<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.metroid2002.com/retromodding/index.php?action=history&amp;feed=atom&amp;title=DAT_%28File_Format%29</id>
		<title>DAT (File Format) - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.metroid2002.com/retromodding/index.php?action=history&amp;feed=atom&amp;title=DAT_%28File_Format%29"/>
		<link rel="alternate" type="text/html" href="http://www.metroid2002.com/retromodding/index.php?title=DAT_(File_Format)&amp;action=history"/>
		<updated>2026-04-30T07:55:56Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://www.metroid2002.com/retromodding/index.php?title=DAT_(File_Format)&amp;diff=2018&amp;oldid=prev</id>
		<title>Aitch at 23:05, 1 August 2025</title>
		<link rel="alternate" type="text/html" href="http://www.metroid2002.com/retromodding/index.php?title=DAT_(File_Format)&amp;diff=2018&amp;oldid=prev"/>
				<updated>2025-08-01T23:05:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 23:05, 1 August 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 107:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Symbol Table ==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Symbol Table ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Symbol Table section starts immediately after the external reference table. This section contains null terminated strings pointed to by entries in the root table.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The Symbol Table section starts immediately after the external reference table. This section contains null terminated strings pointed to by entries in the root table.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:File Formats]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:Super Smash Bros. Melee]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aitch</name></author>	</entry>

	<entry>
		<id>http://www.metroid2002.com/retromodding/index.php?title=DAT_(File_Format)&amp;diff=2017&amp;oldid=prev</id>
		<title>Aitch: Created page with &quot;'''DAT''' is the generic file format used in Super Smash Bros. Melee. These files store animations, textures, models, character attributes, subaction bytecode, etc., everythin...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.metroid2002.com/retromodding/index.php?title=DAT_(File_Format)&amp;diff=2017&amp;oldid=prev"/>
				<updated>2025-08-01T23:04:53Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;DAT&amp;#039;&amp;#039;&amp;#039; is the generic file format used in Super Smash Bros. Melee. These files store animations, textures, models, character attributes, subaction bytecode, etc., everythin...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''DAT''' is the generic file format used in Super Smash Bros. Melee. These files store animations, textures, models, character attributes, subaction bytecode, etc., everything except for movies and audio. The file format itself does not care about the type of data stored within it, it is simply a generic container format for storing objects and symbols pointing to objects, as well as relocation information.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/AlexanderHarrison/cdat CDat] is a simple open-source C library for reading and modifying dat files.&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
= Format =&lt;br /&gt;
&lt;br /&gt;
Every dat file has six sections laid out in order.&lt;br /&gt;
These six sections are: '''Header''', '''Data''', '''Relocation Table''', '''Root Table''', '''External Reference Table''', and '''String Table'''.&lt;br /&gt;
Each section follows immediately after the previous section.&lt;br /&gt;
&lt;br /&gt;
== Header ==&lt;br /&gt;
&lt;br /&gt;
Always 0x20 bytes.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 4&lt;br /&gt;
| '''File Size'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 4&lt;br /&gt;
| '''Data Section Size'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x8&lt;br /&gt;
| 4&lt;br /&gt;
| '''Relocation Entry Count'''&lt;br /&gt;
|-&lt;br /&gt;
| 0xC&lt;br /&gt;
| 4&lt;br /&gt;
| '''Root Entry Count'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x10&lt;br /&gt;
| 4&lt;br /&gt;
| '''External Reference Entry Count'''&lt;br /&gt;
|-&lt;br /&gt;
| 0x14&lt;br /&gt;
| 12&lt;br /&gt;
| ''unused''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
The data section always starts at 0x20 and runs for the length indicated in the header.&lt;br /&gt;
This is just a large heap of bytes pointed to by the other sections.&lt;br /&gt;
The dat format is not concerned with the contents of this section.&lt;br /&gt;
&lt;br /&gt;
== Relocation Table ==&lt;br /&gt;
&lt;br /&gt;
The Relocation Table section starts immediately after the data section and runs for &amp;lt;code&amp;gt;4 * reloc_entry_count&amp;lt;/code&amp;gt; bytes.&lt;br /&gt;
Each entry is a single 4 byte word.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 4&lt;br /&gt;
| '''Data Offset'''&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This table is used to maintain pointers between objects when loading dat files into memory.&lt;br /&gt;
For each data offset, the game will add the file pointer to the data word pointed to by each data offset contained in this table.&lt;br /&gt;
For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
for (u32 i = 0; i &amp;lt; reloc_entry_count; ++i) {&lt;br /&gt;
    u32 reloc_offset = dat_reloc_section[i];&lt;br /&gt;
    u32 *reloc_target = (u32*)(data_section + reloc_offset);&lt;br /&gt;
    *reloc_target += (u32)dat_file_ptr;&lt;br /&gt;
}&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Root Table ==&lt;br /&gt;
&lt;br /&gt;
The Root Table section starts immediately after the relocation table section and runs for &amp;lt;code&amp;gt;8 * root_entry_count&amp;lt;/code&amp;gt; bytes.&lt;br /&gt;
Each entry is two 4 byte words.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Offset&lt;br /&gt;
! Size&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x0&lt;br /&gt;
| 4&lt;br /&gt;
| '''Data Offset'''. This is an offset into the data section.&lt;br /&gt;
|-&lt;br /&gt;
| 0x4&lt;br /&gt;
| 4&lt;br /&gt;
| '''Symbol Offset'''. This is an offset into the string table section. &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Roots often point to models or arrays of animations.&lt;br /&gt;
The type of the root node is interpreted at runtime, type information is not stored in the dat file itself.&lt;br /&gt;
&lt;br /&gt;
== External Reference Table ==&lt;br /&gt;
&lt;br /&gt;
This section is very similar to the root table section. It starts immediately after the root table section and runs for &amp;lt;code&amp;gt;8 * external_ref_entry_count&amp;lt;/code&amp;gt; bytes.&lt;br /&gt;
Each entry is two 4 byte words, exactly the same as the root table section.&lt;br /&gt;
&lt;br /&gt;
This section contains references to root nodes in other dat files.&lt;br /&gt;
&lt;br /&gt;
== Symbol Table ==&lt;br /&gt;
The Symbol Table section starts immediately after the external reference table. This section contains null terminated strings pointed to by entries in the root table.&lt;/div&gt;</summary>
		<author><name>Aitch</name></author>	</entry>

	</feed>