PCE: only latch Y-scroll once per scanline after an offset.

The latching behaviour is correct, but I'm unsure of what the offset value should be.
fixes #771
This commit is contained in:
alyosha-tas 2018-03-20 21:17:57 -04:00
parent 9a9b56c69b
commit f86e00f925
3 changed files with 15 additions and 3 deletions

View File

@ -79,7 +79,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
} }
} }
cpu.Execute(HBlankCycles); cpu.Execute(24);
if (InActiveDisplay) if (InActiveDisplay)
{ {
@ -92,11 +92,16 @@ namespace BizHawk.Emulation.Cores.PCEngine
BackgroundY = Registers[BYR]; BackgroundY = Registers[BYR];
latch_bgy = false; latch_bgy = false;
} }
BackgroundY++; BackgroundY++;
BackgroundY &= 0x01FF; BackgroundY &= 0x01FF;
}
} }
cpu.Execute(HBlankCycles - 24);
if (InActiveDisplay)
{
if (render) RenderScanLine(); if (render) RenderScanLine();
} }

View File

@ -323,6 +323,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
ser.Sync("ScanLine", ref ScanLine); ser.Sync("ScanLine", ref ScanLine);
ser.Sync("BackgroundY", ref BackgroundY); ser.Sync("BackgroundY", ref BackgroundY);
ser.Sync("latch_bgy", ref latch_bgy);
ser.Sync("RCRCounter", ref RCRCounter); ser.Sync("RCRCounter", ref RCRCounter);
ser.Sync("ActiveLine", ref ActiveLine); ser.Sync("ActiveLine", ref ActiveLine);
ser.EndSection(); ser.EndSection();

View File

@ -175,7 +175,7 @@ namespace BizHawk.Emulation.Cores.PCEngine
} }
} }
CPU.Execute(VDC1.HBlankCycles); CPU.Execute(24);
if (InActiveDisplay) if (InActiveDisplay)
{ {
@ -203,10 +203,16 @@ namespace BizHawk.Emulation.Cores.PCEngine
VDC2.BackgroundY++; VDC2.BackgroundY++;
VDC2.BackgroundY &= 0x01FF; VDC2.BackgroundY &= 0x01FF;
} }
}
CPU.Execute(VDC1.HBlankCycles - 24);
if (InActiveDisplay)
{
if (render) RenderScanLine(); if (render) RenderScanLine();
} }
if (ScanLine == VBlankLine && VDC1.VBlankInterruptEnabled) if (ScanLine == VBlankLine && VDC1.VBlankInterruptEnabled)
VDC1.StatusByte |= VDC.StatusVerticalBlanking; VDC1.StatusByte |= VDC.StatusVerticalBlanking;