Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master Keys #7

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion shopkeeper.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion stats.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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
;--------------------------------------------------------------------------------
Expand Down
5 changes: 4 additions & 1 deletion tables.asm
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down