From c8fc39705491a15df86e6bda910eeb6c4c6ab22e Mon Sep 17 00:00:00 2001 From: neauoire Date: Fri, 11 Nov 2022 21:12:30 -0800 Subject: [PATCH] Relaunch boot rom if launcher is not found --- src/uxnemu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index a28baba..5486fc8 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -53,6 +53,8 @@ static Uint8 zoom = 1; static Uint32 stdin_event, audio0_event; static Uint64 exec_deadline, deadline_interval, ms_interval; +char *rom_path; + static int error(char *msg, const char *err) { @@ -306,7 +308,8 @@ static void restart(Uxn *u) { screen_resize(&uxn_screen, WIDTH, HEIGHT); - start(u, "launcher.rom"); + if(!start(u, "launcher.rom")) + start(u, rom_path); } static Uint8 @@ -497,6 +500,7 @@ main(int argc, char **argv) } else if(!loaded++) { if(!start(&u, argv[i])) return error("Boot", "Failed to boot."); + rom_path = argv[i]; } else { char *p = argv[i]; while(*p) console_input(&u, *p++);