(uxncli)Use System/halt as exit code

This commit is contained in:
Devine Lu Linvega 2023-02-13 09:33:57 -08:00
parent c11dcc3771
commit 1014229b8c
1 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ static int
emu_error(char *msg, const char *err) emu_error(char *msg, const char *err)
{ {
fprintf(stderr, "Error %s: %s\n", msg, err); fprintf(stderr, "Error %s: %s\n", msg, err);
return 0; return 1;
} }
static int static int
@ -85,7 +85,7 @@ main(int argc, char **argv)
if(!system_load(&u, argv[1])) if(!system_load(&u, argv[1]))
return emu_error("Load", "Failed"); return emu_error("Load", "Failed");
if(!uxn_eval(&u, PAGE_PROGRAM)) if(!uxn_eval(&u, PAGE_PROGRAM))
return emu_error("Init", "Failed"); return u.dev[0x0f] & 0x7f;
for(i = 2; i < argc; i++) { for(i = 2; i < argc; i++) {
char *p = argv[i]; char *p = argv[i];
while(*p) console_input(&u, *p++); while(*p) console_input(&u, *p++);
@ -96,5 +96,5 @@ main(int argc, char **argv)
if(c != EOF) if(c != EOF)
console_input(&u, (Uint8)c); console_input(&u, (Uint8)c);
} }
return 0; return u.dev[0x0f] & 0x7f;
} }