From cd7e0341d8cf2243e576adb0cd6571db9e6a9b74 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Thu, 26 Jan 2017 01:31:29 +0100 Subject: [PATCH] Include rom revision in dump names --- source/common/common.h | 2 +- source/gamecart/gamecart.c | 8 +++++--- source/virtual/vcart.c | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/source/common/common.h b/source/common/common.h index 8ac457e..86bdada 100644 --- a/source/common/common.h +++ b/source/common/common.h @@ -38,7 +38,7 @@ (((v) % (a)) ? ((v) + (a) - ((v) % (a))) : (v)) // GodMode9 version -#define VERSION "0.9.5" +#define VERSION "0.9.6" // input / output paths #define INPUT_PATHS "0:", "0:/files9", "1:/rw/files9" diff --git a/source/gamecart/gamecart.c b/source/gamecart/gamecart.c index 7df3b63..99eefc0 100644 --- a/source/gamecart/gamecart.c +++ b/source/gamecart/gamecart.c @@ -12,7 +12,9 @@ typedef struct { NcsdHeader ncsd; u32 card2_offset; - u8 cinfo[0x1000 - (0x200 + sizeof(u32))]; + u8 cinfo0[0x312 - (0x200 + sizeof(u32))]; + u32 rom_version; + u8 cinfo1[0x1000 - (0x312 + sizeof(u32))]; NcchHeader ncch; u8 padding[0x3000 - 0x200]; u8 private[PRIV_HDR_SIZE]; @@ -42,12 +44,12 @@ u32 GetCartName(char* name, CartData* cdata) { if (cdata->cart_type & CART_CTR) { CartDataCtr* cdata_i = (CartDataCtr*)(void*) cdata; NcsdHeader* ncsd = &(cdata_i->ncsd); - snprintf(name, 24, "%016llX", ncsd->mediaId); + snprintf(name, 24, "%016llX_v%02lu", ncsd->mediaId, cdata_i->rom_version); return 0; } else if (cdata->cart_type & CART_NTR) { CartDataNtrTwl* cdata_i = (CartDataNtrTwl*)(void*) cdata; TwlHeader* nds = &(cdata_i->ntr_header); - snprintf(name, 24, "%.12s.%.6s%02X", nds->game_title, nds->game_code, nds->rom_version); + snprintf(name, 24, "%.12s_%.6s_%02u", nds->game_title, nds->game_code, nds->rom_version); return 0; } else return 1; } diff --git a/source/virtual/vcart.c b/source/virtual/vcart.c index de5baff..9e191af 100644 --- a/source/virtual/vcart.c +++ b/source/virtual/vcart.c @@ -24,7 +24,7 @@ bool ReadVCartDir(VirtualFile* vfile, VirtualDir* vdir) { if (vdir->index == 2) { // private header if (!(cdata->cart_type & CART_CTR)) return false; - snprintf(vfile->name, 32, "%s-private.bin", name); + snprintf(vfile->name, 32, "%s-priv.bin", name); vfile->size = PRIV_HDR_SIZE; vfile->flags = VFLAG_PRIV_HDR; } else {