Merge remote-tracking branch 'baserom/master' into MergeDecompression

# Conflicts:
#	goalitem.asm
#	inventory.asm
#	invertedmaps.asm
#	newhud.asm
#	pendantcrystalhud.asm

Also some bugfixes here and there
This commit is contained in:
aerinon
2023-08-24 16:16:31 -06:00
22 changed files with 955 additions and 809 deletions

View File

@@ -10,10 +10,9 @@ ProcessMenuButtons:
BIT.b #$20 : BNE .sel_pressed ; check for P1 Select button
LDA.b Joy1A_All : BIT.b #$20 : BNE .sel_held
.sel_unheld
LDA.l HudFlag : AND.b #$20 : BEQ +
LDA.l HudFlag : AND.b #$DF : STA.l HudFlag ; select is released, unset hud flag
LDA.b IndoorsFlag : BEQ + ; skip if outdoors
LDA.b #$20 : STA.w SFX3 ; menu select sound
LDA.l HudFlag : AND.b #$60 : BEQ +
LDA.b #$00 : STA.l HudFlag
JSL.l MaybePlaySelectSFX
+
JSL.l ResetEquipment
+
@@ -21,8 +20,14 @@ ProcessMenuButtons:
CLC ; no buttons
RTL
.sel_pressed
LDA.l HudFlag : ORA.b #$20 : STA.l HudFlag ; set hud flag
LDA.b #$20 : STA.w SFX3 ; menu select sound
LDA.l HUDDungeonItems : BIT.b #$0C : BNE +
LDA.b #$40
BRA .store_flag
+
LDA.b #$60
.store_flag
STA.l HudFlag
JSL.l MaybePlaySelectSFX
JSL.l ResetEquipment
RTL
.y_pressed ; Note: used as entry point by quickswap code. Must preserve X.
@@ -173,6 +178,7 @@ AddInventory:
RTL
ShopCheck:
; TODO: If we write all shops, we can use the ShopPurchase flag instead of this
LDA.b IndoorsFlag : BEQ .count
LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .count
LDA.w InventoryTable_properties,Y : BIT.b #$02 : BNE .count
@@ -274,8 +280,8 @@ IncrementByOne:
TYA : ASL : TAX
LDA.w InventoryTable_stat,X : BEQ .skip
STA.b Scrap0B
SEP #$20
LDA.b #$01 : ADC.b [Scrap0B] : STA.b [Scrap0B]
SEP #$21
LDA.b #$00 : ADC.b [Scrap0B] : STA.b [Scrap0B]
.skip
SEP #$20
RTS
@@ -761,6 +767,18 @@ RTL
}
;--------------------------------------------------------------------------------
MaybePlaySelectSFX:
LDA.w DungeonID : BMI .not_dungeon
.play
LDA.b #$20 : STA.w SFX3 ; menu select sound
RTL
.not_dungeon
LDA.l HUDDungeonItems : BIT.b #$13 : BEQ .dont_play
BIT.b #$0C : BEQ .dont_play
BRA .play
.dont_play
RTL
;--------------------------------------------------------------------------------
; A = item id being collected
ItemGetAlternateSFX:
PEA.w $C567 ; SNES to RTS to in bank 08