From f96b71ffc270f54d8a917e8780b680cc93d49902 Mon Sep 17 00:00:00 2001 From: 4am Date: Thu, 28 Oct 2021 01:28:20 -0400 Subject: [PATCH] use gGamesListStore less --- src/constants.a | 2 +- src/glue.launch.a | 7 ++++--- src/ui.animation.a | 4 ++-- src/ui.attract.mode.a | 4 +++- src/ui.offscreen.a | 5 +---- src/ui.overlay.a | 6 ++---- src/ui.search.mode.a | 2 +- 7 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/constants.a b/src/constants.a index cc7b0a07d..7d750d829 100644 --- a/src/constants.a +++ b/src/constants.a @@ -10,7 +10,7 @@ ; ...unused... ; E000..E3FF - HGR font data ; ...unused... -; E962..FFEE - main program code +; E978..FFEE - main program code ; FFEF..FFF9 - API functions and global constants available for main program ; code, prelaunchers, transition effects, &c. ; (LoadFileDirect, Wait/UnwaitForVBL, MockingboardStuff, MachineStatus) diff --git a/src/glue.launch.a b/src/glue.launch.a index 5ebf09ce5..efa6df295 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -4,10 +4,10 @@ ; Functions to launch games and self-running demos ; ; Public functions +; - AnyGameSelected ; - GetGameToLaunch ; - FindGame ; - FindGameInActionSlideshow -; - GetGameDisplayName ; - PlayGame ; - Launch ; @@ -37,7 +37,8 @@ AnyGameSelected ; GetGameToLaunch ; get filename of game that is currently selected in the UI (if any) ; -; in: gGameToLaunch = index into gGamesListStore (word) or #$FFFF if no game selected +; in: gGameToLaunch = index into gSearchStore (word) or #$FFFF if no game selected +; gSearchStore populated ; out: C clear if a game is selected, and ; A/Y points to game filename ; C set if no game is selected @@ -46,7 +47,7 @@ GetGameToLaunch jsr AnyGameSelected bcs _gameToLaunchExit +ST16 WINDEX - +LDADDR gGamesListStore + +LDADDR gSearchStore jsr okvs_nth ForceGoodResult clc diff --git a/src/ui.animation.a b/src/ui.animation.a index 67b3caae5..071c960d5 100644 --- a/src/ui.animation.a +++ b/src/ui.animation.a @@ -13,7 +13,7 @@ ; slow down to 1 Mhz (always), then check if there is an animation for the ; title screenshot we just displayed, and if so, load it and call it ; -; in: none +; in: gSearchStore is populated ; out: C clear ; all other flags clobbered ; all registers clobbered @@ -61,7 +61,7 @@ MaybeAnimateTitle bit $c050 ; turn on graphics mode (Home set text mode) jsr Launch ; execute the animation - jsr BuildSearchStore + jsr ReloadSearchIndex jsr ResyncPage ; we don't know which HGR page is showing ; when the animation returns, so resync ; the current one with our OffscreenPage diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index df3e897af..5b47dbd1d 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -54,6 +54,7 @@ MegaAttractMode bpl MegaAttractMode cmp #$8D ; Enter plays the game shown on screen. bne + ; Any other key switches to Search Mode. + jsr ReloadSearchIndex jsr PlayGame ; (might return if user hits Ctrl-Reset) + jmp SearchMode @@ -61,7 +62,8 @@ MegaAttractMode ; MiniAttractMode ; run attract modules related to one game ; -; in: gGameToLaunch = index in gGamesListStore (word) +; in: gGameToLaunch = index in gSearchStore (word) +; gSearchStore populated ; out: all flags and registers clobbered ; assume all of main memory has been clobbered ;------------------------------------------------------------------------------ diff --git a/src/ui.offscreen.a b/src/ui.offscreen.a index 893d7c104..82895c5da 100644 --- a/src/ui.offscreen.a +++ b/src/ui.offscreen.a @@ -84,10 +84,7 @@ LoadOffscreenFromAY LoadGameTitleOffscreen ; in: gGameToLaunch = index into gSearchStore (word) - +LD16 gGameToLaunch - +ST16 WINDEX - +LDADDR gSearchStore - jsr okvs_nth ; A/Y -> key (game filename) in gSearchStore + jsr GetGameToLaunch +ST16 @fname bit MachineStatus ; if < 128K, don't bother checking for DHGR title bvc @hgr diff --git a/src/ui.overlay.a b/src/ui.overlay.a index 5bb9dfbf4..e6f70accf 100644 --- a/src/ui.overlay.a +++ b/src/ui.overlay.a @@ -122,11 +122,9 @@ DrawUI sta gPathname ; hack, used by first RedrawForDHGR which follows ; Draw40Chars which doesn't set gPathname - jsr AnyGameSelected ; get index number of current game, if any + jsr GetGameToLaunch ; get current game, if any bcs @doneWithLine2 ; if no game, nothing more to do on UI line 2 - +ST16 WINDEX - +LDADDR gSearchStore - jsr okvs_nth ; A/Y -> key of current game (in gSearchStore) + ; A/Y -> key of current game (in gSearchStore) jsr okvs_get_current ; (PTR) -> display name of current game ; Y = 0 lda (PTR), y diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index cf69fde8e..2b2811332 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -112,7 +112,7 @@ SearchMode txs stx gGameToLaunch ; $FFFF = no game selected stx gGameToLaunch+1 - jsr BuildSearchStore + jsr ReloadSearchIndex jsr Home ; clear screen (switches to text mode) stx OffscreenPage ; don't show text page 2 by accident jsr OnInputChanged ; draw UI offscreen