From 93aead2d74bbf41a79e1fc3ce28c3cad789a9daf Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Sat, 8 Sep 2018 16:07:09 -0400 Subject: [PATCH] Remove no-text lag --- LTTP_RND_GeneralBugfixes.asm | 6 ---- dialog.asm | 56 ++++++++++++++++++++++++++++++++++-- events.asm | 2 +- hooks.asm | 17 +++++++++-- newitems.asm | 4 +-- 5 files changed, 70 insertions(+), 15 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 380deb1..06eb199 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -429,9 +429,6 @@ Sprite_ShowMessageFromPlayerContact: org $05E219 Sprite_ShowMessageUnconditional: -org $05FA8E -Sprite_ShowMessageMinimal: - org $05EC96 Sprite_ZeldaLong: @@ -580,9 +577,6 @@ ShopKeeper_RapidTerminateReceiveItem: org $1CF500 Sprite_NullifyHookshotDrag: -org $1CFD69 -Main_ShowTextMessage: - org $1DE9B6 Filter_MajorWhitenMain: diff --git a/dialog.asm b/dialog.asm index 6b5773b..ea334c3 100644 --- a/dialog.asm +++ b/dialog.asm @@ -237,7 +237,7 @@ FreeDungeonItemNotice: PLB PLP PLY : PLX : PLA - ;JSL.l Main_ShowTextMessage + ;JSL.l Main_ShowTextMessage_Alt RTL .skip @@ -288,7 +288,7 @@ DialogGanon1: + REP #$20 : LDA.w #$016D : STA $1CF0 : SEP #$20 ++ - JSL.l Sprite_ShowMessageMinimal + JSL.l Sprite_ShowMessageMinimal_Alt RTL ;-------------------------------------------------------------------------------- DialogGanon2: @@ -298,7 +298,7 @@ DialogGanon2: + REP #$20 : LDA.w #$016E : STA $1CF0 : SEP #$20 ++ - JSL.l Sprite_ShowMessageMinimal + JSL.l Sprite_ShowMessageMinimal_Alt RTL ;-------------------------------------------------------------------------------- DialogEtherTablet: @@ -366,6 +366,56 @@ DialogBombShopGuy: LDY.b #$01 JSL.l Sprite_ShowMessageUnconditional RTL +;-------------------------------------------------------------------------------- +Main_ShowTextMessage_Alt: + ; Are we in text mode? If so then end the routine. + LDA $10 : CMP.b #$0E : BEQ .already_in_text_mode +Sprite_ShowMessageMinimal_Alt: + STZ $11 + + PHX : PHY + LDA.b $00 : PHA + LDA.b $01 : PHA + LDA.b $02 : PHA + + LDA.b #$1C : STA.b $02 + REP #$30 + LDA.w $1CF0 : ASL : TAX + LDA.l $7f71c0, X + STA.b $00 + SEP #$30 + + LDY.b #$00 + LDA [$00], Y : CMP.b #$fe : BNE + + INY : LDA [$00], Y : CMP.b #$6e : BNE + + INY : LDA [$00], Y : : BNE + + INY : LDA [$00], Y : CMP.b #$fe : BNE + + INY : LDA [$00], Y : CMP.b #$6b : BNE + + INY : LDA [$00], Y : CMP.b #$04 : BNE + + + BRL .end + + + + STZ $0223 ; Otherwise set it so we are in text mode. + STZ $1CD8 ; Initialize the step in the submodule + + ; Go to text display mode (as opposed to maps, etc) + LDA.b #$02 : STA $11 + + ; Store the current module in the temporary location. + LDA $10 : STA $010C + + ; Switch the main module ($10) to text mode. + LDA.b #$0E : STA $10 + .end + PLA : STA.b $02 + PLA : STA.b $01 + PLA : STA.b $00 + PLY : PLX + +Main_ShowTextMessage_Alt_already_in_text_mode: +RTL + ;-------------------------------------------------------------------------------- ; A0 - A9 - 0 - 9 ; AA - C3 - A - Z diff --git a/events.asm b/events.asm index bd8ad11..cdec734 100644 --- a/events.asm +++ b/events.asm @@ -202,7 +202,7 @@ PostItemAnimation: LDA $7F50A0 : BEQ + STZ $1CF0 : STZ $1CF1 ; reset decompression buffer - JSL.l Main_ShowTextMessage + JSL.l Main_ShowTextMessage_Alt LDA.b #$00 : STA $7F50A0 + diff --git a/hooks.asm b/hooks.asm index e366483..2723cfe 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1591,6 +1591,20 @@ db #$8F ;================================================================================ ; Text Removal ;-------------------------------------------------------------------------------- +org $05FA8E +Sprite_ShowMessageMinimal: +JML.l Sprite_ShowMessageMinimal_Alt +;-------------------------------------------------------------------------------- +org $1CFD69 +Main_ShowTextMessage: +JML.l Main_ShowTextMessage_Alt +;-------------------------------------------------------------------------------- +org $05E21F ; <- 2E21F - Bank05.asm : 2691 (STZ $0223) +JSL.l Sprite_ShowMessageMinimal_Alt +BRA Sprite_ShowMessageUnconditional_Rest +org $05E232 ; <- 2E232 - Bank05.asm : 2700 (PHX) +Sprite_ShowMessageUnconditional_Rest: +;-------------------------------------------------------------------------------- ;-- Music restarting at zelda fix org $05ED10 ; <- 2ED10 - sprite_zelda.asm : 233 - (LDA.b #$19 : STA $012C) NOP #5 @@ -1631,9 +1645,6 @@ org $06B4F3 ; <- 334F3 sprite_smithy_bros.asm : 556 (JSL Sprite_ShowMessageUncon JSL ItemSet_SmithSword ;NOP #4 ;---------------------------------------------------------- -org $05FBC2 ; <- 2FBC3 - sprite_mad_batter.asm:195 - (JSL Sprite_ShowMessageUnconditional) -NOP #4 ; removing this breaks animated received objects like rupees -;---------------------------------------------------------- ;=================================== ;-- Escort Text diff --git a/newitems.asm b/newitems.asm index 0fac0aa..c46ee2a 100755 --- a/newitems.asm +++ b/newitems.asm @@ -173,9 +173,9 @@ RTS ;-------------------------------------------------------------------------------- AddReceivedItemExpandedGetItem: PHX - + ;JSR.w ProcessEventItems : CPX.b #$00 : BEQ ++ - ; ;JSL.l Main_ShowTextMessage + ; ;JSL.l Main_ShowTextMessage_Alt ; LDA !GOAL_COUNTER : INC : STA !GOAL_COUNTER ; LDA.b #$01 : STA $7F50A0 ; BRL .done