mirror of
https://github.com/robmcmullen/fujirun.git
synced 2024-12-28 23:30:22 +00:00
Added ACTOR_FLAG to set high bit on text page at enemy location
This commit is contained in:
parent
4b0c7ead49
commit
4da5a2631e
@ -52,6 +52,8 @@ TILE_HORZ = TILE_LEFT|TILE_RIGHT
|
|||||||
TILE_VERT = TILE_UP|TILE_DOWN
|
TILE_VERT = TILE_UP|TILE_DOWN
|
||||||
DIR_MASK = $0f
|
DIR_MASK = $0f
|
||||||
TILE_DOT = $10
|
TILE_DOT = $10
|
||||||
|
ACTOR_FLAG = $80
|
||||||
|
ACTOR_FLAG_MASK = $7f
|
||||||
CLEAR_TILE_DOT = $ef ;%11101111
|
CLEAR_TILE_DOT = $ef ;%11101111
|
||||||
|
|
||||||
LEFT_TILE = TILE_DOT|TILE_RIGHT
|
LEFT_TILE = TILE_DOT|TILE_RIGHT
|
||||||
|
BIN
fujirun-v1.dsk
BIN
fujirun-v1.dsk
Binary file not shown.
22
logic.s
22
logic.s
@ -108,6 +108,28 @@ has_dot nop
|
|||||||
and #TILE_DOT
|
and #TILE_DOT
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
clear_actor_flag nop
|
||||||
|
lda actor_row,x
|
||||||
|
tay
|
||||||
|
jsr mazerow
|
||||||
|
lda actor_col,x
|
||||||
|
tay
|
||||||
|
lda (mazeaddr),y
|
||||||
|
and #ACTOR_FLAG_MASK
|
||||||
|
sta (mazeaddr),y
|
||||||
|
rts
|
||||||
|
|
||||||
|
set_actor_flag nop
|
||||||
|
lda actor_row,x
|
||||||
|
tay
|
||||||
|
jsr mazerow
|
||||||
|
lda actor_col,x
|
||||||
|
tay
|
||||||
|
lda (mazeaddr),y
|
||||||
|
ora #ACTOR_FLAG
|
||||||
|
sta (mazeaddr),y
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
; # Determine the tile location given the direction of the actor's movement
|
; # Determine the tile location given the direction of the actor's movement
|
||||||
; def get_next_tile(r, c, dir):
|
; def get_next_tile(r, c, dir):
|
||||||
|
2
main.s
2
main.s
@ -230,7 +230,9 @@ game_loop nop
|
|||||||
lda actor_active,x
|
lda actor_active,x
|
||||||
bmi ?player ; negative = end
|
bmi ?player ; negative = end
|
||||||
beq ?enemy ; zero = skip
|
beq ?enemy ; zero = skip
|
||||||
|
jsr clear_actor_flag
|
||||||
jsr move_enemy
|
jsr move_enemy
|
||||||
|
jsr set_actor_flag
|
||||||
jmp ?enemy
|
jmp ?enemy
|
||||||
|
|
||||||
?player lda #0
|
?player lda #0
|
||||||
|
@ -460,13 +460,14 @@ draw_to_page2 lda #$60
|
|||||||
; image with tile 15 when necessary
|
; image with tile 15 when necessary
|
||||||
fastfont nop
|
fastfont nop
|
||||||
cmp #12
|
cmp #12
|
||||||
bne fastfont_smc
|
bne ?2
|
||||||
txa
|
txa
|
||||||
and #1
|
and #1
|
||||||
bne ?1
|
bne ?1
|
||||||
lda #15
|
lda #15
|
||||||
bne fastfont_smc
|
bne ?2
|
||||||
?1 lda #12
|
?1 lda #12
|
||||||
|
?2 and #ACTOR_FLAG_MASK
|
||||||
fastfont_smc jmp $ffff
|
fastfont_smc jmp $ffff
|
||||||
|
|
||||||
; restore a horizontal segment from the text page to the current screen
|
; restore a horizontal segment from the text page to the current screen
|
||||||
@ -481,13 +482,14 @@ fasttiles ldx param_col
|
|||||||
sta fasttiles_row_smc+1
|
sta fasttiles_row_smc+1
|
||||||
fasttiles_row_smc lda $ffff,x
|
fasttiles_row_smc lda $ffff,x
|
||||||
cmp #12
|
cmp #12
|
||||||
bne fasttiles_smc
|
bne ?2
|
||||||
txa
|
txa
|
||||||
and #1
|
and #1
|
||||||
bne ?1
|
bne ?1
|
||||||
lda #15
|
lda #15
|
||||||
bne fasttiles_smc
|
bne ?2
|
||||||
?1 lda #12
|
?1 lda #12
|
||||||
|
?2 and #ACTOR_FLAG_MASK
|
||||||
fasttiles_smc jsr $ffff
|
fasttiles_smc jsr $ffff
|
||||||
inx
|
inx
|
||||||
dec param_count
|
dec param_count
|
||||||
|
Loading…
Reference in New Issue
Block a user