From 6df7ff0cbabf79046ddee2d56d936ec2d5f94508 Mon Sep 17 00:00:00 2001 From: Pablo Curiel Date: Sat, 20 Feb 2021 14:52:07 -0400 Subject: [PATCH] Fix output filenames not being updated in usb_gc_dumper. --- code_templates/sd_romfs_dumper.c | 6 ++++++ code_templates/usb_gc_dumper.c | 11 +++++++++-- source/title.c | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/code_templates/sd_romfs_dumper.c b/code_templates/sd_romfs_dumper.c index a03e996..7397914 100644 --- a/code_templates/sd_romfs_dumper.c +++ b/code_templates/sd_romfs_dumper.c @@ -410,7 +410,9 @@ int main(int argc, char *argv[]) consoleUpdate(NULL); + bool gc_update = false; u64 btn_down = 0, btn_held = 0; + while(true) { utilsScanPads(); @@ -430,10 +432,14 @@ int main(int argc, char *argv[]) } selected_idx = scroll = 0; + gc_update = true; + break; } } + if (gc_update) continue; + if (btn_down & HidNpadButton_A) { if (!titleGetUserApplicationData(app_metadata[selected_idx]->title_id, &user_app_data) || !user_app_data.app_info) diff --git a/code_templates/usb_gc_dumper.c b/code_templates/usb_gc_dumper.c index 4ee4821..5e2b750 100644 --- a/code_templates/usb_gc_dumper.c +++ b/code_templates/usb_gc_dumper.c @@ -343,11 +343,18 @@ static u32 menuGetElementCount(const Menu *menu) static void waitForGameCardAndUsb(void) { consoleClear(); - consolePrint("waiting for gamecard and usb session...\n"); + consolePrint("waiting for gamecard...\n"); while(true) { - if (gamecardGetStatus() == GameCardStatus_InsertedAndInfoLoaded && usbIsReady()) break; + if (gamecardGetStatus() == GameCardStatus_InsertedAndInfoLoaded && !titleIsGameCardInfoUpdated()) break; + } + + consolePrint("waiting for usb session...\n"); + + while(true) + { + if (usbIsReady()) break; } } diff --git a/source/title.c b/source/title.c index c12bb01..ac70e2f 100644 --- a/source/title.c +++ b/source/title.c @@ -738,7 +738,7 @@ bool titleIsGameCardInfoUpdated(void) /* Signal the gamecard update info user event. */ ueventSignal(&g_titleGameCardUpdateInfoUserEvent); - /* Wait for the gamecard thread to wakes us up. */ + /* Wait for the gamecard thread to wake us up. */ condvarWait(&g_gameCardCondVar, &g_titleMutex); /* Update output value and gamecard info updated flag (if needed). */