keen: update status

This commit is contained in:
Vince Weaver 2024-03-16 01:28:25 -04:00
parent 2e11fcb13a
commit fb1cf56ec9
10 changed files with 89 additions and 44 deletions

View File

@ -27,3 +27,26 @@ Tile types:
40..63 hard tiles
Status:
0123456789012345678901234567890123456789
****************************************
* KK KK KK KK KK KK * RR YY * *
* KK KK KK KK KK KK * RR YY * *
* KK KK KK KK KK KK * BB GG * *
* KK KK KK KK KK KK * BB GG * *
****************************************
* KEENS KEYCARDS PARTS *
****************************************
* SCORE * NEXT KEEN * RAYGUN * POGO*
* 11223344 * 20000 * 5 * N *

View File

@ -3,22 +3,14 @@
;==========
page_flip:
lda DISP_PAGE ; 3
beq page_flip_show_1 ; 2nt/3
page_flip_show_0:
bit PAGE0 ; 4
lda #4 ; 2
sta DRAW_PAGE ; DRAW_PAGE=1 ; 3
lda #0 ; 2
sta DISP_PAGE ; DISP_PAGE=0 ; 3
rts ; 6
lda DRAW_PAGE
eor #4
sta DRAW_PAGE
beq page_flip_show_2 ; if draw page now 0, disp page 2
page_flip_show_1:
bit PAGE1 ; 4
sta DRAW_PAGE ; DRAW_PAGE=0 ; 3
lda #1 ; 2
sta DISP_PAGE ; DISP_PAGE=1 ; 3
bit PAGE1
rts ; 6
page_flip_show_2:
bit PAGE2 ; 4
rts ; 6
;====================
; DISP_PAGE=0 26
; DISP_PAGE=1 24

View File

@ -4,8 +4,8 @@ KEYPRESS = $C000
KEYRESET = $C010
;; SOFT SWITCHES
CLR80COL = $C000 ; PAGE0/PAGE1 normal
SET80COL = $C001 ; PAGE0/PAGE1 switches PAGE0 in Aux instead
CLR80COL = $C000 ; PAGE1/PAGE2 normal
SET80COL = $C001 ; PAGE1/PAGE2 switches PAGE1 in Aux instead
EIGHTYCOLOFF = $C00C
EIGHTYCOLON = $C00D
TBCOLOR = $C022 ; IIgs text foreground / background colors
@ -16,8 +16,8 @@ SET_GR = $C050
SET_TEXT = $C051
FULLGR = $C052
TEXTGR = $C053
PAGE0 = $C054
PAGE1 = $C055
PAGE1 = $C054
PAGE2 = $C055
LORES = $C056 ; Enable LORES graphics
HIRES = $C057 ; Enable HIRES graphics
AN3 = $C05E ; Annunciator 3

View File

@ -7,7 +7,6 @@ init_vars:
sta ANIMATE_FRAME
sta FRAMEL
sta FRAMEH
sta DISP_PAGE
sta JOYSTICK_ENABLED
sta KEEN_WALKING
sta KEEN_JUMPING
@ -26,7 +25,7 @@ init_vars:
lda #1
sta FIREPOWER
lda #7
sta HEALTH
lda #4
sta KEENS
rts

View File

@ -15,7 +15,7 @@ keen_start:
bit KEYRESET
bit SET_GR
bit PAGE0
bit PAGE1
bit LORES
bit FULLGR
@ -29,7 +29,6 @@ keen_start:
sta ANIMATE_FRAME
sta FRAMEL
sta FRAMEH
sta DISP_PAGE
sta JOYSTICK_ENABLED
sta KEEN_WALKING
sta KEEN_JUMPING
@ -64,8 +63,8 @@ keen_start:
; lda #2 ; draw twice (both pages)
; sta UPDATE_STATUS
lda #7
sta HEALTH
; lda #7
; sta HEALTH
lda #4
sta DRAW_PAGE

View File

@ -17,7 +17,7 @@ keen_start:
bit KEYRESET
bit SET_GR
bit PAGE0
bit PAGE1
bit LORES
bit FULLGR
@ -31,7 +31,6 @@ keen_start:
sta ANIMATE_FRAME
sta FRAMEL
sta FRAMEH
sta DISP_PAGE
sta JOYSTICK_ENABLED
sta KEEN_WALKING
sta KEEN_JUMPING
@ -66,8 +65,8 @@ keen_start:
lda #2 ; draw twice (both pages)
sta UPDATE_STATUS
lda #7
sta HEALTH
lda #4
sta KEENS
lda #4
sta DRAW_PAGE

View File

@ -19,7 +19,7 @@ keen_title_start:
bit KEYRESET
bit SET_GR
bit PAGE0
bit PAGE1
bit HIRES
bit FULLGR
@ -253,7 +253,7 @@ done_keyloop:
bit SET_TEXT
jsr print_help
bit SET_GR
bit PAGE0
bit PAGE1
ldx #100

View File

@ -174,7 +174,7 @@ done_down_pressed:
check_space:
cmp #' '
bne check_return
bne check_comma
space_pressed:
; jump
@ -191,15 +191,15 @@ space_pressed:
jmp done_keypress
check_return:
cmp #13
bne check_escape
check_comma:
cmp #'M'
bne check_return
return_pressed:
comma_pressed:
; shoot
lda LASER_OUT
bne done_return
bne done_comma
jsr laser_noise
@ -232,6 +232,18 @@ laser_assign:
inc LASER_OUT
done_comma:
jmp no_keypress
check_return:
cmp #13
bne check_escape
return_pressed:
jsr draw_status_bar
done_return:
jmp no_keypress

View File

@ -73,7 +73,7 @@ update_score:
;===========================
update_health:
.if 0
ldx #0
update_health_loop:
cpx HEALTH
@ -88,7 +88,7 @@ done_health:
inx
cpx #8
bne update_health_loop
.endif
rts
;===========================
@ -141,10 +141,14 @@ update_status_bar:
;===========================
; draw the status bar
;===========================
; only draw when ENTER pressed, not always
draw_status_bar:
bit TEXTGR
; to improve frame rate, only draw if update status set?
; not implemented yet
; draw to visible frame
lda DRAW_PAGE
eor #$4
sta DRAW_PAGE
jsr inverse_text ; print help node
lda #<help_string
@ -157,6 +161,23 @@ draw_status_bar:
jsr move_and_print ; print explain text
jsr raw_text
jsr move_and_print ; print status line
; wait for keypress
bit KEYRESET
wait_status_bar:
lda KEYPRESS
bpl wait_status_bar
bit KEYRESET
; back to original page
lda DRAW_PAGE
eor #$4
sta DRAW_PAGE
bit FULLGR
rts

View File

@ -110,7 +110,7 @@ INVENTORY = $8F
INV_BLUE_KEY = $20
INV_SHOE = $08
INV_GRIP = $02
HEALTH = $90
KEENS = $90
SCORE0 = $91
SCORE1 = $92
SCORE2 = $93