Palette fix for GT Torch/Hera cage items that load new palette

This commit is contained in:
cassidoxa
2023-09-03 15:39:53 -04:00
parent 73b2a180ba
commit 9800a86189

View File

@@ -366,7 +366,7 @@ LoadItemPalette:
TXA : ASL : TAX TXA : ASL : TAX
LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A LDA.l SpriteProperties_palette_addr,X : STA.b Scrap0A
LDY.w #$000E LDY.w #$000E
JSR.w GTTorchCheck : BCS .aux JSR.w AuxPaletteCheck : BCS .aux
LDA.w TransparencyFlag : BNE .SP05 LDA.w TransparencyFlag : BNE .SP05
- -
LDA.b [Scrap0A], Y LDA.b [Scrap0A], Y
@@ -424,18 +424,23 @@ ItemReceiptWidthCheck:
LDA.l SpriteProperties_standing_width, X LDA.l SpriteProperties_standing_width, X
RTL RTL
GTTorchCheck: AuxPaletteCheck:
; Out: c - write to aux palette buffer if set, main buffer if unset.
;
; We have to put an item's palette in the aux buffer in rooms where standing
; item gfx are loaded in the middle of a fade-in/out such as the spiral staircase
; fade for GT torch room and the Hera cage.
PHX PHX
SEP #$30 SEP #$30
LDA.w RoomIndex : CMP.b #$8C : BNE .done LDA.w ItemReceiptMethod : BNE .main_buffer ; Never use aux if we're actually receiving an item
LDX.w CurrentSpriteSlot LDA.w RoomIndex : CMP.b #$8C : BEQ .aux_buffer ; GT torch/Hope room
LDA.w SpriteTypeTable,X : CMP.b #$3B : BNE .done; Bonk Item LDA.w RoomIndex : CMP.b #$87 : BEQ .aux_buffer ; Hera cage/basement
SEC .main_buffer
REP #$30 REP #$31
PLX PLX
RTS RTS
.done .aux_buffer
CLC SEC
REP #$30 REP #$30
PLX PLX
RTS RTS