diff --git a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs index 757c70980f..4fa20993a5 100644 --- a/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs +++ b/BizHawk.Emulation/Consoles/Nintendo/SNES/LibsnesCore.cs @@ -951,7 +951,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo.SNES { int size = LibsnesDll.snes_serialize_size(); if (data.Length != size) - throw new Exception("Libsnes internal savestate size mismatch!"); + throw new Exception("Libsnes internal savestate size mismatch!"); + LibsnesDll.snes_init(); fixed (byte* pbuf = &data[0]) LibsnesDll.snes_unserialize(new IntPtr(pbuf), size); } diff --git a/BizHawk.MultiClient/output/dll/libsneshawk.dll b/BizHawk.MultiClient/output/dll/libsneshawk.dll index be31526a73..4ca11bfc4a 100644 Binary files a/BizHawk.MultiClient/output/dll/libsneshawk.dll and b/BizHawk.MultiClient/output/dll/libsneshawk.dll differ diff --git a/libsnes/bsnes/target-libsnes/libsnes.cpp b/libsnes/bsnes/target-libsnes/libsnes.cpp index c11e4f70b8..d1efa8c53c 100644 --- a/libsnes/bsnes/target-libsnes/libsnes.cpp +++ b/libsnes/bsnes/target-libsnes/libsnes.cpp @@ -161,6 +161,7 @@ void snes_set_cartridge_basename(const char *basename) { template inline void reconstruct(T* t) { t->~T(); + memset(t,0,sizeof(*t)); new(t) T(); }