From 6c4b3873d0729185572f8d462588001960bee072 Mon Sep 17 00:00:00 2001 From: 4am Date: Tue, 8 Oct 2019 13:34:37 -0400 Subject: [PATCH] shave some bytes --- src/constants.a | 2 +- src/ui.common.a | 34 ---------------------------------- src/ui.search.mode.a | 35 ++++++++++++++++++++++++++++++++++- 3 files changed, 35 insertions(+), 36 deletions(-) diff --git a/src/constants.a b/src/constants.a index 460f3c40f..61e5f17aa 100644 --- a/src/constants.a +++ b/src/constants.a @@ -9,7 +9,7 @@ ; D000..E611 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; EC04..FFF9 - main program code +; EC07..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 diff --git a/src/ui.common.a b/src/ui.common.a index d6906c579..2d5af8cb7 100644 --- a/src/ui.common.a +++ b/src/ui.common.a @@ -4,7 +4,6 @@ ; miscellaneous UI functions ; ; Public functions -; - SoftBell ; - Home ; - BlankHGR ; - BlankDHGR @@ -12,39 +11,6 @@ ; - IsUpDownOrRightArrow ; -;------------------------------------------------------------------------------ -; SoftBell -; yell at the user, but, like, gently -; -; in: none -; out: C clear -; Y preserved -; A=0 -; X=0 -; all flags preserved -;------------------------------------------------------------------------------ -SoftBell - ldx #32 -- lda #2 - jsr @wait - bit SPEAKER - lda #33 - jsr @wait - bit SPEAKER - dex - bne - - clc - rts -@wait ; identical to $FCA8 ROM routine, but ROM is switched out when we need it - sec --- pha -- sbc #1 - bne - - pla - sbc #1 - bne -- - rts - ;------------------------------------------------------------------------------ ; Home ; clear and display text screen (HARDER THAN IT SOUNDS) diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a index c103c6645..f1ae01d42 100644 --- a/src/ui.search.mode.a +++ b/src/ui.search.mode.a @@ -5,6 +5,7 @@ ; ; Public functions ; - SearchMode +; - SoftBell ; ; indices into InputDispatchTable @@ -201,7 +202,39 @@ FindMatchingTitle OnError jsr SwitchToBank2 jsr DisableAcceleratorAndSwitchToBank1 - jmp SoftBell ; Beep on invalid input and start over. + ; /!\ execution falls through to SoftBell +;------------------------------------------------------------------------------ +; SoftBell +; yell at the user, but, like, gently +; +; in: none +; out: C clear +; Y preserved +; A=0 +; X=0 +; all flags preserved +;------------------------------------------------------------------------------ +SoftBell + ldx #32 +- lda #2 + jsr @wait + bit SPEAKER + lda #33 + jsr @wait + bit SPEAKER + dex + bne - + clc + rts +@wait ; identical to $FCA8 ROM routine, but ROM is switched out when we need it + sec +-- pha +- sbc #1 + bne - + pla + sbc #1 + bne -- + rts + ldx BestMatchIndex ; check if the new best match is the same