diff --git a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs index 95fc4f827f..623e9ce698 100644 --- a/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs +++ b/BizHawk.Emulation.Cores/Consoles/Nintendo/QuickNES/QuickNES.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Text; using BizHawk.Emulation.Common; using System.Runtime.InteropServices; +using BizHawk.Common; namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES { @@ -217,12 +218,26 @@ namespace BizHawk.Emulation.Cores.Consoles.Nintendo.QuickNES public void SaveStateText(System.IO.TextWriter writer) { - throw new NotImplementedException(); + var temp = SaveStateBinary(); + temp.SaveAsHexFast(writer); + // write extra copy of stuff we don't use + writer.WriteLine("Frame {0}", Frame); } public void LoadStateText(System.IO.TextReader reader) { - throw new NotImplementedException(); + string hex = reader.ReadLine(); + if (hex.StartsWith("emuVersion")) // movie save + { + do // theoretically, our portion should start right after StartsFromSavestate, maybe... + { + hex = reader.ReadLine(); + } while (!hex.StartsWith("StartsFromSavestate")); + hex = reader.ReadLine(); + } + byte[] state = new byte[hex.Length / 2]; + state.ReadFromHexFast(hex); + LoadStateBinary(new System.IO.BinaryReader(new System.IO.MemoryStream(state))); } public void SaveStateBinary(System.IO.BinaryWriter writer) diff --git a/output/dll/libquicknes.dll b/output/dll/libquicknes.dll index b1c2e2ff67..fa768bfa87 100644 Binary files a/output/dll/libquicknes.dll and b/output/dll/libquicknes.dll differ diff --git a/quicknes/nes_emu/Nes_Core.cpp b/quicknes/nes_emu/Nes_Core.cpp index 365cab4b2f..19dbf0fcf8 100644 --- a/quicknes/nes_emu/Nes_Core.cpp +++ b/quicknes/nes_emu/Nes_Core.cpp @@ -348,7 +348,7 @@ void Nes_Core::reset( bool full_reset, bool erase_battery_ram ) // SRAM lrom_readable = 0; - sram_present = false; + sram_present = true; enable_sram( false ); if ( !cart->has_battery_ram() || erase_battery_ram ) memset( impl->sram, 0xFF, impl->sram_size );