From 1dd0265e6087d383f7d8fe9b89cef5f9b569b84a Mon Sep 17 00:00:00 2001 From: goyuken Date: Mon, 15 Oct 2012 20:25:15 +0000 Subject: [PATCH] =?UTF-8?q?Mapper=2077=20("IREM-74*161/161/21/138",=20Napo?= =?UTF-8?q?leon=20Senki=20(=E3=83=8A=E3=83=9D=E3=83=AC=E3=82=AA=E3=83=B3?= =?UTF-8?q?=E6=88=A6=E8=A8=98)):=20fix=20nametable=20mirroring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NES/Boards/IREM-74_161_161_21_138.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs index 8be808ae31..4af914c15e 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/IREM-74_161_161_21_138.cs @@ -8,6 +8,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo //Mapper 77 //Napoleon Senki + //the 4screen implementation is a bit of a guess, but it seems to work + class IREM_74_161_161_21_138 : NES.NESBoardBase { int chr, prg; @@ -24,7 +26,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo return false; } - SetMirrorType(Cart.pad_h, Cart.pad_v); + SetMirrorType(EMirrorType.Vertical); return true; } @@ -44,14 +46,25 @@ namespace BizHawk.Emulation.Consoles.Nintendo public override byte ReadPPU(int addr) { if (addr < 0x0800) - { return VROM[addr + (chr * 0x0800)]; - } else if (addr < 0x2000) return VRAM[addr]; + else if (addr < 0x2800) + return VRAM[addr & 0x7ff]; else return base.ReadPPU(addr); } + public override void WritePPU(int addr, byte value) + { + if (addr < 0x0800) + return; + else if (addr < 0x2000) + VRAM[addr] = value; + else if (addr < 0x2800) + VRAM[addr & 0x7ff] = value; + else base.WritePPU(addr, value); + } + public override byte ReadPRG(int addr) { if (addr < 0x8000)