From 87a707898c532bc9ec6621e6d0ff27b433f367c4 Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 21 Sep 2019 22:25:34 -0400 Subject: [PATCH] refactor GetGameDisplayName --- src/constants.a | 2 +- src/glue.launch.a | 7 +++++-- src/ui.attract.dhgr.a | 6 +----- src/ui.attract.gr.a | 4 +--- src/ui.attract.hgr.a | 6 +----- src/ui.attract.mode.a | 1 - src/ui.attract.shr.a | 2 -- 7 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/constants.a b/src/constants.a index 01b1a6dde..c0e7b0f19 100644 --- a/src/constants.a +++ b/src/constants.a @@ -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 diff --git a/src/glue.launch.a b/src/glue.launch.a index 061bd7e47..6834154e8 100644 --- a/src/glue.launch.a +++ b/src/glue.launch.a @@ -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 diff --git a/src/ui.attract.dhgr.a b/src/ui.attract.dhgr.a index 5026e7bbe..c7519f8f6 100644 --- a/src/ui.attract.dhgr.a +++ b/src/ui.attract.dhgr.a @@ -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 diff --git a/src/ui.attract.gr.a b/src/ui.attract.gr.a index fffa2ea5c..7f5cf8cd9 100644 --- a/src/ui.attract.gr.a +++ b/src/ui.attract.gr.a @@ -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 diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index d04dd77e6..61f9aa328 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -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 diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 36c4cc95f..8ada42ac2 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -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 diff --git a/src/ui.attract.shr.a b/src/ui.attract.shr.a index b3148caa2..2dd72bc11 100644 --- a/src/ui.attract.shr.a +++ b/src/ui.attract.shr.a @@ -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