diff --git a/Makefile b/Makefile index f47c68463..86dca7b2f 100644 --- a/Makefile +++ b/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 diff --git a/res/dfx.conf b/res/dfx.conf index f46a22590..37dfdedd3 100644 --- a/res/dfx.conf +++ b/res/dfx.conf @@ -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] \ No newline at end of file +# # 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] \ No newline at end of file diff --git a/res/title.hgr/PRINCEUNP b/res/title.hgr/PRINCEUNP index 197adce0e..40ead6ad4 100644 Binary files a/res/title.hgr/PRINCEUNP and b/res/title.hgr/PRINCEUNP differ diff --git a/src/glue.launch.a b/src/glue.launch.a index 759d2ef78..2aa7f246b 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -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 diff --git a/src/prodos.path.a b/src/prodos.path.a index 703894c07..a17f6f2b6 100644 --- a/src/prodos.path.a +++ b/src/prodos.path.a @@ -28,6 +28,10 @@ kSHRArtworkDirectory !byte 12 !raw "ARTWORK.SHR/" +kMiniAttractDirectory + !byte 8 + !raw "ATTRACT/" + kAttractModeSlideshowDirectory !byte 3 !raw "SS/" diff --git a/src/textrank.a b/src/textrank.a index b88b8450c..4325ad06b 100644 --- a/src/textrank.a +++ b/src/textrank.a @@ -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 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index 18b3adaed..d8ee44c27 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -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] diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index fc04cf40b..e5dd77af9 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -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 ;------------------------------------------------------------------------------ diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 8a25d9232..b2e16ca9a 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -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 diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index 6df50a863..fb7ca49aa 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -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 diff --git a/src/ui.common.a b/src/ui.common.a index afb6e040e..bf47cf512 100644 --- a/src/ui.common.a +++ b/src/ui.common.a @@ -56,7 +56,7 @@ SoftBell ; out: $0106..$011F clobbered ;------------------------------------------------------------------------------ Home - lda MachineStatus + lda oldstatus and #SUPPORTS_SHR beq @noSHR lda $C035 diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index e2d37ebbb..e29850faa 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -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