Character encoding (Generation I): Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
Re-edited changes back differently after discussion with Wowy.
(Undo revision 2948102 by Junebug12851 (talk) Not the correct way to do things)
(Re-edited changes back differently after discussion with Wowy.)
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"
Text codes are directly mapped to VRAM minus some exceptions for control codes, variables, and strings. Added is a color-coded raw snapshot from VRAM for better clarification. The early character codes map to whatever  tilemap is loaded into VRAM currently and most of that is directly accessible from character codes. The parts of the tilemap that aren't accessible are special purpose codes such as control codes (new lines and string termination or null), variables (player name, rival name, or Pokemon Names in Battle), and strings (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 character codes after the control codes all directly accesses the corresponding VRAM tile and most of it is text or drawing characters. Color coded in '''green''' in the image below 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). Tiles in '''purple''' are only used by the game to draw a GUI and are not guaranteed to always be there. Tiles 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. Tiles in '''red''' are not used at all in the games but are still present and not always guaranteed to be there. Tiles 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, a leftover tile will be in it's place which is often blank. All tiles 0-255 or 0x00-0xFF are always accessible and will never throw errors. A tile not guaranteed to be present means it's contents could change often throughout game play. This can lead to some pretty fun effects with referencing the early character codes and enjoying that names or strings appear different in different areas of the game.
| <small>NULL</small> || colspan=15 style="background: #bbb" |
 
|-
[[File:English Gen I Character Set.png|450px|thumb|none]]
! 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

Navigation menu