From 6931ce96259d366263c63e704dfaac6f241d8e4a Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 17 Jul 2015 01:21:40 -0700 Subject: money / coins hram constants --- main.asm | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 1bff6a4e..3bc5989a 100755 --- a/main.asm +++ b/main.asm @@ -31,30 +31,30 @@ ResetStatusAndHalveMoneyOnBlackout:: ld [wNPCMovementScriptPointerTableNum], a ld [wFlags_0xcd60], a - ld [$ff9f], a - ld [$ff9f + 1], a - ld [$ff9f + 2], a + ld [hMoney], a + ld [hMoney + 1], a + ld [hMoney + 2], a call HasEnoughMoney jr c, .lostmoney ; never happens ; Halve the player's money. ld a, [wPlayerMoney] - ld [$ff9f], a + ld [hMoney], a ld a, [wPlayerMoney + 1] - ld [$ff9f + 1], a + ld [hMoney + 1], a ld a, [wPlayerMoney + 2] - ld [$ff9f + 2], a + ld [hMoney + 2], a xor a - ld [$ffa2], a - ld [$ffa3], a + ld [hDivideBCDDivisor], a + ld [hDivideBCDDivisor + 1], a ld a, 2 - ld [$ffa4], a + ld [hDivideBCDDivisor + 2], a predef DivideBCDPredef3 - ld a, [$ffa2] + ld a, [hDivideBCDQuotient] ld [wPlayerMoney], a - ld a, [$ffa2 + 1] + ld a, [hDivideBCDQuotient + 1] ld [wPlayerMoney + 1], a - ld a, [$ffa2 + 2] + ld a, [hDivideBCDQuotient + 2] ld [wPlayerMoney + 2], a .lostmoney @@ -789,12 +789,12 @@ INCLUDE "engine/oak_speech2.asm" ; sets carry flag if there is enough money and unsets carry flag if not SubtractAmountPaidFromMoney_: ; 6b21 (1:6b21) ld de,wPlayerMoney - ld hl,$ff9f ; total price of items + 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,$ffa1 ; total price of items + 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 -- cgit v1.2.3