From 79f216e32563acc81517729fe56a6f11f110b0a4 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 10 Nov 2012 22:23:37 +0200 Subject: frontend: avoid loading msg when not needed --- frontend/libretro.c | 2 +- frontend/main.c | 10 ++++++---- frontend/main.h | 2 +- frontend/menu.c | 2 +- 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'frontend') diff --git a/frontend/libretro.c b/frontend/libretro.c index 11bcef4..82e6f65 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -274,7 +274,7 @@ bool retro_load_game(const struct retro_game_info *info) printf("could not load CD-ROM!\n"); return false; } - emu_on_new_cd(); + emu_on_new_cd(0); return true; } diff --git a/frontend/main.c b/frontend/main.c index c1ceb57..4803198 100644 --- a/frontend/main.c +++ b/frontend/main.c @@ -396,7 +396,7 @@ out: fclose(f); } -void emu_on_new_cd(void) +void emu_on_new_cd(int show_hud_msg) { ClearAllCheats(); parse_cwcheat(); @@ -406,8 +406,10 @@ void emu_on_new_cd(void) printf("----------------------------------------------------------\n"); } - snprintf(hud_msg, sizeof(hud_msg), BOOT_MSG); - hud_new_msg = 3; + if (show_hud_msg) { + snprintf(hud_msg, sizeof(hud_msg), BOOT_MSG); + hud_new_msg = 3; + } } int emu_core_preinit(void) @@ -563,7 +565,7 @@ int main(int argc, char *argv[]) printf(_("Could not load CD-ROM!\n")); return -1; } - emu_on_new_cd(); + emu_on_new_cd(!loadst); ready_to_go = 1; } } diff --git a/frontend/main.h b/frontend/main.h index 44c1b6a..7e5dc47 100644 --- a/frontend/main.h +++ b/frontend/main.h @@ -42,7 +42,7 @@ int emu_core_preinit(void); int emu_core_init(void); void emu_set_default_config(void); -void emu_on_new_cd(void); +void emu_on_new_cd(int show_hud_msg); int get_state_filename(char *buf, int size, int i); int emu_check_state(int slot); diff --git a/frontend/menu.c b/frontend/menu.c index 333bdb6..a984bbf 100644 --- a/frontend/menu.c +++ b/frontend/menu.c @@ -1849,7 +1849,7 @@ static int run_cd_image(const char *fname) return -1; } - emu_on_new_cd(); + emu_on_new_cd(1); ready_to_go = 1; return 0; -- cgit v1.2.3