diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index f99f924..2944ea2 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -329,6 +329,9 @@ DecompSwordGfx: org $00D348 DecompShieldGfx: +org $00D463 +Tagalong_LoadGfx: + org $00D51B GetAnimatedSpriteTile: diff --git a/bugfixes.asm b/bugfixes.asm index e088ef3..28551e6 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -98,3 +98,20 @@ MakeBunny: PLY : PLX RTS ;-------------------------------------------------------------------------------- + +;-------------------------------------------------------------------------------- +; fix issue where cross world caves (in Entrance randomizer) don't cause +; frog to become smith or vice versa. +FixFrogSmith: + LDA.l $7EF3CA : BNE .darkWorld + LDA.l $7EF3CC : CMP.b #$07 : BNE .done + LDA.b #$08 : STA.l $7EF3CC ; make frog into smith in light world + BRA .loadgfx + .darkWorld + LDA.l $7EF3CC : CMP.b #$08 : BNE .done + LDA.b #$07 : STA.l $7EF3CC ; make smith into frog in dark world + .loadgfx + JSL Tagalong_LoadGfx + .done +RTS +;-------------------------------------------------------------------------------- diff --git a/entrances.asm b/entrances.asm index 869341d..b9d7505 100644 --- a/entrances.asm +++ b/entrances.asm @@ -23,4 +23,16 @@ RTS + LDA.w #$0000 RTS -;-------------------------------------------------------------------------------- \ No newline at end of file +;-------------------------------------------------------------------------------- +SmithDoorCheck: + LDA.l SmithTravelsFreely : AND.w #$00FF : BEQ .orig + ;If SmithTravelsFreely is set Frog/Smith can enter multi-entrance overworld doors + JMP.l Overworld_Entrance_BRANCH_RHO + + .orig ; The rest is equivlent to what we overwrote + CPX.w #$0076 : !BGE + + JMP.l Overworld_Entrance_BRANCH_LAMBDA + + + +JMP.l Overworld_Entrance_BRANCH_RHO +;-------------------------------------------------------------------------------- diff --git a/hooks.asm b/hooks.asm index b56925c..8ce1eb2 100644 --- a/hooks.asm +++ b/hooks.asm @@ -2095,3 +2095,20 @@ JSL.l QuickSwap org $02A451 ; <- 12451 - Bank02.asm:6283 (LDA $F6 : AND.b #$40 : BEQ .xButtonNotDown) JSL.l QuickSwap ;================================================================================ + +;================================================================================ +; Tagalong Fixes +;-------------------------------------------------------------------------------- +org $0689A7 ; <- 309A7 - sprite_prep.asm: 647 (LDA $7EF3CC : CMP.b #$06 : BEQ .killSprite) +; Note: In JP 1.0 we have: (CMP.b #$00 : BNE .killSprite) appling US bugfix +; Prevent followers from causing blind/maiden to despawn: +CMP.b #$06 : db #$F0 ; BEQ +;-------------------------------------------------------------------------------- +;Control which doors frog/smith can enter +org $1BBCF0 ; <- DBCF0 - Bank1B.asm: 248 (LDA $04B8 : BNE BRANCH_MU) +Overworld_Entrance_BRANCH_LAMBDA: ; Branch here to show Cannot Enter with Follower message + +org $1BBD55 ; <- DBD55 - Bank1B.asm: 290 (CPX.w #$0076 : BCC BRANCH_LAMBDA) +JML.l SmithDoorCheck : NOP +Overworld_Entrance_BRANCH_RHO: ; branch here to continue into door +;================================================================================ diff --git a/music.asm b/music.asm index c1d96d0..0727996 100644 --- a/music.asm +++ b/music.asm @@ -3,6 +3,7 @@ PreOverworld_LoadProperties_ChooseMusic: ; A: scratch space (value never used) ; Y: set to overworld animated tileset ; X: set to music track/command id + JSR.w FixFrogSmith ; Just a convenient spot to install this hook LDY.b #$58 ; death mountain animated tileset. diff --git a/tables.asm b/tables.asm index ce348ae..0ee0053 100644 --- a/tables.asm +++ b/tables.asm @@ -201,6 +201,10 @@ org $30804B ; PC 0x18004B QuickSwapFlag: db #$00 ; #$00 = Off (default) - #$01 = On ;-------------------------------------------------------------------------------- +org $30804C ; PC 0x18004C +SmithTravelsFreely: +db #$00 ; #$00 = Off (default) - #$01 = On (frog/smith can enter multi-entrance doors) +;-------------------------------------------------------------------------------- org $308080 ; PC 0x180080 Upgrade5BombsRefill: db #$00 diff --git a/zelda.asm b/zelda.asm index 4ff151b..83f8def 100644 --- a/zelda.asm +++ b/zelda.asm @@ -2,8 +2,9 @@ ; Spawn Zelda (or not) ;-------------------------------------------------------------------------------- SpawnZelda: - LDA.l $7EF3CC : CMP #$08 : BEQ + ; don't spawn if dwarf is present - CMP #$0C : BEQ + ; don't spawn if purple chest is present + LDA.l $7EF3CC : CMP #$08 : BEQ + ; don't spawn if dwarf is present + CMP #$07 : BEQ + ; don't spawn if frog is present + CMP #$0C : BEQ + ; don't spawn if purple chest is present CLC : RTL + SEC @@ -14,4 +15,4 @@ EndRainState: LDA.b #$02 : STA $7EF3C5 ; end rain state + RTL -;-------------------------------------------------------------------------------- \ No newline at end of file +;--------------------------------------------------------------------------------