Heart pieces and containers shielding, fix some GFX (swords)

This commit is contained in:
2026-02-05 22:10:53 -06:00
parent f6c0de88fb
commit 381868c3ce
7 changed files with 75 additions and 31 deletions

View File

@@ -88,6 +88,7 @@ RTL
PrizeReceiveItem: PrizeReceiveItem:
PHA PHA
LDA.b #$00 : STA.l BossDropTouched
JSL BossPrizeGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID JSL BossPrizeGetPlayer : STA.l !MULTIWORLD_ITEM_PLAYER_ID
PLA PLA
CMP.b #$6A : BNE + CMP.b #$6A : BNE +
@@ -105,7 +106,7 @@ RTL
SetItemPose: SetItemPose:
PHA PHA
LDA.w DungeonID : BMI .one_handed LDA.w DungeonID : BMI .one_handed
LDA.w RoomItemsTaken : BIT.b #$80 : BNE + JSL CheckBossDropTouched : BNE +
.one_handed .one_handed
PLA PLA
JML Link_ReceiveItem_not_cool_pose JML Link_ReceiveItem_not_cool_pose
@@ -134,7 +135,7 @@ SetCutsceneFlag:
PHX PHX
LDY.b #$01 ; wrote over LDY.b #$01 ; wrote over
LDA.w DungeonID : BMI .no_cutscene LDA.w DungeonID : BMI .no_cutscene
LDA.w RoomItemsTaken : BIT.b #$80 : BNE .dungeon_prize JSL CheckBossDropTouched : BNE .dungeon_prize
.no_cutscene .no_cutscene
SEP #$30 SEP #$30
PLX PLX
@@ -155,7 +156,7 @@ AnimatePrizeCutscene:
LDA.w ItemReceiptMethod : CMP.b #$03 : BNE + LDA.w ItemReceiptMethod : CMP.b #$03 : BNE +
JSR CrystalOrPendantBehavior : BCC + JSR CrystalOrPendantBehavior : BCC +
LDA.w DungeonID : BMI + LDA.w DungeonID : BMI +
LDA.w RoomItemsTaken : BIT.b #$80 : BEQ + JSL CheckBossDropTouched : BEQ +
SEC SEC
RTL RTL
+ +
@@ -172,13 +173,13 @@ PrizeDropSparkle:
RTL RTL
HandleDropSFX: HandleDropSFX:
LDA.w RoomItemsTaken : BIT.b #$80 : BEQ .no_sound JSL CheckBossDropTouched : BEQ .no_sound
JSR CrystalOrPendantBehavior : BCC .no_sound JSR CrystalOrPendantBehavior : BCC .no_sound
SEC SEC
RTL RTL
.no_sound .no_sound
CLC CLC
RTL RTL
HandleCrystalsField: HandleCrystalsField:
TAX TAX
@@ -192,7 +193,7 @@ RTL
MaybeKeepLootID: MaybeKeepLootID:
PHA PHA
LDA.w DungeonID : BMI .no_prize LDA.w DungeonID : BMI .no_prize
LDA.w RoomItemsTaken : BIT.b #$80 : BNE .prize JSL CheckBossDropTouched : BNE .prize
.no_prize .no_prize
STZ.w ItemReceiptID STZ.w ItemReceiptID
STZ.w ItemReceiptPose STZ.w ItemReceiptPose
@@ -216,6 +217,15 @@ CheckSpawnPrize:
SEP #$21 SEP #$21
RTL RTL
CheckBossDropTouched:
; Out: z - boss drop not touched
LDA.w RoomItemsTaken
AND.b #$80
BNE .done
LDA.l BossDropTouched
.done
RTL
CheckDungeonCompletion: CheckDungeonCompletion:
LDX.w DungeonID LDX.w DungeonID
REP #$20 REP #$20

View File

@@ -70,7 +70,7 @@ GetAgahnimLightning:
;1 = Forbid ;1 = Forbid
AllowJoypadInput: AllowJoypadInput:
LDA.l PermitSQFromBosses : BEQ .fullCheck LDA.l PermitSQFromBosses : BEQ .fullCheck
LDA.w RoomItemsTaken : AND.b #$80 : BEQ .fullCheck JSL CheckBossDropTouched : BEQ .fullCheck
LDA.w MedallionFlag : ORA.w CutsceneFlag ; we have heart container, do short check LDA.w MedallionFlag : ORA.w CutsceneFlag ; we have heart container, do short check
RTL RTL
.fullCheck .fullCheck

View File

@@ -6,7 +6,16 @@ HeartPieceGet:
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID
LDY.w SprSourceItemId, X LDY.w SprSourceItemId, X
JSL MaybeMarkDigSpotCollected JSL MaybeMarkDigSpotCollected
.skipLoad JSL HeartGet
PLY : PLX
RTL
;--------------------------------------------------------------------------------
HeartGet:
STY.b $0C
JSL ShieldCheck
BCC .done
LDY.b $0C
LDA.w SprItemMWPlayer, X : STA.l !MULTIWORLD_ITEM_PLAYER_ID LDA.w SprItemMWPlayer, X : 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
CMP.b #$00 : BNE .not_heart CMP.b #$00 : BNE .not_heart
@@ -16,15 +25,24 @@ HeartPieceGet:
STZ.w ItemReceiptMethod ; 0 = Receiving item from an NPC or message STZ.w ItemReceiptMethod ; 0 = Receiving item from an NPC or message
JSL Link_ReceiveItem JSL Link_ReceiveItem
JSL MaybeUnlockTabletAnimation JSL MaybeUnlockTabletAnimation
SEC
PLY : PLX .done
RTL RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
HeartContainerGet: HeartContainerGet:
PHX : PHY PHX : PHY
JSL IncrementBossSword JSL IncrementBossSword
LDY.w SprSourceItemId, X LDY.w SprSourceItemId, X
BRA HeartPieceGet_skipLoad JSL HeartGet
PLY : PLX
BCC +
LDA.w RoomItemsTaken
ORA.b #$80
STA.w RoomItemsTaken
+
LDA.b #$01
STA.l BossDropTouched
RTL
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
DrawHeartPieceGFX: DrawHeartPieceGFX:
PHP PHP

View File

@@ -1053,8 +1053,12 @@ Overworld_Entrance_BRANCH_EPSILON: ; go here to lock doors
org $81C50D : JSL CheckDungeonWorld org $81C50D : JSL CheckDungeonWorld
org $81C517 : JSL CheckDungeonCompletion org $81C517 : JSL CheckDungeonCompletion
org $81C523 : JSL CheckDungeonCompletion org $81C523 : JSL CheckDungeonCompletion
org $81C710 : JSL CheckSpawnPrize org $81C709 : JSL CheckBossDropTouched : NOP
BCS RoomTag_GetHeartForPrize_spawn_prize : BRA RoomTag_GetHeartForPrize_delete_tag org $81C710
JSL CheckSpawnPrize
BCS RoomTag_GetHeartForPrize_spawn_prize
BRA RoomTag_GetHeartForPrize_delete_tag
warnpc $81C731
org $81C742 : JSL SpawnDungeonPrize : PLA : RTS org $81C742 : JSL SpawnDungeonPrize : PLA : RTS
org $8799EA : JML SetItemPose org $8799EA : JML SetItemPose
org $88C415 : JSL PendantMusicCheck org $88C415 : JSL PendantMusicCheck
@@ -1066,6 +1070,7 @@ org $88C622 : BCC ItemReceipt_Animate_continue
org $88C6BA : JSL CheckPoseItemCoordinates org $88C6BA : JSL CheckPoseItemCoordinates
org $88C6C3 : JSL PrepPrizeVRAMHigh org $88C6C3 : JSL PrepPrizeVRAMHigh
org $88C6F4 : JSL PrepPrizeVRAMLow org $88C6F4 : JSL PrepPrizeVRAMLow
org $88CAC4 : JSL CheckBossDropTouched : NOP
org $88CAD6 : JSL HandleDropSFX : NOP #2 org $88CAD6 : JSL HandleDropSFX : NOP #2
org $88CADC : BCC Ancilla29_MilestoneItemReceipt_skip_crystal_sfx org $88CADC : BCC Ancilla29_MilestoneItemReceipt_skip_crystal_sfx
org $88CAE9 : JSL PrepPrizeTile org $88CAE9 : JSL PrepPrizeTile
@@ -2033,7 +2038,10 @@ org $85EF79 ; <- 2EF79 - sprite_heart_upgrades.asm:128 (JSL Sprite_PrepAndDrawSi
JSL DrawHeartContainerGFX JSL DrawHeartContainerGFX
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85EFCE ; <- 2EFCE - sprite_heart_upgrades.asm:176 (JSL Link_ReceiveItem) org $85EFCE ; <- 2EFCE - sprite_heart_upgrades.asm:176 (JSL Link_ReceiveItem)
JSL HeartContainerGet JSL HeartContainerGet ; this also handles setting the boss-killed flag if appropriate
PLX
RTS
warnpc $85EFDC
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $8799B1 ; 399B1 - Bank07.asm:4063 (CPY.b #$3E : BNE .notHeartContainer) org $8799B1 ; 399B1 - Bank07.asm:4063 (CPY.b #$3E : BNE .notHeartContainer)
@@ -2059,10 +2067,13 @@ JSL HeartPieceSpawnDelayFix
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $85F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination org $85F08A ; <- 2F08A - sprite_heart_upgrades.asm : 324 - (LDA $7EF36B : INC A : AND.b #$03 : STA $7EF36B : BNE .got_4_piecese) item determination
JSL HeartPieceGet JSL HeartPieceGet
PHP
JSL DynamicDrawCleanup JSL DynamicDrawCleanup
PLP : BCC +
JSL IsMedallion JSL IsMedallion
BCS + : BRA Sprite_EB_HeartPiece_handle_flags : + ; Don't change OW flags if we're BCS + : BRA Sprite_EB_HeartPiece_handle_flags : + ; Don't change OW flags if we're
STZ.w SpriteAITable, X : RTS ; getting a tablet item STZ.w SpriteAITable, X : RTS ; getting a tablet item
warnpc $85F0C0
;-------------------------------------------------------------------------------- ;--------------------------------------------------------------------------------
org $86C0B0 ; <- 340B0 - sprite prep org $86C0B0 ; <- 340B0 - sprite prep
JSL HeartPieceSpritePrep JSL HeartPieceSpritePrep
@@ -2858,3 +2869,6 @@ JSL LinkAwaken
org $879A31 org $879A31
JSL TuckLink JSL TuckLink
NOP #2 NOP #2
org $80F950
NOP #2

View File

@@ -416,10 +416,10 @@ macro SpriteProps(id, chest_width, standing_width, chest_pal, standing_pal, addr
pullpc pullpc
endmacro endmacro
%SpriteProps($00, 0, 2, $05, $02, PalettesVanilla_blue_ice+$0E) ; 00 - Fighter sword & Shield %SpriteProps($00, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 00 - Fighter sword & Shield
%SpriteProps($01, 0, 2, $05, $05, PalettesCustom_master_sword) ; 01 - Master sword %SpriteProps($01, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 01 - Master sword
%SpriteProps($02, 0, 2, $05, $01, PalettesCustom_tempered_sword) ; 02 - Tempered sword %SpriteProps($02, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 02 - Tempered sword
%SpriteProps($03, 0, 2, $05, $04, PalettesCustom_golden_sword) ; 03 - Golden sword %SpriteProps($03, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 03 - Golden sword
%SpriteProps($04, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 04 - Fighter shield %SpriteProps($04, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 04 - Fighter shield
%SpriteProps($05, 2, 2, $05, $80, PalettesCustom_red_shield) ; 05 - Fire shield %SpriteProps($05, 2, 2, $05, $80, PalettesCustom_red_shield) ; 05 - Fire shield
%SpriteProps($06, 2, 2, $05, $80, PalettesCustom_mirror_shield) ; 06 - Mirror shield %SpriteProps($06, 2, 2, $05, $80, PalettesCustom_mirror_shield) ; 06 - Mirror shield
@@ -489,7 +489,7 @@ endmacro
%SpriteProps($46, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 46 - 300 rupees %SpriteProps($46, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 46 - 300 rupees
%SpriteProps($47, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 47 - 20 rupees green %SpriteProps($47, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 47 - 20 rupees green
%SpriteProps($48, 2, 0, $02, $80, PalettesCustom_fighter_shield) ; 48 - Full bottle (good bee) %SpriteProps($48, 2, 0, $02, $80, PalettesCustom_fighter_shield) ; 48 - Full bottle (good bee)
%SpriteProps($49, 0, 2, $05, $02, PalettesCustom_fighter_shield) ; 49 - Tossed fighter sword %SpriteProps($49, 0, 0, $05, $80, PalettesCustom_fighter_shield) ; 49 - Tossed fighter sword
%SpriteProps($4A, 2, 0, $02, $80, PalettesCustom_fighter_shield) ; 4A - Active Flute %SpriteProps($4A, 2, 0, $02, $80, PalettesCustom_fighter_shield) ; 4A - Active Flute
%SpriteProps($4B, 2, 0, $01, $80, PalettesCustom_fighter_shield) ; 4B - Boots %SpriteProps($4B, 2, 0, $01, $80, PalettesCustom_fighter_shield) ; 4B - Boots
%SpriteProps($4C, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 4C - Bomb capacity (50) %SpriteProps($4C, 2, 2, $04, $04, PalettesVanilla_green_blue_guard+$0E) ; 4C - Bomb capacity (50)
@@ -1220,10 +1220,10 @@ ItemReceiptGraphicsOffsets:
; for receipt and non-receipt drawing. ; for receipt and non-receipt drawing.
;=================================================================================================== ;===================================================================================================
StandingItemGraphicsOffsets: StandingItemGraphicsOffsets:
dw $0860 ; 00 - Fighter Sword and Shield dw BigDecompressionBuffer+$09E0 ; 00 - Fighter Sword and Shield
dw $00E0 ; 01 - Master Sword dw BigDecompressionBuffer+$09E0 ; 01 - Master Sword
dw $0120 ; 02 - Tempered Sword dw BigDecompressionBuffer+$09E0 ; 02 - Tempered Sword
dw $0160 ; 03 - Butter Sword dw BigDecompressionBuffer+$09E0 ; 03 - Butter Sword
dw BigDecompressionBuffer+$09E0 ; 04 - Fighter Shield dw BigDecompressionBuffer+$09E0 ; 04 - Fighter Shield
dw BigDecompressionBuffer+$1940 ; 05 - Fire Shield dw BigDecompressionBuffer+$1940 ; 05 - Fire Shield
dw BigDecompressionBuffer+$0C80 ; 06 - Mirror Shield dw BigDecompressionBuffer+$0C80 ; 06 - Mirror Shield
@@ -1293,7 +1293,7 @@ StandingItemGraphicsOffsets:
dw BigDecompressionBuffer+$0DA0 ; 46 - 300 rupees dw BigDecompressionBuffer+$0DA0 ; 46 - 300 rupees
dw BigDecompressionBuffer+$0000 ; 47 - 20 rupees green dw BigDecompressionBuffer+$0000 ; 47 - 20 rupees green
dw BigDecompressionBuffer+$09E0 ; 48 - Full bottle (good bee) dw BigDecompressionBuffer+$09E0 ; 48 - Full bottle (good bee)
dw $00A0 ; 49 - Tossed fighter sword dw BigDecompressionBuffer+$09E0 ; 49 - Tossed fighter sword
dw BigDecompressionBuffer+$09E0 ; 4A - Active Flute dw BigDecompressionBuffer+$09E0 ; 4A - Active Flute
dw BigDecompressionBuffer+$09E0 ; 4B - Boots dw BigDecompressionBuffer+$09E0 ; 4B - Boots

View File

@@ -619,7 +619,8 @@ HexToDecDigit3: skip 1 ;
HexToDecDigit4: skip 1 ; HexToDecDigit4: skip 1 ;
HexToDecDigit5: skip 1 ; HexToDecDigit5: skip 1 ;
SpriteSkipEOR: skip 2 ; Used in utilities.asm to determine when to skip drawing sprites. Zero-padded SpriteSkipEOR: skip 2 ; Used in utilities.asm to determine when to skip drawing sprites. Zero-padded
skip $2B ; Unused skip $2A ; Unused
BossDropTouched: skip 1
AltTextFlag: skip 2 ; dialog.asm: Determines whether to load from vanilla decompression buffer AltTextFlag: skip 2 ; dialog.asm: Determines whether to load from vanilla decompression buffer
; or from a secondary buffer (used for things like free dungeon item text) ; or from a secondary buffer (used for things like free dungeon item text)
BossKills: skip 1 ; BossKills: skip 1 ;

View File

@@ -192,6 +192,7 @@ LoadBackgroundGraphics_arbitrary = $80E64D
RoomTag_GetHeartForPrize = $81C709 RoomTag_GetHeartForPrize = $81C709
RoomTag_GetHeartForPrize_spawn_prize = $81C731 RoomTag_GetHeartForPrize_spawn_prize = $81C731
RoomTag_GetHeartForPrize_delete_tag = $81C749 RoomTag_GetHeartForPrize_delete_tag = $81C749
RoomTag_GetHeartForPrize_exit = $81C74D
Underworld_SetBossOrSancMusicUponEntry = $828AD9 Underworld_SetBossOrSancMusicUponEntry = $828AD9
ResetThenCacheRoomEntryProperties = $828C73 ResetThenCacheRoomEntryProperties = $828C73
RecoverPositionAfterDrowning = $829485 RecoverPositionAfterDrowning = $829485