From 3cf945bad4fdf40c528147a8d1fd9c5565425232 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sat, 24 Jan 2015 12:41:20 -0800 Subject: Better documenting for GetMachinePrice and TechnicalMachinePrices. --- engine/items/tm_prices.asm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'engine') 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 -- cgit v1.2.3