commit c8fc39705491a15df86e6bda910eeb6c4c6ab22e
parent 3a834fdfc1f419275b179ff2dec8da5d3b857f37
Author: neauoire <aliceffekt@gmail.com>
Date: Fri, 11 Nov 2022 21:12:30 -0800
Relaunch boot rom if launcher is not found
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git 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++);