summaryrefslogtreecommitdiff
path: root/otr_generic_array.html
blob: 5003dcc2e789e9bbe56ec24ec8b3dbdc4ab9e089 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Torch: Generic Array Resource</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Torch
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('otr_generic_array.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div><div class="header">
  <div class="headertitle"><div class="title">Generic Array Resource </div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1 class="doxsection"><a class="anchor" id="autotoc_md17"></a>
Generic Array Resource (GARR)</h1>
<p>If the Resource Type is <span class="tt">GARR</span> (<span class="tt">0x47415252</span>), the header is immediately followed by the generic array definition. This resource type is used to store arrays of primitive types or vectors.</p>
<h2 class="doxsection"><a class="anchor" id="autotoc_md18"></a>
Generic Array Header</h2>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadLeft">Offset  </th><th class="markdownTableHeadLeft">Size  </th><th class="markdownTableHeadLeft">Type  </th><th class="markdownTableHeadLeft">Description  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">0x40  </td><td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">u32  </td><td class="markdownTableBodyLeft">Array Type (Enum)  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">0x44  </td><td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">u32  </td><td class="markdownTableBodyLeft">Count  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">0x48  </td><td class="markdownTableBodyLeft">...  </td><td class="markdownTableBodyLeft">...  </td><td class="markdownTableBodyLeft">Array Data  </td></tr>
</table>
<h3 class="doxsection"><a class="anchor" id="autotoc_md19"></a>
Array Types</h3>
<p>The <span class="tt">Array Type</span> field determines the type of data stored in the array.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadLeft">Value  </th><th class="markdownTableHeadLeft">Name  </th><th class="markdownTableHeadLeft">Size (bytes)  </th><th class="markdownTableHeadLeft">Description  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">0  </td><td class="markdownTableBodyLeft">u8  </td><td class="markdownTableBodyLeft">1  </td><td class="markdownTableBodyLeft">Unsigned 8-bit integer  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">1  </td><td class="markdownTableBodyLeft">s8  </td><td class="markdownTableBodyLeft">1  </td><td class="markdownTableBodyLeft">Signed 8-bit integer  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">2  </td><td class="markdownTableBodyLeft">u16  </td><td class="markdownTableBodyLeft">2  </td><td class="markdownTableBodyLeft">Unsigned 16-bit integer  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">3  </td><td class="markdownTableBodyLeft">s16  </td><td class="markdownTableBodyLeft">2  </td><td class="markdownTableBodyLeft">Signed 16-bit integer  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">u32  </td><td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">Unsigned 32-bit integer  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">5  </td><td class="markdownTableBodyLeft">s32  </td><td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">Signed 32-bit integer  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">6  </td><td class="markdownTableBodyLeft">u64  </td><td class="markdownTableBodyLeft">8  </td><td class="markdownTableBodyLeft">Unsigned 64-bit integer  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">7  </td><td class="markdownTableBodyLeft">f32  </td><td class="markdownTableBodyLeft">4  </td><td class="markdownTableBodyLeft">32-bit Float  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">8  </td><td class="markdownTableBodyLeft">f64  </td><td class="markdownTableBodyLeft">8  </td><td class="markdownTableBodyLeft">64-bit Double  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">9  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec2f.html">Vec2f</a>  </td><td class="markdownTableBodyLeft">8  </td><td class="markdownTableBodyLeft">Vector of 2 floats  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">10  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec3f.html">Vec3f</a>  </td><td class="markdownTableBodyLeft">12  </td><td class="markdownTableBodyLeft">Vector of 3 floats  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">11  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec3s.html">Vec3s</a>  </td><td class="markdownTableBodyLeft">6  </td><td class="markdownTableBodyLeft">Vector of 3 shorts  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">12  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec3i.html">Vec3i</a>  </td><td class="markdownTableBodyLeft">12  </td><td class="markdownTableBodyLeft">Vector of 3 integers  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">13  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec3iu.html">Vec3iu</a>  </td><td class="markdownTableBodyLeft">12  </td><td class="markdownTableBodyLeft">Vector of 3 unsigned integers  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft">14  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec4f.html">Vec4f</a>  </td><td class="markdownTableBodyLeft">16  </td><td class="markdownTableBodyLeft">Vector of 4 floats  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft">15  </td><td class="markdownTableBodyLeft"><a class="el" href="classVec4s.html">Vec4s</a>  </td><td class="markdownTableBodyLeft">8  </td><td class="markdownTableBodyLeft">Vector of 4 shorts  </td></tr>
</table>
<h2 class="doxsection"><a class="anchor" id="autotoc_md20"></a>
YAML Configuration</h2>
<p>To define a generic array in the configuration, use the <span class="tt">ARRAY</span> type.</p>
<table class="markdownTable">
<tr class="markdownTableHead">
<th class="markdownTableHeadLeft">Field  </th><th class="markdownTableHeadLeft">Type  </th><th class="markdownTableHeadLeft">Description  </th></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><span class="tt">type</span>  </td><td class="markdownTableBodyLeft">String  </td><td class="markdownTableBodyLeft">Must be <span class="tt">ARRAY</span>.  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><span class="tt">offset</span>  </td><td class="markdownTableBodyLeft">Integer  </td><td class="markdownTableBodyLeft">The offset of the array in the ROM/binary.  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><span class="tt">count</span>  </td><td class="markdownTableBodyLeft">Integer  </td><td class="markdownTableBodyLeft">The number of elements in the array.  </td></tr>
<tr class="markdownTableRowEven">
<td class="markdownTableBodyLeft"><span class="tt">array_type</span>  </td><td class="markdownTableBodyLeft">String  </td><td class="markdownTableBodyLeft">The type of the elements (see table below).  </td></tr>
<tr class="markdownTableRowOdd">
<td class="markdownTableBodyLeft"><span class="tt">symbol</span>  </td><td class="markdownTableBodyLeft">String  </td><td class="markdownTableBodyLeft">(Optional) The symbol name for the array.  </td></tr>
</table>
<h3 class="doxsection"><a class="anchor" id="autotoc_md21"></a>
Supported Array Types (YAML)</h3>
<ul>
<li><span class="tt">u8</span></li>
<li><span class="tt">s8</span></li>
<li><span class="tt">u16</span></li>
<li><span class="tt">s16</span></li>
<li><span class="tt">u32</span></li>
<li><span class="tt">s32</span></li>
<li><span class="tt">u64</span></li>
<li><span class="tt">f32</span></li>
<li><span class="tt">f64</span></li>
<li><span class="tt"><a class="el" href="classVec2f.html">Vec2f</a></span></li>
<li><span class="tt"><a class="el" href="classVec3f.html">Vec3f</a></span></li>
<li><span class="tt"><a class="el" href="classVec3s.html">Vec3s</a></span></li>
<li><span class="tt"><a class="el" href="classVec3i.html">Vec3i</a></span></li>
<li><span class="tt"><a class="el" href="classVec3iu.html">Vec3iu</a></span></li>
<li><span class="tt"><a class="el" href="classVec4f.html">Vec4f</a></span></li>
<li><span class="tt"><a class="el" href="classVec4s.html">Vec4s</a></span></li>
</ul>
<p>Example: </p><div class="fragment"><div class="line">- type: ARRAY</div>
<div class="line">  offset: 0xB000</div>
<div class="line">  count: 10</div>
<div class="line">  array_type: u32</div>
<div class="line">  symbol: my_u32_array</div>
</div><!-- fragment --> </div></div><!-- contents -->
</div><!-- PageDoc -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="index.html">Torch Documentation</a></li><li class="navelem"><a href="otr_format.html">OTR File Format Specification</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>