From 5571e0a92b1c97f8adc58dc236fd0b90b805c114 Mon Sep 17 00:00:00 2001 From: Devine Lu Linvega Date: Sun, 30 Jun 2024 20:59:18 -0800 Subject: [PATCH] Do not pass memory to console deo --- src/devices/console.c | 3 ++- src/devices/console.h | 2 +- src/uxn11.c | 2 +- src/uxncli.c | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/devices/console.c b/src/devices/console.c index 4bb848c..f6eb773 100644 --- a/src/devices/console.c +++ b/src/devices/console.c @@ -215,9 +215,10 @@ console_dei(Uint8 addr) } void -console_deo(Uint8 *d, Uint8 port) +console_deo(Uint8 port) { FILE *fd = NULL; + Uint8 *d = &uxn.dev[0x10]; switch(port) { case 0x5: /* Console/dead */ start_fork(d); break; case 0x6: /* Console/exit*/ kill_child(d, 0); break; diff --git a/src/devices/console.h b/src/devices/console.h index 9c22617..36d7c5e 100644 --- a/src/devices/console.h +++ b/src/devices/console.h @@ -17,4 +17,4 @@ WITH REGARD TO THIS SOFTWARE. int console_input(char c, int type); void console_listen(int i, int argc, char **argv); Uint8 console_dei(Uint8 addr); -void console_deo(Uint8 *d, Uint8 port); +void console_deo(Uint8 port); diff --git a/src/uxn11.c b/src/uxn11.c index 15323b0..646ff6c 100644 --- a/src/uxn11.c +++ b/src/uxn11.c @@ -67,7 +67,7 @@ emu_deo(Uint8 addr, Uint8 value) if(p > 0x7 && p < 0xe) screen_palette(&uxn.dev[0x8]); break; - case 0x10: console_deo(&uxn.dev[d], p); break; + case 0x10: console_deo(p); break; case 0x20: screen_deo(p); break; case 0xa0: file_deo(0, &uxn.dev[d], p); break; case 0xb0: file_deo(1, &uxn.dev[d], p); break; diff --git a/src/uxncli.c b/src/uxncli.c index 526e823..80f3640 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -38,7 +38,7 @@ emu_deo(Uint8 addr, Uint8 value) uxn.dev[addr] = value; switch(d) { case 0x00: system_deo(p); break; - case 0x10: console_deo(&uxn.dev[d], p); break; + case 0x10: console_deo(p); break; case 0xa0: file_deo(0, &uxn.dev[d], p); break; case 0xb0: file_deo(1, &uxn.dev[d], p); break; }