From 5ebb36e3fa0d55b22b8fb6f22de322cab8686ad1 Mon Sep 17 00:00:00 2001 From: Simone Date: Mon, 13 May 2024 17:49:14 +0200 Subject: [PATCH] Small flash refactor --- src/backend/core/mem/Flash.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/backend/core/mem/Flash.cpp b/src/backend/core/mem/Flash.cpp index e0df02f2..6d872b06 100644 --- a/src/backend/core/mem/Flash.cpp +++ b/src/backend/core/mem/Flash.cpp @@ -22,9 +22,7 @@ void Flash::Load(SaveType saveType, const std::string& path) { FILE *f = fopen(flashPath.c_str(), "rb"); if (!f) { - f = fopen(flashPath.c_str(), "wb"); - u8* dummy = (u8*)calloc(FLASH_SIZE, 1); - fwrite(dummy, 1, FLASH_SIZE, f); + Util::panic("Could not open {}", flashPath); } fseek(f, 0, SEEK_END); @@ -37,7 +35,7 @@ void Flash::Load(SaveType saveType, const std::string& path) { saveData = mio::make_mmap_sink( flashPath, 0, mio::map_entire_file, error); - if (error) { Util::panic("Could not open {}", path); } + if (error) { Util::panic("Could not make mmap {}", flashPath); } } }