diff --git a/BizHawk.Emulation/BizHawk.Emulation.csproj b/BizHawk.Emulation/BizHawk.Emulation.csproj index e5c1576343..cda43bc45a 100644 --- a/BizHawk.Emulation/BizHawk.Emulation.csproj +++ b/BizHawk.Emulation/BizHawk.Emulation.csproj @@ -157,6 +157,7 @@ + diff --git a/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper203.cs b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper203.cs new file mode 100644 index 0000000000..0481fa5855 --- /dev/null +++ b/BizHawk.Emulation/Consoles/Nintendo/NES/Boards/Mapper203.cs @@ -0,0 +1,95 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace BizHawk.Emulation.Consoles.Nintendo +{ + class Mapper203 : NES.NESBoardBase + { + /* + Here are Disch's original notes: + ======================== + = Mapper 203 = + ======================== + + Example Games: + -------------------------- + 35-in-1 + + + Registers: + --------------------------- + + + $8000-FFFF: [PPPP PPCC] + P = PRG Reg + C = CHR Reg + + + CHR Setup: + --------------------------- + + $0000 $0400 $0800 $0C00 $1000 $1400 $1800 $1C00 + +---------------------------------------------------------------+ + | $8000 | + +---------------------------------------------------------------+ + + + PRG Setup: + --------------------------- + + $8000 $A000 $C000 $E000 + +---------------+---------------+ + | $8000 | $8000 | + +---------------+---------------+ + */ + + int prg_reg_16k, chr_reg_8k; + int prg_bank_mask_16k; + int chr_bank_mask_8k; + + public override bool Configure(NES.EDetectionOrigin origin) + { + switch (Cart.board_type) + { + case "MAPPER203": + break; + default: + return false; + } + + prg_bank_mask_16k = Cart.prg_size / 16 - 1; + chr_bank_mask_8k = Cart.chr_size / 8 - 1; + + return true; + } + + public override void SyncState(Serializer ser) + { + ser.Sync("prg_reg_16k", ref prg_reg_16k); + ser.Sync("chr_reg_8k", ref chr_reg_8k); + base.SyncState(ser); + } + + public override void WritePRG(int addr, byte value) + { + prg_reg_16k = (value >> 2) & prg_bank_mask_16k; + chr_reg_8k = (value & 0x03) & chr_bank_mask_8k; + } + + public override byte ReadPRG(int addr) + { + return ROM[(prg_reg_16k * 0x4000) + (addr & 0x3FFF)]; + } + + public override byte ReadPPU(int addr) + { + if (addr < 0x2000) + { + return VROM[(chr_reg_8k * 0x2000) + addr]; + } + return base.ReadPPU(addr); + } + } +} diff --git a/BizHawk.MultiClient/output/gamedb.txt b/BizHawk.MultiClient/output/gamedb.txt index e61361ea95..9f93c06914 100644 --- a/BizHawk.MultiClient/output/gamedb.txt +++ b/BizHawk.MultiClient/output/gamedb.txt @@ -126,6 +126,9 @@ sha1:977286FDC76C34A618E2A2D0270641BC36CFE89C Nintendo World Championships 1990 sha1:EC652EE1660E527098102E26A36A8B9B7BB3943F Castlevania (Konami Collection 2002) NES board=NES-UNROM;PRG=128;WRAM=0;VRAM=8;PAD_H=1 sha1:B5C4E5E858113F5AA5E063BC79A12D7F6B856E6C Contra (Konami Collection 2002) NES board=NES-UNROM;PRG=128;WRAM=0;VRAM=8;PAD_H=1 +;multi-cart crap +sha1:B6D1C372A38D196112AA98905C709AD844BD6627 Super 35-in-1 (6-in-1 VT5201) NES board=MAPPER203;PRG=128;CHR=64 + ;chinese shit sha1:BFA31777E077E64AF0E274B5A22B57C6765D36E1 Fan Kong Jing Ying (Unl) (Ch) NES board=MAPPER241;MIR=H ;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------