The supervisor program now uses its own vectors

This commit is contained in:
neauoire 2022-01-06 19:51:34 -08:00
parent 1a7af4d8d0
commit 41d0911d13
3 changed files with 13 additions and 6 deletions

View File

@ -36,7 +36,6 @@
@center @center
&x $2 &y $2 &x $2 &y $2
@modal @modal
&x $2 &y $2 &x $2 &y $2
@ -51,11 +50,17 @@
DUP2 .center/y STZ2 DUP2 .center/y STZ2
MODALH #31 SFT2 -- .modal/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-cross JSR2
;draw-stacks JSR2 ;draw-stacks JSR2
EADDR LDA2 #0000 !! ;on-error JCN2
BRK BRK
@on-error ( -> ) @on-error ( -> )

View File

@ -31,7 +31,7 @@ uxn_halt(Uxn *u, Uint8 error, Uint16 addr)
Uint16 vec = d->vector; Uint16 vec = d->vector;
DEVPOKE16(0x4, addr); DEVPOKE16(0x4, addr);
d->dat[0x6] = error; d->dat[0x6] = error;
uxn_eval(&supervisor, PAGE_PROGRAM); uxn_eval(&supervisor, supervisor.dev[0].vector);
if(vec) { if(vec) {
d->vector = 0; /* need to rearm to run System/vector again */ d->vector = 0; /* need to rearm to run System/vector again */
if(error != 2) /* working stack overflow has special treatment */ if(error != 2) /* working stack overflow has special treatment */

View File

@ -309,6 +309,8 @@ start(Uxn *u, char *rom)
uxn_port(&supervisor, 0x1, nil_dei, console_deo); uxn_port(&supervisor, 0x1, nil_dei, console_deo);
uxn_port(&supervisor, 0x2, screen_dei, screen_deo); uxn_port(&supervisor, 0x2, screen_dei, screen_deo);
uxn_eval(&supervisor, PAGE_PROGRAM);
if(!uxn_eval(u, PAGE_PROGRAM)) if(!uxn_eval(u, PAGE_PROGRAM))
return error("Boot", "Failed to start rom."); return error("Boot", "Failed to start rom.");
@ -485,7 +487,7 @@ run(Uxn *u)
console_input(u, event.cbutton.button); console_input(u, event.cbutton.button);
} }
if(devsystem->dat[0xe]) if(devsystem->dat[0xe])
uxn_eval(&supervisor, PAGE_PROGRAM); uxn_eval(&supervisor, supervisor.dev[2].vector);
uxn_eval(u, devscreen->vector); uxn_eval(u, devscreen->vector);
if(uxn_screen.fg.changed || uxn_screen.bg.changed || devsystem->dat[0xe]) if(uxn_screen.fg.changed || uxn_screen.bg.changed || devsystem->dat[0xe])
redraw(); redraw();