Fixed broken example

This commit is contained in:
neauoire 2021-03-19 20:38:20 -07:00
parent 71371f86c8
commit 39c47c9571
3 changed files with 8 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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