diff --git a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj index 7d73dd6f08..596628c160 100644 --- a/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj +++ b/BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj @@ -242,6 +242,7 @@ + diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs new file mode 100644 index 0000000000..101c1c0307 --- /dev/null +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Boards/FS304.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Emulation.Cores.Nintendo.NES +{ + public class FS304 : NES.NESBoardBase + { + // waixing? + + int prg; + int prg_mask_32k; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "UNIF_UNL-FS304": + AssertChr(0); + AssertPrg(512, 1024, 2048, 4096); + Cart.vram_size = 8; + Cart.wram_size = 8; + Cart.wram_battery = true; + break; + default: + return false; + } + + prg_mask_32k = Cart.prg_size / 32 - 1; + SetMirrorType(Cart.pad_h, Cart.pad_v); + return true; + } + + public override void WriteEXP(int addr, byte value) + { + switch (addr & 0x1300) + { + case 0x1000: + prg &= ~0x0e; + prg |= value & 0x0e; + break; + case 0x1100: + prg &= ~0x01; + prg |= value >> 1 & 0x01; + break; + case 0x1200: + prg &= ~0xf0; + prg |= value << 4 & 0xf0; + break; + } + prg &= prg_mask_32k; + } + + public override byte ReadPRG(int addr) + { + return ROM[addr | prg << 15]; + } + } +} diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs index 2b01cd03d3..8b04ed13a0 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/NES/Unif.cs @@ -98,6 +98,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES byte[] all = ms.ToArray(); ci.sha1 = "sha1:" + Util.Hash_SHA1(all, 0, all.Length); } + + // other code will expect this + if (chrrom.Length == 0) + chrrom = null; } public NES.CartInfo GetCartInfo() { return ci; }