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
This commit is contained in:
cassidoxa
2022-11-05 00:50:25 -04:00
parent cafb0908a0
commit 43f753b517
72 changed files with 7706 additions and 7305 deletions

View File

@@ -3,69 +3,56 @@
;--------------------------------------------------------------------------------
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 $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 CurrentHealth ; thing we wrote over
LDA.l CurrentHealth ; thing we wrote over
RTL
;--------------------------------------------------------------------------------
IgnoreFairyCheck:
LDX.b #$00 ; thing we wrote over
LDA IgnoreFaeries : BIT.b #$04 : BEQ .normal
LDA.l IgnoreFaeries : BIT.b #$04 : BEQ .normal
AND.b #$FB : STA IgnoreFaeries ; clear ignore fairy flag
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
;--------------------------------------------------------------------------------
;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
LDA.b #$00 : STA.l $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
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 #$00 : STA $7F5001 ; mark fake flipper softlock as impossible
LDA.b #$00 : STA.l $7F5001 ; mark fake flipper softlock as impossible
.done
RTL
;--------------------------------------------------------------------------------
RegisterWaterEntryScreen:
PHA
LDA $8A : STA $7F5098 ; store ow index
LDA.b $8A : STA.l $7F5098 ; store ow index
PLA
RTL
;--------------------------------------------------------------------------------
MysteryWaterFunction: ; *$3AE54 ALTERNATE ENTRY POINT
LDA.b #$20 : STA $02E2
STZ $037B
STZ $55
STZ $0360
STZ.w $037B
STZ.b $55
STZ.w $0360
RTL
;--------------------------------------------------------------------------------
@@ -88,11 +75,11 @@ protectff:
ASL
ASL
ASL
STA.b $06
STA.b Scrap06
LDA.b $22
AND.w #$1E00
ORA.b $06
ORA.b Scrap06
XBA
LSR