From d7928377f2feca8a3d9ca7cc8688400768eef5df Mon Sep 17 00:00:00 2001 From: adelikat Date: Mon, 8 May 2017 11:31:00 -0500 Subject: [PATCH] ColecoVision merge MemoryMap.cs into ColecoVision.cs --- .../BizHawk.Emulation.Cores.csproj | 1 - .../Consoles/Coleco/ColecoVision.cs | 32 ++++++++++++++++ .../Consoles/Coleco/MemoryMap.cs | 37 ------------------- 3 files changed, 32 insertions(+), 38 deletions(-) delete mode 100644 BizHawk.Emulation.Cores/Consoles/Coleco/MemoryMap.cs diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index b9fecadc73..8469b45cf4 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -416,7 +416,6 @@ ColecoVision.cs - diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs index 0f1fc55057..57f39c227c 100644 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs +++ b/BizHawk.Emulation.Cores/Consoles/Coleco/ColecoVision.cs @@ -197,5 +197,37 @@ namespace BizHawk.Emulation.Cores.ColecoVision } private int frame; + + public byte ReadMemory(ushort addr) + { + if (addr >= 0x8000) + { + return RomData[addr & 0x7FFF]; + } + + if (addr >= 0x6000) + { + return Ram[addr & 1023]; + } + + if (addr < 0x2000) + { + return BiosRom[addr]; + } + + //Console.WriteLine("Unhandled read at {0:X4}", addr); + return 0xFF; + } + + public void WriteMemory(ushort addr, byte value) + { + if (addr >= 0x6000 && addr < 0x8000) + { + Ram[addr & 1023] = value; + return; + } + + //Console.WriteLine("Unhandled write at {0:X4}:{1:X2}", addr, value); + } } } \ No newline at end of file diff --git a/BizHawk.Emulation.Cores/Consoles/Coleco/MemoryMap.cs b/BizHawk.Emulation.Cores/Consoles/Coleco/MemoryMap.cs deleted file mode 100644 index 43d418d52c..0000000000 --- a/BizHawk.Emulation.Cores/Consoles/Coleco/MemoryMap.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace BizHawk.Emulation.Cores.ColecoVision -{ - public partial class ColecoVision - { - public byte ReadMemory(ushort addr) - { - if (addr >= 0x8000) - { - return RomData[addr & 0x7FFF]; - } - - if (addr >= 0x6000) - { - return Ram[addr & 1023]; - } - - if (addr < 0x2000) - { - return BiosRom[addr]; - } - - //Console.WriteLine("Unhandled read at {0:X4}", addr); - return 0xFF; - } - - public void WriteMemory(ushort addr, byte value) - { - if (addr >= 0x6000 && addr < 0x8000) - { - Ram[addr & 1023] = value; - return; - } - - //Console.WriteLine("Unhandled write at {0:X4}:{1:X2}", addr, value); - } - } -}