From b0438e6eabf37c28e99a435493e35ced7bf26df6 Mon Sep 17 00:00:00 2001 From: 4am Date: Wed, 4 May 2022 12:41:40 -0400 Subject: [PATCH] some comments --- src/ui.attract.mode.a | 15 ++++++++++++++- src/ui.browse.mode.a | 5 +++-- src/ui.overlay.a | 12 ++++++++++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/src/ui.attract.mode.a b/src/ui.attract.mode.a index 0a2ec9f4f..35d37b75d 100644 --- a/src/ui.attract.mode.a +++ b/src/ui.attract.mode.a @@ -70,6 +70,13 @@ MiniAttractMode jsr GetGameToLaunch +ST16 @GameToLaunch +; We want to load the mini attract index into $800 so we can get the +; index record for this game, but we now have so many games that the +; entire index is larger than $1800 bytes and loading it all at once +; would visibly overwrite bytes in HGR page 1. So the index is now +; split into 2 halves based on the first letter of the game's +; directory name, and we figure out which half we want and load it. + +ST16 PTR ldy #1 lda (PTR), y @@ -90,6 +97,10 @@ MiniAttractMode @MiniAttractIndexRecord !word $FDFD ; SMC +; Find the index record for this game and copy it into LC RAM so we +; can reuse it without reloading the mini attract index over and over +; during attract mode. + jsr okvs_find !word - @GameToLaunch @@ -97,12 +108,14 @@ MiniAttractMode jsr okvs_next_field jsr SwitchToBank2 sty OKVS_CACHE - ldy #4 + ldy #4 ; length of index record (-1) - lda (PTR), y sta OKVS_CACHE + 1, y dey bpl - +; Now, finally, start the mini attract mode + jsr BlankHGR ; X = 0 stx @MiniAttractIndex+1 diff --git a/src/ui.browse.mode.a b/src/ui.browse.mode.a index 2e05c5378..cdf0defd6 100644 --- a/src/ui.browse.mode.a +++ b/src/ui.browse.mode.a @@ -61,6 +61,9 @@ kBrowseQuit = 11 @j jsr $FDFD ; SMC jmp @BrowseModeInputLoop +;------------------------------------------------------------------------------ +; internal functions + OnBrowseSearch sta InputBuffer lda #$01 @@ -124,8 +127,6 @@ BrowseHelpWrapper jsr Help jmp ForceBrowseChanged -;------------------------------------------------------------------------------ - BrowseDispatchTableLo !byte length-prefixed string, either a game-specific description +; or the global 'cheats enabled' message ldx #kCheatsEnabled jsr AnyGameSelected bcs + @@ -294,6 +299,13 @@ OVERLAYRTS rts MaybeRedrawUIForDHGR +; If this is a DHGR title screen, then redraw the already-drawn overlay +; for double hi-res. This allows us to use a single font and drawing +; routines for both HGR and DHGR. There is a small amount of flicker +; if we're redrawing directly on the visible screen without swapping +; pages (e.g. adding a dot without changing the selected game), but +; gDrawingOnscreen tracks this and we reduce the redrawing to an +; absolute minimum to reduce flicker. bit MachineStatus bvc OVERLAYRTS bit gGameToLaunchInfo