[NES] fix wai xing ding dong

This commit is contained in:
zeromus 2011-04-19 01:58:12 +00:00
parent dfbee39c1c
commit d6bf47c4d4
4 changed files with 24 additions and 11 deletions

View File

@ -112,8 +112,16 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public virtual byte ReadPRG(int addr) { return ROM[addr]; }
public virtual void WritePRG(int addr, byte value) { }
public virtual void WriteWRAM(int addr, byte value) { }
public virtual byte ReadWRAM(int addr) { return 0xFF; }
public virtual void WriteWRAM(int addr, byte value)
{
if(wram != null)
wram[addr] = value;
}
public virtual byte ReadWRAM(int addr) {
if (wram != null)
return wram[addr];
else return 0xFF;
}
public virtual void WriteEXP(int addr, byte value) { }
public virtual byte ReadEXP(int addr) { return 0xFF; }
@ -211,7 +219,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public override string ToString()
{
return string.Format("pr={0},cr={1},wr={2},vr={3},ba={4},pa={5}|{6},brd={7},map={8},sys={9}", prg_size, chr_size, wram_size, vram_size, wram_battery?1:0, pad_h, pad_v, board_type, mapper, system);
return string.Format("pr={0},ch={1},wr={2},vr={3},ba={4},pa={5}|{6},brd={7},map={8},sys={9}", prg_size, chr_size, wram_size, vram_size, wram_battery?1:0, pad_h, pad_v, board_type, mapper, system);
}
}

View File

@ -44,10 +44,15 @@ mirroring - both
public override void WritePRG(int addr, byte value)
{
mirror = ((addr>>1) & 0x01);
mirror = (value & 0x03);
prg = (addr >> 3) & 15;
if (mirror == 1) SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal);
else SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical);
switch (mirror)
{
case 0: SetMirrorType(NES.NESBoardBase.EMirrorType.Vertical); break;
case 1: SetMirrorType(NES.NESBoardBase.EMirrorType.Horizontal); break;
case 2: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenA); break;
case 3: SetMirrorType(NES.NESBoardBase.EMirrorType.OneScreenB); break;
}
}
public override void SyncState(Serializer ser)

View File

@ -214,8 +214,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
else if (addr < 0x2000) ret = ram[addr - 0x1800];
else if (addr < 0x4000) ret = ReadPPUReg(addr & 7);
else if (addr < 0x4020) ret = ReadReg(addr); //we're not rebasing the register just to keep register names canonical
else if (addr < 0x6000) ret = board.ReadEXP(addr);
else if (addr < 0x8000) ret = board.ReadWRAM(addr);
else if (addr < 0x6000) ret = board.ReadEXP(addr - 0x4000);
else if (addr < 0x8000) ret = board.ReadWRAM(addr - 0x6000);
else ret = board.ReadPRG(addr - 0x8000);
//apply freeze
@ -241,8 +241,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
else if (addr < 0x2000) ram[addr - 0x1800] = value;
else if (addr < 0x4000) WritePPUReg(addr & 7, value);
else if (addr < 0x4020) WriteReg(addr, value); //we're not rebasing the register just to keep register names canonical
else if (addr < 0x6000) board.WriteEXP(addr, value);
else if (addr < 0x8000) board.WriteWRAM(addr, value);
else if (addr < 0x6000) board.WriteEXP(addr - 0x4000, value);
else if (addr < 0x8000) board.WriteWRAM(addr - 0x6000, value);
else board.WritePRG(addr - 0x8000, value);
}

View File

@ -2267,7 +2267,7 @@ sha1:CF655333DCE649A3C7060E9989860F2FC74E473A Demon Sword (U) NES board=NES-SL
sha1:7786BA1FE8E7E9E542EEB13CF2A6E2A1AD7F696D Metal Gear (U) NES board=KONAMI-UNROM;PRG=128
sha1:894F20405286F5F75133CE4648300E2C67972B40 Solomon's Key (U) NES board=NES-CNROM;PRG=32;CHR=32
sha1:0C53B06E1D13AE917536BB39010914EA3D111FF5 Thunder & Lightning (U) NES board=NES-GNROM;PRG=128;CHR=32;bad
sha1:9BDFF9A19265D84979F43F0F6E925A735DDEB38B Wai Xing Zhan Shi (Ch) NES board=Mapper242;PRG=512;CHR=0;VRAM=8
sha1:9BDFF9A19265D84979F43F0F6E925A735DDEB38B Wai Xing Zhan Shi (Ch) NES board=Mapper242;PRG=512;CHR=0;VRAM=8;WRAM=8
;these roms are from goodNES but they are confusingly messed up somehow
sha1:192C543866F1037276D2778046ABEDCA84868E26 Bio Senshi Dan - Increaser To No Tatakai (J) NES board=JALECO-JF-14;PRG=128;CHR=128