From bdd16bc20f54ca28c75be1846378155283dc3fa8 Mon Sep 17 00:00:00 2001 From: spannerisms <32842036+spannerisms@users.noreply.github.com> Date: Sat, 3 Jul 2021 09:06:17 -0400 Subject: [PATCH] dungeon prizes --- compasses.asm | 4 ++-- dungeonmap.asm | 5 ++--- newhud.asm | 50 ++++++++++++++++++++++++++++++++++++++++++++++---- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/compasses.asm b/compasses.asm index 5c1acb5..37295c2 100644 --- a/compasses.asm +++ b/compasses.asm @@ -17,7 +17,7 @@ DrawDungeonCompassCounts: LDX $040C : CPX.b #$FF : BEQ .done ; Skip if not in a dungeon CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass - LDA $7EF364 : AND.l .item_masks, X ; Load compass values to A, mask with dungeon item masks + LDA $7EF364 : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks BEQ .done ; skip if we don't have compass ++ @@ -35,7 +35,7 @@ DrawDungeonCompassCounts: .done RTL -.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc +DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100 dw $0080, $0040, $0020, $0010, $0008, $0004 diff --git a/dungeonmap.asm b/dungeonmap.asm index 6dabf89..39b4624 100644 --- a/dungeonmap.asm +++ b/dungeonmap.asm @@ -107,15 +107,14 @@ DoDungeonMapBossIcon: LDX.b #$02 STX.w $420B + STA.w $4315 LDA.w #$A260>>1 STA.w $2116 - LDA.w #$0040 - STA.w $4315 STX.w $420B ; done - SEP #$32 + SEP #$30 RTL .boss_id diff --git a/newhud.asm b/newhud.asm index f41ed75..35c562f 100644 --- a/newhud.asm +++ b/newhud.asm @@ -131,9 +131,51 @@ SEP #$30 STA !KEY_ICON_ADDRESS .done_keys - - - + + + + +;-------------------------------------------------------------------------------- +; Draw pendant/crystal icon +;-------------------------------------------------------------------------------- +!PRIZE_ICON = $7EC742 +!P_ICON = $296C +!C_ICON = $295F + + SEP #$20 + LDA.b $1B : BEQ .noprize + + + + LDX.w $040C : BMI .noprize + + REP #$20 + + LDA.l MapMode + BEQ .drawprize + + LDA.l $7EF368 + AND.l DungeonItemMasks,X + BEQ .doneprize + +.drawprize + LDA.l CrystalPendantFlags_2, X + AND.w #$0040 : BNE .is_crystal + + LDA.w #!P_ICON + BRA .doneprize + +.is_crystal + LDA.w #!C_ICON + BRA .doneprize + +.noprize + REP #$20 + LDA.w #$207F + +.doneprize + STA.l !PRIZE_ICON + ;-------------------------------------------------------------------------------- ; Draw Magic Meter !INFINITE_MAGIC = "$7F50CA" @@ -261,4 +303,4 @@ HudHexToDec2Digit: DEC : BNE - + STY $07 ; Store 1s digit -RTS \ No newline at end of file +RTS