diff --git a/ray/src/ray.tal b/ray/src/ray.tal index e789230..090ca17 100644 --- a/ray/src/ray.tal +++ b/ray/src/ray.tal @@ -53,32 +53,29 @@ BRK POP #00 ,&rate STR .Controller/button DEI - DUP #10 NEQ ,&no-u JCN - .player/r LDZ2 #0008 ;raycast JSR2 + DUP #10 AND #00 EQU ,&no-u JCN + .player/r LDZ2 #0006 ;raycast JSR2 .player/y STZ2 .player/x STZ2 - ;update JSR2 &no-u - DUP #20 NEQ ,&no-d JCN + DUP #20 AND #00 EQU ,&no-d JCN .player/y LDZ2k #0001 ADD2 ROT STZ2 - ;update JSR2 &no-d - DUP #40 NEQ ,&no-l JCN + DUP #40 AND #00 EQU ,&no-l JCN .player/x LDZ2k #0001 SUB2 ROT STZ2 - ;update JSR2 &no-l - DUP #80 NEQ ,&no-r JCN + DUP #80 AND #00 EQU ,&no-r JCN .player/x LDZ2k #0001 ADD2 ROT STZ2 - ;update JSR2 &no-r - DUP #01 NEQ ,&no-a JCN + DUP #01 AND #00 EQU ,&no-a JCN .player/r LDZ2k #0010 SUB2 #03ff AND2 ROT STZ2 - ;update JSR2 &no-a - DUP #02 NEQ ,&no-b JCN + DUP #02 AND #00 EQU ,&no-b JCN .player/r LDZ2k #0010 ADD2 #03ff AND2 ROT STZ2 - ;update JSR2 &no-b + DUP #00 EQU ,&no-null JCN + ;update JSR2 + &no-null POP BRK @@ -110,7 +107,7 @@ JMP2r #00 .Screen/auto DEO #00c0 #0000 &h - DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2 + DUP2 #0090 ADD2 .Screen/x DEO2 DUP2 .player/r LDZ2 #0060 SUB2 ADD2 #03ff AND2 ;ray-tile JSR2 ;draw-col JSR2 INC2 GTH2k ,&h JCN @@ -198,7 +195,7 @@ JMP2r ,&angle STR2 #0200 #0001 &r - DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 + [ LIT2 &angle $2 ] OVR2 ;raycast JSR2 DUP2 ,&y STR2 OVR2 ,&x STR2 ;get-tile JSR2 ,&end JCN @@ -215,7 +212,7 @@ JMP2r #0200 #0001 &r DUP2 ,&distance STR2 - DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 + [ LIT2 &angle $2 ] OVR2 ;raycast JSR2 ;get-tile JSR2 DUP ,&color STR ,&end JCN