2019-09-28 08:35:48 -04:00
|
|
|
;License:MIT
|
2020-03-12 17:03:37 -07:00
|
|
|
;(c) 2018-2020 by 4am
|
2019-09-28 08:35:48 -04:00
|
|
|
;
|
|
|
|
; functions for animated title screens
|
|
|
|
;
|
2019-10-13 22:22:47 -04:00
|
|
|
; Public functions:
|
2019-09-28 08:35:48 -04:00
|
|
|
; - MaybeAnimateTitle
|
|
|
|
;
|
|
|
|
|
2019-10-08 13:19:20 -04:00
|
|
|
; /!\ execution falls through from ui.search.mode/FindMatchingTitle
|
2019-10-13 22:22:47 -04:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; MaybeAnimateTitle
|
|
|
|
; slow down to 1 Mhz (always), then check if there is an animation for the
|
|
|
|
; title screenshot we just displayed, and if so, load it and call it
|
|
|
|
;
|
2021-10-28 01:28:20 -04:00
|
|
|
; in: gSearchStore is populated
|
2019-10-13 22:22:47 -04:00
|
|
|
; out: C clear
|
|
|
|
; all other flags clobbered
|
|
|
|
; all registers clobbered
|
|
|
|
;------------------------------------------------------------------------------
|
2019-09-28 08:35:48 -04:00
|
|
|
MaybeAnimateTitle
|
2019-10-09 18:02:46 -07:00
|
|
|
jsr SwitchToBank2
|
|
|
|
jsr DisableAcceleratorAndSwitchToBank1
|
|
|
|
|
2019-10-08 19:25:22 -07:00
|
|
|
lda #$3F
|
|
|
|
ldy OffscreenPage
|
2019-09-28 08:35:48 -04:00
|
|
|
bne +
|
2019-10-08 19:25:22 -07:00
|
|
|
eor #$60
|
2020-03-24 21:47:08 -07:00
|
|
|
+ sta DEST+1
|
2019-10-08 19:25:22 -07:00
|
|
|
and #$60
|
2020-03-12 17:03:37 -07:00
|
|
|
sta PageFrom+2
|
2019-10-08 19:25:22 -07:00
|
|
|
eor #$60
|
2020-03-12 17:03:37 -07:00
|
|
|
tax
|
2019-09-28 08:35:48 -04:00
|
|
|
lda #$FD
|
2020-03-24 21:47:08 -07:00
|
|
|
sta DEST
|
2019-09-28 08:35:48 -04:00
|
|
|
ldy #0
|
2020-03-24 21:47:08 -07:00
|
|
|
lda (DEST),y ; see if there is a hidden JMP to an
|
2019-09-28 08:35:48 -04:00
|
|
|
cmp #$4C ; animation routine for this screen
|
2019-10-13 22:22:47 -04:00
|
|
|
; at +$1FFD (after the graphics data,
|
|
|
|
; in the last 3 bytes of a $2000 byte
|
|
|
|
; file -- this area part of a 'screen
|
|
|
|
; hole' and is not displayed on screen)
|
|
|
|
bne @exit ; if not, we're done here
|
2020-03-12 17:03:37 -07:00
|
|
|
txa
|
|
|
|
jsr CopyHGR
|
2019-09-28 08:35:48 -04:00
|
|
|
|
2019-10-13 22:22:47 -04:00
|
|
|
; load the animation routine, which is stored in a subdirectory by filename
|
|
|
|
jsr GetGameToLaunch
|
2020-03-24 16:30:14 -04:00
|
|
|
+ST16 +
|
2019-09-28 08:35:48 -04:00
|
|
|
jsr LoadFile
|
|
|
|
!word kAnimatedTitleDirectory
|
2019-10-08 14:43:41 -04:00
|
|
|
+ !word $FDFD
|
2019-09-28 08:35:48 -04:00
|
|
|
!word 0
|
|
|
|
|
|
|
|
ldx #5 ; copy prelaunch code
|
|
|
|
- lda @titleAnimPrelaunch,x
|
|
|
|
sta $106,x
|
|
|
|
dex
|
|
|
|
bpl -
|
|
|
|
|
2020-03-23 13:21:25 -07:00
|
|
|
bit $c050 ; turn on graphics mode (Home set text mode)
|
2019-10-13 22:22:47 -04:00
|
|
|
jsr Launch ; execute the animation
|
|
|
|
|
2021-10-28 01:28:20 -04:00
|
|
|
jsr ReloadSearchIndex
|
2019-10-13 22:22:47 -04:00
|
|
|
jsr ResyncPage ; we don't know which HGR page is showing
|
|
|
|
; when the animation returns, so resync
|
|
|
|
; the current one with our OffscreenPage
|
|
|
|
; variable
|
|
|
|
|
2019-10-08 00:03:37 -04:00
|
|
|
@exit clc ; tell caller not to refresh screen
|
2019-09-28 08:35:48 -04:00
|
|
|
rts
|
|
|
|
|
2019-10-13 22:22:47 -04:00
|
|
|
@titleAnimPrelaunch ; this is executed from $106/main by |Launch|
|
2019-09-28 08:35:48 -04:00
|
|
|
bit $C082
|
2020-03-24 21:47:08 -07:00
|
|
|
jmp (DEST)
|