2019-01-14 19:06:58 -05:00
|
|
|
;license:MIT
|
2020-03-12 12:36:01 -07:00
|
|
|
;(c) 2018-2020 by 4am
|
2019-01-14 19:06:58 -05:00
|
|
|
;
|
|
|
|
; Super hi-res slideshows
|
|
|
|
;
|
|
|
|
; Public functions
|
2019-06-25 22:44:39 -04:00
|
|
|
; - SHRSlideshow
|
|
|
|
; - SHRSingle
|
2019-01-14 19:06:58 -05:00
|
|
|
;
|
|
|
|
|
2019-10-13 22:22:47 -04:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; 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
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-25 22:44:39 -04:00
|
|
|
SHRSlideshow
|
2019-06-27 09:51:17 -04:00
|
|
|
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
|
2019-01-14 19:06:58 -05:00
|
|
|
and #SUPPORTS_SHR
|
|
|
|
bne +
|
2019-10-08 14:57:40 -04:00
|
|
|
SHRRTS rts
|
2019-10-07 23:47:36 -04:00
|
|
|
+ jsr LoadSHRTransition
|
2019-01-14 19:06:58 -05:00
|
|
|
jsr okvs_iter
|
|
|
|
!word gSlideshowStore
|
2019-10-07 23:47:36 -04:00
|
|
|
!word SHRArtworkCallback
|
2019-01-14 19:06:58 -05:00
|
|
|
jmp BlankHGR
|
|
|
|
|
2019-10-13 22:22:47 -04:00
|
|
|
;------------------------------------------------------------------------------
|
|
|
|
; 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
|
|
|
|
;------------------------------------------------------------------------------
|
2019-06-25 22:44:39 -04:00
|
|
|
SHRSingle
|
2020-03-24 16:30:14 -04:00
|
|
|
+ST16 +
|
2019-06-27 09:51:17 -04:00
|
|
|
lda MachineStatus ; only show SHR on IIgs or if we have a VidHD card
|
2019-06-26 22:51:34 -04:00
|
|
|
and #SUPPORTS_SHR
|
2019-10-08 14:57:40 -04:00
|
|
|
beq SHRRTS
|
2019-10-07 23:47:36 -04:00
|
|
|
jsr BlankSHR
|
2019-06-26 22:51:34 -04:00
|
|
|
jsr LoadFile
|
2019-09-09 22:38:17 -04:00
|
|
|
!word kRootDirectory
|
2019-10-07 23:47:36 -04:00
|
|
|
+ !word $FDFD ; SMC
|
2020-03-11 17:41:16 -07:00
|
|
|
!word $1FF8
|
|
|
|
jsr DecompressSHR
|
2019-10-07 23:47:36 -04:00
|
|
|
jsr LoadSHRTransition
|
2019-10-09 19:21:46 -07:00
|
|
|
jsr ExecuteTransitionAtA000AndWait
|
2019-06-26 22:51:34 -04:00
|
|
|
jmp BlankHGR
|
2019-06-25 22:44:39 -04:00
|
|
|
|
2019-01-14 19:06:58 -05:00
|
|
|
;------------------------------------------------------------------------------
|
2019-10-07 23:47:36 -04:00
|
|
|
; LoadSHGRTransition [private]
|
2020-04-01 11:57:21 -04:00
|
|
|
; load the SHR transition effect code (currently always the same file)
|
2019-01-14 19:06:58 -05:00
|
|
|
;
|
2019-07-15 11:42:05 -04:00
|
|
|
; in: none
|
2019-01-14 19:06:58 -05:00
|
|
|
; out: all registers and flags clobbered
|
|
|
|
; $A000..$BFFF/main contains transition effect code
|
|
|
|
;------------------------------------------------------------------------------
|
2019-10-07 23:47:36 -04:00
|
|
|
LoadSHRTransition
|
2019-09-09 22:38:17 -04:00
|
|
|
jsr LoadFile
|
|
|
|
!word kFXDirectory
|
|
|
|
!word kSFXFizzleFile
|
|
|
|
!word $A000
|
2019-01-14 19:06:58 -05:00
|
|
|
rts
|
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2019-10-13 22:22:47 -04:00
|
|
|
; SHRArtworkCallback [private]
|
2019-01-14 19:06:58 -05:00
|
|
|
; callback called by okvs_iter on gSlideshowStore
|
|
|
|
; to load and display a single SHR graphic
|
|
|
|
|
2019-07-15 11:42:05 -04:00
|
|
|
; in: A/Y contains address of filename (name only, path is always /ARTWORK.SHR/)
|
2020-03-24 16:30:14 -04:00
|
|
|
; $WINDEX contains 0-based index of the current record in gSlideshowStore (word)
|
2019-01-14 19:06:58 -05: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
|
|
|
|
; $2000..$5FFF/aux clobbered
|
|
|
|
;------------------------------------------------------------------------------
|
2019-10-07 23:47:36 -04:00
|
|
|
SHRArtworkCallback
|
2019-09-09 22:38:17 -04:00
|
|
|
bit KBD
|
2019-10-08 14:57:40 -04:00
|
|
|
bmi SHRRTS
|
|
|
|
|
2020-03-24 16:30:14 -04:00
|
|
|
+ST16 @sfname
|
2019-09-20 23:26:32 -04:00
|
|
|
|
2020-03-18 12:08:39 -04:00
|
|
|
jsr FindGame
|
2019-09-20 23:26:32 -04: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
|
2019-10-08 14:57:40 -04:00
|
|
|
bcs SHRRTS
|
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-01-14 19:06:58 -05:00
|
|
|
|
2019-10-07 23:47:36 -04:00
|
|
|
jsr BlankSHR
|
2019-01-14 19:06:58 -05:00
|
|
|
|
2020-03-11 21:19:42 -07:00
|
|
|
; load compressed SHR artwork at $1FF0/main (not aux)
|
2019-01-14 19:06:58 -05:00
|
|
|
jsr LoadFile
|
2019-09-09 22:38:17 -04:00
|
|
|
!word kSHRArtworkDirectory
|
|
|
|
@sfname !word $FDFD
|
2020-03-11 17:41:16 -07:00
|
|
|
!word $1FF8
|
|
|
|
jsr DecompressSHR
|
2019-10-09 19:21:46 -07:00
|
|
|
jmp ExecuteTransitionAtA000AndWait
|
2019-01-14 19:06:58 -05:00
|
|
|
|
|
|
|
;------------------------------------------------------------------------------
|
2019-10-13 22:22:47 -04:00
|
|
|
; BlankSHR [private]
|
2019-01-14 19:06:58 -05:00
|
|
|
; clear and show SHR mode without flickering
|
|
|
|
;
|
2019-06-27 10:55:07 -04: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 13:59:06 -04:00
|
|
|
; Thanks to John Brooks for explaining all of this to me. Twice.
|
2019-01-14 19:06:58 -05:00
|
|
|
; out: text page clobbered (but screen holes preserved)
|
|
|
|
; $2000..$9FFF/aux cleared
|
|
|
|
;------------------------------------------------------------------------------
|
2019-10-07 23:47:36 -04:00
|
|
|
BlankSHR
|
2019-01-14 19:06:58 -05:00
|
|
|
jsr Home
|
|
|
|
|
2020-07-29 22:27:46 -04:00
|
|
|
lda #%01000001 ; set GS NEWVIDEO mode to turn on linearize
|
2019-06-27 10:55:07 -04:00
|
|
|
sta NEWVIDEO
|
2019-01-14 19:06:58 -05:00
|
|
|
|
2019-06-27 10:55:07 -04:00
|
|
|
sta WRITEAUXMEM ; writes go to auxmem
|
2019-01-14 19:06:58 -05:00
|
|
|
|
2020-07-29 21:18:02 -07:00
|
|
|
lda #$00 ; enable auxmem-to-bank-E1 shadowing on IIgs
|
|
|
|
sta SHADOW
|
|
|
|
|
2019-01-14 19:06:58 -05:00
|
|
|
lda #$20 ; clear $2000..$9FFF in auxmem
|
|
|
|
ldx #$80
|
2019-10-09 18:02:46 -07:00
|
|
|
jsr ClearMem
|
2019-01-14 19:06:58 -05:00
|
|
|
|
2019-06-27 10:55:07 -04:00
|
|
|
sta WRITEMAINMEM ; writes go to main memory
|
2019-01-14 19:06:58 -05:00
|
|
|
|
2020-07-29 22:27:46 -04:00
|
|
|
lda #%11000001 ; set GS NEWVIDEO mode to turn on SHR mode
|
2019-06-27 10:55:07 -04:00
|
|
|
sta NEWVIDEO
|
2019-01-14 19:06:58 -05:00
|
|
|
|
|
|
|
rts
|