NesHawk - TEN MILLION IN ONE!!!111
This commit is contained in:
parent
9846b3a050
commit
2e6ba68327
|
@ -550,6 +550,7 @@
|
|||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper202.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper203.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper204.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper212.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper214.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper218.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper222.cs" />
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
using BizHawk.Common;
|
||||
using BizHawk.Common.NumberExtensions;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
// 1997-in-1
|
||||
// 999999-in-1
|
||||
// 1000000-in-1
|
||||
// http://wiki.nesdev.com/w/index.php/INES_Mapper_212
|
||||
public class Mapper212 : NES.NESBoardBase
|
||||
{
|
||||
private int _reg;
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
case "MAPPER212":
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
SetMirrorType(Cart.pad_h, Cart.pad_v);
|
||||
|
||||
_reg = 65535;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SyncState(Serializer ser)
|
||||
{
|
||||
base.SyncState(ser);
|
||||
ser.Sync("_reg", ref _reg);
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
addr += 0x8000;
|
||||
|
||||
_reg = addr;
|
||||
SetMirrorType(addr.Bit(3) ? EMirrorType.Horizontal : EMirrorType.Vertical);
|
||||
}
|
||||
|
||||
public override byte ReadPRG(int addr)
|
||||
{
|
||||
addr += 0x8000;
|
||||
byte ret;
|
||||
|
||||
if ((_reg & 0x4000) > 0)
|
||||
{
|
||||
int bank = (_reg >> 1) & 3;
|
||||
ret = ROM[(bank * 0x8000) + (addr & 0x7FFF)];
|
||||
}
|
||||
else
|
||||
{
|
||||
int bank = _reg & 7;
|
||||
ret = ROM[(bank * 0x4000) + (addr & 0x3FFF)];
|
||||
}
|
||||
|
||||
if ((addr & 0xE010) == 0x6000)
|
||||
{
|
||||
ret |= 0x80;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
public override byte ReadPPU(int addr)
|
||||
{
|
||||
if (addr < 0x2000)
|
||||
{
|
||||
int bank = _reg & 7;
|
||||
return VROM[(bank * 0x2000) + (addr & 0x1FFF)];
|
||||
}
|
||||
|
||||
return base.ReadPPU(addr);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue