Bare minimum fix gpgx lazystates rewinder

This was a lazystates regression -- after lazystates, there is no longer any knowledge in the core of how big the state will be
This commit is contained in:
nattthebear 2020-06-06 18:50:44 -04:00
parent aa48af9c94
commit 0326bf63d3
1 changed files with 2 additions and 13 deletions
src/BizHawk.Emulation.Cores/Consoles/Sega/gpgx64

View File

@ -39,23 +39,12 @@ namespace BizHawk.Emulation.Cores.Consoles.Sega.gpgx
public byte[] SaveStateBinary()
{
if (_stateBuffer != null)
{
using var stream = new MemoryStream(_stateBuffer);
using var writer = new BinaryWriter(stream);
SaveStateBinary(writer);
writer.Flush();
writer.Close();
return _stateBuffer;
}
using var ms = new MemoryStream();
using var bw = new BinaryWriter(ms);
SaveStateBinary(bw);
bw.Flush();
_stateBuffer = ms.ToArray();
bw.Close();
return _stateBuffer;
ms.Close();
return ms.ToArray();
}
}
}