diff --git a/desmume/src/NDSSystem.cpp b/desmume/src/NDSSystem.cpp index c3ed274a5..f8a0001c1 100644 --- a/desmume/src/NDSSystem.cpp +++ b/desmume/src/NDSSystem.cpp @@ -884,6 +884,12 @@ void NDS_Reset(BOOL resetBySavestate) if (!header) return ; + if (MMU.bupmem.fp) + { + fclose(MMU.bupmem.fp); + MMU.bupmem.fp = NULL; + } + lagframecounter=0; LagFrameFlag=0; lastLag=0; diff --git a/desmume/src/mc.cpp b/desmume/src/mc.cpp index 54a8683e5..f4dcb547d 100644 --- a/desmume/src/mc.cpp +++ b/desmume/src/mc.cpp @@ -199,9 +199,9 @@ void mc_reset_com(memory_chip_t *mc) void mc_realloc(memory_chip_t *mc, int type, u32 size) { - if(mc->data) delete[] mc->data; - mc_init(mc, type); - mc_alloc(mc, size); + if(mc->data) delete[] mc->data; + mc_init(mc, type); + mc_alloc(mc, size); } void mc_load_file(memory_chip_t *mc, const char* filename) @@ -213,7 +213,7 @@ void mc_load_file(memory_chip_t *mc, const char* filename) if(movieMode != MOVIEMODE_INACTIVE) { mc->filename = strdup(filename); - file = fopen(filename, "wb+"); + return; } else file = fopen(filename, "rb+"); diff --git a/desmume/src/windows/DeSmuME_2005.sln b/desmume/src/windows/DeSmuME_2005.sln index c1443642b..2eb8ee159 100644 --- a/desmume/src/windows/DeSmuME_2005.sln +++ b/desmume/src/windows/DeSmuME_2005.sln @@ -17,4 +17,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + AMDCaProjectFile = D:\svn\desmume\trunk\desmume\src\windows\CodeAnalyst\DeSmuME_2005.caw + EndGlobalSection EndGlobal