NES - add mapper 203, doesn't play the 35-1 properly, but it doesn't run in fceux as well, documentation may be off, or the ROM i used is bad (not a lot of info on good dumps for these types!)

This commit is contained in:
andres.delikat 2012-07-19 14:13:45 +00:00
parent 10274734f9
commit c256e90a9d
3 changed files with 99 additions and 0 deletions

View File

@ -157,6 +157,7 @@
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper180.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper193.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper200.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper203.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper207.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper226.cs" />
<Compile Include="Consoles\Nintendo\NES\Boards\Mapper227.cs" />

View File

@ -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);
}
}
}

View File

@ -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
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------