Skip to content

Commit

Permalink
force widescreen and deflicker off when melee wide
Browse files Browse the repository at this point in the history
previously the logic to make the display full width was not working when video mode was set to auto, this forces the video force logic a bit more and also forces deflicker off when using one of the widescreen melee codes
  • Loading branch information
JLaferri committed Dec 22, 2021
1 parent dc277ac commit 04444fe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions kernel/Patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset )
// Load melee code config
const MeleeCodeConfig *codeConfig = GetMeleeCodeConfig();
u32 screenValue = ConfigGetMeleeCodeValue(codeConfig->items[MELEE_CODES_SCREEN_OPTION_ID]->identifier);
u8 isMeleeWidescreen = screenValue == MELEE_CODES_WIDE_VALUE || screenValue == MELEE_CODES_WIDE_SHUTTERS_VALUE;

// PSO 1&2 / III
u32 isPSO = 0;
Expand Down Expand Up @@ -1687,7 +1688,8 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset )
u32 videoPatches = 0;
if( ConfigGetConfig(NIN_CFG_FORCE_PROG) || (ConfigGetVideoMode() & NIN_VID_FORCE) ||
(ConfigGetVideoOffset() != 0 && ConfigGetVideoOffset() >= -20 && ConfigGetVideoOffset() <= 20) ||
(ConfigGetVideoScale() != 0 && ConfigGetVideoScale() >= 40 && ConfigGetVideoScale() <= 120) )
(ConfigGetVideoScale() != 0 && ConfigGetVideoScale() >= 40 && ConfigGetVideoScale() <= 120) ||
isMeleeWidescreen )
{
PatchCount &= ~(FPATCH_VideoModes | FPATCH_VIConfigure | FPATCH_getTiming);
videoPatches = 1;
Expand Down Expand Up @@ -2176,7 +2178,7 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset )
break;
}
}
else if( ConfigGetVideoMode() & NIN_VID_FORCE )
else if( ConfigGetVideoMode() & NIN_VID_FORCE || isMeleeWidescreen )
{
u8 NinForceMode = ConfigGetVideoMode() & NIN_VID_FORCE_MASK;
switch(read32((u32)Buffer+i))
Expand Down Expand Up @@ -2248,8 +2250,10 @@ void DoPatches( char *Buffer, u32 Length, u32 DiscOffset )
}
}
s8 videoScale = ConfigGetVideoScale();
if (screenValue == MELEE_CODES_WIDE_VALUE || screenValue == MELEE_CODES_WIDE_SHUTTERS_VALUE) {
if (isMeleeWidescreen) {
// Force video to be full width and force deflicker off
videoScale = 120;
memcpy(Buffer+i+0x32, GXDeflickerOff, sizeof(GXDeflickerOff));
}

if(videoScale >= 40 && videoScale <= 120)
Expand Down

0 comments on commit 04444fe

Please sign in to comment.