A2600: Add HMCLR delay

This commit is contained in:
alyosha-tas 2019-07-13 18:33:54 -04:00
parent 66cf00a917
commit 7df8ed1f27
2 changed files with 23 additions and 6 deletions

View File

@ -104,6 +104,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
private int _hmbDelay;
private byte _hmbVal;
private int _hmClrDelay;
private int _prg0Delay;
private int _prg1Delay;
private byte _prg0Val;
@ -387,6 +389,21 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
}
}
if (_hmClrDelay > 0)
{
_hmClrDelay++;
if (_hmClrDelay == 5)
{
_hmClrDelay = 0;
_player0.HM = 0;
_player0.Missile.Hm = 0;
_player1.HM = 0;
_player1.Missile.Hm = 0;
_ball.HM = 0;
}
}
// Reset the RDY flag when we reach hblank
if (_hsyncCnt <= 0)
{
@ -799,7 +816,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
_hmove.BallLatch = true;
_hmove.BallCnt = 0;
_hmove.LateHBlankReset = true;
if (_hsyncCnt < 67) { _hmove.LateHBlankReset = true; }
}
}
@ -1357,11 +1374,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
}
else if (maskedAddr == 0x2B) // HMCLR
{
_player0.HM = 0;
_player0.Missile.Hm = 0;
_player1.HM = 0;
_player1.Missile.Hm = 0;
_ball.HM = 0;
_hmClrDelay = 1;
}
else if (maskedAddr == 0x2C) // CXCLR
{

View File

@ -51,6 +51,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
ser.Sync("hmb_delay", ref _hmbDelay);
ser.Sync("hmb_val", ref _hmbVal);
ser.Sync("_hmClrDelay", ref _hmClrDelay);
ser.Sync("PRG0_delay", ref _prg0Delay);
ser.Sync("PRG1_delay", ref _prg1Delay);
ser.Sync("PRG0_val", ref _prg0Val);