keen: update rayguns

This commit is contained in:
Vince Weaver 2024-03-20 01:45:37 -04:00
parent 7387e83a63
commit a7f1826f3f
2 changed files with 38 additions and 1 deletions

View File

@ -31,6 +31,14 @@ check_item:
jmp done_item_pickup
get_laser_gun:
lda RAYGUNS
clc
sed
adc #$05
sta RAYGUNS
cld
jmp done_item_pickup
; keycards go here too...
get_keycard:

View File

@ -26,6 +26,35 @@ inc_score:
rts
;===========================
; update rayguns
;===========================
; remove leading zeros
; leftmost is score_string+26
update_rayguns:
update_raygun_l:
lda RAYGUNS
lsr
lsr
lsr
lsr
beq update_raygun_r
ora #$b0 ; 0 -> $b0
sta score_string+26
update_raygun_r:
lda RAYGUNS
and #$f
ora #$b0 ; 0 -> $b0
sta score_string+27
rts
;===========================
; update score
;===========================
@ -181,7 +210,7 @@ done_blue_key:
draw_status_bar:
jsr update_score
jsr update_rayguns
bit TEXTGR ; split graphics/text