minimize flicker when redrawing overlays onscreen

This commit is contained in:
4am 2020-03-15 12:13:50 -04:00
parent d0cc8ecee1
commit b8966ce199
2 changed files with 17 additions and 5 deletions

View File

@ -191,6 +191,9 @@ DrawUI
jsr Draw40Chars ; draw UI line 1 on offscreen page
jsr MaybeRedrawUIForDHGR ; transform for DHGR if this is a DHGR title screen
plp
gDrawingOnscreen=*+1
lda #$00 ; SMC, might be 1
bne @uidone
+LDADDR UILine2
jsr Draw40Chars ; draw UI line 2 on offscreen page
jsr MaybeRedrawUIForDHGR ; transform for DHGR if this is a DHGR title screen
@ -230,7 +233,9 @@ DrawUI
+LDADDR gPathname
jsr DrawCenteredString ; draw cheat UI line 2
jsr MaybeRedrawUIForDHGR ; transform for DHGR if this is a DHGR title screen
@uidone clc
@uidone lda #0
sta gDrawingOnscreen
clc
jmp ShowOtherPage
CheckCheats

View File

@ -227,12 +227,19 @@ SoftBell
+
ldx BestMatchIndex ; check if the new best match is the same
cpx gGameToLaunch ; as the current best match
bne +
bne @load
jsr ToggleOffscreenPage ; Since we're not loading a new screenshot
; we fake switching the 'offscreen' page
; in order to draw on the visible page.
bpl @noload ; (always branches)
+ stx gGameToLaunch
lda #1
bne @noload ; always branches
@load
stx gGameToLaunch
jsr LoadGameTitleOffscreen
@noload jsr DrawUI
lda #0
@noload
sta gDrawingOnscreen ; will minimize flicker in case we're
jsr DrawUI ; drawing directly onscreen
; /!\ execution falls through to ui.animation/MaybeAnimateTitle