diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index be60843cc4..1125f1bb5e 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -681,6 +681,7 @@ + diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/UNIF/UNIF-DREAMTECH01.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/UNIF/UNIF-DREAMTECH01.cs new file mode 100644 index 0000000000..bf642a252c --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/UNIF/UNIF-DREAMTECH01.cs @@ -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)]; + } + } +}