From 82ac2e97d882c987bcedb054cff5837ca902bcd3 Mon Sep 17 00:00:00 2001 From: KrisDavie Date: Sun, 30 Nov 2025 14:47:33 +0100 Subject: [PATCH] More Glitched Fixes --- dungeondrops.asm | 14 ++++++++++++++ heartpieces.asm | 6 ++++++ tablets.asm | 16 ++++++++++++++-- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dungeondrops.asm b/dungeondrops.asm index 823a53db..d23154b1 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 + STA.w ItemReceiptID TAX LDA.b $06,S : STA.b ScrapBuffer72 ; Store current RoomTag index @@ -18,6 +28,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 58ad5aff..4b2ac29b 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -242,6 +242,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 #$00 : BNE + LDA.l OWBonkPrizeTable[$00].loot JMP .done diff --git a/tablets.asm b/tablets.asm index 12761b24..0284fb12 100644 --- a/tablets.asm +++ b/tablets.asm @@ -19,8 +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 - .bombos + ; 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 JSR ItemSet_EtherTablet @@ -69,6 +75,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