4cade/src/ui.credits.a
2020-03-12 17:03:37 -07:00

70 lines
2.1 KiB
Plaintext

;license:MIT
;(c) 2018-2020 by 4am
;
; credits page
;
; Public functions
; - Credits
; - Help
;
;------------------------------------------------------------------------------
; Credits
; display credits page and wait
;
; in: none
; out: C clear
; all other flags and registers clobbered
;------------------------------------------------------------------------------
Credits
jsr LoadFile ; load credits text into $8000
!word kRootDirectory
!word kCreditsFile
!word $8000
jsr ForceHGRMode
jsr ClearOffscreen
lda OffscreenPage
ror ; draw on offscreen page
+LDADDR $8000
tax
jsr DrawPage ; draw credits
jsr ShowOtherPage ; show credits
jsr WaitForKeyFor30Seconds; wait
-- bit CLEARKBD ; don't care about key
- sec ; if called from search mode, tell caller to refresh
rts
;------------------------------------------------------------------------------
; Help
; display global help page and wait
;
; in: none
; out: if user presses an arrow key within 30 seconds, this exits via BrowseMode
; otherwise this returns to caller with
; C clear, all other flags and registers clobbered
;------------------------------------------------------------------------------
Help
jsr LoadFile ; load help text into $8000
!word kRootDirectory
!word kHelpTextFile
!word $8000
jsr LoadHelpOffscreen
lda OffscreenPage
ror ; draw on offscreen page
+LDADDR $8000
ldx #8
jsr DrawPage ; draw help text
jsr ShowOtherPage
jsr WaitForKeyFor30Seconds
cmp #$88
beq BrowseMode
cmp #$83
beq -
cmp #$81
beq -
jsr IsUpDownOrRightArrow
beq -
jsr IsSearchKey
bne --
rts