0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-04 21:35:04 +00:00

(snake.rom) Minor optimizations

This commit is contained in:
Devine Lu Linvega 2021-11-11 09:22:07 -05:00
parent 912afb678f
commit c63a8fa882

View file

@ -143,7 +143,7 @@ RTN
POP POP
( detect collision with apple ) ( detect collision with apple )
.snake/x LDZ2 .apple/x LDZ2 [ ROT = ROT ROT = #0101 !! ] ,&no-collision-apple JCN .snake/x LDZ2 .apple/x LDZ2 NEQ2 ,&no-collision-apple JCN
#00 ;draw-apple JSR2 #00 ;draw-apple JSR2
.snake/length LDZ INC .snake/length STZ .snake/length LDZ INC .snake/length STZ
;add-apple JSR2 ;add-apple JSR2
@ -153,7 +153,7 @@ RTN
.snake/length LDZ #01 .snake/length LDZ #01
&loop-body &loop-body
( pop ) DUP 2* .snake/tail + LDZ2 ( pop ) DUP 2* .snake/tail + LDZ2
.snake/x LDZ2 [ ROT = ROT ROT = #0101 !! ] ,&no-collision-body JCN .snake/x LDZ2 NEQ2 ,&no-collision-body JCN
#01 .snake/dead STZ #01 .snake/dead STZ
#03 ;draw-snake JSR2 #03 ;draw-snake JSR2
&no-collision-body &no-collision-body