PAL <> NTSC timing corrections

This commit is contained in:
dborth 2010-04-12 21:15:11 +00:00
parent a1fe3af450
commit 2421a712dc
5 changed files with 20 additions and 13 deletions

View File

@ -368,7 +368,7 @@ int main(int argc, char *argv[])
else
MainMenu(MENU_GAME);
if(currentTiming != GCSettings.timing)
if(currentTiming != GCSettings.timing && GCSettings.timing != 2)
FCEUI_SetVidSystem(GCSettings.timing); // causes a small 'pop' in the audio
currentTiming = GCSettings.timing;

View File

@ -50,7 +50,7 @@ int GCMemROM(int size)
GameInfo->soundrate = SAMPLERATE;
GameInfo->name=0;
GameInfo->type=GIT_CART;
GameInfo->vidsys=GIV_USER;
GameInfo->vidsys=(EGIV)GCSettings.timing;
GameInfo->input[0]=GameInfo->input[1]=SI_UNSET;
GameInfo->inputfc=SIFC_UNSET;
GameInfo->cspecial=SIS_NONE;

View File

@ -203,7 +203,7 @@ static u32 normaldiff;
void setFrameTimer()
{
if (GCSettings.timing == 1) // PAL
if (FCEUI_GetCurrentVidSystem(NULL, NULL) == 1) // PAL
normaldiff = 20000; // 50hz
else
normaldiff = 16667; // 60hz
@ -212,16 +212,14 @@ void setFrameTimer()
void SyncSpeed()
{
if(GCSettings.timing != vmode_60hz)
return; // same timing as game - no adjustment necessary
now = gettime();
u32 diff = diff_usec(prev, now);
if(turbomode)
{
// do nothing
}
else if (diff_usec(prev, now) > normaldiff)
else if (diff > normaldiff)
{
frameskip++;
}
@ -609,7 +607,7 @@ ResetVideo_Emu ()
// change current VI mode if using original render mode
if (GCSettings.render == 0)
rmode = tvmodes[GCSettings.timing];
rmode = tvmodes[FCEUI_GetCurrentVidSystem(NULL, NULL)];
else
rmode = FindVideoMode();

View File

@ -3051,7 +3051,9 @@ static int MenuSettingsVideo()
break;
case 5: // timing
GCSettings.timing ^= 1;
GCSettings.timing++;
if(GCSettings.timing > 2)
GCSettings.timing = 0;
break;
case 6:
@ -3110,7 +3112,13 @@ static int MenuSettingsVideo()
sprintf (options.value[4], "%s",
GCSettings.currpal ? palettes[GCSettings.currpal-1].desc : "Default");
sprintf (options.value[5], "%s", GCSettings.timing == 1 ? "PAL" : "NTSC");
switch(GCSettings.timing)
{
case 0: sprintf (options.value[5], "NTSC"); break;
case 1: sprintf (options.value[5], "PAL"); break;
case 2: sprintf (options.value[5], "Automatic"); break;
}
sprintf (options.value[6], "%.2f%%, %.2f%%", GCSettings.zoomHor*100, GCSettings.zoomVert*100);
sprintf (options.value[7], "%d, %d", GCSettings.xshift, GCSettings.yshift);
sprintf (options.value[8], "%s", GCSettings.crosshair == 1 ? "On" : "Off");
@ -3133,6 +3141,7 @@ static int MenuSettingsVideo()
}
if(backBtn.GetState() == STATE_CLICKED)
{
menu = MENU_GAMESETTINGS;
}

View File

@ -380,8 +380,8 @@ void FixInvalidSettings()
GCSettings.Controller = CTRL_PAD2;
if(!(GCSettings.render >= 0 && GCSettings.render < 3))
GCSettings.render = 2;
if(GCSettings.timing != 0 && GCSettings.timing != 1)
GCSettings.timing = 0;
if(GCSettings.timing < 0 || GCSettings.timing > 2)
GCSettings.timing = 2;
if(!(GCSettings.videomode >= 0 && GCSettings.videomode < 5))
GCSettings.videomode = 0;
}
@ -398,7 +398,7 @@ DefaultSettings ()
ResetControls(); // controller button mappings
GCSettings.currpal = 1; // color palette
GCSettings.timing = 0; // 0 - NTSC, 1 - PAL
GCSettings.timing = 2; // 0 - NTSC, 1 - PAL, 2 - Automatic
GCSettings.videomode = 0; // automatic video mode detection
GCSettings.Controller = CTRL_PAD2; // NES pad, Four Score, Zapper
GCSettings.crosshair = 1; // show zapper crosshair