million-perfect-letters/src/ui.interstitial.a

118 lines
2.8 KiB
Plaintext
Raw Permalink Normal View History

2020-09-23 18:01:27 +00:00
;license:MIT
;(c) 2019 by qkumba
;(c) 2020 by 4am
;
; animated interstitial screen
;
; Public functions:
; - MaybeShowInterstitial
;
2020-10-02 01:35:55 +00:00
progressStringsLo
!byte <sProgress10
!byte <sProgress20
!byte <sProgress30
!byte <sProgress40
!byte <sProgress50
!byte <sProgress60
!byte <sProgress70
!byte <sProgress80
!byte <sProgress90
!byte <sProgress100
progressStringsHi
!byte >sProgress10
!byte >sProgress20
!byte >sProgress30
!byte >sProgress40
!byte >sProgress50
!byte >sProgress60
!byte >sProgress70
!byte >sProgress80
!byte >sProgress90
!byte >sProgress100
progressHTABs
!byte 7
!byte 8
!byte 8
!byte 8
!byte 7
!byte 2
!byte 9
!byte 7
!byte 6
!byte 4
2020-09-24 02:24:49 +00:00
;------------------------------------------------------------------------------
; MaybeShowInterstitial
; display interstitial progress animation after every 10 completed puzzles
;
2020-09-23 18:01:27 +00:00
; in: A = next puzzle ID (in this world)
; X = # of puzzles completed (in this world)
; out: preserves A
; C set if all puzzles were completed
; C clear if there are more puzzles in this world (and A = next puzzle ID)
; Y, other flags clobbered
2020-09-24 02:24:49 +00:00
;------------------------------------------------------------------------------
MaybeShowInterstitial
2020-09-23 18:01:27 +00:00
pha
cpx #100
bne +
ldy #10
jsr ShowInterstitialWorldComplete
sec
bcs @exit ; always branches
+ ldy #0
- iny
dex
dex
dex
dex
dex
dex
dex
dex
dex
dex ; don't judge me
bmi +
bne -
jsr ShowInterstitialWorldProgress
+ clc
@exit pla
rts
ShowInterstitialWorldProgress
ShowInterstitialWorldComplete
2020-09-24 02:24:49 +00:00
; [private]
2020-09-23 18:01:27 +00:00
; in: Y = which progress string to display (1..9)
; out: all registers and flags clobbered
bit CLEARKBD
tya
tax
dex
jsr Home
lda #11
sta targetVTAB
lda progressHTABs, x
sta minHTAB
lda progressStringsHi, x
tay
lda progressStringsLo, x
jsr HeavySilkReveal
lda KBD
bmi +
; wildcard, will allow any key to terminate sound
+LDADDR sOneSpace
+ST16 $EE
2020-09-23 18:01:27 +00:00
+LDADDR InterstitialProgressMusic
jsr PlaySound
ldx #21
jsr LongWaitForKeyWithTimeout
2020-09-23 18:01:27 +00:00
bmi +
lda #0
sta targetVTAB
sta minHTAB
+LDADDR sOneSpace
2020-09-23 18:01:27 +00:00
jsr HeavySilkReveal
+ jmp Home