mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Regenerate man page HTML renders
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,107 +26,224 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgbasm</code> —
|
||||
<div class="Nd">Game Boy assembler</div>
|
||||
<span class="Nd">Game Boy assembler</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
||||
<table class="Nm">
|
||||
<tr>
|
||||
<td><code class="Nm">rgbasm</code></td>
|
||||
<td>[<code class="Fl">-EhLVvw</code>] [<code class="Fl">-b</code>
|
||||
<var class="Ar">chars</var>] [<code class="Fl">-D</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"><a href="#D">-D</a></code>
|
||||
<var class="Ar">name</var>[=<var class="Ar">value</var>]]
|
||||
[<code class="Fl">-g</code> <var class="Ar">chars</var>]
|
||||
[<code class="Fl">-i</code> <var class="Ar">path</var>]
|
||||
[<code class="Fl">-M</code> <var class="Ar">dependfile</var>]
|
||||
[<code class="Fl">-o</code> <var class="Ar">outfile</var>]
|
||||
[<code class="Fl">-p</code> <var class="Ar">pad_value</var>]
|
||||
[<code class="Fl">-r</code> <var class="Ar">recursion_depth</var>]
|
||||
<var class="Ar">file</var></td>
|
||||
[<code class="Fl"><a href="#g">-g</a></code> <var class="Ar">chars</var>]
|
||||
[<code class="Fl"><a href="#i">-i</a></code> <var class="Ar">path</var>]
|
||||
[<code class="Fl"><a href="#M">-M</a></code> <var class="Ar">depend_file</var>]
|
||||
[<code class="Fl"><a href="#o">-o</a></code> <var class="Ar">out_file</var>]
|
||||
[<code class="Fl"><a href="#p">-p</a></code> <var class="Ar">pad_value</var>]
|
||||
[<code class="Fl"><a href="#r">-r</a></code> <var class="Ar">recursion_depth</var>]
|
||||
[<code class="Fl"><a href="#W">-W</a></code> <var class="Ar">warning</var>]
|
||||
<var class="Ar">file ...</var></td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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,
|
||||
or <code class="Cm">-</code> denoting <code class="Cm">stdin</code>. Its
|
||||
arguments are as follows:
|
||||
or <code class="Cm">-</code> denoting <code class="Cm">stdin</code>.
|
||||
<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">
|
||||
<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>
|
||||
<dd>Change the two characters used for binary constants. The defaults are
|
||||
01.</dd>
|
||||
<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>
|
||||
<dd>Add string symbol to the compiled source code. This is equivalent to
|
||||
<var class="Ar">name</var> <code class="Cm">EQUS</code>
|
||||
“<var class="Ar">value</var>” in code. If a value is not
|
||||
specified, a value of 1 is given.</dd>
|
||||
<dt><a class="permalink" href="#E"><code class="Fl" id="E">-E</code></a></dt>
|
||||
<dd>Add a string symbol to the compiled source code. This is equivalent to
|
||||
‘<code class="Li"><var class="Ar">name</var> <code class="Ic">EQUS
|
||||
"</code><var class="Ar">value</var>"</code>’ in code, or
|
||||
‘<code class="Li"><var class="Ar">name</var> <code class="Ic">EQUS
|
||||
"1"</code></code>’ 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>
|
||||
<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>
|
||||
<dd>Change the four characters used for binary constants. The defaults are
|
||||
0123.</dd>
|
||||
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt>
|
||||
<dd>By default, <code class="Nm">rgbasm</code> inserts a ‘nop’
|
||||
instruction immediately after any ‘halt’ instruction. The
|
||||
<code class="Fl">-h</code> option disables this behavior.</dd>
|
||||
<dd>Change the four characters used for gfx constants. The defaults are
|
||||
0123.</dd>
|
||||
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a>,
|
||||
<code class="Fl">--halt-without-nop</code></dt>
|
||||
<dd>By default, <code class="Nm">rgbasm</code> inserts a
|
||||
<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>
|
||||
<var class="Ar">path</var>,
|
||||
<code class="Fl">--include</code>
|
||||
<var class="Ar">path</var></dt>
|
||||
<dd>Add an include path.</dd>
|
||||
<dt><a class="permalink" href="#L"><code class="Fl" id="L">-L</code></a></dt>
|
||||
<dd>Disable the optimization that turns loads of the form <b class="Sy">LD
|
||||
[$FF00+n8],A</b> into the opcode <b class="Sy">LDH [$FF00+n8],A</b> in
|
||||
order to have full control of the result in the final ROM.</dd>
|
||||
<dt><a class="permalink" href="#L"><code class="Fl" id="L">-L</code></a>,
|
||||
<code class="Fl">--preserve-ld</code></dt>
|
||||
<dd>Disable the optimization that turns loads of the form <code class="Ic">LD
|
||||
[$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>
|
||||
<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
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<var class="Ar">recursion_depth</var>,
|
||||
<code class="Fl">--recursion-depth</code>
|
||||
<var class="Ar">recursion_depth</var></dt>
|
||||
<dd>Specifies the recursion depth at which RGBASM will assume being in an
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<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 “meta” 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 “no-” 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 “Aborting the assembly process” 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
|
||||
“Aborting the assembly process” in
|
||||
<a class="Xr" href="rgbasm.5.html">rgbasm(5)</a> for <code class="Ic">WARN</code>).</dd>
|
||||
</dl>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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:
|
||||
<div class="Bd Pp Bd-indent">
|
||||
<pre>
|
||||
$ rgbasm -o bar.o foo.asm
|
||||
</pre>
|
||||
</div>
|
||||
You can assemble a source file in two ways.
|
||||
<p class="Pp">Straightforward way:</p>
|
||||
<div class="Bd Bd-indent"><code class="Li">$ rgbasm -o bar.o
|
||||
foo.asm</code></div>
|
||||
<p class="Pp">Pipes way:</p>
|
||||
<div class="Bd Pp Bd-indent">
|
||||
<pre>
|
||||
$ cat foo.asm | rgbasm -o bar.o -
|
||||
$ rgbasm -o bar.o - < foo.asm
|
||||
</pre>
|
||||
</div>
|
||||
<p class="Pp">The resulting object file is not yet a usable ROM image —
|
||||
it must first be run through <a class="Xr">rgblink(1)</a> and
|
||||
<a class="Xr">rgbfix(1)</a>.</p>
|
||||
<div class="Bd Bd-indent"><code class="Li">$ cat foo.asm | rgbasm -o bar.o
|
||||
-</code></div>
|
||||
<div class="Bd Bd-indent"><code class="Li">$ rgbasm -o bar.o - <
|
||||
foo.asm</code></div>
|
||||
<p class="Pp">The resulting object file is not yet a usable ROM image—it
|
||||
must first be run through <a class="Xr" href="rgblink.1.html">rgblink(1)</a> and then
|
||||
<a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>.</p>
|
||||
</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 class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(5)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a>
|
||||
<a class="Xr" href="rgbasm.5.html">rgbasm(5)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
|
||||
<a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
|
||||
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||
@@ -137,7 +256,7 @@ $ rgbasm -o bar.o - < foo.asm
|
||||
<table class="foot">
|
||||
<tr>
|
||||
<td class="foot-date">July 8, 2019</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
2351
docs/rgbasm.5.html
2351
docs/rgbasm.5.html
File diff suppressed because it is too large
Load Diff
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,29 +26,30 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgbds</code> —
|
||||
<div class="Nd">object file format documentation</div>
|
||||
<span class="Nd">object file format documentation</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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>
|
||||
and <a class="Xr">rgblink(1)</a>. Please, note that the specifications may
|
||||
change. This toolchain is in development and new features may require adding
|
||||
more information to the current format, or modifying some fields, which would
|
||||
break compatibility with older versions.
|
||||
This is the description of the object files used by <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>
|
||||
and <a class="Xr" href="rgblink.1.html">rgblink(1)</a>. <i class="Em">Please note that the
|
||||
specifications may change.</i> This toolchain is in development and new
|
||||
features may require adding more information to the current format, or
|
||||
modifying some fields, which would break compatibility with older versions.
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="FILE_STRUCTURE"><a class="permalink" href="#FILE_STRUCTURE">FILE
|
||||
STRUCTURE</a></h1>
|
||||
The following types are used:
|
||||
<p class="Pp"><var class="Ar">LONG</var> is a 32‐bit integer stored in
|
||||
little‐endian format (Intel). <var class="Ar">BYTE</var> is an
|
||||
8‐bit integer. <var class="Ar">STRING</var> is a 0‐terminated
|
||||
string of <var class="Ar">BYTE</var>.</p>
|
||||
little‐endian format. <var class="Ar">BYTE</var> is an 8‐bit
|
||||
integer. <var class="Ar">STRING</var> is a 0‐terminated string of
|
||||
<var class="Ar">BYTE</var>.</p>
|
||||
<div class="Bd Pp">
|
||||
<pre>
|
||||
; Header
|
||||
|
||||
BYTE ID[4] ; "RGB6"
|
||||
BYTE ID[4] ; "RGB9"
|
||||
LONG RevisionNumber ; The format's revision number this file uses
|
||||
LONG NumberOfSymbols ; The number of symbols 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.
|
||||
; 1 = IMPORT this symbol from elsewhere
|
||||
; 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 & 0x7F) != 1 ; If symbol is defined in this object file.
|
||||
|
||||
STRING FileName ; File where the symbol is defined.
|
||||
|
||||
@@ -102,8 +107,8 @@ REPT NumberOfSections
|
||||
; decide (floating bank). This field is only valid for ROMX,
|
||||
; VRAM, WRAMX and SRAM sections.
|
||||
|
||||
LONG Align ; Alignment of this section (expressed as number of low bits
|
||||
; to leave as 0). -1 if not defined.
|
||||
LONG Align ; Alignment of this section, expressed as 1 << align. 1 if
|
||||
; not specified.
|
||||
|
||||
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
|
||||
; messages).
|
||||
|
||||
LONG Line ; The line of the source file.
|
||||
|
||||
LONG Offset ; Offset into the section where patch should
|
||||
; be applied (in bytes).
|
||||
|
||||
@@ -137,6 +140,34 @@ REPT NumberOfSections
|
||||
|
||||
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
|
||||
</pre>
|
||||
</div>
|
||||
@@ -145,15 +176,15 @@ ENDR
|
||||
DATA</a></h2>
|
||||
Expressions in the object file are stored as RPN. This is an expression of the
|
||||
form “2 5 +”. This will first push the value “2”
|
||||
to the stack. Then “5”. The “+” operator pops two
|
||||
to the stack, then “5”. The “+” operator pops two
|
||||
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,
|
||||
RPN expressions are stored as BYTEs with some bytes being special prefixes for
|
||||
integers and symbols.
|
||||
RPN expressions are stored as <var class="Ar">BYTE</var>s with some bytes
|
||||
being special prefixes for integers and symbols.
|
||||
<table class="Bl-column Bd-indent">
|
||||
<tr>
|
||||
<td><b class="Sy">Value</b></td>
|
||||
<td><b class="Sy">Meaning</b></td>
|
||||
<th>Value</th>
|
||||
<th>Meaning</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
</tr>
|
||||
<tr>
|
||||
<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
|
||||
BANK()</code></a>.</td>
|
||||
BANK()</code></a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>
|
||||
Check if the value is in HRAM, AND it with 0xFF.</td>
|
||||
<td><a class="permalink" href="#HRAMCheck"><code class="Li" id="HRAMCheck">HRAMCheck</code></a>.
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
</table>
|
||||
</section>
|
||||
@@ -293,8 +329,8 @@ Expressions in the object file are stored as RPN. This is an expression of the
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a>
|
||||
<a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>,
|
||||
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="gbz80.7.html">gbz80(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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">
|
||||
<tr>
|
||||
<td class="foot-date">January 26, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,7 +26,7 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgbds</code> —
|
||||
<div class="Nd">Rednex Game Boy Development System</div>
|
||||
<span class="Nd">Rednex Game Boy Development System</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||
<a class="Xr">gbz80(7)</a>
|
||||
<a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgbfix.1.html">rgbfix(1)</a>,
|
||||
<a class="Xr" href="rgblink.1.html">rgblink(1)</a>, <a class="Xr" href="rgbds.5.html">rgbds(5)</a>,
|
||||
<a class="Xr" href="gbz80.7.html">gbz80(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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">
|
||||
<tr>
|
||||
<td class="foot-date">March 7, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,22 +26,23 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgbfix</code> —
|
||||
<div class="Nd">Game Boy checksum fixer</div>
|
||||
<span class="Nd">Game Boy header utility and checksum fixer</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
||||
<table class="Nm">
|
||||
<tr>
|
||||
<td><code class="Nm">rgbfix</code></td>
|
||||
<td>[<code class="Fl">-CcjsVv</code>] [<code class="Fl">-f</code>
|
||||
<var class="Ar">fix_spec</var>] [<code class="Fl">-i</code>
|
||||
<var class="Ar">game_id</var>] [<code class="Fl">-k</code>
|
||||
<var class="Ar">licensee_str</var>] [<code class="Fl">-l</code>
|
||||
<var class="Ar">licensee_id</var>] [<code class="Fl">-m</code>
|
||||
<var class="Ar">mbc_type</var>] [<code class="Fl">-n</code>
|
||||
<var class="Ar">rom_version</var>] [<code class="Fl">-p</code>
|
||||
<var class="Ar">pad_value</var>] [<code class="Fl">-r</code>
|
||||
<var class="Ar">ram_size</var>] [<code class="Fl">-t</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> |
|
||||
<code class="Fl"><a href="#c">-c</a></code>] [<code class="Fl"><a href="#f">-f</a></code>
|
||||
<var class="Ar">fix_spec</var>] [<code class="Fl"><a href="#i">-i</a></code>
|
||||
<var class="Ar">game_id</var>] [<code class="Fl"><a href="#k">-k</a></code>
|
||||
<var class="Ar">licensee_str</var>] [<code class="Fl"><a href="#l">-l</a></code>
|
||||
<var class="Ar">licensee_id</var>] [<code class="Fl"><a href="#m">-m</a></code>
|
||||
<var class="Ar">mbc_type</var>] [<code class="Fl"><a href="#n">-n</a></code>
|
||||
<var class="Ar">rom_version</var>] [<code class="Fl"><a href="#p">-p</a></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>
|
||||
</tr>
|
||||
</table>
|
||||
@@ -47,19 +50,28 @@
|
||||
<section class="Sh">
|
||||
<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
|
||||
images. It also performs other filetype operations, such as truncation. The
|
||||
arguments are as follows:
|
||||
images. It also performs other correctness operations, such as padding.
|
||||
<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">
|
||||
<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–only flag: <span class="Ad">0x143</span> =
|
||||
0xC0. If both this and the <code class="Fl">-c</code> flag are set, this
|
||||
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–compatible flag:
|
||||
<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
|
||||
precedence.</dd>
|
||||
<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>
|
||||
<dd>Fix certain header values that the Game Boy checks for correctness.
|
||||
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>
|
||||
</dd>
|
||||
<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>
|
||||
<dd>Set the game ID string
|
||||
(<span class="Ad">0x13F</span>–<span class="Ad">0x142</span>) to a
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<dd>Set the new licensee string
|
||||
(<span class="Ad">0x144</span>–<span class="Ad">0x145</span>) to a
|
||||
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>
|
||||
<var class="Ar">licensee_id</var>,
|
||||
<code class="Fl">--old-licensee</code>
|
||||
<var class="Ar">licensee_id</var></dt>
|
||||
<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
|
||||
new software.</dd>
|
||||
<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>
|
||||
<dd>Set the MBC type, <span class="Ad">0x147</span>, to a given value from 0
|
||||
to 0xFF.</dd>
|
||||
<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>
|
||||
<dd>Set the ROM version, <span class="Ad">0x14C</span>, to a given value from
|
||||
0 to 0xFF.</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-value</code>
|
||||
<var class="Ar">pad_value</var></dt>
|
||||
<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 32KiB,
|
||||
64KiB, 128KiB, ..., 8192KiB and give a warning thereafter. The cartridge
|
||||
size byte (<span class="Ad">0x148</span>) will be changed to reflect this
|
||||
new size.</dd>
|
||||
<code class="Nm">rgbfix</code> will automatically pick a size from 32 KiB,
|
||||
64 KiB, 128 KiB, ..., 8192 KiB. The cartridge size byte
|
||||
(<span class="Ad">0x148</span>) will be changed to reflect this new
|
||||
size.</dd>
|
||||
<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>
|
||||
<dd>Set the RAM size, <span class="Ad">0x149</span>, to a given value from 0
|
||||
to 0xFF.</dd>
|
||||
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a></dt>
|
||||
<dd>Set the SGB flag: <span class="Ad">0x146</span> = 3.</dd>
|
||||
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>,
|
||||
<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>
|
||||
<var class="Ar">title</var>,
|
||||
<code class="Fl">--title</code>
|
||||
<var class="Ar">title</var></dt>
|
||||
<dd>Set the title string
|
||||
(<span class="Ad">0x134</span>–<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
|
||||
and the game ID are set, the game ID will overwrite the overlapping
|
||||
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>
|
||||
<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>
|
||||
</dl>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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
|
||||
for a workable image are checksums, the Nintendo logo, and (if needed) the
|
||||
CGB/SGB flags. It is a good idea to pad the image to a valid size as well
|
||||
(“valid” meaning a multiple of 32KiB).
|
||||
<p class="Pp">The following will make a plain, no-color Game Boy game without
|
||||
for a workable program are the header checksum, the Nintendo logo, and (if
|
||||
needed) the CGB/SGB flags. It is a good idea to pad the image to a valid size
|
||||
as well (“valid” meaning a power of 2, times 32 KiB).
|
||||
<p class="Pp">The following will make a plain, non-color Game Boy game without
|
||||
checking for a valid size:</p>
|
||||
<p class="Pp"></p>
|
||||
<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
|
||||
title of “foobar”, and pad it to a multiple of 32KiB. (The
|
||||
Game Boy itself does not use the title, but some emulators or ROM managers
|
||||
might.)</p>
|
||||
title of “foobar”, and pad it to a valid size. (The Game Boy
|
||||
itself does not use the title, but some emulators or ROM managers do.)</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
|
||||
the game “Survival Kids”:</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>
|
||||
</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 class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||
<a class="Xr">rgbds(7)</a>
|
||||
<a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.1.html">rgblink(1)</a>,
|
||||
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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>
|
||||
<table class="foot">
|
||||
<tr>
|
||||
<td class="foot-date">March 11, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-date">December 5, 2019</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,20 +26,23 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgbgfx</code> —
|
||||
<div class="Nd">Game Boy graphics converter</div>
|
||||
<span class="Nd">Game Boy graphics converter</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
||||
<table class="Nm">
|
||||
<tr>
|
||||
<td><code class="Nm">rgbgfx</code></td>
|
||||
<td>[<code class="Fl">-ADfFhmPTuVv</code>] [<code class="Fl">-o</code>
|
||||
<var class="Ar">outfile</var>] [<code class="Fl">-a</code>
|
||||
<var class="Ar">attrmap</var>] [<code class="Fl">-d</code>
|
||||
<var class="Ar">depth</var>] [<code class="Fl">-p</code>
|
||||
<var class="Ar">palfile</var>] [<code class="Fl">-t</code>
|
||||
<var class="Ar">tilemap</var>] [<code class="Fl">-x</code>
|
||||
<var class="Ar">tiles</var>] <var class="Ar">file</var></td>
|
||||
<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> |
|
||||
<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"><a href="#A">-A</a></code>]
|
||||
[<code class="Fl"><a href="#d">-d</a></code> <var class="Ar">depth</var>]
|
||||
[<code class="Fl"><a href="#o">-o</a></code> <var class="Ar">out_file</var>]
|
||||
[<code class="Fl"><a href="#p">-p</a></code> <var class="Ar">pal_file</var> |
|
||||
<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>
|
||||
</table>
|
||||
</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
|
||||
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
|
||||
fourth colors - and the first and third colors get set to default white
|
||||
and dark gray. If the image has multiple shades that map to the same
|
||||
index, the palette is instead determined as if the image had color.</li>
|
||||
fourth colors, and the first and third colors get set to default white and
|
||||
dark gray. If the image has multiple shades that map to the same index,
|
||||
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
|
||||
sorted from lightest to darkest.</li>
|
||||
</ul>
|
||||
@@ -65,73 +70,103 @@ The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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">
|
||||
<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>
|
||||
<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
|
||||
representing the dimensions that the associated tile in the output file
|
||||
should be mirrored. Useful in combination with <code class="Fl">-m</code>
|
||||
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
|
||||
made by taking the input filename, removing the file extension, and
|
||||
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>
|
||||
<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>
|
||||
<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>
|
||||
<var class="Ar">depth</var>,
|
||||
<code class="Fl">--depth</code>
|
||||
<var class="Ar">depth</var></dt>
|
||||
<dd>The bit depth of the output image (either 1 or 2). By default, the bit
|
||||
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>
|
||||
<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
|
||||
and omitting these from the output file. Useful with tilemaps and attrmaps
|
||||
together to keep track of the duplicated tiles and the dimension mirrored.
|
||||
Tiles are checked for horizontal, vertical, and horizontal-vertical
|
||||
mirroring. Implies <code class="Fl">-u</code>.</dd>
|
||||
<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>
|
||||
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
||||
<var class="Ar">palfile</var></dt>
|
||||
<dd>Output the image's palette in standard GBC palette format - bytes (8 bytes
|
||||
<var class="Ar">pal_file</var>,
|
||||
<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
|
||||
RGB15 values in little-endian byte order. If the palette contains too few
|
||||
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
|
||||
made by taking the input PNG file's filename, removing the file extension,
|
||||
and appending <span class="Pa">.pal</span>.</dd>
|
||||
<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>
|
||||
<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
|
||||
file. Useful in combination with <code class="Fl">-u</code> or
|
||||
<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
|
||||
made by taking the input filename, removing the file extension, and
|
||||
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
|
||||
and omitting these from the output file. Useful with tilemaps to keep
|
||||
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>
|
||||
<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
|
||||
in the PNG file don't match.</dd>
|
||||
<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>
|
||||
<dd>Trim the end of the output file by this many tiles.</dd>
|
||||
</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>
|
||||
<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
|
||||
(accounting for tile mirroring) and its associated tilemap
|
||||
<span class="Pa">out.tilemap</span> and attrmap
|
||||
<span class="Pa">accounting for tile mirroring</span> and its associated
|
||||
tilemap <span class="Pa">out.tilemap</span> and attrmap
|
||||
<span class="Pa">out.attrmap</span>:</p>
|
||||
<p class="Pp"></p>
|
||||
<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>
|
||||
</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 class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbds(7)</a>, <a class="Xr">rgbasm(1)</a>,
|
||||
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||
<a class="Xr">gbz80(7)</a>
|
||||
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>, <a class="Xr" href="rgbasm.1.html">rgbasm(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" href="gbz80.7.html">gbz80(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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>
|
||||
<table class="foot">
|
||||
<tr>
|
||||
<td class="foot-date">January 26, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-date">December 5, 2019</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
<!-- This is an automatically generated file. Do not edit.
|
||||
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
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,81 +26,114 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgblink</code> —
|
||||
<div class="Nd">Game Boy linker</div>
|
||||
<span class="Nd">Game Boy linker</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
||||
<table class="Nm">
|
||||
<tr>
|
||||
<td><code class="Nm">rgblink</code></td>
|
||||
<td>[<code class="Fl">-dtVw</code>] [<code class="Fl">-m</code>
|
||||
<var class="Ar">mapfile</var>] [<code class="Fl">-n</code>
|
||||
<var class="Ar">symfile</var>] [<code class="Fl">-O</code>
|
||||
<var class="Ar">overlayfile</var>] [<code class="Fl">-o</code>
|
||||
<var class="Ar">outfile</var>] [<code class="Fl">-p</code>
|
||||
<var class="Ar">pad_value</var>] [<code class="Fl">-s</code>
|
||||
<var class="Ar">symbol</var>] [<code class="Fl">-l</code>
|
||||
<var class="Ar">linkerscript</var>] <var class="Ar">file ...</var></td>
|
||||
<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">linker_script</var>] [<code class="Fl"><a href="#m">-m</a></code>
|
||||
<var class="Ar">map_file</var>] [<code class="Fl"><a href="#n">-n</a></code>
|
||||
<var class="Ar">sym_file</var>] [<code class="Fl"><a href="#O">-O</a></code>
|
||||
<var class="Ar">overlay_file</var>] [<code class="Fl"><a href="#o">-o</a></code>
|
||||
<var class="Ar">out_file</var>] [<code class="Fl"><a href="#p">-p</a></code>
|
||||
<var class="Ar">pad_value</var>] [<code class="Fl"><a href="#s">-s</a></code>
|
||||
<var class="Ar">symbol</var>] <var class="Ar">file ...</var></td>
|
||||
</tr>
|
||||
</table>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
||||
The <code class="Nm">rgblink</code> program links objects created by
|
||||
<a class="Xr">rgbasm(1)</a> into a single Game Boy ROM file.
|
||||
<p class="Pp">By default, ROM0 sections created by the assembler are placed in
|
||||
the 16KiB bank 0, and ROMX sections are placed in any bank except bank 0. If
|
||||
your ROM will only be 32KiB, you can use the <code class="Fl">-t</code>
|
||||
option to override this.</p>
|
||||
<p class="Pp">Similarly, WRAM0 sections are placed in the first 4KiB of WRAM
|
||||
bank 0 and WRAMX sections are placed in any bank except bank 0. If your ROM
|
||||
doesn't use banked WRAM you can use option <code class="Fl">-w</code> option
|
||||
to override this.</p>
|
||||
<p class="Pp">Also, if your ROM is designed for DMG, you can make sure that you
|
||||
don't use any prohibited section by using the option
|
||||
<code class="Fl">-d</code>, which implies <code class="Fl">-w</code> but
|
||||
also prohibits the use of VRAM bank 1.</p>
|
||||
<p class="Pp">The arguments are as follows:</p>
|
||||
The <code class="Nm">rgblink</code> program links RGB object files, typically
|
||||
created by <a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, into a single Game Boy ROM file. The
|
||||
format is documented in <a class="Xr" href="rgbds.5.html">rgbds(5)</a>.
|
||||
<p class="Pp">ROM0 sections are placed in the first 16 KiB of the output ROM,
|
||||
and ROMX sections are placed in any 16 KiB “bank” except the
|
||||
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
|
||||
(“bank 0”), and WRAMX sections are placed in any bank of the
|
||||
last 4 KiB. If your ROM doesn't use banked WRAM, you can use the
|
||||
<code class="Fl">-w</code> option to change this.</p>
|
||||
<p class="Pp">Also, if your ROM is designed for a monochrome Game Boy, you can
|
||||
make sure that you don't use any incompatible section by using the
|
||||
<code class="Fl">-d</code> option, which implies <code class="Fl">-w</code>
|
||||
but also prohibits the use of banked VRAM.</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">
|
||||
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
|
||||
<var class="Ar">mapfile</var></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>
|
||||
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>,
|
||||
<code class="Fl">--dmg</code></dt>
|
||||
<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
|
||||
<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>
|
||||
<var class="Ar">linkerscript</var></dt>
|
||||
<dd>Specify a linkerscript file that tells the linker how sections must be
|
||||
placed in the ROM. This file has priority over the attributes assigned in
|
||||
the source code, but they have to be consistent. See
|
||||
<a class="Xr">rgblink(5)</a> for more information about its format.</dd>
|
||||
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></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
|
||||
placed in the ROM. The attributes assigned in the linker script must be
|
||||
consistent with any assigned in the code. See <a class="Xr" href="rgblink.5.html">rgblink(5)</a>
|
||||
for more information about the linker script format.</dd>
|
||||
<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 "on top" 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>
|
||||
<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>
|
||||
</section>
|
||||
<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:
|
||||
<p class="Pp"></p>
|
||||
<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
|
||||
put them in the assembly source). You should use <a class="Xr">rgbfix(1)</a>
|
||||
to fix these so that the program will actually run in a Game Boy:</p>
|
||||
<p class="Pp">The resulting <var class="Ar">bar.gb</var> will not have correct
|
||||
checksums (unless you put them in the assembly source). You should use
|
||||
<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>
|
||||
<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 class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(5)</a>,
|
||||
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||
<a class="Xr">rgbds(7)</a>
|
||||
<a class="Xr" href="rgbasm.1.html">rgbasm(1)</a>, <a class="Xr" href="rgblink.5.html">rgblink(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" href="rgbds.7.html">rgbds(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<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>
|
||||
<table class="foot">
|
||||
<tr>
|
||||
<td class="foot-date">January 26, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-date">November 26, 2019</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
@@ -8,8 +8,10 @@
|
||||
SPDX-License-Identifier: MIT
|
||||
-->
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta charset="utf-8"/>
|
||||
<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>
|
||||
</head>
|
||||
<body>
|
||||
@@ -24,17 +26,15 @@
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||
<code class="Nm">rgblink</code> —
|
||||
<div class="Nd">linkerscript file format</div>
|
||||
<span class="Nd">linker script file format</span>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
||||
The linkerscript 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.
|
||||
<p class="Pp">The placement of sections specified in the linkerscript is done
|
||||
before the sections whose placement is defined in the source code.</p>
|
||||
<p class="Pp">A linkerscript consists on a series of banks followed by a list of
|
||||
sections and, optionally, commands. They can be lowercase or uppercase, it
|
||||
is ignored. Any line can contain a comment starting with
|
||||
The linker script is an external file that allows the user to specify the order
|
||||
of sections at link time and in a centralized manner.
|
||||
<p class="Pp">A linker script consists on a series of banks followed by a list
|
||||
of sections and, optionally, commands. They can be lowercase or uppercase,
|
||||
it is ignored. Any line can contain a comment starting with
|
||||
‘<code class="Li">;</code>’ that ends at the end of the
|
||||
line:</p>
|
||||
<div class="Bd Pp Bd-indent">
|
||||
@@ -50,42 +50,48 @@ WRAMX 2
|
||||
</div>
|
||||
<p class="Pp">Numbers can be in decimal or hexadecimal format (the prefix is
|
||||
‘<code class="Li">$</code>’). It is an error if any section
|
||||
name or command are found before setting a bank.</p>
|
||||
<p class="Pp">Files can be included by using the <var class="Ar">INCLUDE</var>
|
||||
keyword followed by a string with the path of the file that has to be
|
||||
name or command is found before setting a bank.</p>
|
||||
<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
|
||||
included.</p>
|
||||
<p class="Pp">The possible bank types are: <b class="Sy">ROM0</b>,
|
||||
<b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>, <b class="Sy">WRAM0</b>,
|
||||
<b class="Sy">WRAMX</b>, <b class="Sy">OAM</b> and <b class="Sy">HRAM</b>.
|
||||
Types <b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>,
|
||||
<b class="Sy">WRAMX</b> and <b class="Sy">SRAM</b> are banked, which means
|
||||
that it is needed to specify a bank after the type.</p>
|
||||
<p class="Pp">The possible bank types are: <code class="Cm">ROM0</code>,
|
||||
<code class="Cm">ROMX</code>, <code class="Cm">VRAM</code>,
|
||||
<code class="Cm">SRAM</code>, <code class="Cm">WRAM0</code>,
|
||||
<code class="Cm">WRAMX</code>, <code class="Cm">OAM</code> and
|
||||
<code class="Cm">HRAM</code>. Unless there is a single bank, which can occur
|
||||
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
|
||||
be placed right from the beginning of that bank. If the linkerscript
|
||||
switches to a different bank and then it comes back to the previous one it
|
||||
will continue from the last address that was used.</p>
|
||||
<p class="Pp">The only two commands are <var class="Ar">ORG</var> and
|
||||
<var class="Ar">ALIGN</var>:</p>
|
||||
be placed right from the beginning of that bank. If the linker script
|
||||
switches to a different bank and then comes back to a previous one, it will
|
||||
continue from the last address that was used.</p>
|
||||
<p class="Pp">The only two commands are <code class="Ic">ORG</code> and
|
||||
<code class="Ic">ALIGN</code>:</p>
|
||||
<ul class="Bl-bullet">
|
||||
<li><var class="Ar">ORG</var> sets the address in which new sections will be
|
||||
placed. It can not be lower than the current address.</li>
|
||||
<li><var class="Ar">ALIGN</var> will increase the address until it is aligned
|
||||
to the specified boundary (it tries to set to 0 the number of bits
|
||||
specified after the command: <b class="Sy">ALIGN 8</b> will align to
|
||||
$100).</li>
|
||||
<li><a class="permalink" href="#ORG"><code class="Ic" id="ORG">ORG</code></a>
|
||||
sets the address in which new sections will be placed. It can not be lower
|
||||
than the current address.</li>
|
||||
<li><a class="permalink" href="#ALIGN"><code class="Ic" id="ALIGN">ALIGN</code></a>
|
||||
will increase the address until it is aligned to the specified boundary
|
||||
(it tries to set to 0 the number of bits specified after the command:
|
||||
‘<code class="Li">ALIGN 8</code>’ will align to $100).</li>
|
||||
</ul>
|
||||
<p class="Pp">Note: The bank, alignment, address and type of sections can be
|
||||
specified both in the source code and in the linkerscript. For a section to
|
||||
be able to be placed with the linkerscript the bank must be left unassigned
|
||||
in the source code or be the same as the one specified in the linkerscript.
|
||||
The address and alignment musn't be set.</p>
|
||||
<p class="Pp"><b class="Sy">Note:</b> The bank, alignment, address and type of
|
||||
sections can be specified both in the source code and in the linker script.
|
||||
For a section to be able to be placed with the linker script, the bank,
|
||||
address and alignment must be left unassigned in the source code or be
|
||||
compatible with what is specified in the linker script. For example,
|
||||
‘<code class="Li">ALIGN[8]</code>’ in the source code is
|
||||
compatible with ‘<code class="Li">ORG $F00</code>’ in the
|
||||
linker script.</p>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||
ALSO</a></h1>
|
||||
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||
<a class="Xr">rgbds(7)</a>
|
||||
<a class="Xr" href="rgbasm.1.html">rgbasm(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" href="rgbds.5.html">rgbds(5)</a>,
|
||||
<a class="Xr" href="rgbds.7.html">rgbds(7)</a>
|
||||
</section>
|
||||
<section class="Sh">
|
||||
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||
@@ -97,8 +103,8 @@ WRAMX 2
|
||||
</div>
|
||||
<table class="foot">
|
||||
<tr>
|
||||
<td class="foot-date">January 27, 2018</td>
|
||||
<td class="foot-os">RGBDS Manual</td>
|
||||
<td class="foot-date">November 26, 2019</td>
|
||||
<td class="foot-os">General</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user