refactor GetGameDisplayName

This commit is contained in:
4am 2019-09-21 22:25:34 -04:00
parent c31d91ea60
commit 87a707898c
7 changed files with 9 additions and 19 deletions

View File

@ -9,7 +9,7 @@
; D000..E5F4 - persistent data structures (per-game cheat categories,
; gGlobalPrefsStore, gGamesListStore)
; ...unused...
; EC31..FFF9 - main program code
; EC3B..FFF9 - main program code
; FFFA..FFFF - NMI, reset, IRQ vectors
;
; LC RAM BANK 2

View File

@ -5,14 +5,13 @@
;
; Public functions
; - GetGameDisplayName
; - GetGameDisplayNameInActionSlideshow
; - PlayGame
; - Launch
;
GetGameDisplayName
; in: A/Y points to game filename
; X = #$60 if we should only look in gGamesListStore for a match
; X = #$EA if we should also look in gSlideshowStore
; out: C clear if game exists in gGamesListStore, and
; A/Y points to game display name (but see hack notes below)
; X = game index, or #$FF if the game doesn't really exist but
@ -22,6 +21,10 @@ GetGameDisplayName
; list games that require a joystick, but the games list parser
; filters out joystick-only games if the machine doesn't have a
; joystick)
ldx #$60
+HIDE_NEXT_2_BYTES
GetGameDisplayNameInActionSlideshow
ldx #$EA
stx @maybeExit
+STAY @key
+STAY @slideshowKey

View File

@ -104,8 +104,6 @@ DHGRSingle
+
+STAY @tfname
; find this game in gGamesListStore
ldx #$60
jsr GetGameDisplayName
; 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
@ -141,9 +139,7 @@ DHGRSingle
+
+STAY @afname
; find this game in gGamesListStore or gSlideshowStore
ldx #$EA
jsr GetGameDisplayName
jsr GetGameDisplayNameInActionSlideshow
; if game name is not found (C will be set here), it means the game
; can't be played due to memory or joystick requirements, so we hide
; it from slideshows

View File

@ -87,9 +87,7 @@ BlankGR
+
+STAY @fname
; find this game in gGamesListStore or gSlideshowStore
ldx #$EA
jsr GetGameDisplayName
jsr GetGameDisplayNameInActionSlideshow
; if game name is not found (C will be set here), it means the game
; can't be played due to memory or joystick requirements, so we hide
; it from slideshows

View File

@ -51,8 +51,6 @@ HGRSingle
+
+STAY @tfname
; find this game in gGamesListStore
ldx #$60
jsr GetGameDisplayName
; 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
@ -88,9 +86,7 @@ HGRSingle
+
+STAY @afname
; find this game in gGamesListStore or gSlideshowStore
ldx #$EA
jsr GetGameDisplayName
jsr GetGameDisplayNameInActionSlideshow
; if game name is not found (C will be set here), it means the game
; can't be played due to memory or joystick requirements, so we hide
; it from slideshows

View File

@ -144,7 +144,6 @@ RunAttractModule
; language card or auxiliary memory.
+LDAY @key
ldx #$60
jsr GetGameDisplayName
bcc + ; if game doesn't exist, skip the demo
rts

View File

@ -68,8 +68,6 @@ SHRSingle
+
+STAY @sfname
; find this game in gGamesListStore
ldx #$60
jsr GetGameDisplayName
; 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