although the last change probably wouldve worked, this fix solves the real problem: save ram didnt close file pointers when roms reset
This commit is contained in:
parent
2e4026e86d
commit
5263070da5
|
@ -884,6 +884,12 @@ void NDS_Reset(BOOL resetBySavestate)
|
||||||
|
|
||||||
if (!header) return ;
|
if (!header) return ;
|
||||||
|
|
||||||
|
if (MMU.bupmem.fp)
|
||||||
|
{
|
||||||
|
fclose(MMU.bupmem.fp);
|
||||||
|
MMU.bupmem.fp = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
lagframecounter=0;
|
lagframecounter=0;
|
||||||
LagFrameFlag=0;
|
LagFrameFlag=0;
|
||||||
lastLag=0;
|
lastLag=0;
|
||||||
|
|
|
@ -199,9 +199,9 @@ void mc_reset_com(memory_chip_t *mc)
|
||||||
|
|
||||||
void mc_realloc(memory_chip_t *mc, int type, u32 size)
|
void mc_realloc(memory_chip_t *mc, int type, u32 size)
|
||||||
{
|
{
|
||||||
if(mc->data) delete[] mc->data;
|
if(mc->data) delete[] mc->data;
|
||||||
mc_init(mc, type);
|
mc_init(mc, type);
|
||||||
mc_alloc(mc, size);
|
mc_alloc(mc, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void mc_load_file(memory_chip_t *mc, const char* filename)
|
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) {
|
if(movieMode != MOVIEMODE_INACTIVE) {
|
||||||
mc->filename = strdup(filename);
|
mc->filename = strdup(filename);
|
||||||
file = fopen(filename, "wb+");
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
file = fopen(filename, "rb+");
|
file = fopen(filename, "rb+");
|
||||||
|
|
|
@ -17,4 +17,7 @@ Global
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
AMDCaProjectFile = D:\svn\desmume\trunk\desmume\src\windows\CodeAnalyst\DeSmuME_2005.caw
|
||||||
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
Loading…
Reference in New Issue