NESHawk - implement board UNIF_BMC-GS-2004
This commit is contained in:
parent
43e6418dac
commit
939a86aaf6
|
@ -640,6 +640,7 @@
|
|||
<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-GS-2004.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\UNIF\UNIF_BMC-T-262.cs" />
|
||||
<Compile Include="Consoles\Nintendo\NES\Boards\UxROM.cs">
|
||||
<SubType>Code</SubType>
|
||||
|
|
|
@ -26,6 +26,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
ser.Sync("reg", ref _reg);
|
||||
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
_reg = (addr >> 2) & 7;
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
using BizHawk.Common;
|
||||
|
||||
namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||
{
|
||||
public class UNIF_BMC_GS_2004 : NES.NESBoardBase
|
||||
{
|
||||
private int _reg = 0xFF;
|
||||
|
||||
private int _prgMask32k;
|
||||
private int _wramPage;
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
switch (Cart.board_type)
|
||||
{
|
||||
case "UNIF_BMC-GS-2004":
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
_prgMask32k = (Cart.prg_size - 8) / 32 - 1;
|
||||
|
||||
// Last 8k of Prg goes into 6000-7FFF
|
||||
_wramPage = ((Cart.prg_size - 8) / 32) * 0x8000;
|
||||
|
||||
SetMirrorType(EMirrorType.Vertical);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void NESSoftReset()
|
||||
{
|
||||
_reg = 0xFF;
|
||||
base.NESSoftReset();
|
||||
}
|
||||
|
||||
public override void SyncState(Serializer ser)
|
||||
{
|
||||
base.SyncState(ser);
|
||||
ser.Sync("reg", ref _reg);
|
||||
|
||||
}
|
||||
|
||||
public override void WritePRG(int addr, byte value)
|
||||
{
|
||||
_reg = value;
|
||||
}
|
||||
|
||||
public override byte ReadWRAM(int addr)
|
||||
{
|
||||
return ROM[_wramPage + (addr & 0x1FFF)];
|
||||
}
|
||||
|
||||
public override byte ReadPRG(int addr)
|
||||
{
|
||||
return ROM[((_reg & _prgMask32k) * 0x8000) + (addr & 0x7FFF)];
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue