From e92aa018e3796651aaf2405540191db7bd8a8091 Mon Sep 17 00:00:00 2001 From: Kara Alexandra Date: Mon, 17 Mar 2025 19:02:02 -0500 Subject: [PATCH] Multiworld junk item shortening --- bugfixes.asm | 66 +++++++++++++++++++++++++++++++++++++++++++++++---- inventory.asm | 25 ++++++++++++++++--- newhud.asm | 6 +++++ tables.asm | 6 ++++- 4 files changed, 94 insertions(+), 9 deletions(-) diff --git a/bugfixes.asm b/bugfixes.asm index fca00aa..15038d8 100644 --- a/bugfixes.asm +++ b/bugfixes.asm @@ -267,9 +267,65 @@ ParadoxCaveGfxFix: BRA .uploadLine ;-------------------------------------------------------------------------------- SetItemRiseTimer: - LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest - LDA.b #$38 : STA.w AncillaTimer, X - RTL - .not_from_chest - TYA : STA.w AncillaTimer, X ; What we wrote over + LDA.w ItemReceiptMethod : CMP.b #$01 : BNE .not_from_chest + LDA.b #$38 : STA.w AncillaTimer, X + RTL + + .not_from_chest + LDA.l MultiworldJunkItemTimer : BEQ .default + LDA.l !MULTIWORLD_ITEM_PLAYER_ID : BNE .multiworld + LDA.l !MULTIWORLD_RECEIVING_ITEM : BNE .multiworld + BRA .default + + .multiworld + LDA.l !MULTIWORLD_ITEM_ID + JSL.l ItemIsJunk + BEQ .default + + .junk + LDA.l MultiworldJunkItemTimer : STA.w AncillaTimer, X + RTL + + .default + TYA : STA.w AncillaTimer, X ; What we wrote over + RTL +;-------------------------------------------------------------------------------- +ItemIsJunk: + PHX + LDX.b #JunkItems_end-JunkItems-1 + - + CMP.l JunkItems, X : BEQ .junk + DEX : BPL - + PLX + LDA.b #$00 + RTL +.junk + PLX + LDA.b #$01 + RTL RTL + +JunkItems: + db $27 ; Bomb + db $28 ; 3 bombs + db $31 ; 10 bombs + db $34 ; 1 rupee + db $35 ; 5 rupees + db $36 ; 20 rupees + db $40 ; 100 rupees + db $41 ; 50 rupees + db $42 ; Heart + db $43 ; Arrow + db $44 ; 10 arrows + db $45 ; Small magic + db $46 ; 300 rupees + db $47 ; 20 rupees green + db $59 ; Rupoor + db $D1 ; Apples + db $D2 ; Fairy + db $D3 ; Chicken + db $D4 ; Big Magic + db $D5 ; 5 Arrows + db $D6 ; Good Bee +.end +;-------------------------------------------------------------------------------- diff --git a/inventory.asm b/inventory.asm index 003dfe2..e34f440 100644 --- a/inventory.asm +++ b/inventory.asm @@ -806,10 +806,19 @@ RTL ; A = item id being collected ItemGetAlternateSFX: PEA.w $C567 ; SNES to RTS to in bank 08 -LDA.w AncillaGet,X : CMP.b #$4A : BNE + +LDA.w AncillaGet, X : CMP.b #$4A : BNE + ; collecting pre-activated flute LDA.b #$13 : JML Ancilla_SFX2_Near -+ ; normal itemget sfx ++ ; not pre-activated flute + LDA.l !MULTIWORLD_RECEIVING_ITEM : BEQ .normal + LDA.l MultiworldJunkItemTimer : BEQ .normal + LDA.w AncillaGet, X + JSL.l ItemIsJunk : BEQ .normal + +.multijunk +LDA.b #$3B : JML Ancilla_SFX3_Near ; what we wrote over + +.normal LDA.b #$0F : JML Ancilla_SFX3_Near ; what we wrote over ; A = item id being collected @@ -818,6 +827,16 @@ CPY.b #$4A : BNE + JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$13 : STA.w SFX2 RTL + ; normal itemget sfx + LDA.l !MULTIWORLD_RECEIVING_ITEM : BEQ .normal + LDA.l MultiworldJunkItemTimer : BEQ .normal + TYA + JSL.l ItemIsJunk : BEQ .normal + +.multijunk +JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$3B : STA.w SFX3 +RTL + +.normal JSL Sound_SetSfxPanWithPlayerCoords : ORA.b #$0F : STA.w SFX3 ; what we wrote over RTL -;-------------------------------------------------------------------------------- \ No newline at end of file +;-------------------------------------------------------------------------------- diff --git a/newhud.asm b/newhud.asm index 84a726e..fd703eb 100644 --- a/newhud.asm +++ b/newhud.asm @@ -23,8 +23,14 @@ NewHUD_DrawBombs: BRA .draw .finite + LDA.w BombCapacity : BEQ .no_bomb_bag LDA.w BombsEquipment JSR HUDHex2Digit + BRA .draw + +.no_bomb_bag + LDY.w #!BlankTile + TYX .draw STY.w HUDBombCount+0 diff --git a/tables.asm b/tables.asm index 664b5d6..f542050 100644 --- a/tables.asm +++ b/tables.asm @@ -426,7 +426,11 @@ db $00 ; #$00 = Original Behavior (default) - #$01 = Mimics move when link dashe CrystalSwitchBook: db $00 ; #$00 = Original Behavior (default) - #$01 = Book can flip crystal switch ;-------------------------------------------------------------------------------- -; 0x1800A7 - 0x1800AF (unused) +; 0x1800A7 - 0x1800AE (unused) +;-------------------------------------------------------------------------------- +org $B080AF ; PC 0x1800AF +MultiworldJunkItemTimer: +db $00 ; number of frames to show junk items in a multiworld (#$00 = no change) ;-------------------------------------------------------------------------------- org $B080B0 ; 0x1800B0-0x1800BF StaticDecryptionKey: