commit 41d0911d136f314df53937ecb9275ea07e922578
parent 1a7af4d8d0de7c63f119cc031df4656d818b4353
Author: neauoire <aliceffekt@gmail.com>
Date: Thu, 6 Jan 2022 19:51:34 -0800
The supervisor program now uses its own vectors
Diffstat:
3 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/projects/software/supervisor.tal b/projects/software/supervisor.tal
@@ -36,14 +36,13 @@
@center
&x $2 &y $2
-
@modal
&x $2 &y $2
( init )
|0100 ( -> )
-
+
.Screen/width DEI2 2//
DUP2 .center/x STZ2
MODALW #31 SFT2 -- .modal/x STZ2
@@ -51,11 +50,17 @@
DUP2 .center/y STZ2
MODALH #31 SFT2 -- .modal/y STZ2
+ ( vectors )
+ ;on-error .System/vector DEO2
+ ;on-frame .Screen/vector DEO2
+
+BRK
+
+@on-frame ( -> )
+
;draw-cross JSR2
;draw-stacks JSR2
- EADDR LDA2 #0000 !! ;on-error JCN2
-
BRK
@on-error ( -> )
diff --git a/src/devices/system.c b/src/devices/system.c
@@ -31,7 +31,7 @@ uxn_halt(Uxn *u, Uint8 error, Uint16 addr)
Uint16 vec = d->vector;
DEVPOKE16(0x4, addr);
d->dat[0x6] = error;
- uxn_eval(&supervisor, PAGE_PROGRAM);
+ uxn_eval(&supervisor, supervisor.dev[0].vector);
if(vec) {
d->vector = 0; /* need to rearm to run System/vector again */
if(error != 2) /* working stack overflow has special treatment */
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -309,6 +309,8 @@ start(Uxn *u, char *rom)
uxn_port(&supervisor, 0x1, nil_dei, console_deo);
uxn_port(&supervisor, 0x2, screen_dei, screen_deo);
+ uxn_eval(&supervisor, PAGE_PROGRAM);
+
if(!uxn_eval(u, PAGE_PROGRAM))
return error("Boot", "Failed to start rom.");
@@ -485,7 +487,7 @@ run(Uxn *u)
console_input(u, event.cbutton.button);
}
if(devsystem->dat[0xe])
- uxn_eval(&supervisor, PAGE_PROGRAM);
+ uxn_eval(&supervisor, supervisor.dev[2].vector);
uxn_eval(u, devscreen->vector);
if(uxn_screen.fg.changed || uxn_screen.bg.changed || devsystem->dat[0xe])
redraw();