From 686539f8b38184f9142411dbd07ba50a17476697 Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 5 Oct 2019 16:40:19 -0400 Subject: [PATCH] accelerate during search and browse modes if possible --- src/constants.a | 6 +++--- src/prodos.impl.a | 8 ++++++++ src/ui.browse.mode.a | 8 ++++++-- src/ui.search.mode.a | 7 +++++++ 4 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/constants.a b/src/constants.a index 0a7410aad..0a15e841c 100644 --- a/src/constants.a +++ b/src/constants.a @@ -6,17 +6,17 @@ ; YE OLDE GRAND UNIFIED MEMORY MAP ; ; LC RAM BANK 1 -; D000..E5F4 - persistent data structures (per-game cheat categories, +; D000..E611 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; ECA0..FFF9 - main program code +; EBE4..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 ; D000..D3FF - ProRWTS data ; D400..D5F7 - ProRWTS code ; D5F8..DB52 - HGR font code & ProRWTS glue code -; DB53..DB62 - backup of stack (during gameplay and self-running demos) +; DB53..DB6E - backup of stack (during gameplay and self-running demos) ; ...unused... ; DBB6..DBFF - (de)acceleration function ; DC00..DFFF - HGR font data diff --git a/src/prodos.impl.a b/src/prodos.impl.a index ce68b4519..7d44875aa 100644 --- a/src/prodos.impl.a +++ b/src/prodos.impl.a @@ -654,3 +654,11 @@ LaunchInternal dey bne - jmp $106 ; jump to pre-launch code + +EnableAcceleratorAndSwitchToBank1 + jsr EnableAccelerator + jmp SwitchToBank1 + +DisableAcceleratorAndSwitchToBank1 + jsr DisableAccelerator + jmp SwitchToBank1 diff --git a/src/ui.browse.mode.a b/src/ui.browse.mode.a index 564cc82af..ef215db3b 100644 --- a/src/ui.browse.mode.a +++ b/src/ui.browse.mode.a @@ -106,12 +106,16 @@ OnBrowseTab ; execution falls through here ForceBrowseChanged bit CLEARKBD - ldx gGameToLaunch ; execution falls through here OnBrowseChanged -; in: X = game index +; in: gGameToLaunch = game index + jsr SwitchToBank2 + jsr EnableAcceleratorAndSwitchToBank1 + ldx gGameToLaunch jsr LoadGameTitleOffscreen jsr DrawUIWithoutDots + jsr SwitchToBank2 + jsr DisableAcceleratorAndSwitchToBank1 jmp MaybeAnimateTitle ;------------------------------------------------------------------------------ diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index b3184ee20..bf56456a7 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -124,6 +124,9 @@ OnInputChanged rts @findMatchingTitle + jsr SwitchToBank2 + jsr EnableAcceleratorAndSwitchToBank1 + jsr ResetTextRank jsr okvs_iter_values ; iterate through all game titles @@ -136,6 +139,8 @@ OnInputChanged dec InputLength ; ignore the last key typed OnError + jsr SwitchToBank2 + jsr DisableAcceleratorAndSwitchToBank1 jmp SoftBell ; Beep on invalid input and start over. + @@ -149,6 +154,8 @@ OnError bpl @noload ; (always branches) + jsr LoadGameTitleOffscreen @noload jsr DrawUI + jsr SwitchToBank2 + jsr DisableAcceleratorAndSwitchToBank1 jsr MaybeAnimateTitle clc rts