diff --git a/shopkeeper.asm b/shopkeeper.asm index 03fb7b70..680235d9 100644 --- a/shopkeeper.asm +++ b/shopkeeper.asm @@ -700,7 +700,7 @@ Shopkeeper_BuyItem: LDA !SHOP_INVENTORY+2, X : AND.b #$07 ; if bit 80, it's custom, if numbers 0-7, custom resource ; store shop index, get resource offset (X), load val, pop shop index, cmp val to shop_price... PHX : TAX : LDA ResourceOffset, X : TAX : TAY : LDA $7EF300, X ; fumble around with our resource value and price, sub value then put back into RAM - PLX : CMP !SHOP_INVENTORY+1,X : BMI + ; if resource is less than value, skip + PLX : CMP !SHOP_INVENTORY+1,X : BCC + ; if resource is less than value, skip ; If hearts, ensure hearts are greater than the price BNE .notEqual : CPY #$6D : BEQ .cant_afford .notEqual diff --git a/stats.asm b/stats.asm index e839b763..9aa27c2e 100644 --- a/stats.asm +++ b/stats.asm @@ -253,7 +253,15 @@ IncrementSmallKeysNoPrimary: RTL ;-------------------------------------------------------------------------------- DecrementSmallKeys: - STA $7EF36F ; thing we wrote over, write small key count + PHA : PHP + SEP #$20 + LDA ReusableSmallKeys : BNE + ; if reusable small keys, do not decrement + PLP : PLA + STA $7EF36F ; write small key count + BRA ++ + + + PLP : PLA + ++ JSL.l UpdateKeys RTL ;-------------------------------------------------------------------------------- diff --git a/tables.asm b/tables.asm index e03de986..d9978afe 100644 --- a/tables.asm +++ b/tables.asm @@ -1918,8 +1918,11 @@ db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, db #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00, #$00 ;-------------------------------------------------------------------------------- -; 0x186380 - 187FFF (unused) +; 0x186380 - 187FFD (unused) ;-------------------------------------------------------------------------------- +org $30EFFE ; PC 0x186FFE +ReusableSmallKeys: +db #$00 org $30EFFF ; PC 0x186FFF BallNChainDungeon: