uxn

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

commit c413cd7cb13490785b900a4c598373de5fc66da6
parent 5c0a638e297a4a1cf200debbf6cb87018df192de
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Tue, 21 Jan 2025 09:47:51 -0800

(console) Cache vector

Diffstat:
Msrc/devices/console.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/devices/console.c b/src/devices/console.c @@ -5,7 +5,7 @@ #include "console.h" /* -Copyright (c) 2022-2024 Devine Lu Linvega, Andrew Alderwick +Copyright (c) 2022-2025 Devine Lu Linvega, Andrew Alderwick Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -15,12 +15,16 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ +/* console registers */ + +static int rVECTOR; + int console_input(int c, int type) { if(c == EOF) c = 0, type = 4; uxn.dev[0x12] = c, uxn.dev[0x17] = type; - uxn_eval(uxn.dev[0x10] << 8 | uxn.dev[0x11]); + uxn_eval(rVECTOR); return type != 4; } @@ -40,6 +44,7 @@ console_deo(Uint8 addr) { FILE *fd; switch(addr) { + case 0x11: rVECTOR = PEEK2(&uxn.dev[0x10]); return; case 0x18: fd = stdout, fputc(uxn.dev[0x18], fd), fflush(fd); break; case 0x19: fd = stderr, fputc(uxn.dev[0x19], fd), fflush(fd); break; }