From 210be1f458ed051f37dea898a751b1ebbf125748 Mon Sep 17 00:00:00 2001 From: neauoire Date: Mon, 28 Jun 2021 10:07:49 -0700 Subject: [PATCH] Added console changes to uxncli --- src/uxncli.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/uxncli.c b/src/uxncli.c index 80ec9f7..543c868 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -45,16 +45,8 @@ printstack(Stack *s) void console_talk(Device *d, Uint8 b0, Uint8 w) { - char buffer[7], *p = buffer; - int len = 0; - if(!w) return; - switch(b0) { - case 0x8: len = 1, p = (char *)&d->dat[0x8]; break; - case 0x9: len = sprintf(p, "0x%02x", d->dat[0x9]); break; - case 0xb: len = sprintf(p, "0x%04x", mempeek16(d->dat, 0xa)); break; - case 0xd: len = strlen(p = (char *)&d->mem[mempeek16(d->dat, 0xc)]); break; - } - if(len) write(1, p, len); + if(w && b0 == 0x8) + write(1, (char *)&d->dat[0x8], 1); } void