NESHawk - implement board UNIF_BMC-190in1

This commit is contained in:
adelikat 2015-08-22 11:35:45 -04:00
parent ce1ec1e766
commit 43e6418dac
2 changed files with 51 additions and 0 deletions

View File

@ -638,6 +638,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN-800032.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN_800008.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF-DREAMTECH01.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-190in1.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-A65AS.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-T-262.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\UxROM.cs">

View File

@ -0,0 +1,50 @@
using BizHawk.Common;
using BizHawk.Common.NumberExtensions;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public class UNIF_BMC_190in1 : NES.NESBoardBase
{
private int _reg;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "UNIF_BMC-190in1":
break;
default:
return false;
}
return true;
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("reg", ref _reg);
}
public override void WritePRG(int addr, byte value)
{
_reg = (addr >> 2) & 7;
SetMirrorType(addr.Bit(0) ? EMirrorType.Horizontal : EMirrorType.Vertical);
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
{
return VROM[(_reg * 0x2000) + (addr & 0x1FFF)];
}
return base.ReadPPU(addr);
}
public override byte ReadPRG(int addr)
{
return ROM[(_reg * 0x4000) + (addr & 0x3FFF)];
}
}
}