From d3af10649c2bcc35e5b5271f990dbfae554f3276 Mon Sep 17 00:00:00 2001 From: CaitSith2 Date: Wed, 10 Feb 2021 09:25:11 -0800 Subject: [PATCH] Dungeon completion flags, that indicate for which dungeons the prize was collected from. --- inventory.asm | 29 +++++++++++++++++++++++++++++ stats.asm | 3 +++ 2 files changed, 32 insertions(+) diff --git a/inventory.asm b/inventory.asm index 784bb6e..73802f6 100644 --- a/inventory.asm +++ b/inventory.asm @@ -415,6 +415,7 @@ AddInventory: BRL .done + CPY.b #$20 : BNE + ; Crystal JSR .incrementCrystal + JSR .setDungeonCompletion BRL .done + CPY.b #$21 : BNE + ; Bug Net JSR .incrementY @@ -457,6 +458,7 @@ AddInventory: + CPY.b #$37 : !BLT + ; Items $37 - $39 - Pendants CPY.b #$3A : !BGE + JSR .incrementPendant + JSR .setDungeonCompletion BRL .done + CPY.b #$3A : !BLT + ; Items $3A - $3B - Bow & Silver Arrows CPY.b #$3C : !BGE + @@ -715,6 +717,33 @@ RTL %BottomHalf($7EF426) + RTS + +.setDungeonCompletion + LDA $040C + CMP #$FF : BEQ + + LSR : AND #$0F : CMP #$08 : !BGE ++ + JSR .valueShift + ORA $7EF46B : STA $7EF46B + BRA + + ++ + !SUB #$08 + JSR .valueShift + BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both + ORA $7EF46C : STA $7EF46C + + +RTS + +.valueShift + PHX + TAX : LDA.b #$01 + - + CPX #$00 : BEQ + + ASL + DEX + BRA - + + + PLX +RTS ;-------------------------------------------------------------------------------- ;-------------------------------------------------------------------------------- diff --git a/stats.asm b/stats.asm index c2150c1..0f266a6 100644 --- a/stats.asm +++ b/stats.asm @@ -114,6 +114,8 @@ ; m - mail counter ; k - small keys ;-------------------------------------------------------------------------------- +; $7EF46Bw[2] - Dungeon prizes collected by dungeon location. +;-------------------------------------------------------------------------------- ; $7EF4C0 - 7EF4CF - locations checked, indexed by 040C >> 1 ;-------------------------------------------------------------------------------- @@ -387,6 +389,7 @@ IndoorSubtileTransitionCounter: STZ $0642 JMP StatTransitionCounter ;-------------------------------------------------------------------------------- +!DUNGEON_PRIZE_COLLECTED = "$7EF46B" !CHEST_COUNTER = "$7EF442" !MAIL_COUNTER = "$7EF46A" ; mmkkkkkk !BOSS_KILLS = "$7F5037"