Skip to content

Commit 8e6f09f

Browse files
author
GitHub Action
committed
Update RGBDS master documentation
1 parent 794fc78 commit 8e6f09f

10 files changed

+29
-20
lines changed

docs/gbz80.7.pdf

0 Bytes
Binary file not shown.

docs/rgbasm.1.pdf

0 Bytes
Binary file not shown.

docs/rgbasm.5.html

+29-20
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,14 @@ <h3 class="Ss" id="Operators"><a class="permalink" href="#Operators">Operators</
383383
<td>Unary not</td>
384384
</tr>
385385
</table>
386-
<p class="Pp"><code class="Ic">~</code> complements a value by inverting all its
387-
bits.</p>
388-
<p class="Pp"><code class="Ic">%</code> is used to get the remainder of the
389-
corresponding division, so that &#x2018;a / b * b + a % b == a&#x2019; is
390-
always true. The result has the same sign as the divisor. This makes
391-
&#x2018;a % b&#x2019;. equal to &#x2018;(a + b) % b&#x2019; or &#x2018;(a -
392-
b) % b&#x2019;.</p>
386+
<p class="Pp">&#x2018;~&#x2019; complements a value by inverting all its
387+
bits.</p>
388+
<p class="Pp">&#x2018;%&#x2019; is used to get the remainder of the
389+
corresponding division, so that &#x2018;<code class="Li">x / y * y + x % y
390+
== x</code>&#x2019; is always true. The result has the same sign as the
391+
divisor. This makes &#x2018;<code class="Li">x % y</code>&#x2019; equal to
392+
&#x2018;<code class="Li">(x + y) % y</code>&#x2019; or
393+
&#x2018;<code class="Li">(x - y) % y</code>&#x2019;.</p>
393394
<p class="Pp">Shifting works by shifting all bits in the left operand either
394395
left (&#x2018;&lt;&lt;&#x2019;) or right (&#x2018;&gt;&gt;&#x2019;) by the
395396
right operand's amount. When shifting left, all newly-inserted bits are
@@ -635,6 +636,13 @@ <h3 class="Ss" id="Fixed-point_expressions"><a class="permalink" href="#Fixed-po
635636
&#x2018;<code class="Li">MUL(6.0q8, 7.0q8, 8)</code>&#x2019; will evaluate
636637
to &#x2018;<code class="Li">42.0q8</code>&#x2019; no matter what value is
637638
set as the current <code class="Cm">Q</code> option.</p>
639+
<p class="Pp" id="dividend">The <code class="Ic">FMOD</code> function is used to
640+
get the remainder of the corresponding fixed-point division, so that
641+
&#x2018;<code class="Li">MUL(DIV(x, y), y) + FMOD(x, y) == x</code>&#x2019;
642+
is always true. The result has the same sign as the
643+
<a class="permalink" href="#dividend"><i class="Em">dividend</i></a>; this
644+
is the opposite of how the integer modulo operator &#x2018;%&#x2019;
645+
works!</p>
638646
<p class="Pp">The trigonometry functions ( <code class="Ic">SIN</code>,
639647
<code class="Ic">COS</code>, <code class="Ic">TAN</code>, etc) are defined
640648
in terms of a circle divided into 1.0 &quot;turns&quot; (equal to 2pi
@@ -1371,8 +1379,8 @@ <h3 class="Ss" id="Anonymous_labels"><a class="permalink" href="#Anonymous_label
13711379
</section>
13721380
<section class="Ss">
13731381
<h3 class="Ss" id="Variables"><a class="permalink" href="#Variables">Variables</a></h3>
1374-
<p class="Pp">An equal sign <code class="Ic">=</code> is used to define mutable
1375-
numeric symbols. Unlike the other symbols described below, variables can be
1382+
<p class="Pp">An equal sign &#x2018;=&#x2019; is used to define mutable numeric
1383+
symbols. Unlike the other symbols described below, variables can be
13761384
redefined. This is useful for internal symbols in macros, for counters,
13771385
etc.</p>
13781386
<div class="Bd Pp Bd-indent Li">
@@ -1431,9 +1439,9 @@ <h3 class="Ss" id="Variables"><a class="permalink" href="#Variables">Variables</
14311439
<h3 class="Ss" id="Numeric_constants"><a class="permalink" href="#Numeric_constants">Numeric
14321440
constants</a></h3>
14331441
<p class="Pp"><code class="Ic">EQU</code> is used to define immutable numeric
1434-
symbols. Unlike <code class="Ic">=</code> above, constants defined this way
1435-
cannot be redefined. These constants can be used for unchanging values such
1436-
as properties of the hardware.</p>
1442+
symbols. Unlike &#x2018;=&#x2019; above, constants defined this way cannot
1443+
be redefined. These constants can be used for unchanging values such as
1444+
properties of the hardware.</p>
14371445
<div class="Bd Pp Bd-indent Li">
14381446
<pre>def SCREEN_WIDTH equ 160 ;&#x00A0;In pixels
14391447
def SCREEN_HEIGHT equ 144</pre>
@@ -1927,14 +1935,15 @@ <h3 class="Ss" id="Unions"><a class="permalink" href="#Unions">Unions</a></h3>
19271935
</div>
19281936
<p class="Pp">In the example above, &#x2018;Name, Health, VideoBuffer&#x2019;
19291937
all have the same value, as do &#x2018;Nickname&#x2019; and
1930-
&#x2018;Lives&#x2019;. Thus, keep in mind that <code class="Ic">ld [Health],
1931-
a</code> is identical to <code class="Ic">ld [Name], a</code>.</p>
1938+
&#x2018;Lives&#x2019;. Thus, keep in mind that &#x2018;<code class="Li">ld
1939+
[Health], a</code>&#x2019; is identical to &#x2018;<code class="Li">ld
1940+
[Name], a</code>&#x2019;.</p>
19321941
<p class="Pp">The size of this union is 19 bytes, as this is the size of the
19331942
largest block (the last one, containing &#x2018;VideoBuffer&#x2019;).
19341943
Nesting unions is possible, with each inner union's size being considered as
19351944
described above.</p>
1936-
<p class="Pp">Unions may be used in any section, but inside them may only be
1937-
<code class="Ic">DS -</code> like commands (see
1945+
<p class="Pp">Unions may be used in any section, but they may only contain
1946+
space-allocating directives like <code class="Ic">DS</code> (see
19381947
<a class="Sx" href="#Statically_allocating_space_in_RAM">Statically
19391948
allocating space in RAM</a>).</p>
19401949
</section>
@@ -2093,8 +2102,8 @@ <h3 class="Ss" id="Printing_things_during_assembly"><a class="permalink" href="#
20932102
<dl class="Bl-inset">
20942103
<dt id="PRINT"><a class="permalink" href="#PRINT"><code class="Ic">PRINT</code></a></dt>
20952104
<dd>prints out each of its comma-separated arguments. Numbers are printed as
2096-
unsigned uppercase hexadecimal with a leading <code class="Ic">$</code>.
2097-
For different formats, use <code class="Ic">STRFMT</code>.</dd>
2105+
unsigned uppercase hexadecimal with a leading &#x2018;$&#x2019;. For
2106+
different formats, use <code class="Ic">STRFMT</code>.</dd>
20982107
<dt id="PRINTLN"><a class="permalink" href="#PRINTLN"><code class="Ic">PRINTLN</code></a></dt>
20992108
<dd>prints out each of its comma-separated arguments, if any, followed by a
21002109
line feed (&#x2018;<code class="Li">\n</code>&#x2019;).</dd>
@@ -2349,8 +2358,8 @@ <h3 class="Ss" id="Changing_options_while_assembling"><a class="permalink" href=
23492358
DW `00112233 ; uses the default graphics constant characters
23502359
PRINTLN $80000000/-1 ; no warning by default</pre>
23512360
</div>
2352-
<p class="Pp">The options that <code class="Ic">OPT</code> can modify are
2353-
currently: <code class="Cm">b</code>, <code class="Cm">g</code>,
2361+
<p class="Pp"><code class="Ic">OPT</code> can modify the options
2362+
<code class="Cm">b</code>, <code class="Cm">g</code>,
23542363
<code class="Cm">p</code>, <code class="Cm">Q</code>, and
23552364
<code class="Cm">r</code>.</p>
23562365
<p class="Pp"><code class="Ic">POPO</code> and <code class="Ic">PUSHO</code>

docs/rgbasm.5.pdf

769 Bytes
Binary file not shown.

docs/rgbds.5.pdf

0 Bytes
Binary file not shown.

docs/rgbds.7.pdf

0 Bytes
Binary file not shown.

docs/rgbfix.1.pdf

0 Bytes
Binary file not shown.

docs/rgbgfx.1.pdf

0 Bytes
Binary file not shown.

docs/rgblink.1.pdf

0 Bytes
Binary file not shown.

docs/rgblink.5.pdf

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)