diff --git a/ray/src/ray.tal b/ray/src/ray.tal index cba273d..3299443 100644 --- a/ray/src/ray.tal +++ b/ray/src/ray.tal @@ -107,15 +107,17 @@ JMP2r #0080 #0000 &h DUP2 #10 SFT2 #0090 ADD2 .Screen/x DEO2 - DUP2 .player/r LDZ2 #0040 SUB2 ADD2 #03ff AND2 ;ray-tile JSR2 ;draw-col JSR2 + DUP2 .player/r LDZ2 #0040 SUB2 ADD2 #03ff AND2 + ;ray-tile JSR2 ;draw-col JSR2 INC2 GTH2k ,&h JCN POP2 POP2 JMP2r -@draw-col ( distance color -- ) +@draw-col ( distance* color -- ) #04 SFT ,&color STR + ( TODO ) NIP STH #8000 &l @@ -196,20 +198,20 @@ JMP2r JMP2r -@ray-tile ( angle* -- distance color ) +@ray-tile ( angle* -- distance* color ) ,&angle STR2 - #ff01 + #0100 #0001 &r - DUP ,&distance STR - #00 OVR [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 + DUP2 ,&distance STR2 + DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 ;get-tile JSR2 DUP ,&color STR ,&end JCN - INC GTHk ,&r JCN + INC2 GTH2k ,&r JCN &end - POP2 - ( res ) [ LIT &distance $1 ] [ LIT &color $1 ] + POP2 POP2 + ( res ) [ LIT2 &distance $2 ] [ LIT &color $1 ] JMP2r