Merged in DR v1.4.1.6
This commit is contained in:
124
flipperkill.asm
124
flipperkill.asm
@@ -1,78 +1,14 @@
|
||||
;================================================================================
|
||||
; Fake Flippers Softlock Fix
|
||||
;--------------------------------------------------------------------------------
|
||||
FlipperKill:
|
||||
PHP
|
||||
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
|
||||
LDA FlippersEquipment : 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 IgnoreFaeries : ORA.b #$04 : STA IgnoreFaeries
|
||||
LDA.b #$00 : STA CurrentHealth ; kill link
|
||||
LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
|
||||
.done
|
||||
PLP
|
||||
LDA CurrentHealth ; thing we wrote over
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
IgnoreFairyCheck:
|
||||
LDX.b #$00 ; thing we wrote over
|
||||
LDA IgnoreFaeries : BIT.b #$04 : BEQ .normal
|
||||
|
||||
AND.b #$FB : STA IgnoreFaeries ; clear ignore fairy flag
|
||||
LDA.b #$F0 ; set check to invalid entry
|
||||
RTL
|
||||
.normal
|
||||
LDA.b #$06 ; set check to fairy
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
;KillFairies:
|
||||
; LDA BottleContentsOne : CMP #$06 : BNE +
|
||||
; LDA #$02 : STA BottleContentsOne
|
||||
; + LDA BottleContentsTwo : CMP #$06 : BNE +
|
||||
; LDA #$02 : STA BottleContentsTwo
|
||||
; + LDA BottleContentsThree : CMP #$06 : BNE +
|
||||
; LDA #$02 : STA BottleContentsThree
|
||||
; + LDA BottleContentsFour : CMP #$06 : BNE +
|
||||
; LDA #$02 : STA BottleContentsFour
|
||||
; +
|
||||
;RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
FlipperReset:
|
||||
JSL $0998E8 ; AddTransitionSplash
|
||||
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
|
||||
.done
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
FlipperFlag:
|
||||
LDA $5D : CMP #$04 : BNE .done ; skip if we're not swimming
|
||||
LDA FlippersEquipment : BNE .safe ; skip if we have the flippers
|
||||
LDA #$01 : STA $7F5001 ; mark fake flipper softlock as possible
|
||||
BRA .done
|
||||
.safe
|
||||
LDA #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
|
||||
.done
|
||||
RTL
|
||||
;--------------------------------------------------------------------------------
|
||||
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
|
||||
;--------------------------------------------------------------------------------
|
||||
|
||||
|
||||
;===================================================================================================
|
||||
; More elegant solution
|
||||
;===================================================================================================
|
||||
; Written over and used by OnEnterWater hook.
|
||||
; UnequipCapeQuiet:
|
||||
; LDA.b #$20 : STA.w PoofTimer
|
||||
; STZ.w NoDamage
|
||||
; STZ.b CapeOn
|
||||
; STZ.w LinkZap
|
||||
; RTL
|
||||
|
||||
protectff:
|
||||
LDA.l AllowAccidentalMajorGlitch
|
||||
@@ -83,16 +19,16 @@ protectff:
|
||||
.yes_protect
|
||||
REP #$30
|
||||
|
||||
LDA.b $20
|
||||
LDA.b LinkPosY
|
||||
AND.w #$1E00
|
||||
ASL
|
||||
ASL
|
||||
ASL
|
||||
STA.b $06
|
||||
STA.b Scrap06
|
||||
|
||||
LDA.b $22
|
||||
LDA.b LinkPosX
|
||||
AND.w #$1E00
|
||||
ORA.b $06
|
||||
ORA.b Scrap06
|
||||
|
||||
XBA
|
||||
LSR
|
||||
@@ -103,26 +39,26 @@ protectff:
|
||||
; Remove dark world bit
|
||||
; in game table that converts coordinates to actual screen ID
|
||||
; special case for other areas
|
||||
LDA.b $8A
|
||||
LDA.b OverworldIndex
|
||||
BMI .special_overworld
|
||||
|
||||
AND.b #$3F
|
||||
CMP.l $02A4E3,X
|
||||
CMP.l Overworld_ActualScreenID,X
|
||||
BEQ ++
|
||||
|
||||
.protect
|
||||
LDA.b #$15
|
||||
STA.b $5D
|
||||
STA.b LinkState
|
||||
|
||||
STZ.b $2E
|
||||
STZ.b $67
|
||||
STZ.b LinkAnimationStep
|
||||
STZ.b LinkWalkDirection
|
||||
|
||||
LDA.b #$02
|
||||
STA.b $2F
|
||||
STA.b LinkDirection
|
||||
|
||||
STZ.w $0112
|
||||
STZ.w $02E4
|
||||
STZ.w $0FFC
|
||||
STZ.w MedallionFlag
|
||||
STZ.w CutsceneFlag
|
||||
STZ.w NoMenu
|
||||
|
||||
++ RTL
|
||||
|
||||
@@ -137,18 +73,18 @@ protectff:
|
||||
db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF
|
||||
|
||||
FlipperScrollWarp:
|
||||
STZ $00 : STZ $02 ; what we wrote over
|
||||
LDA $308358 : BEQ .checkX : RTL
|
||||
STZ.b Scrap00 : STZ.b Scrap02 ; what we wrote over
|
||||
LDA.l AllowAccidentalMajorGlitch : BEQ .checkX : RTL
|
||||
.checkX
|
||||
LDA $22 : CMP.w $0604 : BCC +
|
||||
CMP.w $0616 : BCS +
|
||||
LDA.b LinkPosX : CMP.w $0604 : BCC +
|
||||
CMP.w CameraTargetE : BCS +
|
||||
BRA .checkY
|
||||
+ LDA $7EC186
|
||||
STA $22
|
||||
+ LDA.l $7EC186
|
||||
STA.b LinkPosX
|
||||
.checkY
|
||||
LDA $20 : CMP.w $0600 : BCC +
|
||||
CMP.w $0612 : BCS +
|
||||
LDA.b LinkPosY : CMP.w $0600 : BCC +
|
||||
CMP.w CameraTargetS : BCS +
|
||||
RTL
|
||||
+ LDA $7EC184
|
||||
STA $20
|
||||
+ LDA.l $7EC184
|
||||
STA.b LinkPosY
|
||||
RTL
|
||||
|
||||
Reference in New Issue
Block a user