diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs index cb6276bc9b..db8c68387d 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/Gambatte.IStatable.cs @@ -21,6 +21,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy { var s = (TextState)ser.Deserialize(reader, typeof(TextState)); LoadState(s); + reader.ReadToEnd(); } public void SaveStateBinary(BinaryWriter writer) diff --git a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IStatable.cs b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IStatable.cs index b5b014a2df..c06a69ecb2 100644 --- a/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IStatable.cs +++ b/src/BizHawk.Emulation.Cores/Consoles/Nintendo/Gameboy/GambatteLink.IStatable.cs @@ -36,6 +36,7 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy _linkShiftSignal = s.LinkShiftSignal; _linkSpaced = s.LinkSpaced; _linkSpaceSignal = s.LinkSpaceSignal; + reader.ReadToEnd(); } public void SaveStateBinary(BinaryWriter writer) @@ -104,6 +105,11 @@ namespace BizHawk.Emulation.Cores.Nintendo.Gameboy public DGBSerialized(GambatteLink linkcore) { + if (linkcore == null) + { + return; + } + NumCores = linkcore._numCores; LinkedStates = new TextState[NumCores]; LinkedOverflow = new int[NumCores];