shave some bytes

This commit is contained in:
4am 2019-10-08 13:34:37 -04:00
parent e57eaaa3fa
commit 6c4b3873d0
3 changed files with 35 additions and 36 deletions

View File

@ -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

View File

@ -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)

View File

@ -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