Files
alttpr-baserom/flipperkill.asm
cassidoxa 43f753b517 ram.asm initial commit. Replaced all address defines with labels
Value defines styled without quotes, # moved to load/store/cmp site
Added registers.asm (copied from spannerisms JP disassembly)
Added a bunch of length annotations
Deleted old or trivial commented out code
Deleted: ganonfixes.asm, map.asm, seedtag.asm
Replaced obsolete credits.asm with creditsnew.asm
Moved scratch space at $7F5020-3F to mirrored WRAM (7E1E70-8F)
Moved clock RAM to mirrored WRAM (7E1E90-9F)
dialog.asm: FreeDungeonItemNotice preserves callee-preserved scratch RAM
Toast buffer moved to mirrored WRAM (7E1E0E-0F)
servicerequest.asm: long store to $012E converted to word length store
2022-11-05 00:50:25 -04:00

125 lines
3.0 KiB
NASM

;================================================================================
; Fake Flippers Softlock Fix
;--------------------------------------------------------------------------------
FlipperKill:
PHP
LDA.b $5D : CMP.b #$04 : BNE .done ; skip if we're not swimming
LDA.l FlippersEquipment : BNE .done ; skip if we have the flippers
LDA.l $7F5001 : BEQ .done ; skip if we're not marked in danger for softlock
LDA.b $8A : CMP.l $7F5098 : BEQ .done ; skip if we're on the same screen we entered the water on
LDA.l IgnoreFaeries : ORA.b #$04 : STA.l IgnoreFaeries
LDA.b #$00 : STA CurrentHealth ; kill link
LDA.b #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
.done
PLP
LDA.l CurrentHealth ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
IgnoreFairyCheck:
LDX.b #$00 ; thing we wrote over
LDA.l IgnoreFaeries : BIT.b #$04 : BEQ .normal
AND.b #$FB : STA.l IgnoreFaeries ; clear ignore fairy flag
LDA.b #$F0 ; set check to invalid entry
RTL
.normal
LDA.b #$06 ; set check to fairy
RTL
;--------------------------------------------------------------------------------
FlipperReset:
JSL $0998E8 ; AddTransitionSplash
LDA.b #$00 : STA.l $7F5001 ; mark fake flipper softlock as impossible
.done
RTL
;--------------------------------------------------------------------------------
FlipperFlag:
LDA.b $5D : CMP.b #$04 : BNE .done ; skip if we're not swimming
LDA.l FlippersEquipment : BNE .safe ; skip if we have the flippers
LDA.b #$01 : STA.l $7F5001 ; mark fake flipper softlock as possible
BRA .done
.safe
LDA.b #$00 : STA.l $7F5001 ; mark fake flipper softlock as impossible
.done
RTL
;--------------------------------------------------------------------------------
RegisterWaterEntryScreen:
PHA
LDA.b $8A : STA.l $7F5098 ; store ow index
PLA
RTL
;--------------------------------------------------------------------------------
MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT
LDA.b #$20 : STA $02E2
STZ.w $037B
STZ.b $55
STZ.w $0360
RTL
;--------------------------------------------------------------------------------
;===================================================================================================
; More elegant solution
;===================================================================================================
protectff:
LDA.l AllowAccidentalMajorGlitch
BEQ .yes_protect
RTL
.yes_protect
REP #$30
LDA.b $20
AND.w #$1E00
ASL
ASL
ASL
STA.b Scrap06
LDA.b $22
AND.w #$1E00
ORA.b Scrap06
XBA
LSR
TAX
SEP #$30
; Remove dark world bit
; in game table that converts coordinates to actual screen ID
; special case for other areas
LDA.b $8A
BMI .special_overworld
AND.b #$3F
CMP.l $02A4E3,X
BEQ ++
.protect
LDA.b #$15
STA.b $5D
STZ.b $2E
STZ.b $67
LDA.b #$02
STA.b $2F
STZ.w $0112
STZ.w $02E4
STZ.w $0FFC
++ RTL
.special_overworld
CMP.l .spow,X
BNE .protect
RTL
.spow
db $80, $81, $81, $FF, $FF, $FF, $FF, $FF
db $FF, $81, $81, $FF, $FF, $FF, $FF, $FF