From f22c9b7abd61bb0dca111e5dea02e2679707184d Mon Sep 17 00:00:00 2001 From: SaxxonPike Date: Sat, 13 Jul 2019 15:25:40 -0500 Subject: [PATCH] C64: CPU reads open bus when !AEC is asserted --- .../Computers/Commodore64/C64.Motherboard.cs | 1 + BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs index 9151154a5a..8e951246dc 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/C64.Motherboard.cs @@ -234,6 +234,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64 Cpu.ReadMemory = Pla.Read; Cpu.WriteMemory = Pla.Write; Cpu.WriteMemoryPort = Cpu_WriteMemoryPort; + Cpu.ReadBus = ReadOpenBus; Pla.PeekBasicRom = BasicRom.Peek; Pla.PeekCartridgeHi = CartPort.PeekHiRom; diff --git a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs index a79632d865..a4343f44fc 100644 --- a/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs +++ b/BizHawk.Emulation.Cores/Computers/Commodore64/MOS/Chip6510.cs @@ -41,6 +41,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS public Func ReadIrq; public Func ReadNmi; public Func ReadRdy; + public Func ReadBus; public Func ReadMemory; public Func ReadPort; public Action WriteMemory; @@ -136,7 +137,7 @@ namespace BizHawk.Emulation.Cores.Computers.Commodore64.MOS case 0x0001: return PortData; default: - return ReadAec() ? ReadMemory(addr) : 0xFF; + return ReadAec() ? ReadMemory(addr) : ReadBus(); } }