shave some bytes

This commit is contained in:
4am 2019-10-08 13:39:06 -04:00
parent 6c4b3873d0
commit e1ce947144
4 changed files with 36 additions and 32 deletions

View File

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

View File

@ -393,7 +393,8 @@ okvs_update
; X = numeric index of record
; A/Y = address of key or value (depends on which entry point you call)
; all registers are clobbered
; all flags clobbered
; Z=1
; all other flags clobbered
; PARAM clobbered
; PTR clobbered
;------------------------------------------------------------------------------

View File

@ -7,6 +7,8 @@
; - DHGRTitleSlideshow
; - DHGRActionSlideshow
; - DHGRSingle
; - BlankHGR
; - HGRMode
;
DHGRTitleSlideshow
@ -18,7 +20,8 @@ DHGRTitleSlideshow
jsr okvs_iter ; cycle through all listed DHGR files
!word gSlideshowStore
!word DHGRTitleCallback ; address of callback (called on each file)
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
beq BlankHGR ; switch back to HGR mode with initial blank screen on exit
; (always branches)
DHGRActionSlideshow
bit MachineStatus ; only run DHGR slideshow if we have 128K
@ -28,7 +31,8 @@ DHGRActionSlideshow
jsr okvs_iter ; cycle through all listed DHGR files
!word gSlideshowStore
!word DHGRActionCallback ; address of callback (called on each file)
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
beq BlankHGR ; switch back to HGR mode with initial blank screen on exit
; (always branches)
DHGRSingle
bit MachineStatus ; only show DHGR screenshots if we have 128K
@ -41,7 +45,33 @@ DHGRSingle
jsr LoadDHGRTransition ; load transition effect code at $6000
+LDADDR $6000
jsr ExecuteTransitionAndWait
jmp BlankHGR ; switch back to HGR mode with initial blank screen on exit
; switch back to HGR mode with initial blank screen on exit
; /!\ execution falls through here to BlankHGR
;------------------------------------------------------------------------------
; BlankHGR
; clear and show HGR page 1 without flickering
;
; in: none
; out: text page clobbered (but screen holes preserved)
; $2000..$3FFF cleared
;------------------------------------------------------------------------------
BlankHGR
jsr Home
jsr ClearHGR1 ; clear hi-res screen 1
bit PAGE1 ; show hi-res screen 1 (now blank)
; /!\ execution falls through here to HGRMode
;------------------------------------------------------------------------------
; HGRMode
; twiddles softswitches to set HGR mode (does not set page 1 or 2)
;
; in: none
; out: all registers preserved
;------------------------------------------------------------------------------
HGRMode
bit $C057
bit $C052
bit $C050
rts
;------------------------------------------------------------------------------
; LoadDHGRTransition [private]

View File

@ -5,7 +5,6 @@
;
; Public functions
; - Home
; - BlankHGR
; - BlankDHGR
; - IsSearchKey
; - IsUpDownOrRightArrow
@ -67,32 +66,6 @@ BlankDHGR
bit PAGE1
jmp HGRMode
;------------------------------------------------------------------------------
; BlankHGR
; clear and show HGR page 1 without flickering
;
; in: none
; out: text page clobbered (but screen holes preserved)
; $2000..$3FFF cleared
;------------------------------------------------------------------------------
BlankHGR
jsr Home
jsr ClearHGR1 ; clear hi-res screen 1
bit PAGE1 ; show hi-res screen 1 (now blank)
; /!\execution falls through here to HGRMode
;------------------------------------------------------------------------------
; HGRMode
; twiddles softswitches to set HGR mode (does not set page 1 or 2)
;
; in: none
; out: all registers preserved
;------------------------------------------------------------------------------
HGRMode
bit $C057
bit $C052
bit $C050
rts
;------------------------------------------------------------------------------
; IsSearchKey
; test whether accumulator contains a key that might trigger a new textrank