diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 5bc796f..df48bd3 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -146,32 +146,57 @@ macro SetMinimum(base,filler,compare) endmacro RefreshRainAmmo: LDA.l ProgressIndicator : CMP.b #$01 : BEQ .rain ; check if we're in rain state - RTL - .rain - LDA.l StartingEntrance - + CMP.b #$03 : BNE + ; Uncle - %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Uncle) - %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Uncle) - LDA.l ArrowMode : BEQ ++ - LDA.l BowEquipment : BEQ +++ - ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Uncle) - +++ BRA .done - + CMP.b #$02 : BNE + ; Cell - %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Cell) - %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Cell) - LDA.l ArrowMode : BEQ ++ - LDA.l BowEquipment : BEQ .done - ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Cell) - BRA .done - + CMP.b #$04 : BNE + ; Mantle - %SetMinimum(CurrentMagic,MagicFiller,RainDeathRefillMagic_Mantle) - %SetMinimum(BombsEquipment,BombsFiller,RainDeathRefillBombs_Mantle) - LDA.l ArrowMode : BEQ ++ - LDA.l BowEquipment : BEQ .done - ++ %SetMinimum(CurrentArrows,ArrowsFiller,RainDeathRefillArrows_Mantle) - + - .done RTL +.rain + LDA.l StartingEntrance : BEQ .uncle + CMP.b #$03 : BNE + ; Uncle + .uncle + LDA.l RainDeathRefillMagic_Uncle : JSR .refillMagic + LDA.l RainDeathRefillBombs_Uncle : JSR .refillBombs + LDA.l ArrowMode : BNE .rupeeBow + LDA.l RainDeathRefillArrows_Uncle : JSR .refillArrows + BRA .done + + CMP.b #$02 : BNE + ; Cell + LDA.l RainDeathRefillMagic_Cell : JSR .refillMagic + LDA.l RainDeathRefillBombs_Cell : JSR .refillBombs + LDA.l ArrowMode : BNE .rupeeBow + LDA.l RainDeathRefillArrows_Cell : JSR .refillArrows + BRA .done + + CMP.b #$04 : BNE + ; Mantle + LDA.l RainDeathRefillMagic_Mantle : JSR .refillMagic + LDA.l RainDeathRefillBombs_Mantle : JSR .refillBombs + LDA.l ArrowMode : BNE .rupeeBow + LDA.l RainDeathRefillArrows_Mantle : JSR .refillArrows + BRA .done + + BRA .done + + .rupeeBow + REP #$20 + LDA.l RainDeathRefillRupeeBow : JSR .refillRupees + SEP #$20 + +.done +RTL + +.refillMagic + SEC : SBC.l CurrentMagic : BCC + + STA.l MagicFiller + + RTS + +.refillBombs + SEC : SBC.l BombsEquipment : BCC + + STA.l BombsFiller + + RTS + +.refillArrows + SEC : SBC.l CurrentArrows : BCC + + STA.l ArrowsFiller + + RTS + +.refillRupees + CMP.l CurrentRupees : BCC + + STA.l CurrentRupees + + RTS ;-------------------------------------------------------------------------------- SetEscapeAssist: LDA.l ProgressIndicator : CMP.b #$01 : BNE .no_train ; check if we're in rain state diff --git a/events.asm b/events.asm index f481548..5a7f974 100644 --- a/events.asm +++ b/events.asm @@ -38,7 +38,7 @@ RTL OnPlayerDead: PHA JSL SetDeathWorldChecked - JSL DynamicDropGFXClear + JSL DynamicDropGFXClear JSL SetSilverBowMode JSL RefreshRainAmmo PLA @@ -79,30 +79,20 @@ RTL ;-------------------------------------------------------------------------------- OnUncleItemGet: PHA - - LDA.l EscapeAssist - BIT.b #$04 : BEQ + : STA.l InfiniteMagic : + - BIT.b #$02 : BEQ + : STA.l InfiniteBombs : + - BIT.b #$01 : BEQ + : STA.l InfiniteArrows : + - LDA.l UncleItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID PLA JSL Link_ReceiveItem - LDA.l UncleRefill : BIT.b #$04 : BEQ + : LDA.b #$80 : STA.l MagicFiller : + ; refill magic - LDA.l UncleRefill : BIT.b #$02 : BEQ + : LDA.b #50 : STA.l BombsFiller : + ; refill bombs - LDA.l UncleRefill : BIT.b #$01 : BEQ + ; refill arrows - LDA.b #70 : STA.l ArrowsFiller + LDA.l ProgressIndicator : BNE + + LDA.b #$01 : STA.l ProgressIndicator ; set rain state + JSL SetEscapeAssist + JSL RefreshRainAmmo + ; grant arrows if we started with a bow in retro mode LDA.l ArrowMode : BEQ + - LDA.l BowTracking : ORA.b #$80 : STA.l BowTracking ; enable bow toggle - REP #$20 ; set 16-bit accumulator - LDA.l CurrentRupees : !ADD.l FreeUncleItemAmount : STA.l CurrentRupees ; rupee arrows, so also give the player some money to start - SEP #$20 ; set 8-bit accumulator + LDA.l RainDeathRefillRupeeBow : ORA.l RainDeathRefillRupeeBow+1 : BEQ + + LDA.b #$01 : STA.l ArrowsFiller + - LDA.l ProgressIndicator : BNE + - LDA.b #$01 : STA.l ProgressIndicator ; handle rain state - + RTL ;-------------------------------------------------------------------------------- OnAga1Defeated: @@ -201,12 +191,12 @@ OnNewFile: STZ.w TreePullKills STZ.w TreePullHits STZ.w PrizePackIndexes - STZ.w PrizePackIndexes+1 - STZ.w PrizePackIndexes+2 - STZ.w PrizePackIndexes+3 - STZ.w PrizePackIndexes+4 - STZ.w PrizePackIndexes+5 - STZ.w PrizePackIndexes+6 + STZ.w PrizePackIndexes+1 + STZ.w PrizePackIndexes+2 + STZ.w PrizePackIndexes+3 + STZ.w PrizePackIndexes+4 + STZ.w PrizePackIndexes+5 + STZ.w PrizePackIndexes+6 LDA.b #$00 : STA.l MosaicLevel JSL InitRNGPointerTable PLP : PLX diff --git a/tables.asm b/tables.asm index 12de6d4..f0c2197 100644 --- a/tables.asm +++ b/tables.asm @@ -237,12 +237,8 @@ db $00 ;a - Infinite Arrows ;-------------------------------------------------------------------------------- org $B0804E ; PC 0x18004E -UncleRefill: +UncleRefill_deprecated: ; no longer used db $00 -;---- -mba -;m - Refill Magic -;b - Refill Bombs -;a - Refill Arrows ;-------------------------------------------------------------------------------- org $B0804F ; PC 0x18004F ByrnaInvulnerability: @@ -890,8 +886,8 @@ SilverArrowsAutoEquip: db $01 ; #$00 = Off - #$01 = Collection Time (Default) - #$02 = Entering Ganon - #$03 = Collection Time & Entering Ganon ;================================================================================ org $B08183 ; PC 0x180183 -FreeUncleItemAmount: -dw $12C ; 300 rupees (Default) +RainDeathRefillRupeeBow: +dw $012C ; 300 rupees (Default) ;-------------------------------------------------------------------------------- org $B08185 ; PC 0x180185 RainDeathRefillTable: diff --git a/zelda.asm b/zelda.asm index 1d7c9fd..7e40205 100644 --- a/zelda.asm +++ b/zelda.asm @@ -1,10 +1,14 @@ ;-------------------------------------------------------------------------------- EndRainState: - LDA.l InitProgressIndicator : BIT.b #$80 : BNE + ; check for instant post-aga - LDA.b #$02 : STA.l ProgressIndicator - RTL + LDA.l InitProgressIndicator : BIT.b #$80 : BEQ + ; check for instant post-aga + LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02 + LDA.b #$03 + BRA ++ + - LDA.b #$03 : STA.l ProgressIndicator - LDA.l InitLumberjackOW : STA.l OverworldEventDataWRAM+$02 + LDA.b #$02 + ++ + STA.l ProgressIndicator + + JSL SetEscapeAssist RTL ;--------------------------------------------------------------------------------