diff --git a/bookofmudora.asm b/bookofmudora.asm index dff9707..d00a880 100644 --- a/bookofmudora.asm +++ b/bookofmudora.asm @@ -2,7 +2,7 @@ ; Randomize Book of Mudora ;-------------------------------------------------------------------------------- LoadLibraryItemGFX: - LDA.l LibraryItem_Player : STA !MULTIWORLD_SPRITEITEM_PLAYER_ID + LDA.l LibraryItem_Player : STA.l !MULTIWORLD_SPRITEITEM_PLAYER_ID %GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues) JSL.l AttemptItemSubstitution JSL.l ResolveLootIDLong @@ -63,7 +63,7 @@ RTL GiveBonkItem: JSR LoadBonkItem_Player : STA !MULTIWORLD_ITEM_PLAYER_ID 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 @@ -100,3 +100,19 @@ LoadBonkItem_Player: LDA.b #$00 ++ 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 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/dungeondrops.asm b/dungeondrops.asm index 6abf178..48d3535 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 + LDA.w ItemReceiptMethod : CMP.b #$01 : BEQ .no_cutscene + LDA.w ItemReceiptID : TAX + LDA.l InventoryTable_properties,X : BPL .no_cutscene + PLX + SEC RTL AnimatePrizeCutscene: @@ -324,3 +325,4 @@ CheckDungeonWorld: .dark_world SEP #$02 RTL + diff --git a/events.asm b/events.asm index e8445fe..1b15382 100644 --- a/events.asm +++ b/events.asm @@ -29,10 +29,19 @@ 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 + LDA.w RoomIndex : CMP.b #$20 : BEQ .aga + .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 + .aga + CPX.b #$08 : BEQ .set_completed RTL ;-------------------------------------------------------------------------------- OnPlayerDead: diff --git a/heartpieces.asm b/heartpieces.asm index acd23ba..929ea90 100644 --- a/heartpieces.asm +++ b/heartpieces.asm @@ -224,7 +224,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 @@ -287,7 +290,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/invertedmaps.asm b/invertedmaps.asm index e2b5a17..b6a976e 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 c037ea7..ed39f47 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/stats/credits.asm b/stats/credits.asm index a2250b3..da41911 100644 --- a/stats/credits.asm +++ b/stats/credits.asm @@ -459,10 +459,10 @@ CreditsLineBlank: %blankline() -%bigcredits("MATRETHEWEY IBAZLY") +%bigcredits(" MATRETHEWEY ") %blankline() -%bigcredits("FISH_WAFFLE64 KRELBEL") +%bigcredits("FISH_WAFFLE64 IBAZLY") %blankline() diff --git a/utilities.asm b/utilities.asm index e031ad9..fd576b6 100644 --- a/utilities.asm +++ b/utilities.asm @@ -406,22 +406,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 @@ -463,3 +463,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