diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 7bb9c89..ef53fa6 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -253,6 +253,7 @@ ConvertToDisplay2: CountAbsorbedKeys: PHA : PHX LDA.l StandingItemsOn : BEQ .count_it + LDA.w SpawnedItemKeyCounted : BNE .done CPY.b #$24 : BEQ .count_it ; small key for this dungeon LDA.w DungeonID : LSR : TAX TYA : CMP.l KeyTable, X : BNE .done @@ -262,6 +263,7 @@ CountAbsorbedKeys: REP #$10 : JSL CountAllKey : SEP #$10 LDY.b Scrap02 .done + STZ.w SpawnedItemKeyCounted ; reset to zero for next time PLX : PLA JML IncrementSmallKeysNoPrimary diff --git a/inventory.asm b/inventory.asm index 61856af..7438cbb 100644 --- a/inventory.asm +++ b/inventory.asm @@ -220,7 +220,6 @@ DungeonIncrement: REP #$10 PHX LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + - CPY.w #$0024 : BEQ + ; keys for this dungeon are done elsewhere JSL CountAllKey + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 406e4c5..ff29efe 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -688,6 +688,7 @@ KeyGet: LDA.b Scrap00 : CMP.l KeyTable, X : BNE + .countIt LDA.l StandingItemCounterMask : AND SpawnedItemFlag : BEQ ++ + STA.w SpawnedItemKeyCounted JSL AddInventory ++ PLX : PLA : RTL + CMP.b #$AF : beq .countIt ; universal key diff --git a/ram.asm b/ram.asm index 693fe5b..c3ca8dd 100644 --- a/ram.asm +++ b/ram.asm @@ -313,6 +313,7 @@ SpawnedItemFlag = $7E0726 ; 0x02 - one for pot, 2 for sprite drop SpawnedItemMWPlayer = $7E0728 ; Player Id for spawned item if Multiworld item 0x02 ; EnemyDropIndicator = $7E072A ; Used by HUD to indicate enemy drops remaining +SpawnedItemKeyCounted = $7E072C ; If set, the spawned item has been counted towards dungeon key total SprDropsItem = $7E0730 ; Array for whether a sprite drops an item 0x16 SprItemReceipt = $7E0740 ; Array for item id for each sprite 0x16 @@ -874,6 +875,7 @@ endmacro %assertRAM(SpawnedItemFlag, $7E0726) %assertRAM(SpawnedItemMWPlayer, $7E0728) %assertRAM(EnemyDropIndicator, $7E072A) +%assertRAM(SpawnedItemKeyCounted, $7E072C) %assertRAM(SprDropsItem, $7E0730) %assertRAM(SprItemReceipt, $7E0740) %assertRAM(SprItemIndex, $7E0750)