Character encoding (Generation III): Difference between revisions

m (→‎English: missed a non-English western symbol)
Line 220: Line 220:


==Control characters==
==Control characters==
{{incomplete|section|Full description of ALL the ways to use 0xFC.<br>Reason 2: How 0xFD works (how/what different variables it can access)}}
The characters 0xFA to 0xFF are {{wp|control characters}}.
* 0xFA and 0xFB both mark a prompt for the player to press a button to continue the dialogue. However, they will print the new line of dialogue differently: 0xFA will scroll the previous dialogue up one line before printing the next line, while 0xFB will clear the dialogue box entirely.
* 0xFA and 0xFB both mark a prompt for the player to press a button to continue the dialogue. However, they will print the new line of dialogue differently: 0xFA will scroll the previous dialogue up one line before printing the next line, while 0xFB will clear the dialogue box entirely.
* 0xFC is an {{wp|escape character}} that leads to several different functions.
* 0xFC is an {{wp|escape character}} that leads to several different functions.
**When followed by 0x01, it will change the color of the text, depending on the byte following. This byte can be anything between 00 and 0F, with the available colors as shown below.
**When followed by 0x02, the text will be highlighted, depending on the byte following. Valid bytes are identical to the ones specified above.
**When followed by 0x03, the text's shadow will have its color changed, depending on the byte following. This follows the same color table as listed above.
**When followed by 0x04, the text will be colored and highlighted. The byte immediately following determines the text's color, while a second byte afterward will determine the highlight color. Colors follow the same table as previously stated.
**When followed by 0x06, the text will change size, depending on the byte following. 0x00 will make the font smaller, while anything else will make the font the default size.
**When followed by 0x08 and another byte, it produces a pause in the text. The byte after 0x08 determines the length of the pause.
**When followed by 0x09, the game will pause text display, and resume upon pressing a button.
**When followed by 0x0C, it will escape the byte that follows 0x0C if it is a control character and print a new character. If the second byte after 0xFC is not a control character byte, that byte prints normally.
**When followed by 0x0C, it will escape the byte that follows 0x0C if it is a control character and print a new character. If the second byte after 0xFC is not a control character byte, that byte prints normally.
***When the third byte is 0xFA, "➡" is produced.
***When the third byte is 0xFA, "➡" is produced.
***When the third byte is 0xFB, "+" is produced (though in the Japanese games, within the [[Options]] screen, it produces "=").
***When the third byte is 0xFB, "+" is produced (though in the Japanese games, within the [[Options]] screen, it produces "=").
***The other control characters do not produce any characters. In the English games, nothing is printed, while in the Japanese games, miscellaneous data appears to be printed.
***The other control characters do not produce any characters. In the English games, nothing is printed, while in the Japanese games, miscellaneous data appears to be printed.
**When followed by 0x08 and another byte, it produces a pause in the text. The byte after 0x08 determines the length of the pause.
**When followed by 0x0D, the text will be shifted by a certain amount of pixels, depending on the byte following this one. The effect wears off upon entering a new line.
**When followed by 0x10, music will begin to play. Music is specified by the two bytes following, in [[wp:Endianness|little endian]] format.
**When followed by 0x15, text will be rendered slightly larger and more spread out.
**When followed by 0x16, text will be rendered at the default size and spread.
**When followed by 0x17, music will be paused.
**When followed by 0x18, music will resume playing.
* 0xFD is an escape character for variables, such as the player's name or a Pokémon's name.
* 0xFD is an escape character for variables, such as the player's name or a Pokémon's name.
**When followed by 0x1, the player's name is displayed.
**When followed by 0x2, 0x3, or 0x4, the three buffers will be displayed. Text is assigned to one of three buffers using a variety of script commands.
**When followed by 0x6, the rival's name is displayed.
**When followed by 0x7, the game's name will be displayed.{{sup/3|RSE}}
**When followed by 0x8, the name of the villainous team will be displayed.{{sup/3|RSE}}
**When followed by 0x9, the name of the non-villainous team will be dsiplayed.{{sup/3|RSE}}
**When followed by 0xA, the name of the villainous team's leader will be displayed.{{sup/3|RSE}}
**When followed by 0xB, the name of the non-villainous team's leader will be displayed.{{sup/3|RSE}}
**When followed by 0xC, the name of the villainous team's legendary Pokémon will be displayed.{{sup/3|RSE}}
**When followed by 0xD, the name of the opposing legendary Pokémon will be displayed.{{sup/3|RSE}}
* 0xFE is a line break.
* 0xFE is a line break.
* 0xFF is a terminator, marking the ends of strings.
* 0xFF is a terminator, marking the ends of strings.
A table of available text, highlight, and shadow colors is shown below.
{| style="border: 1px solid #999; border-collapse: collapse;"
|- style="background: #ccc;"
! Byte
! style="width:80px" | {{gameabbrev3|RS}}
! style="width:80px" | {{gameabbrev3|FRLG}}
! style="width:80px" | {{gameabbrev3|E}}
|-
| 0x00
| Transparent
| style="background: #FFF" |
| style="background: #FFF" |
|-
| 0x01
| style="background: #444" |   
| style="background: #FFF" |
| style="background: #FFF" |
|-
| 0x02
| style="background: #F00" |   
| style="background: #666" |   
| style="background: #666" |   
|-
| 0x03
| style="background: #0F0" |
| style="background: #DDD" |
| style="background: #DDD" |
|-
| 0x04
| style="background: #00F" |
| style="background: #F00" |
| style="background: #F00" |
|-
| 0x05
| style="background: #FF0" |
| style="background: #FB7" |
| style="background: #FB7" |
|-
| 0x06
| style="background: #0FF" |
| style="background: #290" |
| style="background: #290" |
|-
| 0x07
| style="background: #F0F" |
| style="background: #9F9" |
| style="background: #9F9" |
|-
| 0x08
| style="background: #DDD" |
| style="background: #35C" |
| style="background: #35C" |
|-
| 0x09
| style="background: #000" |
| style="background: #ACF" |
| style="background: #ACF" |
|-
| 0x0A
| style="background: #000" |
| style="background: #FFF" |
| style="background: #FFF" |
|-
| 0x0B
| style="background: #EEE" |
| style="background: #DEF" |
| style="background: #EEE" |
|-
| 0x0C
| style="background: #FFF" |
| style="background: #ADE" |
| style="background: #FFF" |
|-
| 0x0D
| style="background: #9CF" |
| style="background: #EFF" |
| style="background: #0F9" |
|-
| 0x0E
| style="background: #7BE" |
| style="background: #7AC" |
| style="background: #0CB" |
|-
| 0x0F
| style="background: #FFF" |
| style="background: #47A" |
| style="background: #47A" |
|}


==Trivia==
==Trivia==
22

edits