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
|
|
|
;
|
|
|
|
; Super hi-res slideshows
|
|
|
|
;
|
|
|
|
; Public functions
|
2019-06-26 02:44:39 +00:00
|
|
|
; - SHRSlideshow
|
|
|
|
; - SHRSingle
|
2019-01-15 00:06:58 +00:00
|
|
|
;
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
!zone {
|
|
|
|
|
|
|
|
SHRSlideshow
|
2019-06-27 13:51:17 +00:00
|
|
|
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
|
2019-01-15 00:06:58 +00:00
|
|
|
and #SUPPORTS_SHR
|
|
|
|
bne +
|
|
|
|
rts
|
2019-06-27 02:51:34 +00:00
|
|
|
+ jsr .LoadSHRTransition
|
2019-01-15 00:06:58 +00:00
|
|
|
jsr okvs_iter
|
|
|
|
!word gSlideshowStore
|
2019-06-30 19:18:51 +00:00
|
|
|
!word .SHRArtworkCallback
|
2019-01-15 00:06:58 +00:00
|
|
|
jmp BlankHGR
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
SHRSingle
|
2019-06-27 02:51:34 +00:00
|
|
|
+STAY SAVE
|
2019-06-27 13:51:17 +00:00
|
|
|
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
|
2019-06-27 02:51:34 +00:00
|
|
|
and #SUPPORTS_SHR
|
|
|
|
bne +
|
2019-06-26 02:44:39 +00:00
|
|
|
rts
|
2019-06-27 02:51:34 +00:00
|
|
|
+
|
|
|
|
+LDAY SAVE
|
|
|
|
jsr SetPath
|
|
|
|
jsr .BlankSHR
|
|
|
|
jsr LoadFile
|
|
|
|
jsr .LoadSHRTransition
|
|
|
|
+LDADDR $A000
|
|
|
|
jsr ExecuteTransitionAndWait
|
|
|
|
jmp BlankHGR
|
2019-06-26 02:44:39 +00:00
|
|
|
|
2019-01-15 00:06:58 +00:00
|
|
|
;------------------------------------------------------------------------------
|
2019-06-27 02:51:34 +00:00
|
|
|
; .LoadSHGRTransition [private]
|
2019-01-15 00:06:58 +00:00
|
|
|
;
|
|
|
|
; in: gSFXStore has been initialized
|
|
|
|
; gGlobalPrefsStore has been initialized
|
|
|
|
; out: all registers and flags clobbered
|
|
|
|
; $A000..$BFFF/main contains transition effect code
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-27 02:51:34 +00:00
|
|
|
.LoadSHRTransition
|
2019-01-18 14:19:32 +00:00
|
|
|
+LDADDR kSFXFizzleFile
|
|
|
|
+STAY @file
|
|
|
|
+LOAD_FILE kFXDirectory, @file
|
2019-01-15 00:06:58 +00:00
|
|
|
rts
|
2019-01-18 14:19:32 +00:00
|
|
|
@file !word $FDFD
|
2019-01-15 00:06:58 +00:00
|
|
|
kSFXFizzleFile
|
|
|
|
!byte @kSFXFizzleFile_e-*-1
|
2019-01-18 14:19:32 +00:00
|
|
|
!text "SHR.FIZZLE"
|
2019-01-15 00:06:58 +00:00
|
|
|
@kSFXFizzleFile_e
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-30 19:18:51 +00:00
|
|
|
; .SHRArtworkCallback [private]
|
2019-01-15 00:06:58 +00:00
|
|
|
; callback called by okvs_iter on gSlideshowStore
|
|
|
|
; to load and display a single SHR graphic
|
|
|
|
|
|
|
|
; in: A/Y contains address of filename (name only, path is always /SHR/)
|
|
|
|
; 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-30 19:18:51 +00:00
|
|
|
.SHRArtworkCallback
|
2019-01-15 00:06:58 +00:00
|
|
|
+STAY PTR
|
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
lda KBD
|
2019-01-15 00:06:58 +00:00
|
|
|
bpl +
|
|
|
|
rts
|
|
|
|
+
|
|
|
|
stx gCurrentlyVisibleSlideshowIndex
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
jsr .BlankSHR
|
2019-01-15 00:06:58 +00:00
|
|
|
|
|
|
|
; load SHR artwork at $2000/main (not aux)
|
|
|
|
+LDADDR kSHRArtworkDirectory
|
2019-06-19 02:40:17 +00:00
|
|
|
jsr SetPath
|
2019-01-15 00:06:58 +00:00
|
|
|
+LDAY PTR
|
|
|
|
jsr AddToPath
|
|
|
|
jsr LoadFile
|
|
|
|
|
2019-06-26 02:44:39 +00:00
|
|
|
+LDADDR $A000
|
|
|
|
jmp ExecuteTransitionAndWait
|
2019-01-15 00:06:58 +00:00
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
; .BlankSHR [private]
|
2019-01-15 00:06:58 +00:00
|
|
|
; clear and show SHR mode without flickering
|
|
|
|
;
|
2019-06-27 14:55:07 +00:00
|
|
|
; in: Machine is a IIgs or has a VidHD card that responds appropriately to
|
|
|
|
; IIgs-specific softswitches for graphics and memory modes.
|
|
|
|
; NOTE: THIS ROUTINE WILL CRASH ON AN APPLE //C due to writing to $C029,
|
|
|
|
; so it is imperative that the caller ensures the machine type.
|
2019-06-30 17:59:06 +00:00
|
|
|
; Thanks to John Brooks for explaining all of this to me. Twice.
|
2019-01-15 00:06:58 +00:00
|
|
|
; out: text page clobbered (but screen holes preserved)
|
|
|
|
; $2000..$9FFF/aux cleared
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-26 02:44:39 +00:00
|
|
|
.BlankSHR
|
2019-01-15 00:06:58 +00:00
|
|
|
jsr Home
|
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on linearize
|
2019-01-15 00:06:58 +00:00
|
|
|
ora #$40
|
2019-06-27 14:55:07 +00:00
|
|
|
sta NEWVIDEO
|
2019-01-15 00:06:58 +00:00
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
sta WRITEAUXMEM ; writes go to auxmem
|
2019-01-15 00:06:58 +00:00
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
lda SHADOW ; enable auxmem-to-bank-E1 shadowing on IIgs
|
2019-01-15 00:06:58 +00:00
|
|
|
and #$F7
|
2019-06-27 14:55:07 +00:00
|
|
|
sta SHADOW
|
2019-01-15 00:06:58 +00:00
|
|
|
|
|
|
|
lda #$20 ; clear $2000..$9FFF in auxmem
|
|
|
|
sta @a+2
|
|
|
|
ldx #$80
|
|
|
|
lda #0
|
|
|
|
tay
|
|
|
|
@a sta $2000,y
|
|
|
|
iny
|
|
|
|
bne @a
|
|
|
|
inc @a+2
|
|
|
|
dex
|
|
|
|
bne @a
|
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
sta WRITEMAINMEM ; writes go to main memory
|
2019-01-15 00:06:58 +00:00
|
|
|
|
2019-06-27 14:55:07 +00:00
|
|
|
lda NEWVIDEO ; set GS NEWVIDEO mode to turn on SHR mode
|
2019-01-15 00:06:58 +00:00
|
|
|
ora #$81
|
2019-06-27 14:55:07 +00:00
|
|
|
sta NEWVIDEO
|
2019-01-15 00:06:58 +00:00
|
|
|
|
|
|
|
rts
|
2019-06-26 02:44:39 +00:00
|
|
|
|
|
|
|
}
|