Fixes Qi Wang

Puts this mapper in line with FCEUX and Nestopia.
Still mapper variants to add here I guess, no idea where the data is coming from.

Looks strange no matter what source I look at.
This commit is contained in:
alyosha-tas 2016-09-12 22:46:14 -04:00 committed by GitHub
parent e51c6c6911
commit 790c4d21a5
1 changed files with 18 additions and 13 deletions

View File

@ -33,31 +33,36 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
return true; return true;
} }
byte reg public byte[] reg = new byte [4];
public void sync()
{ {
set
{ prg=reg[2]>>2;
prg = (value & 0x4) >> 2;
prg &= prg_mask; prg &= prg_mask;
chr = (value & 0x3); chr = (reg[2] & 0x3);
chr &= chr_mask; chr &= chr_mask;
} }
get
public override void WritePRG(int addr, byte value)
{ {
return (byte)(prg << 2 | chr); sync();
}
} }
public override void WriteEXP(int addr, byte value) public override void WriteEXP(int addr, byte value)
{ {
if ((addr & 0x103) == 0x102) if (addr <= 0x103 && addr >= 0x100)
reg = (byte)(value & 0x0f); reg[addr&0x03] = (byte)(value & 0x0f);
} }
public override byte ReadEXP(int addr) public override byte ReadEXP(int addr)
{ {
if ((addr & 0x100) != 0) if ((addr & 0x100) != 0)
return (byte)((NES.DB & (is173 ? 0x01 : 0xf0)) | reg); return (byte)((NES.DB & (is173 ? 0x01 : 0xf0)) | reg[2]);
else if ((addr & 0x1000) == 0) else if ((addr & 0x1000) == 0)
return NES.DB; return NES.DB;
else else