From b27d7c996b7dfeca397a17ec787168afd9465e68 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 14 Nov 2025 09:06:07 -0700 Subject: [PATCH 1/9] feat: enemy "spies" during enemy drop --- enemizer/hooks.asm | 11 +++++++++- enemizer/underworld_sprites.asm | 38 ++++++++++++++++++++++++++++++++- vanillalabels.asm | 11 ++++++++++ 3 files changed, 58 insertions(+), 2 deletions(-) diff --git a/enemizer/hooks.asm b/enemizer/hooks.asm index 189b01e..6899310 100644 --- a/enemizer/hooks.asm +++ b/enemizer/hooks.asm @@ -14,4 +14,13 @@ incsrc hooks/damage_hooks.asm incsrc hooks/overworld_sprite_hooks.asm -incsrc hooks/underworld_sprite_hooks.asm \ No newline at end of file +incsrc hooks/underworld_sprite_hooks.asm + +org $85B8BA +JSL GeldmanDrawOverride + +org $9EAAAC +JSL StalfosKnightDrawOverride + +org $9EB209 +JSL BlobDrawOverride \ No newline at end of file diff --git a/enemizer/underworld_sprites.asm b/enemizer/underworld_sprites.asm index 237137a..7d900b4 100644 --- a/enemizer/underworld_sprites.asm +++ b/enemizer/underworld_sprites.asm @@ -8,4 +8,40 @@ GetSpriteSlot16Bit: LDA.b Scrap03 : AND.w #$00FF ASL A TAY -RTL \ No newline at end of file +RTL + +GeldmanDrawOverride: + PLA : PLA : PLA ; fix the call stack + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + LDA.b #$01 + STA.w $0DC0,X + JML Sprite_4C_Geldman_do_indeed_draw + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML Sprite_4C_Geldman_continue + +StalfosKnightDrawOverride: + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + JSL Sprite_PrepOAMCoordLong + LDA.b #$12 + JML Sprite_DrawShadowLong + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML Sprite_91_StalfosKnight_continue + +BlobDrawOverride: + PLA : PLA : PLA ; fix the call stack + LDA.l DRFlags+1 : AND.b #$08 : BEQ .vanilla + + LDA.b #$05 + STA.w $0DC0,X + + JML SpriteDraw_Blob_head_popping_out + +.vanilla + JSL Sprite_PrepOAMCoordLong + JML SpriteDraw_Blob_bad_gfx \ No newline at end of file diff --git a/vanillalabels.asm b/vanillalabels.asm index b2ee2a2..e88190d 100644 --- a/vanillalabels.asm +++ b/vanillalabels.asm @@ -76,6 +76,7 @@ Sprite_TransmuteToBomb = $86AD58 Sprite_PrepAndDrawSingleLargeLong = $86DBF8 Sprite_PrepAndDrawSingleSmallLong = $86DC00 Sprite_DrawShadowLong = $86DC5C +Sprite_DrawShadowCustomLong = $86DC64 DashKey_Draw = $86DD40 Sprite_PrepOAMCoordLong = $86E41C Sprite_ApplySpeedTowardsPlayerLong = $86EA18 @@ -232,6 +233,16 @@ CrystalMaiden_KickOutOfDungeon = $9ECF35 GoldBee_Dormant_exit = $9EDE89 GoldBee_SpawnSelf = $9EDE8A +;=================================================================================================== +; Spliced routines (use JML directly since the hook left these methods) +;=================================================================================================== + +Sprite_4C_Geldman_do_indeed_draw = $85B8C0 +Sprite_4C_Geldman_continue = $85B8C3 +Sprite_91_StalfosKnight_continue = $9EAAB5 +SpriteDraw_Blob_bad_gfx = $9EB20D +SpriteDraw_Blob_head_popping_out = $9EB24E + ;=================================================================================================== ; Palettes ;=================================================================================================== From 7f7ffeb5fb57e94e4f3652e840411d9a11e66de5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Fri, 14 Nov 2025 14:37:15 -0700 Subject: [PATCH 2/9] feat: lamp cone bitmask settings --- lampmantlecone.asm | 3 ++- tables.asm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lampmantlecone.asm b/lampmantlecone.asm index b0f00e8..4843547 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -5,9 +5,10 @@ ;-------------------------------------------------------------------------------- LampCheck: LDA.l LightConeModifier : BNE .lamp + LDA.l LampCone : AND.b #$10 : BEQ .lamp ; always on LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? - LDA.l LampConeSewers : RTL + LDA.l LampCone : RTL + : TDC .lamp RTL diff --git a/tables.asm b/tables.asm index 4e6b825..ba58718 100644 --- a/tables.asm +++ b/tables.asm @@ -110,8 +110,8 @@ RupoorDeduction: dw $000A ; #$0A - Default (10 decimal) ;-------------------------------------------------------------------------------- org $B08038 ; PC 0x180038 -LampConeSewers: -db $01 ; #$00 = Off - #$01 = On (default) +LampCone: +db $01 ; #$00 = Off - #$01 = Sewers only (default) - #$11 = Always On ;-------------------------------------------------------------------------------- org $B08039 ; PC 0x180039 ItemCounterHUD: From 08ecc9b6734d41bb9df33aa6241c124bb0daedd7 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 18 Nov 2025 10:43:16 -0700 Subject: [PATCH 3/9] feat: pot lose coloring upon collection fix: normal lamp cone --- keydrop/standing_items.asm | 57 +++++++++++++++++++++++++++++++++++--- lampmantlecone.asm | 2 +- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 0ffcfda..406e4c5 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -831,12 +831,61 @@ RTL CheckIfPotIsSpecial: TXA ; give index to A so we can do a CMP.l CMP.l $018550 ; see if our current index is that of object 230 - BEQ .specialpot + BNE .normal_pot - ; Normal pot, so run the vanilla code +.special_pot + PHX + + ; get pot index and cache room ID offset + LDA.b RoomIndex : ASL : STA.b Scrap0E + TAX + + LDA.b $08 + BIT.b $BF : BVC .upper ; if $BF has bit 14 set, it's upper layer + ORA.w #$2000 ; set the lower layer bit ($2000) +.upper + STA.b $90 ; cache tilemap offset + + LDA.l UWPotsPointers,X : TAX + LDY.w #$0000 + +.next_pot + LDA.l UWPotsPointers&$FF0000, X ; read only the bank + CMP.w #$FFFF + BEQ .nothing + AND.w #$3FFF ; mask out the first three bits (used for item indicators and layer) + + CMP.b $90 ; check against the tilemap offset + BEQ .get_flag + + INX #3 + INY #2 + BRA .next_pot + +.get_flag + TYX + + LDA.l BitFieldMasks,X + LDX.b Scrap0E ; get room ID + STA.b Scrap0E + LDA.l RoomPotData,X + + BRA .check_pot + +.nothing + INC ; from FFFF, A is now 0000 so the AND always fails + +.check_pot + LDY.b $08 : PLX + AND.b Scrap0E + BEQ .exit ; zero flag will be set, which is what we want + LDX.w #$0E82 ; the normal pot obj. See RoomDrawObjectData_#obj0E82 + +.normal_pot + ; Normal pot, so run the vanilla code LDA.l CurrentWorld ; check for dark world - .specialpot ; zero flag already set, so gtg -RTL +.exit + RTL SetTheSceneFix: STZ.b $6C diff --git a/lampmantlecone.asm b/lampmantlecone.asm index 4843547..08175f0 100644 --- a/lampmantlecone.asm +++ b/lampmantlecone.asm @@ -5,7 +5,7 @@ ;-------------------------------------------------------------------------------- LampCheck: LDA.l LightConeModifier : BNE .lamp - LDA.l LampCone : AND.b #$10 : BEQ .lamp ; always on + LDA.l LampCone : AND.b #$10 : BNE .lamp ; always on LDA.l LampEquipment : BNE .lamp ; skip if we already have lantern LDA.w DungeonID : CMP.b #$04 : BCS + ; are we en HC? LDA.l LampCone : RTL From fee689e583ebed9d8232d29fb7dd89fa4fa937cb Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 18 Nov 2025 15:19:28 -0700 Subject: [PATCH 4/9] feat: hud shows all keys, instead of chest keys. Dropped Map requirement for key info. --- doorrando/hudadditions.asm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index d5e8778..6cbd50a 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -69,15 +69,14 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX STY.w HUDCurrentDungeonWorld DRHUD_DrawKeyCounter: - LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished - REP #$20 - LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished + LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished + REP #$20 TXA : LSR : TAX LDA.l GenericKeys : AND.w #$00FF : BNE .total_only - LDA.w DungeonCollectedKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained + LDA.w DungeonKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only - LDA.l ChestKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal + LDA.l TotalKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal DRHUD_Finished: PLB : RTL @@ -141,14 +140,13 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - lda.l MapField : and.l DungeonMask, x : beq + ; must have map - plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 - lda.l GenericKeys : bne +++ - lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 - +++ lda.b Scrap02 - rep #$30 - jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals - bra .skipStack + plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 + lda.l GenericKeys : bne +++ + lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 + +++ lda.b Scrap02 + rep #$30 + jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals + bra .skipStack + plx .skipStack iny #2 cpx.w #$000d : beq + From 70a23191bac587c2bc94a9b4d2f4968b85a218f8 Mon Sep 17 00:00:00 2001 From: aerinon Date: Wed, 19 Nov 2025 16:29:40 -0700 Subject: [PATCH 5/9] fix: bunch of fixes for key counting system --- doorrando/hudadditions.asm | 15 +++++++-- enemizer/underworld_sprites.asm | 2 +- inventory.asm | 3 +- sram.asm | 17 +++++++++- stats.asm | 60 ++++++++++++++++++--------------- 5 files changed, 63 insertions(+), 34 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 6cbd50a..2a1fc96 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -71,9 +71,12 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished REP #$20 - TXA : LSR : TAX + TXA : LSR : BNE .dungeon_id + INC +.dungeon_id + TAX LDA.l GenericKeys : AND.w #$00FF : BNE .total_only - LDA.w DungeonKeys, X : JSR ConvertToDisplay : STA.w HUDKeysObtained + LDA.w DungeonAllCollectedKeys-1, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only LDA.l TotalKeys, x : JSR ConvertToDisplay : STA.w HUDKeysTotal @@ -240,7 +243,13 @@ ConvertToDisplay2: ++ lda.w #$2827 : rts ; 0/O for 0 or placeholder digit ;2483 CountAbsorbedKeys: - JML IncrementSmallKeysNoPrimary + CPY.b #$24 : BNE .done + PHA : PHX + LDA.b #$84 : TAX ; pretend this isn't a smallkey, but an absorbed object (small heart) + REP #$10 : JSL CountAllKey : SEP #$10 + PLX : PLA +.done + JML IncrementSmallKeysNoPrimary ;================================================================================ ; 8-bit registers diff --git a/enemizer/underworld_sprites.asm b/enemizer/underworld_sprites.asm index 7d900b4..f931db7 100644 --- a/enemizer/underworld_sprites.asm +++ b/enemizer/underworld_sprites.asm @@ -31,7 +31,7 @@ StalfosKnightDrawOverride: .vanilla JSL Sprite_PrepOAMCoordLong - JML Sprite_91_StalfosKnight_continue + RTL BlobDrawOverride: PLA : PLA : PLA ; fix the call stack diff --git a/inventory.asm b/inventory.asm index e86eebb..61856af 100644 --- a/inventory.asm +++ b/inventory.asm @@ -220,7 +220,8 @@ DungeonIncrement: REP #$10 PHX LDA.w InventoryTable_properties,X : BIT.b #$40 : BEQ + - JSL CountChestKeyLong + CPY.w #$0024 : BEQ + ; keys for this dungeon are done elsewhere + JSL CountAllKey + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .done SEP #$10 diff --git a/sram.asm b/sram.asm index a77105b..272883b 100644 --- a/sram.asm +++ b/sram.asm @@ -361,7 +361,21 @@ TRCollectedKeys: skip 1 ; | Turtle Rock GTCollectedKeys: skip 1 ; / Ganon's Tower skip 2 ; Reserved for previous table FileMarker: skip 1 ; $FF = Active save file | $00 = Inactive save file -skip 13 ; Unused +DungeonAllCollectedKeys: ; \ Key Counters. Counts all keys for a dungeon. Chests and drops. + ; | Note, this label is not indexed like others due to space. Sewers has no decicated entry. +HCAllCollectedKeys: skip 1 ; | Hyrule Castle +EPAllCollectedKeys: skip 1 ; | Eastern Palace +DPAllCollectedKeys: skip 1 ; | Desert Palace +CTAllCollectedKeys: skip 1 ; | Agahnim's Tower +SPAllCollectedKeys: skip 1 ; | Swamp Palace +PDAllCollectedKeys: skip 1 ; | Palace of Darkness +MMAllCollectedKeys: skip 1 ; | Misery Mire +SWAllCollectedKeys: skip 1 ; | Skull Woods +IPAllCollectedKeys: skip 1 ; | Ice Palace +THAllCollectedKeys: skip 1 ; | Tower of Hera +TTAllCollectedKeys: skip 1 ; | Thieves' Town +TRAllCollectedKeys: skip 1 ; | Turtle Rock +GTAllCollectedKeys: skip 1 ; / Ganon's Tower InverseChecksumWRAM: skip 2 ; Vanilla Inverse Checksum. Don't write unless computing checksum. ;================================================================================ @@ -623,6 +637,7 @@ endmacro %assertSRAM(TRCollectedKeys, $7EF4EC) %assertSRAM(GTCollectedKeys, $7EF4ED) %assertSRAM(FileMarker, $7EF4F0) +%assertSRAM(DungeonAllCollectedKeys, $7EF4F1) ;-------------------------------------------------------------------------------- %assertSRAM(ExtendedSaveDataWRAM, $7F6000) %assertSRAM(ExtendedFileNameWRAM, $7F6000) diff --git a/stats.asm b/stats.asm index 0b6b4eb..04c7bd1 100644 --- a/stats.asm +++ b/stats.asm @@ -115,38 +115,42 @@ DecrementSmallKeys: STA.l CurrentSmallKeys ; thing we wrote over, write small key count JSL UpdateKeys RTL -;-------------------------------------------------------------------------------- -CountChestKeyLong: - PHX : PHP - SEP #$30 - JSR CountChestKey - PLP : PLX -RTL + ;-------------------------------------------------------------------------------- -CountChestKey: - PHA : PHX - LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .done - LDA.l StatsLocked : BNE .done - CPY.b #$24 : BEQ .this_dungeon - TYA - AND.b #$0F : CMP.b #$02 : BCC .hc_sewers - TAX - LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X - BRA .done - .this_dungeon - LDA.w DungeonID : CMP.b #$03 : BCC .hc_sewers - LSR : TAX - LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X - BRA .done +; Expects 16 bit index mode upon entering. 8-bit Acumulator +CountAllKey: + PHP : PHA : PHX + SEP #$10 + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .done + CPY.b #$24 : BEQ .this_dungeon + TYA : AND.b #$0F : CMP.b #$02 : BCC .hc_sewers + BRA .all_dungoens - .hc_sewers - LDA.l SewerCollectedKeys : INC - STA.l SewerCollectedKeys : STA.l HCCollectedKeys +.this_dungeon + LDA.w DungeonID : CMP.b #$03 : BCC .hc_sewers + LSR - .done - PLX : PLA -RTS +.all_dungoens + STA.b Scrap00 : TAX ; store dungeon index in X, $00 + LDA.l DungeonAllCollectedKeys-1, X : INC : STA.l DungeonAllCollectedKeys-1, X + REP #$10 : PLX : PHX ; 16 bit index + LDA.l InventoryTable_properties, X : BIT.b #$40 : BEQ .done + SEP #$10 : LDX.b Scrap00 + LDA.l DungeonCollectedKeys,X : INC : STA.l DungeonCollectedKeys,X + BRA .done + +.hc_sewers + LDA.l HCAllCollectedKeys : INC : STA.l HCAllCollectedKeys + REP #$10 : PLX : PHX ; 16 bit index + LDA.l InventoryTable_properties, X : BIT.b #$40 : BEQ .done + LDA.l SewerCollectedKeys : INC + STA.l SewerCollectedKeys : STA.l HCCollectedKeys + +.done + REP #$10 + PLX : PLA : PLP + RTL ;-------------------------------------------------------------------------------- IncrementAgahnim2Sword: From 5936b08497caf72703e998b6caba883f179dd8f5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 20 Nov 2025 10:04:53 -0700 Subject: [PATCH 6/9] fix: skip map check only when maps aren't shuffled --- doorrando/hudadditions.asm | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 2a1fc96..15b756a 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -71,6 +71,9 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished REP #$20 + LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished +.skip_map_check TXA : LSR : BNE .dungeon_id INC .dungeon_id @@ -143,15 +146,19 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 - lda.l GenericKeys : bne +++ - lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 - +++ lda.b Scrap02 - rep #$30 - jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals - bra .skipStack - + plx - .skipStack iny #2 + LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map, if shuffled + .skip_map_check + plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 + lda.l GenericKeys : bne +++ + lda.b Scrap02 : !SUB.l DungeonCollectedKeys, x : sta.b Scrap02 + +++ lda.b Scrap02 + rep #$30 + jsr ConvertToDisplay2 : sta.w $1644, y ; small key totals + bra .skipStack + .key_info_done + plx + .skipStack iny #2 cpx.w #$000d : beq + lda.w #$24f5 : sta.w $1644, y + From 68c511d6beb5cc92e94f12406c321568790ab3a5 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Dec 2025 08:26:33 -0700 Subject: [PATCH 7/9] fix: skip map check based on "compass" mode --- doorrando/hudadditions.asm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 15b756a..6941477 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -70,15 +70,16 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished + LDA.l CompassMode : BIT.w #$03 : BEQ DRHUD_Finished REP #$20 - LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check + BIT.w #$0002 : BEQ .skip_map_check LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished .skip_map_check TXA : LSR : BNE .dungeon_id INC .dungeon_id TAX - LDA.l GenericKeys : AND.w #$00FF : BNE .total_only + LDA.l GenericKeys : LSR : BCS .total_only LDA.w DungeonAllCollectedKeys-1, X : JSR ConvertToDisplay : STA.w HUDKeysObtained LDA.w #!SlashTile : STA.w HUDKeysSlash .total_only @@ -146,8 +147,8 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - LDA.l FreeItemText : BIT.w #$0040 : BEQ .skip_map_check - LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map, if shuffled + LDA.l CompassMode : BIT.w #$0002 : BEQ .skip_map_check + LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map .skip_map_check plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02 lda.l GenericKeys : bne +++ From 761365927f847a0d5729ba15087bac3d7bb553e2 Mon Sep 17 00:00:00 2001 From: KrisDavie Date: Sat, 29 Nov 2025 15:34:23 +0100 Subject: [PATCH 8/9] Prevent prizes dropping in dungeons where they shouldn't (including cave state) and fix rain state items/tablets. --- dungeondrops.asm | 14 ++++++++++++++ heartpieces.asm | 6 ++++++ tablets.asm | 15 ++++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/dungeondrops.asm b/dungeondrops.asm index 2a7a2ef..68ff32e 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -3,6 +3,16 @@ ;-------------------------------------------------------------------------------- SpawnDungeonPrize: PHX : PHB + + PHA + ; Don't spawn prize in Cave state, Hyrule Castle, Escape, Castle Tower, or Ganon's Tower + LDA.w DungeonID : BMI .skip_prize_drop ; Cave state + CMP.b #$00 : BEQ .skip_prize_drop ; Escape + CMP.b #$02 : BEQ .skip_prize_drop ; Hyrule Castle + CMP.b #$1A : BEQ .skip_prize_drop ; Ganon's Tower + CMP.b #$08 : BEQ .skip_prize_drop ; Agahnim's Tower (Castle Tower) + PLA + TAX LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index TXA @@ -24,6 +34,10 @@ SpawnDungeonPrize: PLB : PLX RTL +.skip_prize_drop: + PLA : PLB : PLX +RTL + AddDungeonPrizeAncilla: LDY.w ItemReceiptID STZ.w AncillaVelocityY,X diff --git a/heartpieces.asm b/heartpieces.asm index 5509e67..c5f8c08 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -246,6 +246,12 @@ LoadOutdoorValue: PHP REP #$20 ; set 16-bit accumulator LDA.b OverworldIndex + ; Rain state fix: In rain state DW, use LW screen ID for item lookup + BIT.w #$0040 : BEQ + + LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002 + LDA.b OverworldIndex : BCS ++ : AND.w #$00BF + ++ + + CMP.w #$03 : BNE + LDA.b LinkPosX : CMP.w #1890 : !BLT ++ %GetPossiblyEncryptedItem(HeartPiece_Spectacle, HeartPieceOutdoorValues) diff --git a/tablets.asm b/tablets.asm index 50801a0..09bbe13 100644 --- a/tablets.asm +++ b/tablets.asm @@ -19,7 +19,14 @@ RTL ;-------------------------------------------------------------------------------- SetTabletItemFlag: PHA - LDA.b OverworldIndex : CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet + ; Rain state fix: convert DW screen ID to LW if in rain state + LDA.b OverworldIndex + BIT.b #$40 : BEQ + + LDA.l ProgressIndicator : CMP.b #$02 + LDA.b OverworldIndex : BCS ++ : AND.b #$BF + ++ + + + CMP.b #$03 : BEQ .ether ; if we're on the map where ether is, we're the ether tablet .bombos JSR ItemSet_BombosTablet : BRA .done .ether @@ -71,6 +78,12 @@ RTL IsMedallion: REP #$20 ; set 16-bit accumulator LDA.b OverworldIndex + ; Rain state fix: In rain state DW, use LW screen ID for tablet lookup + BIT.w #$0040 : BEQ + + LDA.l ProgressIndicator : AND.w #$00FF : CMP.w #$0002 + LDA.b OverworldIndex : BCS ++ : AND.w #$00BF + ++ + + CMP.w #$03 : BNE + ; Death Mountain LDA.b LinkPosX : CMP.w #1890 : !BGE ++ SEC From b583cc58ff99a6776e858840b63e4068ab0d5084 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 2 Dec 2025 11:09:37 -0700 Subject: [PATCH 9/9] fix: not sure what I was thinking - fix branches and width --- doorrando/hudadditions.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doorrando/hudadditions.asm b/doorrando/hudadditions.asm index 6941477..b43848f 100644 --- a/doorrando/hudadditions.asm +++ b/doorrando/hudadditions.asm @@ -70,9 +70,9 @@ DRHUD_DrawCurrentDungeonIndicator: ; mX DRHUD_DrawKeyCounter: LDA.l DRFlags : AND.b #$04 : BEQ DRHUD_Finished - LDA.l CompassMode : BIT.w #$03 : BEQ DRHUD_Finished + LDA.l CompassMode : BIT.b #$03 : BEQ DRHUD_Finished REP #$20 - BIT.w #$0002 : BEQ .skip_map_check + BIT.w #$0002 : BNE .skip_map_check LDA.w MapField : AND.l DungeonMask, X : BEQ DRHUD_Finished .skip_map_check TXA : LSR : BNE .dungeon_id @@ -147,7 +147,7 @@ DrHudDungeonItemsAdditions: jsr ConvertToDisplay2 : sta.w $1644, y + iny #2 : lda.w #$24f5 : sta.w $1644, y phx : ldx.b Scrap00 - LDA.l CompassMode : BIT.w #$0002 : BEQ .skip_map_check + LDA.l CompassMode : BIT.w #$0002 : BNE .skip_map_check LDA.l MapField : AND.l DungeonMask, x : BEQ .key_info_done ; must have map .skip_map_check plx : sep #$30 : lda.l ChestKeys, x : sta.b Scrap02