Randomize Special Transitions

This commit is contained in:
codemann8
2022-05-04 16:48:55 -05:00
parent 46dfb2f036
commit 1eefa5dbde

View File

@@ -13,16 +13,17 @@ org $02a929
OWDetectTransitionReturn: OWDetectTransitionReturn:
org $02a939 org $02a939
OverworldHandleTransitions_SpecialTrigger:
JSL OWDetectEdgeTransition JSL OWDetectEdgeTransition
BCS OWDetectTransitionReturn BCS OWDetectTransitionReturn
org $02a999
jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA
org $04e8ae org $04e8ae
JSL OWDetectSpecialTransition JSL OWDetectSpecialTransition
RTL : NOP RTL : NOP
org $02a999
jsl OWEdgeTransition : nop #4 ;LDA $02A4E3,X : ORA $7EF3CA
org $02e809 org $02e809
JSL OWSpecialExit JSL OWSpecialExit
@@ -32,6 +33,12 @@ JSL OWAdjustExitPosition
org $02c1a9 org $02c1a9
JSL OWEndScrollTransition JSL OWEndScrollTransition
org $04E881
Overworld_LoadSpecialOverworld_RoomId:
org $04E8B4
Overworld_LoadSpecialOverworld:
org $05af75 org $05af75
jsl OWPreserveMirrorSprite : nop #2 ; LDA $7EF3CA : BNE $05AFDF jsl OWPreserveMirrorSprite : nop #2 ; LDA $7EF3CA : BNE $05AFDF
@@ -355,7 +362,7 @@ OWDetectSpecialTransition:
STA.w $06FA STA.w $06FA
LDA.l OWEdgeDataOffset,X : STA.w $06F8 LDA.l OWEdgeDataOffset,X : STA.w $06F8
PLA : SEP #$30 : PLA ; delete 3 bytes from stack PLA : SEP #$30 : PLA ; delete 3 bytes from stack
JSL $07F413 : BCS .return ; Link_CheckForEdgeScreenTransition JSL Link_CheckForEdgeScreenTransition : BCS .return ; Link_CheckForEdgeScreenTransition
LDA.l $04E879,X : STA.b $00 : CMP.b #$08 : BNE .hobo LDA.l $04E879,X : STA.b $00 : CMP.b #$08 : BNE .hobo
LSR : STA.b $20 : STZ.b $E8 ; move Link and camera to edge LSR : STA.b $20 : STZ.b $E8 ; move Link and camera to edge
LDA.b #$06 : STA.b $02 LDA.b #$06 : STA.b $02
@@ -368,7 +375,7 @@ OWDetectSpecialTransition:
.continue .continue
STZ.b $03 STZ.b $03
; copied from DeleteCertainAncillaeStopDashing at $028A0E ; copied from DeleteCertainAncillaeStopDashing at $028A0E
JSL $09AC57 ; Ancilla_TerminateSelectInteractives JSL Ancilla_TerminateSelectInteractives
LDA.w $0372 : BEQ .not_dashing LDA.w $0372 : BEQ .not_dashing
STZ.b $4D : STZ.b $46 STZ.b $4D : STZ.b $46
LDA.b #$FF : STA.b $29 : STA.b $C7 LDA.b #$FF : STA.b $29 : STA.b $C7
@@ -377,7 +384,7 @@ OWDetectSpecialTransition:
PLA : REP #$31 : PLA ; delete 3 bytes from stack PLA : REP #$31 : PLA ; delete 3 bytes from stack
LDX.b $02 LDX.b $02
LDA.b $84 LDA.b $84
JML $02A93F JML OverworldHandleTransitions_SpecialTrigger+6
.special .special
AND.w #$0003 : TAY : ASL : TAX AND.w #$0003 : TAY : ASL : TAX
.normal .normal
@@ -411,13 +418,7 @@ OWSpecialExit:
} }
OWShuffle: OWShuffle:
{ {
;Assume you're at links house = $2c ;determine direction of edge transition
;transitioning right will result in X = $2d
;transitioning left will result in X = $2b
;up X = $24
;down X = $34
;compares X to determine direction of edge transition
phx : lsr.w $0700 phx : lsr.w $0700
tyx : lda.l OWTransitionDirection,X : sta.w $0418 tyx : lda.l OWTransitionDirection,X : sta.w $0418
@@ -585,8 +586,8 @@ OWNewDestination:
} }
OWLoadSpecialArea: OWLoadSpecialArea:
{ {
LDA.l $04E881,X : STA.b $A0 LDA.l Overworld_LoadSpecialOverworld_RoomId,X : STA.b $A0
JSL $04E8B4 JSL Overworld_LoadSpecialOverworld
LDA.l OWMode+1 : AND.b #!FLAG_OW_CROSSED : BEQ .return LDA.l OWMode+1 : AND.b #!FLAG_OW_CROSSED : BEQ .return
TYX : LDA.l OWSpecialDestSlot,X : TAX TYX : LDA.l OWSpecialDestSlot,X : TAX
JSR OWWorldUpdate JSR OWWorldUpdate