Mapper 216 - supported enough for Magic Jewelry 2 to work
This commit is contained in:
parent
1e454a46fe
commit
2cb64fafb8
|
@ -478,6 +478,7 @@
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI-FCG-1.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI-FCG-1.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_02_74.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_02_74.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_161_32.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\BANDAI_74_161_161_32.cs" />
|
||||||
|
<Compile Include="Consoles\Nintendo\NES\Boards\Bonza.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\BxROM.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\BxROM.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\Camerica.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\Camerica.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\CoolBoy.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\CoolBoy.cs" />
|
||||||
|
|
|
@ -0,0 +1,64 @@
|
||||||
|
using BizHawk.Common;
|
||||||
|
|
||||||
|
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
|
{
|
||||||
|
// Bonza (R)
|
||||||
|
// Magic Jewelry 2 (Unl)
|
||||||
|
public class Bonza : NES.NESBoardBase
|
||||||
|
{
|
||||||
|
private int _chrReg;
|
||||||
|
private int _prgReg;
|
||||||
|
|
||||||
|
public override bool Configure(NES.EDetectionOrigin origin)
|
||||||
|
{
|
||||||
|
switch (Cart.board_type)
|
||||||
|
{
|
||||||
|
case "MAPPER216":
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void SyncState(Serializer ser)
|
||||||
|
{
|
||||||
|
base.SyncState(ser);
|
||||||
|
ser.Sync("chrReg", ref _chrReg);
|
||||||
|
ser.Sync("prgReg", ref _prgReg);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void WritePRG(int addr, byte value)
|
||||||
|
{
|
||||||
|
_prgReg = addr & 1;
|
||||||
|
_chrReg = (addr >> 1) & 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte ReadEXP(int addr)
|
||||||
|
{
|
||||||
|
if (addr == 0x1000)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.ReadEXP(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte ReadPRG(int addr)
|
||||||
|
{
|
||||||
|
return ROM[(_prgReg * 0x8000) + (addr & 0x7FFF)];
|
||||||
|
}
|
||||||
|
|
||||||
|
public override byte ReadPPU(int addr)
|
||||||
|
{
|
||||||
|
// Magic Jewelry has no VROM and does not write chr regs
|
||||||
|
if (addr < 0x2000 && VROM != null)
|
||||||
|
{
|
||||||
|
return VROM[(_chrReg * 2000) + (addr & 0x1FFF)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.ReadPPU(addr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue