2019-07-15 15:42:05 +00:00
|
|
|
;license:MIT
|
2020-03-13 00:03:37 +00:00
|
|
|
;(c) 2018-2020 by 4am
|
2019-07-15 15:42:05 +00:00
|
|
|
;
|
|
|
|
; GR action slideshows
|
|
|
|
;
|
|
|
|
; Public functions
|
|
|
|
; - GRActionSlideshow
|
|
|
|
; - GRSingle
|
|
|
|
;
|
|
|
|
|
2019-10-14 02:22:47 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; GRActionSlideshow
|
|
|
|
; display a slideshow of lo-res action screenshots
|
|
|
|
;
|
|
|
|
; in: none
|
|
|
|
; out: everything clobbered
|
|
|
|
; graphics mode set to display hi-res screen
|
|
|
|
;------------------------------------------------------------------------------
|
2019-07-15 15:42:05 +00:00
|
|
|
GRActionSlideshow
|
2020-03-17 01:58:05 +00:00
|
|
|
jsr LoadGRTransition ; load transition effect code at $6000
|
2019-07-15 15:42:05 +00:00
|
|
|
jsr BlankGR ; switch GR mode with initial blank screen
|
|
|
|
jsr okvs_iter ; cycle through all listed GR files
|
|
|
|
!word gSlideshowStore
|
2020-03-17 01:58:05 +00:00
|
|
|
!word GRActionCallback ; address of callback (called on each file)
|
2019-07-15 15:42:05 +00:00
|
|
|
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
|
|
|
|
2019-10-14 02:22:47 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; GRSingle
|
|
|
|
; display a single lo-res screenshot, with transition effect
|
|
|
|
;
|
|
|
|
; in: none
|
|
|
|
; out: everything clobbered
|
|
|
|
; graphics mode set to display hi-res screen
|
|
|
|
;------------------------------------------------------------------------------
|
2019-07-15 15:42:05 +00:00
|
|
|
GRSingle
|
2021-11-09 18:39:16 +00:00
|
|
|
+ST16 IndexedGRFilename
|
2019-07-15 15:42:05 +00:00
|
|
|
jsr BlankGR ; switch to GR mode with initial blank screen
|
2021-11-09 18:39:16 +00:00
|
|
|
jsr LoadIndexedGRFile ; load GR screen at $4000
|
|
|
|
jsr LoadGRTransition ; load transition effect code at $6000
|
|
|
|
jsr ExecuteTransitionAt6000AndWait
|
2019-07-15 15:42:05 +00:00
|
|
|
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2020-04-01 15:57:21 +00:00
|
|
|
; BlankGR [private]
|
2019-07-15 15:42:05 +00:00
|
|
|
; clear and show GR page 1 without flickering
|
|
|
|
;
|
|
|
|
; in: none
|
|
|
|
; out: text page clobbered
|
2019-10-14 02:22:47 +00:00
|
|
|
; graphics mode set to display lo-res screen
|
2019-07-15 15:42:05 +00:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
BlankGR
|
2020-03-13 00:03:37 +00:00
|
|
|
ldy #$2C ; BIT
|
|
|
|
sty PageFrom
|
2019-07-15 15:42:05 +00:00
|
|
|
ldx #$04
|
2020-03-13 00:03:37 +00:00
|
|
|
stx PageTo+2
|
2019-07-15 15:42:05 +00:00
|
|
|
lda #0
|
2020-03-13 00:03:37 +00:00
|
|
|
jsr ClearGR
|
2019-07-15 15:42:05 +00:00
|
|
|
bit PAGE1
|
2019-09-10 04:04:16 +00:00
|
|
|
bit $C056 ; set GR mode
|
2019-11-27 21:51:43 +00:00
|
|
|
jmp GRMode
|
2019-07-15 15:42:05 +00:00
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2020-04-01 15:57:21 +00:00
|
|
|
; LoadGRTransition [private]
|
2019-07-15 15:42:05 +00:00
|
|
|
;
|
|
|
|
; in: none
|
|
|
|
; out: all registers and flags clobbered
|
2021-11-09 18:39:16 +00:00
|
|
|
; $6000..$BFFF/main contains transition effect code (probably not all
|
2019-07-15 15:42:05 +00:00
|
|
|
; of that, but no promises)
|
|
|
|
;------------------------------------------------------------------------------
|
2020-03-17 01:58:05 +00:00
|
|
|
LoadGRTransition
|
2021-11-17 19:21:41 +00:00
|
|
|
jsr LoadIndexedFile
|
2021-11-09 18:39:16 +00:00
|
|
|
!word $6000
|
2021-11-17 19:21:41 +00:00
|
|
|
!word kGRFizzleRecord
|
2019-10-08 18:54:14 +00:00
|
|
|
GRRTS rts
|
2019-07-15 15:42:05 +00:00
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2020-04-01 15:57:21 +00:00
|
|
|
; GRActionCallback [private]
|
2019-07-15 15:42:05 +00:00
|
|
|
; 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 20:30:14 +00:00
|
|
|
; $WINDEX contains 0-based index of the current record in gSlideshowStore (word)
|
2019-07-15 15:42:05 +00:00
|
|
|
; 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-17 01:58:05 +00:00
|
|
|
GRActionCallback
|
2019-09-10 02:38:17 +00:00
|
|
|
bit KBD
|
2019-10-08 18:54:14 +00:00
|
|
|
bmi GRRTS
|
2019-10-08 03:47:36 +00:00
|
|
|
|
2021-11-09 18:39:16 +00:00
|
|
|
+ST16 IndexedGRFilename
|
2019-07-15 15:42:05 +00:00
|
|
|
|
2021-11-18 01:38:34 +00:00
|
|
|
jsr FindGame
|
2019-09-21 03:26:32 +00: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 18:54:14 +00:00
|
|
|
bcs GRRTS
|
2020-03-24 20:30:14 +00:00
|
|
|
|
2021-11-09 18:39:16 +00:00
|
|
|
jsr LoadIndexedGRFile
|
|
|
|
jmp ExecuteTransitionAt6000AndWait
|
|
|
|
|
|
|
|
LoadIndexedGRFile
|
|
|
|
; in: caller has set IndexedGRFilename
|
|
|
|
; out: all flags & registers clobbered
|
2021-11-13 01:46:05 +00:00
|
|
|
jsr LoadIndexedFile ; load index file into $4600
|
2021-11-09 18:39:16 +00:00
|
|
|
- !word $4600
|
2021-11-13 01:46:05 +00:00
|
|
|
!word kGRActionIndexRecord
|
2021-11-09 18:39:16 +00:00
|
|
|
|
|
|
|
jsr okvs_find
|
|
|
|
!word -
|
|
|
|
IndexedGRFilename
|
|
|
|
!word $FDFD ; SMC
|
|
|
|
+ST16 @indexRecordPtr
|
2019-07-15 15:42:05 +00:00
|
|
|
|
2021-11-09 18:39:16 +00:00
|
|
|
jsr LoadIndexedFile ; load GR screenshot at $4000
|
2021-11-16 22:44:12 +00:00
|
|
|
!word $4000 ; because that's where the transition code expects to find it
|
2021-11-09 18:39:16 +00:00
|
|
|
@indexRecordPtr
|
|
|
|
!word $FDFD ; SMC
|
|
|
|
rts
|