NES Mapper034.cs is missing SyncState (#1451)

* NES Mapper034.cs is missing SyncState
This commit is contained in:
Brad Smith 2019-01-17 16:42:27 -05:00 committed by nattthebear
parent f6dd99a3ce
commit 65ce3abaa9
1 changed files with 18 additions and 4 deletions

View File

@ -1,7 +1,8 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Nintendo.NES
{
@ -13,7 +14,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
int prg_bank_mask_32k, chr_bank_mask_4k;
//state
int[] chr = new int[2];
ByteBuffer chr = new ByteBuffer(2);
int prg;
@ -38,6 +39,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
return true;
}
public override void Dispose()
{
chr.Dispose();
base.Dispose();
}
public override byte ReadPPU(int addr)
{
if (addr < 0x2000)
@ -64,10 +71,10 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
prg = value & prg_bank_mask_32k;
break;
case 0x1ffe:
chr[0] = value & chr_bank_mask_4k;
chr[0] = (byte)(value & chr_bank_mask_4k);
break;
case 0x1fff:
chr[1] = value & chr_bank_mask_4k;
chr[1] = (byte)(value & chr_bank_mask_4k);
break;
default:
// on NINA, the regs sit on top of WRAM
@ -75,5 +82,12 @@ namespace BizHawk.Emulation.Cores.Nintendo.NES
break;
}
}
public override void SyncState(Serializer ser)
{
base.SyncState(ser);
ser.Sync("prg", ref prg);
ser.Sync("chr", ref chr);
}
}
}