shithub: pokecrystal

Download patch

ref: 8153737bae7169d42b8937c5dc7eec6f669acbb2
parent: ed29db5841849345c5971a9b08681dfb6560c07d
author: PikalaxALT <PikalaxALT@gmail.com>
date: Fri Oct 30 06:34:35 EDT 2015

Enumerate text constants

--- a/home/text.asm
+++ b/home/text.asm
@@ -1057,13 +1057,13 @@
 ; 152d
 
 TextSFX:: ; 152d
-	dbw $0b, SFX_DEX_FANFARE_50_79
-	dbw $12, SFX_FANFARE
-	dbw $0e, SFX_DEX_FANFARE_20_49
-	dbw $0f, SFX_ITEM
-	dbw $10, SFX_CAUGHT_MON
-	dbw $11, SFX_DEX_FANFARE_80_109
-	dbw $13, SFX_SLOT_MACHINE_START
+	dbw TX_SOUND_0B, SFX_DEX_FANFARE_50_79
+	dbw TX_SOUND_12, SFX_FANFARE
+	dbw TX_SOUND_0E, SFX_DEX_FANFARE_20_49
+	dbw TX_SOUND_0F, SFX_ITEM
+	dbw TX_SOUND_10, SFX_CAUGHT_MON
+	dbw TX_SOUND_11, SFX_DEX_FANFARE_80_109
+	dbw TX_SOUND_13, SFX_SLOT_MACHINE_START
 	db -1
 ; 1543
 
@@ -1122,11 +1122,11 @@
 	push hl
 	ld e, a
 	ld d, 0
-	ld hl, Unknown_24000
+	ld hl, StringBufferPointers
 rept 2
 	add hl, de
 endr
-	ld a, BANK(Unknown_24000)
+	ld a, BANK(StringBufferPointers)
 	call GetFarHalfword
 	ld d, h
 	ld e, l
--- a/macros/enum.asm
+++ b/macros/enum.asm
@@ -18,6 +18,10 @@
 __enum__ = __enum__ + __enumdir__
 endm
 
+enum_set: macro
+__enum__ = \1
+endm
+
 
 ; Enumerate constants
 
--- a/macros/text.asm
+++ b/macros/text.asm
@@ -12,72 +12,127 @@
 dex    EQUS "db $e8, $50" ; End a Pokedex entry.
 
 
-TX_RAM EQU $01
-TX_FAR EQU $16
+; TX_RAM EQU $01
+; TX_FAR EQU $16
+	enum_start 1
+	enum TX_RAM
+text_from_ram: MACRO
+	db TX_RAM
+	dw \1
+	ENDM
+	
+	enum TX_BCD
+text_bcd: macro
+	db TX_BCD
+	dw \1
+	db \2
+	ENDM
 
-text_jump: MACRO
-	db TX_FAR
+	enum TX_MOVE
+text_move: macro
+	db TX_MOVE
 	dw \1
-	db BANK(\1)
 	ENDM
 
-text_from_ram: MACRO
-	db TX_RAM
+	enum TX_BOX
+text_box: macro
+	db TX_BOX
 	dw \1
+	db \2, \3
 	ENDM
 
-text_dunno1: macro
-	db 5
+	enum TX_LOW
+text_low: macro
+	db TX_LOW
 	endm
 
+	enum WAIT_BUTTON
 text_waitbutton: macro
-	db 6
+	db WAIT_BUTTON
 	endm
 
-text_dunno2: macro
-	db 7
+	enum TX_SCROLL
+text_scroll: macro
+	db TX_SCROLL
 	endm
 
+	enum START_ASM
 start_asm: macro
-	db 8
+	db START_ASM
 	endm
 
+	enum TX_NUM
 deciram: macro
-	db 9
-	dw \1
-	db \2
+	db TX_NUM
+	dw \1 ; address
+	dn \2, \3 ; bytes, digits
 	endm
 
+	enum TX_EXIT
 interpret_data: macro
-	db 10
+	db TX_EXIT
 	endm
 
+	enum TX_SOUND_0B
 sound0: macro
-	db 11
+	db TX_SOUND_0B
 	endm
 
+	enum TX_DOTS
 limited_interpret_data: macro
-	db 12
+	db TX_DOTS
 	db \1
 	endm
 
+	enum TX_LINK_WAIT_BUTTON
+link_wait_button: macro
+	db TX_LINK_WAIT_BUTTON
+	endm
+
+	enum TX_SOUND_0E
+sound1: macro
+	db TX_SOUND_0E
+	endm
+
+	enum TX_SOUND_0F
 sound0x0F: macro
-	db $f
+	db TX_SOUND_0F
 	endm
 
+	enum TX_SOUND_10
 sound0x02: macro
-	db $10
+	db TX_SOUND_10
 	endm
 
+	enum TX_SOUND_11
 sound0x0A: macro
-	db $11
+	db TX_SOUND_11
 	endm
 
+	enum TX_SOUND_12
+sound0x12: macro
+	db TX_SOUND_12
+	endm
+
+	enum TX_SOUND_13
 sound0x2C: macro
 	db $13
 	endm
 
+	enum TX_STRINGBUFFER
+text_buffer: macro
+	db TX_STRINGBUFFER
+	db \1
+	endm
+
+	enum TX_DAY
 current_day: macro
-	db $15
+	db TX_DAY
 	endm
 
+	enum TX_FAR
+text_jump: MACRO
+	db TX_FAR
+	dw \1
+	db BANK(\1)
+	ENDM
--- a/main.asm
+++ b/main.asm
@@ -21990,7 +21990,7 @@
 
 SECTION "bank9", ROMX, BANK[$9]
 
-Unknown_24000:: ; 24000
+StringBufferPointers:: ; 24000
 	dw StringBuffer3
 	dw StringBuffer4
 	dw StringBuffer5
--- a/maps/BattleTower1F.asm
+++ b/maps/BattleTower1F.asm
@@ -734,7 +734,7 @@
 	text "One or more of"
 	line "your #MON's"
 	cont "levels exceeds @"
-	deciram ScriptVar, $13
+	deciram ScriptVar, 1, 3
 	text "."
 	done
 
@@ -746,7 +746,7 @@
 
 	para "This BATTLE ROOM"
 	line "is for L@"
-	deciram ScriptVar, $13
+	deciram ScriptVar, 1, 3
 	text "."
 	done
 
--- a/text/battle.asm
+++ b/text/battle.asm
@@ -1,7 +1,7 @@
 BattleText_0x80730: ; 0x80730
 	text "<PLAYER> picked up"
 	line "¥@"
-	deciram wPayDayMoney, $36
+	deciram wPayDayMoney, 3, 6
 	text "!"
 	prompt
 ; 0x80746
@@ -99,7 +99,7 @@
 PerishCountText: ; 0x80864
 	text "<USER>'s"
 	line "PERISH count is @"
-	deciram wd265, $11
+	deciram wd265, 1, 1
 	text "!"
 	prompt
 ; 0x80880
@@ -194,7 +194,7 @@
 
 GotMoneyForWinningText:
 	text "<PLAYER> got ¥@"
-	deciram wc686, $36
+	deciram wc686, 3, 6
 	text ""
 	line "for winning!"
 	prompt
@@ -213,7 +213,7 @@
 
 SentSomeToMomText:
 	text "<PLAYER> got ¥@"
-	deciram wc686, $36
+	deciram wc686, 3, 6
 	text ""
 	line "for winning!"
 	cont "Sent some to MOM!"
@@ -394,7 +394,7 @@
 	text_from_ram StringBuffer1
 	text " grew to"
 	line "level @"
-	deciram CurPartyLevel, $13
+	deciram CurPartyLevel, 1, 3
 	text "!@"
 	sound0
 	db "@"
@@ -778,7 +778,7 @@
 	text_from_ram StringBuffer1
 	text " was"
 	cont "reduced by @"
-	deciram wd265, $11
+	deciram wd265, 1, 1
 	text "!"
 	prompt
 ; 0x811a0
@@ -887,7 +887,7 @@
 
 PlayerHitTimesText: ; 0x812e5
 	text "Hit @"
-	deciram PlayerDamageTaken, $11
+	deciram PlayerDamageTaken, 1, 1
 	text " times!"
 	prompt
 ; 0x812f8
@@ -894,7 +894,7 @@
 
 EnemyHitTimesText: ; 0x812f8
 	text "Hit @"
-	deciram EnemyDamageTaken, $11
+	deciram EnemyDamageTaken, 1, 1
 	text " times!"
 	prompt
 ; 0x8130b
@@ -1203,7 +1203,7 @@
 
 MagnitudeText: ; 0x81751
 	text "Magnitude @"
-	deciram wd265, $11
+	deciram wd265, 1, 1
 	text "!"
 	prompt
 ; 0x81764
--- a/text/common_2.asm
+++ b/text/common_2.asm
@@ -48,7 +48,7 @@
 	text_from_ram StringBuffer1
 	text ""
 	line "recovered @"
-	deciram wd1f3, $23
+	deciram wd1f3, 2, 3
 	text "HP!"
 	done
 ; 0x1bc0bb
@@ -106,7 +106,7 @@
 	text_from_ram StringBuffer1
 	text " grew to"
 	line "level @"
-	deciram CurPartyLevel, $13
+	deciram CurPartyLevel, 1, 3
 	text "!@"
 	sound0
 	text_waitbutton
@@ -1381,7 +1381,7 @@
 UnknownText_0x1bd0d8: ; 0x1bd0d8
 	text "The compatibility"
 	line "is @"
-	deciram wd265, $13
+	deciram wd265, 1, 3
 	text "."
 	cont "Should they breed?"
 	done
@@ -1402,7 +1402,7 @@
 UnknownText_0x1bd131: ; 0x1bd131
 	text "Test event"
 	line "@"
-	deciram StringBuffer2, $12
+	deciram StringBuffer2, 1, 2
 	text "?"
 	done
 ; 0x1bd145
@@ -1456,7 +1456,7 @@
 	text_from_ram StringBuffer2
 	text "'s CARD was"
 	line "listed as no.@"
-	deciram StringBuffer1, $12
+	deciram StringBuffer1, 1, 2
 	text "."
 	prompt
 ; 0x1bd201
@@ -2049,13 +2049,13 @@
 
 	para "By level, it's"
 	line "grown by @"
-	deciram StringBuffer2 + 1, $13
+	deciram StringBuffer2 + 1, 1, 3
 	text "."
 
 	para "If you want your"
 	line "#MON back, it"
 	cont "will cost ¥@"
-	deciram StringBuffer2 + 2, $34
+	deciram StringBuffer2 + 2, 3, 4
 	text "."
 	done
 ; 0x1bde04
--- a/text/common_3.asm
+++ b/text/common_3.asm
@@ -116,7 +116,7 @@
 	text ""
 	line "a boosted"
 	cont "@"
-	deciram StringBuffer2, $24
+	deciram StringBuffer2, 2, 4
 	text " EXP. Points!"
 	prompt
 ; 1c02c9
@@ -124,7 +124,7 @@
 UnknownText_0x1c02c9: ; 1c02c9
 	text ""
 	line "@"
-	deciram StringBuffer2, $24
+	deciram StringBuffer2, 2, 4
 	text " EXP. Points!"
 	prompt
 ; 1c02df
@@ -311,7 +311,7 @@
 	text_from_ram wc850
 	text "'s CARD was"
 	line "listed as no.@"
-	deciram wd265, $12
+	deciram wd265, 1, 2
 	text "."
 	prompt
 ; 1c0555
@@ -708,7 +708,7 @@
 
 UnknownText_0x1c0bbb: ; 1c0bbb
 	text "Throw away @"
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text ""
 	line "@"
 	text_from_ram StringBuffer2
@@ -1056,7 +1056,7 @@
 ; 1c0fbc
 
 UnknownText_0x1c0fbc: ; 1c0fbc
-	deciram wcf64, $13
+	deciram wcf64, 1, 3
 	text " @"
 	text_from_ram StringBuffer1
 	text ""
@@ -1158,7 +1158,7 @@
 	text ""
 	para "The winning score"
 	line "was @"
-	deciram wd004, $23
+	deciram wd004, 2, 3
 	text " points!"
 	prompt
 ; 1c1166
@@ -1179,7 +1179,7 @@
 	text ""
 	para "The score was"
 	line "@"
-	deciram wd008, $23
+	deciram wd008, 2, 3
 	text " points!"
 	prompt
 ; 1c11b5
@@ -1200,7 +1200,7 @@
 	text ""
 	para "The score was"
 	line "@"
-	deciram wd00c, $23
+	deciram wd00c, 2, 3
 	text " points!"
 	prompt
 ; 1c1203
@@ -1293,7 +1293,7 @@
 
 _KrissPCWithdrewItemsText: ; 1c13a4
 	text "Withdrew @"
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text ""
 	line "@"
 	text_from_ram StringBuffer2
@@ -1320,7 +1320,7 @@
 
 _KrissPCDepositItemsText: ; 1c1411
 	text "Deposited @"
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text ""
 	line "@"
 	text_from_ram StringBuffer2
@@ -1610,7 +1610,7 @@
 
 UnknownText_0x1c1aad: ; 1c1aad
 	text "Throw away @"
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text ""
 	line "@"
 	text_from_ram StringBuffer2
--- a/text/common_4.asm
+++ b/text/common_4.asm
@@ -137,7 +137,7 @@
 UnknownText_0x1c439c: ; 0x1c439c
 	text "Today's remaining"
 	line "time is @"
-	deciram StringBuffer2, $12
+	deciram StringBuffer2, 1, 2
 	text " min."
 
 	para "Would you like to"
@@ -147,7 +147,7 @@
 
 UnknownText_0x1c43dc: ; 0x1c43dc
 	text "There are only @"
-	deciram StringBuffer2, $12
+	deciram StringBuffer2, 1, 2
 	text ""
 	line "min. left today."
 
@@ -201,7 +201,7 @@
 UnknownText_0x1c4525: ; 0x1c4525
 	text "Today's remaining"
 	line "time is @"
-	deciram StringBuffer2, $12
+	deciram StringBuffer2, 1, 2
 	text " min."
 	done
 ; 0x1c454b
@@ -537,12 +537,12 @@
 ; 0x1c4c08
 
 UnknownText_0x1c4c08: ; 0x1c4c08
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text " @"
 	text_from_ram StringBuffer2
 	text "(S)"
 	line "will be ¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text "."
 	done
 ; 0x1c4c28
@@ -569,12 +569,12 @@
 ; 0x1c4cae
 
 UnknownText_0x1c4cae: ; 0x1c4cae
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text " @"
 	text_from_ram StringBuffer2
 	text "(S)"
 	line "will be ¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text "."
 	done
 ; 0x1c4cce
@@ -619,7 +619,7 @@
 	text_from_ram StringBuffer2
 	text " costs"
 	line "¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text ". Want it?"
 	done
 ; 0x1c4dcd
@@ -666,12 +666,12 @@
 ; 0x1c4e89
 
 UnknownText_0x1c4e89: ; 0x1c4e89
-	deciram wd10c, $12
+	deciram wd10c, 1, 2
 	text " @"
 	text_from_ram StringBuffer2
 	text "(S)"
 	line "will cost ¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text "."
 	done
 ; 0x1c4eab
@@ -713,7 +713,7 @@
 UnknownText_0x1c4f3e: ; 0x1c4f3e
 	text "I can pay you"
 	line "¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text "."
 
 	para "Is that OK?"
@@ -763,7 +763,7 @@
 
 UnknownText_0x1c502e: ; 0x1c502e
 	text "Got ¥@"
-	deciram hMoneyTemp, $36
+	deciram hMoneyTemp, 3, 6
 	text " for"
 	line "@"
 	text_from_ram StringBuffer2
@@ -1464,7 +1464,7 @@
 UnknownText_0x1c5c5e: ; 0x1c5c5e
 	text "You now have"
 	line "@"
-	deciram wBlueCardBalance, $12
+	deciram wBlueCardBalance, 1, 2
 	text " points."
 	done
 ; 0x1c5c7b
@@ -1472,7 +1472,7 @@
 UnknownText_0x1c5c7b: ; 0x1c5c7b
 	text "Coins:"
 	line "@"
-	deciram Coins, $24
+	deciram Coins, 2, 4
 	db "@"
 ; 0x1c5c89
 
@@ -1587,7 +1587,7 @@
 
 UnknownText_0x1c5e68: ; 0x1c5e68
 	text "<PLAYER> used the@"
-	text_dunno1
+	text_low
 	text_from_ram StringBuffer2
 	text "."
 	done
@@ -1595,7 +1595,7 @@
 
 UnknownText_0x1c5e7b: ; 0x1c5e7b
 	text "<PLAYER> got on the@"
-	text_dunno1
+	text_low
 	text_from_ram StringBuffer2
 	text "."
 	prompt
@@ -1603,7 +1603,7 @@
 
 UnknownText_0x1c5e90: ; 0x1c5e90
 	text "<PLAYER> got off@"
-	text_dunno1
+	text_low
 	text "the @"
 	text_from_ram StringBuffer2
 	text "."