From 4c98268d812e7546e247b79aac8f2df077c9e209 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Tue, 29 Aug 2023 16:03:22 -0400 Subject: [PATCH 1/5] Various fixes --- custompalettes.asm | 2 +- events.asm | 11 ++++++++--- invertedmaps.asm | 4 ++-- itemdatatables.asm | 12 +++++------- itemtext_lower.asm | 2 +- utilities.asm | 40 ++++++++++++++++++++++++++++------------ 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/custompalettes.asm b/custompalettes.asm index cbe705a..d19f52b 100644 --- a/custompalettes.asm +++ b/custompalettes.asm @@ -2,7 +2,7 @@ PalettesCustom: .master_sword dw $0000, $7E4E, $6FF4, $1CF5, $7FFF, $1CE7, $7A10, $64A5 .tempered_sword -dw $0000, $7FFF, $1979, $14B6, $39DC, $14A5, $66F7, $45EF +dw $7FFF, $093B, $169F, $7E8D, $7FFF, $1CE7, $7A10, $64A5 .golden_sword dw $0000, $033F, $7FFF, $2640, $7FFF, $1CE7, $7A10, $64A5 .fighter_shield diff --git a/events.asm b/events.asm index 15ae511..b582c4a 100644 --- a/events.asm +++ b/events.asm @@ -28,10 +28,15 @@ RTL OnDungeonBossExit: JSL.l StatTransitionCounter LDX.w DungeonID : BMI + - REP #$20 - LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted - SEP #$20 + LDA.w RoomIndex : CMP.b #$0D : BEQ .aga2 + .set_completed + REP #$20 + LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted + SEP #$20 + +RTL + .aga2 + CPX.b #$1A : BEQ .set_completed RTL ;-------------------------------------------------------------------------------- OnPlayerDead: diff --git a/invertedmaps.asm b/invertedmaps.asm index f354001..1501335 100644 --- a/invertedmaps.asm +++ b/invertedmaps.asm @@ -1362,11 +1362,11 @@ OverworldMapChangePointers: dw !OWW_Stripe|!OWW_Vertical dw $2422 - dw $02F3, $00C9, $00E3 + dw $02F3, $00C9, $00E3|!OWW_STOP dw !OWW_Stripe|!OWW_Vertical dw $2424 - dw $02F3, $00C9, $00E3 + dw $02F3, $00C9, $00E3|!OWW_STOP dw !OWW_END diff --git a/itemdatatables.asm b/itemdatatables.asm index 1f36c99..b83d5d2 100644 --- a/itemdatatables.asm +++ b/itemdatatables.asm @@ -22,10 +22,6 @@ ; resolve to a different one, or to run some custom code on pickup, you will have to use ; ItemSubstitutionRules in tables.asm or claim some free space in this bank to put your ; own code with vectors to it in the appropriate tables. -; -; Currently our "skip" vectors are located at (SNES address, little-endian): -; ItemReceipts_behavior: $CDBB -; ItemReceipts_resolution: $D33F ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ @@ -81,6 +77,8 @@ ; c = palette index | l = load palette from .palette_addr ; .palette_addr [0x02] - $A2BE00 (0x11CE00 PC) ; • Pointer to 8-color palette in bank $9B (see custompalettes.asm) +; • If an item has two sprites, this should be the chest sprite for +; dark rooms. ;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------ @@ -420,9 +418,9 @@ endmacro %SpriteProps($01, 0, 2, $05, $05, PalettesCustom_master_sword) ; 01 - Master sword %SpriteProps($02, 0, 2, $05, $01, PalettesCustom_tempered_sword) ; 02 - Tempered sword %SpriteProps($03, 0, 2, $05, $04, PalettesCustom_golden_sword) ; 03 - Golden sword -%SpriteProps($04, 0, 0, $80, $80, PalettesCustom_fighter_shield) ; 04 - Fighter shield -%SpriteProps($05, 2, 2, $80, $80, PalettesCustom_red_shield) ; 05 - Fire shield -%SpriteProps($06, 2, 2, $80, $80, PalettesCustom_mirror_shield) ; 06 - Mirror 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($06, 2, 2, $05, $80, PalettesCustom_mirror_shield) ; 06 - Mirror shield %SpriteProps($07, 0, 0, $01, $01, PalettesVanilla_red_melon+$0E) ; 07 - Fire rod %SpriteProps($08, 0, 0, $02, $02, PalettesVanilla_blue_ice+$0E) ; 08 - Ice rod %SpriteProps($09, 0, 0, $01, $01, PalettesVanilla_red_melon+$0E) ; 09 - Hammer diff --git a/itemtext_lower.asm b/itemtext_lower.asm index e371649..d4061f7 100644 --- a/itemtext_lower.asm +++ b/itemtext_lower.asm @@ -16,7 +16,7 @@ Notice_CompassOf: ; Oh look! it's ; the big key of Notice_BigKeyOf: - db $74, $00, $B8, $00, $D7, $00, $FF, $00, $DB, $00, $DE, $00, $DE, $00, $DA, $00, $C7, $00, $FF, $00, $D8, $00, $E3, $00, $D8, $00, $E2 + db $74, $00, $B8, $00, $D7, $00, $FF, $00, $DB, $00, $DE, $00, $DE, $00, $DA, $00, $C7, $00, $FF, $00, $D8, $00, $E3, $00, $9D, $00, $E2 db $75, $00, $E3, $00, $D7, $00, $D4, $00, $FF, $00, $D1, $00, $D8, $00, $D6, $00, $FF, $00, $DA, $00, $D4, $00, $E8, $00, $FF, $00, $DE, $00, $D5 dw #$7F7F diff --git a/utilities.asm b/utilities.asm index cc4e286..a4063aa 100644 --- a/utilities.asm +++ b/utilities.asm @@ -366,22 +366,22 @@ LoadItemPalette: TXA : ASL : TAX LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A LDY.w #$000E - LDA.w RoomIndex : CMP.w #$008C : BEQ .aux - LDA.w TransparencyFlag : BNE .SP05 + JSR.w GTTorchCheck : BCS .aux + LDA.w TransparencyFlag : BNE .SP05 + - + LDA.b [Scrap0A], Y + STA.w PaletteBuffer+$0170,Y + DEY #2 + BPL - + LDA.w #$0003 + BRA .done + .SP05 - LDA.b [Scrap0A], Y - STA.w PaletteBuffer+$0170,Y + STA.w PaletteBuffer+$01B0,Y DEY #2 BPL - - LDA.w #$0003 - BRA .done - .SP05 - - - LDA.b [Scrap0A], Y - STA.w PaletteBuffer+$01B0,Y - DEY #2 - BPL - - LDA.w #$0005 + LDA.w #$0005 .done SEP #$30 PLB : PLY : PLX @@ -423,3 +423,19 @@ ItemReceiptWidthCheck: PLX LDA.l SpriteProperties_standing_width, X RTL + +GTTorchCheck: + PHX + SEP #$30 + LDA.w RoomIndex : CMP.b #$8C : BNE .done + LDX.w CurrentSpriteSlot + LDA.w SpriteTypeTable,X : CMP.b #$3B : BNE .done; Bonk Item + SEC + REP #$30 + PLX + RTS + .done + CLC + REP #$30 + PLX +RTS From 90c8e95f9b3351326884863edd8ce901f7b04276 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Wed, 30 Aug 2023 01:25:43 -0400 Subject: [PATCH 2/5] Fix overworld item duping Fix setting dungeon completed when Aga 1 and 2 are defeated (prize drops) --- events.asm | 4 ++++ heartpieces.asm | 10 ++++++++-- stats/credits.asm | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/events.asm b/events.asm index b582c4a..9587aa4 100644 --- a/events.asm +++ b/events.asm @@ -29,6 +29,7 @@ OnDungeonBossExit: JSL.l StatTransitionCounter LDX.w DungeonID : BMI + LDA.w RoomIndex : CMP.b #$0D : BEQ .aga2 + LDA.w RoomIndex : CMP.b #$20 : BEQ .aga .set_completed REP #$20 LDA.l DungeonItemMasks, X : ORA.l DungeonsCompleted : STA.l DungeonsCompleted @@ -37,6 +38,9 @@ OnDungeonBossExit: RTL .aga2 CPX.b #$1A : BEQ .set_completed +RTL + .aga + CPX.b #$08 : BEQ .set_completed RTL ;-------------------------------------------------------------------------------- OnPlayerDead: diff --git a/heartpieces.asm b/heartpieces.asm index 7243aa2..c54f10c 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -211,7 +211,10 @@ LoadIndoorValue: LDA.l StandingKey_Hera JMP .done + - LDA.w #$0017 ; default to a normal hp + PHX + LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite + LDA.w SpriteID,X ; we can see and are interacting with + PLX .done AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before PLP @@ -274,7 +277,10 @@ LoadOutdoorValue: %GetPossiblyEncryptedItem(HeartPiece_Zora, HeartPieceOutdoorValues) JMP .done + - LDA.w #$0017 ; default to a normal hp + PHX + LDX.w CurrentSpriteSlot ; If we're on a different screen ID via glitches load the sprite + LDA.w SpriteID,X ; we can see and are interacting with. + PLX .done AND.w #$00FF ; the loads are words but the values are 1-byte so we need to clear the top half of the accumulator - no guarantee it was 8-bit before PLP diff --git a/stats/credits.asm b/stats/credits.asm index 9661e5c..8466385 100644 --- a/stats/credits.asm +++ b/stats/credits.asm @@ -443,10 +443,10 @@ CreditsLineBlank: %blankline() -%bigcredits("MATRETHEWEY IBAZLY") +%bigcredits(" MATRETHEWEY ") %blankline() -%bigcredits("FISH_WAFFLE64 KRELBEL") +%bigcredits("FISH_WAFFLE64 IBAZLY") %blankline() From 29176fa1946150784705f34d5b7641f81eda1dd0 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Wed, 30 Aug 2023 20:47:06 -0400 Subject: [PATCH 3/5] Absorb torch keys if they belong to the dungeon they're in. --- bookofmudora.asm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/bookofmudora.asm b/bookofmudora.asm index 21f79a3..9dd0c4f 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -60,7 +60,7 @@ RTL ;-------------------------------------------------------------------------------- GiveBonkItem: JSR LoadBonkItem - CMP.b #$24 : BNE .notKey + JSR.w AbsorbKeyCheck : BCC .notKey .key PHY : LDY.b #$24 : JSL.l AddInventory : PLY ; do inventory processing for a small key LDA.l CurrentSmallKeys : INC A : STA.l CurrentSmallKeys @@ -84,3 +84,19 @@ LoadBonkItem: LDA.b #$24 ; default to small key ++ RTS +;-------------------------------------------------------------------------------- +AbsorbKeyCheck: + PHA + CMP.b #$24 : BEQ .key + CMP.b #$A0 : BCC .not_key + CMP.b #$B0 : BCS .not_key + AND.b #$0F : ASL + CMP.w DungeonID : BNE .not_key + .key + PLA + SEC + RTS + .not_key + PLA + CLC +RTS From 71e6d54276f47b4e6ea3f17a172c99fed3ee407d Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Thu, 31 Aug 2023 15:17:07 -0400 Subject: [PATCH 4/5] Fix for item receipt after GT boss heart container collected --- dungeondrops.asm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/dungeondrops.asm b/dungeondrops.asm index 6abf178..a3aa120 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -107,10 +107,11 @@ SetCutsceneFlag: CLC RTL .dungeon_prize - LDA.w ItemReceiptID : TAX - LDA.l InventoryTable_properties,X : BPL .no_cutscene - PLX - SEC + JSR.w PrizeAncillaCheck : BCC .no_cutscene + LDA.w ItemReceiptID : TAX + LDA.l InventoryTable_properties,X : BPL .no_cutscene + PLX + SEC RTL AnimatePrizeCutscene: @@ -324,3 +325,15 @@ CheckDungeonWorld: .dark_world SEP #$02 RTL + +PrizeAncillaCheck: + PHX + LDX.w CurrentSpriteSlot + LDA.w AncillaVelocityZ,X : BNE .prize ; Only prizes should have Z velocity after + PLX ; room boss heart container is collected + CLC + RTS + .prize + PLX + SEC +RTS From 3a5974b456d75331797f3487366f7d8c37574069 Mon Sep 17 00:00:00 2001 From: cassidoxa Date: Thu, 31 Aug 2023 16:38:53 -0400 Subject: [PATCH 5/5] Only check if we're getting a chest item if boss heart flag is set --- dungeondrops.asm | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/dungeondrops.asm b/dungeondrops.asm index a3aa120..48d3535 100644 --- a/dungeondrops.asm +++ b/dungeondrops.asm @@ -107,7 +107,7 @@ SetCutsceneFlag: CLC RTL .dungeon_prize - JSR.w PrizeAncillaCheck : BCC .no_cutscene + LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .no_cutscene LDA.w ItemReceiptID : TAX LDA.l InventoryTable_properties,X : BPL .no_cutscene PLX @@ -326,14 +326,3 @@ CheckDungeonWorld: SEP #$02 RTL -PrizeAncillaCheck: - PHX - LDX.w CurrentSpriteSlot - LDA.w AncillaVelocityZ,X : BNE .prize ; Only prizes should have Z velocity after - PLX ; room boss heart container is collected - CLC - RTS - .prize - PLX - SEC -RTS