Update for VS Castlevania
This commit is contained in:
parent
a28e016cbb
commit
b6a786d5a2
|
@ -26,6 +26,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
//state
|
||||
int prg;
|
||||
|
||||
//the VS actually does have 2 KB of nametable address space
|
||||
//let's make the extra space here, instead of in the main NES to avoid confusion
|
||||
byte[] CIRAM_VS = new byte[0x800];
|
||||
|
||||
public override bool Configure(NES.EDetectionOrigin origin)
|
||||
{
|
||||
adjust_prg = (x) => x;
|
||||
|
@ -58,7 +62,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
case "JALECO-JF-18":
|
||||
AssertPrg(256); AssertChr(0); AssertVram(8); AssertWram(0);
|
||||
break;
|
||||
|
||||
case "NES-UNROM_VS":
|
||||
NES._isVS = true;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
@ -88,7 +94,23 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
return VRAM[addr & vram_byte_mask];
|
||||
}
|
||||
else return base.ReadPPU(addr);
|
||||
else
|
||||
{
|
||||
if (NES._isVS)
|
||||
{
|
||||
addr = addr - 0x2000;
|
||||
if (addr < 0x800)
|
||||
{
|
||||
return NES.CIRAM[addr];
|
||||
}
|
||||
else
|
||||
{
|
||||
return CIRAM_VS[addr - 0x800];
|
||||
}
|
||||
}
|
||||
else
|
||||
return base.ReadPPU(addr);
|
||||
}
|
||||
}
|
||||
|
||||
public override void WritePPU(int addr, byte value)
|
||||
|
@ -97,13 +119,33 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
|||
{
|
||||
VRAM[addr & vram_byte_mask] = value;
|
||||
}
|
||||
else base.WritePPU(addr,value);
|
||||
else if (NES._isVS)
|
||||
{
|
||||
// The game VS Castlevania apparently scans for more CIRAM then actually exists, so we have to mask out nonsensical values
|
||||
addr &= 0x2FFF;
|
||||
|
||||
|
||||
addr = addr - 0x2000;
|
||||
if (addr < 0x800)
|
||||
{
|
||||
NES.CIRAM[addr] = value;
|
||||
}
|
||||
else
|
||||
{
|
||||
CIRAM_VS[addr - 0x800] = value;
|
||||
}
|
||||
}
|
||||
else
|
||||
base.WritePPU(addr,value);
|
||||
}
|
||||
|
||||
public override void SyncState(Serializer ser)
|
||||
{
|
||||
base.SyncState(ser);
|
||||
ser.Sync("prg", ref prg);
|
||||
|
||||
if (NES.IsVS)
|
||||
ser.Sync("VS_CIRAM", ref CIRAM_VS, false);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue