some comments

This commit is contained in:
4am 2019-10-13 22:22:47 -04:00
parent 8c72e6b137
commit 7b1b6ed3e1
9 changed files with 174 additions and 16 deletions

View File

@ -3,15 +3,25 @@
; ;
; functions for animated title screens ; functions for animated title screens
; ;
; Public functions:
; - MaybeAnimateTitle ; - MaybeAnimateTitle
; ;
; /!\ execution falls through from ui.search.mode/FindMatchingTitle ; /!\ execution falls through from ui.search.mode/FindMatchingTitle
;------------------------------------------------------------------------------
; 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
;
; in: none
; out: C clear
; all other flags clobbered
; all registers clobbered
;------------------------------------------------------------------------------
MaybeAnimateTitle MaybeAnimateTitle
jsr SwitchToBank2 jsr SwitchToBank2
jsr DisableAcceleratorAndSwitchToBank1 jsr DisableAcceleratorAndSwitchToBank1
; out: C clear
lda #$3F lda #$3F
ldy OffscreenPage ldy OffscreenPage
bne + bne +
@ -26,7 +36,13 @@ MaybeAnimateTitle
ldy #0 ldy #0
lda (SAVE),y ; see if there is a hidden JMP to an lda (SAVE),y ; see if there is a hidden JMP to an
cmp #$4C ; animation routine for this screen cmp #$4C ; animation routine for this screen
bne @exit ; 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
; copy one HGR screen to the other
ldx #$20 ldx #$20
@a lda $FD00,y ; SMC @a lda $FD00,y ; SMC
@b sta $FD00,y ; SMC @b sta $FD00,y ; SMC
@ -37,8 +53,8 @@ MaybeAnimateTitle
dex dex
bne @a bne @a
jsr GetGameToLaunch ; load the animation routine, which is ; load the animation routine, which is stored in a subdirectory by filename
; stored in a subdirectory by filename jsr GetGameToLaunch
+STAY + +STAY +
jsr LoadFile jsr LoadFile
!word kAnimatedTitleDirectory !word kAnimatedTitleDirectory
@ -51,11 +67,16 @@ MaybeAnimateTitle
dex dex
bpl - bpl -
jsr Launch jsr Launch ; execute the animation
jsr ResyncPage
jsr ResyncPage ; we don't know which HGR page is showing
; when the animation returns, so resync
; the current one with our OffscreenPage
; variable
@exit clc ; tell caller not to refresh screen @exit clc ; tell caller not to refresh screen
rts rts
@titleAnimPrelaunch @titleAnimPrelaunch ; this is executed from $106/main by |Launch|
bit $C082 bit $C082
jmp (SAVE) jmp (SAVE)

View File

@ -11,6 +11,16 @@
; - HGRMode ; - HGRMode
; ;
;------------------------------------------------------------------------------
; DHGRTitleSlideshow
; execute a slideshow of double hi-res title screenshots
;
; safe to call if machine only has 64K (does nothing and exits)
;
; in: none
; out: everything clobbered
; graphics mode reset to display hi-res screen, which is blank
;------------------------------------------------------------------------------
DHGRTitleSlideshow DHGRTitleSlideshow
bit MachineStatus ; only run DHGR slideshow if we have 128K bit MachineStatus ; only run DHGR slideshow if we have 128K
bvc DHGRRTS bvc DHGRRTS
@ -22,6 +32,16 @@ DHGRTitleSlideshow
beq BlankHGR ; switch back to HGR mode with initial blank screen on exit beq BlankHGR ; switch back to HGR mode with initial blank screen on exit
; (always branches because Z=1 on exit of okvs_iter) ; (always branches because Z=1 on exit of okvs_iter)
;------------------------------------------------------------------------------
; DHGRActionSlideshow
; execute a slideshow of double hi-res action screenshots
;
; safe to call if machine only has 64K (does nothing and exits)
;
; in: none
; out: everything clobbered
; graphics mode reset to display hi-res screen, which is blank
;------------------------------------------------------------------------------
DHGRActionSlideshow DHGRActionSlideshow
bit MachineStatus ; only run DHGR slideshow if we have 128K bit MachineStatus ; only run DHGR slideshow if we have 128K
bvc DHGRRTS bvc DHGRRTS
@ -33,6 +53,16 @@ DHGRActionSlideshow
beq BlankHGR ; switch back to HGR mode with initial blank screen on exit beq BlankHGR ; switch back to HGR mode with initial blank screen on exit
; (always branches because Z=1 on exit of okvs_iter) ; (always branches because Z=1 on exit of okvs_iter)
;------------------------------------------------------------------------------
; DHGRSingle
; display a single double hi-res screenshot, with transition effect
;
; safe to call if machine only has 64K (does nothing and exits)
;
; in: none
; out: everything clobbered
; graphics mode reset to display hi-res screen, which is blank
;------------------------------------------------------------------------------
DHGRSingle DHGRSingle
bit MachineStatus ; only show DHGR screenshots if we have 128K bit MachineStatus ; only show DHGR screenshots if we have 128K
bvc DHGRRTS bvc DHGRRTS

View File

@ -8,6 +8,14 @@
; - GRSingle ; - GRSingle
; ;
;------------------------------------------------------------------------------
; GRActionSlideshow
; display a slideshow of lo-res action screenshots
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen
;------------------------------------------------------------------------------
GRActionSlideshow GRActionSlideshow
jsr .LoadGRTransition ; load transition effect code at $6000 jsr .LoadGRTransition ; load transition effect code at $6000
jsr BlankGR ; switch GR mode with initial blank screen jsr BlankGR ; switch GR mode with initial blank screen
@ -16,6 +24,14 @@ GRActionSlideshow
!word .GRActionCallback ; address of callback (called on each file) !word .GRActionCallback ; address of callback (called on each file)
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
;------------------------------------------------------------------------------
; GRSingle
; display a single lo-res screenshot, with transition effect
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen
;------------------------------------------------------------------------------
GRSingle GRSingle
+STAY @fname +STAY @fname
jsr BlankGR ; switch to GR mode with initial blank screen jsr BlankGR ; switch to GR mode with initial blank screen
@ -33,6 +49,7 @@ GRSingle
; ;
; in: none ; in: none
; out: text page clobbered ; out: text page clobbered
; graphics mode set to display lo-res screen
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
BlankGR BlankGR
ldx #$04 ldx #$04

View File

@ -9,6 +9,14 @@
; - HGRSingle ; - HGRSingle
; ;
;------------------------------------------------------------------------------
; HGRTitleSlideshow
; execute a slideshow of hi-res title screenshots
;
; in: none
; out: everything clobbered
; graphics mode still displaying hi-res screen with last picture visible
;------------------------------------------------------------------------------
HGRTitleSlideshow HGRTitleSlideshow
jsr LoadHGRTransition ; load transition effect code at $6000 jsr LoadHGRTransition ; load transition effect code at $6000
jsr okvs_iter ; cycle through all listed HGR files jsr okvs_iter ; cycle through all listed HGR files
@ -16,6 +24,14 @@ HGRTitleSlideshow
!word HGRTitleCallback ; address of callback (called on each file) !word HGRTitleCallback ; address of callback (called on each file)
rts ; exit with last picture still visible rts ; exit with last picture still visible
;------------------------------------------------------------------------------
; HGRActionSlideshow
; execute a slideshow of hi-res action screenshots
;
; in: none
; out: everything clobbered
; graphics mode still displaying hi-res screen with last picture visible
;------------------------------------------------------------------------------
HGRActionSlideshow HGRActionSlideshow
jsr LoadHGRTransition ; load transition effect code at $6000 jsr LoadHGRTransition ; load transition effect code at $6000
jsr okvs_iter ; cycle through all listed HGR files jsr okvs_iter ; cycle through all listed HGR files
@ -23,6 +39,14 @@ HGRActionSlideshow
!word HGRActionCallback ; address of callback (called on each file) !word HGRActionCallback ; address of callback (called on each file)
rts ; exit with last picture still visible rts ; exit with last picture still visible
;------------------------------------------------------------------------------
; HGRSingle
; display a single hi-res screenshot, with transition effect
;
; in: none
; out: everything clobbered
; graphics mode still displaying hi-res screen with last picture visible
;------------------------------------------------------------------------------
HGRSingle HGRSingle
+STAY @fname +STAY @fname
jsr LoadFile ; load HGR screenshot at $4000 jsr LoadFile ; load HGR screenshot at $4000

View File

@ -8,6 +8,17 @@
; - SHRSingle ; - SHRSingle
; ;
;------------------------------------------------------------------------------
; SHRSlideshow
; execute a slideshow of super hi-res artwork
;
; safe to call if machine can not display super hi-res graphics (does nothing
; and exits)
;
; in: none
; out: everything clobbered
; graphics mode reset to display hi-res screen, which is blank
;------------------------------------------------------------------------------
SHRSlideshow SHRSlideshow
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
and #SUPPORTS_SHR and #SUPPORTS_SHR
@ -19,6 +30,17 @@ SHRRTS rts
!word SHRArtworkCallback !word SHRArtworkCallback
jmp BlankHGR jmp BlankHGR
;------------------------------------------------------------------------------
; SHRSlideshow
; display a single super hi-res artwork
;
; safe to call if machine can not display super hi-res graphics (does nothing
; and exits)
;
; in: none
; out: everything clobbered
; graphics mode reset to display hi-res screen, which is blank
;------------------------------------------------------------------------------
SHRSingle SHRSingle
+STAY + +STAY +
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
@ -48,7 +70,7 @@ LoadSHRTransition
rts rts
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; .SHRArtworkCallback [private] ; SHRArtworkCallback [private]
; callback called by okvs_iter on gSlideshowStore ; callback called by okvs_iter on gSlideshowStore
; to load and display a single SHR graphic ; to load and display a single SHR graphic
@ -83,7 +105,7 @@ SHRArtworkCallback
jmp ExecuteTransitionAtA000AndWait jmp ExecuteTransitionAtA000AndWait
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; .BlankSHR [private] ; BlankSHR [private]
; clear and show SHR mode without flickering ; clear and show SHR mode without flickering
; ;
; in: Machine is a IIgs or has a VidHD card that responds appropriately to ; in: Machine is a IIgs or has a VidHD card that responds appropriately to

View File

@ -7,10 +7,19 @@
; - ToggleCheat ; - ToggleCheat
; ;
ToggleCheat ;------------------------------------------------------------------------------
; ToggleCheat
; toggle whether cheats are enabled (global flag) and update the preferences
; file with the new status
;
; does not update UI
;
; in: none ; in: none
; out: X = 0, Z = 1 (guaranteed by pref_set) ; out: X = 0
; Z = 1
; all other registers and flags clobbered ; all other registers and flags clobbered
;------------------------------------------------------------------------------
ToggleCheat
ldx #$B0 ldx #$B0
lda MachineStatus lda MachineStatus
eor #CHEATS_ENABLED eor #CHEATS_ENABLED
@ -22,6 +31,7 @@ ToggleCheat
jsr pref_set jsr pref_set
!word kCheat !word kCheat
!word @pref !word @pref
; X = 0, Z = 1
rts rts
@pref !byte 1 @pref !byte 1
@val !byte $FD @val !byte $FD

View File

@ -128,6 +128,16 @@ IsSearchKey
ldx #1 ldx #1
rts rts
;------------------------------------------------------------------------------
; IsUpDownOrRightArrow
; test whether accumulator contains ASCII code for up, down, or right arrow
; search
;
; in: A = key
; out: all registers preserved
; Z = 1 if accumulator was one of those 3 keys
; Z = 0 otherwise
;------------------------------------------------------------------------------
IsUpDownOrRightArrow IsUpDownOrRightArrow
cmp #$8B ; up arrow cmp #$8B ; up arrow
beq @done beq @done

View File

@ -8,8 +8,15 @@
; - Help ; - Help
; ;
;------------------------------------------------------------------------------
; Credits
; display credits page and wait
;
; in: none
; out: C clear
; all other flags and registers clobbered
;------------------------------------------------------------------------------
Credits Credits
; clobbers all
jsr LoadFile ; load credits text into $8000 jsr LoadFile ; load credits text into $8000
!word kRootDirectory !word kRootDirectory
!word kCreditsFile !word kCreditsFile
@ -26,8 +33,16 @@ Credits
- clc ; if called from search mode, tell caller not to refresh - clc ; if called from search mode, tell caller not to refresh
rts 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 Help
; clobbers all
jsr LoadHelpOffscreen jsr LoadHelpOffscreen
jsr ShowOtherPage jsr ShowOtherPage
jsr WaitForKeyFor30Seconds jsr WaitForKeyFor30Seconds

View File

@ -3,10 +3,14 @@
; ;
; UI functions for doing things then waiting, or waiting then doing things ; UI functions for doing things then waiting, or waiting then doing things
; ;
; - ExecuteTransitionAt6000AndWait
; - ExecuteTransitionAt6400AndWait
; - ExecuteTransitionAtA000AndWait
; - ExecuteTransitionAndWait ; - ExecuteTransitionAndWait
; - WaitForKeyFor30Seconds ; - WaitForKeyFor30Seconds
; - CoverFade ; - CoverFade
; /!\ execution falls through here from ui.attract.dhgr/DHGRActionCallback
ExecuteTransitionAt6000AndWait ExecuteTransitionAt6000AndWait
ldy #$60 ldy #$60
+HIDE_NEXT_2_BYTES +HIDE_NEXT_2_BYTES
@ -15,8 +19,7 @@ ExecuteTransitionAt6400AndWait
+HIDE_NEXT_2_BYTES +HIDE_NEXT_2_BYTES
ExecuteTransitionAtA000AndWait ExecuteTransitionAtA000AndWait
ldy #$A0 ldy #$A0
; /!\ execution falls through here to ExecuteTransitionAndWait
; /!\ execution falls through here from ui.attract.dhgr/DHGRActionCallback
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ExecuteTransitionAndWait ; ExecuteTransitionAndWait
; call transition effect code (address passed in) and wait a period of time ; call transition effect code (address passed in) and wait a period of time
@ -41,7 +44,6 @@ ExecuteTransitionAndWait
bit CLEARKBD bit CLEARKBD
WAITRTS rts WAITRTS rts
; /!\ keep this last in the file to ensure it doesn't cross a page boundary /!\
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; WaitForKeyFor30Seconds ; WaitForKeyFor30Seconds
; does what it says on the tin ; does what it says on the tin
@ -71,6 +73,13 @@ WaitForKeyFor30Seconds
dec Timeout+2 dec Timeout+2
bne @loop bne @loop
; /!\ execution falls through here to CoverFade ; /!\ execution falls through here to CoverFade
;------------------------------------------------------------------------------
; CoverFade
; load cover file and execute a specific transition effect on it
;
; in: none
; out: exits via MegaAttractMode and everything is clobbered
;------------------------------------------------------------------------------
CoverFade CoverFade
jsr LoadCoverOffscreen jsr LoadCoverOffscreen
jsr ShowOtherPage jsr ShowOtherPage