Atari 2600: Added support to read UDLR from controller
M6532: Gives controller data to game program TIA: Fixed player reflecting error
This commit is contained in:
parent
8938290e36
commit
b9a791ab30
|
@ -54,7 +54,6 @@ namespace BizHawk
|
||||||
// registers
|
// registers
|
||||||
// else
|
// else
|
||||||
// ROM
|
// ROM
|
||||||
|
|
||||||
public byte ReadMemory(ushort addr)
|
public byte ReadMemory(ushort addr)
|
||||||
{
|
{
|
||||||
ushort maskedAddr = (ushort)(addr & 0x1FFF);
|
ushort maskedAddr = (ushort)(addr & 0x1FFF);
|
||||||
|
@ -112,7 +111,7 @@ namespace BizHawk
|
||||||
// Setup TIA
|
// Setup TIA
|
||||||
tia = new TIA(cpu, frameBuffer);
|
tia = new TIA(cpu, frameBuffer);
|
||||||
// Setup 6532
|
// Setup 6532
|
||||||
m6532 = new M6532(cpu, ram);
|
m6532 = new M6532(cpu, ram, this);
|
||||||
|
|
||||||
//setup the system state here. for instance..
|
//setup the system state here. for instance..
|
||||||
// Read from the reset vector for where to start
|
// Read from the reset vector for where to start
|
||||||
|
@ -161,5 +160,16 @@ namespace BizHawk
|
||||||
//run one frame's worth of cpu cyclees (i.e. do the emulation!)
|
//run one frame's worth of cpu cyclees (i.e. do the emulation!)
|
||||||
//this should generate the framebuffer as it goes.
|
//this should generate the framebuffer as it goes.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public byte ReadControls1()
|
||||||
|
{
|
||||||
|
byte value = 0xFF;
|
||||||
|
|
||||||
|
if (Controller["P1 Up"]) value &= 0xEF;
|
||||||
|
if (Controller["P1 Down"]) value &= 0xDF;
|
||||||
|
if (Controller["P1 Left"]) value &= 0xBF;
|
||||||
|
if (Controller["P1 Right"]) value &= 0x7F;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -13,11 +13,14 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
public int timerStartValue;
|
public int timerStartValue;
|
||||||
public int timerFinishedCycles;
|
public int timerFinishedCycles;
|
||||||
public int timerShift;
|
public int timerShift;
|
||||||
|
Atari2600 core;
|
||||||
|
|
||||||
public M6532(MOS6507 cpu, byte[] ram)
|
|
||||||
|
public M6532(MOS6507 cpu, byte[] ram, Atari2600 core)
|
||||||
{
|
{
|
||||||
Cpu = cpu;
|
Cpu = cpu;
|
||||||
this.ram = ram;
|
this.ram = ram;
|
||||||
|
this.core = core;
|
||||||
|
|
||||||
// Apparently this will break for some games (Solaris and H.E.R.O.). We shall see
|
// Apparently this will break for some games (Solaris and H.E.R.O.). We shall see
|
||||||
timerFinishedCycles = 0;
|
timerFinishedCycles = 0;
|
||||||
|
@ -60,7 +63,8 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
Console.WriteLine("6532 register read: " + maskedAddr.ToString("x"));
|
Console.WriteLine("6532 register read: " + maskedAddr.ToString("x"));
|
||||||
if (maskedAddr == 0x00) // SWCHA
|
if (maskedAddr == 0x00) // SWCHA
|
||||||
{
|
{
|
||||||
return 0xFF;
|
return core.ReadControls1();
|
||||||
|
//return 0xFF;
|
||||||
}
|
}
|
||||||
else if (maskedAddr == 0x01) // SWACNT
|
else if (maskedAddr == 0x01) // SWACNT
|
||||||
{
|
{
|
||||||
|
|
|
@ -408,11 +408,11 @@ namespace BizHawk.Emulation.Consoles.Atari
|
||||||
}
|
}
|
||||||
else if (maskedAddr == 0x0B) // REFP0
|
else if (maskedAddr == 0x0B) // REFP0
|
||||||
{
|
{
|
||||||
player0.reflect = ((value & 0x04) != 0);
|
player0.reflect = ((value & 0x08) != 0);
|
||||||
}
|
}
|
||||||
else if (maskedAddr == 0x0C) // REFP1
|
else if (maskedAddr == 0x0C) // REFP1
|
||||||
{
|
{
|
||||||
player1.reflect = ((value & 0x04) != 0);
|
player1.reflect = ((value & 0x08) != 0);
|
||||||
}
|
}
|
||||||
else if (maskedAddr == 0x0D) // PF0
|
else if (maskedAddr == 0x0D) // PF0
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue