diff --git a/makefile b/makefile index 20aeab3..f47cad7 100644 --- a/makefile +++ b/makefile @@ -13,6 +13,8 @@ dest: @ mkdir -p bin run: all bin/uxnasm bin/uxncli bin/uxn11 @ bin/uxn11 +debug: bin/uxnasm-debug bin/uxncli-debug bin/uxn11-debug + @ bin/uxncli-debug bin/opctest.rom test: all @ bin/uxnasm -v && ./bin/uxncli -v && ./bin/uxn11 -v @ bin/uxnasm etc/opctest.tal bin/opctest.rom @@ -34,3 +36,9 @@ bin/uxncli: ${CLI_src} src/uxncli.c @ cc ${RELEASE_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli bin/uxn11: ${EMU_src} src/uxn11.c @ cc ${RELEASE_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11 +bin/uxnasm-debug: src/uxnasm.c + @ cc ${DEBUG_flags} ${CFLAGS} src/uxnasm.c -o bin/uxnasm +bin/uxncli-debug: ${CLI_src} src/uxncli.c + @ cc ${DEBUG_flags} ${CFLAGS} ${CLI_src} src/uxncli.c -lutil -o bin/uxncli +bin/uxn11-debug: ${EMU_src} src/uxn11.c + @ cc ${DEBUG_flags} ${CFLAGS} ${EMU_src} src/uxn11.c -lX11 -lutil -o bin/uxn11 diff --git a/src/devices/system.c b/src/devices/system.c index 40edd29..a16dec1 100644 --- a/src/devices/system.c +++ b/src/devices/system.c @@ -16,18 +16,16 @@ WITH REGARD TO THIS SOFTWARE. */ char *boot_rom; -Uint16 dev_vers[0x10]; static void system_zero(int soft) { int i; - for(i = 0x100 * soft; i < 0x10000; i++) + for(i = soft ? 0x100 : 0; i < 0x10000; i++) uxn.ram[i] = 0; for(i = 0x0; i < 0x100; i++) uxn.dev[i] = 0; - uxn.wst.ptr = 0; - uxn.rst.ptr = 0; + uxn.wst.ptr = uxn.rst.ptr = 0; } static int @@ -52,6 +50,13 @@ system_print(Stack *s) fprintf(stderr, "< \n"); } +void +system_inspect(void) +{ + fprintf(stderr, "WST "), system_print(&uxn.wst); + fprintf(stderr, "RST "), system_print(&uxn.rst); +} + int system_error(char *msg, const char *err) { @@ -60,13 +65,6 @@ system_error(char *msg, const char *err) return 0; } -void -system_inspect(void) -{ - fprintf(stderr, "WST "), system_print(&uxn.wst); - fprintf(stderr, "RST "), system_print(&uxn.rst); -} - void system_reboot(char *rom, int soft) {