shave some bytes

This commit is contained in:
Peter Ferrie 2019-10-08 19:25:22 -07:00
parent 2d80f38186
commit 45bdefea5f
5 changed files with 29 additions and 33 deletions

View File

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

View File

@ -9,29 +9,22 @@
; /!\ execution falls through from ui.search.mode/FindMatchingTitle
MaybeAnimateTitle
; out: C clear
lda OffscreenPage
lda #$3F
ldy OffscreenPage
bne +
lda #$5F
+HIDE_NEXT_2_BYTES
+ lda #$3F
sta SAVE+1
eor #$60
+ sta SAVE+1
and #$60
sta @a+2
eor #$60
sta @b+2
lda #$FD
sta SAVE
ldy #0
lda (SAVE),y ; see if there is a hidden JMP to an
cmp #$4C ; animation routine for this screen
bne @exit
ldx #$20 ; copy new HGR screen to the other
ldy #$40
lda OffscreenPage
beq +
stx @a+2
sty @b+2
jmp ++
+ sty @a+2
stx @b+2
++ ldx #$20
ldy #0
ldx #$20
@a lda $FD00,y ; SMC
@b sta $FD00,y ; SMC
iny

View File

@ -18,11 +18,6 @@
; - OffscreenPage
;
OffscreenPage
!byte 0 ; 0 = currently showing HGR page 2
; (so offscreen is page 1 @ $2000)
; 1 = currently showing HGR page 1
; (so offscreen is page 2 @ $4000)
;------------------------------------------------------------------------------
; GetOffscreenAddress
@ -33,7 +28,12 @@ OffscreenPage
; preserves X/Y
;------------------------------------------------------------------------------
GetOffscreenAddress
lda OffscreenPage
OffscreenPage = * + 1
lda #$00 ; SMC
; 0 = currently showing HGR page 2
; (so offscreen is page 1 @ $2000)
; 1 = currently showing HGR page 1
; (so offscreen is page 2 @ $4000)
beq +
lda #$40
rts

View File

@ -73,13 +73,12 @@ sCheatDescriptionSuffix
; out: all flags and registers clobbered
;------------------------------------------------------------------------------
DrawUIWithoutDots
lda #" "
clc
bcc +
lda #" " * 2
+HIDE_NEXT_2_BYTES
DrawUI
lda #$7F
sec
+ sta @printCursor+1 ; set up cursor printing based on entry point
lda #$FF ; #$7F * 2
lsr
sta @printCursor+1 ; set up cursor printing based on entry point
php
ldy #39

View File

@ -74,8 +74,15 @@ InputKeyDispatch
beq .foundSearchKey
ldx #kInputError
+HIDE_NEXT_2_BYTES
.IsArrow
ldx #kInputBrowse
!if kInputSearch > 0 {
+HIDE_NEXT_2_BYTES
.foundSearchKey
ldx #kInputSearch
} else {
.foundSearchKey
}
; execution falls through here to .InputDispatch
.InputDispatch
ldy InputDispatchTableLo,x
@ -115,10 +122,7 @@ SearchMode
; that mode finds and dispatches the arrow key.
jsr IsUpDownOrRightArrow
bne @notArrow
ldx #kInputBrowse
bne .InputDispatch ; always branches
@notArrow
beq .IsArrow
bit CLEARKBD
ldy #kNumBrowseKeys