uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 9a882a64c770930ee6e0a74a366aaab95b753b92
parent 1bf0ffc5e54f98520de14db54dc6a1236c3739f7
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Mon, 17 Apr 2023 10:41:03 -0700

(uxnemu) Write arguments end in console device

Diffstat:
Msrc/devices/system.c | 2++
Msrc/devices/system.h | 3+--
Msrc/uxncli.c | 2+-
Msrc/uxnemu.c | 4+++-
4 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/devices/system.c b/src/devices/system.c @@ -102,6 +102,8 @@ uxn_halt(Uxn *u, Uint8 instr, Uint8 err, Uint16 addr) return 0; } +/* Console */ + int console_input(Uxn *u, char c, int type) { diff --git a/src/devices/system.h b/src/devices/system.h @@ -20,4 +20,4 @@ int system_load(Uxn *u, char *filename); void system_inspect(Uxn *u); void system_deo(Uxn *u, Uint8 *d, Uint8 port); int console_input(Uxn *u, char c, int type); -void console_deo(Uint8 *d, Uint8 port); -\ No newline at end of file +void console_deo(Uint8 *d, Uint8 port); diff --git a/src/uxncli.c b/src/uxncli.c @@ -53,7 +53,7 @@ main(int argc, char **argv) { Uxn u; int i = 1; - if(argc < 2) + if(i == argc) return emu_error("Usage", "uxncli game.rom args"); if(!uxn_boot(&u, (Uint8 *)calloc(0x10000 * RAM_PAGES, sizeof(Uint8)))) return emu_error("Boot", "Failed"); diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -500,9 +500,11 @@ main(int argc, char **argv) set_zoom(argv[i++][1] - '0'); else if(SDL_GetCurrentDisplayMode(0, &DM) == 0) set_zoom(DM.w / 1280); + /* load rom */ if(i == argc) return error("usage", "uxnemu [-2x][-3x] file.rom"); - /* load rom */ + if(i == argc - 1) + u.dev[0x17] = CONSOLE_END; if(!start(&u, argv[i])) return error("Start", "Failed"); rom_path = argv[i++];