From 20bc7bd4f3e159f18da12f77d2b5b6ac30901dec Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 17 Sep 2016 12:20:03 -0400 Subject: [PATCH] Failed attempt to implement mapper 134 --- .../BizHawk.Emulation.Cores.csproj | 1 + .../NES/Boards/MMC3_family/Mapper134.cs | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index edd233b3ba..6c75b3a8b8 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -676,6 +676,7 @@ + diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs new file mode 100644 index 0000000000..e3943d19cd --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/MMC3_family/Mapper134.cs @@ -0,0 +1,49 @@ +using BizHawk.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + public sealed class Mapper134 : MMC3Board_Base + { + private byte reg; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "MAPPER134": + break; + default: + return false; + } + + BaseSetup(); + return true; + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("reg", ref reg); + } + + public override void WriteWRAM(int addr, byte value) + { + if (addr == 1) // 0x6001 + { + reg = value; + } + + base.WriteWRAM(addr, value); + } + + protected override int Get_PRGBank_8K(int addr) + { + return base.Get_PRGBank_8K(addr) | ((reg & 0x2) << 4); + } + + protected override int Get_CHRBank_1K(int addr) + { + return base.Get_CHRBank_1K(addr) | ((reg & 0x20) << 3); + } + } +}