Added device support error

This commit is contained in:
Devine Lu Linvega 2023-07-13 10:57:48 -07:00
parent c53ca56775
commit 11249a9e52
1 changed files with 14 additions and 17 deletions

View File

@ -13,7 +13,7 @@
@on-reset ( -> )
.Console/type DEI ?&>has-arg
;dict/usage &err <print-str>
;dict/usage <print-str>
#010f DEO
BRK &>has-arg
;on-waitsrc .Console/vector DEO2
@ -42,16 +42,14 @@
[ LIT2 00 -emu/sleep ] STZ
#0000
&w ( -- )
<step> POP
<step>
.uxn/err LDZ ?&err
.emu/sleep LDZ ?&end
#00 EQU ?&end
INC2 ORAk ?&w
&end POP2
( TODO: Catch too long ) JMP2r
&err ( -- )
POP2 #00 ;wst/ptr STA
#00 ;rst/ptr STA
JMP2r
&end ( -- )
POP2 JMP2r
&err ( opcode -- )
POP !<reset>
@halt ( opcode -- opcode )
#01 .emu/sleep STZ
@ -65,18 +63,16 @@
DUP #0f NEQ ?&>no-halt
&>no-halt
DUP #18 NEQ ?&>no-out
POP #18 DEO
POP JMP2r &>no-out
POP NIP #18 DEO
JMP2r &>no-out
DUP #19 NEQ ?&>no-err
POP #19 DEO
POP JMP2r &>no-err
POP NIP #19 DEO
JMP2r &>no-err
( | error )
LIT "! #18 DEO
;dict/err-device <print-str>
<phex>/b
#2018 DEO
<phex>
#0a18 DEO
JMP2r
POP2 JMP2r
(
@|stdlib )
@ -125,6 +121,7 @@
@dict &usage "usage: 20 "uxnvm.rom 20 "game.rom 0a $1
&bytes-free 20 "bytes 20 "free. 0a $1
&err-device "Unsupported 20 "device: 20 $1
~vm.tal