duke: split out status bar

This commit is contained in:
Vince Weaver 2020-11-26 21:35:16 -05:00
parent 01bec0b06f
commit 15db5b64bb
3 changed files with 34 additions and 22 deletions

View File

@ -27,7 +27,8 @@ HELLO: hello.bas
DUKE: duke.o
ld65 -o DUKE duke.o -C ../linker_scripts/apple2_2000.inc
duke.o: duke.s zp.inc hardware.inc duke.s duke.inc
duke.o: duke.s zp.inc hardware.inc duke.s duke.inc \
status_bar.s
ca65 -o duke.o duke.s -l duke.lst
####

View File

@ -52,17 +52,7 @@ duke_loop:
jsr gr_copy_to_current
jsr normal_text
lda #<help_string
sta OUTL
lda #>help_string
sta OUTH
jsr move_and_print
jsr move_and_print
jsr move_and_print
jsr inverse_text
jsr move_and_print
jsr draw_status_bar
jsr page_flip
@ -103,13 +93,4 @@ done_with_duke:
.include "gr_pageflip.s"
.include "decompress_fast_v2.s"
help_string:
.byte 11,20,"PRESS ^H FOR HELP",0
score_string:
; 012456789012345678901234567890123456789
.byte 0,22,"SCORE HEALTH FIREPOWER INVENTORY",0
.byte 0,23,"00010 XXXXXXXX =-=- ",0
.byte 7,23," ",0
.include "status_bar.s"

30
duke/status_bar.s Normal file
View File

@ -0,0 +1,30 @@
; Draw Status Bar
update_status_bar:
rts
draw_status_bar:
jsr normal_text
lda #<help_string
sta OUTL
lda #>help_string
sta OUTH
jsr move_and_print
jsr move_and_print
jsr move_and_print
jsr inverse_text
jsr move_and_print
rts
help_string:
.byte 11,20,"PRESS ^H FOR HELP",0
score_string:
; 012456789012345678901234567890123456789
.byte 0,22,"SCORE HEALTH FIREPOWER INVENTORY",0
.byte 0,23,"00010 XXXXXXXX =-=- ",0
.byte 7,23," ",0