shithub: pokered

Download patch

ref: ea05c44163f753b9f507535d8ee549a4d43a4410
parent: f16f07c5ca38fa269972dfecab7dbae50e0a73ff
author: yenatch <yenatch@gmail.com>
date: Tue May 27 07:09:08 EDT 2014

Add macro TX_BCD for printing BCD numbers.

This fixes some more static wram addresses.

--- a/macros.asm
+++ b/macros.asm
@@ -131,6 +131,12 @@
 	dw \1
 	ENDM
 
+TX_BCD: MACRO
+	db $2
+	dw \1
+	db \2
+	ENDM
+
 ; Predef macro.
 PREDEF: MACRO
 	ld a, (\1 - PredefPointers) / 3
--- a/text.asm
+++ b/text.asm
@@ -992,13 +992,13 @@
 _FoundHiddenCoinsText:: ; 8950b (22:550b)
 	text $52, " found"
 	line "@"
-	db $2, $a0, $ff, $c2 ; XXX $2
+	TX_BCD $ffa0, $c2
 	text " coins!@@"
 
 _FoundHiddenCoins2Text:: ; 89523 (22:5523)
 	text $52, " found"
 	line "@"
-	db $2, $a0, $ff, $c2 ; XXX $2 probably coins
+	TX_BCD $ffa0, $c2
 	text " coins!@@"
 
 _DroppedHiddenCoinsText:: ; 8953b (22:553b)
@@ -1091,8 +1091,7 @@
 
 _MoneyForWinningText:: ; 896dd (22:56dd)
 	text $52, " got ¥@"
-	;XXX $2
-	db $2, $79, $d0, $c3
+	TX_BCD wd079, $c3
 	db $0
 	line "for winning!"
 	prompt
@@ -1549,12 +1548,10 @@
 	prompt
 
 ; money related
-; XXX $2 BCD macro
-; $2, pointer, byte
 _PickUpPayDayMoneyText:: ; 89d80 (22:5d80)
 	text $52, " picked up"
 	line "¥@"
-	db $2, $e5, $cc, $c3
+	TX_BCD wcce5, $c3
 	text "!"
 	prompt
 
@@ -2468,7 +2465,7 @@
 	text "?"
 	line "That will be"
 	cont "¥@"
-	db $2, $9f, $ff, $c3
+	TX_BCD $ff9f, $c3
 	text ". OK?"
 	done
 
@@ -2495,7 +2492,7 @@
 _PokemartTellSellPriceText:: ; a26ae (28:66ae)
 	text "I can pay you"
 	line "¥@"
-	db $2, $9f, $ff, $c3 ; XXX
+	TX_BCD $ff9f, $c3
 	text " for that."
 	done
 
@@ -2881,7 +2878,7 @@
 _CoinCaseNumCoinsText:: ; a6940 (29:6940)
 	text "Coins"
 	line "@"
-	db $2, $a4, $d5, $c2 ; print BCD number
+	TX_BCD wPlayerCoins, $c2
 	text " "
 	prompt
 
--- a/text/maps/daycare_1.asm
+++ b/text/maps/daycare_1.asm
@@ -41,7 +41,7 @@
 
 _DayCareMText_56428:: ; 8ac7d (22:6c7d)
 	text "You owe me ¥@"
-	db $2, $3f, $cd, $c2
+	TX_BCD wcd3f, $c2
 	db $0
 	line "for the return"
 	cont "of this #MON."
--- a/wram.asm
+++ b/wram.asm
@@ -368,6 +368,7 @@
 wTrainerEngageDistance:: ; cd3e
 	ds 1
 wTrainerFacingDirection:: ; cd3f
+wcd3f::
 	ds 1
 wTrainerScreenY:: ; cd40
 	ds 1