More flag work.

This commit is contained in:
Martin Haye 2018-02-14 09:42:54 -08:00
parent ab5c423bc0
commit e65956a8a0

View File

@ -325,12 +325,14 @@ castRay: !zone
lda deltaDistX ; re-init X distance lda deltaDistX ; re-init X distance
sta sideDistX sta sideDistX
lda (pMap),y ; check map at current X/Y position 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. beq .DDA_step ; nothing there? do another step.
bpl .hitX bpl .hitX
jmp .hitSprite jmp .hitSprite
; We hit something! ; We hit something!
.hitX: !if DEBUG >= 2 { +prStr : !text " Hit.",0 } .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 sta txNum ; store the texture number we hit
lda #0 lda #0
sec sec
@ -382,12 +384,14 @@ castRay: !zone
lda deltaDistY ; re-init Y distance lda deltaDistY ; re-init Y distance
sta sideDistY sta sideDistY
lda (pMap),y ; check map at current X/Y position lda (pMap),y ; check map at current X/Y position
and #NOTFLG_AUTOMAP ; mask off automap mark
bmi .hitSprite bmi .hitSprite
bne .hitY ; nothing there? do another step. bne .hitY ; nothing there? do another step.
jmp .DDA_step jmp .DDA_step
.hitY: ; We hit something! .hitY: ; We hit something!
!if DEBUG >= 2 { +prStr : !text " Hit.",0 } !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 sta txNum ; store the texture number we hit
lda #0 lda #0
sec sec
@ -415,11 +419,13 @@ castRay: !zone
!if DEBUG >= 2 { jsr .debugFinal } !if DEBUG >= 2 { jsr .debugFinal }
rts rts
.hitSprite: .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 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, ; We found a sprite cell on the map. We only want to process this sprite once,
; so check if we've already done it. ; so check if we've already done it.
tax
and #FLG_SPDONE and #FLG_SPDONE
beq .notDone ; already done, don't do again beq .notDone ; already done, don't do again
txa txa