From 1e7ca654d574d4c001c857c45cb924191014566a Mon Sep 17 00:00:00 2001 From: zeromus Date: Thu, 29 Jul 2010 18:53:43 +0000 Subject: [PATCH] port dsv movie fix from trunk, and also touch 100 files for no good reason --- desmume/src/MMU.cpp | 11 +++++++++-- desmume/src/mc.cpp | 14 +++++++++----- desmume/src/mc.h | 3 ++- desmume/src/windows/DeSmuME_2005.vcproj | 2 +- desmume/src/windows/main.cpp | 4 ++-- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/desmume/src/MMU.cpp b/desmume/src/MMU.cpp index d2051a19c..0d959cb0e 100644 --- a/desmume/src/MMU.cpp +++ b/desmume/src/MMU.cpp @@ -976,8 +976,15 @@ void MMU_Reset() //HACK!!! //until we improve all our session tracking stuff, we need to save the backup memory filename std::string bleh = MMU_new.backupDevice.filename; - new(&MMU_new) MMU_struct_new; - MMU_new.backupDevice.load_rom(bleh.c_str()); + BackupDevice tempBackupDevice; + bool bleh2 = MMU_new.backupDevice.isMovieMode; + if(bleh2) tempBackupDevice = MMU_new.backupDevice; + reconstruct(&MMU_new); + if(bleh2) { + MMU_new.backupDevice = tempBackupDevice; + MMU_new.backupDevice.reset_hardware(); + } + else MMU_new.backupDevice.load_rom(bleh.c_str()); MMU_timing.arm7codeFetch.Reset(); MMU_timing.arm7dataFetch.Reset(); diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index b9b291172..87afe5b76 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -327,17 +327,21 @@ void BackupDevice::movie_mode() reset(); } -void BackupDevice::reset() +void BackupDevice::reset_hardware() { + write_enable = FALSE; com = 0; addr = addr_counter = 0; + state = DETECTING; flushPending = false; lazyFlushPending = false; - data.resize(0); - write_enable = FALSE; - data_autodetect.resize(0); +} - state = DETECTING; +void BackupDevice::reset() +{ + reset_hardware(); + data.resize(0); + data_autodetect.resize(0); addr_size = 0; loadfile(); diff --git a/desmume/src/mc.h b/desmume/src/mc.h index cf74fb8b1..b102dd7aa 100644 --- a/desmume/src/mc.h +++ b/desmume/src/mc.h @@ -82,6 +82,7 @@ public: void reset(); void close_rom(); + void reset_hardware(); bool save_state(EMUFILE* os); bool load_state(EMUFILE* is); @@ -120,13 +121,13 @@ public: public: //SHOULD BE PRIVATE!!!!!!!! std::string filename; + bool isMovieMode; private: bool write_enable; //is write enabled? u32 com; //persistent command actually handled u32 addr_size, addr_counter; u32 addr; - bool isMovieMode; std::vector data; std::vector data_autodetect; diff --git a/desmume/src/windows/DeSmuME_2005.vcproj b/desmume/src/windows/DeSmuME_2005.vcproj index a2c166495..024ac279a 100644 --- a/desmume/src/windows/DeSmuME_2005.vcproj +++ b/desmume/src/windows/DeSmuME_2005.vcproj @@ -437,7 +437,7 @@ />