diff --git a/cli/uxncore/src/main.c b/cli/uxncore/src/main.c index 23aa9fc..ea016e7 100644 --- a/cli/uxncore/src/main.c +++ b/cli/uxncore/src/main.c @@ -19,8 +19,8 @@ static void system_print(Stack *s) { Uint8 i; - for(i = s->ptr - 7; i != (Uint8)(s->ptr + 1); i++) - fprintf(stderr, "%02x%c", s->dat[i], i == 2 ? '|' : ' '); + for(i = s->ptr - 7; i != (Uint8)(s->ptr); i++) + fprintf(stderr, "%02x%c", s->dat[i], i == 1 ? '|' : ' '); 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 main(int argc, char **argv) { + /* test */ uxn.ram[0x100] = 0xa0; uxn.ram[0x101] = 0x12; uxn.ram[0x102] = 0x34; - if(uxn_eval(0x0100) && (uxn.dev[0x10] << 8 | uxn.dev[0x11])) { - while(!uxn.dev[0x0f]) { - - } - } + uxn.ram[0x103] = 0x01; + + if(uxn_eval(0x0100) && (uxn.dev[0x10] << 8 | uxn.dev[0x11])) + while(!uxn.dev[0x0f]) ; return uxn.dev[0x0f] & 0x7f; }