Small fixes

This commit is contained in:
cassidoxa
2023-08-01 20:30:15 -04:00
parent 8ed4cbda1d
commit ddfb8eed0f
5 changed files with 13 additions and 36 deletions

View File

@@ -4,19 +4,19 @@
LoadLibraryItemGFX:
%GetPossiblyEncryptedItem(LibraryItem, SpriteItemValues)
JSL.l ResolveLootIDLong
STA.w SpriteItemType, X ; Store item type
STA.w SpriteItemType, X
JSL.l PrepDynamicTile_loot_resolved
RTL
;--------------------------------------------------------------------------------
DrawLibraryItemGFX:
PHA
LDA.w SpriteItemType, X ; Retrieve stored item type
LDA.w SpriteItemType, X
JSL.l DrawDynamicTile
PLA
RTL
;--------------------------------------------------------------------------------
SetLibraryItem:
LDY.w SpriteItemType, X ; Retrieve stored item type
LDY.w SpriteItemType, X
JSL.l ItemSet_Library ; contains thing we wrote over
RTL
;--------------------------------------------------------------------------------
@@ -30,12 +30,13 @@ LoadBonkItemGFX:
LoadBonkItemGFX_inner:
LDA.b #$00 : STA.l RedrawFlag
JSR LoadBonkItem
STA.w SpriteItemType, X
JSL.l PrepDynamicTile
RTL
;--------------------------------------------------------------------------------
DrawBonkItemGFX:
PHA
LDA.l RedrawFlag : BEQ .skipInit ; skip init if already ready
LDA.l RedrawFlag : BEQ .skipInit
JSL.l LoadBonkItemGFX_inner
BRA .done ; don't draw on the init frame

View File

@@ -1,27 +0,0 @@
CheckReceivedItemPropertiesBeforeLoad:
LDA.b RoomIndex : BEQ .normalCode
LDA.l RoomFade : BNE .lightOff
.normalCode
LDA.l ItemReceipts_palette, X ;Restore Rando Code
RTL
.lightOff
PHX : PHY : PHB
LDA.l ItemReceipts_palette, X ; get palette
REP #$30
AND.w #$0007 ; mask out palette
ASL #5 ; multiply by 32
ADC.w #$C610 ; offset to latter half
TAX ; give to destination
LDY.w #$C610 ; target palette SP0 colors 8-F
LDA.w #$000F ; 16 bytes
MVN $7E, $7E ; move palette
SEP #$30
PLB : PLY : PLX
INC.b NMICGRAM
LDA.b #$00
RTL

View File

@@ -41,12 +41,13 @@ DrawHeartPieceGFX:
PHA : PHX
TAX
LDA.l SpriteProperties_standing_width,X : BNE +
PLX
LDA.w SpriteControl, X : ORA.b #$20 : STA.w SpriteControl, X
PLX : PLA
BRA .draw
+
PLX : PLA
PLX
.draw
PLA
JSL.l DrawDynamicTile
JSL.l Sprite_DrawShadowLong
.done

View File

@@ -473,6 +473,7 @@ ItemBehavior:
.free_map
REP #$20
LSR
AND.w #$000F : ASL : TAX
LDA.w DungeonItemIDMap,X : TAX
LDA.l DungeonMask,X : ORA.l MapField : STA.l MapField
@@ -485,6 +486,7 @@ ItemBehavior:
.free_compass
REP #$20
LSR
AND.w #$000F : ASL : TAX
LDA.w DungeonItemIDMap,X : TAX
LDA.l DungeonMask,X : ORA.l CompassField : STA.l CompassField
@@ -497,6 +499,7 @@ ItemBehavior:
.free_bigkey
REP #$20
LSR
AND.w #$000F : ASL : TAX
LDA.w DungeonItemIDMap,X : TAX
LDA.l DungeonMask,X : ORA.l BigKeyField : STA.l BigKeyField
@@ -509,6 +512,7 @@ ItemBehavior:
.free_smallkey
REP #$20
LSR
AND.w #$000F : TAX
ASL : CMP.w DungeonID : BEQ .same_dungeon
LSR : TAX

View File

@@ -83,11 +83,9 @@ LoadDynamicTileOAMTable:
.narrow
REP #$20
LDA.w #$0400 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14
LDA.w #$0000 : STA.l SpriteOAM+7 : STA.l SpriteOAM+14
LDA.w #$0800 : STA.l SpriteOAM+9
LDA.w #$3400 : STA.l SpriteOAM+11
SEP #$20
LDA.b #$04 : STA.l SpriteOAM
.done
PLX