Faster raycast-pos
This commit is contained in:
parent
0fe97c02e4
commit
ea67f4a700
|
@ -166,18 +166,15 @@ JMP2r
|
|||
;player-icn .Screen/addr DEO2
|
||||
#05 .Screen/sprite DEO
|
||||
|
||||
.player/x LDZ2
|
||||
.player/y LDZ2
|
||||
.player/x LDZ2 .player/y LDZ2
|
||||
.player/r LDZ2 ;ray-pos JSR2
|
||||
#01 ;draw-line JSR2
|
||||
|
||||
.player/x LDZ2
|
||||
.player/y LDZ2
|
||||
.player/x LDZ2 .player/y LDZ2
|
||||
.player/r LDZ2 #0040 SUB2 #03ff AND2 ;ray-pos JSR2
|
||||
#02 ;draw-line JSR2
|
||||
|
||||
.player/x LDZ2
|
||||
.player/y LDZ2
|
||||
.player/x LDZ2 .player/y LDZ2
|
||||
.player/r LDZ2 #0040 ADD2 #03ff AND2 ;ray-pos JSR2
|
||||
#02 ;draw-line JSR2
|
||||
|
||||
|
@ -189,14 +186,13 @@ JMP2r
|
|||
#ff01
|
||||
&r
|
||||
#00 OVR [ LIT2 &angle $2 ] SWP2 ;raycast JSR2
|
||||
OVR2 OVR2 ;get-tile JSR2
|
||||
DUP #00 EQU ,&continue JCN
|
||||
POP ROT2 POP2 JMP2r
|
||||
&continue
|
||||
POP POP2 POP2
|
||||
DUP2 ,&y STR2
|
||||
OVR2 ,&x STR2
|
||||
;get-tile JSR2 ,&end JCN
|
||||
INC GTHk ,&r JCN
|
||||
&end
|
||||
POP2
|
||||
#0000 #0000
|
||||
( res ) [ LIT2 &x $2 ] [ LIT2 &y $2 ]
|
||||
|
||||
JMP2r
|
||||
|
||||
|
|
Loading…
Reference in New Issue