From 52d5e2d694c03b5c272909756563c9231197a7b5 Mon Sep 17 00:00:00 2001 From: neauoire Date: Thu, 26 Aug 2021 20:12:56 -0700 Subject: [PATCH] Single vector uxncli --- src/uxncli.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/uxncli.c b/src/uxncli.c index 6038206..241984b 100644 --- a/src/uxncli.c +++ b/src/uxncli.c @@ -132,9 +132,13 @@ uxn_halt(Uxn *u, Uint8 error, char *name, int id) static void run(Uxn *u) { - uxn_eval(u, PAGE_PROGRAM); - while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0)) - uxn_eval(u, mempeek16(devconsole->dat, 0)); + Uint16 vec = PAGE_PROGRAM; + uxn_eval(u, vec); + while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0)) { + vec = mempeek16(devconsole->dat, 0); + if (!vec) vec = u->ram.ptr; /* continue after last BRK */ + uxn_eval(u, vec); + } } static int