Atari 2600: Implemented the reset button
This commit is contained in:
parent
45430c8ca7
commit
10365ef970
|
@ -13,6 +13,8 @@ namespace BizHawk
|
|||
public M6532 m6532;
|
||||
public TIA tia;
|
||||
|
||||
bool resetSignal;
|
||||
|
||||
// The Atari 2600 memory mapper looks something like this...usually
|
||||
|
||||
// N/A Page #
|
||||
|
@ -122,6 +124,13 @@ namespace BizHawk
|
|||
public void FrameAdvance(bool render)
|
||||
{
|
||||
Frame++;
|
||||
if (resetSignal)
|
||||
{
|
||||
//cpu.PC = cpu.ReadWord(MOS6507.ResetVector);
|
||||
m6532.resetOccured = true;
|
||||
//m6532.swchb &= 0xFE;
|
||||
//cpu.FlagI = true;
|
||||
}
|
||||
//cpu.Execute(228);
|
||||
//cpu.Execute(2000);
|
||||
|
||||
|
@ -143,6 +152,7 @@ namespace BizHawk
|
|||
}
|
||||
|
||||
}
|
||||
resetSignal = Controller["Reset"];
|
||||
//clear the framebuffer (hack code)
|
||||
if (render == false) return;
|
||||
/*
|
||||
|
|
|
@ -19,6 +19,10 @@ namespace BizHawk.Emulation.Consoles.Atari
|
|||
|
||||
Atari2600 core;
|
||||
|
||||
public byte swchb = 0x0B;
|
||||
|
||||
public bool resetOccured = false;
|
||||
|
||||
|
||||
public M6532(MOS6507 cpu, byte[] ram, Atari2600 core)
|
||||
{
|
||||
|
@ -79,7 +83,9 @@ namespace BizHawk.Emulation.Consoles.Atari
|
|||
}
|
||||
else if (maskedAddr == 0x02) // SWCHB
|
||||
{
|
||||
return 0x3F;
|
||||
bool temp = resetOccured;
|
||||
resetOccured = false;
|
||||
return (byte)(0x0A | (temp ? 0x00 : 0x01));
|
||||
}
|
||||
else if (maskedAddr == 0x03) // SWBCNT
|
||||
{
|
||||
|
@ -130,6 +136,10 @@ namespace BizHawk.Emulation.Consoles.Atari
|
|||
|
||||
interruptEnabled = ((addr & 0x08) != 0);
|
||||
}
|
||||
else if ((addr & 0x04) == 0 && (maskedAddr & 0x03) == 0x02)
|
||||
{
|
||||
swchb = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("6532 register write: " + maskedAddr.ToString("x"));
|
||||
|
|
Loading…
Reference in New Issue