more flash work

This commit is contained in:
SimoneN64
2023-06-09 17:10:02 +02:00
parent f62df87381
commit cbc2ca147a
6 changed files with 109 additions and 32 deletions

View File

@@ -6,7 +6,8 @@ void Flash::Load(SaveType saveType, fs::path path) {
if(saveData) {
memset(saveData, 0xff, 1_mb);
} else {
saveData = (u8 *) calloc(1_mb, 1);
saveData = (u8 *) malloc(1_mb);
memset(saveData, 0xff, 1_mb);
}
saveDataPath = path.replace_extension(".flash").string();
FILE *f = fopen(saveDataPath.c_str(), "rb");