mirror of
https://github.com/a2-4am/4cade.git
synced 2024-12-26 20:30:29 +00:00
mini attract mode
This commit is contained in:
parent
6da3cba47a
commit
23844487b8
4
Makefile
4
Makefile
@ -107,6 +107,9 @@ dsk: md asm
|
||||
rsync -aP res/artwork.shr/* build/ARTWORK.SHR >>build/log
|
||||
bin/buildfileinfo.py build/ARTWORK.SHR "C1" "2000" >>build/log
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/ARTWORK.SHR" "build/ARTWORK.SHR" >>build/log
|
||||
rsync -aP res/attract/* build/ATTRACT >>build/log
|
||||
bin/buildfileinfo.py build/ATTRACT "04" "8000" >>build/log
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/ATTRACT" "build/ATTRACT" >>build/log
|
||||
rsync -aP res/ss/* build/SS >>build/log
|
||||
bin/buildfileinfo.py build/SS "04" "4000" >>build/log
|
||||
$(CADIUS) ADDFOLDER build/"$(DISK)" "/${VOLUME}/SS" "build/SS" >>build/log
|
||||
@ -135,6 +138,7 @@ md:
|
||||
mkdir -p build/ACTION.HGR
|
||||
mkdir -p build/ACTION.DHGR
|
||||
mkdir -p build/ARTWORK.SHR
|
||||
mkdir -p build/ATTRACT
|
||||
mkdir -p build/SS
|
||||
mkdir -p build/DEMO
|
||||
mkdir -p build/FX
|
||||
|
@ -1 +1 @@
|
||||
#
# transition effects for DHGR slideshows
#
# Each Mega-Attract Module that is a DHGR slideshow (see attract.conf)
# will use a single transition effect for the length of the module.
# Transition effects are loaded in the order listed in this file. Each line
# of this file is a filename (not including comments, like this one). The
# name of the next transition effect is stored in the global prefs, so this
# file should not contain duplicates.
#
# Transition effects are binary files loaded at $6000 and called with DHGR
# page 1 showing and the next DHGR graphic already loaded at $4000/main and
# $4000/aux. A transition effect has full use of main and auxiliary memory,
# including zero pages and text pages if needed. LC RAM banks 1 and 2 are
# reserved for the launcher.
#
# Important: LC RAM bank 1 will be read/write on entry and must be read/write
# on exit. If you need ROM routines, you are responsible for switching to ROM
# then switching back to RAM bank 1 (read/write) before returning.
#
DHGR.RIPPLE
DHGR.FIZZLE
DHGR.RADIAL
DHGR.STAR
DHGR.RADIAL3
DHGR.IRIS
DHGR.RADIAL2
DHGR.RADIAL4
DHGR.RADIAL5
DHGR.RIPPLEWH
DHGR.FIZZLEWH
DHGR.RADIALWH
DHGR.STARWH
DHGR.RADIAL3WH
DHGR.IRISWH
DHGR.RADIAL2WH
DHGR.RADIAL4WH
DHGR.RADIAL5WH
[eof]
|
||||
#
# transition effects for DHGR slideshows
#
# Each Mega-Attract Module that is a DHGR slideshow (see attract.conf)
# will use a single transition effect for the length of the module.
# Transition effects are loaded in the order listed in this file. Each line
# of this file is a filename (not including comments, like this one). The
# name of the next transition effect is stored in the global prefs, so this
# file should not contain duplicates.
#
# Transition effects are binary files loaded at $6000 and called with DHGR
# page 1 showing and the next DHGR graphic already loaded at $4000/main and
# $4000/aux. A transition effect has full use of main and auxiliary memory,
# including zero pages and text pages if needed. LC RAM banks 1 and 2 are
# reserved for the launcher.
#
# Important: LC RAM bank 1 will be read/write on entry and must be read/write
# on exit. If you need ROM routines, you are responsible for switching to ROM
# then switching back to RAM bank 1 (read/write) before returning.
#
DHGR.FIZZLE
DHGR.RIPPLE
DHGR.RADIAL
DHGR.STAR
DHGR.RADIAL3
DHGR.IRIS
DHGR.RADIAL2
DHGR.RADIAL4
DHGR.RADIAL5
DHGR.RIPPLEWH
DHGR.FIZZLEWH
DHGR.RADIALWH
DHGR.STARWH
DHGR.RADIAL3WH
DHGR.IRISWH
DHGR.RADIAL2WH
DHGR.RADIAL4WH
DHGR.RADIAL5WH
[eof]
|
Binary file not shown.
@ -10,7 +10,6 @@
|
||||
; - Launch
|
||||
;
|
||||
; Public variables
|
||||
; - SelectedIndex ; [byte] numeric index in gGamesStore of currently selected game in search mode
|
||||
; - gCurrentAttractIndex ; [byte] numeric index in gAttractModeStore of current Mega-Attract Module
|
||||
; - gCurrentlyVisibleSlideshowIndex ; [byte] numeric index in gSlideshowStore of currently visible slideshow picture
|
||||
; (only valid during slideshows, not updated once a key is pressed)
|
||||
@ -18,9 +17,10 @@
|
||||
!zone {
|
||||
|
||||
PlayGameFromSearch
|
||||
stx @gameIndex
|
||||
jsr okvs_nth
|
||||
!word gGamesListStore
|
||||
SelectedIndex
|
||||
@gameIndex
|
||||
!byte $FD ; SMC
|
||||
jmp .Go
|
||||
|
||||
|
@ -28,6 +28,10 @@ kSHRArtworkDirectory
|
||||
!byte 12
|
||||
!raw "ARTWORK.SHR/"
|
||||
|
||||
kMiniAttractDirectory
|
||||
!byte 8
|
||||
!raw "ATTRACT/"
|
||||
|
||||
kAttractModeSlideshowDirectory
|
||||
!byte 3
|
||||
!raw "SS/"
|
||||
|
@ -4,14 +4,16 @@
|
||||
; text rank - an implementation of the Quicksilver search rank algorithm
|
||||
;
|
||||
; Public functions
|
||||
; - ResetTextRank
|
||||
; - TextRankCallback (as okvs_iter_values callback)
|
||||
;
|
||||
; Public variables
|
||||
; - InputLength
|
||||
; - InputBuffer
|
||||
; - MatchCount
|
||||
; - BestMatchScore
|
||||
; - BestMatchIndex
|
||||
; - InputLength ; [byte] number of characters typed in search mode
|
||||
; - InputBuffer ; [25 bytes] characters typed in search mode
|
||||
; - SelectedIndex ; [byte] index in gGamesListStore of currently selected game in search mode
|
||||
; - MatchCount ; [byte] number of games that match InputBuffer
|
||||
; - BestMatchScore ; [byte] raw ranking score (0-100) of current best match (updated during TextRankCallback)
|
||||
; - BestMatchIndex ; [byte] index in gGamesListStore of current best match (updated during TextRankCallback)
|
||||
|
||||
zpword = $F0 ; word
|
||||
zpstring = $F2 ; word
|
||||
@ -27,6 +29,8 @@ InputLength
|
||||
!byte 0
|
||||
InputBuffer
|
||||
!text " "
|
||||
SelectedIndex
|
||||
!byte $FF
|
||||
MatchCount
|
||||
!byte 0
|
||||
BestMatchScore
|
||||
|
@ -12,7 +12,7 @@
|
||||
!zone {
|
||||
|
||||
DHGRTitleSlideshow
|
||||
bit MachineStatus ; only run DHGR slideshow if we have 128K
|
||||
bit oldstatus ; only run DHGR slideshow if we have 128K
|
||||
bvs +
|
||||
rts
|
||||
+ jsr .LoadDHGRTransition ; load transition effect code at $6000
|
||||
@ -23,7 +23,7 @@ DHGRTitleSlideshow
|
||||
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
||||
|
||||
DHGRActionSlideshow
|
||||
bit MachineStatus ; only run DHGR slideshow if we have 128K
|
||||
bit oldstatus ; only run DHGR slideshow if we have 128K
|
||||
bvs +
|
||||
rts
|
||||
+ jsr .LoadDHGRTransition ; load transition effect code at $6000
|
||||
@ -34,8 +34,16 @@ DHGRActionSlideshow
|
||||
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
|
||||
|
||||
DHGRSingle
|
||||
; TODO
|
||||
bit oldstatus ; only show DHGR screenshots if we have 128K
|
||||
bvs +
|
||||
rts
|
||||
+ jsr SetPath ; A/Y point to path
|
||||
jsr BlankDHGR ; switch to DHGR mode with initial blank screen
|
||||
jsr LoadDHRFile ; load DHGR file at $4000/main and $4000/aux
|
||||
+ 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
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; .LoadDHGRTransition [private]
|
||||
|
@ -26,8 +26,11 @@ HGRActionSlideshow
|
||||
rts ; exit with last picture still visible
|
||||
|
||||
HGRSingle
|
||||
; TODO
|
||||
rts
|
||||
jsr SetPath
|
||||
jsr LoadFile ; load HGR screenshot at $4000
|
||||
jsr .LoadHGRTransition ; load transition effect code at $6000
|
||||
+LDADDR $6000
|
||||
jmp ExecuteTransitionAndWait
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; .HGRTitleCallback [private]
|
||||
@ -149,8 +152,7 @@ HGRSingle
|
||||
; looks up name of next HGR transition effect in FX.CONF and loads that file
|
||||
; at $6000
|
||||
|
||||
; in: gFXStore has been initialized
|
||||
; gGlobalPrefsStore has been initialized
|
||||
; in: gGlobalPrefsStore has been initialized
|
||||
; out: all registers and flags clobbered
|
||||
; $6000..$BFFF contains transition effect code
|
||||
;------------------------------------------------------------------------------
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; MegaAttractMode
|
||||
; main entry point for Mega Attract Mode, which cycles through modules listed
|
||||
; in ATTRACT.CONF to provide pretty visual effects and snippets of self-running
|
||||
; self-terminating game demos
|
||||
; main entry point for Mega Attract Mode, which endlessly cycles through
|
||||
; modules listed in ATTRACT.CONF to display title pages, action screenshots,
|
||||
; super hi-res box art (on supporting platforms), and self-running game demos
|
||||
;
|
||||
; in: gGlobalPrefsStore must be initialized
|
||||
; out: never returns to caller (may JMP to other major modes)
|
||||
@ -90,6 +90,70 @@ MegaAttractMode
|
||||
@jmpsearch
|
||||
jmp SearchMode
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; MiniAttractMode
|
||||
; run attract modules related to one game
|
||||
;
|
||||
; in: X = index in gGamesStore of game
|
||||
; gGlobalPrefsStore must be initialized
|
||||
; out: all flags and registers clobbered
|
||||
; assume all of main memory has been clobbered
|
||||
;------------------------------------------------------------------------------
|
||||
MiniAttractMode
|
||||
stx +
|
||||
|
||||
jsr BlankHGR
|
||||
|
||||
jsr okvs_nth
|
||||
!word gGamesListStore
|
||||
+ !byte $FD ; SMC
|
||||
+STAY @MiniAttractGame
|
||||
|
||||
lda #0
|
||||
sta @MiniAttractIndex
|
||||
|
||||
@loop
|
||||
; load mini attract mode configuration file at $8000
|
||||
+LOAD_FILE kMiniAttractDirectory, @MiniAttractGame
|
||||
|
||||
jsr ParseKeyValueList ; parse configuration into OKVS data structure at $6000
|
||||
!word gAttractModeStore
|
||||
!word ldrlo2 ; (ldrlo2) points to last load address, so $8000
|
||||
!byte 0
|
||||
|
||||
jsr okvs_len
|
||||
!word gAttractModeStore
|
||||
cmp @MiniAttractIndex
|
||||
beq @exit ; we've run through all modules, so exit to caller
|
||||
|
||||
lda @MiniAttractIndex
|
||||
sta +
|
||||
jsr okvs_nth ; get the next module on the list
|
||||
!word gAttractModeStore
|
||||
+ !byte $FD ; SMC
|
||||
+STAY @key
|
||||
|
||||
jsr okvs_get ; get module type
|
||||
!word gAttractModeStore
|
||||
@key !word $FDFD ; SMC
|
||||
+STAY PTR
|
||||
|
||||
ldy #1
|
||||
lda (PTR),y
|
||||
and #$0F ; convert ASCII digit to integer
|
||||
tax ; X = module type
|
||||
+LDAY @key ; A/Y = address of module name
|
||||
jsr RunAttractModule ; execute the module
|
||||
|
||||
inc @MiniAttractIndex
|
||||
lda $C000
|
||||
bpl @loop
|
||||
@exit rts
|
||||
@MiniAttractIndex
|
||||
!byte $FD
|
||||
@MiniAttractGame
|
||||
!word $FDFD
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; RunAttractModule
|
||||
; run a single attract module of any type and return to caller
|
||||
|
@ -11,22 +11,34 @@
|
||||
!zone {
|
||||
|
||||
SHRSlideshow
|
||||
lda MachineStatus ; only run SHR slideshow on IIgs or if we have a VidHD card
|
||||
lda oldstatus ; only show SHR on IIgs or if we have a VidHD card
|
||||
and #SUPPORTS_SHR
|
||||
bne +
|
||||
rts
|
||||
+ jsr LoadSHRTransition
|
||||
+ jsr .LoadSHRTransition
|
||||
jsr okvs_iter
|
||||
!word gSlideshowStore
|
||||
!word SHRArtworkCallback
|
||||
jmp BlankHGR
|
||||
|
||||
SHRSingle
|
||||
; TODO
|
||||
+STAY SAVE
|
||||
lda oldstatus ; only show SHR on IIgs or if we have a VidHD card
|
||||
and #SUPPORTS_SHR
|
||||
bne +
|
||||
rts
|
||||
+
|
||||
+LDAY SAVE
|
||||
jsr SetPath
|
||||
jsr .BlankSHR
|
||||
jsr LoadFile
|
||||
jsr .LoadSHRTransition
|
||||
+LDADDR $A000
|
||||
jsr ExecuteTransitionAndWait
|
||||
jmp BlankHGR
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; .LoadSHGRTransition
|
||||
; .LoadSHGRTransition [private]
|
||||
; [TODO] for now there is only 1 SHR transition so this always load the same file
|
||||
; [TODO] but eventually it should look up name of next SHR transition effect in
|
||||
; [TODO] SFX.CONF or something and loads that file at $A000
|
||||
@ -36,7 +48,7 @@ SHRSingle
|
||||
; out: all registers and flags clobbered
|
||||
; $A000..$BFFF/main contains transition effect code
|
||||
;------------------------------------------------------------------------------
|
||||
LoadSHRTransition
|
||||
.LoadSHRTransition
|
||||
+LDADDR kSFXFizzleFile
|
||||
+STAY @file
|
||||
+LOAD_FILE kFXDirectory, @file
|
||||
|
@ -56,7 +56,7 @@ SoftBell
|
||||
; out: $0106..$011F clobbered
|
||||
;------------------------------------------------------------------------------
|
||||
Home
|
||||
lda MachineStatus
|
||||
lda oldstatus
|
||||
and #SUPPORTS_SHR
|
||||
beq @noSHR
|
||||
lda $C035
|
||||
|
@ -51,7 +51,7 @@ _SearchModeInputLoop
|
||||
jsr _ResetInputTimeout
|
||||
|
||||
cmp #$9B ; Esc clears the input buffer (if any)
|
||||
bne + ; or switches to attract mode
|
||||
bne + ; or switches to mega attract mode
|
||||
ldx #kInputClear
|
||||
bne InputDispatch ; always branches
|
||||
+
|
||||
@ -68,6 +68,11 @@ _SearchModeInputLoop
|
||||
+ cmp #$88 ; left arrow = delete
|
||||
beq -
|
||||
|
||||
cmp #$89 ; TAB switches to mini attract mode
|
||||
bne + ; if there is a game selected
|
||||
ldx #kInputTab
|
||||
bne InputDispatch ; always branches
|
||||
+
|
||||
and #$7F ; strip high bit for search characters
|
||||
cmp #$30 ; control keys and punctuation ignored
|
||||
bcc @badkey
|
||||
@ -102,8 +107,9 @@ InputDispatch
|
||||
sta @j+2
|
||||
pla ; restore key pressed
|
||||
@j jsr $FDFD ; SMC
|
||||
bcc _SearchModeInputLoop
|
||||
jmp SearchMode ; if carry is set, force full redraw
|
||||
bcs +
|
||||
jmp _SearchModeInputLoop ; if carry is clear, continue
|
||||
+ jmp SearchMode ; if carry is set, force full redraw
|
||||
|
||||
OnClear
|
||||
ldx InputLength
|
||||
@ -122,6 +128,18 @@ OnBack
|
||||
+ dec InputLength
|
||||
jmp OnInputChanged
|
||||
|
||||
OnTab
|
||||
ldx SelectedIndex
|
||||
cpx #$FF
|
||||
beq +
|
||||
jsr MiniAttractMode
|
||||
cmp #$8D
|
||||
beq OnLaunch
|
||||
sec ; tell caller to redraw UI
|
||||
rts
|
||||
+ clc
|
||||
rts
|
||||
|
||||
OnLaunch
|
||||
ldx SelectedIndex
|
||||
cpx #$FF
|
||||
@ -368,10 +386,12 @@ OffscreenPage
|
||||
kInputSearch = 0
|
||||
kInputClear = 1
|
||||
kInputBack = 2
|
||||
kInputLaunch = 3
|
||||
kInputTab = 3
|
||||
kInputLaunch = 4
|
||||
|
||||
InputDispatchTable
|
||||
!word OnSearch
|
||||
!word OnClear
|
||||
!word OnBack
|
||||
!word OnTab
|
||||
!word OnLaunch
|
||||
|
Loading…
Reference in New Issue
Block a user