From ca86a8dff36c4215bb70479f8b027c0c3240a120 Mon Sep 17 00:00:00 2001 From: adelikat Date: Tue, 30 Oct 2012 01:33:56 +0000 Subject: [PATCH] Atari - start DPC mapper (Pitfall 2) - only does the basic bankswitching right now, still needs the 2k display bank and DPC sound chip --- BizHawk.Emulation/BizHawk.Emulation.csproj | 1 + .../Consoles/Atari/2600/Atari2600.Core.cs | 1 + BizHawk.Emulation/Consoles/Atari/2600/Mappers/mF8.cs | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BizHawk.Emulation/BizHawk.Emulation.csproj b/BizHawk.Emulation/BizHawk.Emulation.csproj index a13e2f110c..42098b7d69 100644 --- a/BizHawk.Emulation/BizHawk.Emulation.csproj +++ b/BizHawk.Emulation/BizHawk.Emulation.csproj @@ -83,6 +83,7 @@ + diff --git a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.Core.cs b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.Core.cs index ccf16b8adc..31750eabd5 100644 --- a/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.Core.cs +++ b/BizHawk.Emulation/Consoles/Atari/2600/Atari2600.Core.cs @@ -143,6 +143,7 @@ namespace BizHawk case "EF": mapper = new mEF(); break; case "X07": mapper = new mX07(); break; case "4A50": mapper = new m4A50(); break; + case "DPC": mapper = new mDPC(); break; default: throw new InvalidOperationException("mapper not supported: " + game.GetOptionsDict()["m"]); } diff --git a/BizHawk.Emulation/Consoles/Atari/2600/Mappers/mF8.cs b/BizHawk.Emulation/Consoles/Atari/2600/Mappers/mF8.cs index 72ec862fc0..188bd4b303 100644 --- a/BizHawk.Emulation/Consoles/Atari/2600/Mappers/mF8.cs +++ b/BizHawk.Emulation/Consoles/Atari/2600/Mappers/mF8.cs @@ -27,13 +27,13 @@ namespace BizHawk class mF8 : MapperBase { - int toggle = 0; + int bank_4k = 0; public override byte ReadMemory(ushort addr) { Address(addr); if (addr < 0x1000) return base.ReadMemory(addr); - return core.rom[toggle*4*1024 + (addr&0xFFF)]; + return core.rom[(bank_4k << 12) + (addr&0xFFF)]; } public override void WriteMemory(ushort addr, byte value) { @@ -44,13 +44,13 @@ namespace BizHawk public override void SyncState(Serializer ser) { base.SyncState(ser); - ser.Sync("toggle", ref toggle); + ser.Sync("toggle", ref bank_4k); } void Address(ushort addr) { - if (addr == 0x1FF8) toggle = 0; - else if (addr == 0x1FF9) toggle = 1; + if (addr == 0x1FF8) bank_4k = 0; + else if (addr == 0x1FF9) bank_4k = 1; } } }