From 2d2e0c7e311a8ce768d2141d73a235d9aaddd992 Mon Sep 17 00:00:00 2001 From: pjgat09 Date: Wed, 31 Oct 2012 23:42:18 +0000 Subject: [PATCH] A2600: Resetting players before hsyncCnt 76 has apparently has strange results. I borrowed these changes from EMU7800. This seems to fix glitches with Frostbite. --- BizHawk.Emulation/Consoles/Atari/2600/TIA.cs | 51 +++++++++++++++++++- 1 file changed, 49 insertions(+), 2 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Atari/2600/TIA.cs b/BizHawk.Emulation/Consoles/Atari/2600/TIA.cs index eda9815ee6..38a479ce36 100644 --- a/BizHawk.Emulation/Consoles/Atari/2600/TIA.cs +++ b/BizHawk.Emulation/Consoles/Atari/2600/TIA.cs @@ -1169,11 +1169,58 @@ namespace BizHawk.Emulation.Consoles.Atari } else if (maskedAddr == 0x10) // RESP0 { - player0.resetCnt = 0; + // Borrowed from EMU7800. Apparently resetting between 68 and 76 has strange results. + if (hsyncCnt < 69) + { + player0.hPosCnt = 0; + player0.resetCnt = 0; + player0.reset = true; + } + else if (hsyncCnt == 69) + { + player0.resetCnt = 3; + } + else if (hsyncCnt == 72) + { + player0.resetCnt = 2; + } + else if (hsyncCnt == 75) + { + player0.resetCnt = 1; + } + else + { + player0.resetCnt = 0; + } + //player0.resetCnt = 0; } else if (maskedAddr == 0x11) // RESP1 { - player1.resetCnt = 0; + // 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 = 0; + player1.reset = true; + } + else if (hsyncCnt == 69) + { + player1.resetCnt = 3; + } + else if (hsyncCnt == 72) + { + player1.resetCnt = 2; + } + else if (hsyncCnt == 75) + { + player1.resetCnt = 1; + } + else + { + player1.resetCnt = 0; + } + //player1.resetCnt = 0; } else if (maskedAddr == 0x12) // RESM0 {