aboutsummaryrefslogtreecommitdiffstats
path: root/engine/items/tm_prices.asm
diff options
context:
space:
mode:
authordannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
committerdannye <33dannye@gmail.com>2020-11-04 00:06:44 -0600
commit5647ca687b92954dcf37a6ea6bfbc9a341c32de4 (patch)
treedde1937a1bfdb3a835f4155e1c2eb8f1aaf86f63 /engine/items/tm_prices.asm
parentMerge pull request #55 from Deokishisu/patch-1 (diff)
downloadpokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.gz
pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.tar.xz
pokeyellow-5647ca687b92954dcf37a6ea6bfbc9a341c32de4.zip
Sync with pokered
Diffstat (limited to 'engine/items/tm_prices.asm')
-rwxr-xr-xengine/items/tm_prices.asm14
1 files changed, 7 insertions, 7 deletions
diff --git a/engine/items/tm_prices.asm b/engine/items/tm_prices.asm
index 80e6bf3c..df9761bd 100755
--- a/engine/items/tm_prices.asm
+++ b/engine/items/tm_prices.asm
@@ -1,9 +1,9 @@
-GetMachinePrice:
+GetMachinePrice::
; Input: [wcf91] = Item Id of a TM
; Output: Stores the TM price at hItemPrice
ld a, [wcf91] ; a contains TM item id
- sub TM_01
- ret c
+ sub TM01 ; underflows below 0 for HM items (before TM items)
+ ret c ; HMs are priceless
ld d, a
ld hl, TechnicalMachinePrices
srl a
@@ -16,10 +16,10 @@ GetMachinePrice:
swap a
.highNybbleIsPrice
and $f0
- ld [hItemPrice + 1], a
+ ldh [hItemPrice + 1], a
xor a
- ld [hItemPrice], a
- ld [hItemPrice + 2], a
+ ldh [hItemPrice], a
+ ldh [hItemPrice + 2], a
ret
-INCLUDE "data/tm_prices.asm"
+INCLUDE "data/items/tm_prices.asm"