Minor formatting and small optimization

This commit is contained in:
codemann8
2023-05-05 22:11:19 -05:00
parent 48b2238109
commit 9500800c3c
5 changed files with 24 additions and 24 deletions

View File

@@ -63,7 +63,7 @@ RTL
LoadBonkItem:
LDA $A0 ; check room ID - only bonk keys in 2 rooms so we're just checking the lower byte
CMP #115 : BNE + ; Desert Bonk Key
LDA.l BonkKey_Desert
LDA.l BonkKey_Desert
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower
@@ -79,7 +79,7 @@ LoadBonkItem_Player:
LDA.l BonkKey_Desert_Player
BRA ++
+ : CMP #140 : BNE + ; GTower Bonk Key
LDA.l BonkKey_GTower_Player
LDA.l BonkKey_GTower_Player
BRA ++
+
LDA.b #$00

View File

@@ -25,12 +25,12 @@ MarkThrownItem:
LDA $8A : CMP.b #$81 : BNE .catfish
.zora
JSL.l ItemSet_ZoraKing
JSL.l ItemSet_ZoraKing
LDA ZoraItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
BRA .done
.catfish
JSL.l ItemSet_Catfish
JSL.l ItemSet_Catfish
LDA CatfishItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID
.done

View File

@@ -16,7 +16,7 @@ HudAdditions:
+ JSL HexToDec_fast
.skip
LDA #$207F : STA !GOAL_DRAW_ADDRESS+2 : STA !GOAL_DRAW_ADDRESS+4
PLA : PHA : CMP.w #100 : !BLT +
LDA.b 1,S : CMP.w #100 : !BLT +
LDX.b $05 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+2 ; draw 100's digit
+ PLA : CMP.w #10 : !BLT +
LDX.b $06 : TXA : ORA.w #$2490 : STA !GOAL_DRAW_ADDRESS+4 ; draw 10's digit

View File

@@ -433,7 +433,7 @@ HandleSpecialDoorLanding: {
HandleIncomingDoorState:
PHA
LDA.l DRMode : BEQ .noDoor
PLA : PHA : AND.b #$FA : CMP.b #$80 : bne .noDoor
LDA.b 1,S : AND.b #$FA : CMP.b #$80 : bne .noDoor
.setDoorState
LDA.w $0418 : AND.b #$02 : BNE + : INC

View File

@@ -472,21 +472,21 @@ SpriteKeyDrawGFX:
RTL
KeyGet:
LDA CurrentSmallKeys ; what we wrote over
PHA
LDA.l StandingItemsOn : BNE +
PLA : RTL
+ LDY $0E80, X
LDA SprItemIndex, X : STA SpawnedItemIndex
LDA SprItemFlags, X : STA SpawnedItemFlag
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++
LDA CurrentSmallKeys ; what we wrote over
PHA
LDA.l StandingItemsOn : BNE +
PLA : RTL
+ LDY $0E80, X
LDA SprItemIndex, X : STA SpawnedItemIndex
LDA SprItemFlags, X : STA SpawnedItemFlag
LDA $A0 : CMP #$87 : BNE + ;check for hera cage
LDA SpawnedItemFlag : BNE + ; if it came from a pot, it's fine
JSR ShouldKeyBeCountedForDungeon : BCC ++
JSL CountChestKeyLong
++ PLA : RTL
+ STY $00
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
PHX
++ PLA : RTL
+ STY $00
LDA SprItemMWPlayer, X : STA !MULTIWORLD_ITEM_PLAYER_ID : BNE .receive
PHX
LDA $040C : CMP #$FF : BNE +
LDA $00 : CMP.b #$AF : BNE .skip
LDA CurrentGenericKeys : INC : STA CurrentGenericKeys
@@ -499,10 +499,10 @@ KeyGet:
++ PLX : PLA : RTL
+ CMP.b #$AF : beq .countIt ; universal key
CMP.b #$24 : beq .countIt ; small key for this dungeon
.skip PLX
.receive
JSL $0791b3 ; Player_HaltDashAttackLong
JSL.l Link_ReceiveItem
.skip PLX
.receive
JSL $0791b3 ; Player_HaltDashAttackLong
JSL.l Link_ReceiveItem
PLA : DEC : RTL
KeyTable: