diff --git a/Assets/gamedb/gamedb_a2600.txt b/Assets/gamedb/gamedb_a2600.txt index 95587d31ee..ba9afa2182 100644 --- a/Assets/gamedb/gamedb_a2600.txt +++ b/Assets/gamedb/gamedb_a2600.txt @@ -2701,3 +2701,4 @@ sha1:F28E52921646A18467577370808454F494C15EFE 0840 EconoBanking A26 m=0840;NTS sha1:2A9647E27AB27E6CF82B3BF122EDF212FA34AE86 Halo2600 Final A26 m=m4K sha1:341BB93E67C21063F3910845D1AF59FEA129FF21 Bang! A26 m=F4SC sha1:62E7A3CE40BE1C29870D892639FBD394977281F5 DHmoveValues(rev2) A26 m=F6SC +sha1:FBB0FE0A859BF764D060E264561734B8F7CFC9D7 REF A26 m=4K;NTSC=true diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs index cfa7bc84b8..ee22dc7599 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/TIA.cs @@ -77,6 +77,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 private byte _pf1MaxDelay; private byte _pf2MaxDelay; + private int _ctrlPFDelay; + private byte _ctrlPFVal; + private int _enam0Delay; private int _enam1Delay; private int _enambDelay; @@ -264,6 +267,21 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } } + if (_ctrlPFDelay > 0) + { + _ctrlPFDelay++; + if (_ctrlPFDelay == 2) + { + _playField.Reflect = (_ctrlPFVal & 0x01) != 0; + _playField.Score = (_ctrlPFVal & 0x02) != 0; + _playField.Priority = (_ctrlPFVal & 0x04) != 0; + + _ball.Size = (byte)((_ctrlPFVal & 0x30) >> 4); + + _ctrlPFDelay = 0; + } + } + if (_pf0Updater) { _pf0DelayClock++; @@ -1116,11 +1134,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } else if (maskedAddr == 0x0A) // CTRLPF { - _playField.Reflect = (value & 0x01) != 0; - _playField.Score = (value & 0x02) != 0; - _playField.Priority = (value & 0x04) != 0; - - _ball.Size = (byte)((value & 0x30) >> 4); + _ctrlPFDelay = 1; + _ctrlPFVal = value; } else if (maskedAddr == 0x0B) // REFP0 { @@ -1254,7 +1269,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 else if (maskedAddr == 0x12) // RESM0 { // RESP delays draw signal clocking - _player0.Missile.Resp_check(); + // but only for players? Needs investigation + //_player0.Missile.Resp_check(); if (!_hmove.LateHBlankReset) { @@ -1276,7 +1292,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 else if (maskedAddr == 0x13) // RESM1 { // RESP delays draw signal clocking - _player1.Missile.Resp_check(); + // but only for players? Needs investigation + //_player1.Missile.Resp_check(); if (!_hmove.LateHBlankReset) { @@ -1297,7 +1314,9 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 } else if (maskedAddr == 0x14) // RESBL { - _ball.Resp_check(); + // RESP delays draw signal clocking + // but only for players? Needs investigation + //_ball.Resp_check(); if (!_hmove.LateHBlankReset) { diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs index fa95102db1..6b9080fb47 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.Audio.cs @@ -192,11 +192,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 break; case 0x0f: - if (Run3_L()) + // poly5 output to div 6 + if (Run5_L()) { - goto case 0x07; + if (Run3_L()) + { + on_L = Run1_L(); + } } - break; } } @@ -349,11 +352,14 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 break; case 0x0f: - if (Run3_R()) + // poly5 output to div 6 + if (Run5_R()) { - goto case 0x07; + if (Run3_R()) + { + on_R = Run1_R(); + } } - break; } } diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs index deb62d3a7b..9c8c4ca6aa 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/2600/Tia/Tia.SyncState.cs @@ -14,6 +14,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600 // add everything to the state ser.Sync("Bus_State", ref BusState); + ser.Sync("_ctrlPFDelay", ref _ctrlPFDelay); + ser.Sync("_ctrlPFVal", ref _ctrlPFVal); ser.Sync("PF0_up", ref _pf0Update); ser.Sync("PF1_up", ref _pf1Update); ser.Sync("PF2_up", ref _pf2Update); diff --git a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.Audio.cs b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.Audio.cs index 1bda5b3521..0ee9b95f99 100644 --- a/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.Audio.cs +++ b/BizHawk.Emulation.Cores/Consoles/Atari/A7800Hawk/TIA_Sound/Tia.Audio.cs @@ -182,11 +182,14 @@ namespace BizHawk.Emulation.Cores.Atari.A7800Hawk break; case 0x0f: - if (Run3()) + // poly5 output to div 6 + if (Run5()) { - goto case 0x07; + if (Run3()) + { + on = Run1(); + } } - break; } }