Replace now-invalid macros in projects.

This commit is contained in:
Andrew Alderwick 2022-11-10 21:54:32 +00:00
parent adae0a0348
commit fc3232a8e8
3 changed files with 26 additions and 26 deletions

View File

@ -1,9 +1,9 @@
( uxnasm projects/examples/demos/snake.tal bin/snake.rom && uxnemu bin/snake.rom )
%+ { ADD } %- { SUB } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
%+ { ADD } %/ { DIV }
%< { LTH } %> { GTH } %! { NEQ }
%++ { ADD2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %!! { NEQ2 }
%2/ { #01 SFT } %2* { #10 SFT }
%8// { #03 SFT2 } %8** { #30 SFT2 }
%MOD { DIVk MUL SUB }
@ -65,7 +65,7 @@ BRK
@on-frame ( -> )
.arena/timer LDZ INC DUP .arena/timer STZ
DIFFICULTY = BRK?
DIFFICULTY EQU BRK?
( clear ) #00 ;draw-snake JSR2
( update ) ;move JSR2
@ -82,7 +82,7 @@ BRK
DUP #08 ! ,&no-escape JCN
;reset JSR2
&no-escape
#04 SFT DUP #00 = ,&skip JCN
#04 SFT DUP #00 EQU ,&skip JCN
DUP .snake/direction STZ
&skip
POP
@ -94,8 +94,8 @@ BRK
#00 ;draw-snake JSR2
#00 ;draw-apple JSR2
.arena/w LDZ 2/ #01 - .snake/x STZ
.arena/h LDZ 2/ #01 - .snake/y STZ
.arena/w LDZ 2/ #01 SUB .snake/x STZ
.arena/h LDZ 2/ #01 SUB .snake/y STZ
#00 .snake/dead STZ
#00 .snake/length STZ
#00 .snake/direction STZ
@ -117,11 +117,11 @@ RTN
POP2
POP2r
.snake/dead LDZ #00 = JMP RTN
.snake/dead LDZ #00 EQU JMP RTN
.snake/direction LDZ
DUP #01 ! ,&no-up JCN
.snake/y LDZ #01 -
.snake/y LDZ #01 SUB
.arena/h LDZ MAX
.snake/y STZ
&no-up
@ -131,7 +131,7 @@ RTN
.snake/y STZ
&no-down
DUP #04 ! ,&no-left JCN
.snake/x LDZ #01 -
.snake/x LDZ #01 SUB
.arena/w LDZ MAX
.snake/x STZ
&no-left

View File

@ -1,9 +1,9 @@
( art by @ritualdust )
%+ { ADD } %- { SUB } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
%+ { ADD } %/ { DIV }
%< { LTH } %> { GTH } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %!! { NEQ2 }
%8** { #30 SFT2 }
%10** { #40 SFT2 }
@ -13,7 +13,7 @@
%RTN { JMP2r }
%TOS { #00 SWP }
%DEC { #01 - }
%DEC { #01 SUB }
%MOUSE { #82 }
@ -45,8 +45,8 @@
#036f .System/g DEO2
#003f .System/b DEO2
.Screen/width DEI2 #01 SFT2 #0040 -- .room/x STZ2
.Screen/height DEI2 #01 SFT2 #0040 -- .room/y STZ2
.Screen/width DEI2 #01 SFT2 #0040 SUB2 .room/x STZ2
.Screen/height DEI2 #01 SFT2 #0040 SUB2 .room/y STZ2
( vectors )
;on-frame .Screen/vector DEO2

View File

@ -2,10 +2,10 @@
( uxnasm rule110.tal rule110.rom && uxnemu rule110.rom )
%+ { ADD } %- { SUB } %* { MUL } %/ { DIV }
%< { LTH } %> { GTH } %= { EQU } %! { NEQ }
%++ { ADD2 } %-- { SUB2 } %** { MUL2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %== { EQU2 } %!! { NEQ2 }
%+ { ADD } %* { MUL } %/ { DIV }
%< { LTH } %> { GTH } %! { NEQ }
%++ { ADD2 } %** { MUL2 } %// { DIV2 }
%<< { LTH2 } %>> { GTH2 } %!! { NEQ2 }
%2* { #10 SFT } %2/ { #01 SFT } %2** { #10 SFT2 } %2// { #01 SFT2 }
%4* { #20 SFT } %4/ { #02 SFT } %4** { #20 SFT2 } %4// { #02 SFT2 }
@ -76,11 +76,11 @@ RTN
#1000
&loop
DUP #00 SWP 8** .Screen/x DEO2
( shift ) INCk #10 SWP -
( shift ) INCk #10 SWP SUB
( get address ) STHkr 2* LDZ2
( bit ) ROT SFT2 #0001 AND2
( get sprite ) 8** ;cell-icns ++ .Screen/addr DEO2
#01 STHkr #00 = + .Screen/sprite DEO
#01 STHkr #00 EQU + .Screen/sprite DEO
INC GTHk ,&loop JCN
POP2
POPr
@ -123,14 +123,14 @@ RTN
.Mouse/y DEI2 DUP2 ,&y STR2 .Screen/y DEO2
( colorize on state )
#43 [ .Mouse/state DEI #00 ! ] - .Screen/sprite DEO
#43 [ .Mouse/state DEI #00 ! ] SUB .Screen/sprite DEO
( on click )
.Mouse/state DEI #00 ! JMP BRK
( toggle bit )
.input LDZ2k
#0001 .Mouse/x DEI2 8// #000f SWP2 -- NIP #40 SFT SFT2 EOR2
#0001 .Mouse/x DEI2 8// #000f SWP2 SUB2 NIP #40 SFT SFT2 EOR2
ROT STZ2
;render JSR2
( release ) #00 .Mouse/state DEO