From 6da1227578d8ee9b31a5bebdf338b1d05d98bbab Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Thu, 15 Jul 2021 16:45:37 -0700 Subject: [PATCH] Color bombs in the HUD according to bomb level in bomb-only mode --- hooks.asm | 4 ++++ newhud.asm | 9 +++++++++ special_bombs.asm | 17 +++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/hooks.asm b/hooks.asm index 16c20fa..939de7d 100755 --- a/hooks.asm +++ b/hooks.asm @@ -2826,6 +2826,10 @@ org $0DEE05 ; equipment.asm@2065 (LDA $7EF359 : AND.w #$00FF : CMP.w #$00FF : .. JSL DrawSwordInMenu BRA + : NOP #16 : + ;-------------------------------------------------------------------------------- +org $0DFA92 ; headsup_display.asm@622 (PDB : LDA.w #$0149 : ...) +JSL DrawBombOnHud +BRA + : NOP #8 : + +;-------------------------------------------------------------------------------- org $0DFC51 ; is this being used? I hope not! let's find out if anything breaks! db $F5, $20, $F5, $20, $F5, $20, $F5, $20 db $B2, $3C, $B3, $3C, $C2, $3C, $17, $3C diff --git a/newhud.asm b/newhud.asm index a8d0e3c..23e3cc7 100644 --- a/newhud.asm +++ b/newhud.asm @@ -8,6 +8,9 @@ SEP #$30 LDA !INFINITE_BOMBS : BNE .infinite_bombs .finite_bombs + LDA.l SpecialBombs : BEQ .normal + LDA.l !BOMB_LEVEL : BEQ .no_bombs + .normal LDA.l $7EF343 ; bombs JSR HudHexToDec2Digit ;requires 8 bit registers! REP #$20 @@ -15,6 +18,12 @@ SEP #$30 LDX.b $07 : TXA : ORA.w #$2400 : STA !BOMBCOUNT_DRAW_ADDRESS+2 ; Draw bombs 1 digit BRA + + .no_bombs + REP #$20 + LDA.w #$207F : STA !BOMBCOUNT_DRAW_ADDRESS + STA !BOMBCOUNT_DRAW_ADDRESS+2 + BRA + + .infinite_bombs REP #$20 LDA.w #$2431 : STA !BOMBCOUNT_DRAW_ADDRESS ; infinity (left half) diff --git a/special_bombs.asm b/special_bombs.asm index 556b817..0456983 100644 --- a/special_bombs.asm +++ b/special_bombs.asm @@ -265,3 +265,20 @@ DrawSwordInMenu: LDA.w #$FC51 : STA $04 RTL ;-------------------------------------------------------------------------------- +BombIcon: + dw $207F, $207F, $3C88, $3C89, $2C88, $2C89, $2488, $2489, $2888, $2889,$2888, $2889 +DrawBombOnHud: + PHB + LDA.w #$0149 + LDX.w #$86B0 + LDY.w #$C700 + MVN $7E, $21 + PLB + + LDA.l SpecialBombs : AND.w #$00FF : BEQ .regularBombs + LDA.l !BOMB_LEVEL : AND.w #$00FF : ASL #2 : TAX + LDA.l BombIcon, X : STA.l $7EC71A + LDA.l BombIcon+2, X : STA.l $7EC71C +.regularBombs + RTL +;--------------------------------------------------------------------------------