From 3ea2d929a49cef60c647e79e0dc6a37243ab4af1 Mon Sep 17 00:00:00 2001 From: chaoskagami Date: Tue, 24 May 2016 17:44:35 -0400 Subject: [PATCH] FIRM versions aren't known without loading; use lazy load of some sort --- source/firm/firm.c | 4 ++++ source/menu.c | 6 ++++++ 2 files changed, 10 insertions(+) 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); -- 2.39.5