-lets use the video patching of r239 again, hopefully it works

yet again
This commit is contained in:
fix94.1 2012-06-15 14:27:18 +00:00
parent 4dc425d650
commit c088fd969b
3 changed files with 79 additions and 40 deletions

View File

@ -38,7 +38,6 @@ static u8 *diskid = (u8 *)0x80000000;
GXRModeObj *vmode = NULL; GXRModeObj *vmode = NULL;
u32 vmode_reg = 0; u32 vmode_reg = 0;
u8 vidmode_selected = 0;
extern void __exception_closeall(); extern void __exception_closeall();
@ -66,56 +65,93 @@ void __Disc_SetLowMem()
memcpy((void *)Online_Check, (void *)Disc_ID, 4); memcpy((void *)Online_Check, (void *)Disc_ID, 4);
} }
GXRModeObj *__Disc_SelectVMode(u8 videoselected, u64 chantitle) GXRModeObj * __Disc_SelectVMode(u8 videoselected, u64 chantitle)
{ {
vmode = VIDEO_GetPreferredMode(NULL); vmode = VIDEO_GetPreferredMode(0);
/* Get video mode configuration */ /* Get video mode configuration */
bool progressive = (CONF_GetProgressiveScan() > 0) && VIDEO_HaveComponentCable(); bool progressive = (CONF_GetProgressiveScan() > 0) && VIDEO_HaveComponentCable();
char Region; /* Select video mode register */
if(chantitle != 0) switch (CONF_GetVideo())
Region = ((u32)(chantitle) & 0xFFFFFFFF) % 256;
else
Region = diskid[3];
/* Select video mode */
switch(Region)
{ {
case 'W': case CONF_VIDEO_PAL:
break; // Don't overwrite wiiware video modes. if (CONF_GetEuRGB60() > 0)
// PAL {
case 'D': vmode_reg = VI_EURGB60;
case 'F': vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf;
case 'P': }
case 'X': else
case 'Y': vmode_reg = VI_PAL;
vmode_reg = VI_PAL;
if(CONF_GetVideo() != CONF_VIDEO_PAL)
vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
break; break;
// NTSC
case 'E': case CONF_VIDEO_MPAL:
case 'J': vmode_reg = VI_MPAL;
break;
case CONF_VIDEO_NTSC:
vmode_reg = VI_NTSC; vmode_reg = VI_NTSC;
if(CONF_GetVideo() != CONF_VIDEO_NTSC)
vmode = progressive ? &TVNtsc480Prog : &TVPal528IntDf;
break;
default:
break; break;
} }
if(videoselected) char Region;
if(chantitle != 0)
Region = ((u32)(chantitle) & 0xFFFFFFFF) % 256;
else Region = diskid[3];
switch (videoselected)
{ {
if(videoselected == 1) //PAL50 case 0: // DEFAULT (DISC/GAME)
vmode = &TVPal528IntDf; /* Select video mode */
else if(videoselected == 2) //PAL60 switch (Region)
vmode = &TVEurgb60Hz480IntDf; {
else if(videoselected == 3) //NTSC case 'W':
vmode = &TVNtsc480IntDf; break; // Don't overwrite wiiware video modes.
else // PAL
case 'D':
case 'F':
case 'P':
case 'X':
case 'Y':
if (CONF_GetVideo() != CONF_VIDEO_PAL)
{
vmode_reg = VI_PAL;
vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
}
break;
// NTSC
case 'E':
case 'J':
default:
if (CONF_GetVideo() != CONF_VIDEO_NTSC)
{
vmode_reg = VI_NTSC;
vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf;
}
break;
}
break;
case 1: // PAL50
vmode = &TVPal528IntDf;
vmode_reg = vmode->viTVMode >> 2;
break;
case 2: // PAL60
vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf;
vmode_reg = progressive ? TVEurgb60Hz480Prog.viTVMode >> 2 : vmode->viTVMode >> 2;
break;
case 3: // NTSC
vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
vmode_reg = vmode->viTVMode >> 2;
break;
case 4: // AUTO PATCH TO SYSTEM
case 5: // SYSTEM
break;
case 6: // PROGRESSIVE 480P(NTSC + PATCH ALL)
vmode = &TVNtsc480Prog; vmode = &TVNtsc480Prog;
vmode_reg = vmode->viTVMode >> 2; vmode_reg = vmode->viTVMode >> 2;
break;
default:
break;
} }
return vmode; return vmode;
@ -131,12 +167,14 @@ void __Disc_SetVMode(void)
if(vmode != 0) if(vmode != 0)
VIDEO_Configure(vmode); VIDEO_Configure(vmode);
/* Setup video */ /* Setup video */
VIDEO_SetBlack(TRUE); VIDEO_SetBlack(TRUE);
VIDEO_Flush(); VIDEO_Flush();
VIDEO_WaitVSync(); VIDEO_WaitVSync();
if(vmode->viTVMode & VI_NON_INTERLACE) if(vmode->viTVMode & VI_NON_INTERLACE)
VIDEO_WaitVSync(); VIDEO_WaitVSync();
else while(VIDEO_GetNextField())
VIDEO_WaitVSync();
} }
void __Disc_SetTime(void) void __Disc_SetTime(void)

View File

@ -245,7 +245,7 @@ static GXRModeObj* NTSC2PAL60[]={
&TVNtsc240IntAa, &TVEurgb60Hz240IntAa, &TVNtsc240IntAa, &TVEurgb60Hz240IntAa,
&TVNtsc480IntDf, &TVEurgb60Hz480IntDf, &TVNtsc480IntDf, &TVEurgb60Hz480IntDf,
&TVNtsc480IntAa, &TVEurgb60Hz480IntAa, &TVNtsc480IntAa, &TVEurgb60Hz480IntAa,
&TVNtsc480Prog, &TVNtsc480Prog, &TVNtsc480Prog, &TVEurgb60Hz480Prog,
0,0 0,0
}; };

View File

@ -5,4 +5,5 @@
void patchVideoModes(void *dst, u32 len, int vidMode, GXRModeObj *vmode, int patchVidModes); void patchVideoModes(void *dst, u32 len, int vidMode, GXRModeObj *vmode, int patchVidModes);
#endif // !defined(_VIDEOPATCH_H_) #endif // !defined(_VIDEOPATCH_H_)