pokered/engine/subtract_paid_money.asm

18 lines
530 B
NASM
Raw Normal View History

2016-09-18 01:17:57 +00:00
; subtracts the amount the player paid from their money
; sets carry flag if there is enough money and unsets carry flag if not
SubtractAmountPaidFromMoney_:
ld de, wPlayerMoney
ld hl, hMoney ; total price of items
ld c, 3 ; length of money in bytes
2016-09-18 01:17:57 +00:00
call StringCmp
ret c
ld de, wPlayerMoney + 2
ld hl, hMoney + 2 ; total price of items
ld c, 3 ; length of money in bytes
2016-09-18 01:17:57 +00:00
predef SubBCDPredef ; subtract total price from money
ld a, MONEY_BOX
ld [wTextBoxID], a
2016-09-18 01:17:57 +00:00
call DisplayTextBoxID ; redraw money text box
and a
ret