<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://ff7speedruns.com/index.php?action=history&amp;feed=atom&amp;title=Battle_RNG</id>
	<title>Battle RNG - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://ff7speedruns.com/index.php?action=history&amp;feed=atom&amp;title=Battle_RNG"/>
	<link rel="alternate" type="text/html" href="http://ff7speedruns.com/index.php?title=Battle_RNG&amp;action=history"/>
	<updated>2026-05-29T17:04:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1583&amp;oldid=prev</id>
		<title>AceZephyr: /* BattleRand16 */</title>
		<link rel="alternate" type="text/html" href="http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1583&amp;oldid=prev"/>
		<updated>2024-07-01T18:20:17Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;BattleRand16&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:20, 1 July 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l94&quot;&gt;Line 94:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 94:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   byte &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar1&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   byte &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lo&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   byte &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar2&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   byte &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hi&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   uint &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar3&lt;/del&gt;;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   uint &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;joker&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar1 &lt;/del&gt;= BattleRand8();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;lo &lt;/ins&gt;= BattleRand8();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar3 &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BattleRandCounter &lt;/del&gt;&amp;amp; 7;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;joker &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BattleRandJoker &lt;/ins&gt;&amp;amp; 7;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BattleRandCounter &lt;/del&gt;= &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BattleRandCounter &lt;/del&gt;+ 1;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;BattleRandJoker &lt;/ins&gt;= &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;BattleRandJoker &lt;/ins&gt;+ 1;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   if (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar3 &lt;/del&gt;!= 0) {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   if (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;joker &lt;/ins&gt;!= 0) {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     BattleRandIdxIncrement();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     BattleRandIdxIncrement();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar2 &lt;/del&gt;= BattleRand8();&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;hi &lt;/ins&gt;= BattleRand8();&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   return &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CONCAT11&lt;/del&gt;(&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uVar2,uVar1&lt;/del&gt;);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;   return (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hi &amp;lt;&amp;lt; 8&lt;/ins&gt;) &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;| lo&lt;/ins&gt;;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ff7_wiki:diff:1.41:old-1582:rev-1583:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>AceZephyr</name></author>
	</entry>
	<entry>
		<id>http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1582&amp;oldid=prev</id>
		<title>AceZephyr: /* Seeding Differences between PSX and PC */</title>
		<link rel="alternate" type="text/html" href="http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1582&amp;oldid=prev"/>
		<updated>2024-06-30T05:08:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Seeding Differences between PSX and PC&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 05:08, 30 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l55&quot;&gt;Line 55:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 55:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Seeding Differences between PSX and PC ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Seeding Differences between PSX and PC ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The process used to seed Battle RNG given &lt;/del&gt;a 15-bit seed &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;is identical &lt;/del&gt;between &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;PSX and &lt;/del&gt;PC, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;however there &lt;/del&gt;is &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;an important difference in &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;process &lt;/del&gt;used to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obtain that seed&lt;/del&gt;. On &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;PSX &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;version&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;when &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;battle module is loaded, System RNG is reseeded based on &lt;/del&gt;the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;current &lt;/del&gt;frame counter&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, effectively removing the player&#039;s ability to influence this seed. On PC, this does not happen, and the System RNG state remains how it was before the battle module was loaded&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;Both PC/HD and PSX use &lt;/ins&gt;a 15-bit &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;value to &lt;/ins&gt;seed &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Battle RNG, but this value comes from different sources &lt;/ins&gt;between &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the versions. &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;On &lt;/ins&gt;PC&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;/HD&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a call to System RNG &lt;/ins&gt;is &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;made for &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;value that will be &lt;/ins&gt;used&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. This leads &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the possibility of [[System Clock Manipulation]]&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; 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;On PSX, the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lowest 15 bits of &lt;/ins&gt;the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;global &lt;/ins&gt;frame counter &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;are instead used&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Interfaces ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Interfaces ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ff7_wiki:diff:1.41:old-1425:rev-1582:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>AceZephyr</name></author>
	</entry>
	<entry>
		<id>http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1425&amp;oldid=prev</id>
		<title>AceZephyr: 1 revision imported: Import from old wiki</title>
		<link rel="alternate" type="text/html" href="http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1425&amp;oldid=prev"/>
		<updated>2024-06-10T06:02:53Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Import from old wiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:02, 10 June 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key ff7_wiki:diff:1.41:old-1424:rev-1425 --&gt;
&lt;/table&gt;</summary>
		<author><name>AceZephyr</name></author>
	</entry>
	<entry>
		<id>http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1424&amp;oldid=prev</id>
		<title>ff7&gt;Acezephyr: /* Implementation */</title>
		<link rel="alternate" type="text/html" href="http://ff7speedruns.com/index.php?title=Battle_RNG&amp;diff=1424&amp;oldid=prev"/>
		<updated>2022-03-06T19:22:51Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Implementation&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The Battle Engine use its own implementation of a [[Random Number Generator]] to generate unpredictable values. This random number generator is used for most, but not all, apparently random elements in battles.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
=== Battle RNG Table ===&lt;br /&gt;
Battle RNG consists of a lookup table consisting of the following 256 bytes:&amp;lt;pre&amp;gt;&lt;br /&gt;
63 06 F0 23 F8 E5 A8 01 C1 AE 7F 48 7B B1 DC 09&lt;br /&gt;
22 6D 7D EE 9D 58 D5 55 24 39 7A DF 8E 54 6C 1B&lt;br /&gt;
C0 0B D0 43 D8 9A 47 5D 21 02 17 4B DB 11 AF 70&lt;br /&gt;
CD 4D 34 49 72 91 2D 62 97 59 45 F7 6E 46 AA 0A&lt;br /&gt;
A3 C8 31 92 38 FA D4 E6 CB F3 DE 6B BB F1 1C 3C&lt;br /&gt;
D6 AD B2 A9 DD 57 42 95 0C 79 25 1F BC E7 AC 5B&lt;br /&gt;
83 28 76 F2 18 DA 87 A1 61 6F BE 5A 5E 51 EF B0&lt;br /&gt;
C9 15 74 89 BD D1 A2 75 D7 99 85 4C 4F D2 BF 4A&lt;br /&gt;
20 08 56 A0 50 3A 67 26 41 33 B7 BA FB 30 CF 7C&lt;br /&gt;
84 2C 32 E9 1D 16 82 78 A4 80 65 5F 0E 27 B9 19&lt;br /&gt;
C3 A7 B6 00 3B FC 88 E1 C6 93 FE 8B D9 B8 13 69&lt;br /&gt;
2F 64 12 37 FD 77 E2 B5 04 E0 1A 8C 8F B4 CC F9&lt;br /&gt;
60 EB 29 E3 90 A5 68 3D 81 73 3F AB 7E B3 0F CE&lt;br /&gt;
C4 35 94 96 86 71 D3 2A E4 9F 9C EC 4E 14 F5 EA&lt;br /&gt;
40 A6 F6 03 98 C5 07 F4 2B C2 3E E8 9B 36 53 2E&lt;br /&gt;
8D 0D 52 10 66 1E ED 8A 44 9E 05 FF 5C C7 6A CA&lt;br /&gt;
&amp;lt;/pre&amp;gt;This list does not appear to be directly hardcoded but it is not yet known how it is generated.&lt;br /&gt;
&lt;br /&gt;
=== State ===&lt;br /&gt;
The current Battle RNG state consists of:&lt;br /&gt;
&lt;br /&gt;
* Eight 1-byte indexes that refer to a position in the RNG table&lt;br /&gt;
* One 1-byte index that refers to one of the eight above indexes&lt;br /&gt;
* One 4-byte value that influences how Rand16 calls behave&lt;br /&gt;
&lt;br /&gt;
==== Index Array ====&lt;br /&gt;
The Battle RNG Index Array consists of eight 1-byte indexes that each refers to a position in the Battle RNG Table. One of these indexes is selected to be the Active Index by another index. The Active Index is usually incremented when Rand16 is called.&lt;br /&gt;
&lt;br /&gt;
The Index Array is seeded when a battle starts, and the Active Index is always initialized to 0.&lt;br /&gt;
&lt;br /&gt;
==== Counter ====&lt;br /&gt;
There is also another value called the Battle RNG Counter that increments on every Rand16 call and influences its behavior. This value is initialized to 0 when the game starts, but it is never reseeded or reinitialized afterwards.&lt;br /&gt;
&lt;br /&gt;
== Seeding ==&lt;br /&gt;
Battle RNG is seeded by the return value of a single call to [[System RNG]] which is used to populate the Index Array as follows:&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
void BattleSRand(int seed)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  int i;&lt;br /&gt;
  &lt;br /&gt;
  for (i = 0; i &amp;lt; 8; i = i + 1) {&lt;br /&gt;
    BattleRandArr[i] = (byte)seed;&lt;br /&gt;
    seed = seed &amp;gt;&amp;gt; 1;&lt;br /&gt;
  }&lt;br /&gt;
  BattleRandIdx = 0;&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Seeding Differences between PSX and PC ===&lt;br /&gt;
The process used to seed Battle RNG given a 15-bit seed is identical between PSX and PC, however there is an important difference in the process used to obtain that seed. On the PSX version, when the battle module is loaded, System RNG is reseeded based on the current frame counter, effectively removing the player&amp;#039;s ability to influence this seed. On PC, this does not happen, and the System RNG state remains how it was before the battle module was loaded.&lt;br /&gt;
&lt;br /&gt;
== Interfaces ==&lt;br /&gt;
There are several interfaces used to call Battle RNG or otherwise influence its state:&lt;br /&gt;
&lt;br /&gt;
=== Primary Interfaces ===&lt;br /&gt;
&lt;br /&gt;
==== BattleRand8 ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
byte BattleRand8(void)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  byte out;&lt;br /&gt;
  &lt;br /&gt;
  out = BattleRandTable[BattleRandArr[BattleRandIdx]];&lt;br /&gt;
  BattleRandArr[BattleRandIdx] = BattleRandArr[BattleRandIdx] + 1;&lt;br /&gt;
  return out;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== BattleRandIdxIncrement ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
void BattleRandIdxIncrement(void)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  BattleRandIdx = BattleRandIdx + 1 &amp;amp; 7;&lt;br /&gt;
  return;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== BattleRand16 ====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
ushort BattleRand16(void)&lt;br /&gt;
&lt;br /&gt;
{&lt;br /&gt;
  byte uVar1;&lt;br /&gt;
  byte uVar2;&lt;br /&gt;
  uint uVar3;&lt;br /&gt;
  &lt;br /&gt;
  uVar1 = BattleRand8();&lt;br /&gt;
  uVar3 = BattleRandCounter &amp;amp; 7;&lt;br /&gt;
  BattleRandCounter = BattleRandCounter + 1;&lt;br /&gt;
  if (uVar3 != 0) {&lt;br /&gt;
    BattleRandIdxIncrement();&lt;br /&gt;
  }&lt;br /&gt;
  uVar2 = BattleRand8();&lt;br /&gt;
  return CONCAT11(uVar2,uVar1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>ff7&gt;Acezephyr</name></author>
	</entry>
</feed>