Character encoding (Generation I): Difference between revisions

m
no edit summary
(Expanded completely on the English text engine)
mNo edit summary
Line 18: Line 18:
====Tilemap Sections====
====Tilemap Sections====


# VRAM address 0x9000 to 0x9480 correspond to a portion of the current tileset of the map. Character codes 0x01 to 0x48 and 0x4D directly correspond to them. For example, when your outdoors, tile #3 is the animated flower meaning character code 0x3 will place the animated flower in text, however if your anywhere else such as in battle, in a cave, or elsewhere a completely different tile will likely print.  
# VRAM address 0x9000 to 0x9480 correspond to a portion of the current tileset of the map. Character codes 0x01 to 0x48 and 0x4D directly correspond to them. For example, when your outdoors, tile #3 is the animated flower meaning character code 0x3 will place the animated flower in text, however if your anywhere else such as in battle, in a cave, or elsewhere a completely different tile will likely print.
## Characters 0x49 - 0x5F technically are also in this same section but, apart from one, 0x4D, all the rest are control character and thus link to code rather than the tile they would normally correspond to
## Characters 0x49 - 0x5F technically are also in this same section but, apart from one, 0x4D, all the rest are control character and thus link to code rather than the tile they would normally correspond to
# VRAM address 0x9600 to 0x97F0 partially corresponds to character codes 0x60-0x7F, here is where the "UI" tiles are such as random bold letters or border artwork for the dialogs and menus. The space character is also here. Tiles here can sometimes change meaning characters that reference them may print out a different tile image but they are far more consistent than the first section mentioned above
# VRAM address 0x9600 to 0x97F0 partially corresponds to character codes 0x60-0x7F, here is where the "UI" tiles are such as random bold letters or border artwork for the dialogs and menus. The space character is also here. Tiles here can sometimes change meaning characters that reference them may print out a different tile image but they are far more consistent than the first section mentioned above
Line 24: Line 24:
# VRAM address 0x8C00 to 0x8DF0 has 2 tile sections
# VRAM address 0x8C00 to 0x8DF0 has 2 tile sections
## 0xC0 - 0xDF is one that appears to be reserved only for certain areas that need extra space for extra tiles, they would go here. As such, most of the time nothings there meaning only blank characters print out. The player info screen is one such example that uses only some of this area and thus any character codes that reference these tiles.
## 0xC0 - 0xDF is one that appears to be reserved only for certain areas that need extra space for extra tiles, they would go here. As such, most of the time nothings there meaning only blank characters print out. The player info screen is one such example that uses only some of this area and thus any character codes that reference these tiles.
## 0xE0 - 0xFF reference tiles similar to section 2, you can consider these the "other half" of that section although some player-typeable characters like "PK", "MN", gender symbols, etc are here as well as numbers, some symbols, and more ui characters
## 0xE0 - 0xFF reference tiles similar to section 2, you can consider these the "other half" of that section although some player-typeable characters like "PK", "MN", gender symbols, etc. are here as well as numbers, some symbols, and more ui characters


====Character Codes====
====Character Codes====


As mentioned above, character codes are within the 0x49-0x5F range with the exception of 0x4D which doesn't map to any code and thus, by default, corresponds to tile 4D. All of these are completely useable in game such as names, testing never showed any crashing, however if done so expect to have some small to large graphical glitches that will usually be cleaned up by changing screens or entering a new map through a warp and definitely some annoyances if used long-term.
As mentioned above, character codes are within the 0x49-0x5F range with the exception of 0x4D which doesn't map to any code and thus, by default, corresponds to tile 4D. All of these are completely usable in game such as names, testing never showed any crashing, however if done so expect to have some small to large graphical glitches that will usually be cleaned up by changing screens or entering a new map through a warp and definitely some annoyances if used long-term.


=====Dialogue control codes=====
=====Dialogue control codes=====
Line 52: Line 52:
* 0x52 - "players name" - Insert the players name, the only variable you cannot use at all in the players name since it will lead to an infinite loop that crashes the game safe and fun elsewhere, try it on a Pokémon's name or your rival.
* 0x52 - "players name" - Insert the players name, the only variable you cannot use at all in the players name since it will lead to an infinite loop that crashes the game safe and fun elsewhere, try it on a Pokémon's name or your rival.
* 0x53 - "rivals name" - Inverse of players name, prints rivals name instead and cannot be used in the rivals name, great to place in your HM slave's name though
* 0x53 - "rivals name" - Inverse of players name, prints rivals name instead and cannot be used in the rivals name, great to place in your HM slave's name though
* 0x59 - "target" - Inserts target name, this is essentially the Pokémon from your perspective. If the dialogue is referring to the enemies Pokemon that name will be inserted with "Enemy " prepended before it, if it's your Pokémon then it will just be your Pokemon name. The last Pokemon you fought is kept in memory so if used in names it will still work even out of battle. This is the longest control character in the game and will print far off the screen in all cases. It can expand up to 16 characters with this single control character alone.
* 0x59 - "target" - Inserts target name, this is essentially the Pokémon from your perspective. If the dialogue is referring to the enemies Pokémon that name will be inserted with "Enemy " prepended before it, if it's your Pokémon then it will just be your Pokémon name. The last Pokémon you fought is kept in memory so if used in names it will still work even out of battle. This is the longest control character in the game and will print far off the screen in all cases. It can expand up to 16 characters with this single control character alone.
* 0x5A - "user" - The inverse of "target", the Pokemon from the enemies perspective. If used in names will likely just be the enemy you fought without the "Enemy " prefix
* 0x5A - "user" - The inverse of "target", the Pokémon from the enemies perspective. If used in names will likely just be the enemy you fought without the "Enemy " prefix


=====Text control codes=====
=====Text control codes=====