Skip to content

Commit

Permalink
shave some bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
a2-4am committed Oct 8, 2019
1 parent 6c4b387 commit e1ce947
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/constants.a
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/okvs.a
Original file line number Diff line number Diff line change
Expand Up @@ -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
;------------------------------------------------------------------------------
Expand Down
36 changes: 33 additions & 3 deletions src/ui.attract.dhgr.a
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
; - DHGRTitleSlideshow
; - DHGRActionSlideshow
; - DHGRSingle
; - BlankHGR
; - HGRMode
;

DHGRTitleSlideshow
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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]
Expand Down
27 changes: 0 additions & 27 deletions src/ui.common.a
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
;
; Public functions
; - Home
; - BlankHGR
; - BlankDHGR
; - IsSearchKey
; - IsUpDownOrRightArrow
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit e1ce947

Please sign in to comment.