update MMC1 for VS Dr. Mario
This commit is contained in:
parent
d123709a72
commit
312bacf2f3
|
@ -71,7 +71,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
A, B1, B2, B3
|
A, B1, B2, B3
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//register 0:
|
//register 0:
|
||||||
public int chr_mode;
|
public int chr_mode;
|
||||||
public int prg_mode;
|
public int prg_mode;
|
||||||
|
@ -249,6 +248,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
const int pputimeout = 4; // i don't know if this is right, but anything lower will not boot Bill & Ted
|
const int pputimeout = 4; // i don't know if this is right, but anything lower will not boot Bill & Ted
|
||||||
bool disablemirror = false; // mapper 171: mmc1 without mirroring control
|
bool disablemirror = false; // mapper 171: mmc1 without mirroring control
|
||||||
|
|
||||||
|
|
||||||
|
//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];
|
||||||
|
|
||||||
|
|
||||||
//state
|
//state
|
||||||
public MMC1 mmc1;
|
public MMC1 mmc1;
|
||||||
/// <summary>number of cycles since last WritePRG()</summary>
|
/// <summary>number of cycles since last WritePRG()</summary>
|
||||||
|
@ -294,12 +299,49 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
return VRAM[Gen_CHR_Address(addr) & vram_mask];
|
return VRAM[Gen_CHR_Address(addr) & vram_mask];
|
||||||
else return VROM[Gen_CHR_Address(addr)];
|
else return VROM[Gen_CHR_Address(addr)];
|
||||||
}
|
}
|
||||||
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)
|
public override void WritePPU(int addr, byte value)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (NES._isVS)
|
||||||
{
|
{
|
||||||
if (addr < 0x2000)
|
if (addr < 0x2000)
|
||||||
|
{
|
||||||
|
if (VRAM != null)
|
||||||
|
VRAM[Gen_CHR_Address(addr) & vram_mask] = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addr = addr - 0x2000;
|
||||||
|
if (addr < 0x800)
|
||||||
|
{
|
||||||
|
NES.CIRAM[addr] = value;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
CIRAM_VS[addr - 0x800] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (addr < 0x2000)
|
||||||
{
|
{
|
||||||
if (Cart.vram_size != 0)
|
if (Cart.vram_size != 0)
|
||||||
VRAM[Gen_CHR_Address(addr) & vram_mask] = value;
|
VRAM[Gen_CHR_Address(addr) & vram_mask] = value;
|
||||||
|
@ -312,6 +354,9 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
base.SyncState(ser);
|
base.SyncState(ser);
|
||||||
mmc1.SyncState(ser);
|
mmc1.SyncState(ser);
|
||||||
ser.Sync("ppuclock", ref ppuclock);
|
ser.Sync("ppuclock", ref ppuclock);
|
||||||
|
|
||||||
|
if (NES._isVS)
|
||||||
|
ser.Sync("VS_CIRAM", ref CIRAM_VS, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Configure(NES.EDetectionOrigin origin)
|
public override bool Configure(NES.EDetectionOrigin origin)
|
||||||
|
@ -320,6 +365,20 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
{
|
{
|
||||||
case "MAPPER116_HACKY":
|
case "MAPPER116_HACKY":
|
||||||
break;
|
break;
|
||||||
|
case "MAPPER001_VS":
|
||||||
|
// VS mapper MMC1
|
||||||
|
NES._isVS = true;
|
||||||
|
//update the state of the dip switches
|
||||||
|
//this is only done at power on
|
||||||
|
NES.VS_dips[0] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[1] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[2] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[3] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[4] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[5] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[6] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
NES.VS_dips[7] = (byte)(NES.SyncSettings.VSDipswitches.Dip_Switch_1 ? 1 : 0);
|
||||||
|
break;
|
||||||
case "MAPPER001":
|
case "MAPPER001":
|
||||||
// there's no way to define PRG oversize for mapper001 due to how the MMC1 regs work
|
// there's no way to define PRG oversize for mapper001 due to how the MMC1 regs work
|
||||||
// so 512KB must mean SUROM or SXROM. SUROM is more common, so we try that
|
// so 512KB must mean SUROM or SXROM. SUROM is more common, so we try that
|
||||||
|
@ -445,7 +504,6 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
|
||||||
base.Dispose();
|
base.Dispose();
|
||||||
if(mmc1 != null) mmc1.Dispose();
|
if(mmc1 != null) mmc1.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
} //class SxROM
|
} //class SxROM
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue