From d95a606ec2b48a19f1374a71a0cac6069535e136 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Tue, 8 Mar 2022 18:47:32 +0100 Subject: [PATCH] Fix bad trimming of certain NDS dumps Fixes #763 --- arm9/source/utils/gameutil.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arm9/source/utils/gameutil.c b/arm9/source/utils/gameutil.c index 6ec9c4c..79a9a2b 100644 --- a/arm9/source/utils/gameutil.c +++ b/arm9/source/utils/gameutil.c @@ -3294,7 +3294,8 @@ u64 GetGameFileTrimmedSize(const char* path) { return 0; if (hdr.unit_code != 0x00) // DSi or NDS+DSi trimsize = hdr.ntr_twl_rom_size; - else trimsize = hdr.ntr_rom_size + 0x88; // regular NDS + else if (hdr.ntr_rom_size) // regular NDS + trimsize = hdr.ntr_rom_size + 0x88; } else { u8 hdr[0x200]; if (fvx_qread(path, &hdr, 0, 0x200, NULL) != FR_OK)