If you are still using the old URL (datacrystal.romhacking.net), please update your bookmarks! The old URL may stop working soon.
The current URL is datacrystal.tcrf.net.
The current URL is datacrystal.tcrf.net.
Text Table: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
TheDarkTiger (talk | contribs) m (Use <pre> instead of <code>.) |
||
(6 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
A '''Text Table''' or '''.TBL''' file describes to a hex editor how to convert a ROM's text format into readable text. | {{stub}} | ||
A '''Text Table''' or '''.TBL''' file describes to a hex editor how to convert a ROM's text format into readable text. | |||
==Overview== | |||
===Normal Entries=== | |||
* The whole file is always UTF-8, and each line is in the format <code>[[Hexadecimal|HEX]]=string</code> (formally, [Hex sequence]=[Text sequence]). | |||
* Blank lines are ignored, and # can be used as the first character of a line to leave comment (until the end of said line). | |||
* The hex value must be an even number of nibbles (2 nibbles would give <code>42</code>, 4 nibbles <code>1EE7</code>, etc.), and must be in big endian (most significant to least significant, <code>10</code> means 16 in decimal, and <code>CA75</code> means 51829 in decimal ). | |||
* Whitespaces can only be present in the text sequence, which can't contain '[' or ']' characters. | |||
For example:<br> | |||
* <code>E1=H</code> means the byte 0xE1 means uppercase H. | |||
* <code>1502= that </code> means the byte 0x15 followed by the byte 0x02 means the word "that" with spaces on either side. | |||
===Non-Normal Entries=== | |||
These special cases allow for more flexibility and ease of usage. It contains the prefixes, labels, parameters, control code, end token, etc.<br> | |||
For example:<br> | |||
* <code>*HEX</code> indicates that <code>HEX</code> is a newline. Notice there is no text sequence. | |||
* <code>HEX=\n</code> indicates that <code>HEX</code> is a newline too. | |||
* <code>\HEX</code> indicates that <code>HEX</code> is the end of text. Notice there is no text sequence. | |||
* <code>\HEX=[end of text]\n</code> indicates that <code>HEX</code> is the end of text. The optional text sequence here is useful for debugging or clarity purpose. Line breaks are used by dumpers only and will be ignored by inserters. | |||
* <code>(HEXh)Title</code> determines bookmarks. You need the <code>h</code> after the hexidecimal address for it to be read as hex. | |||
==Examples== | |||
===Simple case=== | |||
''This is a purely made up example and don't came from any game that I know of.'' | |||
Using this TBL:<br> | |||
<pre> | |||
00= | |||
01=A | |||
02=B | |||
03=C | |||
04=D | |||
</pre><br> | |||
This sequence <code>0x02, 0x01, 0x04, 0x00, 0x03, 0x01, 0x02</code><br> | |||
Is decoded as <code>BAD CAB</code> | |||
===More complex case=== | |||
''This is a purely made up example and don't came from any game that I know of.'' | |||
Using this TBL:<br> | |||
<pre> | |||
# Alphabet | |||
00= | |||
01=A | |||
02=B | |||
03=C | |||
04=D | |||
05=E | |||
# Dictionary | |||
70=AT | |||
# Controls | |||
*FE | |||
\FF=[end of text]\n | |||
</pre><br> | |||
This sequence <code>0x01, 0x00, 0x02, 0x01, 0x04, 0x00, 0x03, 0x70, 0xFE, 0x70, 0x05, 0x00, 0x01, 0x00, 0x02, 0x07, 0xFF</code><br> | |||
Is decoded as:<br> | |||
<code>A BAD CAT<br>ATE A BAT[end of text]<br></code> | |||
Note:<br> | |||
* The use (and abuse) of <code>0x70</code> to compress <code>AT</code> | |||
* The use of <code>0xFE</code> and <code>0xFF</code> for new line and end of text, respectively. | |||
==Useful tools== | |||
* [https://www.romhacking.net/utilities/55/ TaBuLar] can be used to create TBL files | |||
* [https://www.romhacking.net/utilities/818/ crystaltile2] can help you make and display TBL files | |||
==See Also== | ==See Also== | ||
[[Category:TBL | * [[:Category:TBL Files]] - All .TBL files are in this category. Place <nowiki>{{</nowiki>[[:Template:TBL|TBL]]|game=''game name''<nowiki>}}</nowiki> at the top of all such pages. | ||
==External Links== | ==External Links== | ||
[http://www.everything2.com/index.pl?node_id=1430647 Table File node on Everything2] (includes an example) | * [https://transcorp.romhacking.net/scratchpad/Table%20File%20Format.txt Original TBL format description] Use this for reference | ||
* [http://www.everything2.com/index.pl?node_id=1430647 Table File node on Everything2] (includes an example) | |||
[ | * [https://gbatemp.net/threads/how-to-make-a-table-file-for-a-rom-gba-nds.327308/#post-4228890 Thread on gbatemp] interesting post by 'FAST6191' on how to get the data to make these files |
Latest revision as of 00:03, 24 August 2024
This page is rather stubbly and could use some expansion. Are you a bad enough dude to rescue this article? |
A Text Table or .TBL file describes to a hex editor how to convert a ROM's text format into readable text.
Overview
Normal Entries
- The whole file is always UTF-8, and each line is in the format
HEX=string
(formally, [Hex sequence]=[Text sequence]). - Blank lines are ignored, and # can be used as the first character of a line to leave comment (until the end of said line).
- The hex value must be an even number of nibbles (2 nibbles would give
42
, 4 nibbles1EE7
, etc.), and must be in big endian (most significant to least significant,10
means 16 in decimal, andCA75
means 51829 in decimal ). - Whitespaces can only be present in the text sequence, which can't contain '[' or ']' characters.
For example:
E1=H
means the byte 0xE1 means uppercase H.1502= that
means the byte 0x15 followed by the byte 0x02 means the word "that" with spaces on either side.
Non-Normal Entries
These special cases allow for more flexibility and ease of usage. It contains the prefixes, labels, parameters, control code, end token, etc.
For example:
*HEX
indicates thatHEX
is a newline. Notice there is no text sequence.HEX=\n
indicates thatHEX
is a newline too.\HEX
indicates thatHEX
is the end of text. Notice there is no text sequence.\HEX=[end of text]\n
indicates thatHEX
is the end of text. The optional text sequence here is useful for debugging or clarity purpose. Line breaks are used by dumpers only and will be ignored by inserters.(HEXh)Title
determines bookmarks. You need theh
after the hexidecimal address for it to be read as hex.
Examples
Simple case
This is a purely made up example and don't came from any game that I know of.
Using this TBL:
00= 01=A 02=B 03=C 04=D
This sequence 0x02, 0x01, 0x04, 0x00, 0x03, 0x01, 0x02
Is decoded as BAD CAB
More complex case
This is a purely made up example and don't came from any game that I know of.
Using this TBL:
# Alphabet 00= 01=A 02=B 03=C 04=D 05=E # Dictionary 70=AT # Controls *FE \FF=[end of text]\n
This sequence 0x01, 0x00, 0x02, 0x01, 0x04, 0x00, 0x03, 0x70, 0xFE, 0x70, 0x05, 0x00, 0x01, 0x00, 0x02, 0x07, 0xFF
Is decoded as:
A BAD CAT
ATE A BAT[end of text]
Note:
- The use (and abuse) of
0x70
to compressAT
- The use of
0xFE
and0xFF
for new line and end of text, respectively.
Useful tools
- TaBuLar can be used to create TBL files
- crystaltile2 can help you make and display TBL files
See Also
- Category:TBL Files - All .TBL files are in this category. Place {{TBL|game=game name}} at the top of all such pages.
External Links
- Original TBL format description Use this for reference
- Table File node on Everything2 (includes an example)
- Thread on gbatemp interesting post by 'FAST6191' on how to get the data to make these files