Formatting and notation

This commit is contained in:
codemann8
2024-04-10 04:26:17 -05:00
parent 279a0ad030
commit 2367f16179
6 changed files with 36 additions and 37 deletions

View File

@@ -8,15 +8,15 @@ PHP
++ SEP #$20 : LDA.l CurrentWorld : EOR.b #$40 : STA.l CurrentWorld ++ SEP #$20 : LDA.l CurrentWorld : EOR.b #$40 : STA.l CurrentWorld
LDA.l DRFlags+1 : AND.b #$02 : BEQ + ; skip if the flag isn't set LDA.l DRFlags+1 : AND.b #$02 : BEQ + ; skip if the flag isn't set
LDA.l MoonPearlEquipment : BNE + ; moon pearl? LDA.l MoonPearlEquipment : BNE + ; moon pearl?
LDA #$17 : STA.b LinkState : INC.w BunnyFlag LDA.b #$17 : STA.b LinkState : INC.w BunnyFlag
+ PLP : RTL + PLP : RTL
SetDefaultWorld: SetDefaultWorld:
PHP : SEP #$20 PHP : SEP #$20
LDA.l FollowerIndicator : CMP #$04 : BNE .default LDA.l FollowerIndicator : CMP.b #$04 : BNE .default
LDA.l OldManRetrievalWorld : BRA + LDA.l OldManRetrievalWorld : BRA +
.default .default
LDA.l InvertedMode : BEQ + LDA.l InvertedMode : BEQ +
LDA.b #$40 LDA.b #$40
+ STA CurrentWorld + STA.l CurrentWorld
PLP : RTL PLP : RTL

View File

@@ -236,9 +236,9 @@ MirrorBonk:
.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
JML MirrorBonk_NormalReturn JML MirrorBonk_NormalReturn
.forceBonk .forceBonk
JML MirrorBonk_BranchGamma JML MirrorBonk_BranchGamma

View File

@@ -142,9 +142,9 @@ AddReceivedItemExpanded:
STZ.w ItemReceiptID : STZ.w ItemReceiptID+1 : STZ.w ItemReceiptMethod STZ.w ItemReceiptID : STZ.w ItemReceiptID+1 : STZ.w ItemReceiptMethod
PHY : LDY.b #$00 : JSL AddInventory : PLY PHY : LDY.b #$00 : JSL AddInventory : PLY
PLX : PLA : RTL PLX : PLA : RTL
+ PLX : PLA + PLX : PLA
JSR ResolveReceipt JSR ResolveReceipt
PHB : PHK PHB : PHK
JML AddReceivedItem+2 JML AddReceivedItem+2
AddReceivedItemExpandedGetItem: AddReceivedItemExpandedGetItem:

View File

@@ -79,7 +79,7 @@ SpritePrep_ShopKeeper_PotionShop:
LDA.l ShopType : CMP.b #$FF : BNE + LDA.l ShopType : CMP.b #$FF : BNE +
JSL SpritePrep_MagicShopAssistant JSL SpritePrep_MagicShopAssistant
RTL RTL
+ LDX.b #$0 + LDX.b #$00
PHK : PEA.w .jslrtsreturn-1 PHK : PEA.w .jslrtsreturn-1
PEA.w $85f527 ; an rtl address - 1 in Bank05 PEA.w $85f527 ; an rtl address - 1 in Bank05
JML MagicShopAssistant_SpawnPowder JML MagicShopAssistant_SpawnPowder
@@ -128,11 +128,11 @@ SpritePrep_ShopKeeper:
LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l ShopInventory+1, X : PLX LDA.l ShopContentsTable+2, X : PHX : TYX : STA.l ShopInventory+1, X : PLX
LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l ShopInventory+2, X : PLX LDA.l ShopContentsTable+3, X : PHX : TYX : STA.l ShopInventory+2, X : PLX
LDA.l ShopContentsTable+8, X : PHX : PHA : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.l ShopContentsTable+8, X : PHX : PHA : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
PLA : STA.l ShopInventoryPlayer, X : LDA.b #0 : STA.l ShopInventoryDisguise, X : PLX PLA : STA.l ShopInventoryPlayer, X : LDA.b #$00 : STA.l ShopInventoryDisguise, X : PLX
PHY PHY
PHX PHX
LDA.b #0 : XBA : TYA : LSR #2 : !ADD.l ShopSRAMIndex : TAX LDA.b #$00 : XBA : TYA : LSR #2 : !ADD.l ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : TYX : STA.l ShopInventory+3, X : TAY LDA.l PurchaseCounts, X : TYX : STA.l ShopInventory+3, X : TAY
PLX PLX
@@ -143,8 +143,8 @@ SpritePrep_ShopKeeper:
LDA.l ShopContentsTable+6, X : PHX : TYX : STA.l ShopInventory+1, X : PLX LDA.l ShopContentsTable+6, X : PHX : TYX : STA.l ShopInventory+1, X : PLX
LDA.l ShopContentsTable+7, X : PHX : TYX : STA.l ShopInventory+2, X : PLX LDA.l ShopContentsTable+7, X : PHX : TYX : STA.l ShopInventory+2, X : PLX
LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX
PHX : LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) PHX : LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
LDA.b #0 : STA.l ShopInventoryPlayer, X : PLX LDA.b #$00 : STA.l ShopInventoryPlayer, X : PLX
BRA +++ BRA +++
+ : PLY : LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX : BRA +++ + : PLY : LDA.b #$40 : PHX : TYX : STA.l ShopInventory+3, X : PLX : BRA +++
++ ++
@@ -156,7 +156,7 @@ SpritePrep_ShopKeeper:
JSL AttemptItemSubstitution JSL AttemptItemSubstitution
JSL ResolveLootIDLong JSL ResolveLootIDLong
CMP.b #$D0 : BNE + CMP.b #$D0 : BNE +
PHX : LDA.b #0 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode) PHX : LDA.b #$00 : XBA : TYA : LSR #2 : TAX ; This will convert the value back to the slot number (in 8-bit accumulator mode)
JSL GetRandomInt : AND.b #$3F JSL GetRandomInt : AND.b #$3F
BNE ++ : LDA.b #$49 : ++ : CMP.b #$26 : BNE ++ : LDA.b #$6A : ++ ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece BNE ++ : LDA.b #$49 : ++ : CMP.b #$26 : BNE ++ : LDA.b #$6A : ++ ; if 0 (fighter's sword + shield), set to just sword, if filled container (bugged palette), switch to triforce piece
STA.l ShopInventoryDisguise, X : PLX STA.l ShopInventoryDisguise, X : PLX
@@ -457,7 +457,7 @@ Shopkeeper_BuyItem:
REP #$20 : LDA.l CurrentRupees : !SUB.l ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away REP #$20 : LDA.l CurrentRupees : !SUB.l ShopInventory+1, X : STA.l CurrentRupees : SEP #$20 ; Take price away
++ ++
PHX PHX
LDA.b #0 : XBA : TXA : LSR #2 : TAX LDA.b #$00 : XBA : TXA : LSR #2 : TAX
LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.l ShopInventoryPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID
TXA : !ADD.l ShopSRAMIndex : TAX TXA : !ADD.l ShopSRAMIndex : TAX
LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot? LDA.l PurchaseCounts, X : BNE +++ ;Is this the first time buying this slot?
@@ -469,7 +469,7 @@ Shopkeeper_BuyItem:
JSL ResolveLootIDLong JSL ResolveLootIDLong
TAY : JSL Link_ReceiveItem TAY : JSL Link_ReceiveItem
LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X LDA.l ShopInventory+3, X : INC : STA.l ShopInventory+3, X
LDA.b #0 : STA.l ShopEnableCount LDA.b #$00 : STA.l ShopEnableCount
TXA : LSR #2 : TAX TXA : LSR #2 : TAX
LDA.l ShopType : BIT.b #$80 : BNE + LDA.l ShopType : BIT.b #$80 : BNE +
LDA.l ShopkeeperRefill : BNE +++ LDA.l ShopkeeperRefill : BNE +++
@@ -522,6 +522,7 @@ Setup_ShopItemCollisionHitbox:
!ADD.b (Scrap00), Y !ADD.b (Scrap00), Y
!ADD.w #$0002 ; a small negative margin !ADD.w #$0002 ; a small negative margin
; TODO: add 4 for a narrow item
SEP #$20 ; set 8-bit accumulator SEP #$20 ; set 8-bit accumulator
; store hitbox X ; store hitbox X
@@ -636,8 +637,8 @@ Shopkeeper_DrawNextItem:
PLY PLY
STZ.b Scrap0E ; $0E will be used temporarily to store a non-zero value if VRAM slot is in OAM1 STZ.b Scrap0E ; $0E will be used temporarily to store a non-zero value if VRAM slot is in OAM1
PHX : LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryPlayer, X : PLX : CMP.b #$0 : BNE .no_disguise PHX : LDA.b #$00 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryPlayer, X : PLX : CMP.b #$00 : BNE .no_disguise
PHX : LDA.b #0 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$0 : BNE ++ PHX : LDA.b #$00 : XBA : TXA : LSR #2 : TAX : LDA.l ShopInventoryDisguise, X : PLX : CMP.b #$00 : BNE ++
.no_disguise .no_disguise
CPX.b #$0C : BCC .not_powder CPX.b #$0C : BCC .not_powder
LDA.l PowderFlag : BRA .resolve LDA.l PowderFlag : BRA .resolve
@@ -728,9 +729,9 @@ Shopkeeper_DrawNextItem:
LDA.b #$00 : STA.l SpriteOAM+6 LDA.b #$00 : STA.l SpriteOAM+6
LDA.b Scrap0D LDA.b Scrap0D
PHX PHX
TAX TAX
LDA.l SpriteProperties_standing_width,X : BEQ .narrow LDA.l SpriteProperties_standing_width,X : BEQ .narrow
.full .full
PLX PLX
LDA.b #$02 LDA.b #$02

View File

@@ -362,8 +362,6 @@ org $B0808F ; PC 0x18008F
SwapAgaGanonsTower: SwapAgaGanonsTower:
db $00 ; #$00 = Off (default) - #$01 = On db $00 ; #$00 = Off (default) - #$01 = On
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
; 0x18008F (unused)
;--------------------------------------------------------------------------------
org $B08090 ; PC 0x180090 - 0x180097 org $B08090 ; PC 0x180090 - 0x180097
ProgressiveSwordLimit: ProgressiveSwordLimit:
db $04 ; #$04 - 4 Swords (default) db $04 ; #$04 - 4 Swords (default)

View File

@@ -96,19 +96,19 @@ CheckTabletItem:
; Zero flag set = Item not collected ; Zero flag set = Item not collected
; Zero flag clear = Item collected ; Zero flag clear = Item collected
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
JSL IsMedallion : BCS .tablet JSL IsMedallion : BCS .tablet
PHX PHX
LDA.b 5,S : TAX : LDA.w SpriteSpawnStep, X : BEQ .vanilla-1 LDA.b 5,S : TAX : LDA.w SpriteSpawnStep, X : BEQ .vanilla-1
PLX PLX
.bonk_item .bonk_item
LDA.b #$00 LDA.b #$00
RTL RTL
PLX PLX
.vanilla .vanilla
LDA.l OverworldEventDataWRAM, X : AND.b #$40 ; What we wrote over LDA.l OverworldEventDataWRAM, X : AND.b #$40 ; What we wrote over
RTL RTL
.tablet .tablet
TDC TDC
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
SaveTabletItem: SaveTabletItem: