Updates and Bug Fixes
Sets stack pointer to FD on initialization (see visual 6502) Adds portA write state to 6532
This commit is contained in:
parent
24b0ebb924
commit
d0c7d81de5
|
@ -323,6 +323,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
Rom.HashSHA1(),
|
||||
Rom.HashMD5(),
|
||||
_mapper.GetType());
|
||||
|
||||
|
||||
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
|
||||
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
|
||||
// executing a reset sequence at power on, but it's needed so let's hard code it for now
|
||||
Cpu.S = 0xFD;
|
||||
}
|
||||
|
||||
private bool _pal;
|
||||
|
@ -345,7 +351,12 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
|
||||
M6532 = new M6532(this);
|
||||
Cpu.PC = (ushort)(ReadMemory(0x1FFC) + (ReadMemory(0x1FFD) << 8)); // set the initial PC
|
||||
}
|
||||
|
||||
// as it turns out, the stack pointer cannot be set to 0 for some games as they do not initilize it themselves.
|
||||
// some documentation seems to indicate it should beset to FD, but currently there is no documentation of the 6532
|
||||
// executing a reset sequence at power on, but it's needed so let's hard code it for now
|
||||
Cpu.S = 0xFD;
|
||||
}
|
||||
|
||||
public void FrameAdvance(bool render, bool rendersound)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
|
||||
public byte DDRa = 0x00;
|
||||
public byte DDRb = 0x00;
|
||||
public byte outputA = 0x00;
|
||||
|
||||
public TimerData Timer;
|
||||
|
||||
|
@ -35,9 +36,13 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
{
|
||||
// Read Output reg A
|
||||
// Combine readings from player 1 and player 2
|
||||
var temp = (byte)(_core.ReadControls1(peek) & 0xF0 | ((_core.ReadControls2(peek) >> 4) & 0x0F));
|
||||
temp = (byte)(temp & ~DDRa);
|
||||
return temp;
|
||||
// actually depends on setting in SWCHCNTA (aka DDRa)
|
||||
|
||||
var temp = (byte)(_core.ReadControls1(peek) & 0xF0 | ((_core.ReadControls2(peek) >> 4) & 0x0F));
|
||||
temp = (byte)(temp & ~DDRa);
|
||||
temp = (byte)(temp + (outputA & DDRa));
|
||||
return temp;
|
||||
|
||||
}
|
||||
|
||||
if (registerAddr == 0x01)
|
||||
|
@ -150,7 +155,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
|
||||
if (registerAddr == 0x00)
|
||||
{
|
||||
// Write Output reg A
|
||||
// Write Output reg A
|
||||
outputA = value;
|
||||
}
|
||||
else if (registerAddr == 0x01)
|
||||
{
|
||||
|
@ -159,7 +165,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
}
|
||||
else if (registerAddr == 0x02)
|
||||
{
|
||||
// Write Output reg B
|
||||
// Write Output reg B
|
||||
// But is read only
|
||||
}
|
||||
else if (registerAddr == 0x03)
|
||||
{
|
||||
|
@ -175,7 +182,8 @@ namespace BizHawk.Emulation.Cores.Atari.Atari2600
|
|||
ser.BeginSection("M6532");
|
||||
ser.Sync("ddra", ref DDRa);
|
||||
ser.Sync("ddrb", ref DDRb);
|
||||
Timer.SyncState(ser);
|
||||
ser.Sync("OutputA", ref outputA);
|
||||
Timer.SyncState(ser);
|
||||
ser.EndSection();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue