mirror of https://github.com/a2-4am/4cade.git
use gGamesListStore less
This commit is contained in:
parent
1cbbb972fc
commit
f96b71ffc2
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
;------------------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue