Fix other Mapper 195 Regs

This commit is contained in:
alyosha-tas 2016-09-23 19:15:34 -04:00 committed by GitHub
parent 90f52e6919
commit 04f49d34a9
1 changed files with 63 additions and 44 deletions

View File

@ -1,4 +1,6 @@
namespace BizHawk.Emulation.Cores.Nintendo.NES
using System;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public sealed class Mapper195 : MMC3Board_Base
{
@ -18,17 +20,34 @@
public override byte ReadEXP(int addr)
{
if (addr < 0x1000)
if (addr >= 0x1000)
{
return ROM[(2 << 0x1000) + (addr & 0xFFF)];
return WRAM[addr-0x1000];
}
return base.ReadEXP(addr);
}
public override void WritePRG(int addr, byte value)
public override void WriteEXP(int addr, byte value)
{
base.WritePRG(addr, value);
if (addr >= 0x1000)
{
WRAM[addr - 0x1000] = value;
}
base.WriteEXP(addr, value);
}
public override void WriteWRAM(int addr, byte value)
{
if (!mmc3.wram_enable || mmc3.wram_write_protect) return;
base.WriteWRAM(addr+0x1000, value);
}
public override byte ReadWRAM(int addr)
{
if (!mmc3.wram_enable) return NES.DB;
return base.ReadWRAM(addr+0x1000);
}
public override byte ReadPPU(int addr)