summaryrefslogtreecommitdiff
path: root/engine/items
diff options
context:
space:
mode:
authorMarcus Huderle <huderlem@gmail.com>2015-01-24 12:41:20 -0800
committerMarcus Huderle <huderlem@gmail.com>2015-01-24 12:41:20 -0800
commit3cf945bad4fdf40c528147a8d1fd9c5565425232 (patch)
tree5baa865d3d4f4d172c77069f50b6738222f39f80 /engine/items
parent5b7c8541db9fac9c74508541c9199223fdae4c21 (diff)
Better documenting for GetMachinePrice and TechnicalMachinePrices.
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