2017-12-12 18:51:07 +00:00
# Text Commands
2019-03-11 03:00:01 +00:00
Defined in [macros/scripts/text.asm ](https://github.com/pret/pokecrystal/blob/master/macros/scripts/text.asm ) and [home/text.asm:TextCommands ](https://github.com/pret/pokecrystal/blob/master/home/text.asm ).
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$00`: `text_start`
2017-12-12 18:51:07 +00:00
2018-11-17 18:33:03 +00:00
Start writing text until `"@"` . The text can use [control characters ](#control-characters ).
2017-12-12 18:51:07 +00:00
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$01`: <code>text_ram <i>address</i></code>
2017-12-12 18:51:07 +00:00
Write text from a RAM address.
2017-12-15 00:04:44 +00:00
2018-01-17 18:58:50 +00:00
## `$02`: <code>text_bcd <i>address</i>, <i>flags</i></code>
2017-12-12 18:51:07 +00:00
2017-12-25 02:27:20 +00:00
Write [BCD][bcd] from an address, typically RAM.
2017-12-12 23:50:39 +00:00
[bcd]: https://en.wikipedia.org/wiki/Binary-coded_decimal
2017-12-12 18:51:07 +00:00
2017-12-15 00:04:44 +00:00
2018-01-17 18:58:50 +00:00
## `$03`: <code>text_move <i>address</i></code>
2017-12-12 18:51:07 +00:00
Move to a new tile.
2017-12-15 00:04:44 +00:00
2018-01-17 18:58:50 +00:00
## `$04`: <code>text_box <i>address</i>, <i>height</i>, <i>width</i></code>
2017-12-12 18:51:07 +00:00
Draw a box.
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$05`: `text_low`
Write text at (1, 16).
2017-12-15 00:04:44 +00:00
2019-11-03 17:48:54 +00:00
## `$06`: `text_promptbutton`
2017-12-12 18:51:07 +00:00
Wait for button press; show arrow.
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$07`: `text_scroll`
Pushes text up two lines and sets the `bc` cursor to the border tile below the
first character column of the text box.
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$08`: `text_asm`
2017-12-12 18:51:07 +00:00
Start interpreting assembly code.
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$09`: <code>text_decimal <i>address</i>, <i>bytes</i>, <i>digits</i></code>
2017-12-12 18:51:07 +00:00
Read *bytes* bytes from *address* and print them as a *digits* -digit number.
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$0A`: `text_pause`
2017-12-12 18:51:07 +00:00
2018-11-17 18:33:03 +00:00
Pause for 30 frames unless A or B is pressed.
2017-12-12 18:51:07 +00:00
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$0B`: `sound_dex_fanfare_50_79`
Play `SFX_DEX_FANFARE_50_79` .
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$0C`: <code>text_dots <i>n</i></code>
2017-12-12 18:51:07 +00:00
2018-11-17 18:33:03 +00:00
Print *n* `"…"` s, pausing for 10 frames after each; interrupt if A or B is pressed.
2017-12-12 18:51:07 +00:00
2017-12-15 00:04:44 +00:00
2019-11-03 17:48:54 +00:00
## `$0D`: `text_linkpromptbutton`
2017-12-12 18:51:07 +00:00
Wait for button press; show arrow.
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$0E`: `sound_dex_fanfare_20_49`
Play `SFX_DEX_FANFARE_20_49` .
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$0F`: `sound_item`
Play `SFX_ITEM` .
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$10`: `sound_caught_mon`
Play `SFX_CAUGHT_MON` .
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$11`: `sound_dex_fanfare_80_109`
Play `SFX_DEX_FANFARE_80_109` .
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$12`: `sound_fanfare`
Play `SFX_FANFARE` .
2017-12-15 00:04:44 +00:00
2017-12-12 18:51:07 +00:00
## `$13`: `sound_slot_machine_start`
Play `SFX_SLOT_MACHINE_START` .
2017-12-15 00:04:44 +00:00
2018-01-17 18:58:50 +00:00
## `$14`: <code>text_buffer <i>id</i></code>
2017-12-12 18:51:07 +00:00
2019-03-11 03:00:01 +00:00
Write text from one of the following addresses (listed in [data/text_buffers.asm ](https://github.com/pret/pokecrystal/blob/master/data/text_buffers.asm )):
2017-12-12 18:51:07 +00:00
0. `StringBuffer3`
1. `StringBuffer4`
2. `StringBuffer5`
3. `StringBuffer2`
4. `StringBuffer1`
5. `EnemyMonNick`
6. `BattleMonNick`
2017-12-15 00:04:44 +00:00
2018-11-17 18:33:03 +00:00
## `$15`: `text_today`
2017-12-12 18:51:07 +00:00
Print the weekday.
2017-12-15 00:04:44 +00:00
2018-11-12 02:42:10 +00:00
## `$16`: <code>text_far <i>address</i></code>
2017-12-12 18:51:07 +00:00
Write text from a different bank.
2018-01-18 23:34:20 +00:00
2018-11-17 18:33:03 +00:00
## `$50`: `text_end`
Stops processing text commands.
2018-01-18 23:34:20 +00:00
2018-11-17 18:33:03 +00:00
# Control characters
These get interpreted in the context of printing regular text. Macros exist to conveniently place the control characters.
## `$00`: <code>text <i>text</i></code>
Start writing text until `"@"` . (Not actually a control character, but shorter than `text_start` followed by `db` .)
## `$4E`, `"<NEXT>"`: <code>next <i>text</i></code>
Move a line down.
## `$4F`, `"<LINE>"`: <code>line <i>text</i></code>
Start writing at the bottom line.
## `$50`, `"@"`: <code>page <i>text</i></code>
Start a new Pokédex page.
## `$51`, `"<PARA>"`: <code>para <i>text</i></code>
Start a new paragraph.
## `$55`, `"<CONT>"`: <code>cont <i>text</i></code>
Scroll to the next line.
## `$57`, `"<DONE>"`: `done`
End a text box.
## `$58`, `"<PROMPT>"`: `prompt`
Prompt the player to end a text box (initiating some other event).