Files
libaaruformat/docs/html/lfg_8c.html

466 lines
25 KiB
HTML

<!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.16.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libaaruformat: src/ngcw/lfg.c File Reference</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">libaaruformat<span id="projectnumber">&#160;1.0</span>
</div>
<div id="projectbrief">Aaru Data Preservation Suite - Format Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.16.1 -->
<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('lfg_8c.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 class="header">
<div class="headertitle"><div class="title">lfg.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="lfg_8h_source.html">lfg.h</a>&quot;</code><br />
<code>#include &lt;string.h&gt;</code><br />
</div>
<p><a href="lfg_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2f32611fcb5d9160c4bd4b6f2f1c2fa9" id="r_a2f32611fcb5d9160c4bd4b6f2f1c2fa9"><td class="memItemLeft">static uint32_t&#160;</td><td class="memItemRight"><a class="el" href="#a2f32611fcb5d9160c4bd4b6f2f1c2fa9">swap32</a> (uint32_t x)</td></tr>
<tr class="memitem:a672ca5afd8a74c736fed44e0a89df900" id="r_a672ca5afd8a74c736fed44e0a89df900"><td class="memItemLeft">static void&#160;</td><td class="memItemRight"><a class="el" href="#a672ca5afd8a74c736fed44e0a89df900">lfg_forward</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx)</td></tr>
<tr class="memitem:a306c5ff9a0006e222eef0a9a79f81d77" id="r_a306c5ff9a0006e222eef0a9a79f81d77"><td class="memItemLeft">static void&#160;</td><td class="memItemRight"><a class="el" href="#a306c5ff9a0006e222eef0a9a79f81d77">lfg_backward</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx, size_t start_word, size_t end_word)</td></tr>
<tr class="memitem:a46e2707c175bb96188106c86fdcb1953" id="r_a46e2707c175bb96188106c86fdcb1953"><td class="memItemLeft">static bool&#160;</td><td class="memItemRight"><a class="el" href="#a46e2707c175bb96188106c86fdcb1953">lfg_initialize</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx, bool check_existing)</td></tr>
<tr class="memitem:abc583da3bb66cab3eafc3496bc46e193" id="r_abc583da3bb66cab3eafc3496bc46e193"><td class="memItemLeft">void&#160;</td><td class="memItemRight"><a class="el" href="#abc583da3bb66cab3eafc3496bc46e193">ngc_lfg_set_seed</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx, const uint32_t seed[17])</td></tr>
<tr class="memdesc:abc583da3bb66cab3eafc3496bc46e193"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the LFG from a 17-word big-endian seed. <br /></td></tr>
<tr class="memitem:a25e6df5ee051a324d943185f193d3418" id="r_a25e6df5ee051a324d943185f193d3418"><td class="memItemLeft">void&#160;</td><td class="memItemRight"><a class="el" href="#a25e6df5ee051a324d943185f193d3418">ngc_lfg_get_bytes</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx, uint8_t *out, size_t count)</td></tr>
<tr class="memdesc:a25e6df5ee051a324d943185f193d3418"><td class="mdescLeft">&#160;</td><td class="mdescRight">Generate count bytes of junk data into out. <br /></td></tr>
<tr class="memitem:a7a8fe75a120f047f2a2fad61d664d9da" id="r_a7a8fe75a120f047f2a2fad61d664d9da"><td class="memItemLeft">static bool&#160;</td><td class="memItemRight"><a class="el" href="#a7a8fe75a120f047f2a2fad61d664d9da">lfg_reinitialize</a> (struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *ctx, uint32_t seed_out[17])</td></tr>
<tr class="memitem:aef1434f019902caf30f1d4fe577267ba" id="r_aef1434f019902caf30f1d4fe577267ba"><td class="memItemLeft">size_t&#160;</td><td class="memItemRight"><a class="el" href="#aef1434f019902caf30f1d4fe577267ba">ngc_lfg_get_seed</a> (const uint8_t *data, size_t size, size_t data_offset, uint32_t seed_out[17])</td></tr>
<tr class="memdesc:aef1434f019902caf30f1d4fe577267ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Try to extract the LFG seed from a chunk of data. <br /></td></tr>
</table>
<a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="a306c5ff9a0006e222eef0a9a79f81d77" name="a306c5ff9a0006e222eef0a9a79f81d77"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a306c5ff9a0006e222eef0a9a79f81d77">&#9670;&#160;</a></span>lfg_backward()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void lfg_backward </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>start_word</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>end_word</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>&lt; LFG second tap.</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG second tap.</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00036">36</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8h_source.html#l00035">NGC_LFG_J</a>, and <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>.</p>
<p class="reference">Referenced by <a class="el" href="lfg_8c_source.html#l00103">lfg_reinitialize()</a>, and <a class="el" href="lfg_8c_source.html#l00121">ngc_lfg_get_seed()</a>.</p>
</div>
</div>
<a id="a672ca5afd8a74c736fed44e0a89df900" name="a672ca5afd8a74c736fed44e0a89df900"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a672ca5afd8a74c736fed44e0a89df900">&#9670;&#160;</a></span>lfg_forward()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void lfg_forward </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>&lt; LFG second tap.</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG second tap.</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG second tap.</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00029">29</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8h_source.html#l00035">NGC_LFG_J</a>, and <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>.</p>
<p class="reference">Referenced by <a class="el" href="lfg_8c_source.html#l00048">lfg_initialize()</a>, <a class="el" href="lfg_8c_source.html#l00082">ngc_lfg_get_bytes()</a>, and <a class="el" href="lfg_8c_source.html#l00121">ngc_lfg_get_seed()</a>.</p>
</div>
</div>
<a id="a46e2707c175bb96188106c86fdcb1953" name="a46e2707c175bb96188106c86fdcb1953"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a46e2707c175bb96188106c86fdcb1953">&#9670;&#160;</a></span>lfg_initialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool lfg_initialize </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">bool</td> <td class="paramname"><span class="paramname"><em>check_existing</em></span>&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>&lt; Number of uint32 words needed to seed the LFG.</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00048">48</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8c_source.html#l00029">lfg_forward()</a>, <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, and <a class="el" href="lfg_8c_source.html#l00026">swap32()</a>.</p>
<p class="reference">Referenced by <a class="el" href="lfg_8c_source.html#l00103">lfg_reinitialize()</a>, and <a class="el" href="lfg_8c_source.html#l00073">ngc_lfg_set_seed()</a>.</p>
</div>
</div>
<a id="a7a8fe75a120f047f2a2fad61d664d9da" name="a7a8fe75a120f047f2a2fad61d664d9da"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7a8fe75a120f047f2a2fad61d664d9da">&#9670;&#160;</a></span>lfg_reinitialize()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool lfg_reinitialize </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>seed_out</em></span>[17/**&lt; Number of uint32 words needed to seed the LFG. */]&#160;)</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; Number of uint32 words needed to seed the LFG.</p>
<p>&lt; Number of uint32 words needed to seed the LFG.</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00103">103</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8c_source.html#l00036">lfg_backward()</a>, <a class="el" href="lfg_8c_source.html#l00048">lfg_initialize()</a>, <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, and <a class="el" href="lfg_8c_source.html#l00026">swap32()</a>.</p>
<p class="reference">Referenced by <a class="el" href="lfg_8c_source.html#l00121">ngc_lfg_get_seed()</a>.</p>
</div>
</div>
<a id="a25e6df5ee051a324d943185f193d3418" name="a25e6df5ee051a324d943185f193d3418"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a25e6df5ee051a324d943185f193d3418">&#9670;&#160;</a></span>ngc_lfg_get_bytes()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ngc_lfg_get_bytes </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint8_t *</td> <td class="paramname"><span class="paramname"><em>out</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>count</em></span>&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Generate count bytes of junk data into out. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>LFG context (must be initialized via ngc_lfg_set_seed). </td></tr>
<tr><td class="paramname">out</td><td>Output buffer to fill. </td></tr>
<tr><td class="paramname">count</td><td>Number of bytes to generate. </td></tr>
</table>
</dd>
</dl>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00082">82</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8c_source.html#l00029">lfg_forward()</a>, <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>, and <a class="el" href="lfg_8h_source.html#l00044">ngc_lfg_ctx::position_bytes</a>.</p>
<p class="reference">Referenced by <a class="el" href="ngcw__junk_8c_source.html#l00154">ngcw_regenerate_junk_sector()</a>, and <a class="el" href="read_8c_source.html#l00044">wii_reconstruct_group_junk()</a>.</p>
</div>
</div>
<a id="aef1434f019902caf30f1d4fe577267ba" name="aef1434f019902caf30f1d4fe577267ba"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aef1434f019902caf30f1d4fe577267ba">&#9670;&#160;</a></span>ngc_lfg_get_seed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">size_t ngc_lfg_get_seed </td>
<td>(</td>
<td class="paramtype">const uint8_t *</td> <td class="paramname"><span class="paramname"><em>data</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>size</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t</td> <td class="paramname"><span class="paramname"><em>data_offset</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>seed_out</em></span>[17]&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Try to extract the LFG seed from a chunk of data. </p>
<p>Attempts to reverse-engineer the 17-word seed from a buffer of suspected PRNG output. Requires at least NGC_LFG_K * 4 = 2084 bytes of contiguous PRNG output aligned to uint32 boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">data</td><td>Pointer to the data to test. </td></tr>
<tr><td class="paramname">size</td><td>Number of bytes available. </td></tr>
<tr><td class="paramname">data_offset</td><td>Byte offset of data[0] within its LFG block (0x8000-aligned for Wii, arbitrary for GC). </td></tr>
<tr><td class="paramname">seed_out</td><td>If successful, receives the 17-word seed (big-endian).</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of consecutive bytes from data[0] that match the LFG. Returns 0 if the data does not look like junk. </dd></dl>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p>&lt; LFG buffer size (number of uint32 words in state).</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00121">121</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8c_source.html#l00036">lfg_backward()</a>, <a class="el" href="lfg_8c_source.html#l00029">lfg_forward()</a>, <a class="el" href="lfg_8c_source.html#l00103">lfg_reinitialize()</a>, <a class="el" href="lfg_8h_source.html#l00034">NGC_LFG_K</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, <a class="el" href="lfg_8h_source.html#l00044">ngc_lfg_ctx::position_bytes</a>, and <a class="el" href="lfg_8c_source.html#l00026">swap32()</a>.</p>
</div>
</div>
<a id="abc583da3bb66cab3eafc3496bc46e193" name="abc583da3bb66cab3eafc3496bc46e193"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc583da3bb66cab3eafc3496bc46e193">&#9670;&#160;</a></span>ngc_lfg_set_seed()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void ngc_lfg_set_seed </td>
<td>(</td>
<td class="paramtype">struct <a class="el" href="structngc__lfg__ctx.html">ngc_lfg_ctx</a> *</td> <td class="paramname"><span class="paramname"><em>ctx</em></span>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const uint32_t</td> <td class="paramname"><span class="paramname"><em>seed</em></span>[17]&#160;)</td>
</tr>
</table>
</div><div class="memdoc">
<p>Initialize the LFG from a 17-word big-endian seed. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">ctx</td><td>LFG context to initialize. </td></tr>
<tr><td class="paramname">seed</td><td>Array of 17 uint32 seed words (big-endian). </td></tr>
</table>
</dd>
</dl>
<p>&lt; Number of uint32 words needed to seed the LFG.</p>
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00073">73</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">References <a class="el" href="lfg_8h_source.html#l00043">ngc_lfg_ctx::buffer</a>, <a class="el" href="lfg_8c_source.html#l00048">lfg_initialize()</a>, <a class="el" href="lfg_8h_source.html#l00036">NGC_LFG_SEED_SIZE</a>, <a class="el" href="lfg_8h_source.html#l00044">ngc_lfg_ctx::position_bytes</a>, and <a class="el" href="lfg_8c_source.html#l00026">swap32()</a>.</p>
<p class="reference">Referenced by <a class="el" href="ngcw__junk_8c_source.html#l00154">ngcw_regenerate_junk_sector()</a>, and <a class="el" href="read_8c_source.html#l00044">wii_reconstruct_group_junk()</a>.</p>
</div>
</div>
<a id="a2f32611fcb5d9160c4bd4b6f2f1c2fa9" name="a2f32611fcb5d9160c4bd4b6f2f1c2fa9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2f32611fcb5d9160c4bd4b6f2f1c2fa9">&#9670;&#160;</a></span>swap32()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">uint32_t swap32 </td>
<td>(</td>
<td class="paramtype">uint32_t</td> <td class="paramname"><span class="paramname"><em>x</em></span></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel inline">inline</span><span class="mlabel static">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p class="definition">Definition at line <a class="el" href="lfg_8c_source.html#l00026">26</a> of file <a class="el" href="lfg_8c_source.html">lfg.c</a>.</p>
<p class="reference">Referenced by <a class="el" href="lfg_8c_source.html#l00048">lfg_initialize()</a>, <a class="el" href="lfg_8c_source.html#l00103">lfg_reinitialize()</a>, <a class="el" href="lfg_8c_source.html#l00121">ngc_lfg_get_seed()</a>, and <a class="el" href="lfg_8c_source.html#l00073">ngc_lfg_set_seed()</a>.</p>
</div>
</div>
</div><!-- contents -->
</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="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a href="dir_366d6a3889b2c1ca7d50351540a67e4b.html">ngcw</a></li><li class="navelem"><a href="lfg_8c.html">lfg.c</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.16.1 </li>
</ul>
</div>
</body>
</html>