Upscaled world

This commit is contained in:
neauoire 2022-09-11 10:31:59 -07:00
parent 6bc22473c7
commit ac4450885f
1 changed files with 21 additions and 14 deletions

View File

@ -36,8 +36,8 @@
;on-mouse .Mouse/vector DEO2 ;on-mouse .Mouse/vector DEO2
;on-button .Controller/vector DEO2 ;on-button .Controller/vector DEO2
#0060 .player/x STZ2 #0060 #10 SFT2 .player/x STZ2
#0070 .player/y STZ2 #0070 #10 SFT2 .player/y STZ2
;update JSR2 ;update JSR2
@ -50,7 +50,7 @@ BRK
.Controller/button DEI .Controller/button DEI
DUP #10 NEQ ,&no-u JCN DUP #10 NEQ ,&no-u JCN
.player/r LDZ2 #0002 ;raycast JSR2 .player/r LDZ2 #0004 ;raycast JSR2
.player/y STZ2 .player/y STZ2
.player/x STZ2 .player/x STZ2
;update JSR2 ;update JSR2
@ -117,7 +117,7 @@ JMP2r
@draw-col ( distance* color -- ) @draw-col ( distance* color -- )
#04 SFT ,&color STR #04 SFT ,&color STR
( TODO ) NIP #01 SFT2 NIP
STH STH
#8000 #8000
&l &l
@ -163,29 +163,35 @@ JMP2r
( draw player ) ( draw player )
.player/x LDZ2 #0003 SUB2 .Screen/x DEO2 .player/x LDZ2 #01 SFT2 #0003 SUB2 .Screen/x DEO2
.player/y LDZ2 #0003 SUB2 .Screen/y DEO2 .player/y LDZ2 #01 SFT2 #0003 SUB2 .Screen/y DEO2
;player-icn .Screen/addr DEO2 ;player-icn .Screen/addr DEO2
#05 .Screen/sprite DEO #05 .Screen/sprite DEO
.player/x LDZ2 .player/y LDZ2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2
.player/r LDZ2 ;ray-pos JSR2 .player/r LDZ2 ;ray-pos JSR2 ;to-scale JSR2
#01 ;draw-line JSR2 #01 ;draw-line JSR2
.player/x LDZ2 .player/y LDZ2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2
.player/r LDZ2 #0040 SUB2 #03ff AND2 ;ray-pos JSR2 .player/r LDZ2 #0040 SUB2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2
#02 ;draw-line JSR2 #02 ;draw-line JSR2
.player/x LDZ2 .player/y LDZ2 .player/x LDZ2 .player/y LDZ2 ;to-scale JSR2
.player/r LDZ2 #0040 ADD2 #03ff AND2 ;ray-pos JSR2 .player/r LDZ2 #0040 ADD2 #03ff AND2 ;ray-pos JSR2 ;to-scale JSR2
#02 ;draw-line JSR2 #02 ;draw-line JSR2
JMP2r JMP2r
@to-scale ( x* y* -- x* y* )
SWP2 #01 SFT2 SWP2 #01 SFT2
JMP2r
@ray-pos ( angle* -- x* y* ) @ray-pos ( angle* -- x* y* )
,&angle STR2 ,&angle STR2
#0100 #0001 #0200 #0001
&r &r
DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2
DUP2 ,&y STR2 DUP2 ,&y STR2
@ -201,7 +207,7 @@ JMP2r
@ray-tile ( angle* -- distance* color ) @ray-tile ( angle* -- distance* color )
,&angle STR2 ,&angle STR2
#0100 #0001 #0200 #0001
&r &r
DUP2 ,&distance STR2 DUP2 ,&distance STR2
DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2 DUP2 [ LIT2 &angle $2 ] SWP2 ;raycast JSR2
@ -228,6 +234,7 @@ JMP2r
@get-tile ( x* y* -- tile ) @get-tile ( x* y* -- tile )
;to-scale JSR2
#43 SFT2 SWP2 #03 SFT2 ADD2 #0003 MUL2 #43 SFT2 SWP2 #03 SFT2 ADD2 #0003 MUL2
;nametable ADD2 LDA2 NIP ;nametable ADD2 LDA2 NIP