Character encoding (Generation I): Difference between revisions

Replaced table with better representation image
(Replaced table with better representation image)
Line 10: Line 10:


===English===
===English===
Bytes with a dark gray background are not used normally in the English games. Characters with a light gray background are holdovers from the Japanese game but that are not used in the English game.
 
:{| style="text-align: center; border-collapse: collapse" cellpadding="2px" width="375px"
The below image provides more visual clarity and is a snapshot straight from VRAM on how the text engine sees what text codes go to what tiles. The '''upper portion''' show whatever tilemap is loaded into memory and as you can see most of the tilemap is directly accessible. The parts of the tilemap that aren't accessible are special purpose codes such as control codes (like new lines and string termination or null), variables (Like player name, rival name, or Pokemon Names in Battle), and strings (Like Pokédex or PKMN) all of which are represented by 1 byte.
|-
 
! || -0 || -1 || -2 || -3 || -4 || -5 || -6 || -7 || -8 || -9 || -A || -B || -C || -D || -E || -F
The rest of the VRAM memory is all directly accessible and most of it is text or drawing characters. The characters in '''green''' are characters a player can select on the game keyboard. These are always guaranteed to be persistent whenever text is shown and will never render any differently because they are always placed in the same locations in VRAM (Tile 0xE1 will always be the PK tile when text is shown). The characters in '''purple''' are only used by the game to draw a GUI and are not guaranteed to always be there. The characters in '''blue''' are characters used in in-game dialog but are not on the in-game keyboard and are not always guaranteed to be present. The characters in '''red''' are not used at all in the games but are still present and not always guaranteed to be there. The characters in the '''Optional Tilemap Overflow''' are mostly empty and serve as a sort of overflow when game code needs more map tiles to display. One example of this is the Player Badge Screen which uses the tilemap overflow section.
|-
 
! 0-
When a tile that isn't guaranteed to be there is ever not there, the tile underneath it is there whether it be blank or leftover from something else. All tiles 0-255 or 0x00-0xFF are always accessible and will never throw errors it's just what that tile displays is not guaranteed to be the same unless it's one of the tiles in green from the image below. This can lead to some pretty fun effects with referencing the upper tilemap tiles and enjoying that names or strings appear different in different areas of the game.
| <small>NULL</small> || colspan=15 style="background: #bbb" |
 
|-
https://i.imgur.com/tFZavHg.png
! 1-
| colspan=16 rowspan=3 style="background: #bbb" | ''Junk''
|-
! 2-
|-
! 3-
|-
! 4-
| colspan=8 style="background: #bbb" | || colspan=8 | ''Control characters''
|-
! 5-
| colspan=16 | ''Control characters''
|- style="background: #ddd"
! style="background: #fff" | 6-
| A || B || C || D || E || F || G || H || I || V || S || L || M || style="background: #fff" | : || ぃ || ぅ
|- style="background: #ddd"
! style="background: #fff" | 7-
| ‘ || ’ || “ || ” || ・ || … || ぁ || ぇ || ぉ || [[File:Character 0x79 i.png]] || = || [[File:Character 0x7B i.png]] || <nowiki>||</nowiki> || [[File:Character 0x7D i.png]] || [[File:Character 0x7E i.png]] || style="background: #fff" | 
|-
! 8-
| A || B || C || D || E || F || G || H || I || J || K || L || M || N || O || P
|-
! 9-
| Q || R || S || T || U || V || W || X || Y || Z || ( || ) || : || ; || [ || ]
|-
! A-
| a || b || c || d || e || f || g || h || i || j || k || l || m || n || o || p
|-
! B-
| q || r || s || t || u || v || w || x || y || z  || é || 'd || 'l || 's || 't || 'v
|-
! C-
| colspan=16 rowspan=2 style="background: #bbb" | ''Junk''
|-
! D-
|-
! E-
| ' || <sup>P</sup><sub>K</sub> || <sup>M</sup><sub>N</sub> || -  || 'r || 'm || ? || ! || . || style="background: #ddd" | ァ || style="background: #ddd" | ゥ || style="background: #ddd" | ェ || ▷ || ▶ || ▼ || ♂
|-
! F-
| {{PDollar}} || ×  || . || / || ,  || ♀ || 0 || 1 || 2 || 3 || 4 || 5 || 6 || 7 || 8 || 9
|}


In the Japanese games (as can be seen below), 0xF2 is distinguishable from 0xE8, with the former meant as a decimal point while the latter is punctuation. Presumably this intention was largely inherited when the English games were made, as most of the game's script uses 0xE8 exclusively; however, 0xF2 appears in the character table for user input, meaning it may appear in user-input names (and, conversely, 0xE8 never should).
In the Japanese games (as can be seen below), 0xF2 is distinguishable from 0xE8, with the former meant as a decimal point while the latter is punctuation. Presumably this intention was largely inherited when the English games were made, as most of the game's script uses 0xE8 exclusively; however, 0xF2 appears in the character table for user input, meaning it may appear in user-input names (and, conversely, 0xE8 never should).
21

edits