Fix mapper 51

This commit is contained in:
adelikat 2015-08-09 14:03:11 -04:00
parent ef656a9f5d
commit d12726a1fc
1 changed files with 12 additions and 5 deletions

View File

@ -35,7 +35,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
ser.Sync("mode", ref _mode); ser.Sync("mode", ref _mode);
} }
public override byte ReadPPU(int addr) public override byte ReadWRAM(int addr)
{ {
int prgBank8k; int prgBank8k;
if ((_mode & 0x02) > 0) if ((_mode & 0x02) > 0)
@ -47,7 +47,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
prgBank8k = ((_bank & 4) << 2) | 0x2F; prgBank8k = ((_bank & 4) << 2) | 0x2F;
} }
return ROM[(prgBank8k * 0x2000) + addr]; return ROM[(prgBank8k * 0x2000) + addr];
} }
public override byte ReadPRG(int addr) public override byte ReadPRG(int addr)
@ -80,10 +80,17 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
} }
} }
public override void WritePPU(int addr, byte value) public override void WriteWRAM(int addr, byte value)
{ {
_mode = value & 0x012; if (addr < 0x2000)
SyncMirroring(); {
_mode = value & 0x012;
SyncMirroring();
}
else
{
base.WriteWRAM(addr, value);
}
} }
public override void WritePRG(int addr, byte value) public override void WritePRG(int addr, byte value)