diff --git a/BizHawk.Emulation/BizHawk.Emulation.csproj b/BizHawk.Emulation/BizHawk.Emulation.csproj index 6f0aa76925..86ebe82b11 100644 --- a/BizHawk.Emulation/BizHawk.Emulation.csproj +++ b/BizHawk.Emulation/BizHawk.Emulation.csproj @@ -99,7 +99,7 @@ - + diff --git a/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt b/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt index 0714128d3f..a43099c062 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt +++ b/BizHawk.Emulation/Consoles/Nintendo/Docs/compatibility.txt @@ -71,7 +71,7 @@ Open bus and bus conflict emulation is not considered complete or thorough in an 082 Misc (J) Nothing 085 VRC7 Needed (lagrange point) 086 Misc (J) Nothing -087 Misc (J) Started but City Connection and Ninja Jajamaru Kun crash (possibly in need of a db entry) +087 Misc (J) Complete 088 Misc (J) Nothing 089 Misc (J) Nothing (easy) 090 Garbage Junk (+209) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs new file mode 100644 index 0000000000..504b701644 --- /dev/null +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_05_06_07.cs @@ -0,0 +1,188 @@ +using System; +using System.IO; +using System.Diagnostics; + + +namespace BizHawk.Emulation.Consoles.Nintendo +{ + /* + PRG-ROM - 32kb/16kb + CHR-ROM - 16kb + Mirroring - Vertical + ines Mapper 87 + + Example Games: + -------------------------- + City Connection (J) - JF_05 + Ninja Jajamaru Kun + Argus (J) - JF_07 + */ + class JALECO_JF_05 : NES.NESBoardBase + { + bool hibit, lowbit; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "JALECO-JF-05": + AssertPrg(16); AssertChr(16); AssertVram(0); AssertWram(0); + break; + default: + return false; + } + SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); + return true; + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("hibit", ref hibit); + ser.Sync("lowbit", ref lowbit); + } + + public override void WriteWRAM(int addr, byte value) + { + hibit = value.Bit(0); + lowbit = value.Bit(1); + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + { + if (lowbit) + { + if (hibit) + return VROM[addr + 0x6000]; + return VROM[addr + 0x2000]; + } + else + { + if (hibit) + return VROM[addr + 0x4000]; + return VROM[addr]; + } + } + return base.ReadPPU(addr); + } + + public override byte ReadPRG(int addr) + { + if (addr > 0x4000) addr -= 0x4000; + return base.ReadPRG(addr); + } + } + + class JALECO_JF_06 : NES.NESBoardBase + { + bool hibit, lowbit; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "JALECO-JF-06": + AssertPrg(16); AssertChr(16); AssertVram(0); AssertWram(0); + break; + default: + return false; + } + SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); + return true; + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("hibit", ref hibit); + ser.Sync("lowbit", ref lowbit); + } + + public override void WriteWRAM(int addr, byte value) + { + hibit = value.Bit(0); + lowbit = value.Bit(1); + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + { + if (lowbit) + { + if (hibit) + return VROM[addr + 0x6000]; + return VROM[addr + 0x2000]; + } + else + { + if (hibit) + return VROM[addr + 0x4000]; + return VROM[addr]; + } + } + return base.ReadPPU(addr); + } + + public override byte ReadPRG(int addr) + { + if (addr > 0x4000) addr -= 0x4000; + return base.ReadPRG(addr); + } + } + + class JALECO_JF_07: NES.NESBoardBase + { + bool hibit, lowbit; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "JALECO-JF-07": + break; + default: + return false; + } + SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); + return true; + } + + public override void SyncState(Serializer ser) + { + base.SyncState(ser); + ser.Sync("hibit", ref hibit); + ser.Sync("lowbit", ref lowbit); + } + + public override void WriteWRAM(int addr, byte value) + { + hibit = value.Bit(0); + lowbit = value.Bit(1); + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + { + if (lowbit) + { + if (hibit) + return VROM[addr + 0x6000]; + return VROM[addr + 0x2000]; + } + else + { + if (hibit) + return VROM[addr + 0x4000]; + return VROM[addr]; + } + } + return base.ReadPPU(addr); + } + } + + +} diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_07.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_07.cs deleted file mode 100644 index 0d4c1f4a13..0000000000 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/JALECO_JF_07.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.IO; -using System.Diagnostics; - - -namespace BizHawk.Emulation.Consoles.Nintendo -{ - /* - PRG-ROM - 32kb - CHR-ROM - 16kb - Mirroring - Vertical - ines Mapper 87 (Board JALECO_JF_05 is also classified under mapper 87) - - Example Games: - -------------------------- - Argus (J) - */ - class JALECO_JF_07: NES.NESBoardBase - { - bool hibit, lowbit; - - public override bool Configure(NES.EDetectionOrigin origin) - { - switch (Cart.board_type) - { - case "JALECO-JF-07": - break; - default: - return false; - } - SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); - return true; - } - - public override void SyncState(Serializer ser) - { - base.SyncState(ser); - ser.Sync("hibit", ref hibit); - ser.Sync("lowbit", ref lowbit); - } - - public override void WriteWRAM(int addr, byte value) - { - hibit = value.Bit(0); - lowbit = value.Bit(1); - } - - public override byte ReadPPU(int addr) - { - if (addr < 0x2000) - { - if (lowbit) - { - if (hibit) - return VROM[addr + 0x6000]; - return VROM[addr + 0x2000]; - } - else - { - if (hibit) - return VROM[addr + 0x4000]; - return VROM[addr]; - } - } - return base.ReadPPU(addr); - } - } -}