Added console changes to uxncli

This commit is contained in:
neauoire 2021-06-28 10:07:49 -07:00
parent 95aa3dba35
commit 210be1f458
1 changed files with 2 additions and 10 deletions

View File

@ -45,16 +45,8 @@ printstack(Stack *s)
void void
console_talk(Device *d, Uint8 b0, Uint8 w) console_talk(Device *d, Uint8 b0, Uint8 w)
{ {
char buffer[7], *p = buffer; if(w && b0 == 0x8)
int len = 0; write(1, (char *)&d->dat[0x8], 1);
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);
} }
void void