From 8cf9d55c1c0a053afa4e8ccdabf0896aedadce6f Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Mon, 13 Feb 2023 09:34:30 -0800 Subject: [PATCH] (uxncli)Use System/halt as exit code --- src/uxncli.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/uxncli.c b/src/uxncli.c index 4d4b249..41bccf4 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -23,7 +23,7 @@ static int emu_error(char *msg, const char *err) { fprintf(stderr, "Error %s: %s\n", msg, err); - return 0; + return 1; } static int @@ -37,8 +37,8 @@ console_input(Uxn *u, char c) static void console_deo(Uint8 *d, Uint8 port) { - FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr : - 0; + FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr + : 0; if(fd) { fputc(d[port], fd); fflush(fd); @@ -85,7 +85,7 @@ main(int argc, char **argv) if(!system_load(&u, argv[1])) return emu_error("Load", "Failed"); if(!uxn_eval(&u, PAGE_PROGRAM)) - return emu_error("Init", "Failed"); + return u.dev[0x0f] & 0x7f; for(i = 2; i < argc; i++) { char *p = argv[i]; while(*p) console_input(&u, *p++); @@ -96,5 +96,5 @@ main(int argc, char **argv) if(c != EOF) console_input(&u, (Uint8)c); } - return 0; + return u.dev[0x0f] & 0x7f; }