NESHawk: Fix mapper 219

This commit is contained in:
alyosha-tas 2018-04-09 12:48:47 -04:00
parent 0fc046bea9
commit f2529fa0e0
2 changed files with 16 additions and 7 deletions

View File

@ -276,6 +276,7 @@ sha1:4EBC1ED9665C36913D0F05129E6A54787BAD3165 Dragon Ball 3 - Gokuu Den (Japan)
sha1:5A6DFDD8A2D62EBE313A6FDB986C3585077BB348 Final Combat (Asia) (NTSC) (Unl) NES board=MAPPER139
sha1:DFAF6D81280ADBEB2ADF3DAB38E536B0F2FDFC76 Final Combat (Asia) (PAL) (Unl) NES board=MAPPER139;system=NES-PAL
sha1:433CEC30E71DCA31E32B8A44A0D534DBFE7039CA BoogerMan II (RexSoft) [!] NES board=UNIF_UNL-KOF97
sha1:1903F3C614E54C0AA4EDE740909D7B3C791FA514 Toy Story NES board=MAPPER219
;;;;;;;;;;;;;;;;;;;-----------------------------------------------------------------------

View File

@ -1,4 +1,6 @@
namespace BizHawk.Emulation.Cores.Nintendo.NES
using System;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
public sealed class Mapper219 : MMC3Board_Base
{
@ -15,14 +17,15 @@
case "MAPPER219":
break;
default:
return false;
return false;
}
BaseSetup();
prgregs[1] = 1;
prgregs[2] = 2;
prgregs[3] = 3;
prgregs[0] = 0xFC;
prgregs[1] = 0xFD;
prgregs[2] = 0xFE;
prgregs[3] = 0xFF;
byte r0_0 = (byte)(0 & ~1);
byte r0_1 = (byte)(0 | 1);
@ -108,16 +111,21 @@
public override byte ReadPRG(int addr)
{
int bank_prg = addr >> 13;
bank_prg = prgregs[bank_prg];
bank_prg = prgregs[bank_prg] & prg_mask;
return ROM[((bank_prg << 13) + (addr & 0x1FFF))];
}
public override byte ReadPPU(int addr)
{
if (addr<0x2000)
{
int bank_chr = addr >> 10;
bank_chr = chrregs[bank_chr];
bank_chr = chrregs[bank_chr] & chr_mask;
if (VROM != null)
{
return VROM[((bank_chr << 10) + (addr & 0x3FF))];
}
return VRAM[((bank_chr << 10) + (addr & 0x3FF))];
}
else