2019-01-15 00:06:58 +00:00
|
|
|
;license:MIT
|
2019-06-24 02:32:18 +00:00
|
|
|
;(c) 2018-9 by 4am
|
2019-01-15 00:06:58 +00:00
|
|
|
;
|
|
|
|
; Double hi-res slideshows
|
|
|
|
;
|
|
|
|
; Public functions
|
|
|
|
; - DHGRTitleSlideshow
|
2019-06-26 02:44:39 +00:00
|
|
|
; - DHGRActionSlideshow
|
|
|
|
; - DHGRSingle
|
2019-01-15 00:06:58 +00:00
|
|
|
;
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
!zone {
|
|
|
|
|
2019-01-15 00:06:58 +00:00
|
|
|
DHGRTitleSlideshow
|
2019-06-27 13:51:17 +00:00
|
|
|
bit MachineStatus ; only run DHGR slideshow if we have 128K
|
2019-01-15 00:06:58 +00:00
|
|
|
bvs +
|
|
|
|
rts
|
2019-06-26 02:44:39 +00:00
|
|
|
+ jsr .LoadDHGRTransition ; load transition effect code at $6000
|
2019-01-15 00:06:58 +00:00
|
|
|
jsr BlankDHGR ; switch to DHGR mode with initial blank screen
|
|
|
|
jsr okvs_iter ; cycle through all listed DHGR files
|
|
|
|
!word gSlideshowStore
|
2019-06-26 02:44:39 +00:00
|
|
|
!word .DHGRTitleCallback ; address of callback (called on each file)
|
2019-01-15 00:06:58 +00:00
|
|
|
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
|
|
|
|
2019-02-09 01:48:07 +00:00
|
|
|
DHGRActionSlideshow
|
2019-06-27 13:51:17 +00:00
|
|
|
bit MachineStatus ; only run DHGR slideshow if we have 128K
|
2019-02-09 01:48:07 +00:00
|
|
|
bvs +
|
|
|
|
rts
|
2019-06-26 02:44:39 +00:00
|
|
|
+ jsr .LoadDHGRTransition ; load transition effect code at $6000
|
2019-02-09 01:48:07 +00:00
|
|
|
jsr BlankDHGR ; switch to DHGR mode with initial blank screen
|
|
|
|
jsr okvs_iter ; cycle through all listed DHGR files
|
|
|
|
!word gSlideshowStore
|
2019-06-26 02:44:39 +00:00
|
|
|
!word .DHGRActionCallback ; address of callback (called on each file)
|
2019-02-09 01:48:07 +00:00
|
|
|
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
DHGRSingle
|
2019-06-27 13:51:17 +00:00
|
|
|
bit MachineStatus ; only show DHGR screenshots if we have 128K
|
2019-06-27 02:51:34 +00:00
|
|
|
bvs +
|
2019-06-26 02:44:39 +00:00
|
|
|
rts
|
2019-09-10 02:38:17 +00:00
|
|
|
+
|
|
|
|
+STAY @fname
|
2019-06-27 02:51:34 +00:00
|
|
|
jsr BlankDHGR ; switch to DHGR mode with initial blank screen
|
|
|
|
jsr LoadDHRFile ; load DHGR file at $4000/main and $4000/aux
|
2019-09-10 02:38:17 +00:00
|
|
|
!word kRootDirectory
|
|
|
|
@fname !word $FDFD ; SMC
|
2019-06-27 02:51:34 +00:00
|
|
|
+ jsr .LoadDHGRTransition ; load transition effect code at $6000
|
|
|
|
+LDADDR $6000
|
|
|
|
jsr ExecuteTransitionAndWait
|
|
|
|
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
2019-06-26 02:44:39 +00:00
|
|
|
|
2019-01-15 00:06:58 +00:00
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
; .LoadDHGRTransition [private]
|
2019-01-15 00:06:58 +00:00
|
|
|
; looks up name of next DHGR transition effect in DFX.CONF and loads that file
|
|
|
|
; at $6000
|
|
|
|
|
|
|
|
; in: gDFXStore has been initialized
|
|
|
|
; gGlobalPrefsStore has been initialized
|
|
|
|
; out: all registers and flags clobbered
|
|
|
|
; $6000..$BFFF/main contains transition effect code
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
.LoadDHGRTransition
|
2019-09-10 02:58:16 +00:00
|
|
|
jsr LoadFile ; load DHGR transition effects list into $8000
|
2019-09-10 02:38:17 +00:00
|
|
|
!word kRootDirectory
|
|
|
|
!word kDFXConfFile
|
2019-09-10 02:58:16 +00:00
|
|
|
- !word $8000
|
2019-01-15 00:06:58 +00:00
|
|
|
jsr ParseKeyValueList ; parse DHGR transition effects list into $6000
|
|
|
|
!word gDFXStore
|
2019-09-10 02:58:16 +00:00
|
|
|
!word -
|
2019-01-15 00:06:58 +00:00
|
|
|
!byte 0
|
|
|
|
|
|
|
|
jsr okvs_get ; get next DHGR transition effect from prefs
|
|
|
|
!word gGlobalPrefsStore
|
|
|
|
!word kNextDFX
|
|
|
|
bcs @nodfx
|
|
|
|
+STAY @dfx
|
|
|
|
jsr okvs_get
|
|
|
|
!word gDFXStore
|
|
|
|
@dfx !word $FDFD ; SMC
|
|
|
|
bcc +
|
|
|
|
@nodfx ldx #0
|
|
|
|
+ stx gDFXIndex
|
|
|
|
|
|
|
|
jsr okvs_nth ; get filename of DHGR transition effect code
|
|
|
|
!word gDFXStore
|
|
|
|
gDFXIndex
|
|
|
|
!byte 0
|
|
|
|
+STAY @dfxkey
|
|
|
|
|
|
|
|
inc gDFXIndex ; increment transition effect index for next time
|
|
|
|
jsr okvs_len
|
|
|
|
!word gDFXStore
|
|
|
|
cmp gDFXIndex
|
|
|
|
bne +
|
|
|
|
lda #0
|
|
|
|
sta gDFXIndex
|
|
|
|
+
|
|
|
|
lda gDFXIndex
|
|
|
|
sta @nexti
|
|
|
|
jsr okvs_nth ; get name of next DHGR transition
|
|
|
|
!word gDFXStore
|
|
|
|
@nexti !byte $FD ; SMC
|
|
|
|
+STAY @nextdfx
|
|
|
|
|
|
|
|
jsr okvs_update ; save name of next DHGR transition in prefs store
|
|
|
|
!word gGlobalPrefsStore
|
|
|
|
!word kNextDFX
|
|
|
|
@nextdfx !word $FDFD ; SMC
|
|
|
|
|
|
|
|
jsr SaveGlobalPreferences ; write prefs store to disk
|
|
|
|
|
2019-09-10 02:38:17 +00:00
|
|
|
jsr LoadFile ; load transition effect code into $6000
|
|
|
|
!word kFXDirectory
|
|
|
|
@dfxkey !word $FDFD ; SMC
|
|
|
|
!word $6000
|
2019-01-15 00:06:58 +00:00
|
|
|
rts
|
|
|
|
kDFXConfFile
|
|
|
|
!byte @kDFXConfFile_e-*-1
|
|
|
|
!text "DFX.CONF"
|
|
|
|
@kDFXConfFile_e
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
; .DHGRTitleCallback [private]
|
2019-01-15 00:06:58 +00:00
|
|
|
; callback called by okvs_iter on gSlideshowStore
|
|
|
|
; to load and display a single DHGR title screenshot
|
|
|
|
|
2019-07-15 15:42:05 +00:00
|
|
|
; in: A/Y contains address of filename (name only, path is always /TITLE.DHGR/)
|
2019-01-15 00:06:58 +00:00
|
|
|
; X contains 0-based index of the current record in gSlideshowStore
|
|
|
|
; out: all registers and flags clobbered
|
|
|
|
; $0800..$1EFF preserved (this contains the gSlideshowStore OKVS data)
|
|
|
|
; $2000..$BFFF clobbered by graphics data and transition code
|
|
|
|
; $2000..$5FFF/aux clobbered
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
.DHGRTitleCallback
|
2019-09-10 02:38:17 +00:00
|
|
|
bit KBD
|
2019-01-15 00:06:58 +00:00
|
|
|
bpl +
|
2019-07-08 19:03:25 +00:00
|
|
|
@exit rts
|
2019-01-15 00:06:58 +00:00
|
|
|
+
|
2019-09-10 02:38:17 +00:00
|
|
|
+STAY @tfname
|
2019-01-15 00:06:58 +00:00
|
|
|
stx gCurrentlyVisibleSlideshowIndex
|
|
|
|
|
2019-09-08 18:50:50 +00:00
|
|
|
; try to get the human-readable name of this game from gGamesListStore
|
|
|
|
ldx #$60
|
2019-07-08 19:03:25 +00:00
|
|
|
jsr GetGameDisplayName
|
2019-09-08 18:50:50 +00:00
|
|
|
; if game is not found (C will be set here), it means it can't be played on
|
|
|
|
; this machine due to memory or joystick requirements, so we don't display
|
|
|
|
; it in slideshows
|
|
|
|
bcs @exit
|
|
|
|
; (we don't actually use the display name in the title slideshow, we just
|
|
|
|
; reuse the function for convenience)
|
2019-07-08 19:03:25 +00:00
|
|
|
|
2019-01-15 00:06:58 +00:00
|
|
|
; load DHGR screenshot at $4000/main and $4000/aux
|
|
|
|
jsr LoadDHRFile
|
2019-09-10 02:38:17 +00:00
|
|
|
!word kDHGRTitleDirectory
|
|
|
|
@tfname !word $FDFD
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
+LDADDR $6000
|
|
|
|
jmp ExecuteTransitionAndWait
|
2019-01-15 00:06:58 +00:00
|
|
|
|
2019-02-09 01:48:07 +00:00
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
; .DHGRActionCallback [private]
|
2019-02-09 01:48:07 +00:00
|
|
|
; callback called by okvs_iter on gSlideshowStore
|
|
|
|
; to load and display a single DHGR action screenshot
|
|
|
|
|
2019-07-15 15:42:05 +00:00
|
|
|
; in: A/Y contains address of filename (name only, path is always /ACTION.DHGR/)
|
2019-02-09 01:48:07 +00:00
|
|
|
; X contains 0-based index of the current record in gSlideshowStore
|
|
|
|
; out: all registers and flags clobbered
|
|
|
|
; $0800..$1EFF preserved (this contains the gSlideshowStore OKVS data)
|
|
|
|
; $2000..$BFFF clobbered by graphics data and transition code
|
|
|
|
; $2000..$5FFF/aux clobbered
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
.DHGRActionCallback
|
2019-09-10 02:38:17 +00:00
|
|
|
bit KBD
|
2019-02-09 01:48:07 +00:00
|
|
|
bpl +
|
2019-09-08 18:50:50 +00:00
|
|
|
@actionExit
|
2019-02-09 01:48:07 +00:00
|
|
|
rts
|
|
|
|
+
|
2019-09-10 02:38:17 +00:00
|
|
|
+STAY @afname
|
2019-02-09 01:48:07 +00:00
|
|
|
stx gCurrentlyVisibleSlideshowIndex
|
|
|
|
|
2019-09-08 18:50:50 +00:00
|
|
|
; try to get the human-readable name of this game from gGamesListStore
|
|
|
|
; or gSlideshowStore
|
|
|
|
ldx #$EA
|
2019-07-08 19:03:25 +00:00
|
|
|
jsr GetGameDisplayName
|
2019-09-08 18:50:50 +00:00
|
|
|
; if game is not found (C will be set here), it means it can't be played on
|
|
|
|
; this machine due to memory or joystick requirements, so we don't display
|
|
|
|
; it in slideshows
|
|
|
|
bcs @actionExit
|
|
|
|
; (we don't actually use the display name in the DHGR action slideshow, we
|
|
|
|
; just reuse the function for convenience)
|
2019-07-08 19:03:25 +00:00
|
|
|
|
2019-02-09 01:48:07 +00:00
|
|
|
; load DHGR screenshot at $4000/main and $4000/aux
|
|
|
|
jsr LoadDHRFile
|
2019-09-10 02:38:17 +00:00
|
|
|
!word kDHGRActionDirectory
|
|
|
|
@afname !word $FDFD
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
+LDADDR $6000
|
|
|
|
jmp ExecuteTransitionAndWait
|
2019-02-09 01:48:07 +00:00
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
}
|