diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 6b2884363b..afd021186b 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -767,6 +767,7 @@ + diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs new file mode 100644 index 0000000000..a12401eb11 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/UNIF/UNIF_UNL-43272.cs @@ -0,0 +1,39 @@ +using BizHawk.Common; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + public sealed class UNIF_UNL_43272 : NES.NESBoardBase + { + private int latche; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "UNIF_UNL-43272": + break; + default: + return false; + } + + return true; + } + + public override void SyncState(Serializer ser) + { + ser.Sync("latche", ref latche); + base.SyncState(ser); + } + + public override void WritePRG(int addr, byte value) + { + latche = addr & 65535; + } + + public override byte ReadPRG(int addr) + { + int bank = (latche & 0x38) >> 3; + return ROM[(bank << 15) + addr]; + } + } +}