diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index be04dce..4fb3d25 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF db #$00 ; expand file to 2mb org $1FFFF8 ; timestamp rom -dl #$20170617 +dl #$20170620 ;================================================================================ diff --git a/darkworldspawn.asm b/darkworldspawn.asm index 821ff39..c8408ba 100644 --- a/darkworldspawn.asm +++ b/darkworldspawn.asm @@ -20,6 +20,9 @@ DarkWorldFlagSet: LDA Bugfix_PreAgaDWDungeonDeathToFakeDW : BEQ + LDA $10 : CMP #$12 : BEQ .done ; don't do anything in death mode + + LDA $1B : BEQ + ; skip this unless indoors - THIS PART FIXES THE OTHER FUCKUP WITH THE PYRAMID SPAWN IN GLITCHED + LDA $A0 : CMP.b #$00 : BEQ .done ; skip if we died in ganon's room + + LDA.l Bugfix_MirrorlessSQToLW : BEQ + LDA $7EF353 : BEQ .noMirror ; check if we have the mirror + @@ -29,7 +32,6 @@ DarkWorldFlagSet: .aga1Alive LDA #$00 : STA $7EF3CA ; set flag to light world LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$08 : STA $7EF3CC : + ; convert frog to dwarf - ;LDA $7EF3CC : CMP #$07 : BNE + : LDA.b #$00 : STA $7EF3CC : + ; clear frog .done PLA RTL @@ -43,7 +45,6 @@ SetDeathWorldChecked: LDA $A0 : CMP.b #$00 : BEQ .done ; skip if we died in ganon's room LDA.b #$00 : STA $7EF3CA : STA $7E0FFF ; set the world to the light world if he's still alive LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$08 : STA $7EF3CC ; convert frog to dwarf - ;LDA $7EF3CC : CMP #$07 : BNE .done : LDA.b #$00 : STA $7EF3CC ; clear frog .done PLA RTL diff --git a/events.asm b/events.asm index 2b939aa..47300fd 100644 --- a/events.asm +++ b/events.asm @@ -17,10 +17,11 @@ OnDungeonEntrance: PHA : PHP SEP #$20 ; set 8-bit accumulator LDA $040C : CMP #$FF : BEQ + ; don't do this unless it's a real dungeon + REP #$20 : LDA $A0 : CMP.w #18 : BEQ + : SEP #$20 ; skip if we're in the sanctuary LDA $7EF3CC ; load follower CMP #$0C : BNE + ; skip if not the purple chest LDA #$00 : STA $7EF3CC - + + + ; this might get hit from above in either accumulator mode PLP : PLA STA $7EC172 ; thing we wrote over RTL @@ -77,11 +78,6 @@ PreItemGet: RTL ;-------------------------------------------------------------------------------- PostItemGet: - ;LDA $02D8 - ;CMP #$70 : !BLT + - ;CMP #$B0 : !BGE + - ; JSL.l FreeDungeonItemNotice - ;+ JSL.l MaybeWriteSRAMTrace RTL ;-------------------------------------------------------------------------------- diff --git a/hooks.asm b/hooks.asm index 9ca431d..269fd28 100644 --- a/hooks.asm +++ b/hooks.asm @@ -687,6 +687,12 @@ JSL.l CheckMedallionSword org $07A656 ; <- 3A656 - Bank07.asm:6133 (LDA $7EF359 : INC A : AND.b #$FE : BEQ BRANCH_BETA) - Quake JSL.l CheckMedallionSword ;-------------------------------------------------------------------------------- +org $05F3A0 ; <- 2F3A0 - sprite_medallion_tablet.asm:240 (LDA $7EF359 : BMI .zeta) +JSL.l CheckTabletSword +;-------------------------------------------------------------------------------- +org $05F40A ; <- 2F40A - sprite_medallion_tablet.asm:303 (LDA $7EF359 : BMI .show_hylian_script) +JSL.l CheckTabletSword +;-------------------------------------------------------------------------------- ;================================================================================ ; Medallion Tablets @@ -811,12 +817,12 @@ JSL.l RNG_Kholdstare org $1E97D5 ; <- F17D5 - sprite_kholdstare.asm : 605 (JSL GetRandomInt : AND.b #$04 : STA $0D) JSL.l RNG_Kholdstare ;-------------------------------------------------------------------------------- -org $1DE5E4 ; <- EE5E4 - sprite_vitreous.asm : 207 (JSL GetRandomInt : AND.b #$0F : TAY) +org $1DE5B4 ; <- EE5E4 - sprite_vitreous.asm : 207 (JSL GetRandomInt : AND.b #$0F : TAY) JSL.l RNG_Vitreous org $1DE626 ; <- EE626 - sprite_vitreous.asm : 255 (JSL GetRandomInt : AND.b #$07 : STA $0D90, Y) JSL.l RNG_Vitreous ;-------------------------------------------------------------------------------- -org $1DB16C ; <- EB16C - sprite_trinexx.asm : 530 (JSL GetRandomInt : AND.b #$07 : TAY) +org $1DB61C ; <- EB16C - sprite_trinexx.asm : 530 (JSL GetRandomInt : AND.b #$07 : TAY) JSL.l RNG_Trinexx org $1DB186 ; <- EB186 - sprite_trinexx.asm : 535 (JSL GetRandomInt : AND.b #$07 : TAY) JSL.l RNG_Trinexx diff --git a/swordswap.asm b/swordswap.asm index c4c0611..7608a9a 100644 --- a/swordswap.asm +++ b/swordswap.asm @@ -30,6 +30,14 @@ LoadSwordForDamage: .done RTL ;================================================================================ +CheckTabletSword: + LDA.l AllowHammerTablets : BEQ + + LDA $7EF34B : BEQ + ; check for hammer + LDA.b #$02 : RTL + + + LDA $7EF359 ; get actual sword value +RTL +;================================================================================ CheckGanonHammerDamage: LDA.l HammerableGanon : BEQ + LDA $0E20, X : CMP.b #$D8 ; original behavior except ganon diff --git a/tables.asm b/tables.asm index 2192c5b..a835156 100644 --- a/tables.asm +++ b/tables.asm @@ -161,6 +161,10 @@ org $308043 ; PC 0x180043 StartingSword: db #$00 ; #$00 = No Sword (default) - #$FF = Non-Sword ;-------------------------------------------------------------------------------- +org $308044 ; PC 0x180044 +AllowHammerTablets: +db #$00 ; #$00 = Off (default) - #$01 = On +;-------------------------------------------------------------------------------- org $308080 ; PC 0x180080 Upgrade5BombsRefill: db #$00 diff --git a/zelda.asm b/zelda.asm index f9dd945..4ff151b 100644 --- a/zelda.asm +++ b/zelda.asm @@ -2,7 +2,8 @@ ; Spawn Zelda (or not) ;-------------------------------------------------------------------------------- SpawnZelda: - LDA.l $7EF3CC : CMP #$08 : BEQ + + LDA.l $7EF3CC : CMP #$08 : BEQ + ; don't spawn if dwarf is present + CMP #$0C : BEQ + ; don't spawn if purple chest is present CLC : RTL + SEC