[NES] restore battery functionality

This commit is contained in:
zeromus 2011-03-07 19:32:54 +00:00
parent 288c99b519
commit 5b6a34d8f0
2 changed files with 4 additions and 2 deletions

View File

@ -91,7 +91,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
case "wram":
currCart.wram_size += (short)ParseSize(xmlreader.GetAttribute("size"));
if (xmlreader.GetAttribute("battery") != null)
currCart.wram_battery = 1;
currCart.wram_battery = true;
break;
case "pad":
currCart.pad_h = byte.Parse(xmlreader.GetAttribute("h"));
@ -145,7 +145,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
public short chr_size;
public short prg_size;
public short wram_size, vram_size;
public byte pad_h, pad_v, wram_battery, mapper;
public byte pad_h, pad_v, mapper;
public bool wram_battery;
public string board_type;

View File

@ -441,6 +441,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo.Boards
mmc1 = new MMC1();
prg_mask = (BoardInfo.PRG_Size / 16) - 1;
chr_mask = (BoardInfo.CHR_Size / 8) - 1;
BoardInfo.Battery = cart.wram_battery;
//boards that don't contain CHR rom will contain CRAM. only one size is supported; set it up if it is there.
Debug.Assert(BoardInfo.CRAM_Size == 0 || BoardInfo.CRAM_Size == 8);