Browse code

Single vector uxncli

neauoire authored on 27/08/2021 03:12:56
Showing 1 changed files
... ...
@@ -132,9 +132,13 @@ uxn_halt(Uxn *u, Uint8 error, char *name, int id)
132 132
 static void
133 133
 run(Uxn *u)
134 134
 {
135
-	uxn_eval(u, PAGE_PROGRAM);
136
-	while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0))
137
-		uxn_eval(u, mempeek16(devconsole->dat, 0));
135
+    Uint16 vec = PAGE_PROGRAM;
136
+	uxn_eval(u, vec);
137
+	while((!u->dev[0].dat[0xf]) && (read(0, &devconsole->dat[0x2], 1) > 0)) {
138
+        vec = mempeek16(devconsole->dat, 0);
139
+        if (!vec) vec = u->ram.ptr; /* continue after last BRK */
140
+		uxn_eval(u, vec);
141
+    }
138 142
 }
139 143
 
140 144
 static int