From: chaoskagami Date: Tue, 24 May 2016 21:44:35 +0000 (-0400) Subject: FIRM versions aren't known without loading; use lazy load of some sort X-Git-Tag: stable-1~39 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=3ea2d929a49cef60c647e79e0dc6a37243ab4af1;p=corbenik%2Fcorbenik.git FIRM versions aren't known without loading; use lazy load of some sort --- diff --git a/source/firm/firm.c b/source/firm/firm.c index c784db8..71b68de 100644 --- a/source/firm/firm.c +++ b/source/firm/firm.c @@ -367,6 +367,8 @@ find_proc9(firm_h* firm, firm_section_h* process9, exefs_h** p9exefs) return 1; } +int firm_loaded = 0; + int load_firms() { @@ -392,6 +394,8 @@ load_firms() else find_proc9(agb_firm_loc, &agb_firm_proc9, &agb_firm_p9_exefs); + firm_loaded = 1; // Loaded. + return 0; } diff --git a/source/menu.c b/source/menu.c index 5ecaaad..f2917e2 100644 --- a/source/menu.c +++ b/source/menu.c @@ -156,9 +156,15 @@ menu_options() return 0; } +extern int firm_loaded; + int menu_info() { + // This menu requres firm to be loaded. Unfortunately. + if (!firm_loaded) + load_firms(); + clear_screen(TOP_SCREEN); set_cursor(TOP_SCREEN, 0, 0);