summaryrefslogtreecommitdiff
path: root/src/constants/text_constants.asm
diff options
context:
space:
mode:
authorDaniel Harding <33dannye@gmail.com>2018-07-18 17:20:30 -0500
committerGitHub <noreply@github.com>2018-07-18 17:20:30 -0500
commit783f5fe610c69006742b4976ab4f183f39512d89 (patch)
treecdbe7ea8c0430e64a89cad5e93b250f6291677c9 /src/constants/text_constants.asm
parent169dc3d8fdd5603efd1766acd9ad1b8c23093e7f (diff)
parenteb87f849ff7a0ec07a27035fb183234ed04ef540 (diff)
Merge pull request #46 from xCrystal/master
Finish bank 0 disasm ; Text engine and charmaps
Diffstat (limited to 'src/constants/text_constants.asm')
-rw-r--r--src/constants/text_constants.asm113
1 files changed, 45 insertions, 68 deletions
diff --git a/src/constants/text_constants.asm b/src/constants/text_constants.asm
index b5e6e22..3a50b59 100644
--- a/src/constants/text_constants.asm
+++ b/src/constants/text_constants.asm
@@ -1,72 +1,49 @@
-TX_END EQU $00
-TX_SYMBOL EQU $05
-TX_START EQU $06
-TX_RAM1 EQU $09
-TX_LINE EQU "\n" ; $0a
-TX_RAM2 EQU $0B
-TX_RAM3 EQU $0C
+TX_END EQU $00 ; terminates the text
-text EQUS "db TX_START, "
-line EQUS "db TX_LINE, "
-done EQUS "db TX_END"
+; usage: TX_FULLWIDTH*, char1, TX_FULLWIDTH*, char2, ...
+; source: gfx/fonts/full_width/1_kanji2.1bpp
+TX_FULLWIDTH1 EQU $01
+; source: gfx/fonts/full_width/2_kanji3.1bpp
+TX_FULLWIDTH2 EQU $02
+; source: gfx/fonts/full_width/3.1bpp (contains latin letters and symbols)
+TX_FULLWIDTH3 EQU $03
+; source: gfx/fonts/full_width/4.1bpp
+TX_FULLWIDTH4 EQU $04
- charmap "é", "`"
- charmap "♂", "$"
- charmap "♀", "%"
- charmap "”", "\""
+TX_CTRL_START EQU $05
-; TX_SYMBOL (full-tile icons/symbols loaded at the beginning of v0Tiles2)
-; TODO: Use symbols in menus (cursor tile number, tile behind cursor), draw text boxes, WriteByteToBGMap0, etc
-; If user-defined functions ever become a thing a symbol(*) syntax would probably be preferred over SYM_*
+; usage: TX_SYMBOL, char1, TX_SYMBOL, char2, ...
+; source: gfx/fonts/symbols.2bpp
+TX_SYMBOL EQU $05
- charmap "<", TX_SYMBOL
- const_def
- txsymbol SPACE ; $00
- txsymbol FIRE ; $01
- txsymbol GRASS ; $02
- txsymbol LIGHTNING ; $03
- txsymbol WATER ; $04
- txsymbol FIGHTING ; $05
- txsymbol PSYCHIC ; $06
- txsymbol COLORLESS ; $07
- txsymbol POISONED ; $08
- txsymbol ASLEEP ; $09
- txsymbol CONFUSED ; $0a
- txsymbol PARALYZED ; $0b
- txsymbol CURSOR_U ; $0c
- txsymbol POKEMON ; $0d
- txsymbol UNKNOWN_0E ; $0e
- txsymbol CURSOR_R ; $0f
- txsymbol HP ; $10
- txsymbol Lv ; $11
- txsymbol E ; $12
- txsymbol No ; $13
- txsymbol PLUSPOWER ; $14
- txsymbol DEFENDER ; $15
- txsymbol HP_OK ; $16
- txsymbol HP_NOK ; $17
- txsymbol BOX_TOP_L ; $18
- txsymbol BOX_TOP_R ; $19
- txsymbol BOX_BTM_L ; $1a
- txsymbol BOX_BTM_R ; $1b
- txsymbol BOX_TOP ; $1c
- txsymbol BOX_BOTTOM ; $1d
- txsymbol BOX_LEFT ; $1e
- txsymbol BOX_RIGHT ; $1f
- txsymbol 0 ; $20
- txsymbol 1 ; $21
- txsymbol 2 ; $22
- txsymbol 3 ; $23
- txsymbol 4 ; $24
- txsymbol 5 ; $25
- txsymbol 6 ; $26
- txsymbol 7 ; $27
- txsymbol 8 ; $28
- txsymbol 9 ; $29
- txsymbol DOT ; $2a
- txsymbol PLUS ; $2b
- txsymbol MINUS ; $2c
- txsymbol x ; $2d
- txsymbol SLASH ; $2e
- txsymbol CURSOR_D ; $2f
- txsymbol PRIZE ; $30
+; usage: TX_HALFWIDTH, char1, char2, ...
+; source: gfx/fonts/half_width.1bpp
+TX_HALFWIDTH EQU $06 ; sets wFontWidth to HALF_WIDTH
+
+; usage: <half width text>, TX_HALF2FULL, <full width text>
+TX_HALF2FULL EQU $07 ; sets wFontWidth to FULL_WIDTH, and hJapaneseSyllabary to TX_KATAKANA
+
+TX_RAM1 EQU $09 ; prints the player's name or, in a duel, the turn duelist's name
+TX_LINE EQU "\n" ; advances to a new line
+TX_RAM2 EQU $0b ; prints text from wTxRam2 or wTxRam2_b
+TX_RAM3 EQU $0c ; prints a number from wTxRam3 or wTxRam3_b
+
+; usage: TX_FULLWIDTH*, char1, char2, ...
+; sources:
+ ; gfx/fonts/full_width/0_1_hiragana.1bpp (characters below $60)
+ ; gfx/fonts/full_width/0_2_digits_kanji1.1bpp (characters above or equal to $60)
+TX_HIRAGANA EQU $0e ; sets hJapaneseSyllabary to TX_HIRAGANA
+; sources:
+ ; gfx/fonts/full_width/0_0_katakana.1bpp (characters below $60)
+ ; gfx/fonts/full_width/0_2_digits_kanji1.1bpp (characters above or equal to $60)
+TX_KATAKANA EQU $0f ; sets hJapaneseSyllabary to TX_KATAKANA
+
+; db char1, char2, ... defaults to the value at hJapaneseSyllabary, unless
+; wFontWidth was set to HALF_WIDTH by TX_HALFWIDTH (it is FULL_WIDTH by default).
+; hJapaneseSyllabary is TX_KATAKANA by default.
+
+TX_CTRL_END EQU $10
+
+; wFontWidth constants
+FULL_WIDTH EQU $0
+HALF_WIDTH EQU $1 ; non-0