diff --git a/ray/src/ray.tal b/ray/src/ray.tal index 5547a4e..e789230 100644 --- a/ray/src/ray.tal +++ b/ray/src/ray.tal @@ -36,8 +36,8 @@ ;on-mouse .Mouse/vector DEO2 ;on-button .Controller/vector DEO2 - #0060 #10 SFT2 .player/x STZ2 - #0070 #10 SFT2 .player/y STZ2 + #0060 ( scale ) #10 SFT2 .player/x STZ2 + #0070 ( scale ) #10 SFT2 .player/y STZ2 ;update JSR2 @@ -48,9 +48,13 @@ BRK @on-frame ( -> ) + [ LIT &rate $1 ] INC DUP #03 EQU ,&go JCN + ,&rate STR BRK &go + POP #00 ,&rate STR + .Controller/button DEI DUP #10 NEQ ,&no-u JCN - .player/r LDZ2 #0004 ;raycast JSR2 + .player/r LDZ2 #0008 ;raycast JSR2 .player/y STZ2 .player/x STZ2 ;update JSR2 @@ -68,11 +72,11 @@ BRK ;update JSR2 &no-r DUP #01 NEQ ,&no-a JCN - .player/r LDZ2k #0004 SUB2 #03ff AND2 ROT STZ2 + .player/r LDZ2k #0010 SUB2 #03ff AND2 ROT STZ2 ;update JSR2 &no-a DUP #02 NEQ ,&no-b JCN - .player/r LDZ2k #0004 ADD2 #03ff AND2 ROT STZ2 + .player/r LDZ2k #0010 ADD2 #03ff AND2 ROT STZ2 ;update JSR2 &no-b POP @@ -104,10 +108,10 @@ JMP2r @draw-viewport ( -- ) #00 .Screen/auto DEO - #0080 #0000 + #00c0 #0000 &h DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2 - DUP2 .player/r LDZ2 #0040 SUB2 ADD2 #03ff AND2 + DUP2 .player/r LDZ2 #0060 SUB2 ADD2 #03ff AND2 ;ray-tile JSR2 ;draw-col JSR2 INC2 GTH2k ,&h JCN POP2 POP2 @@ -117,7 +121,7 @@ JMP2r @draw-col ( distance* color -- ) #04 SFT ,&color STR - #01 SFT2 NIP + ( scale ) #01 SFT2 NIP STH #8000 &l @@ -163,8 +167,8 @@ JMP2r ( draw player ) - .player/x LDZ2 #01 SFT2 #0003 SUB2 .Screen/x DEO2 - .player/y LDZ2 #01 SFT2 #0003 SUB2 .Screen/y DEO2 + .player/x LDZ2 ( scale ) #01 SFT2 #0003 SUB2 .Screen/x DEO2 + .player/y LDZ2 ( scale ) #01 SFT2 #0003 SUB2 .Screen/y DEO2 ;player-icn .Screen/addr DEO2 #05 .Screen/sprite DEO @@ -173,18 +177,19 @@ JMP2r #01 ;draw-line JSR2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2 - .player/r LDZ2 #0040 SUB2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 + .player/r LDZ2 #0060 SUB2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 #02 ;draw-line JSR2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2 - .player/r LDZ2 #0040 ADD2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 + .player/r LDZ2 #0060 ADD2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2 #02 ;draw-line JSR2 JMP2r @to-scale ( x* y* -- x* y* ) - SWP2 #01 SFT2 SWP2 #01 SFT2 + ( scale ) SWP2 #01 SFT2 + ( scale ) SWP2 #01 SFT2 JMP2r