Fix GFX transfer, use stack

Fix HUD arrow icon after buying shop arrow
This commit is contained in:
cassidoxa
2023-08-25 12:29:52 -04:00
parent 3f5455b647
commit 5ac2f8c537
5 changed files with 31 additions and 28 deletions

View File

@@ -105,8 +105,8 @@ SpritePrep_ShopKeeper:
LDX.w #$0000
LDY.w #$0000
-
TYA : CMP.l ShopCapacity : !BLT ++ : JMP .stop : ++
LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .stop : ++
TYA : CMP.l ShopCapacity : !BLT ++ : JMP .done : ++
LDA.l ShopContentsTable+1, X : CMP.b #$FF : BNE ++ : JMP .done : ++
LDA.l ShopContentsTable, X : CMP.l ShopId : BEQ ++ : JMP .next : ++
LDA.l ShopContentsTable+1, X : PHX : TYX : STA.l ShopInventory, X : PLX
@@ -143,15 +143,9 @@ SpritePrep_ShopKeeper:
.next
INX #8
JMP -
.stop
REP #$20
LDA.w ItemQueuePtr
DEC #2
AND.w #$00E
STA.w ItemQueuePtr
SEP #$20
.done
SEP #$20
LDA.l ShopType : BIT.b #$20 : BEQ .notTakeAll ; Take-all
.takeAll
@@ -199,19 +193,19 @@ SetupTileTransfer:
TXA : LSR #2
CLC : ADC.w #!FREE_TILE_ALT
.store_target
LDX.w ItemQueuePtr
STA.w ItemTargetQueue,X
LDX.w ItemStackPtr
STA.l ItemTargetStack,X
TYA : ASL : TAX
LDA.l StandingItemGraphicsOffsets,X
LDX.w ItemQueuePtr
STA.w ItemGFXQueue,X
LDX.w ItemStackPtr
STA.l ItemGFXStack,X
TXA
INC #2
AND.w #$000E
STA.w ItemQueuePtr
TDC
STA.l ItemStackPtr
LDA.w #$0000
REP #$10 ; set 16-bit index registers
SEP #$20
RTS