From 48dcf8fc911510278c720f9968eb5d87477111b3 Mon Sep 17 00:00:00 2001 From: alyosha-tas Date: Sat, 9 Apr 2016 12:57:32 -0400 Subject: [PATCH] PRG delays due to HMOVE --- .../Consoles/Atari/2600/Tia/TIA.cs | 102 +++++++++--------- 1 file changed, 54 insertions(+), 48 deletions(-) diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index be1d67bf18..f80fa4a547 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -1178,56 +1178,62 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } else if (maskedAddr == 0x10) // RESP0 { - // Borrowed from EMU7800. Apparently resetting between 68 and 76 has strange results. - if (_hsyncCnt < 69) - { - _player0.HPosCnt = 0; - _player0.ResetCnt = 2; - _player0.Reset = true; - } - else if (_hsyncCnt == 69) - { - _player0.ResetCnt = 0; - } - else if (_hsyncCnt == 72) - { - _player0.ResetCnt = 0; - } - else if (_hsyncCnt == 75) - { - _player0.ResetCnt = 0; - } - else - { - _player0.ResetCnt = 0; - } - } + // Resp depends on HMOVE + if (!_hmove.LateHBlankReset) + { + if (_hsyncCnt < 69) + { + _player0.HPosCnt = 0; + _player0.ResetCnt = 2; + _player0.Reset = true; + } + else + { + _player0.ResetCnt = 0; + } + } + else + { + if (_hsyncCnt < 76) + { + _player0.HPosCnt = 0; + _player0.ResetCnt = 1; + _player0.Reset = true; + } + else + { + _player0.ResetCnt = 0; + } + } + } else if (maskedAddr == 0x11) // RESP1 { - // Borrowed from EMU7800. Apparently resetting between 68 and 76 has strange results. - // This fixes some graphic glitches with Frostbite - if (_hsyncCnt < 69) - { - _player1.HPosCnt = 0; - _player1.ResetCnt = 2; - _player1.Reset = true; - } - else if (_hsyncCnt == 69) - { - _player1.ResetCnt = 0; - } - else if (_hsyncCnt == 72) - { - _player1.ResetCnt = 0; - } - else if (_hsyncCnt == 75) - { - _player1.ResetCnt = 0; - } - else - { - _player1.ResetCnt = 0; - } + // RESP depends on HMOVE + if (!_hmove.LateHBlankReset) + { + if (_hsyncCnt < 69) + { + _player1.HPosCnt = 0; + _player1.ResetCnt = 2; + _player1.Reset = true; + } else + { + _player1.ResetCnt = 0; + } + } else + { + if (_hsyncCnt < 76) + { + _player1.HPosCnt = 0; + _player1.ResetCnt = 1; + _player1.Reset = true; + } + else + { + _player1.ResetCnt = 0; + } + } + } else if (maskedAddr == 0x12) // RESM0 {