mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-05 21:34:30 +00:00
climb: clean up erase code
This commit is contained in:
parent
be4c387bae
commit
d12e9ede7a
@ -163,8 +163,8 @@ draw_bird:
|
||||
|
||||
; erase the bird if needed
|
||||
|
||||
ldx #0 ; always in erase slot 0
|
||||
jsr erase_enemy
|
||||
ldy #0 ; always in erase slot 0
|
||||
jsr hgr_partial_restore_by_num
|
||||
|
||||
; only draw bird if it's out
|
||||
|
||||
@ -198,10 +198,10 @@ done_draw_bird:
|
||||
lda #0
|
||||
sta CURRENT_ROCK
|
||||
draw_rock_loop:
|
||||
ldx CURRENT_ROCK
|
||||
ldy CURRENT_ROCK
|
||||
|
||||
inx
|
||||
jsr erase_enemy
|
||||
iny
|
||||
jsr hgr_partial_restore_by_num
|
||||
|
||||
ldx CURRENT_ROCK
|
||||
|
||||
@ -821,37 +821,3 @@ bird_no_collide:
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
|
||||
;=====================
|
||||
; erase old
|
||||
;=====================
|
||||
; from A to X
|
||||
; SAVED_Y1 to SAVED_Y2
|
||||
|
||||
;========================
|
||||
; which one is in X
|
||||
|
||||
erase_enemy:
|
||||
lda save_valid,X
|
||||
bne really_erase_enemy
|
||||
|
||||
rts
|
||||
|
||||
really_erase_enemy:
|
||||
lda #0
|
||||
sta save_valid,X
|
||||
|
||||
lda save_ystart,X
|
||||
sta SAVED_Y1
|
||||
lda save_yend,X
|
||||
sta SAVED_Y2
|
||||
lda save_xstart,X
|
||||
pha
|
||||
lda save_xend,X
|
||||
tax
|
||||
pla
|
||||
|
||||
jmp hgr_partial_restore
|
||||
|
||||
|
||||
|
@ -5,6 +5,15 @@
|
||||
|
||||
; Y is which
|
||||
hgr_partial_restore_by_num:
|
||||
lda save_valid,Y
|
||||
bne really_partial_restore
|
||||
rts
|
||||
|
||||
really_partial_restore:
|
||||
|
||||
lda #0
|
||||
sta save_valid,Y
|
||||
|
||||
lda save_ystart,Y
|
||||
sta SAVED_Y1
|
||||
lda save_yend,Y
|
||||
|
@ -21,8 +21,8 @@
|
||||
; Y is save slot
|
||||
|
||||
hgr_draw_sprite_bg_mask:
|
||||
|
||||
; ldy #4 ; FIXME, should be proper save slot
|
||||
lda #1
|
||||
sta save_valid,Y
|
||||
|
||||
; save info on background to restore
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user