From e65956a8a03d170487d3a33161900af097771db5 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Wed, 14 Feb 2018 09:42:54 -0800 Subject: [PATCH] More flag work. --- Platform/Apple/virtual/src/raycast/render.s | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Platform/Apple/virtual/src/raycast/render.s b/Platform/Apple/virtual/src/raycast/render.s index a7fef605..ac04894a 100644 --- a/Platform/Apple/virtual/src/raycast/render.s +++ b/Platform/Apple/virtual/src/raycast/render.s @@ -325,12 +325,14 @@ castRay: !zone lda deltaDistX ; re-init X distance sta sideDistX lda (pMap),y ; check map at current X/Y position - and #NOTFLG_AUTOMAP ; mask off automap mark beq .DDA_step ; nothing there? do another step. bpl .hitX jmp .hitSprite ; We hit something! .hitX: !if DEBUG >= 2 { +prStr : !text " Hit.",0 } + ora #FLG_AUTOMAP ; remember that this square... + sta (pMap),y ; ...has been seen + and #NOTFLG_AUTOMAP sta txNum ; store the texture number we hit lda #0 sec @@ -382,12 +384,14 @@ castRay: !zone lda deltaDistY ; re-init Y distance sta sideDistY lda (pMap),y ; check map at current X/Y position - and #NOTFLG_AUTOMAP ; mask off automap mark bmi .hitSprite bne .hitY ; nothing there? do another step. jmp .DDA_step .hitY: ; We hit something! !if DEBUG >= 2 { +prStr : !text " Hit.",0 } + ora #FLG_AUTOMAP ; remember that this square... + sta (pMap),y ; ...has been seen + and #NOTFLG_AUTOMAP sta txNum ; store the texture number we hit lda #0 sec @@ -415,11 +419,13 @@ castRay: !zone !if DEBUG >= 2 { jsr .debugFinal } rts .hitSprite: - cmp #NOTFLG_AUTOMAP ; check for special mark at edges of map (was $FF but the automap bit was masked off) + cmp #$FF ; check for special mark at edges of map beq .hitEdge + tax + ora #FLG_AUTOMAP ; remember that this square... + sta (pMap),y ; ...has been seen ; We found a sprite cell on the map. We only want to process this sprite once, ; so check if we've already done it. - tax and #FLG_SPDONE beq .notDone ; already done, don't do again txa