From 39c47c9571d22f920a0014d49cbfa2590fa5f187 Mon Sep 17 00:00:00 2001 From: neauoire Date: Fri, 19 Mar 2021 20:38:20 -0700 Subject: [PATCH] Fixed broken example --- build.sh | 2 +- projects/examples/dev.controller.usm | 13 ++++++------- projects/examples/gui.editor.usm | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index a65f69a..9bc2dea 100755 --- a/build.sh +++ b/build.sh @@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr # cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator # run -./bin/assembler projects/software/noodle.usm bin/boot.rom +./bin/assembler projects/software/left.usm bin/boot.rom ./bin/emulator bin/boot.rom diff --git a/projects/examples/dev.controller.usm b/projects/examples/dev.controller.usm index ee732f1..40e74a5 100644 --- a/projects/examples/dev.controller.usm +++ b/projects/examples/dev.controller.usm @@ -3,7 +3,6 @@ %++ { #0001 ADD2 } %-- { #0001 SUB2 } %2/ { #0002 DIV2 } -%JMC2 { ROT JMP2? POP2 } ;slime { color 1 } @@ -27,21 +26,21 @@ BRK ( hold ctrl key to change slime color ) ~Controller.buttons #0f AND - DUP #01 NEQ ,$no-ctrl JMC2 #05 =slime $no-ctrl - DUP #02 NEQ ,$no-alt JMC2 #0f =slime $no-alt + DUP #01 NEQ ,$no-ctrl ROT JMP2? #05 =slime $no-ctrl + DUP #02 NEQ ,$no-alt ROT JMP2? #0f =slime $no-alt POP ( clear ) #10 =Sprite.color ( detect movement ) ~Controller.buttons #f0 AND - DUP #04 SHR #01 AND #01 NEQ ,$no-up JMC2 + DUP #04 SHR #01 AND #01 NEQ ,$no-up ROT JMP2? ( move ) ~Sprite.y -- =Sprite.y ,up_icn =Sprite.addr $no-up - DUP #05 SHR #01 AND #01 NEQ ,$no-down JMC2 + DUP #05 SHR #01 AND #01 NEQ ,$no-down ROT JMP2? ( move ) ~Sprite.y ++ =Sprite.y ,down_icn =Sprite.addr $no-down - DUP #06 SHR #01 AND #01 NEQ ,$no-left JMC2 + DUP #06 SHR #01 AND #01 NEQ ,$no-left ROT JMP2? ( move ) ~Sprite.x -- =Sprite.x ,left_icn =Sprite.addr $no-left - DUP #07 SHR #01 AND #01 NEQ ,$no-right JMC2 + DUP #07 SHR #01 AND #01 NEQ ,$no-right ROT JMP2? ( move ) ~Sprite.x ++ =Sprite.x ,right_icn =Sprite.addr $no-right POP diff --git a/projects/examples/gui.editor.usm b/projects/examples/gui.editor.usm index 95fa35c..244f3f3 100644 --- a/projects/examples/gui.editor.usm +++ b/projects/examples/gui.editor.usm @@ -47,7 +47,7 @@ BRK ( load ) ~editor.addr ~Mouse.y ~editor.y1 SUB2 #0008 DIV2 ADD2 LDR ( mask ) #01 #07 ~Mouse.x ~editor.x1 SUB2 #0008 DIV2 SWP POP SUB SHL - XOR + ORA ( save ) ~editor.addr ~Mouse.y ~editor.y1 SUB2 #0008 DIV2 ADD2 STR ,draw-window JSR2