From bf940d29d72133752be3dfb513a4ca642baa04ee Mon Sep 17 00:00:00 2001 From: 4am Date: Sat, 21 Sep 2019 18:46:45 -0400 Subject: [PATCH] further refactoring in HGRActionCallback --- src/constants.a | 2 +- src/ui.attract.hgr.a | 72 +++++++++++++++++++++----------------------- 2 files changed, 35 insertions(+), 39 deletions(-) diff --git a/src/constants.a b/src/constants.a index d7a34e20f..05bce6b4e 100644 --- a/src/constants.a +++ b/src/constants.a @@ -9,7 +9,7 @@ ; D000..E5F4 - persistent data structures (per-game cheat categories, ; gGlobalPrefsStore, gGamesListStore) ; ...unused... -; EC15..FFF9 - main program code +; EC22..FFF9 - main program code ; FFFA..FFFF - NMI, reset, IRQ vectors ; ; LC RAM BANK 2 diff --git a/src/ui.attract.hgr.a b/src/ui.attract.hgr.a index bdddb6713..d04dd77e6 100644 --- a/src/ui.attract.hgr.a +++ b/src/ui.attract.hgr.a @@ -106,48 +106,44 @@ HGRSingle !word $4000 ; display game name in the bottom-left corner - ldx #39 - lda #0 -- sta UILine1,x - dex - bpl - - sta HTAB - ldx #22 - stx VTAB - tay - lda (SAVE),y - tax - +LDADDR UILine1 - sec - jsr DrawBuffer - ldx #3 - +LDADDR @toprightcorner - sec - jsr DrawBuffer + lda #22 + sta VTAB + lda #0 ; solid horizontal bar character + jsr @resetline + lda (SAVE),y ; (SAVE) -> game title, Y = 0, so A = title length + clc + adc #$03 + sta gPathname + lda #7 ; top-right rounded corner character + jsr @drawline + inc VTAB - ldx #0 - stx HTAB - inx - +LDADDR @rightline - sec - jsr DrawBuffer - +LDAY SAVE - jsr SetPath - +LDADDR gPathname - sec - jsr DrawString - ldx #2 - +LDADDR @rightline - sec - jsr DrawBuffer + lda #" " + jsr @resetline + lda (SAVE),y ; A = title length + tay +- lda (SAVE),y + sta gPathname+1,y + dey + bne - + lda #3 ; solid vertical bar character + jsr @drawline +LDADDR $6000 jmp ExecuteTransitionAndWait -@toprightcorner - !byte 0,0,7 -@rightline - !text " " - !byte 3 +@resetline + ldy #40 +- sta gPathname,y + dey + bne - + sty HTAB + rts +@drawline + ldy gPathname + sta gPathname,y + +LDADDR gPathname + sec + jmp DrawString ;------------------------------------------------------------------------------ ; .LoadHGRTransition [private]