uxn

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

commit 83ba7e05eabc14a9aaf1084b2498e5ed622fa667
parent d2e054346f03e66f031f78a50bf1caa87da2dc10
Author: Devine Lu Linvega <aliceffekt@gmail.com>
Date:   Tue,  2 May 2023 10:31:33 -0700

Added mock behavior for the friend port

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

diff --git a/src/devices/system.c b/src/devices/system.c @@ -83,6 +83,13 @@ system_deo(Uxn *u, Uint8 *d, Uint8 port) case 0x3: system_cmd(u->ram, PEEK2(d + 2)); break; + case 0x5: + if(PEEK2(d + 4)){ + Uxn friend; + uxn_boot(&friend, u->ram); + uxn_eval(&friend, PEEK2(d + 4)); + } + break; case 0xe: system_inspect(u); break; diff --git a/src/uxncli.c b/src/uxncli.c @@ -17,7 +17,7 @@ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE. */ -Uint16 deo_mask[] = {0x6a08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; +Uint16 deo_mask[] = {0xc028, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; Uint16 dei_mask[] = {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07ff, 0x0000, 0x0000, 0x0000}; Uint8 @@ -53,16 +53,17 @@ main(int argc, char **argv) if(!system_load(&u, argv[i++])) return system_error("Load", "Failed"); u.dev[0x17] = argc - i; - if(!uxn_eval(&u, PAGE_PROGRAM)) - return u.dev[0x0f] & 0x7f; - for(; i < argc; i++) { - char *p = argv[i]; - while(*p) console_input(&u, *p++, CONSOLE_ARG); - console_input(&u, '\n', i == argc - 1 ? CONSOLE_END : CONSOLE_EOA); - } - while(!u.dev[0x0f]) { - int c = fgetc(stdin); - if(c != EOF) console_input(&u, (Uint8)c, CONSOLE_STD); + if(uxn_eval(&u, PAGE_PROGRAM)) { + for(; i < argc; i++) { + char *p = argv[i]; + while(*p) console_input(&u, *p++, CONSOLE_ARG); + console_input(&u, '\n', i == argc - 1 ? CONSOLE_END : CONSOLE_EOA); + } + while(!u.dev[0x0f]) { + int c = fgetc(stdin); + if(c != EOF) console_input(&u, (Uint8)c, CONSOLE_STD); + } } + free(u.ram); return u.dev[0x0f] & 0x7f; } diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -41,7 +41,7 @@ WITH REGARD TO THIS SOFTWARE. #define WIDTH 64 * 8 #define HEIGHT 40 * 8 -#define PAD 4 +#define PAD 2 #define TIMEOUT_MS 334 #define BENCH 0 @@ -52,7 +52,7 @@ static SDL_AudioDeviceID audio_id; static SDL_Rect gRect; static SDL_Thread *stdin_thread; -Uint16 deo_mask[] = {0xff08, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; +Uint16 deo_mask[] = {0xff28, 0x0300, 0xc028, 0x8000, 0x8000, 0x8000, 0x8000, 0x0000, 0x0000, 0x0000, 0xa260, 0xa260, 0x0000, 0x0000, 0x0000, 0x0000}; Uint16 dei_mask[] = {0x0000, 0x0000, 0x003c, 0x0014, 0x0014, 0x0014, 0x0014, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x07ff, 0x0000, 0x0000, 0x0000}; /* devices */