NESHawk - implement board UNIF_BMC-190in1
This commit is contained in:
parent
ce1ec1e766
commit
43e6418dac
|
@ -638,6 +638,7 @@
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN-800032.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN-800032.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\TENGEN_800008.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-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-A65AS.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-T-262.cs" />
|
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-T-262.cs" />
|
||||||
<Compile Include="Consoles\Nintendo\NES\Boards\UxROM.cs">
|
<Compile Include="Consoles\Nintendo\NES\Boards\UxROM.cs">
|
||||||
|
|
|
@ -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)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue