nes-fix a pretty big systematic error that wouldve made lots of savefiles not get generated

This commit is contained in:
zeromus 2011-10-15 05:15:46 +00:00
parent d2aba72502
commit ebbe60c009
2 changed files with 10 additions and 10 deletions

View File

@ -166,7 +166,15 @@ namespace BizHawk.Emulation.Consoles.Nintendo
}
}
public virtual byte[] SaveRam { get { return null; } }
public virtual byte[] SaveRam
{
get
{
if (!Cart.wram_battery) return null;
return WRAM;
}
}
public byte[] WRAM { get { return wram; } set { wram = value; } }
public byte[] VRAM { get { return vram; } set { vram = value; } }
public byte[] ROM { get; set; }
@ -191,6 +199,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
Assert(false, "unhandled {0} size of {1}", name,value);
}
protected void AssertBattery(bool has_bat) { Assert(Cart.wram_battery == has_bat); }
}
//this will be used to track classes that implement boards

View File

@ -257,15 +257,6 @@ namespace BizHawk.Emulation.Consoles.Nintendo
WRAM[addr & wram_mask] = value;
}
public override byte[] SaveRam
{
get
{
if (!Cart.wram_battery) return null;
return WRAM;
}
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);