diff --git a/dialog.asm b/dialog.asm index 46f09b2..1020dc9 100644 --- a/dialog.asm +++ b/dialog.asm @@ -419,6 +419,29 @@ Sprite_ShowMessageMinimal_Alt: Main_ShowTextMessage_Alt_already_in_text_mode: RTL +CalculateSignIndex: + ; for the big 1024x1024 screens we are calculating link's effective + ; screen area, as though the screen was 4 different 512x512 screens. + ; And we do this in a way that will likely give the right value even + ; with major glitches. + + LDA $8A : ASL A : TAY ;what we wrote over + + LDA $0712 : BEQ .done ; If a small map, we can skip these calculations. + + LDA $21 : AND.w #$0002 : ASL #2 : EOR $8A : AND.w #$0008 : BEQ + + TYA : !ADD.w #$0010 : TAY ;add 16 if we are in lower half of big screen. + + + + LDA $23 : AND.w #$0002 : LSR : EOR $8A : AND.w #$0001 : BEQ + + TYA : INC #2 : TAY ;add 16 if we are in lower half of big screen. + + + ; ensure even if things go horribly wrong, we don't read the sign out of bounds and crash: + TYA : AND.w #$00FF : TAY + +.done +RTL + ;-------------------------------------------------------------------------------- ; A0 - A9 - 0 - 9 ; AA - C3 - A - Z diff --git a/hooks.asm b/hooks.asm index 6c69b5e..31885a4 100755 --- a/hooks.asm +++ b/hooks.asm @@ -1818,6 +1818,9 @@ dw $05AC, $04FC, $0001, $0027, $00F0 ; Zelda in the water room ; org $01CA66 ; <- CA66 Bank01.asm : 10864 - (LDA.w #$2200 : ADD $041C : STA $041C) ; LDA.w #$4400 ; #$2200 is the normal speed, $#FF00 is max. ;---------------------------------------------------------- +;-- New Sign table offet calculation +org $07b4fe ; <- 3b4fe - bank07.asm : 8454 (LDA $8A : ASL A : TAY) +JSL CalculateSignIndex ;================================================================================ ; Ganon Fixes diff --git a/tables.asm b/tables.asm index 437364c..db8ec13 100644 --- a/tables.asm +++ b/tables.asm @@ -530,25 +530,30 @@ Music_GTower: db $16 ;-------------------------------------------------------------------------------- -; OWG EDM bridge sign text pointer (Message id of the map05) +; OWG EDM bridge sign text pointer (Message id of the upper left of map05 = map05) ;-------------------------------------------------------------------------------- org $07F501 dw #$018E ;-------------------------------------------------------------------------------- -; GT sign text pointer (Message id of the map43) +; GT sign text pointer (Message id of the upper right of map43 = map44) ;-------------------------------------------------------------------------------- -org $07F57D +org $07F57F dw #$0190 ;-------------------------------------------------------------------------------- -; Pyramid sign text pointer (Message id of the map5B) +; Pyramid sign text pointer (Message id of the upper left of map5B = map5B) ;-------------------------------------------------------------------------------- org $07F5AD dw #$0191 ;-------------------------------------------------------------------------------- -; HC (inverted) sign text pointer (Message id of the map1B) +; HC (inverted) left sign text pointer (Message id of the upper left of map1B = map1B) ;-------------------------------------------------------------------------------- org $07F52D dw #$0190 +;-------------------------------------------------------------------------------- +; HC (inverted) right sign text pointer (Message id of the upper right of map1B = map1C) +;-------------------------------------------------------------------------------- +org $07F52F +dw #$0191 ;-------------------------------------------------------------------------------- ;Map Pendant / Crystal Indicators