Formatting

This commit is contained in:
codemann8
2024-04-05 21:00:55 -05:00
committed by aerinon
parent a70251d2b2
commit 0339e09b5d
5 changed files with 245 additions and 247 deletions

View File

@@ -64,12 +64,11 @@ GiveBonkItem:
JSR LoadBonkItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID JSR LoadBonkItem_Player : STA.l !MULTIWORLD_ITEM_PLAYER_ID
JSR LoadBonkItem JSR LoadBonkItem
JSR AbsorbKeyCheck : BCC .notKey JSR AbsorbKeyCheck : BCC .notKey
.key
PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key PHY : LDY.b #$24 : JSL AddInventory : PLY ; do inventory processing for a small key
LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys
LDA.b #$2F : JSL Sound_SetSfx3PanLong LDA.b #$2F : JSL Sound_SetSfx3PanLong
INC.w UpdateHUDFlag INC.w UpdateHUDFlag
RTL RTL
.notKey .notKey
PHY : TAY : JSL Link_ReceiveItem : PLY PHY : TAY : JSL Link_ReceiveItem : PLY
RTL RTL
@@ -84,7 +83,7 @@ LoadBonkItem:
BRA ++ BRA ++
+ +
LDA.b #$24 ; default to small key LDA.b #$24 ; default to small key
++ ++
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
LoadBonkItem_Player: LoadBonkItem_Player:
@@ -97,7 +96,7 @@ LoadBonkItem_Player:
BRA ++ BRA ++
+ +
LDA.b #$00 LDA.b #$00
++ ++
RTS RTS
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
AbsorbKeyCheck: AbsorbKeyCheck:

View File

@@ -3,37 +3,39 @@
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartPieceGet: HeartPieceGet:
PHX : PHY PHX : PHY
JSL LoadHeartPieceRoomValue
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
TAY TAY
JSL MaybeMarkDigSpotCollected
.skipLoad .skipLoad
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID
CPY.b #$26 : BNE .not_heart ; don't add a 1/4 heart if it's not a heart piece CPY.b #$26 : BNE .not_heart ; don't add a 1/4 heart if it's not a heart piece
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .not_heart LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .not_heart
LDA.l HeartPieceQuarter : INC A : AND.b #$03 : STA.l HeartPieceQuarter LDA.l HeartPieceQuarter : INC A : AND.b #$03 : STA.l HeartPieceQuarter
.not_heart .not_heart
STZ.w ItemReceiptMethod ; 0 = Receiving item from an NPC or message
JSL MaybeUnlockTabletAnimation
JSL LoadHeartPieceRoomValue
JSL AttemptItemSubstitution
JSL ResolveLootIDLong
JSL MaybeMarkDigSpotCollected
JSL Player_HaltDashAttackLong JSL Player_HaltDashAttackLong
STZ.w ItemReceiptMethod ; 0 = Receiving item from an NPC or message
JSL Link_ReceiveItem JSL Link_ReceiveItem
JSL MaybeUnlockTabletAnimation
PLY : PLX PLY : PLX
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartContainerGet: HeartContainerGet:
PHX : PHY PHX : PHY
JSL IncrementBossSword
LDY.w SpriteID, X : BNE + LDY.w SpriteID, X : BNE +
JSL LoadHeartContainerRoomValue : TAY
+ +
BRA HeartPieceGet_skipLoad BRA HeartPieceGet_skipLoad
JSL IncrementBossSword
JSL LoadHeartContainerRoomValue : TAY
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawHeartPieceGFX: DrawHeartPieceGFX:
PHP PHP
JSL Sprite_IsOnscreen : BCC .offscreen
PHA : PHY PHA : PHY
LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready
JSL HeartPieceSpritePrep
JMP .done ; don't draw on the init frame JMP .done ; don't draw on the init frame
.skipInit .skipInit
LDA.w SpriteID, X ; Retrieve stored item type LDA.w SpriteID, X ; Retrieve stored item type
@@ -44,23 +46,21 @@ DrawHeartPieceGFX:
PLX PLX
LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X
PLA PLA
JSL DrawDynamicTile
LDA.b Scrap00 LDA.b Scrap00
CLC : ADC.b #$04 CLC : ADC.b #$04
STA.b Scrap00 STA.b Scrap00
JSL Sprite_DrawShadowLong
BRA .done BRA .done
+ +
PLX PLX
PLA PLA
JSL DrawDynamicTile
JSL Sprite_DrawShadowLong
.done .done
PLY : PLA PLY : PLA
.offscreen .offscreen
PLP PLP
JSL Sprite_IsOnscreen : BCC .offscreen
JSL HeartPieceSpritePrep
JSL DrawDynamicTile
JSL Sprite_DrawShadowLong
JSL DrawDynamicTile
JSL Sprite_DrawShadowLong
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawHeartContainerGFX: DrawHeartContainerGFX:
@@ -80,20 +80,20 @@ DrawHeartContainerGFX:
HeartContainerSound: HeartContainerSound:
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE +
LDA.w ItemReceiptMethod : CMP.b #$03 : BEQ + LDA.w ItemReceiptMethod : CMP.b #$03 : BEQ +
JSL CheckIfBossRoom : BCC + ; Skip if not in a boss room
LDA.b #$2E LDA.b #$2E
SEC SEC
RTL RTL
+ +
CLC CLC
JSL CheckIfBossRoom : BCC + ; Skip if not in a boss room
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
NormalItemSkipSound: NormalItemSkipSound:
; Out: c - skip sounds if set ; Out: c - skip sounds if set
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
JSL.l CheckIfBossRoom : BCS .boss_room JSL CheckIfBossRoom : BCS .boss_room
TDC TDC
CPY #$17 : BEQ .skip CPY.b #$17 : BEQ .skip
CLC CLC
RTL RTL
.boss_room .boss_room
@@ -117,10 +117,10 @@ HeartPieceSpritePrep:
LDA.b #$00 : STA.l RedrawFlag LDA.b #$00 : STA.l RedrawFlag
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
STA.w SpriteID, X
JSL LoadHeartPieceRoomValue JSL LoadHeartPieceRoomValue
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
STA.w SpriteID, X
JSL PrepDynamicTile_loot_resolved JSL PrepDynamicTile_loot_resolved
.skip .skip
@@ -132,10 +132,10 @@ HeartContainerSpritePrep:
LDA.b #$00 : STA.l RedrawFlag LDA.b #$00 : STA.l RedrawFlag
JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID JSL HeartPieceGetPlayer : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
STA.w SpriteID, X
JSL LoadHeartContainerRoomValue ; load item type JSL LoadHeartContainerRoomValue ; load item type
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
STA.w SpriteID, X
JSL PrepDynamicTile_loot_resolved JSL PrepDynamicTile_loot_resolved
PLA PLA
@@ -144,31 +144,30 @@ RTL
LoadHeartPieceRoomValue: LoadHeartPieceRoomValue:
LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors LDA.b IndoorsFlag : BEQ .outdoors ; check if we're indoors or outdoors
.indoors .indoors
JSL LoadIndoorValue
JMP .done JMP .done
.outdoors .outdoors
.done
JSL LoadIndoorValue
JSL LoadOutdoorValue JSL LoadOutdoorValue
.done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HPItemReset: HPItemReset:
PHA PHA
LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .skip
PLA PLA
JSL GiveRupeeGift ; thing we wrote over
BRA .done BRA .done
.skip .skip
PLA PLA
.done .done
PHA : LDA.b #$01 : STA.l RedrawFlag : PLA PHA : LDA.b #$01 : STA.l RedrawFlag : PLA
JSL GiveRupeeGift ; thing we wrote over
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
MaybeMarkDigSpotCollected: MaybeMarkDigSpotCollected:
PHA : PHP PHA : PHP
LDA.b IndoorsFlag : BNE + LDA.b IndoorsFlag : BNE +
REP #$20 ; set 16-bit accumulator REP #$20 ; set 16-bit accumulator
LDA.b OverworldIndex LDA.b OverworldIndex : CMP.w #$002A : BNE +
CMP.w #$2A : BNE +
LDA.l HasGroveItem : ORA.w #$0001 : STA.l HasGroveItem LDA.l HasGroveItem : ORA.w #$0001 : STA.l HasGroveItem
+ +
PLP : PLA PLP : PLA

View File

@@ -223,16 +223,16 @@ MirrorBonk:
PLB : PLP : PLX PLB : PLP : PLX
BRA .forceBonk BRA .forceBonk
++ ++
TXA : !ADD.w #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
TAX TAX
BRA .loop BRA .loop
.endbonkRectanglesTable .endbonkRectanglesTable
.endLoop .endLoop
PLB : PLP : PLX PLB : PLP : PLX
.normal .normal
;Not forcing a bonk, so the vanilla bonk detection run. ;Not forcing a bonk, so the vanilla bonk detection run.
LDA.b Scrap0C : ORA.b Scrap0E LDA.b Scrap0C : ORA.b Scrap0E
TXA : !ADD.w #$0008 : CMP.w #.tableEnd-.bonkRectanglesTable : BEQ .endLoop
JML MirrorBonk_NormalReturn JML MirrorBonk_NormalReturn
.forceBonk .forceBonk
JML MirrorBonk_BranchGamma JML MirrorBonk_BranchGamma