diff --git a/BizHawk.Emulation/BizHawk.Emulation.csproj b/BizHawk.Emulation/BizHawk.Emulation.csproj index 3468181ce8..28ea58a66d 100644 --- a/BizHawk.Emulation/BizHawk.Emulation.csproj +++ b/BizHawk.Emulation/BizHawk.Emulation.csproj @@ -219,6 +219,7 @@ + diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper036.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper036.cs new file mode 100644 index 0000000000..96cd44deb1 --- /dev/null +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper036.cs @@ -0,0 +1,65 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Emulation.Consoles.Nintendo +{ + // mapper036 + // Strike Wolf (MGC-014) [!].nes + // like an oversize GxROM + // information from fceux + public class Mapper036 : NES.NESBoardBase + { + int chr; + int prg; + int chr_mask; + int prg_mask; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "MAPPER036": + AssertVram(0); AssertWram(0); + break; + default: + return false; + } + chr_mask = Cart.chr_size / 8 - 1; + prg_mask = Cart.prg_size / 32 - 1; + SetMirrorType(Cart.pad_h, Cart.pad_v); + return true; + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + return VROM[addr | chr << 13]; + else + return base.ReadPPU(addr); + } + + public override byte ReadPRG(int addr) + { + return ROM[addr | prg << 15]; + } + + public override void WritePRG(int addr, byte value) + { + // either hack emulation of a weird bus conflict, or crappy pirate safeguard + if (addr >= 0x400 && addr <= 0x7ffe) + { + chr = value & 15 & chr_mask; + prg = value >> 4 & 15 & prg_mask; + } + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("chr", ref chr); + ser.Sync("prg", ref prg); + } + } +}