NESHawk - add unf board UNIF_DREAMTECH01, (Korean Igo (Unl))

This commit is contained in:
adelikat 2015-08-18 21:02:28 -04:00
parent dd973d03fc
commit f044790202
2 changed files with 44 additions and 0 deletions

View File

@ -681,6 +681,7 @@
<Compile Include="Consoles\Nintendo\NES\PPU.regs.cs" />
<Compile Include="Consoles\Nintendo\NES\PPU.run.cs" />
<Compile Include="Consoles\Nintendo\NES\Unif.cs" />
<Compile Include="Consoles\Nintendo\NES\UNIF\UNIF-DREAMTECH01.cs" />
<Compile Include="Consoles\Nintendo\QuickNES\LibQuickNES.cs" />
<Compile Include="Consoles\Nintendo\QuickNES\Nes_NTSC_Colors.cs" />
<Compile Include="Consoles\Nintendo\QuickNES\QuickNES.cs" />

View File

@ -0,0 +1,43 @@
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public class UNIF_DREAMTECH01 : NES.NESBoardBase
{
// Korean Igo (Unl) [U][!]
private int reg;
public override bool Configure(NES.EDetectionOrigin origin)
{
switch (Cart.board_type)
{
case "UNIF_DREAMTECH01":
break;
default:
return false;
}
return true;
}
public override void SyncState(Serializer ser)
{
ser.Sync("reg", ref reg);
base.SyncState(ser);
}
public override void WriteEXP(int addr, byte value)
{
if (addr == 0x1020)
{
reg = value & 0x07;
}
}
public override byte ReadPRG(int addr)
{
int bank = addr < 0x4000 ? reg : 8;
return ROM[(bank << 14) + (addr & 0x3FFF)];
}
}
}