From e07f51dfb44fa691b604e81267e200c56f8432db Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Sat, 21 Apr 2018 11:01:51 -0400 Subject: [PATCH] Extra cleanup of text removal code Remove hooks that were only left to clear $1C8E, replacing them with a single new hook. --- LTTP_RND_GeneralBugfixes.asm | 3 + contrib.asm | 182 +++++++++++++++++------------------ dialog.asm | 5 + hooks.asm | 57 +---------- 4 files changed, 102 insertions(+), 145 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 8f220d7..25080fa 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -356,6 +356,9 @@ GetAnimatedSpriteTile: org $00D52D GetAnimatedSpriteTile_variable: +org $00D84E +Attract_DecompressStoryGfx: + org $00E529 LoadSelectScreenGfx: diff --git a/contrib.asm b/contrib.asm index 576adc0..ac5991d 100644 --- a/contrib.asm +++ b/contrib.asm @@ -1,137 +1,137 @@ ;================================================================ ; Contributor: Myramong ;================================================================ -Sprite_ShowMessageFromPlayerContact_Edit: -{ - STZ $1CE8 - JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .dont_show - - LDA $4D : CMP.b #$02 : BEQ .dont_show - - JSL.l Sprite_DirectionToFacePlayerLong : TYA : EOR.b #$03 - SEC -RTL -.dont_show - LDA $0DE0, X - CLC -RTL -} +;Sprite_ShowMessageFromPlayerContact_Edit: +;{ +; STZ $1CE8 +; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .dont_show +; +; LDA $4D : CMP.b #$02 : BEQ .dont_show +; +; JSL.l Sprite_DirectionToFacePlayerLong : TYA : EOR.b #$03 +; SEC +;RTL +;.dont_show +; LDA $0DE0, X +; CLC +;RTL +;} ;================================================================ -Sprite_ShowSolicitedMessageIfPlayerFacing_Edit: -{ - JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha - JSL.l Sprite_CheckIfPlayerPreoccupied : BCS .alpha - LDA $F6 : BPL .alpha - LDA $0F10, X : BNE .alpha - - LDA $4D : CMP.b #$02 : BEQ .alpha - - STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc) - JSL.l Sprite_DirectionToFacePlayerLong : PHX : TYX - - ; Make sure that the sprite is facing towards the player, otherwise - ; talking can't happen. (What sprites actually use this???) - LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other - PHY - LDA.b #$40 : STA $0F10, X - PLA : EOR.b #$03 - SEC -RTL -.not_facing_each_other -.alpha - LDA $0DE0, X - CLC -RTL -} +;Sprite_ShowSolicitedMessageIfPlayerFacing_Edit: +;{ +; JSL.l Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha +; JSL.l Sprite_CheckIfPlayerPreoccupied : BCS .alpha +; LDA $F6 : BPL .alpha +; LDA $0F10, X : BNE .alpha +; +; LDA $4D : CMP.b #$02 : BEQ .alpha +; +; STZ $1CE8 ; set text choice to 1st option (usually yes/confirm/etc) +; JSL.l Sprite_DirectionToFacePlayerLong : PHX : TYX +; +; ; Make sure that the sprite is facing towards the player, otherwise +; ; talking can't happen. (What sprites actually use this???) +; LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other +; PHY +; LDA.b #$40 : STA $0F10, X +; PLA : EOR.b #$03 +; SEC +;RTL +;.not_facing_each_other +;.alpha +; LDA $0DE0, X +; CLC +;RTL +;} ;================================================================ -OldMountainMan_TransitionFromTagalong_Edit: -{ - PHA - - LDA.b #$AD : JSL Sprite_SpawnDynamically - - PLA : PHX : TAX - - LDA $1A64, X : AND.b #$03 : STA $0EB0, Y - STA $0DE0, Y - - LDA $1A00, X : CLC : ADC.b #$02 : STA $0D00, Y - LDA $1A14, X : ADC.b #$00 : STA $0D20, Y - - LDA $1A28, X : CLC : ADC.b #$02 : STA $0D10, Y - LDA $1A3C, X : ADC.b #$00 : STA $0D30, Y - - LDA $EE : STA $0F20, Y - - LDA.b #$01 : STA $0BA0, Y - STA $0E80, Y - - LDA.b #$01 : STA $02E4 ; OldMountainMan_FreezePlayer - STA $037B ; ^ - - PLX - - LDA.b #$00 : STA $7EF3CC - - STZ $5E - - JML $09A6B6 ; <- 4A6B6 tagalong.asm:1194 (SEP #$30 : RTS) -} +;OldMountainMan_TransitionFromTagalong_Edit: +;{ +; PHA +; +; LDA.b #$AD : JSL Sprite_SpawnDynamically +; +; PLA : PHX : TAX +; +; LDA $1A64, X : AND.b #$03 : STA $0EB0, Y +; STA $0DE0, Y +; +; LDA $1A00, X : CLC : ADC.b #$02 : STA $0D00, Y +; LDA $1A14, X : ADC.b #$00 : STA $0D20, Y +; +; LDA $1A28, X : CLC : ADC.b #$02 : STA $0D10, Y +; LDA $1A3C, X : ADC.b #$00 : STA $0D30, Y +; +; LDA $EE : STA $0F20, Y +; +; LDA.b #$01 : STA $0BA0, Y +; STA $0E80, Y +; +; LDA.b #$01 : STA $02E4 ; OldMountainMan_FreezePlayer +; STA $037B ; ^ +; +; PLX +; +; LDA.b #$00 : STA $7EF3CC +; +; STZ $5E +; +; JML $09A6B6 ; <- 4A6B6 tagalong.asm:1194 (SEP #$30 : RTS) +;} ;================================================================ !MAP_OVERLAY = "$7EF414" ; [2] Sprite_ShowSolicitedMessageIfPlayerFacing_Alt: { STA $1CF0 STY $1CF1 - + JSL Sprite_CheckDamageToPlayerSameLayerLong : BCC .alpha JSL Sprite_CheckIfPlayerPreoccupied : BCS .alpha - + LDA $F6 : BPL .alpha LDA $0F10, X : BNE .alpha LDA $4D : CMP.b #$02 : BEQ .alpha - + JSL Sprite_DirectionToFacePlayerLong : PHX : TYX - + ; Make sure that the sprite is facing towards the player, otherwise ; talking can't happen. (What sprites actually use this???) LDA $05E1A3, X : PLX : CMP $2F : BNE .not_facing_each_other - + PHY - + LDA $1CF0 LDY $1CF1 - + ; Check what room we're in so we know which npc we're talking to LDA.b $A0 : CMP #$05 : BEQ .SahasrahlaDialogs CMP #$1C : BEQ .BombShopGuyDialog BRA .SayNothing - + .SahasrahlaDialogs REP #$20 : LDA.l MapReveal_Sahasrahla : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20 JSL DialogSahasrahla : BRA .SayNothing - + .BombShopGuyDialog REP #$20 : LDA.l MapReveal_BombShop : ORA !MAP_OVERLAY : STA !MAP_OVERLAY : SEP #$20 JSL DialogBombShopGuy - + .SayNothing - + LDA.b #$40 : STA $0F10, X - + PLA : EOR.b #$03 - + SEC - + RTL .not_facing_each_other .alpha LDA $0DE0, X - + CLC - + RTL } -;================================================================ \ No newline at end of file +;================================================================ diff --git a/dialog.asm b/dialog.asm index f3ce258..5076d5b 100644 --- a/dialog.asm +++ b/dialog.asm @@ -250,6 +250,11 @@ RTL PLY : PLX : PLA RTL ;-------------------------------------------------------------------------------- +DialogResetSelectionIndex: + JSL.l Attract_DecompressStoryGfx ; what we wrote over + STZ $1CE8 +RTL +;-------------------------------------------------------------------------------- DialogFairyThrow: LDA.l Restrict_Ponds : BEQ .normal LDA $7EF35C : ORA $7EF35D : ORA $7EF35E : ORA $7EF35F : BNE .normal diff --git a/hooks.asm b/hooks.asm index fab3c41..8ddcd08 100644 --- a/hooks.asm +++ b/hooks.asm @@ -1431,71 +1431,20 @@ LDA #$40 : STA !MS_GOT org $08C5E5 ; <- 445ED - ancilla_receive_item.asm:395 (LDA .item_messages, Y : CMP.w #$FFFF : BEQ .handleGraphics) LDA.w #$FFFF ;-------------------------------------------------------------------------------- -;-- zelda in jail -org $05ED27 ; <- 2ED27 sprite_zelda.asm : 256 - (JSL Sprite_ShowMessageUnconditional) -STZ $1CE8 : NOP -;---------------------------------------------------- -;-- sanctuary -org $05DDAB ; <- 2DDAB sprite_uncle_and_priest.asm : 635 - (JSL Sprite_ShowMessageUnconditional) -STZ $1CE8 : NOP -;---------------------------------------------------- -;-- King Zora -org $059A82 ; <- 29A82 sprite_zora_king.asm : 229 - (LDA $1CE8 : BNE .player_says_just_came_to_visit) -LDA.b #00 : NOP -org $059A8D ; <- 29A8d sprite_zora_king.asm : 229 - (LDA $1CE8 : BNE .not_buying) -LDA.b #00 : NOP -;---------------------------------------------------- -;-- Kiki -org $1EE3E6 ; <- F63E6 sprite_kiki.asm : 157 pay kiki 10 rupees -STZ $1CE8 : NOP -org $1EE4FB ; <- F64FB sprite_kiki.asm : 340 pay 100 rupees -STZ $1CE8 : NOP +;-- Reset Dialog Selection index for each new message +org $0EEE5D ; <- 76E5D - vwf.asm:84 (JSL Attract_DecompressStoryGfx) +JSL.l DialogResetSelectionIndex ;---------------------------------------------------- ;-- Agahnim 1 Defeated org $068475 ; <- 30475 Bank06.asm : 762 - (JSL Sprite_ShowMessageMinimal) JSL.l AddInventory_incrementBossSwordLong ;NOP #4 ;---------------------------------------------------------- -;-- Middle aged man opens purple chest -org $06BD44 ; <- 33D44 sprite_middle_aged_man.asm : 107 (JSL Sprite_ShowMessageFromPlayerContact : BCC .return) -JSL Sprite_ShowMessageFromPlayerContact_Edit -; ^ still needed because of clearing $1CE8 -;---------------------------------------------------------- -;-- Smiths -;-- Ask us to do anything -org $06B418 ; <- 33418 sprite_smithy_bros.asm : 371 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .player_didnt_speak) -JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit -; ^ still needed because of clearing $1CE8 -;-- 10 rupees to temper -org $06B470 ; <- 33470 sprite_smithy_bros.asm : 447 (JSL Sprite_ShowMessageUnconditional) -STZ $1CE8 : NOP -;-- Yes, I'm sure -org $06B495 ; <- 33495 sprite_smithy_bros.asm : 479 (JSL Sprite_ShowMessageUnconditional) -STZ $1CE8 : NOP ;-- We'll take your sword org $06B4F3 ; <- 334F3 sprite_smithy_bros.asm : 556 (JSL Sprite_ShowMessageUnconditional) JSL ItemSet_SmithSword ;NOP #4 ;---------------------------------------------------------- -;-- Bottle Vendor -org $05EAE3 ; <- 2EAE3 sprite_bottle_vendor.asm : 104 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_converse) -JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit -; ^ still needed because of clearing $1CE8 -;---------------------------------------------------------- -;-- Digging Game Guy -org $1DFC76 ; <- EFC76 sprite_digging_game_guy.asm : 46 (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .return) -JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit -; ^ still needed because of clearing $1CE8 -;---------------------------------------------------------- -;-- Flute Boy -org $06B078 ; <- 33078 sprite_flute_boy.asm : 244 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC .didnt_speak) -JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit -; ^ still needed because of clearing $1CE8 -;---------------------------------------------------------- -;-- Chest Game Guy -org $1EEFBF ; <- F6FBF sprite_shopkeeper.asm : 121 - (JSL Sprite_ShowSolicitedMessageIfPlayerFacing : BCC BRANCH_ALPHA) -JSL Sprite_ShowSolicitedMessageIfPlayerFacing_Edit -; ^ still needed because of clearing $1CE8 ;=================================== ;-- Escort Text