From f6015a85693c53eabe31a14cd1c4a15aca42e732 Mon Sep 17 00:00:00 2001 From: aerinon Date: Tue, 19 Apr 2022 14:04:12 -0600 Subject: [PATCH] New colorized pot and bitfields --- LTTP_RND_GeneralBugfixes.asm | 1 + keydrop/standing_items.asm | 35 ++++++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/LTTP_RND_GeneralBugfixes.asm b/LTTP_RND_GeneralBugfixes.asm index 513f105..d57641f 100644 --- a/LTTP_RND_GeneralBugfixes.asm +++ b/LTTP_RND_GeneralBugfixes.asm @@ -384,6 +384,7 @@ warnpc $B08000 ;$27 DR Code Bank ;$28 Keydrop / Standing Items Code bank ;$29 External hooks (rest of bank not used) +;$2A Room Data migration ;$2E Reserved for Tournament Use ;$2F Static RNG (rest is reserved for tournament use) ;$30 Main Configuration Table diff --git a/keydrop/standing_items.asm b/keydrop/standing_items.asm index 7c1c92f..c521138 100644 --- a/keydrop/standing_items.asm +++ b/keydrop/standing_items.asm @@ -48,6 +48,15 @@ org $07B169 org $07B17D JSL PreventPotSpawn2 +org $00A9DC +dw $1928, $1938, $5928, $5938 ; change weird ugly black diagonal pot to blue-ish pot + +org $018650 +dw $B395 ; change tile type to normal pot + +org $01B3D5 +JSL CheckIfPotIsSpecial + ; refs to other functions org $06d23a @@ -124,8 +133,15 @@ db 1 StandingItemCounterMask: ; 142A55 db 0 ; if 0x01 is set then pot should be counted, if 0x02 then sprite drops, 0x03 (both bits for both) PotCountMode: ; 28AA56-7 -dw 0 ; # 0 is don't count pots, bit 1 for cave pots and bit 2 for dungeon pots +; 0 is don't count pots +; 1 for check PotCollectionRateTable +dw 0 +org $A8AA60 +PotCollectionRateTable: +; Reserved $250 296 * 2 + +org $A8ACB0 RevealPotItem: STA.b $04 ; save tilemap coordinates @@ -218,12 +234,7 @@ SaveMajorItemDrop: ShouldCountNormalPot: INY : INY : LDA [$00], Y : AND #$00FF : CMP #$0080 : BCS .clear LDA.l PotCountMode : BEQ .clear - CMP.w #$0003 : BEQ .set - CMP.w #$0001 : BEQ .check_cave - .in_dungeon - LDA $040C : CMP.w #$00FF : BEQ .clear : BRA .set - .check_cave - LDA $040C : CMP.w #$00FF : BEQ .set : BRA .clear + LDA.l PotCollectionRateTable, X : BIT $0A : BEQ .clear ; don't count if clear .set SEC RTS @@ -488,6 +499,16 @@ PreventPotSpawn2: LDA.b #$01 : TSB.b $50 ; what we wrote over + RTL +CheckIfPotIsSpecial: + TXA ; give index to A so we can do a CMP.l + CMP.l $018550 ; see if our current index is that of object 230 + BEQ .specialpot + + ; Normal pot, so run the vanilla code + LDA.l $7EF3CA ; check for dark world + .specialpot ; zero flag already set, so gtg +RTL + incsrc dynamic_si_vram.asm