From f8778ef3f2087221f2577e271e35133b13d68261 Mon Sep 17 00:00:00 2001 From: zeromus Date: Tue, 8 Oct 2013 16:53:09 +0000 Subject: [PATCH] add something, at least, in place of the deleted memset code --- desmume/src/utils/fsnitro.cpp | 5 +++++ desmume/src/utils/fsnitro.h | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/desmume/src/utils/fsnitro.cpp b/desmume/src/utils/fsnitro.cpp index be2058d7a..aa4c0b91a 100644 --- a/desmume/src/utils/fsnitro.cpp +++ b/desmume/src/utils/fsnitro.cpp @@ -149,6 +149,11 @@ bool FS_NITRO::loadFileTables() if (numOverlay7 && !ovr7) return false; if (numOverlay9 && !ovr9) return false; + delete[] fat; + delete[] fnt; + fat = new FAT_NITRO[numFiles]; + fnt = new FNT_NITRO[numDirs]; + // ========= FAT (File Allocation Table) u32 *_FAT = (u32*)(rom + FATOff); for (u32 i = 0; i < numFiles; i++) diff --git a/desmume/src/utils/fsnitro.h b/desmume/src/utils/fsnitro.h index d7f1a692c..b90a9bcf6 100644 --- a/desmume/src/utils/fsnitro.h +++ b/desmume/src/utils/fsnitro.h @@ -37,6 +37,17 @@ enum FNT_TYPES #include "PACKED.h" struct FAT_NITRO { + FAT_NITRO() + : start(0) + , end(0) + , size(0) + , parentOffset(0) + , isOverlay(false) + , file(false) + , sizeFile(0) + , parentID(0) + { + } u32 start; u32 end; u32 size; @@ -57,6 +68,12 @@ struct FNT_MAIN struct FNT_NITRO { + FNT_NITRO() + : offset(0) + , firstID(0) + , parentID(0) + { + } u32 offset; u16 firstID; u16 parentID;