A2600: audio bug fix (Space Jockey)

This commit is contained in:
alyosha-tas 2019-11-03 20:21:25 -05:00
parent 6eb44acd4f
commit 2750a420ef
5 changed files with 48 additions and 17 deletions

View File

@ -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

View File

@ -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)
{

View File

@ -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;
}
}

View File

@ -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);

View File

@ -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;
}
}