New colorized pot and bitfields

This commit is contained in:
aerinon
2022-04-19 14:04:12 -06:00
parent d116249412
commit f6015a8569
2 changed files with 29 additions and 7 deletions

View File

@@ -384,6 +384,7 @@ warnpc $B08000
;$27 DR Code Bank ;$27 DR Code Bank
;$28 Keydrop / Standing Items Code bank ;$28 Keydrop / Standing Items Code bank
;$29 External hooks (rest of bank not used) ;$29 External hooks (rest of bank not used)
;$2A Room Data migration
;$2E Reserved for Tournament Use ;$2E Reserved for Tournament Use
;$2F Static RNG (rest is reserved for tournament use) ;$2F Static RNG (rest is reserved for tournament use)
;$30 Main Configuration Table ;$30 Main Configuration Table

View File

@@ -48,6 +48,15 @@ org $07B169
org $07B17D org $07B17D
JSL PreventPotSpawn2 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 ; refs to other functions
org $06d23a org $06d23a
@@ -124,8 +133,15 @@ db 1
StandingItemCounterMask: ; 142A55 StandingItemCounterMask: ; 142A55
db 0 ; if 0x01 is set then pot should be counted, if 0x02 then sprite drops, 0x03 (both bits for both) db 0 ; if 0x01 is set then pot should be counted, if 0x02 then sprite drops, 0x03 (both bits for both)
PotCountMode: ; 28AA56-7 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: RevealPotItem:
STA.b $04 ; save tilemap coordinates STA.b $04 ; save tilemap coordinates
@@ -218,12 +234,7 @@ SaveMajorItemDrop:
ShouldCountNormalPot: ShouldCountNormalPot:
INY : INY : LDA [$00], Y : AND #$00FF : CMP #$0080 : BCS .clear INY : INY : LDA [$00], Y : AND #$00FF : CMP #$0080 : BCS .clear
LDA.l PotCountMode : BEQ .clear LDA.l PotCountMode : BEQ .clear
CMP.w #$0003 : BEQ .set LDA.l PotCollectionRateTable, X : BIT $0A : BEQ .clear ; don't count if clear
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
.set .set
SEC SEC
RTS RTS
@@ -488,6 +499,16 @@ PreventPotSpawn2:
LDA.b #$01 : TSB.b $50 ; what we wrote over LDA.b #$01 : TSB.b $50 ; what we wrote over
+ RTL + 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 incsrc dynamic_si_vram.asm