From b58641ad90b4239775b2653a3e7892e25a657f80 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Sun, 3 May 2026 17:06:30 -0500 Subject: [PATCH] extra keys display --- doorrando/hudadditions.asm | 46 ++++++++++++++++++++++++++++---------- ram.asm | 2 ++ tables.asm | 6 ++--- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 73cf87f..7eb29b5 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -1,5 +1,6 @@ !BlankTile = $207F !SlashTile = $2830 +!PlusTile = $2404 !HyphenTile = $2405 !LTile = $2D68 !DTile = $2D60 @@ -77,7 +78,7 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX STY.w HUDCurrentDungeonWorld DRHUD_DrawKeyCounter: - LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished + LDA.l DRFlags : AND.b #$04 : BEQ .to_finished LDA.l CompassMode : BIT.b #$03 : BEQ DRHUD_Finished REP #$20 BIT.w #$0002 : BNE .skip_map_check @@ -90,8 +91,17 @@ DRHUD_DrawKeyCounter: LDA.l GenericKeys : LSR : BCS .total_only LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash + + LDA.l ExtraChestKeys, X : AND.w #$00FF : BEQ .total_only + JSR ConvertToDisplay : STA.w HUDKeysExtraCount + LDA.w #!PlusTile : STA.w HUDKeysExtraPlus + .total_only - LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal + SEP #$20 + LDA.l ChestKeys, X : SEC : SBC.l ExtraChestKeys, X + REP #$20 + JSR ConvertToDisplay : STA.w HUDKeysTotal +.to_finished JMP DRHUD_Finished OWRHUD_DrawWorldIndicator: @@ -292,17 +302,29 @@ BossStatus: ; default palette 3 - white LDA.l DungeonReminderTable, X : RTS -ConvertToDisplay: - and.w #$00ff : cmp.w #$000a : !BLT + - !ADD.w #$2519 : rts - + !ADD.w #$2490 : rts +ConvertToDisplay: ; transparent background + AND.w #$00FF + CMP.w #$000A : BCC .under10 + CMP.w #$000C : BCC .under12 + .over11 + CLC : ADC.w #$2553 : RTS + .under12 + CLC : ADC.w #$2519 : RTS + .under10 + CLC : ADC.w #$2490 : RTS -ConvertToDisplay2: - and.w #$00ff : beq ++ - cmp.w #$000a : !BLT + - !ADD.w #$2517 : rts ; 2580 with 258A as "A" for non transparent digits - + !ADD.w #$2816 : rts - ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 +ConvertToDisplay2: ; solid background + AND.w #$00FF : BEQ .zero + CMP.w #$000A : BCC .under10 + CMP.w #$000C : BCC .under12 + .over11 + CLC : ADC.w #$2580 : RTS + .under12 + CLC : ADC.w #$2517 : RTS + .under10 + CLC : ADC.w #$2816 : RTS + .zero + LDA.w #$2827 : RTS CountAbsorbedKeys: JML IncrementSmallKeysNoPrimary diff --git a/ram.asm b/ram.asm index 1e8b7ae..1e89b51 100644 --- a/ram.asm +++ b/ram.asm @@ -597,6 +597,8 @@ HUDMultiIndicator = $7EC790 ; HUDKeysObtained = $7EC7A2 ; HUDKeysSlash = $7EC7A4 ; HUDKeysTotal = $7EC7A6 ; +HUDKeysExtraPlus = $7EC7E4 ; +HUDKeysExtraCount = $7EC7E6 ; ; BigRAM = $7EC900 ; Big buffer of free ram (0x1F00) ItemGFXStack = $7ECB00 ; Pointers to source of decompressed item tiles deferred to NMI loading. diff --git a/tables.asm b/tables.asm index 3cf1dd1..12de6d4 100644 --- a/tables.asm +++ b/tables.asm @@ -2686,9 +2686,9 @@ org $B0EFFF ; PC 0x186FFF BallNChainDungeon: ; Dungeon ID where ball n chain guard is located. Write db $02 ; $FF to count ball and chain item for collection stats. -;-------------------------------------------------------------------------------- -; 0x187000 - 18700F (unused) -;-------------------------------------------------------------------------------- +org $B0F000 +ExtraChestKeys: ; PC 0x187000-0x18700F +db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 org $B0F010 ChestKeys: ; PC 0x187010-0x18701F