summaryrefslogtreecommitdiff
path: root/engine/items
diff options
context:
space:
mode:
authorIIMarckus <iimarckus@gmail.com>2015-02-04 00:51:25 -0700
committerIIMarckus <iimarckus@gmail.com>2015-02-04 00:51:25 -0700
commit01e314f4f5b7de2f5ad00dd017ad44514ba71e48 (patch)
treee8653c548dcc82d34d5dd79bff0a1f243855ccac /engine/items
parenta53b3ca5614855ab9be5991230a73f1f3d6cc442 (diff)
parentc3a5bb70d2c65b7fe6033ee9bfb8fe89b6a3e431 (diff)
Merge branch 'master' of /tmp/a/pokered
Diffstat (limited to 'engine/items')
-rwxr-xr-xengine/items/tm_prices.asm11
1 files changed, 7 insertions, 4 deletions
diff --git a/engine/items/tm_prices.asm b/engine/items/tm_prices.asm
index c55a25b4..7c5c56fa 100755
--- a/engine/items/tm_prices.asm
+++ b/engine/items/tm_prices.asm
@@ -1,5 +1,8 @@
GetMachinePrice: ; 7bf86 (1e:7f86)
- ld a, [wcf91]
+; Input: [wcf91] = Item Id of a TM
+; Output: Stores the 2-byte TM price in [H_DOWNARROWBLINKCNT1] and [H_DOWNARROWBLINKCNT2]
+; as a BCD
+ ld a, [wcf91] ; a contains TM item id
sub TM_01
ret c
ld d, a
@@ -8,11 +11,11 @@ GetMachinePrice: ; 7bf86 (1e:7f86)
ld c, a
ld b, 0
add hl, bc
- ld a, [hl]
+ ld a, [hl] ; a contains byte whose high or low nybble is the TM price (in thousands)
srl d
- jr nc, .asm_7bf9d
+ jr nc, .highNybbleIsPrice ; is TM id odd?
swap a
-.asm_7bf9d
+.highNybbleIsPrice
and $f0
ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
xor a