From 26e9d8bf88e93116797bd0cacdfc6570c2567f5b Mon Sep 17 00:00:00 2001 From: neauoire Date: Wed, 22 Sep 2021 10:13:02 -0700 Subject: [PATCH] Set size after devices are defined --- src/uxnemu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/uxnemu.c b/src/uxnemu.c index bddd27f..91ccff8 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -583,8 +583,6 @@ main(int argc, char **argv) return error("Boot", "Failed to start uxn."); if(!load(&u, argv[argc - 1])) return error("Load", "Failed to open rom."); - if(!init(&u)) - return error("Init", "Failed to initialize emulator."); /* system */ devsystem = uxn_port(&u, 0x0, system_talk); /* console */ devconsole = uxn_port(&u, 0x1, console_talk); @@ -603,6 +601,8 @@ main(int argc, char **argv) /* unused */ uxn_port(&u, 0xe, nil_talk); /* unused */ uxn_port(&u, 0xf, nil_talk); + if(!init(&u)) + return error("Init", "Failed to initialize emulator."); if(!set_size(WIDTH, HEIGHT, 0)) return error("Window", "Failed to set window size.");