Atari 2600: Use the RDY flag to halt the CPU instead of a loop in the TIA.

This commit is contained in:
pjgat09 2016-02-13 17:11:07 -05:00
parent 8750b64a12
commit a3ef769407
1 changed files with 8 additions and 12 deletions

View File

@ -395,6 +395,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
{
// Still ignoring cycles...
// Reset the RDY flag when we reach hblank
if (_hsyncCnt <= 0)
{
_core.Cpu.RDY = true;
}
// Assume we're on the left side of the screen for now
var rightSide = false;
@ -850,18 +856,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
}
else if (maskedAddr == 0x02) // WSYNC
{
int count = 0;
while (_hsyncCnt > 0)
{
count++;
Execute(1);
// Add a cycle to the cpu every 3 TIA clocks (corrects timer error in M6532)
if (count % 3 == 0)
{
_core.M6532.Timer.Tick();
}
}
// Halt the CPU until we reach hblank
_core.Cpu.RDY = false;
}
else if (maskedAddr == 0x04) // NUSIZ0
{