Mapper 77 ("IREM-74*161/161/21/138", Napoleon Senki (ナポレオン戦記)): fix nametable mirroring

This commit is contained in:
goyuken 2012-10-15 20:25:15 +00:00
parent d575e50fd2
commit 1dd0265e60
1 changed files with 16 additions and 3 deletions

View File

@ -8,6 +8,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
//Mapper 77 //Mapper 77
//Napoleon Senki //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 class IREM_74_161_161_21_138 : NES.NESBoardBase
{ {
int chr, prg; int chr, prg;
@ -24,7 +26,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
return false; return false;
} }
SetMirrorType(Cart.pad_h, Cart.pad_v); SetMirrorType(EMirrorType.Vertical);
return true; return true;
} }
@ -44,14 +46,25 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public override byte ReadPPU(int addr) public override byte ReadPPU(int addr)
{ {
if (addr < 0x0800) if (addr < 0x0800)
{
return VROM[addr + (chr * 0x0800)]; return VROM[addr + (chr * 0x0800)];
}
else if (addr < 0x2000) else if (addr < 0x2000)
return VRAM[addr]; return VRAM[addr];
else if (addr < 0x2800)
return VRAM[addr & 0x7ff];
else return base.ReadPPU(addr); 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) public override byte ReadPRG(int addr)
{ {
if (addr < 0x8000) if (addr < 0x8000)