4cade/src/ui.attract.gr.a

113 lines
4.1 KiB
Plaintext
Raw Normal View History

;license:MIT
2020-03-12 17:03:37 -07:00
;(c) 2018-2020 by 4am
;
; GR action slideshows
;
; Public functions
; - GRActionSlideshow
; - GRSingle
;
2019-10-13 22:22:47 -04:00
;------------------------------------------------------------------------------
; GRActionSlideshow
; display a slideshow of lo-res action screenshots
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen
;------------------------------------------------------------------------------
GRActionSlideshow
2020-03-16 21:58:05 -04:00
jsr LoadGRTransition ; load transition effect code at $6000
jsr BlankGR ; switch GR mode with initial blank screen
jsr okvs_iter ; cycle through all listed GR files
!word gSlideshowStore
2020-03-16 21:58:05 -04:00
!word GRActionCallback ; address of callback (called on each file)
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
2019-10-13 22:22:47 -04:00
;------------------------------------------------------------------------------
; GRSingle
; display a single lo-res screenshot, with transition effect
;
; in: none
; out: everything clobbered
; graphics mode set to display hi-res screen
;------------------------------------------------------------------------------
GRSingle
2020-03-24 16:30:14 -04:00
+ST16 @fname
jsr BlankGR ; switch to GR mode with initial blank screen
2019-09-09 22:38:17 -04:00
jsr LoadFile ; load GR screenshot into $6000
!word kRootDirectory
@fname !word $FDFD ; SMC
!word $6000
2020-03-16 21:58:05 -04:00
jsr LoadGRTransition ; load transition effect code at $6400
2019-10-09 19:21:46 -07:00
jsr ExecuteTransitionAt6400AndWait
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
;------------------------------------------------------------------------------
2020-04-01 11:57:21 -04:00
; BlankGR [private]
; clear and show GR page 1 without flickering
;
; in: none
; out: text page clobbered
2019-10-13 22:22:47 -04:00
; graphics mode set to display lo-res screen
;------------------------------------------------------------------------------
BlankGR
2020-03-12 17:03:37 -07:00
ldy #$2C ; BIT
sty PageFrom
ldx #$04
2020-03-12 17:03:37 -07:00
stx PageTo+2
lda #0
2020-03-12 17:03:37 -07:00
jsr ClearGR
bit PAGE1
bit $C056 ; set GR mode
2019-11-27 13:51:43 -08:00
jmp GRMode
;------------------------------------------------------------------------------
2020-04-01 11:57:21 -04:00
; LoadGRTransition [private]
;
; in: none
; out: all registers and flags clobbered
; $6400..$BFFF/main contains transition effect code (probably not all
; of that, but no promises)
;------------------------------------------------------------------------------
2020-03-16 21:58:05 -04:00
LoadGRTransition
2019-09-09 22:38:17 -04:00
jsr LoadFile
!word kFXDirectory
!word kGRFizzleFile
!word $6400
2019-10-08 14:54:14 -04:00
GRRTS rts
;------------------------------------------------------------------------------
2020-04-01 11:57:21 -04:00
; GRActionCallback [private]
; callback called by okvs_iter on gSlideshowStore
; to load and display a single GR action screenshot
; in: A/Y contains address of filename (name only, path is always /ACTION.GR/)
2020-03-24 16:30:14 -04:00
; $WINDEX contains 0-based index of the current record in gSlideshowStore (word)
; gGamesListStore must be initialized
; out: all registers and flags clobbered
; $0800..$1EFF preserved (this contains the gSlideshowStore OKVS data)
; $2000..$BFFF clobbered by graphics data and transition code
;------------------------------------------------------------------------------
2020-03-16 21:58:05 -04:00
GRActionCallback
2019-09-09 22:38:17 -04:00
bit KBD
2019-10-08 14:54:14 -04:00
bmi GRRTS
2019-10-07 23:47:36 -04:00
2020-03-24 16:30:14 -04:00
+ST16 +
jsr FindGameInActionSlideshow
2019-09-20 23:26:32 -04:00
; if game name is not found (C will be set here), it means the game
; can't be played due to memory or joystick requirements, so we hide
; it from slideshows
2019-10-08 14:54:14 -04:00
bcs GRRTS
2020-03-24 16:30:14 -04:00
+LD16 WINDEX ; save game index in case user hits RETURN
+ST16 gGameToLaunch ; while it's visible (we'll launch it)
2019-09-09 22:38:17 -04:00
jsr LoadFile ; load GR screenshot into $6000
!word kGRActionDirectory
2019-10-07 23:47:36 -04:00
+ !word $FDFD ; SMC
2019-09-09 22:38:17 -04:00
!word $6000
2019-10-09 19:21:46 -07:00
jmp ExecuteTransitionAt6400AndWait