mirror of
https://github.com/a2-4am/4cade.git
synced 2024-06-26 12:29:33 +00:00
shave some bytes
This commit is contained in:
parent
2d80f38186
commit
45bdefea5f
|
@ -9,7 +9,7 @@
|
||||||
; D000..E611 - persistent data structures (per-game cheat categories,
|
; D000..E611 - persistent data structures (per-game cheat categories,
|
||||||
; gGlobalPrefsStore, gGamesListStore)
|
; gGlobalPrefsStore, gGamesListStore)
|
||||||
; ...unused...
|
; ...unused...
|
||||||
; EC28..FFF9 - main program code
|
; EC41..FFF9 - main program code
|
||||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||||
;
|
;
|
||||||
; LC RAM BANK 2
|
; LC RAM BANK 2
|
||||||
|
|
|
@ -9,29 +9,22 @@
|
||||||
; /!\ execution falls through from ui.search.mode/FindMatchingTitle
|
; /!\ execution falls through from ui.search.mode/FindMatchingTitle
|
||||||
MaybeAnimateTitle
|
MaybeAnimateTitle
|
||||||
; out: C clear
|
; out: C clear
|
||||||
lda OffscreenPage
|
lda #$3F
|
||||||
|
ldy OffscreenPage
|
||||||
bne +
|
bne +
|
||||||
lda #$5F
|
eor #$60
|
||||||
+HIDE_NEXT_2_BYTES
|
+ sta SAVE+1
|
||||||
+ lda #$3F
|
and #$60
|
||||||
sta SAVE+1
|
sta @a+2
|
||||||
|
eor #$60
|
||||||
|
sta @b+2
|
||||||
lda #$FD
|
lda #$FD
|
||||||
sta SAVE
|
sta SAVE
|
||||||
ldy #0
|
ldy #0
|
||||||
lda (SAVE),y ; see if there is a hidden JMP to an
|
lda (SAVE),y ; see if there is a hidden JMP to an
|
||||||
cmp #$4C ; animation routine for this screen
|
cmp #$4C ; animation routine for this screen
|
||||||
bne @exit
|
bne @exit
|
||||||
ldx #$20 ; copy new HGR screen to the other
|
ldx #$20
|
||||||
ldy #$40
|
|
||||||
lda OffscreenPage
|
|
||||||
beq +
|
|
||||||
stx @a+2
|
|
||||||
sty @b+2
|
|
||||||
jmp ++
|
|
||||||
+ sty @a+2
|
|
||||||
stx @b+2
|
|
||||||
++ ldx #$20
|
|
||||||
ldy #0
|
|
||||||
@a lda $FD00,y ; SMC
|
@a lda $FD00,y ; SMC
|
||||||
@b sta $FD00,y ; SMC
|
@b sta $FD00,y ; SMC
|
||||||
iny
|
iny
|
||||||
|
|
|
@ -18,11 +18,6 @@
|
||||||
; - OffscreenPage
|
; - 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
|
; GetOffscreenAddress
|
||||||
|
@ -33,7 +28,12 @@ OffscreenPage
|
||||||
; preserves X/Y
|
; preserves X/Y
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
GetOffscreenAddress
|
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 +
|
beq +
|
||||||
lda #$40
|
lda #$40
|
||||||
rts
|
rts
|
||||||
|
|
|
@ -73,13 +73,12 @@ sCheatDescriptionSuffix
|
||||||
; out: all flags and registers clobbered
|
; out: all flags and registers clobbered
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
DrawUIWithoutDots
|
DrawUIWithoutDots
|
||||||
lda #" "
|
lda #" " * 2
|
||||||
clc
|
+HIDE_NEXT_2_BYTES
|
||||||
bcc +
|
|
||||||
DrawUI
|
DrawUI
|
||||||
lda #$7F
|
lda #$FF ; #$7F * 2
|
||||||
sec
|
lsr
|
||||||
+ sta @printCursor+1 ; set up cursor printing based on entry point
|
sta @printCursor+1 ; set up cursor printing based on entry point
|
||||||
php
|
php
|
||||||
|
|
||||||
ldy #39
|
ldy #39
|
||||||
|
|
|
@ -74,8 +74,15 @@ InputKeyDispatch
|
||||||
beq .foundSearchKey
|
beq .foundSearchKey
|
||||||
ldx #kInputError
|
ldx #kInputError
|
||||||
+HIDE_NEXT_2_BYTES
|
+HIDE_NEXT_2_BYTES
|
||||||
|
.IsArrow
|
||||||
|
ldx #kInputBrowse
|
||||||
|
!if kInputSearch > 0 {
|
||||||
|
+HIDE_NEXT_2_BYTES
|
||||||
.foundSearchKey
|
.foundSearchKey
|
||||||
ldx #kInputSearch
|
ldx #kInputSearch
|
||||||
|
} else {
|
||||||
|
.foundSearchKey
|
||||||
|
}
|
||||||
; execution falls through here to .InputDispatch
|
; execution falls through here to .InputDispatch
|
||||||
.InputDispatch
|
.InputDispatch
|
||||||
ldy InputDispatchTableLo,x
|
ldy InputDispatchTableLo,x
|
||||||
|
@ -115,10 +122,7 @@ SearchMode
|
||||||
; that mode finds and dispatches the arrow key.
|
; that mode finds and dispatches the arrow key.
|
||||||
|
|
||||||
jsr IsUpDownOrRightArrow
|
jsr IsUpDownOrRightArrow
|
||||||
bne @notArrow
|
beq .IsArrow
|
||||||
ldx #kInputBrowse
|
|
||||||
bne .InputDispatch ; always branches
|
|
||||||
@notArrow
|
|
||||||
bit CLEARKBD
|
bit CLEARKBD
|
||||||
|
|
||||||
ldy #kNumBrowseKeys
|
ldy #kNumBrowseKeys
|
||||||
|
|
Loading…
Reference in New Issue
Block a user