From c631415465385104bf80c9a86ad0b524320ba794 Mon Sep 17 00:00:00 2001 From: Karkat Date: Wed, 9 Aug 2017 23:13:28 -0400 Subject: [PATCH] let's dev aug 9 2017 fixed tablet text not displaying in swordless fixed goal item transition to triforce scene bugs fixed map carryover for hyrule castle and sewers fixed item graphics for bottle overflow fixed item graphics for armor overflow --- LTTP_RND_GeneralBugfixes.asm | 2 +- dialog.asm | 6 ++- newitems.asm | 12 +++++- tables.asm | 4 +- utilities.asm | 72 ++++++++++++++++++++++++++++++++++-- 5 files changed, 85 insertions(+), 11 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index c214db9..6014b98 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -26,7 +26,7 @@ org $3FFFFF ; <- 1FFFFF db #$00 ; expand file to 2mb org $1FFFF8 ; <- FFFF8 timestamp rom -db #$20, #$17, #$08, #$08 ; year/month/day +db #$20, #$17, #$08, #$09 ; year/month/day ;================================================================================ diff --git a/dialog.asm b/dialog.asm index a2fffe8..ff28384 100644 --- a/dialog.asm +++ b/dialog.asm @@ -260,7 +260,8 @@ DialogEtherTablet: RTL + BIT $F4 : BVC - ; Show normal text if Y is not pressed - LDA $7EF359 : CMP.b #$02 : !BGE .noText + LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText + .yesText %LoadDialogAddress(EtherTabletText) PLA : JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm) RTL @@ -276,7 +277,8 @@ DialogBombosTablet: RTL + BIT $F4 : BVC - ; Show normal text if Y is not pressed - LDA $7EF359 : CMP.b #$02 : !BGE .noText + LDA $7EF359 : CMP.b #$FF : BEQ .yesText : CMP.b #$02 : !BGE .noText + .yesText %LoadDialogAddress(BombosTabletText) PLA : JSL Sprite_ShowMessageUnconditional ; Text From MSPedestalText (tables.asm) RTL diff --git a/newitems.asm b/newitems.asm index 5367126..e7f7ad9 100755 --- a/newitems.asm +++ b/newitems.asm @@ -220,7 +220,7 @@ AddReceivedItemExpandedGetItem: + CMP.b #$63 : BNE + ; RNG Pool Item (Multi) BRL .done + CMP.b #$6A : BNE + ; Goal Collectable (Single/Triforce) - JSL.l StatsFinalPrep + JSL.l ActivateGoal BRL .done + CMP.b #$6B : BNE + ; Goal Collectable (Multi/Power Star) BRA .multi_collect @@ -228,7 +228,7 @@ AddReceivedItemExpandedGetItem: .multi_collect LDA GoalItemRequirement : BEQ ++ LDA !GOAL_COUNTER : INC : STA !GOAL_COUNTER - CMP GoalItemRequirement : !BLT ++ : JSL.l StatsFinalPrep : ++ + CMP GoalItemRequirement : !BLT ++ : JSL.l ActivateGoal : ++ BRL .done + CMP.b #$70 : !BLT + : CMP.b #$80 : !BGE + ; Free Map AND #$0F : CMP #$08 : !BGE ++ @@ -237,6 +237,7 @@ AddReceivedItemExpandedGetItem: ++ !SUB #$08 %ValueShift() + BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF369 : STA $7EF369 ; Map 2 BRL .done + CMP.b #$80 : !BLT + : CMP.b #$90 : !BGE + ; Free Compass @@ -246,6 +247,7 @@ AddReceivedItemExpandedGetItem: ++ !SUB #$08 %ValueShift() + BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF365 : STA $7EF365 ; Compass 2 BRL .done + CMP.b #$90 : !BLT + : CMP.b #$A0 : !BGE + ; Free Big Key @@ -255,6 +257,7 @@ AddReceivedItemExpandedGetItem: ++ !SUB #$08 %ValueShift() + BIT.b #$C0 : BEQ +++ : LDA.b #$C0 : +++ ; Make Hyrule Castle / Sewers Count for Both ORA $7EF367 : STA $7EF367 ; Big Key 2 BRL .done + CMP.b #$A0 : !BLT + : CMP.b #$B0 : !BGE + ; Free Small Key @@ -801,4 +804,9 @@ CountBottles: ++ TXA RTS +;-------------------------------------------------------------------------------- +ActivateGoal: + STZ $11 + STZ $B0 +JMP.l StatsFinalPrep ;-------------------------------------------------------------------------------- \ No newline at end of file diff --git a/tables.asm b/tables.asm index bd36a5c..bbe3eac 100644 --- a/tables.asm +++ b/tables.asm @@ -10,7 +10,7 @@ HeartPiece_Lumberjack_Tree: HeartPiece_Spectacle_Cave: db #$17 HeartPiece_Circle_Bushes: - db #$17 + db #$3D HeartPiece_Graveyard_Warp: db #$17 HeartPiece_Mire_Warp: @@ -644,7 +644,7 @@ HeartContainer_Mothula: HeartContainer_Blind: db #$3E HeartContainer_Kholdstare: - db #$3E + db #$6A HeartContainer_Vitreous: db #$3E HeartContainer_Trinexx: diff --git a/utilities.asm b/utilities.asm index c7f70f2..5798716 100644 --- a/utilities.asm +++ b/utilities.asm @@ -8,6 +8,22 @@ ; out: A - Sprite GFX ID ;-------------------------------------------------------------------------------- GetSpriteID: + + CMP.b #$16 : BEQ .bottle ; Bottle + CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle + CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle + CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle + CMP.b #$3C : BEQ .bottle ; Bee w/bottle + CMP.b #$3D : BEQ .bottle ; Fairy w/bottle + CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle + BRA .notBottle + .bottle + PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + + PLA : LDA.l BottleLimitReplacement + JSL.l GetSpriteID + RTL + + + PLA : .notBottle PHX PHB : PHK : PLB ;-------- @@ -20,6 +36,13 @@ RTL JSL.l GetRNGItemSingle : JMP GetSpriteID ++ CMP.b #$FB : BNE ++ ; RNG Item (Multi) JSL.l GetRNGItemMulti : JMP GetSpriteID + ++ CMP.b #$FD : BNE ++ ; Progressive Armor + LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit + LDA.l ProgressiveArmorReplacement + JSL.l GetSpriteID + RTL + + + LDA.b #$04 : RTL ++ CMP.b #$FE : BNE ++ ; Progressive Sword LDA $7EF359 CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit @@ -80,7 +103,7 @@ RTL db $FE, $FF ; Progressive Sword & Shield ;6x - db $04, $0D ; Progressive Armor & Gloves + db $FD, $0D ; Progressive Armor & Gloves db $FA, $FB ; RNG Single & Multi db $FF, $FF, $FF, $FF, $FF, $FF ; Unused db $49, $4A, $49 ; Goal Item Single, Multi & Alt Multi @@ -106,6 +129,22 @@ RTL ; out: A - Palette ;-------------------------------------------------------------------------------- GetSpritePalette: + + CMP.b #$16 : BEQ .bottle ; Bottle + CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle + CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle + CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle + CMP.b #$3C : BEQ .bottle ; Bee w/bottle + CMP.b #$3D : BEQ .bottle ; Fairy w/bottle + CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle + BRA .notBottle + .bottle + PHA : JSR.w CountBottles : CMP.l BottleLimit : !BLT + + PLA : LDA.l BottleLimitReplacement + JSL.l GetSpritePalette + RTL + + + PLA : .notBottle PHX PHB : PHK : PLB ;-------- @@ -141,7 +180,11 @@ RTL + ; Everything Else LDA.b #$08 : RTL ++ : CMP.b #$FF : BNE ++ ; Progressive Armor - LDA $7EF35B : BNE + ; Green Tunic + LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit + LDA.l ProgressiveArmorReplacement + JSL.l GetSpritePalette + RTL + + : CMP.b #$00 : BNE + ; Green Tunic LDA.b #$04 : RTL + ; Everything Else LDA.b #$02 : RTL @@ -205,13 +248,28 @@ IsNarrowSprite: PHB : PHK : PLB ;-------- - CMP.b #$5E : BNE ++ ; Special Handler for Progressive Sword + CMP.b #$16 : BEQ .bottle ; Bottle + CMP.b #$2B : BEQ .bottle ; Red Potion w/bottle + CMP.b #$2C : BEQ .bottle ; Green Potion w/bottle + CMP.b #$2D : BEQ .bottle ; Blue Potion w/bottle + CMP.b #$3C : BEQ .bottle ; Bee w/bottle + CMP.b #$3D : BEQ .bottle ; Fairy w/bottle + CMP.b #$48 : BEQ .bottle ; Gold Bee w/bottle + BRA .notBottle + .bottle + JSR.w CountBottles : CMP.l BottleLimit : !BLT + + LDA.l BottleLimitReplacement + JSL.l IsNarrowSprite + BRL .done + + : BRA .continue + .notBottle + CMP.b #$5E : BNE ++ ; Progressive Sword LDA $7EF359 : CMP.l ProgressiveSwordLimit : !BLT + ; Progressive Sword Limit LDA.l ProgressiveSwordReplacement JSL.l IsNarrowSprite BRA .done + : BRA .continue - ++ : CMP.b #$5F : BNE ++ ; Special Handler for Progressive Shield + ++ : CMP.b #$5F : BNE ++ ; Progressive Shield LDA !PROGRESSIVE_SHIELD : AND #$C0 : BNE + : SEC : BRA .done ; No Shield LSR #6 : CMP.l ProgressiveShieldLimit : !BLT + ; Progressive Shield Limit LDA.l ProgressiveShieldReplacement @@ -220,6 +278,12 @@ IsNarrowSprite: + ;LDA $7EF35A : BNE + : SEC : BRA .done : +; No Shield BRA .false ; Everything Else + ++ CMP.b #$60 : BNE ++ ; Progressive Armor + LDA $7EF35B : CMP.l ProgressiveArmorLimit : !BLT + ; Progressive Armor Limit + LDA.l ProgressiveArmorReplacement + JSL.l IsNarrowSprite + BRA .done + + ++ CMP.b #$62 : BNE ++ ; RNG Item (Single) JSL.l GetRNGItemSingle : BRA .continue ++ CMP.b #$63 : BNE ++ ; RNG Item (Multi)