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,38 +1,57 @@
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public sealed class Mapper195 : MMC3Board_Base
{
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "MAPPER195":
break;
default:
return false;
}
BaseSetup();
return true;
}
public override byte ReadEXP(int addr)
{
if (addr < 0x1000)
{
return ROM[(2 << 0x1000) + (addr & 0xFFF)];
}
return base.ReadEXP(addr);
}
public override void WritePRG(int addr, byte value)
{
base.WritePRG(addr, value);
}
public override byte ReadPPU(int addr)
{
using System;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public sealed class Mapper195 : MMC3Board_Base
{
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "MAPPER195":
break;
default:
return false;
}
BaseSetup();
return true;
}
public override byte ReadEXP(int addr)
{
if (addr >= 0x1000)
{
return WRAM[addr-0x1000];
}
return base.ReadEXP(addr);
}
public override void WriteEXP(int addr, byte 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)
{
if (addr < 0x2000)
{
int bank_1k = Get_CHRBank_1K(addr);
@ -48,11 +67,11 @@
}
}
else
return base.ReadPPU(addr);
}
public override void WritePPU(int addr, byte value)
{
return base.ReadPPU(addr);
}
public override void WritePPU(int addr, byte value)
{
if (addr < 0x2000)
{
int bank_1k = Get_CHRBank_1K(addr);
@ -67,7 +86,7 @@
}
}
else
base.WritePPU(addr, value);
}
}
}
base.WritePPU(addr, value);
}
}
}