Save SRAM battery files as 8KB files.

This commit is contained in:
skidau 2015-05-22 11:05:45 +00:00
parent c58595208a
commit 152533061c
1 changed files with 7 additions and 2 deletions

View File

@ -1068,7 +1068,7 @@ bool CPUWriteBatteryFile(const char *fileName)
return false;
}
} else {
if(fwrite(flashSaveMemory, 1, 0x10000, file) != 0x10000) {
if(fwrite(flashSaveMemory, 1, 0x8000, file) != 0x8000) {
fclose(file);
return false;
}
@ -1335,12 +1335,17 @@ bool CPUReadBatteryFile(const char *fileName)
return false;
}
flashSetSize(0x20000);
} else {
} else if(size == 0x10000) {
if(fread(flashSaveMemory, 1, 0x10000, file) != 0x10000) {
fclose(file);
return false;
}
flashSetSize(0x10000);
} else if (size == 0x8000) {
if (fread(flashSaveMemory, 1, 0x8000, file) != 0x8000) {
fclose(file);
return false;
}
}
}
fclose(file);