(snake.rom) Minor optimizations

This commit is contained in:
Devine Lu Linvega 2021-11-11 09:10:45 -05:00
parent 6e28039b37
commit 912afb678f
1 changed files with 6 additions and 7 deletions

View File

@ -7,12 +7,12 @@
%2/ { #01 SFT } %2* { #10 SFT }
%8// { #03 SFT2 } %8** { #30 SFT2 }
%MOD { DIVk MUL SUB }
%MAX { LTHk JMP SWP POP }
%RTN { JMP2r }
%TOS { #00 SWP }
%SWP? { #01 JCN SWP }
%RTN? { #01 JCN RTN }
%BRK? { #01 JCN BRK }
%DIFFICULTY { #06 }
( devices )
@ -117,12 +117,12 @@ RTN
POP2
POP2r
.snake/dead LDZ #00 = RTN?
.snake/dead LDZ #00 = JMP RTN
.snake/direction LDZ
DUP #01 ! ,&no-up JCN
.snake/y LDZ #01 -
.arena/h LDZ LTHk SWP? POP
.arena/h LDZ MAX
.snake/y STZ
&no-up
DUP #02 ! ,&no-down JCN
@ -132,7 +132,7 @@ RTN
&no-down
DUP #04 ! ,&no-left JCN
.snake/x LDZ #01 -
.arena/w LDZ LTHk SWP? POP
.arena/w LDZ MAX
.snake/x STZ
&no-left
DUP #08 ! ,&no-right JCN
@ -160,7 +160,6 @@ RTN
INC GTHk ,&loop-body JCN
POP2
RTN
@add-apple ( -- )