-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();
@ -68,17 +67,41 @@ void __Disc_SetLowMem()
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();
/* Select video mode register */
switch (CONF_GetVideo())
{
case CONF_VIDEO_PAL:
if (CONF_GetEuRGB60() > 0)
{
vmode_reg = VI_EURGB60;
vmode = progressive ? &TVNtsc480Prog : &TVEurgb60Hz480IntDf;
}
else
vmode_reg = VI_PAL;
break;
case CONF_VIDEO_MPAL:
vmode_reg = VI_MPAL;
break;
case CONF_VIDEO_NTSC:
vmode_reg = VI_NTSC;
break;
}
char Region; char Region;
if(chantitle != 0) if(chantitle != 0)
Region = ((u32)(chantitle) & 0xFFFFFFFF) % 256; Region = ((u32)(chantitle) & 0xFFFFFFFF) % 256;
else else Region = diskid[3];
Region = diskid[3];
switch (videoselected)
{
case 0: // DEFAULT (DISC/GAME)
/* Select video mode */ /* Select video mode */
switch (Region) switch (Region)
{ {
@ -90,34 +113,47 @@ GXRModeObj *__Disc_SelectVMode(u8 videoselected, u64 chantitle)
case 'P': case 'P':
case 'X': case 'X':
case 'Y': case 'Y':
vmode_reg = VI_PAL;
if (CONF_GetVideo() != CONF_VIDEO_PAL) if (CONF_GetVideo() != CONF_VIDEO_PAL)
{
vmode_reg = VI_PAL;
vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf; vmode = progressive ? &TVNtsc480Prog : &TVNtsc480IntDf;
}
break; break;
// NTSC // NTSC
case 'E': case 'E':
case 'J': case 'J':
vmode_reg = VI_NTSC; default:
if (CONF_GetVideo() != CONF_VIDEO_NTSC) if (CONF_GetVideo() != CONF_VIDEO_NTSC)
vmode = progressive ? &TVNtsc480Prog : &TVPal528IntDf; {
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_reg = vmode->viTVMode >> 2;
break; break;
default: default:
break; break;
} }
if(videoselected)
{
if(videoselected == 1) //PAL50
vmode = &TVPal528IntDf;
else if(videoselected == 2) //PAL60
vmode = &TVEurgb60Hz480IntDf;
else if(videoselected == 3) //NTSC
vmode = &TVNtsc480IntDf;
else
vmode = &TVNtsc480Prog;
vmode_reg = vmode->viTVMode >> 2;
}
return vmode; return vmode;
} }
@ -137,6 +173,8 @@ void __Disc_SetVMode(void)
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_)