From ebc0791cc4c6ccbaa6da04f6944508237396ee66 Mon Sep 17 00:00:00 2001 From: Karkat Date: Wed, 28 Jun 2017 01:08:03 -0400 Subject: [PATCH] let's dev 6/28/17 fixed fake flipper kill (again except on the screen you entered) fixed stats bonk key fixed stats progressive sword probably fixed several byrna bugs added OnEnterWater event hook --- LTTP_RND_GeneralBugfixes.asm | 2 +- bookofmudora.asm | 1 + events.asm | 10 +++++++++- flipperkill.asm | 16 +++++++++++++++- hooks.asm | 14 ++++++++++++++ inventory.asm | 15 ++------------- stats.asm | 3 +-- tables.asm | 1 + 8 files changed, 44 insertions(+), 18 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 6ecceab..63282e3 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 #$20170626 +dl #$20170628 ;================================================================================ diff --git a/bookofmudora.asm b/bookofmudora.asm index 2af234b..8f9c9ac 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -54,6 +54,7 @@ GiveBonkItem: JSR LoadBonkItem CMP #$24 : BNE .notKey .key + JSL.l AddInventory_incrementKeyLong LDA $7EF36F : INC A : STA $7EF36F LDA.b #$2F : JSL.l Sound_SetSfx3PanLong RTL diff --git a/events.asm b/events.asm index 47300fd..d109826 100644 --- a/events.asm +++ b/events.asm @@ -36,6 +36,7 @@ OnFileLoad: JSL.l MasterSwordFollowerClear JSL.l InitOpenMode LDA #$FF : STA !RNG_ITEM_LOCK_IN ; reset rng item lock-in + LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible RTL ;-------------------------------------------------------------------------------- !RNG_ITEM_LOCK_IN = "$7F5090" @@ -53,10 +54,17 @@ OnNewFile: RTL ;-------------------------------------------------------------------------------- OnLinkDamaged: - ;JSL.l FlipperKill + JSL.l FlipperKill JSL.l OHKOTimer RTL ;-------------------------------------------------------------------------------- +OnEnterWater: + JSL.l RegisterWaterEntryScreen + + JSL.l MysteryWaterFunction + LDX.b #$04 +RTL +;-------------------------------------------------------------------------------- OnLinkDamagedFromPit: JSL.l OHKOTimer LDA.b #$14 : STA $11 ; thing we wrote over diff --git a/flipperkill.asm b/flipperkill.asm index bb5d683..c198600 100644 --- a/flipperkill.asm +++ b/flipperkill.asm @@ -6,6 +6,7 @@ FlipperKill: LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming LDA $7EF356 : BNE .done ; skip if we have the flippers LDA $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock + LDA $8A : CMP $7F5098 : BEQ .done ; skip if we're on the same screen we entered the water on JSL.l KillFairies ; take away fairies LDA.b #$00 : STA $7EF36D ; kill link LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible @@ -41,4 +42,17 @@ FlipperFlag: LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible .done RTL -;-------------------------------------------------------------------------------- \ No newline at end of file +;-------------------------------------------------------------------------------- +RegisterWaterEntryScreen: + PHA + LDA $8A : STA $7F5098 ; store ow index + PLA +RTL +;-------------------------------------------------------------------------------- +MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT + LDA.b #$20 : STA $02E2 + STZ $037B + STZ $55 + STZ $0360 +RTL +;-------------------------------------------------------------------------------- diff --git a/hooks.asm b/hooks.asm index 087b49a..7de3fdf 100644 --- a/hooks.asm +++ b/hooks.asm @@ -514,6 +514,10 @@ JSL.l DialogUncle ;org $1FB8E4 ; <- 0FB8E4 ;db $00 ;-------------------------------------------------------------------------------- +;0xFE465 -> 0x1E +org $1FE465 +db #$1E +;-------------------------------------------------------------------------------- ;================================================================================ ; Bomb & Arrow Capacity Updates @@ -1665,15 +1669,25 @@ NOP #6 ;================================================================================ ; Fake Flippers Softlock Fix + General Damage Hooks ;-------------------------------------------------------------------------------- +org $078091 ; <- 38091 - Bank07.asm:138 (LDA $037B : BNE .linkNotDamaged) +LDA $0373 : STA $00 : STZ $0373 ; store and zero damage +LDA $037B : BNE LinkDamaged_linkNotDamaged ; skip if immune +;-------------------------------------------------------------------------------- org $0780C6 ; <- 380C6 - Bank07.asm:174 (LDA $7EF36D) JSL.l OnLinkDamaged ;-------------------------------------------------------------------------------- +org $0780FB ; <- 380FB - Bank07.asm:207 (.linkNotDamaged) +LinkDamaged_linkNotDamaged: +;-------------------------------------------------------------------------------- org $0794FB ; <- 394FB - Bank07.asm:3336 (LDA.b #$14 : STA $11) JSL.l OnLinkDamagedFromPit ;-------------------------------------------------------------------------------- org $078F27 ; <- 38F27 JSL.l FlipperReset ;-------------------------------------------------------------------------------- +org $078F51 ; <- 38F51 - Bank07.asm:2444 (JSR $AE54 ; $3AE54 IN ROM) +JSL.l OnEnterWater : NOP +;-------------------------------------------------------------------------------- ;================================================================================ ; Floodgate Softlock Fix diff --git a/inventory.asm b/inventory.asm index a91f050..a6aff8e 100644 --- a/inventory.asm +++ b/inventory.asm @@ -231,10 +231,7 @@ AddInventory: CPY.b #$50 : BEQ .isSword BRA + .isSword - LDA $7EF42A : AND #$40 : BNE ++ ; skip additional processing if we have the fairy sword flag yet - BRL .dungeonCounts - ++ - BRL .itemCounts + BRL .dungeonCounts + CPY.b #$3B : BNE + : BRL .dungeonCounts : + ; Silver Arrow Bow - Skip Shop/Fairy Check for Silver Arrow Bow @@ -522,15 +519,7 @@ RTL PLA + - LDA $00 : PHA - LDA.l FairySword : STA $00 - CPY $00 : BNE + ; increment if not the fairy sword - LDA $7EF42A : BIT #$40 : BNE ++ ; skip if we have the fairy sword flag yet - ORA.b #$40 : STA $7EF42A ; set fairy sword flag - + - LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter - ++ - PLA : STA $00 + LDA $7EF422 : !ADD #$20 : STA $7EF422 ; increment sword counter RTS .incrementShield diff --git a/stats.asm b/stats.asm index 60aeea2..636d743 100644 --- a/stats.asm +++ b/stats.asm @@ -38,9 +38,8 @@ ; b - heart containers ; p - pendant upgrades ;-------------------------------------------------------------------------------- -; $7EF42A bfsccccc +; $7EF42A b-sccccc ; b - bomb acquired -; f - fairy sword acquired ; s - silver arrow bow acquired ; c - chests before gtower big key ;-------------------------------------------------------------------------------- diff --git a/tables.asm b/tables.asm index aabe020..9ffab30 100644 --- a/tables.asm +++ b/tables.asm @@ -1104,6 +1104,7 @@ dw #9999 ; Rupee Limit ; $7F5095 - Dialog Offset Pointer (High) ; $7F5096 - Dialog Offset Pointer Return (Low) ; $7F5097 - Dialog Offset Pointer Return (High) +; $7F5098 - Water Entry Index ; $7F50D0 - $7F50FF - Block Cypher Parameters ; $7F5100 - $7F51FF - Block Cypher Buffer ; $7F5200 - $7F52FF - RNG Pointer Block