mirror of
https://github.com/a2-4am/4cade.git
synced 2024-11-27 08:50:01 +00:00
cut some bytes
This commit is contained in:
parent
eefe04bc4b
commit
9ec08f8430
@ -79,7 +79,9 @@ RestoreStackNextTime
|
||||
STACKPTR
|
||||
ldx #$D1 ; SMC, restore stack pointer
|
||||
txs
|
||||
jmp SwitchToBank1 ; switch to bank 1 and return to caller
|
||||
SwitchToBank1
|
||||
+READ_RAM1_WRITE_RAM1
|
||||
rts
|
||||
ResetVector ; 6 bytes, copied to $100
|
||||
+READ_RAM1_NO_WRITE
|
||||
jmp Reenter
|
||||
|
@ -6,10 +6,10 @@
|
||||
; YE OLDE GRAND UNIFIED MEMORY MAP
|
||||
;
|
||||
; LC RAM BANK 1
|
||||
; D000..E891 - persistent data structures (per-game cheat categories,
|
||||
; D000..E8A7 - persistent data structures (per-game cheat categories,
|
||||
; gGlobalPrefsStore, gGamesListStore)
|
||||
; ...unused...
|
||||
; EA6F..FFF9 - main program code
|
||||
; EA96..FFF9 - main program code
|
||||
; FFFA..FFFF - NMI, reset, IRQ vectors
|
||||
;
|
||||
; LC RAM BANK 2
|
||||
|
@ -1,5 +1,5 @@
|
||||
;license:MIT
|
||||
;(c) 2018-9 by 4am
|
||||
;(c) 2018-2020 by 4am
|
||||
;
|
||||
; GAMES.CONF parser
|
||||
;
|
||||
@ -88,8 +88,7 @@ ParseGamesList
|
||||
pla ; pop cheat category
|
||||
sta gVal,x ; store after game title
|
||||
pla ; pop DHGR title
|
||||
clc
|
||||
ror
|
||||
lsr
|
||||
ror
|
||||
ora gVal,x
|
||||
sta gVal,x ; store in bit 7 of same byte as cheat category
|
||||
|
@ -4,36 +4,12 @@
|
||||
; miscellaneous UI functions
|
||||
;
|
||||
; Public functions
|
||||
; - ClearScreens
|
||||
; - Home
|
||||
; - BlankDHGR
|
||||
; - IsSearchKey
|
||||
; - IsUpDownOrRightArrow
|
||||
;
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ClearScreens
|
||||
; clear and display text screen and then clear both hires screens
|
||||
; (in this order so that the erasing isn't visible)
|
||||
;
|
||||
; in: none
|
||||
; out: $0106..$011F clobbered
|
||||
;------------------------------------------------------------------------------
|
||||
ClearScreens
|
||||
jsr Home
|
||||
lda #$20 ; clear both hi-res pages
|
||||
sta @clear+2 ; (in case game loader shows them, we don't want
|
||||
ldx #$40 ; to flash previous bits of the launcher UI)
|
||||
ldy #$00
|
||||
tya
|
||||
@clear sta $FD00,y ; SMC
|
||||
iny
|
||||
bne @clear
|
||||
inc @clear+2
|
||||
dex
|
||||
bne @clear
|
||||
rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; Home
|
||||
; clear and display text screen (HARDER THAN IT SOUNDS)
|
||||
@ -58,24 +34,17 @@ Home
|
||||
sta CLOCKCTL ; set twice for VidHD
|
||||
@noSHR
|
||||
sta gMachineInDHGRMode ; A=0 here
|
||||
ldy #$2C ; BIT
|
||||
sty PageFrom
|
||||
ldx #$04
|
||||
stx PageTo+2
|
||||
lda #$A0 ; clear text screen page 1
|
||||
ldx #$77 ; but preserve screen holes
|
||||
- sta $400,x
|
||||
sta $480,x
|
||||
sta $500,x
|
||||
sta $580,x
|
||||
sta $600,x
|
||||
sta $680,x
|
||||
sta $700,x
|
||||
sta $780,x
|
||||
dex
|
||||
bpl -
|
||||
jsr ClearGR
|
||||
|
||||
sta DHIRESOFF ; get out of DHGR mode
|
||||
sta CLR80VID ; /!\ order of operations matters for RGB card
|
||||
lda PAGE1
|
||||
lda TEXTMODE
|
||||
SwitchToBank1 ; unnecessary but harmless (and has to be somewhere)
|
||||
+READ_RAM1_WRITE_RAM1
|
||||
rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
|
@ -11,6 +11,7 @@
|
||||
; - ResyncPage
|
||||
; - ShowOtherPage
|
||||
; - ToggleOffscreenPage
|
||||
; - ClearScreens
|
||||
; - ClearOffscreen
|
||||
; - ClearHGR1
|
||||
; - ClearMem
|
||||
@ -115,6 +116,20 @@ LoadGameTitleOffscreen
|
||||
+ !word $FDFD
|
||||
rts
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ClearScreens
|
||||
; clear and display text screen and then clear both hires screens
|
||||
; (in this order so that the erasing isn't visible)
|
||||
;
|
||||
; in: none
|
||||
; out: $400..$7FF and $2000..$5FFF cleared
|
||||
;------------------------------------------------------------------------------
|
||||
ClearScreens
|
||||
jsr Home
|
||||
lda #$20 ; clear both hi-res pages
|
||||
ldx #$40 ; to flash previous bits of the launcher UI)
|
||||
bne ClearMem ; always
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; ClearOffscreen
|
||||
; clear $2000..$3FFF or $4000..$5FFF, depending on which HGR page is not
|
||||
|
@ -214,24 +214,15 @@ OnError
|
||||
SoftBell
|
||||
ldx #32
|
||||
- lda #2
|
||||
jsr @wait
|
||||
jsr WaitForKeyWithTimeout
|
||||
bit SPEAKER
|
||||
lda #33
|
||||
jsr @wait
|
||||
jsr WaitForKeyWithTimeout
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user