diff --git a/BizHawk.Emulation/BizHawk.Emulation.csproj b/BizHawk.Emulation/BizHawk.Emulation.csproj index f3371c758f..665d27efe0 100644 --- a/BizHawk.Emulation/BizHawk.Emulation.csproj +++ b/BizHawk.Emulation/BizHawk.Emulation.csproj @@ -167,6 +167,7 @@ + diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper60.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper60.cs new file mode 100644 index 0000000000..48f15f1897 --- /dev/null +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper60.cs @@ -0,0 +1,82 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Emulation.Consoles.Nintendo +{ + class Mapper60 : NES.NESBoardBase + { + /* + Here are Disch's original notes: + ======================== + = Mapper 060 = + ======================== + + Example Game: + -------------------------- + Reset Based 4-in-1 + + + Notes: + --------------------------- + This mapper is very, very unique. + + It's a multicart that consists of four NROM games, each with 16k PRG (put at $8000 and $C000) and 8k CHR. + The current block that is selected is determined by an internal register that can only be incremented by a + soft reset! + + I would assume the register is 2 bits wide? Don't know for sure. + */ + + int reg = 0; + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "MAPPER060": + break; + default: + return false; + } + + return true; + } + + public override void SyncState(Serializer ser) + { + ser.Sync("reg", ref reg); + base.SyncState(ser); + } + + public override void NESSoftReset() + { + if (reg >= 3) + { + reg = 0; + } + else + { + reg++; + } + } + + public override byte ReadPRG(int addr) + { + if (addr >= 0x4000) + { + addr -= 0x4000; + } + return ROM[addr + (reg * 0x4000)]; + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + { + return VROM[(reg * 0x2000) + addr]; + } + return base.ReadPPU(addr); + } + } +}