C64: Writing to CPU port writes open bus data to 00/01
This commit is contained in:
parent
f18e7c8833
commit
bd20b355f0
|
@ -38,8 +38,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
public readonly Drive1541 DiskDrive;
|
||||
|
||||
// state
|
||||
//public int address;
|
||||
public int Bus;
|
||||
public bool InputRead;
|
||||
public bool Irq;
|
||||
public bool Nmi;
|
||||
|
@ -79,9 +77,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
Pla = new Chip90611401();
|
||||
Ram = new Chip4864();
|
||||
Serial = new SerialPort();
|
||||
|
||||
Cpu.DebuggerStep = Execute;
|
||||
DiskDrive.DebuggerStep = Execute;
|
||||
|
||||
switch (sidType)
|
||||
{
|
||||
|
@ -149,6 +144,11 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
BasicRom = new Chip23128();
|
||||
CharRom = new Chip23128();
|
||||
KernalRom = new Chip23128();
|
||||
|
||||
if (Cpu != null)
|
||||
Cpu.DebuggerStep = Execute;
|
||||
if (DiskDrive != null)
|
||||
DiskDrive.DebuggerStep = Execute;
|
||||
}
|
||||
|
||||
public int ClockNumerator { get; }
|
||||
|
@ -178,7 +178,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
// -----------------------------------------
|
||||
public void HardReset()
|
||||
{
|
||||
Bus = 0xFF;
|
||||
_lastReadVicAddress = 0x3FFF;
|
||||
_lastReadVicData = 0xFF;
|
||||
InputRead = false;
|
||||
|
||||
Cia0.HardReset();
|
||||
|
@ -198,7 +199,8 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
public void SoftReset()
|
||||
{
|
||||
// equivalent to a hard reset EXCEPT cpu, color ram, memory
|
||||
Bus = 0xFF;
|
||||
_lastReadVicAddress = 0x3FFF;
|
||||
_lastReadVicData = 0xFF;
|
||||
InputRead = false;
|
||||
|
||||
Cia0.HardReset();
|
||||
|
@ -365,7 +367,6 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
ser.EndSection();
|
||||
}
|
||||
|
||||
ser.Sync(nameof(Bus), ref Bus);
|
||||
ser.Sync(nameof(InputRead), ref InputRead);
|
||||
ser.Sync(nameof(Irq), ref Irq);
|
||||
ser.Sync(nameof(Nmi), ref Nmi);
|
||||
|
|
|
@ -43,9 +43,9 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
return data;
|
||||
}
|
||||
|
||||
private void Cpu_WriteMemoryPort(int addr, int val)
|
||||
private void Cpu_WriteMemoryPort(int addr)
|
||||
{
|
||||
Pla.WriteMemory(addr, Bus);
|
||||
Pla.WriteMemory(addr, ReadOpenBus());
|
||||
}
|
||||
|
||||
private bool Glue_ReadIRQ()
|
||||
|
@ -84,7 +84,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64
|
|||
|
||||
private int Pla_ReadColorRam(int addr)
|
||||
{
|
||||
var result = Bus;
|
||||
var result = ReadOpenBus();
|
||||
result &= 0xF0;
|
||||
result |= ColorRam.Read(addr);
|
||||
return result;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
public Func<int, int> ReadMemory;
|
||||
public Func<int> ReadPort;
|
||||
public Action<int, int> WriteMemory;
|
||||
public Action<int, int> WriteMemoryPort;
|
||||
public Action<int> WriteMemoryPort;
|
||||
|
||||
public Action DebuggerStep;
|
||||
|
||||
|
@ -161,11 +161,11 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS
|
|||
{
|
||||
case 0x0000:
|
||||
_port.Direction = val;
|
||||
WriteMemoryPort(addr, val);
|
||||
WriteMemoryPort(addr);
|
||||
break;
|
||||
case 0x0001:
|
||||
_port.Latch = val;
|
||||
WriteMemoryPort(addr, val);
|
||||
WriteMemoryPort(addr);
|
||||
break;
|
||||
default:
|
||||
if (ReadAec())
|
||||
|
|
Loading…
Reference in New Issue