Merge pull request #455 from negativeExponent/update

some cleanups
This commit is contained in:
Autechre
2021-06-05 14:45:38 +02:00
committed by GitHub
16 changed files with 127 additions and 174 deletions

View File

@@ -339,6 +339,14 @@ int FCEUI_Initialize(void) {
FSettings.UsrLastSLine[0] = 231;
FSettings.UsrLastSLine[1] = 239;
FSettings.SoundVolume = 100;
FSettings.dendy = 0;
FSettings.swapDuty = 0;
ppu.overclock_enabled = 0;
ppu.skip_7bit_overclocking = 1;
ppu.totalscanlines = 0;
ppu.normal_scanlines = SCANLINES_NORMAL;
ppu.extrascanlines = 0;
ppu.vblankscanlines = 0;
FCEUPPU_Init();
X6502_Init();
return 1;
@@ -379,8 +387,6 @@ void ResetNES(void)
X6502_Reset();
}
int option_ramstate = 0;
void FCEU_MemoryRand(uint8 *ptr, uint32 size)
{
int x = 0;
@@ -395,7 +401,7 @@ void FCEU_MemoryRand(uint8 *ptr, uint32 size)
/* 1942 SCORE/HISCORE is screwed... */
#endif
uint8_t v = 0;
switch (option_ramstate)
switch (FSettings.ramstate)
{
case 0: v = 0xff; break;
case 1: v = 0x00; break;
@@ -464,7 +470,7 @@ void FCEU_ResetVidSys(void)
else if (GameInfo->vidsys == GIV_PAL)
{
w = 1;
dendy = 0;
FSettings.dendy = 0;
}
else
w = FSettings.PAL;
@@ -472,12 +478,12 @@ void FCEU_ResetVidSys(void)
PAL = w ? 1 : 0;
if (PAL)
dendy = 0;
FSettings.dendy = 0;
normal_scanlines = dendy ? 290 : 240;
totalscanlines = normal_scanlines + (overclock_enabled ? extrascanlines : 0);
ppu.normal_scanlines = FSettings.dendy ? SCANLINES_DENDY : SCANLINES_NORMAL;
ppu.totalscanlines = ppu.normal_scanlines + (ppu.overclock_enabled ? ppu.extrascanlines : 0);
FCEUPPU_SetVideoSystem(w || dendy);
FCEUPPU_SetVideoSystem(w || FSettings.dendy);
SetSoundVariables();
}
@@ -515,7 +521,7 @@ void FCEUI_SetRenderedLines(int ntscf, int ntscl, int palf, int pall)
FSettings.UsrLastSLine[0] = ntscl;
FSettings.UsrFirstSLine[1] = palf;
FSettings.UsrLastSLine[1] = pall;
if (PAL || dendy)
if (PAL || FSettings.dendy)
{
FSettings.FirstSLine = FSettings.UsrFirstSLine[1];
FSettings.LastSLine = FSettings.UsrLastSLine[1];
@@ -559,7 +565,7 @@ void FCEUI_SetSnapName(int a)
int32 FCEUI_GetDesiredFPS(void)
{
if (PAL || dendy)
if (PAL || FSettings.dendy)
return(838977920); /* ~50.007 */
else
return(1008307711); /* ~60.1 */