From 579b52e3aa194da3f62759c003c384045e2b240d Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sun, 17 Feb 2013 19:25:20 +0200 Subject: [PATCH] Unconditionally reload hostmemory on loadstate Hostmemory is associated with system state, so it must be reloaded upon loadstate, even in preserve input mode. --- src/core/moviedata.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/moviedata.cpp b/src/core/moviedata.cpp index 87df8204..ad4e1528 100644 --- a/src/core/moviedata.cpp +++ b/src/core/moviedata.cpp @@ -345,6 +345,7 @@ void do_load_state(struct moviefile& _movie, int lmode) throw std::runtime_error("ROM types of movie and loaded ROM don't match"); if(our_rom->orig_region && !our_rom->orig_region->compatible_with(_movie.gametype->get_region())) throw std::runtime_error("NTSC/PAL select of movie and loaded ROM don't match"); + auto _hostmemory = _movie.host_memory; if(our_rom->rtype && _movie.coreversion != bsnes_core_version) { if(will_load_state) { @@ -427,6 +428,9 @@ void do_load_state(struct moviefile& _movie, int lmode) if(!our_movie.is_savestate || lmode == LOAD_STATE_MOVIE) { our_movie.is_savestate = false; our_movie.host_memory.clear(); + } else { + //Hostmemory must be unconditionally reloaded, even in preserve mode. + our_movie.host_memory = _hostmemory; } if(our_movie.prefix != "" && lmode != LOAD_STATE_PRESERVE) { mprefix.prefix = our_movie.prefix;