mirror of
https://github.com/pret/pokered.git
synced 2024-10-23 23:18:23 +00:00
4b853ad676
Each new file builds its own .o, along with separate main.o and home.o, which necessitates many more "exported::" labels.
17 lines
533 B
NASM
17 lines
533 B
NASM
; subtracts the amount the player paid from their money
|
|
; OUTPUT: carry = 0(success) or 1(fail because there is not enough money)
|
|
SubtractAmountPaidFromMoney_::
|
|
ld de, wPlayerMoney
|
|
ld hl, hMoney ; total price of items
|
|
ld c, 3 ; length of money in bytes
|
|
call StringCmp
|
|
ret c
|
|
ld de, wPlayerMoney + 2
|
|
ld hl, hMoney + 2 ; total price of items
|
|
ld c, 3 ; length of money in bytes
|
|
predef SubBCDPredef ; subtract total price from money
|
|
ld a, MONEY_BOX
|
|
ld [wTextBoxID], a
|
|
call DisplayTextBoxID ; redraw money text box
|
|
and a
|
|
ret
|