diff --git a/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt b/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt index f4472eddb8..4a45e84091 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt +++ b/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt @@ -93,7 +93,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an 152 Misc (J) Complete 154 Misc (J) Nothing 159 Bandai {{See 016}} -164 Pirate Started +164 Pirate Junk - Started 165 Pirate Junk 180 Misc (J) Complete (but we don't implement the crazy climber controller) 182 MMC3Variant Nothing @@ -102,7 +102,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an 189 MMC3Variant Nothing 191 Pirate Junk 192 Pirate Junk -193 Unlicensed Junk +193 Unlicensed Junk - Started 194 Pirate Junk 200 Multicart Junk 201 Multicart Junk diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper193.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper193.cs new file mode 100644 index 0000000000..dbce68e4a9 --- /dev/null +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper193.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Emulation.Consoles.Nintendo +{ + class Mapper193 : NES.NESBoardBase + { + int prg, chr0, chr1, chr2; + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "Mapper193": + break; + default: + return false; + } + SetMirrorType(EMirrorType.Vertical); + return true; + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("prg", ref prg); + ser.Sync("chr0", ref chr0); + ser.Sync("chr1", ref chr1); + ser.Sync("chr2", ref chr2); + } + + public override void WritePPU(int addr, byte value) + { + switch (addr) + { + case 0x6000: + chr0 = value; + break; + case 0x6001: + chr1 = value; + break; + case 0x6002: + chr2 = value; + break; + case 0x6003: + prg = value; + break; + } + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x1000) + return VRAM[addr + (chr0 * 0x1000)]; + else if (addr < 0x1800) + return VRAM[addr + (chr1 * 0x0800)]; + else if (addr < 0x2000) + return VRAM[addr + (chr2 * 0x0800)]; + else + return base.ReadPPU(addr); + } + + public override byte ReadPRG(int addr) + { + if (addr < 0xA000) + return ROM[addr + (prg * 0x2000)]; + else if (addr < 0xC000) + return 0xFD; + else if (addr < 0xE000) + return 0xFE; + else + return 0xFF; + } + } +}