Regenerate man page HTML renders

This commit is contained in:
ISSOtm
2020-04-03 12:03:59 +02:00
parent bdad1499fe
commit 80170eb6eb
9 changed files with 2362 additions and 1613 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBASM(1)</title> <title>RGBASM(1)</title>
</head> </head>
<body> <body>
@@ -24,107 +26,224 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbasm</code> &#x2014; <code class="Nm">rgbasm</code> &#x2014;
<div class="Nd">Game Boy assembler</div> <span class="Nd">Game Boy assembler</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm"> <table class="Nm">
<tr> <tr>
<td><code class="Nm">rgbasm</code></td> <td><code class="Nm">rgbasm</code></td>
<td>[<code class="Fl">-EhLVvw</code>] [<code class="Fl">-b</code> <td>[<code class="Fl"><a href="#E">-E</a><a href="#h">h</a><a href="#L">L</a><a href="#V">V</a><a href="#v">v</a><a href="#w">w</a></code>] [<code class="Fl"><a href="#b">-b</a></code>
<var class="Ar">chars</var>] [<code class="Fl">-D</code> <var class="Ar">chars</var>] [<code class="Fl"><a href="#D">-D</a></code>
<var class="Ar">name</var>[=<var class="Ar">value</var>]] <var class="Ar">name</var>[=<var class="Ar">value</var>]]
[<code class="Fl">-g</code> <var class="Ar">chars</var>] [<code class="Fl"><a href="#g">-g</a></code> <var class="Ar">chars</var>]
[<code class="Fl">-i</code> <var class="Ar">path</var>] [<code class="Fl"><a href="#i">-i</a></code> <var class="Ar">path</var>]
[<code class="Fl">-M</code> <var class="Ar">dependfile</var>] [<code class="Fl"><a href="#M">-M</a></code> <var class="Ar">depend_file</var>]
[<code class="Fl">-o</code> <var class="Ar">outfile</var>] [<code class="Fl"><a href="#o">-o</a></code> <var class="Ar">out_file</var>]
[<code class="Fl">-p</code> <var class="Ar">pad_value</var>] [<code class="Fl"><a href="#p">-p</a></code> <var class="Ar">pad_value</var>]
[<code class="Fl">-r</code> <var class="Ar">recursion_depth</var>] [<code class="Fl"><a href="#r">-r</a></code> <var class="Ar">recursion_depth</var>]
<var class="Ar">file</var></td> [<code class="Fl"><a href="#W">-W</a></code> <var class="Ar">warning</var>]
<var class="Ar">file ...</var></td>
</tr> </tr>
</table> </table>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <code class="Nm">rgbasm</code> program creates an object file from an The <code class="Nm">rgbasm</code> program creates an RGB object file from an
assembly source file. The input <var class="Ar">file</var> can be a file path, assembly source file. The input <var class="Ar">file</var> can be a file path,
or <code class="Cm">-</code> denoting <code class="Cm">stdin</code>. Its or <code class="Cm">-</code> denoting <code class="Cm">stdin</code>.
arguments are as follows: <p class="Pp">Note that options can be abbreviated as long as the abbreviation
is unambiguous: <code class="Fl">--verb</code> is
<code class="Fl">--verbose</code>, but
<code class="Fl">--ver</code> is invalid because it
could also be <code class="Fl">--version</code>. The
arguments are as follows:</p>
<dl class="Bl-tag"> <dl class="Bl-tag">
<dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a> <dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a>
<var class="Ar">chars</var>,
<code class="Fl">--binary-digits</code>
<var class="Ar">chars</var></dt> <var class="Ar">chars</var></dt>
<dd>Change the two characters used for binary constants. The defaults are <dd>Change the two characters used for binary constants. The defaults are
01.</dd> 01.</dd>
<dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a> <dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a>
<var class="Ar">name</var>[=<var class="Ar">value</var>],
<code class="Fl">-</code> <code class="Fl">-define</code>
<var class="Ar">name</var>[=<var class="Ar">value</var>]</dt> <var class="Ar">name</var>[=<var class="Ar">value</var>]</dt>
<dd>Add string symbol to the compiled source code. This is equivalent to <dd>Add a string symbol to the compiled source code. This is equivalent to
<var class="Ar">name</var> <code class="Cm">EQUS</code> &#x2018;<code class="Li"><var class="Ar">name</var> <code class="Ic">EQUS
&#x201C;<var class="Ar">value</var>&#x201D; in code. If a value is not &quot;</code><var class="Ar">value</var>&quot;</code>&#x2019; in code, or
specified, a value of 1 is given.</dd> &#x2018;<code class="Li"><var class="Ar">name</var> <code class="Ic">EQUS
<dt><a class="permalink" href="#E"><code class="Fl" id="E">-E</code></a></dt> &quot;1&quot;</code></code>&#x2019; if <var class="Ar">value</var> is not
specified.</dd>
<dt><a class="permalink" href="#E"><code class="Fl" id="E">-E</code></a>,
<code class="Fl">--export-all</code></dt>
<dd>Export all labels, including unreferenced and local labels.</dd> <dd>Export all labels, including unreferenced and local labels.</dd>
<dt><a class="permalink" href="#g"><code class="Fl" id="g">-g</code></a> <dt><a class="permalink" href="#g"><code class="Fl" id="g">-g</code></a>
<var class="Ar">chars</var>,
<code class="Fl">--gfx-chars</code>
<var class="Ar">chars</var></dt> <var class="Ar">chars</var></dt>
<dd>Change the four characters used for binary constants. The defaults are <dd>Change the four characters used for gfx constants. The defaults are
0123.</dd> 0123.</dd>
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt> <dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a>,
<dd>By default, <code class="Nm">rgbasm</code> inserts a &#x2018;nop&#x2019; <code class="Fl">--halt-without-nop</code></dt>
instruction immediately after any &#x2018;halt&#x2019; instruction. The <dd>By default, <code class="Nm">rgbasm</code> inserts a
<code class="Fl">-h</code> option disables this behavior.</dd> <code class="Ic">nop</code> instruction immediately after any
<code class="Ic">halt</code> instruction. The <code class="Fl">-h</code>
option disables this behavior.</dd>
<dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a> <dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a>
<var class="Ar">path</var>,
<code class="Fl">--include</code>
<var class="Ar">path</var></dt> <var class="Ar">path</var></dt>
<dd>Add an include path.</dd> <dd>Add an include path.</dd>
<dt><a class="permalink" href="#L"><code class="Fl" id="L">-L</code></a></dt> <dt><a class="permalink" href="#L"><code class="Fl" id="L">-L</code></a>,
<dd>Disable the optimization that turns loads of the form <b class="Sy">LD <code class="Fl">--preserve-ld</code></dt>
[$FF00+n8],A</b> into the opcode <b class="Sy">LDH [$FF00+n8],A</b> in <dd>Disable the optimization that turns loads of the form <code class="Ic">LD
order to have full control of the result in the final ROM.</dd> [$FF00+n8],A</code> into the opcode <code class="Ic">LDH
[$FF00+n8],A</code> in order to have full control of the result in the
final ROM.</dd>
<dt><a class="permalink" href="#M"><code class="Fl" id="M">-M</code></a> <dt><a class="permalink" href="#M"><code class="Fl" id="M">-M</code></a>
<var class="Ar">dependfile</var></dt> <var class="Ar">depend_file</var>,
<code class="Fl">--dependfile</code>
<var class="Ar">depend_file</var></dt>
<dd>Print <a class="Xr">make(1)</a> dependencies to <dd>Print <a class="Xr">make(1)</a> dependencies to
<var class="Ar">dependfile</var>.</dd> <var class="Ar">depend_file</var>.</dd>
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a> <dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
<var class="Ar">outfile</var></dt> <var class="Ar">out_file</var>,
<code class="Fl">--output</code>
<var class="Ar">out_file</var></dt>
<dd>Write an object file to the given filename.</dd> <dd>Write an object file to the given filename.</dd>
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a> <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
<var class="Ar">pad_value</var>,
<code class="Fl">--pad-value</code>
<var class="Ar">pad_value</var></dt> <var class="Ar">pad_value</var></dt>
<dd>When padding an image, pad with this value. The default is 0x00.</dd> <dd>When padding an image, pad with this value. The default is 0x00.</dd>
<dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a> <dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
<var class="Ar">recursion_depth</var>,
<code class="Fl">--recursion-depth</code>
<var class="Ar">recursion_depth</var></dt> <var class="Ar">recursion_depth</var></dt>
<dd>Specifies the recursion depth at which RGBASM will assume being in an <dd>Specifies the recursion depth at which RGBASM will assume being in an
infinite loop.</dd> infinite loop.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt> <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a>,
<code class="Fl">--version</code></dt>
<dd>Print the version of the program and exit.</dd> <dd>Print the version of the program and exit.</dd>
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt> <dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a>,
<code class="Fl">--verbose</code></dt>
<dd>Be verbose.</dd> <dd>Be verbose.</dd>
<dt><a class="permalink" href="#W"><code class="Fl" id="W">-W</code></a>
<var class="Ar">warning</var>,
<code class="Fl">--warning</code>
<var class="Ar">warning</var></dt>
<dd>Set warning flag <var class="Ar">warning</var>. A warning message will be
printed if <var class="Ar">warning</var> is an unknown warning flag. See
the <a class="Sx" href="#DIAGNOSTICS">DIAGNOSTICS</a> section for a list
of warnings.</dd>
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt> <dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
<dd>Disable warning output.</dd> <dd>Disable all warning output, even when turned into errors.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="DIAGNOSTICS"><a class="permalink" href="#DIAGNOSTICS">DIAGNOSTICS</a></h1>
Warnings are diagnostic messages that indicate possibly erroneous behavior that
does not necessarily compromise the assembling process. The following options
alter the way warnings are processed.
<dl class="Bl-tag">
<dt><a class="permalink" href="#Werror"><code class="Fl" id="Werror">-Werror</code></a></dt>
<dd>Make all warnings into errors.</dd>
<dt><a class="permalink" href="#Werror="><code class="Fl" id="Werror=">-Werror=</code></a></dt>
<dd>Make the specified warning into an error. A warning's name is appended
(example: <code class="Fl">-Werror=obsolete</code>), and this warning is
implicitly enabled and turned into an error. This is an error if used with
a meta warning, such as <code class="Fl">-Werror=all</code>.</dd>
</dl>
<p class="Pp">The following warnings are &#x201C;meta&#x201D; warnings, that
enable a collection of other warnings. If a specific warning is toggled via
a meta flag and a specific one, the more specific one takes priority. The
position on the command-line acts as a tie breaker, the last one taking
effect.</p>
<dl class="Bl-tag">
<dt><a class="permalink" href="#Wall"><code class="Fl" id="Wall">-Wall</code></a></dt>
<dd>This enables warnings that are likely to indicate an error or undesired
behavior, and that can easily be fixed.</dd>
<dt><a class="permalink" href="#Wextra"><code class="Fl" id="Wextra">-Wextra</code></a></dt>
<dd>This enables extra warnings that are less likely to pose a problem, but
that may still be wanted.</dd>
<dt><a class="permalink" href="#Weverything"><code class="Fl" id="Weverything">-Weverything</code></a></dt>
<dd>Enables literally every warning.</dd>
</dl>
<p class="Pp">The following warnings are actual warning flags; with each
description, the corresponding warning flag is included. Note that each of
these flag also has a negation (for example,
<code class="Fl">-Wempty-entry</code> enables the warning that
<code class="Fl">-Wno-empty-entry</code> disables). Only the non-default
flag is listed here. Ignoring the &#x201C;no-&#x201D; prefix, entries are
listed alphabetically.</p>
<dl class="Bl-tag">
<dt><a class="permalink" href="#Wno-assert"><code class="Fl" id="Wno-assert">-Wno-assert</code></a></dt>
<dd>Warns when <code class="Ic">WARN</code><span class="No">-type</span>
assertions fail. (See &#x201C;Aborting the assembly process&#x201D; in
<a class="Xr" href="rgbasm.5.html">rgbasm(5)</a> for <code class="Ic">ASSERT</code>).</dd>
<dt><a class="permalink" href="#Wbuiltin-args"><code class="Fl" id="Wbuiltin-args">-Wbuiltin-args</code></a></dt>
<dd>Warn about incorrect arguments to built-in functions, such as
<code class="Fn">STRSUB</code>() with indexes outside of the string's
bounds. This warning is enabled by <code class="Fl">-Wall</code>.</dd>
<dt><a class="permalink" href="#Wdiv"><code class="Fl" id="Wdiv">-Wdiv</code></a></dt>
<dd>Warn when dividing the smallest negative integer by -1, which yields
itself due to integer overflow.</dd>
<dt><a class="permalink" href="#Wempty-entry"><code class="Fl" id="Wempty-entry">-Wempty-entry</code></a></dt>
<dd>Warn when an empty entry is encountered in a <code class="Ic">db</code>,
<code class="Ic">dw</code>, <code class="Ic">dl</code> list. This warning
is enabled by <code class="Fl">-Wextra</code>.</dd>
<dt><a class="permalink" href="#Wlarge-constant"><code class="Fl" id="Wlarge-constant">-Wlarge-constant</code></a></dt>
<dd>Warn when a constant too large to fit in a signed 32-bit integer is
encountered. This warning is enabled by
<code class="Fl">-Wall</code>.</dd>
<dt><a class="permalink" href="#Wlong-string"><code class="Fl" id="Wlong-string">-Wlong-string</code></a></dt>
<dd>Warn when a string too long to fit in internal buffers is encountered.
This warning is enabled by <code class="Fl">-Wall</code>.</dd>
<dt><a class="permalink" href="#Wobsolete"><code class="Fl" id="Wobsolete">-Wobsolete</code></a></dt>
<dd>Warn when obsolete constructs such as the <code class="Ic">jp [hl]</code>
instruction or <code class="Ic">HOME</code> section type are encountered.
This warning is enabled by <code class="Fl">-Wextra</code>.</dd>
<dt><a class="permalink" href="#Wshift"><code class="Fl" id="Wshift">-Wshift</code></a></dt>
<dd>Warn when shifting right a negative value. Use a division by 2^N
instead.</dd>
<dt><a class="permalink" href="#Wshift-amount"><code class="Fl" id="Wshift-amount">-Wshift-amount</code></a></dt>
<dd>Warn when a shift's operand is negative or greater than 32.</dd>
<dt><a class="permalink" href="#Wno-truncation"><code class="Fl" id="Wno-truncation">-Wno-truncation</code></a></dt>
<dd>Warn when an implicit truncation (for example, <code class="Ic">db</code>)
loses some bits.</dd>
<dt><a class="permalink" href="#Wno-user"><code class="Fl" id="Wno-user">-Wno-user</code></a></dt>
<dd>Warn when the <code class="Ic">WARN</code> built-in is executed. (See
&#x201C;Aborting the assembly process&#x201D; in
<a class="Xr" href="rgbasm.5.html">rgbasm(5)</a> for <code class="Ic">WARN</code>).</dd>
</dl> </dl>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
You can assemble a source file in two ways. Straight forward way: You can assemble a source file in two ways.
<div class="Bd Pp Bd-indent"> <p class="Pp">Straightforward way:</p>
<pre> <div class="Bd Bd-indent"><code class="Li">$ rgbasm -o bar.o
$ rgbasm -o bar.o foo.asm foo.asm</code></div>
</pre>
</div>
<p class="Pp">Pipes way:</p> <p class="Pp">Pipes way:</p>
<div class="Bd Pp Bd-indent"> <div class="Bd Bd-indent"><code class="Li">$ cat foo.asm | rgbasm -o bar.o
<pre> -</code></div>
$ cat foo.asm | rgbasm -o bar.o - <div class="Bd Bd-indent"><code class="Li">$ rgbasm -o bar.o - &lt;
$ rgbasm -o bar.o - &lt; foo.asm foo.asm</code></div>
</pre> <p class="Pp">The resulting object file is not yet a usable ROM image&#x2014;it
</div> must first be run through <a class="Xr" href="rgblink.1.html">rgblink(1)</a> and then
<p class="Pp">The resulting object file is not yet a usable ROM image &#x2014; <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>.</p>
it must first be run through <a class="Xr">rgblink(1)</a> and </section>
<a class="Xr">rgbfix(1)</a>.</p> <section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
Please report bugs on
<a class="Lk" href="https://github.com/rednex/rgbds/issues">GitHub</a>.
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(5)</a>, <a class="Xr">rgbfix(1)</a>, <a class="Xr" href="rgbasm.5.html">rgbasm(5)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a> <a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -137,7 +256,7 @@ $ rgbasm -o bar.o - &lt; foo.asm
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">July 8, 2019</td> <td class="foot-date">July 8, 2019</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

File diff suppressed because it is too large Load Diff

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBDS(5)</title> <title>RGBDS(5)</title>
</head> </head>
<body> <body>
@@ -24,29 +26,30 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbds</code> &#x2014; <code class="Nm">rgbds</code> &#x2014;
<div class="Nd">object file format documentation</div> <span class="Nd">object file format documentation</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
This is the description of the object files used by <a class="Xr">rgbasm(1)</a> This is the description of the object files used by <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>
and <a class="Xr">rgblink(1)</a>. Please, note that the specifications may and <a class="Xr" href="rgblink.1.html">rgblink(1)</a>. <i class="Em">Please note that the
change. This toolchain is in development and new features may require adding specifications may change.</i> This toolchain is in development and new
more information to the current format, or modifying some fields, which would features may require adding more information to the current format, or
break compatibility with older versions. modifying some fields, which would break compatibility with older versions.
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="FILE_STRUCTURE"><a class="permalink" href="#FILE_STRUCTURE">FILE <h1 class="Sh" id="FILE_STRUCTURE"><a class="permalink" href="#FILE_STRUCTURE">FILE
STRUCTURE</a></h1> STRUCTURE</a></h1>
The following types are used: The following types are used:
<p class="Pp"><var class="Ar">LONG</var> is a 32&#x2010;bit integer stored in <p class="Pp"><var class="Ar">LONG</var> is a 32&#x2010;bit integer stored in
little&#x2010;endian format (Intel). <var class="Ar">BYTE</var> is an little&#x2010;endian format. <var class="Ar">BYTE</var> is an 8&#x2010;bit
8&#x2010;bit integer. <var class="Ar">STRING</var> is a 0&#x2010;terminated integer. <var class="Ar">STRING</var> is a 0&#x2010;terminated string of
string of <var class="Ar">BYTE</var>.</p> <var class="Ar">BYTE</var>.</p>
<div class="Bd Pp"> <div class="Bd Pp">
<pre> <pre>
; Header ; Header
BYTE ID[4] ; &quot;RGB6&quot; BYTE ID[4] ; &quot;RGB9&quot;
LONG RevisionNumber ; The format's revision number this file uses
LONG NumberOfSymbols ; The number of symbols used in this file LONG NumberOfSymbols ; The number of symbols used in this file
LONG NumberOfSections ; The number of sections used in this file LONG NumberOfSections ; The number of sections used in this file
@@ -60,8 +63,10 @@ REPT NumberOfSymbols ; Number of symbols defined in this object file.
BYTE Type ; 0 = LOCAL symbol only used in this file. BYTE Type ; 0 = LOCAL symbol only used in this file.
; 1 = IMPORT this symbol from elsewhere ; 1 = IMPORT this symbol from elsewhere
; 2 = EXPORT this symbol to other objects. ; 2 = EXPORT this symbol to other objects.
; Bit 7 is independent from the above value, and
; encodes whether the section is unionized
IF Type != 1 ; If symbol is defined in this object file. IF (Type &amp; 0x7F) != 1 ; If symbol is defined in this object file.
STRING FileName ; File where the symbol is defined. STRING FileName ; File where the symbol is defined.
@@ -102,8 +107,8 @@ REPT NumberOfSections
; decide (floating bank). This field is only valid for ROMX, ; decide (floating bank). This field is only valid for ROMX,
; VRAM, WRAMX and SRAM sections. ; VRAM, WRAMX and SRAM sections.
LONG Align ; Alignment of this section (expressed as number of low bits LONG Align ; Alignment of this section, expressed as 1 &lt;&lt; align. 1 if
; to leave as 0). -1 if not defined. ; not specified.
IF (Type == ROMX) || (Type == ROM0) ; Sections that can contain data. IF (Type == ROMX) || (Type == ROM0) ; Sections that can contain data.
@@ -118,8 +123,6 @@ REPT NumberOfSections
STRING SourceFile ; Name of the source file (for printing error STRING SourceFile ; Name of the source file (for printing error
; messages). ; messages).
LONG Line ; The line of the source file.
LONG Offset ; Offset into the section where patch should LONG Offset ; Offset into the section where patch should
; be applied (in bytes). ; be applied (in bytes).
@@ -137,6 +140,34 @@ REPT NumberOfSections
ENDC ENDC
ENDR
; Assertions
LONG NumberOfAssertions
REPT NumberOfAssertions
STRING SourceFile ; Name of the source file (for printing the failure).
LONG Offset ; Offset into the section where the assertion is located.
BYTE Type ; 0 = Prints the message but allows linking to continue
; 1 = Prints the message and evaluates other assertions,
; but linking fails afterwards
; 2 = Prints the message and immediately fails linking
LONG RPNSize ; Size of the RPN expression's buffer.
BYTE RPN[RPNSize] ; RPN expression, same as patches. Assert fails if == 0.
LONG SectionID ; The section number (of this object file) in which this
; assert is defined. If it doesn't belong to any specific
; section (like a constant), this field has the value -1.
STRING Message ; A message displayed when the assert fails. If set to
; the empty string, a generic message is printed instead.
ENDR ENDR
</pre> </pre>
</div> </div>
@@ -145,15 +176,15 @@ ENDR
DATA</a></h2> DATA</a></h2>
Expressions in the object file are stored as RPN. This is an expression of the Expressions in the object file are stored as RPN. This is an expression of the
form &#x201C;2 5 +&#x201D;. This will first push the value &#x201C;2&#x201D; form &#x201C;2 5 +&#x201D;. This will first push the value &#x201C;2&#x201D;
to the stack. Then &#x201C;5&#x201D;. The &#x201C;+&#x201D; operator pops two to the stack, then &#x201C;5&#x201D;. The &#x201C;+&#x201D; operator pops two
arguments from the stack, adds them, and then pushes the result on the stack, arguments from the stack, adds them, and then pushes the result on the stack,
effectively replacing the two top arguments with their sum. In the RGB format, effectively replacing the two top arguments with their sum. In the RGB format,
RPN expressions are stored as BYTEs with some bytes being special prefixes for RPN expressions are stored as <var class="Ar">BYTE</var>s with some bytes
integers and symbols. being special prefixes for integers and symbols.
<table class="Bl-column Bd-indent"> <table class="Bl-column Bd-indent">
<tr> <tr>
<td><b class="Sy">Value</b></td> <th>Value</th>
<td><b class="Sy">Meaning</b></td> <th>Meaning</th>
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$00"><code class="Li" id="$00">$00</code></a></td> <td><a class="permalink" href="#$00"><code class="Li" id="$00">$00</code></a></td>
@@ -261,23 +292,28 @@ Expressions in the object file are stored as RPN. This is an expression of the
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$50"><code class="Li" id="$50">$50</code></a></td> <td><a class="permalink" href="#$50"><code class="Li" id="$50">$50</code></a></td>
<td><a class="permalink" href="#BANK(symbol),"><code class="Li" id="BANK(symbol),">BANK(symbol),</code></a> <td><a class="permalink" href="#BANK(symbol)"><code class="Li" id="BANK(symbol)">BANK(symbol)</code></a>,
a <var class="Ar">LONG</var> Symbol ID follows.</td> a <var class="Ar">LONG</var> Symbol ID follows.</td>
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$51"><code class="Li" id="$51">$51</code></a></td> <td><a class="permalink" href="#$51"><code class="Li" id="$51">$51</code></a></td>
<td><a class="permalink" href="#BANK(section_name),"><code class="Li" id="BANK(section_name),">BANK(section_name),</code></a> <td><a class="permalink" href="#BANK(section_name)"><code class="Li" id="BANK(section_name)">BANK(section_name)</code></a>,
a null-terminated string follows.</td> a null-terminated string follows.</td>
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$52"><code class="Li" id="$52">$52</code></a></td> <td><a class="permalink" href="#$52"><code class="Li" id="$52">$52</code></a></td>
<td><a class="permalink" href="#Current_BANK()"><code class="Li" id="Current_BANK()">Current <td><a class="permalink" href="#Current_BANK()"><code class="Li" id="Current_BANK()">Current
BANK()</code></a>.</td> BANK()</code></a></td>
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$60"><code class="Li" id="$60">$60</code></a></td> <td><a class="permalink" href="#$60"><code class="Li" id="$60">$60</code></a></td>
<td><a class="permalink" href="#HRAMCheck."><code class="Li" id="HRAMCheck.">HRAMCheck.</code></a> <td><a class="permalink" href="#HRAMCheck"><code class="Li" id="HRAMCheck">HRAMCheck</code></a>.
Check if the value is in HRAM, AND it with 0xFF.</td> Checks if the value is in HRAM, ANDs it with 0xFF.</td>
</tr>
<tr>
<td><a class="permalink" href="#$61"><code class="Li" id="$61">$61</code></a></td>
<td><a class="permalink" href="#RSTCheck"><code class="Li" id="RSTCheck">RSTCheck</code></a>.
Checks if the value is a RST vector, ORs it with 0xC7.</td>
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$80"><code class="Li" id="$80">$80</code></a></td> <td><a class="permalink" href="#$80"><code class="Li" id="$80">$80</code></a></td>
@@ -285,7 +321,7 @@ Expressions in the object file are stored as RPN. This is an expression of the
</tr> </tr>
<tr> <tr>
<td><a class="permalink" href="#$81"><code class="Li" id="$81">$81</code></a></td> <td><a class="permalink" href="#$81"><code class="Li" id="$81">$81</code></a></td>
<td><var class="Ar">LONG</var> Symbol ID follows.</td> <td><var class="Ar">LONG</var> symbol ID follows.</td>
</tr> </tr>
</table> </table>
</section> </section>
@@ -293,8 +329,8 @@ Expressions in the object file are stored as RPN. This is an expression of the
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>,
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a> <a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -307,7 +343,7 @@ Expressions in the object file are stored as RPN. This is an expression of the
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">January 26, 2018</td> <td class="foot-date">January 26, 2018</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBDS(7)</title> <title>RGBDS(7)</title>
</head> </head>
<body> <body>
@@ -24,7 +26,7 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbds</code> &#x2014; <code class="Nm">rgbds</code> &#x2014;
<div class="Nd">Rednex Game Boy Development System</div> <span class="Nd">Rednex Game Boy Development System</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
@@ -40,9 +42,9 @@ $ rgbfix -v -p 0 baz.gb
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgbfix(1)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
<a class="Xr">gbz80(7)</a> <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -71,7 +73,7 @@ $ rgbfix -v -p 0 baz.gb
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">March 7, 2018</td> <td class="foot-date">March 7, 2018</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBFIX(1)</title> <title>RGBFIX(1)</title>
</head> </head>
<body> <body>
@@ -24,22 +26,23 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbfix</code> &#x2014; <code class="Nm">rgbfix</code> &#x2014;
<div class="Nd">Game Boy checksum fixer</div> <span class="Nd">Game Boy header utility and checksum fixer</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm"> <table class="Nm">
<tr> <tr>
<td><code class="Nm">rgbfix</code></td> <td><code class="Nm">rgbfix</code></td>
<td>[<code class="Fl">-CcjsVv</code>] [<code class="Fl">-f</code> <td>[<code class="Fl"><a href="#j">-j</a><a href="#s">s</a><a href="#V">V</a><a href="#v">v</a></code>] [<code class="Fl"><a href="#C">-C</a></code> |
<var class="Ar">fix_spec</var>] [<code class="Fl">-i</code> <code class="Fl"><a href="#c">-c</a></code>] [<code class="Fl"><a href="#f">-f</a></code>
<var class="Ar">game_id</var>] [<code class="Fl">-k</code> <var class="Ar">fix_spec</var>] [<code class="Fl"><a href="#i">-i</a></code>
<var class="Ar">licensee_str</var>] [<code class="Fl">-l</code> <var class="Ar">game_id</var>] [<code class="Fl"><a href="#k">-k</a></code>
<var class="Ar">licensee_id</var>] [<code class="Fl">-m</code> <var class="Ar">licensee_str</var>] [<code class="Fl"><a href="#l">-l</a></code>
<var class="Ar">mbc_type</var>] [<code class="Fl">-n</code> <var class="Ar">licensee_id</var>] [<code class="Fl"><a href="#m">-m</a></code>
<var class="Ar">rom_version</var>] [<code class="Fl">-p</code> <var class="Ar">mbc_type</var>] [<code class="Fl"><a href="#n">-n</a></code>
<var class="Ar">pad_value</var>] [<code class="Fl">-r</code> <var class="Ar">rom_version</var>] [<code class="Fl"><a href="#p">-p</a></code>
<var class="Ar">ram_size</var>] [<code class="Fl">-t</code> <var class="Ar">pad_value</var>] [<code class="Fl"><a href="#r">-r</a></code>
<var class="Ar">ram_size</var>] [<code class="Fl"><a href="#t">-t</a></code>
<var class="Ar">title_str</var>] <var class="Ar">file</var></td> <var class="Ar">title_str</var>] <var class="Ar">file</var></td>
</tr> </tr>
</table> </table>
@@ -47,19 +50,28 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <code class="Nm">rgbfix</code> program changes headers of Game Boy ROM The <code class="Nm">rgbfix</code> program changes headers of Game Boy ROM
images. It also performs other filetype operations, such as truncation. The images. It also performs other correctness operations, such as padding.
arguments are as follows: <p class="Pp">Note that options can be abbreviated as long as the abbreviation
is unambiguous: <code class="Fl">--verb</code> is
<code class="Fl">--verbose</code>, but
<code class="Fl">--ver</code> is invalid because it
could also be <code class="Fl">--version</code>. The
arguments are as follows:</p>
<dl class="Bl-tag"> <dl class="Bl-tag">
<dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a></dt> <dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a>,
<code class="Fl">--color-only</code></dt>
<dd>Set the Game Boy Color&#x2013;only flag: <span class="Ad">0x143</span> = <dd>Set the Game Boy Color&#x2013;only flag: <span class="Ad">0x143</span> =
0xC0. If both this and the <code class="Fl">-c</code> flag are set, this 0xC0. If both this and the <code class="Fl">-c</code> flag are set, this
takes precedence.</dd> takes precedence.</dd>
<dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a></dt> <dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a>,
<code class="Fl">--color-compatible</code></dt>
<dd>Set the Game Boy Color&#x2013;compatible flag: <dd>Set the Game Boy Color&#x2013;compatible flag:
<span class="Ad">0x143</span> = 0x80. If both this and the <span class="Ad">0x143</span> = 0x80. If both this and the
<code class="Fl">-C</code> flag are set, <code class="Fl">-C</code> takes <code class="Fl">-C</code> flag are set, <code class="Fl">-C</code> takes
precedence.</dd> precedence.</dd>
<dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a> <dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a>
<var class="Ar">fix_spec</var>,
<code class="Fl">--fix-spec</code>
<var class="Ar">fix_spec</var></dt> <var class="Ar">fix_spec</var></dt>
<dd>Fix certain header values that the Game Boy checks for correctness. <dd>Fix certain header values that the Game Boy checks for correctness.
Alternatively, intentionally trash these values by writing their binary Alternatively, intentionally trash these values by writing their binary
@@ -84,45 +96,64 @@ The <code class="Nm">rgbfix</code> program changes headers of Game Boy ROM
</dl> </dl>
</dd> </dd>
<dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a> <dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a>
<var class="Ar">game_id</var>,
<code class="Fl">--game-id</code>
<var class="Ar">game_id</var></dt> <var class="Ar">game_id</var></dt>
<dd>Set the game ID string <dd>Set the game ID string
(<span class="Ad">0x13F</span>&#x2013;<span class="Ad">0x142</span>) to a (<span class="Ad">0x13F</span>&#x2013;<span class="Ad">0x142</span>) to a
given string of exactly 4 characters. If both this and the title are set, given string of exactly 4 characters. If both this and the title are set,
the game ID will overwrite the overlapping portion of the title.</dd> the game ID will overwrite the overlapping portion of the title.</dd>
<dt><a class="permalink" href="#j"><code class="Fl" id="j">-j</code></a></dt> <dt><a class="permalink" href="#j"><code class="Fl" id="j">-j</code></a>,
<code class="Fl">--non-japanese</code></dt>
<dd>Set the non-Japanese region flag: <span class="Ad">0x14A</span> = 1.</dd> <dd>Set the non-Japanese region flag: <span class="Ad">0x14A</span> = 1.</dd>
<dt><a class="permalink" href="#k"><code class="Fl" id="k">-k</code></a> <dt><a class="permalink" href="#k"><code class="Fl" id="k">-k</code></a>
<var class="Ar">licensee_str</var>,
<code class="Fl">--new-licensee</code>
<var class="Ar">licensee_str</var></dt> <var class="Ar">licensee_str</var></dt>
<dd>Set the new licensee string <dd>Set the new licensee string
(<span class="Ad">0x144</span>&#x2013;<span class="Ad">0x145</span>) to a (<span class="Ad">0x144</span>&#x2013;<span class="Ad">0x145</span>) to a
given string, truncated to at most two characters.</dd> given string, truncated to at most two characters.</dd>
<dt><a class="permalink" href="#l_2"><code class="Fl" id="l_2">-l</code></a> <dt><a class="permalink" href="#l_2"><code class="Fl" id="l_2">-l</code></a>
<var class="Ar">licensee_id</var>,
<code class="Fl">--old-licensee</code>
<var class="Ar">licensee_id</var></dt> <var class="Ar">licensee_id</var></dt>
<dd>Set the old licensee code, <span class="Ad">0x14B</span>, to a given value <dd>Set the old licensee code, <span class="Ad">0x14B</span>, to a given value
from 0 to 0xFF. This value is deprecated and should be set to 0x33 in all from 0 to 0xFF. This value is deprecated and should be set to 0x33 in all
new software.</dd> new software.</dd>
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a> <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
<var class="Ar">mbc_type</var>,
<code class="Fl">--mbc-type</code>
<var class="Ar">mbc_type</var></dt> <var class="Ar">mbc_type</var></dt>
<dd>Set the MBC type, <span class="Ad">0x147</span>, to a given value from 0 <dd>Set the MBC type, <span class="Ad">0x147</span>, to a given value from 0
to 0xFF.</dd> to 0xFF.</dd>
<dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a> <dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
<var class="Ar">rom_version</var>,
<code class="Fl">--rom-version</code>
<var class="Ar">rom_version</var></dt> <var class="Ar">rom_version</var></dt>
<dd>Set the ROM version, <span class="Ad">0x14C</span>, to a given value from <dd>Set the ROM version, <span class="Ad">0x14C</span>, to a given value from
0 to 0xFF.</dd> 0 to 0xFF.</dd>
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a> <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
<var class="Ar">pad_value</var>,
<code class="Fl">--pad-value</code>
<var class="Ar">pad_value</var></dt> <var class="Ar">pad_value</var></dt>
<dd>Pad the image to a valid size with a given pad value from 0 to 0xFF. <dd>Pad the image to a valid size with a given pad value from 0 to 0xFF.
<code class="Nm">rgbfix</code> will automatically pick a size from 32 KiB, <code class="Nm">rgbfix</code> will automatically pick a size from 32 KiB,
64KiB, 128KiB, ..., 8192KiB and give a warning thereafter. The cartridge 64 KiB, 128 KiB, ..., 8192 KiB. The cartridge size byte
size byte (<span class="Ad">0x148</span>) will be changed to reflect this (<span class="Ad">0x148</span>) will be changed to reflect this new
new size.</dd> size.</dd>
<dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a> <dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
<var class="Ar">ram_size</var>,
<code class="Fl">--ram-size</code>
<var class="Ar">ram_size</var></dt> <var class="Ar">ram_size</var></dt>
<dd>Set the RAM size, <span class="Ad">0x149</span>, to a given value from 0 <dd>Set the RAM size, <span class="Ad">0x149</span>, to a given value from 0
to 0xFF.</dd> to 0xFF.</dd>
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a></dt> <dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>,
<dd>Set the SGB flag: <span class="Ad">0x146</span> = 3.</dd> <code class="Fl">--sgb-compatible</code></dt>
<dd>Set the SGB flag: <span class="Ad">0x146</span> = 3. This flag will be
ignored by the SGB unless the old licensee code is 0x33!</dd>
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a> <dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>
<var class="Ar">title</var>,
<code class="Fl">--title</code>
<var class="Ar">title</var></dt> <var class="Ar">title</var></dt>
<dd>Set the title string <dd>Set the title string
(<span class="Ad">0x134</span>&#x2013;<span class="Ad">0x143</span>) to a (<span class="Ad">0x134</span>&#x2013;<span class="Ad">0x143</span>) to a
@@ -131,28 +162,29 @@ The <code class="Nm">rgbfix</code> program changes headers of Game Boy ROM
(<code class="Fl">-c</code> or <code class="Fl">-C</code>). If both this (<code class="Fl">-c</code> or <code class="Fl">-C</code>). If both this
and the game ID are set, the game ID will overwrite the overlapping and the game ID are set, the game ID will overwrite the overlapping
portion of the title.</dd> portion of the title.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt> <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a>,
<code class="Fl">--version</code></dt>
<dd>Print the version of the program and exit.</dd> <dd>Print the version of the program and exit.</dd>
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt> <dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a>,
<code class="Fl">--validate</code></dt>
<dd>Equivalent to <code class="Fl">-f</code> <code class="Cm">lhg</code>.</dd> <dd>Equivalent to <code class="Fl">-f</code> <code class="Cm">lhg</code>.</dd>
</dl> </dl>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> <h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
Most values in the ROM header are only cosmetic. The bare minimum requirements Most values in the ROM header are only cosmetic. The bare minimum requirements
for a workable image are checksums, the Nintendo logo, and (if needed) the for a workable program are the header checksum, the Nintendo logo, and (if
CGB/SGB flags. It is a good idea to pad the image to a valid size as well needed) the CGB/SGB flags. It is a good idea to pad the image to a valid size
(&#x201C;valid&#x201D; meaning a multiple of 32KiB). as well (&#x201C;valid&#x201D; meaning a power of 2, times 32 KiB).
<p class="Pp">The following will make a plain, no-color Game Boy game without <p class="Pp">The following will make a plain, non-color Game Boy game without
checking for a valid size:</p> checking for a valid size:</p>
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -v foo.gb</div> <div class="Bd Bd-indent">$ rgbfix -v foo.gb</div>
<p class="Pp">The following will make a SGB-enabled, color-enabled game with a <p class="Pp">The following will make a SGB-enabled, color-enabled game with a
title of &#x201C;foobar&#x201D;, and pad it to a multiple of 32KiB. (The title of &#x201C;foobar&#x201D;, and pad it to a valid size. (The Game Boy
Game Boy itself does not use the title, but some emulators or ROM managers itself does not use the title, but some emulators or ROM managers do.)</p>
might.)</p>
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -vcs -l 0x33 -p 0 -t foobar baz.gb</div> <div class="Bd Bd-indent">$ rgbfix -vcs -l 0x33 -p 255 -t foobar baz.gb</div>
<p class="Pp">The following will duplicate the header (sans global checksum) of <p class="Pp">The following will duplicate the header (sans global checksum) of
the game &#x201C;Survival Kids&#x201D;:</p> the game &#x201C;Survival Kids&#x201D;:</p>
<p class="Pp"></p> <p class="Pp"></p>
@@ -160,10 +192,15 @@ Most values in the ROM header are only cosmetic. The bare minimum requirements
SURVIVALKIDAVKE SurvivalKids.gbc</div> SURVIVALKIDAVKE SurvivalKids.gbc</div>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
Please report bugs on
<a class="Lk" href="https://github.com/rednex/rgbds/issues">GitHub</a>.
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>,
<a class="Xr">rgbds(7)</a> <a class="Xr" href="rgbds.7.html">rgbds(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -175,8 +212,8 @@ Most values in the ROM header are only cosmetic. The bare minimum requirements
</div> </div>
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">March 11, 2018</td> <td class="foot-date">December 5, 2019</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBGFX(1)</title> <title>RGBGFX(1)</title>
</head> </head>
<body> <body>
@@ -24,20 +26,23 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbgfx</code> &#x2014; <code class="Nm">rgbgfx</code> &#x2014;
<div class="Nd">Game Boy graphics converter</div> <span class="Nd">Game Boy graphics converter</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm"> <table class="Nm">
<tr> <tr>
<td><code class="Nm">rgbgfx</code></td> <td><code class="Nm">rgbgfx</code></td>
<td>[<code class="Fl">-ADfFhmPTuVv</code>] [<code class="Fl">-o</code> <td>[<code class="Fl"><a href="#C">-C</a><a href="#D">D</a><a href="#h">h</a><a href="#m">m</a><a href="#u">u</a><a href="#V">V</a><a href="#v">v</a></code>] [<code class="Fl"><a href="#f">-f</a></code> |
<var class="Ar">outfile</var>] [<code class="Fl">-a</code> <code class="Fl"><a href="#F">-F</a></code>] [<code class="Fl"><a href="#a">-a</a></code>
<var class="Ar">attrmap</var>] [<code class="Fl">-d</code> <var class="Ar">attrmap</var> | <code class="Fl"><a href="#A">-A</a></code>]
<var class="Ar">depth</var>] [<code class="Fl">-p</code> [<code class="Fl"><a href="#d">-d</a></code> <var class="Ar">depth</var>]
<var class="Ar">palfile</var>] [<code class="Fl">-t</code> [<code class="Fl"><a href="#o">-o</a></code> <var class="Ar">out_file</var>]
<var class="Ar">tilemap</var>] [<code class="Fl">-x</code> [<code class="Fl"><a href="#p">-p</a></code> <var class="Ar">pal_file</var> |
<var class="Ar">tiles</var>] <var class="Ar">file</var></td> <code class="Fl"><a href="#P">-P</a></code>] [<code class="Fl"><a href="#t">-t</a></code>
<var class="Ar">tilemap</var> | <code class="Fl"><a href="#T">-T</a></code>]
[<code class="Fl"><a href="#x">-x</a></code> <var class="Ar">tiles</var>]
<var class="Ar">file</var></td>
</tr> </tr>
</table> </table>
</section> </section>
@@ -54,9 +59,9 @@ The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
the indices appropriate for each shade. Any undetermined indices are set the indices appropriate for each shade. Any undetermined indices are set
to respective default shades of gray. For example: if the bit depth is 2 to respective default shades of gray. For example: if the bit depth is 2
and the image contains light gray and black, they become the second and and the image contains light gray and black, they become the second and
fourth colors - and the first and third colors get set to default white fourth colors, and the first and third colors get set to default white and
and dark gray. If the image has multiple shades that map to the same dark gray. If the image has multiple shades that map to the same index,
index, the palette is instead determined as if the image had color.</li> the palette is instead determined as if the image had color.</li>
<li>If the image has color (or the grayscale method failed), the colors are <li>If the image has color (or the grayscale method failed), the colors are
sorted from lightest to darkest.</li> sorted from lightest to darkest.</li>
</ul> </ul>
@@ -65,73 +70,103 @@ The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1> <h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1>
Note that options can be abbreviated as long as the abbreviation is unambiguous:
<code class="Fl">--verb</code> is
<code class="Fl">-</code> <code class="Fl">-verbose</code>, but
<code class="Fl">--ver</code> is invalid because it
could also be <code class="Fl">--version</code>. The
arguments are as follows:
<dl class="Bl-tag"> <dl class="Bl-tag">
<dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a> <dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a>
<var class="Ar">attrmap,</var>
<code class="Fl">--attr-map</code>
<var class="Ar">attrmap</var></dt> <var class="Ar">attrmap</var></dt>
<dd>Generate a file of tile mirroring attributes for OAM or (CGB-only) <dd>Generate a file of tile mirroring attributes for OAM or (CGB-only)
background tiles. For each tile in the input file, a byte is written background tiles. For each tile in the input file, a byte is written
representing the dimensions that the associated tile in the output file representing the dimensions that the associated tile in the output file
should be mirrored. Useful in combination with <code class="Fl">-m</code> should be mirrored. Useful in combination with <code class="Fl">-m</code>
to keep track the mirror direction of mirrored duplicate tiles.</dd> to keep track the mirror direction of mirrored duplicate tiles.</dd>
<dt><a class="permalink" href="#A"><code class="Fl" id="A">-A</code></a></dt> <dt><a class="permalink" href="#A"><code class="Fl" id="A">-A</code></a>,
<code class="Fl">--output-attr-map</code></dt>
<dd>Same as <code class="Fl">-a</code>, but the attrmap file output name is <dd>Same as <code class="Fl">-a</code>, but the attrmap file output name is
made by taking the input filename, removing the file extension, and made by taking the input filename, removing the file extension, and
appending <span class="Pa">.attrmap</span>.</dd> appending <span class="Pa">.attrmap</span>.</dd>
<dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a></dt> <dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a>,
<code class="Fl">--color-curve</code></dt>
<dd>Use the color curve of the Game Boy Color when generating palettes.</dd> <dd>Use the color curve of the Game Boy Color when generating palettes.</dd>
<dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a></dt> <dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a>,
<code class="Fl">--debug</code></dt>
<dd>Debug features are enabled.</dd> <dd>Debug features are enabled.</dd>
<dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a></dt>
<dd>Fix the input PNG file to be a correctly indexed image.</dd>
<dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a></dt>
<dd>Same as <code class="Fl">-f</code>, but additionally, the supplied command
line parameters are saved within the PNG and will be loaded and
automatically used next time.</dd>
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a> <dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
<var class="Ar">depth</var>,
<code class="Fl">--depth</code>
<var class="Ar">depth</var></dt> <var class="Ar">depth</var></dt>
<dd>The bit depth of the output image (either 1 or 2). By default, the bit <dd>The bit depth of the output image (either 1 or 2). By default, the bit
depth is 2 (two bits per pixel).</dd> depth is 2 (two bits per pixel).</dd>
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt> <dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a>,
<code class="Fl">--fix</code></dt>
<dd>Fix the input PNG file to be a correctly indexed image.</dd>
<dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a>,
<code class="Fl">--fix-and-save</code></dt>
<dd>Same as <code class="Fl">-f</code>, but additionally, the supplied command
line parameters are saved within the PNG and will be loaded and
automatically used next time.</dd>
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a>,
<code class="Fl">--horizontal</code></dt>
<dd>Lay out tiles horizontally rather than vertically.</dd> <dd>Lay out tiles horizontally rather than vertically.</dd>
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a></dt> <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>,
<code class="Fl">--mirror-tiles</code></dt>
<dd>Truncate tiles by checking for tiles that are mirrored versions of others <dd>Truncate tiles by checking for tiles that are mirrored versions of others
and omitting these from the output file. Useful with tilemaps and attrmaps and omitting these from the output file. Useful with tilemaps and attrmaps
together to keep track of the duplicated tiles and the dimension mirrored. together to keep track of the duplicated tiles and the dimension mirrored.
Tiles are checked for horizontal, vertical, and horizontal-vertical Tiles are checked for horizontal, vertical, and horizontal-vertical
mirroring. Implies <code class="Fl">-u</code>.</dd> mirroring. Implies <code class="Fl">-u</code>.</dd>
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a> <dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
<var class="Ar">outfile</var></dt> <var class="Ar">out_file</var>,
<code class="Fl">--output</code>
<var class="Ar">out_file</var></dt>
<dd>The name of the output file.</dd> <dd>The name of the output file.</dd>
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a> <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
<var class="Ar">palfile</var></dt> <var class="Ar">pal_file</var>,
<dd>Output the image's palette in standard GBC palette format - bytes (8 bytes <code class="Fl">--palette</code>
<var class="Ar">pal_file</var></dt>
<dd>Output the image's palette in standard GBC palette format: bytes (8 bytes
for two bits per pixel, 4 bytes for one bit per pixel) containing the for two bits per pixel, 4 bytes for one bit per pixel) containing the
RGB15 values in little-endian byte order. If the palette contains too few RGB15 values in little-endian byte order. If the palette contains too few
colors, the remaining entries are set to black.</dd> colors, the remaining entries are set to black.</dd>
<dt><a class="permalink" href="#P"><code class="Fl" id="P">-P</code></a></dt> <dt><a class="permalink" href="#P"><code class="Fl" id="P">-P</code></a>,
<code class="Fl">--output-palette</code></dt>
<dd>Same as <code class="Fl">-p</code>, but the palette file output name is <dd>Same as <code class="Fl">-p</code>, but the palette file output name is
made by taking the input PNG file's filename, removing the file extension, made by taking the input PNG file's filename, removing the file extension,
and appending <span class="Pa">.pal</span>.</dd> and appending <span class="Pa">.pal</span>.</dd>
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a> <dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>
<var class="Ar">tilemap</var>,
<code class="Fl">--tilemap</code>
<var class="Ar">tilemap</var></dt> <var class="Ar">tilemap</var></dt>
<dd>Generate a file of tile indices. For each tile in the input file, a byte <dd>Generate a file of tile indices. For each tile in the input file, a byte
is written representing the index of the associated tile in the output is written representing the index of the associated tile in the output
file. Useful in combination with <code class="Fl">-u</code> or file. Useful in combination with <code class="Fl">-u</code> or
<code class="Fl">-m</code> to keep track of duplicate tiles.</dd> <code class="Fl">-m</code> to keep track of duplicate tiles.</dd>
<dt><a class="permalink" href="#T"><code class="Fl" id="T">-T</code></a></dt> <dt><a class="permalink" href="#T"><code class="Fl" id="T">-T</code></a>,
<code class="Fl">--output-tilemap</code></dt>
<dd>Same as <code class="Fl">-t</code>, but the tilemap file output name is <dd>Same as <code class="Fl">-t</code>, but the tilemap file output name is
made by taking the input filename, removing the file extension, and made by taking the input filename, removing the file extension, and
appending <span class="Pa">.tilemap</span>.</dd> appending <span class="Pa">.tilemap</span>.</dd>
<dt><a class="permalink" href="#u"><code class="Fl" id="u">-u</code></a></dt> <dt><a class="permalink" href="#u"><code class="Fl" id="u">-u</code></a>,
<code class="Fl">--unique-tiles</code></dt>
<dd>Truncate tiles by checking for tiles that are exact duplicates of others <dd>Truncate tiles by checking for tiles that are exact duplicates of others
and omitting these from the output file. Useful with tilemaps to keep and omitting these from the output file. Useful with tilemaps to keep
track of the duplicated tiles.</dd> track of the duplicated tiles.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt> <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a>,
<code class="Fl">--version</code></dt>
<dd>Print the version of the program and exit.</dd> <dd>Print the version of the program and exit.</dd>
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt> <dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a>,
<code class="Fl">--verbose</code></dt>
<dd>Verbose. Print errors when the command line parameters and the parameters <dd>Verbose. Print errors when the command line parameters and the parameters
in the PNG file don't match.</dd> in the PNG file don't match.</dd>
<dt><a class="permalink" href="#x"><code class="Fl" id="x">-x</code></a> <dt><a class="permalink" href="#x"><code class="Fl" id="x">-x</code></a>
<var class="Ar">tiles</var>,
<code class="Fl">--trim-end</code>
<var class="Ar">tiles</var></dt> <var class="Ar">tiles</var></dt>
<dd>Trim the end of the output file by this many tiles.</dd> <dd>Trim the end of the output file by this many tiles.</dd>
</dl> </dl>
@@ -147,8 +182,8 @@ The following will take a PNG file with a bit depth of 1, 2, or 8, and output
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbgfx -T -u -o out.2bpp in.png</div> <div class="Bd Bd-indent">$ rgbgfx -T -u -o out.2bpp in.png</div>
<p class="Pp">The following creates a planar 2bpp file with only unique tiles <p class="Pp">The following creates a planar 2bpp file with only unique tiles
(accounting for tile mirroring) and its associated tilemap <span class="Pa">accounting for tile mirroring</span> and its associated
<span class="Pa">out.tilemap</span> and attrmap tilemap <span class="Pa">out.tilemap</span> and attrmap
<span class="Pa">out.attrmap</span>:</p> <span class="Pa">out.attrmap</span>:</p>
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbgfx -A -T -m -o out.2bpp in.png</div> <div class="Bd Bd-indent">$ rgbgfx -A -T -m -o out.2bpp in.png</div>
@@ -157,11 +192,16 @@ The following will take a PNG file with a bit depth of 1, 2, or 8, and output
<div class="Bd Bd-indent">$ rgbgfx in.png</div> <div class="Bd Bd-indent">$ rgbgfx in.png</div>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
Please report bugs on
<a class="Lk" href="https://github.com/rednex/rgbds/issues">GitHub</a>.
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbds(7)</a>, <a class="Xr">rgbasm(1)</a>, <a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>,
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbfix(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
<a class="Xr">gbz80(7)</a> <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -172,8 +212,8 @@ The following will take a PNG file with a bit depth of 1, 2, or 8, and output
</div> </div>
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">January 26, 2018</td> <td class="foot-date">December 5, 2019</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@@ -3,13 +3,15 @@
<!-- This is an automatically generated file. Do not edit. <!-- This is an automatically generated file. Do not edit.
This file is part of RGBDS. This file is part of RGBDS.
Copyright (c) 2010-2018, Anthony J. Bentley and RGBDS contributors. Copyright (c) 2010-2019, Anthony J. Bentley and RGBDS contributors.
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBLINK(1)</title> <title>RGBLINK(1)</title>
</head> </head>
<body> <body>
@@ -24,81 +26,114 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgblink</code> &#x2014; <code class="Nm">rgblink</code> &#x2014;
<div class="Nd">Game Boy linker</div> <span class="Nd">Game Boy linker</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> <h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm"> <table class="Nm">
<tr> <tr>
<td><code class="Nm">rgblink</code></td> <td><code class="Nm">rgblink</code></td>
<td>[<code class="Fl">-dtVw</code>] [<code class="Fl">-m</code> <td>[<code class="Fl"><a href="#d">-d</a><a href="#t">t</a><a href="#V">V</a><a href="#v">v</a><a href="#w">w</a></code>] [<code class="Fl"><a href="#l">-l</a></code>
<var class="Ar">mapfile</var>] [<code class="Fl">-n</code> <var class="Ar">linker_script</var>] [<code class="Fl"><a href="#m">-m</a></code>
<var class="Ar">symfile</var>] [<code class="Fl">-O</code> <var class="Ar">map_file</var>] [<code class="Fl"><a href="#n">-n</a></code>
<var class="Ar">overlayfile</var>] [<code class="Fl">-o</code> <var class="Ar">sym_file</var>] [<code class="Fl"><a href="#O">-O</a></code>
<var class="Ar">outfile</var>] [<code class="Fl">-p</code> <var class="Ar">overlay_file</var>] [<code class="Fl"><a href="#o">-o</a></code>
<var class="Ar">pad_value</var>] [<code class="Fl">-s</code> <var class="Ar">out_file</var>] [<code class="Fl"><a href="#p">-p</a></code>
<var class="Ar">symbol</var>] [<code class="Fl">-l</code> <var class="Ar">pad_value</var>] [<code class="Fl"><a href="#s">-s</a></code>
<var class="Ar">linkerscript</var>] <var class="Ar">file ...</var></td> <var class="Ar">symbol</var>] <var class="Ar">file ...</var></td>
</tr> </tr>
</table> </table>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <code class="Nm">rgblink</code> program links objects created by The <code class="Nm">rgblink</code> program links RGB object files, typically
<a class="Xr">rgbasm(1)</a> into a single Game Boy ROM file. created by <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, into a single Game Boy ROM file. The
<p class="Pp">By default, ROM0 sections created by the assembler are placed in format is documented in <a class="Xr" href="rgbds.5.html">rgbds(5)</a>.
the 16KiB bank 0, and ROMX sections are placed in any bank except bank 0. If <p class="Pp">ROM0 sections are placed in the first 16 KiB of the output ROM,
your ROM will only be 32KiB, you can use the <code class="Fl">-t</code> and ROMX sections are placed in any 16 KiB &#x201C;bank&#x201D; except the
option to override this.</p> first. If your ROM will only be 32 KiB, you can use the
<code class="Fl">-t</code> option to change this.</p>
<p class="Pp">Similarly, WRAM0 sections are placed in the first 4 KiB of WRAM <p class="Pp">Similarly, WRAM0 sections are placed in the first 4 KiB of WRAM
bank 0 and WRAMX sections are placed in any bank except bank 0. If your ROM (&#x201C;bank 0&#x201D;), and WRAMX sections are placed in any bank of the
doesn't use banked WRAM you can use option <code class="Fl">-w</code> option last 4 KiB. If your ROM doesn't use banked WRAM, you can use the
to override this.</p> <code class="Fl">-w</code> option to change this.</p>
<p class="Pp">Also, if your ROM is designed for DMG, you can make sure that you <p class="Pp">Also, if your ROM is designed for a monochrome Game Boy, you can
don't use any prohibited section by using the option make sure that you don't use any incompatible section by using the
<code class="Fl">-d</code>, which implies <code class="Fl">-w</code> but <code class="Fl">-d</code> option, which implies <code class="Fl">-w</code>
also prohibits the use of VRAM bank 1.</p> but also prohibits the use of banked VRAM.</p>
<p class="Pp">The arguments are as follows:</p> <p class="Pp">Note that options can be abbreviated as long as the abbreviation
is unambiguous: <code class="Fl">--verb</code> is
<code class="Fl">--verbose</code>, but
<code class="Fl">--ver</code> is invalid because it
could also be <code class="Fl">--version</code>. The
arguments are as follows:</p>
<dl class="Bl-tag"> <dl class="Bl-tag">
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a> <dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>,
<var class="Ar">mapfile</var></dt> <code class="Fl">--dmg</code></dt>
<dd>Write a mapfile to the given filename.</dd>
<dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
<var class="Ar">symfile</var></dt>
<dd>Write a symbol file to the given filename.</dd>
<dt><a class="permalink" href="#O"><code class="Fl" id="O">-O</code></a>
<var class="Ar">overlayfile</var></dt>
<dd>The ROM image to overlay sections over. When an overlay ROM is provided,
all sections must be fixed. This may be used to patch an existing
binary.</dd>
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
<var class="Ar">outfile</var></dt>
<dd>Write ROM image to the given filename.</dd>
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
<var class="Ar">pad_value</var></dt>
<dd>When padding an image, pad with this value. The default is 0x00.</dd>
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>
<var class="Ar">symbol</var></dt>
<dd>???</dd>
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
<dd>Expand the WRAM0 section size from 4KiB to the full 8KiB assigned to WRAM
and prohibit the use of WRAMX sections.</dd>
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a></dt>
<dd>Enable DMG mode. Prohibit the use of sections that doesn't exist on a DMG, <dd>Enable DMG mode. Prohibit the use of sections that doesn't exist on a DMG,
such as WRAMX and VRAM bank 1. This option automatically enables such as WRAMX and VRAM bank 1. This option automatically enables
<code class="Fl">-w</code>.</dd> <code class="Fl">-w</code>.</dd>
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a></dt>
<dd>Expand the ROM0 section size from 16KiB to the full 32KiB assigned to ROM
and prohibit the use of ROMX sections. Useful for ROMs that fit in 32
KiB.</dd>
<dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a> <dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a>
<var class="Ar">linkerscript</var></dt> <var class="Ar">linker_script,</var>
<code class="Fl">--linkerscript</code>
<var class="Ar">linker_script</var></dt>
<dd>Specify a linker script file that tells the linker how sections must be <dd>Specify a linker script file that tells the linker how sections must be
placed in the ROM. This file has priority over the attributes assigned in placed in the ROM. The attributes assigned in the linker script must be
the source code, but they have to be consistent. See consistent with any assigned in the code. See <a class="Xr" href="rgblink.5.html">rgblink(5)</a>
<a class="Xr">rgblink(5)</a> for more information about its format.</dd> for more information about the linker script format.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt> <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
<var class="Ar">map_file</var>,
<code class="Fl">--map</code>
<var class="Ar">map_file</var></dt>
<dd>Write a map file to the given filename, listing how sections and symbols
were assigned.</dd>
<dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
<var class="Ar">sym_file</var>,
<code class="Fl">--sym</code>
<var class="Ar">sym_file</var></dt>
<dd>Write a symbol file to the given filename, listing the address of all
exported symbols. Several external programs can use this information, for
example to help debugging ROMs.</dd>
<dt><a class="permalink" href="#O"><code class="Fl" id="O">-O</code></a>
<var class="Ar">overlay_file</var>,
<code class="Fl">--overlay</code>
<var class="Ar">overlay_file</var></dt>
<dd>If specified, sections will be overlaid &quot;on top&quot; of the provided
ROM image. In that case, all sections must be fixed. This may be used to
patch an existing binary.</dd>
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
<var class="Ar">out_file</var>,
<code class="Fl">--output</code>
<var class="Ar">out_file</var></dt>
<dd>Write the ROM image to the given file.</dd>
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
<var class="Ar">pad_value</var>,
<code class="Fl">--pad</code>
<var class="Ar">pad_value</var></dt>
<dd>When inserting padding between sections, pad with this value. Has no
effect if <code class="Fl">-O</code> is specified. The default is 0.</dd>
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>
<var class="Ar">symbol</var>,
<code class="Fl">--smart</code>
<var class="Ar">symbol</var></dt>
<dd>This option is ignored. It was supposed to perform smart linking but fell
into disrepair, and so has been removed. It will be reimplemented at some
point.</dd>
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>,
<code class="Fl">--tiny</code></dt>
<dd>Expand the ROM0 section size from 16 KiB to the full 32 KiB assigned to
ROM and prohibit the use of ROMX sections. Useful for ROMs that fit in 32
KiB.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a>,
<code class="Fl">--version</code></dt>
<dd>Print the version of the program and exit.</dd> <dd>Print the version of the program and exit.</dd>
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a>,
<code class="Fl">--verbose</code></dt>
<dd>Verbose: enable printing more information to standard error.</dd>
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a>,
<code class="Fl">--wramx</code></dt>
<dd>Expand the WRAM0 section size from 4 KiB to the full 8 KiB assigned to
WRAM and prohibit the use of WRAMX sections.</dd>
</dl> </dl>
</section> </section>
<section class="Sh"> <section class="Sh">
@@ -107,18 +142,28 @@ All you need for a basic ROM is an object file, which can be made into a ROM
image like so: image like so:
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgblink -o bar.gb foo.o</div> <div class="Bd Bd-indent">$ rgblink -o bar.gb foo.o</div>
<p class="Pp">The resulting bar.gb will not have correct checksums (unless you <p class="Pp">The resulting <var class="Ar">bar.gb</var> will not have correct
put them in the assembly source). You should use <a class="Xr">rgbfix(1)</a> checksums (unless you put them in the assembly source). You should use
to fix these so that the program will actually run in a Game Boy:</p> <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a> to fix these so that the program will actually
run in a Game Boy:</p>
<p class="Pp"></p> <p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -v bar.gb</div> <div class="Bd Bd-indent"><code class="Li">$ rgbfix -v bar.gb</code></div>
<p class="Pp">Here is a more complete example:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent"><code class="Li">$ rgblink -o bin/game.gb -n
bin/game.sym -p 0xFF obj/title.o obj/engine.o</code></div>
</section>
<section class="Sh">
<h1 class="Sh" id="BUGS"><a class="permalink" href="#BUGS">BUGS</a></h1>
Please report bugs on
<a class="Lk" href="https://github.com/rednex/rgbds/issues">GitHub</a>.
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(5)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.5.html">rgblink(5)</a>,
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
<a class="Xr">rgbds(7)</a> <a class="Xr" href="rgbds.7.html">rgbds(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -130,8 +175,8 @@ All you need for a basic ROM is an object file, which can be made into a ROM
</div> </div>
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">January 26, 2018</td> <td class="foot-date">November 26, 2019</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>

View File

@@ -8,8 +8,10 @@
SPDX-License-Identifier: MIT SPDX-License-Identifier: MIT
--> -->
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8"/> <meta charset="utf-8"/>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/> <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<link rel="stylesheet" href="rgbds.css" type="text/css" media="all"/>
<title>RGBLINK(5)</title> <title>RGBLINK(5)</title>
</head> </head>
<body> <body>
@@ -24,17 +26,15 @@
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> <h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgblink</code> &#x2014; <code class="Nm">rgblink</code> &#x2014;
<div class="Nd">linkerscript file format</div> <span class="Nd">linker script file format</span>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> <h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The linker script is an external file that allows the user to specify the order The linker script is an external file that allows the user to specify the order
of sections without the need for doing so before assembling each object file. of sections at link time and in a centralized manner.
<p class="Pp">The placement of sections specified in the linkerscript is done <p class="Pp">A linker script consists on a series of banks followed by a list
before the sections whose placement is defined in the source code.</p> of sections and, optionally, commands. They can be lowercase or uppercase,
<p class="Pp">A linkerscript consists on a series of banks followed by a list of it is ignored. Any line can contain a comment starting with
sections and, optionally, commands. They can be lowercase or uppercase, it
is ignored. Any line can contain a comment starting with
&#x2018;<code class="Li">;</code>&#x2019; that ends at the end of the &#x2018;<code class="Li">;</code>&#x2019; that ends at the end of the
line:</p> line:</p>
<div class="Bd Pp Bd-indent"> <div class="Bd Pp Bd-indent">
@@ -50,42 +50,48 @@ WRAMX 2
</div> </div>
<p class="Pp">Numbers can be in decimal or hexadecimal format (the prefix is <p class="Pp">Numbers can be in decimal or hexadecimal format (the prefix is
&#x2018;<code class="Li">$</code>&#x2019;). It is an error if any section &#x2018;<code class="Li">$</code>&#x2019;). It is an error if any section
name or command are found before setting a bank.</p> name or command is found before setting a bank.</p>
<p class="Pp">Files can be included by using the <var class="Ar">INCLUDE</var> <p class="Pp">Files can be included by using the <code class="Ic">INCLUDE</code>
keyword followed by a string with the path of the file that has to be keyword, followed by a string with the path of the file that has to be
included.</p> included.</p>
<p class="Pp">The possible bank types are: <b class="Sy">ROM0</b>, <p class="Pp">The possible bank types are: <code class="Cm">ROM0</code>,
<b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>, <b class="Sy">WRAM0</b>, <code class="Cm">ROMX</code>, <code class="Cm">VRAM</code>,
<b class="Sy">WRAMX</b>, <b class="Sy">OAM</b> and <b class="Sy">HRAM</b>. <code class="Cm">SRAM</code>, <code class="Cm">WRAM0</code>,
Types <b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>, <code class="Cm">WRAMX</code>, <code class="Cm">OAM</code> and
<b class="Sy">WRAMX</b> and <b class="Sy">SRAM</b> are banked, which means <code class="Cm">HRAM</code>. Unless there is a single bank, which can occur
that it is needed to specify a bank after the type.</p> with types <code class="Cm">ROMX</code>, <code class="Cm">VRAM</code>,
<code class="Cm">SRAM</code> and <code class="Cm">WRAMX</code>, it is needed
to specify a bank number after the type.</p>
<p class="Pp">When a new bank statement is found, sections found after it will <p class="Pp">When a new bank statement is found, sections found after it will
be placed right from the beginning of that bank. If the linker script be placed right from the beginning of that bank. If the linker script
switches to a different bank and then it comes back to the previous one it switches to a different bank and then comes back to a previous one, it will
will continue from the last address that was used.</p> continue from the last address that was used.</p>
<p class="Pp">The only two commands are <var class="Ar">ORG</var> and <p class="Pp">The only two commands are <code class="Ic">ORG</code> and
<var class="Ar">ALIGN</var>:</p> <code class="Ic">ALIGN</code>:</p>
<ul class="Bl-bullet"> <ul class="Bl-bullet">
<li><var class="Ar">ORG</var> sets the address in which new sections will be <li><a class="permalink" href="#ORG"><code class="Ic" id="ORG">ORG</code></a>
placed. It can not be lower than the current address.</li> sets the address in which new sections will be placed. It can not be lower
<li><var class="Ar">ALIGN</var> will increase the address until it is aligned than the current address.</li>
to the specified boundary (it tries to set to 0 the number of bits <li><a class="permalink" href="#ALIGN"><code class="Ic" id="ALIGN">ALIGN</code></a>
specified after the command: <b class="Sy">ALIGN 8</b> will align to will increase the address until it is aligned to the specified boundary
$100).</li> (it tries to set to 0 the number of bits specified after the command:
&#x2018;<code class="Li">ALIGN 8</code>&#x2019; will align to $100).</li>
</ul> </ul>
<p class="Pp">Note: The bank, alignment, address and type of sections can be <p class="Pp"><b class="Sy">Note:</b> The bank, alignment, address and type of
specified both in the source code and in the linkerscript. For a section to sections can be specified both in the source code and in the linker script.
be able to be placed with the linkerscript the bank must be left unassigned For a section to be able to be placed with the linker script, the bank,
in the source code or be the same as the one specified in the linkerscript. address and alignment must be left unassigned in the source code or be
The address and alignment musn't be set.</p> compatible with what is specified in the linker script. For example,
&#x2018;<code class="Li">ALIGN[8]</code>&#x2019; in the source code is
compatible with &#x2018;<code class="Li">ORG $F00</code>&#x2019; in the
linker script.</p>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE <h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1> ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>,
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
<a class="Xr">rgbds(7)</a> <a class="Xr" href="rgbds.7.html">rgbds(7)</a>
</section> </section>
<section class="Sh"> <section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> <h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
@@ -97,8 +103,8 @@ WRAMX 2
</div> </div>
<table class="foot"> <table class="foot">
<tr> <tr>
<td class="foot-date">January 27, 2018</td> <td class="foot-date">November 26, 2019</td>
<td class="foot-os">RGBDS Manual</td> <td class="foot-os">General</td>
</tr> </tr>
</table> </table>
</body> </body>