From a63aa6f5fee8eb65fbf67116503faa35a7a7c256 Mon Sep 17 00:00:00 2001 From: aerinon Date: Mon, 1 Feb 2021 16:29:09 -0700 Subject: [PATCH] Shop fixes --- events.asm | 2 +- inventory.asm | 8 +++++--- shopkeeper.asm | 26 ++++++++++++++------------ 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/events.asm b/events.asm index 31bfda3..c9ffa67 100644 --- a/events.asm +++ b/events.asm @@ -88,7 +88,7 @@ RTL OnFileLoad: REP #$10 ; set 16 bit index registers JSL.l EnableForceBlank ; what we wrote over - REP #$20 : LDA.l $30F010 : STA.l $7EF33E : SEP $#20 + REP #$20 : LDA.l $30F010 : STA.l $7EF33E : SEP #$20 LDA.b #$07 : STA $210c ; Restore screen 3 to normal tile area diff --git a/inventory.asm b/inventory.asm index 35c0c5a..bedd126 100644 --- a/inventory.asm +++ b/inventory.asm @@ -260,9 +260,11 @@ AddInventory: ; don't count any of this stuff CPY.b #$20 : BNE + : BRL .itemCounts : + ; Crystal CPY.b #$26 : BNE + : BRL .itemCounts : + ; Heart Piece Completion Heart - CPY.b #$2E : BNE + : BRL .itemCounts : + ; Red Potion (Refill) - CPY.b #$2F : BNE + : BRL .itemCounts : + ; Green Potion (Refill) - CPY.b #$30 : BNE + : BRL .itemCounts : + ; Blue Potion (Refill) + LDA.l !SHOP_ENABLE_COUNT : BNE ++ + CPY.b #$2E : BNE + : BRL .itemCounts : + ; Red Potion (Refill) + CPY.b #$2F : BNE + : BRL .itemCounts : + ; Green Potion (Refill) + CPY.b #$30 : BNE + : BRL .itemCounts : + ; Blue Potion (Refill) + ++ CPY.b #$37 : BNE + : BRL .itemCounts : + ; Pendant CPY.b #$38 : BNE + : BRL .itemCounts : + ; Pendant CPY.b #$39 : BNE + : BRL .itemCounts : + ; Pendant diff --git a/shopkeeper.asm b/shopkeeper.asm index db61bbe..8c95b74 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -896,20 +896,22 @@ Shopkeeper_DrawNextPrice: INY : LDA ($02), Y : STA !COLUMN_HIGH PLY LDA.l !SHOP_INVENTORY+1, X : STA $0C ; set value - - JSR.w DrawPrice - SEP #$20 : STA $06 : STZ $07 ; set 8-bit accumulator & store result - PHA - LDA.b #!BIGRAM : STA $08 - LDA.b #!BIGRAM>>8 : STA $09 - LDA.b #$7E : PHA : PLB ; set data bank to $7E - PHX : PHA : LDA !SCRATCH_TEMP_X : TAX : PLA : JSL.l Sprite_DrawMultiple_quantity_preset : PLX + BEQ .free + JSR.w DrawPrice + SEP #$20 : STA $06 : STZ $07 ; set 8-bit accumulator & store result + PHA + LDA.b #!BIGRAM : STA $08 + LDA.b #!BIGRAM>>8 : STA $09 + LDA.b #$7E : PHA : PLB ; set data bank to $7E - LDA 1,s - ASL #2 : !ADD $90 : STA $90 ; increment oam pointer - PLA - !ADD $92 : STA $92 + PHX : PHA : LDA !SCRATCH_TEMP_X : TAX : PLA : JSL.l Sprite_DrawMultiple_quantity_preset : PLX + + LDA 1,s + ASL #2 : !ADD $90 : STA $90 ; increment oam pointer + PLA + !ADD $92 : STA $92 + .free PLP : PLY : PLX PLB RTS