(uxncore) Housekeeping

This commit is contained in:
Devine Lu Linvega 2024-06-29 19:12:56 -08:00
parent b0ca1dc05e
commit e89d67b8c1
1 changed files with 7 additions and 14 deletions

View File

@ -19,8 +19,8 @@ static void
system_print(Stack *s) system_print(Stack *s)
{ {
Uint8 i; Uint8 i;
for(i = s->ptr - 7; i != (Uint8)(s->ptr + 1); i++) for(i = s->ptr - 7; i != (Uint8)(s->ptr); i++)
fprintf(stderr, "%02x%c", s->dat[i], i == 2 ? '|' : ' '); fprintf(stderr, "%02x%c", s->dat[i], i == 1 ? '|' : ' ');
fprintf(stderr, "< \n"); fprintf(stderr, "< \n");
} }
@ -116,23 +116,16 @@ uxn_eval(Uint16 pc)
} }
} }
void
console_input(char c, int type)
{
uxn.dev[0x12] = c, uxn.dev[0x17] = type;
uxn_eval(uxn.dev[0x10] << 8 | uxn.dev[0x11]);
}
int int
main(int argc, char **argv) main(int argc, char **argv)
{ {
/* test */
uxn.ram[0x100] = 0xa0; uxn.ram[0x100] = 0xa0;
uxn.ram[0x101] = 0x12; uxn.ram[0x101] = 0x12;
uxn.ram[0x102] = 0x34; uxn.ram[0x102] = 0x34;
if(uxn_eval(0x0100) && (uxn.dev[0x10] << 8 | uxn.dev[0x11])) { uxn.ram[0x103] = 0x01;
while(!uxn.dev[0x0f]) {
if(uxn_eval(0x0100) && (uxn.dev[0x10] << 8 | uxn.dev[0x11]))
} while(!uxn.dev[0x0f]) ;
}
return uxn.dev[0x0f] & 0x7f; return uxn.dev[0x0f] & 0x7f;
} }