Merge pull request #346 from qguv/tilemap-mirrored-duplicates

gfx: Add mirrored tile check when generating tilemap
This commit is contained in:
Antonio Niño Díaz
2019-06-07 10:27:26 +01:00
16 changed files with 3400 additions and 3598 deletions

View File

@@ -36,6 +36,8 @@ Other contributors
- The OpenBSD Project <http://www.openbsd.org>
- Quint Guvernator <quint@guvernator.net>
- Sanqui <gsanky@gmail.com>
- YamaArashi <shadow962@live.com>

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- 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.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBASM(1)</title>
</head>
@@ -20,133 +21,105 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgbasm</b> &#x2014; <span class="Nd" title="Nd">Game
Boy assembler</span>
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbasm</code> &#x2014;
<div class="Nd">Game Boy assembler</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm">
<tr>
<td><b class="Nm" title="Nm">rgbasm</b></td>
<td>[<span class="Op"><b class="Fl" title="Fl">-EhLVvw</b></span>]
[<span class="Op"><b class="Fl" title="Fl">-b</b>
<var class="Ar" title="Ar">chars</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-D</b>
<var class="Ar" title="Ar">name</var>[<span class="Op">=<var class="Ar" title="Ar">value</var></span>]</span>]
[<span class="Op"><b class="Fl" title="Fl">-g</b>
<var class="Ar" title="Ar">chars</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-i</b>
<var class="Ar" title="Ar">path</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-M</b>
<var class="Ar" title="Ar">dependfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-o</b>
<var class="Ar" title="Ar">outfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-p</b>
<var class="Ar" title="Ar">pad_value</var></span>]
<var class="Ar" title="Ar">file</var></td>
<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>
<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>]
<var class="Ar">file</var></td>
</tr>
</table>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <b class="Nm" title="Nm">rgbasm</b> program creates an object file from an
</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
assembly source file. Its arguments are as follows:
<dl class="Bl-tag">
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#b"><b class="Fl" title="Fl" id="b">-b</b></a>
<var class="Ar" title="Ar">chars</var></dt>
<dd class="It-tag">Change the two characters used for binary constants. The
defaults are 01.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#D"><b class="Fl" title="Fl" id="D">-D</b></a>
<var class="Ar" title="Ar">name</var>[<span class="Op">=<var class="Ar" title="Ar">value</var></span>]</dt>
<dd class="It-tag">Add string symbol to the compiled source code. This is
equivalent to <var class="Ar" title="Ar">name</var>
<b class="Cm" title="Cm">EQUS</b>
&#x201C;<var class="Ar" title="Ar">value</var>&#x201D; in code. If a value
is not specified, a value of 1 is given.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#E"><b class="Fl" title="Fl" id="E">-E</b></a></dt>
<dd class="It-tag">Export all labels, including unreferenced and local
labels.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#g"><b class="Fl" title="Fl" id="g">-g</b></a>
<var class="Ar" title="Ar">chars</var></dt>
<dd class="It-tag">Change the four characters used for binary constants. The
defaults are 0123.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#h"><b class="Fl" title="Fl" id="h">-h</b></a></dt>
<dd class="It-tag">By default, <b class="Nm" title="Nm">rgbasm</b> inserts a
&#x2018;nop&#x2019; instruction immediately after any &#x2018;halt&#x2019;
instruction. The <b class="Fl" title="Fl">-h</b> option disables this
behavior.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#i"><b class="Fl" title="Fl" id="i">-i</b></a>
<var class="Ar" title="Ar">path</var></dt>
<dd class="It-tag">Add an include path.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#L"><b class="Fl" title="Fl" id="L">-L</b></a></dt>
<dd class="It-tag">Disable the optimization that turns loads of the form
<b class="Sy" title="Sy">LD [$FF00+n8],A</b> into the opcode
<b class="Sy" title="Sy">LDH [$FF00+n8],A</b> in order to have full
control of the result in the final ROM.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#M"><b class="Fl" title="Fl" id="M">-M</b></a>
<var class="Ar" title="Ar">dependfile</var></dt>
<dd class="It-tag">Print <a class="Xr" title="Xr">make(1)</a> dependencies to
<var class="Ar" title="Ar">dependfile</var>.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#o"><b class="Fl" title="Fl" id="o">-o</b></a>
<var class="Ar" title="Ar">outfile</var></dt>
<dd class="It-tag">Write an object file to the given filename.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
<var class="Ar" title="Ar">pad_value</var></dt>
<dd class="It-tag">When padding an image, pad with this value. The default is
0x00.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#V"><b class="Fl" title="Fl" id="V">-V</b></a></dt>
<dd class="It-tag">Print the version of the program and exit.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#v"><b class="Fl" title="Fl" id="v">-v</b></a></dt>
<dd class="It-tag">Be verbose.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#w"><b class="Fl" title="Fl" id="w">-w</b></a></dt>
<dd class="It-tag">Disable warning output.</dd>
<dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a>
<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>]</dt>
<dd>Add string symbol to the compiled source code. This is equivalent to
<var class="Ar">name</var> <code class="Cm">EQUS</code>
&#x201C;<var class="Ar">value</var>&#x201D; 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>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></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 &#x2018;nop&#x2019;
instruction immediately after any &#x2018;halt&#x2019; 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></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="#M"><code class="Fl" id="M">-M</code></a>
<var class="Ar">dependfile</var></dt>
<dd>Print <a class="Xr">make(1)</a> dependencies to
<var class="Ar">dependfile</var>.</dd>
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
<var class="Ar">outfile</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></dt>
<dd>When padding an image, pad with this value. The default is 0x00.</dd>
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></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>
<dd>Be verbose.</dd>
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
<dd>Disable warning output.</dd>
</dl>
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
Assembling a basic source file is simple:
<div class="Pp"></div>
<div class="Bd" style="margin-left: 5.00ex;">
<pre class="Li">
<div class="Bd Pp Bd-indent">
<pre>
$ rgbasm -o bar.o foo.asm
</pre>
</div>
<div class="Pp"></div>
The resulting object file is not yet a usable ROM image &#x2014; it must first
be run through <a class="Xr" title="Xr">rgblink(1)</a> and
<a class="Xr" title="Xr">rgbfix(1)</a>.
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
<p class="Pp">The resulting object file is not yet a usable ROM image &#x2014;
it must first be run through <a class="Xr">rgblink(1)</a> and
<a class="Xr">rgbfix(1)</a>.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(5)</a>, <a class="Xr" title="Xr">rgbfix(1)</a>,
<a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbds(5)</a>, <a class="Xr" title="Xr">rgbds(7)</a>,
<a class="Xr" title="Xr">gbz80(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgbasm</b> was originally written by Carsten
S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<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>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgbasm</code> was originally written by Carsten S&#x00F8;rensen
as part of the ASMotor package, and was later packaged in RGBDS by Justin
Lloyd. It is now maintained by a number of contributors at
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">February 24, 2018</td>

File diff suppressed because it is too large Load Diff

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
This file is part of RGBDS.
Copyright (c) 2017-2018, Antonio Nino Diaz and RGBDS contributors.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBDS(5)</title>
</head>
@@ -20,27 +21,29 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgbds</b> &#x2014; <span class="Nd" title="Nd">object
file format documentation</span>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
This is the description of the object files used by
<a class="Xr" title="Xr">rgbasm(1)</a> and
<a class="Xr" title="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.
<h1 class="Sh" title="Sh" id="FILE_STRUCTURE"><a class="selflink" href="#FILE_STRUCTURE">FILE
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbds</code> &#x2014;
<div class="Nd">object file format documentation</div>
</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.
</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:
<div class="Pp"></div>
<var class="Ar" title="Ar">LONG</var> is a 32&#x2010;bit integer stored in
little&#x2010;endian format (Intel). <var class="Ar" title="Ar">BYTE</var> is
an 8&#x2010;bit integer. <var class="Ar" title="Ar">STRING</var> is a
0&#x2010;terminated string of <var class="Ar" title="Ar">BYTE</var>.
<div class="Pp"></div>
<div class="Bd" style="margin-left: 0.00ex;">
<pre class="Li">
<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
8&#x2010;bit integer. <var class="Ar">STRING</var> is a 0&#x2010;terminated
string of <var class="Ar">BYTE</var>.</p>
<div class="Bd Pp">
<pre>
; Header
BYTE ID[4] ; &quot;RGB6&quot;
@@ -55,7 +58,7 @@ REPT NumberOfSymbols ; Number of symbols defined in this object file.
; as &quot;Scope.Symbol&quot;.
BYTE Type ; 0 = LOCAL symbol only used in this file.
; 1 = IMPORT this symbol from elsewhere (unused).
; 1 = IMPORT this symbol from elsewhere
; 2 = EXPORT this symbol to other objects.
IF Type != 1 ; If symbol is defined in this object file.
@@ -137,7 +140,8 @@ REPT NumberOfSections
ENDR
</pre>
</div>
<h2 class="Ss" title="Ss" id="RPN_DATA"><a class="selflink" href="#RPN_DATA">RPN
<section class="Ss">
<h2 class="Ss" id="RPN_DATA"><a class="permalink" href="#RPN_DATA">RPN
DATA</a></h2>
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;
@@ -146,159 +150,160 @@ Expressions in the object file are stored as RPN. This is an expression of the
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.
<table class="Bl-column" style="margin-left: 6.00ex;">
<colgroup>
<col style="width: 15.00ex;"/>
<col style="min-width: 10.00ex;"/>
</colgroup>
<tr class="It-column">
<td class="It-column"><b class="Sy" title="Sy">Value</b></td>
<td class="It-column"><b class="Sy" title="Sy">Meaning</b></td>
<table class="Bl-column Bd-indent">
<tr>
<td><b class="Sy">Value</b></td>
<td><b class="Sy">Meaning</b></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$00"><code class="Li" id="$00">$00</code></a></td>
<td class="It-column"><a class="selflink" href="#+_operator"><code class="Li" id="+_operator">+
<tr>
<td><a class="permalink" href="#$00"><code class="Li" id="$00">$00</code></a></td>
<td><a class="permalink" href="#+_operator"><code class="Li" id="+_operator">+
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$01"><code class="Li" id="$01">$01</code></a></td>
<td class="It-column"><a class="selflink" href="#-_operator"><code class="Li" id="-_operator">-
<tr>
<td><a class="permalink" href="#$01"><code class="Li" id="$01">$01</code></a></td>
<td><a class="permalink" href="#-_operator"><code class="Li" id="-_operator">-
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$02"><code class="Li" id="$02">$02</code></a></td>
<td class="It-column"><a class="selflink" href="#*_operator"><code class="Li" id="*_operator">*
<tr>
<td><a class="permalink" href="#$02"><code class="Li" id="$02">$02</code></a></td>
<td><a class="permalink" href="#*_operator"><code class="Li" id="*_operator">*
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$03"><code class="Li" id="$03">$03</code></a></td>
<td class="It-column"><a class="selflink" href="#/_operator"><code class="Li" id="/_operator">/
<tr>
<td><a class="permalink" href="#$03"><code class="Li" id="$03">$03</code></a></td>
<td><a class="permalink" href="#/_operator"><code class="Li" id="/_operator">/
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$04"><code class="Li" id="$04">$04</code></a></td>
<td class="It-column"><a class="selflink" href="#%_operator"><code class="Li" id="%_operator">%
<tr>
<td><a class="permalink" href="#$04"><code class="Li" id="$04">$04</code></a></td>
<td><a class="permalink" href="#__operator"><code class="Li" id="__operator">%
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$05"><code class="Li" id="$05">$05</code></a></td>
<td class="It-column"><a class="selflink" href="#unary_-"><code class="Li" id="unary_-">unary
<tr>
<td><a class="permalink" href="#$05"><code class="Li" id="$05">$05</code></a></td>
<td><a class="permalink" href="#unary_-"><code class="Li" id="unary_-">unary
-</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$10"><code class="Li" id="$10">$10</code></a></td>
<td class="It-column">|
<a class="selflink" href="#operator"><code class="Li" id="operator">operator</code></a></td>
<tr>
<td><a class="permalink" href="#$10"><code class="Li" id="$10">$10</code></a></td>
<td>|
<a class="permalink" href="#operator"><code class="Li" id="operator">operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$11"><code class="Li" id="$11">$11</code></a></td>
<td class="It-column"><a class="selflink" href="#&amp;_operator"><code class="Li" id="&amp;_operator">&amp;
<tr>
<td><a class="permalink" href="#$11"><code class="Li" id="$11">$11</code></a></td>
<td><a class="permalink" href="#&amp;_operator"><code class="Li" id="&amp;_operator">&amp;
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$12"><code class="Li" id="$12">$12</code></a></td>
<td class="It-column"><a class="selflink" href="#^_operator"><code class="Li" id="^_operator">^
<tr>
<td><a class="permalink" href="#$12"><code class="Li" id="$12">$12</code></a></td>
<td><a class="permalink" href="#__operator_2"><code class="Li" id="__operator_2">^
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$13"><code class="Li" id="$13">$13</code></a></td>
<td class="It-column"><a class="selflink" href="#unary_~"><code class="Li" id="unary_~">unary
<tr>
<td><a class="permalink" href="#$13"><code class="Li" id="$13">$13</code></a></td>
<td><a class="permalink" href="#unary_~"><code class="Li" id="unary_~">unary
~</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$21"><code class="Li" id="$21">$21</code></a></td>
<td class="It-column"><a class="selflink" href="#&amp;&amp;_comparison"><code class="Li" id="&amp;&amp;_comparison">&amp;&amp;
<tr>
<td><a class="permalink" href="#$21"><code class="Li" id="$21">$21</code></a></td>
<td><a class="permalink" href="#&amp;&amp;_comparison"><code class="Li" id="&amp;&amp;_comparison">&amp;&amp;
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$22"><code class="Li" id="$22">$22</code></a></td>
<td class="It-column"><a class="selflink" href="#||_comparison"><code class="Li" id="||_comparison">||
<tr>
<td><a class="permalink" href="#$22"><code class="Li" id="$22">$22</code></a></td>
<td><a class="permalink" href="#___comparison"><code class="Li" id="___comparison">||
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$23"><code class="Li" id="$23">$23</code></a></td>
<td class="It-column"><a class="selflink" href="#unary"><code class="Li" id="unary">unary</code></a>!</td>
<tr>
<td><a class="permalink" href="#$23"><code class="Li" id="$23">$23</code></a></td>
<td><a class="permalink" href="#unary"><code class="Li" id="unary">unary</code></a>!</td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$30"><code class="Li" id="$30">$30</code></a></td>
<td class="It-column"><a class="selflink" href="#==_comparison"><code class="Li" id="==_comparison">==
<tr>
<td><a class="permalink" href="#$30"><code class="Li" id="$30">$30</code></a></td>
<td><a class="permalink" href="#==_comparison"><code class="Li" id="==_comparison">==
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$31"><code class="Li" id="$31">$31</code></a></td>
<td class="It-column"><a class="selflink" href="#!=_comparison"><code class="Li" id="!=_comparison">!=
<tr>
<td><a class="permalink" href="#$31"><code class="Li" id="$31">$31</code></a></td>
<td><a class="permalink" href="#!=_comparison"><code class="Li" id="!=_comparison">!=
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$32"><code class="Li" id="$32">$32</code></a></td>
<td class="It-column"><a class="selflink" href="#&gt;_comparison"><code class="Li" id="&gt;_comparison">&gt;
<tr>
<td><a class="permalink" href="#$32"><code class="Li" id="$32">$32</code></a></td>
<td><a class="permalink" href="#__comparison"><code class="Li" id="__comparison">&gt;
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$33"><code class="Li" id="$33">$33</code></a></td>
<td class="It-column"><a class="selflink" href="#&lt;_comparison"><code class="Li" id="&lt;_comparison">&lt;
<tr>
<td><a class="permalink" href="#$33"><code class="Li" id="$33">$33</code></a></td>
<td><a class="permalink" href="#__comparison_2"><code class="Li" id="__comparison_2">&lt;
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$34"><code class="Li" id="$34">$34</code></a></td>
<td class="It-column"><a class="selflink" href="#&gt;=_comparison"><code class="Li" id="&gt;=_comparison">&gt;=
<tr>
<td><a class="permalink" href="#$34"><code class="Li" id="$34">$34</code></a></td>
<td><a class="permalink" href="#_=_comparison"><code class="Li" id="_=_comparison">&gt;=
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$35"><code class="Li" id="$35">$35</code></a></td>
<td class="It-column"><a class="selflink" href="#&lt;=_comparison"><code class="Li" id="&lt;=_comparison">&lt;=
<tr>
<td><a class="permalink" href="#$35"><code class="Li" id="$35">$35</code></a></td>
<td><a class="permalink" href="#_=_comparison_2"><code class="Li" id="_=_comparison_2">&lt;=
comparison</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$40"><code class="Li" id="$40">$40</code></a></td>
<td class="It-column"><a class="selflink" href="#&lt;&lt;_comparison"><code class="Li" id="&lt;&lt;_comparison">&lt;&lt;
comparison</code></a></td>
<tr>
<td><a class="permalink" href="#$40"><code class="Li" id="$40">$40</code></a></td>
<td><a class="permalink" href="#___operator"><code class="Li" id="___operator">&lt;&lt;
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$41"><code class="Li" id="$41">$41</code></a></td>
<td class="It-column"><a class="selflink" href="#&gt;&gt;_comparison"><code class="Li" id="&gt;&gt;_comparison">&gt;&gt;
comparison</code></a></td>
<tr>
<td><a class="permalink" href="#$41"><code class="Li" id="$41">$41</code></a></td>
<td><a class="permalink" href="#___operator_2"><code class="Li" id="___operator_2">&gt;&gt;
operator</code></a></td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$50"><code class="Li" id="$50">$50</code></a></td>
<td class="It-column"><a class="selflink" href="#BANK(symbol),"><code class="Li" id="BANK(symbol),">BANK(symbol),</code></a>
a <var class="Ar" title="Ar">LONG</var> Symbol ID follows.</td>
<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>
a <var class="Ar">LONG</var> Symbol ID follows.</td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$51"><code class="Li" id="$51">$51</code></a></td>
<td class="It-column"><a class="selflink" href="#BANK(section_name),"><code class="Li" id="BANK(section_name),">BANK(section_name),</code></a>
<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>
a null-terminated string follows.</td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$52"><code class="Li" id="$52">$52</code></a></td>
<td class="It-column"><a class="selflink" href="#Current_BANK()"><code class="Li" id="Current_BANK()">Current
<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>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$60"><code class="Li" id="$60">$60</code></a></td>
<td class="It-column"><a class="selflink" href="#HRAMCheck."><code class="Li" id="HRAMCheck.">HRAMCheck.</code></a>
<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>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$80"><code class="Li" id="$80">$80</code></a></td>
<td class="It-column"><var class="Ar" title="Ar">LONG</var> integer
follows.</td>
<tr>
<td><a class="permalink" href="#$80"><code class="Li" id="$80">$80</code></a></td>
<td><var class="Ar">LONG</var> integer follows.</td>
</tr>
<tr class="It-column">
<td class="It-column"><a class="selflink" href="#$81"><code class="Li" id="$81">$81</code></a></td>
<td class="It-column"><var class="Ar" title="Ar">LONG</var> Symbol ID
follows.</td>
<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>
</tr>
</table>
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
</section>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbds(7)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgbds</b> was originally written by Carsten
S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgbds</code> was originally written by Carsten S&#x00F8;rensen
as part of the ASMotor package, and was later packaged in RGBDS by Justin
Lloyd. It is now maintained by a number of contributors at
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 26, 2018</td>

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- 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.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBDS(7)</title>
</head>
@@ -20,46 +21,52 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgbds</b> &#x2014; <span class="Nd" title="Nd">Rednex
Game Boy Development System</span>
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbds</code> &#x2014;
<div class="Nd">Rednex Game Boy Development System</div>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
To get a working ROM image from a single assembly source file:
<div class="Pp"></div>
<div class="Bd" style="margin-left: 5.00ex;">
<pre class="Li">
<div class="Bd Pp Bd-indent">
<pre>
$ rgbasm -o bar.o foo.asm
$ rgblink -o baz.gb bar.o
$ rgbfix -v -p 0 baz.gb
</pre>
</div>
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgbfix(1)</a>,
<a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbds(5)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</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>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<dl class="Bl-ohang">
<dt class="It-ohang"></dt>
<dd class="It-ohang">1997, Carsten S&#x00F8;rensen (AKA SurfSmurf) writes
ASMotor as a general-purpose assembler/linker system for DOS/Win32.</dd>
<dt class="It-ohang"></dt>
<dd class="It-ohang">1999, Justin Lloyd (AKA Otaku no Zoku) adapts ASMotor to
read and produce GBZ80 assembly/machine code, and releases this version as
RGBDS.</dd>
<dt class="It-ohang"></dt>
<dd class="It-ohang">2009, Vegard Nossum adapts the code to be more UNIX-like
and releases this version as rgbds-linux on GitHub.</dd>
<dt class="It-ohang"></dt>
<dd class="It-ohang">2010, Anthony J. Bentley forks that repository. The fork
becomes the reference implementation of rgbds.</dd>
<dt class="It-ohang"></dt>
<dd class="It-ohang">2017, Bentley's repository is moved to a neutral name. It
is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</dd>
<dt class="It-ohang"></dt>
<dd class="It-ohang">2018, codebase relicensed under the MIT license.</dd>
<dt></dt>
<dd>1997, Carsten S&#x00F8;rensen (AKA SurfSmurf) writes ASMotor as a
general-purpose assembler/linker system for DOS/Win32.</dd>
<dt></dt>
<dd>1999, Justin Lloyd (AKA Otaku no Zoku) adapts ASMotor to read and produce
GBZ80 assembly/machine code, and releases this version as RGBDS.</dd>
<dt></dt>
<dd>2009, Vegard Nossum adapts the code to be more UNIX-like and releases this
version as rgbds-linux on GitHub.</dd>
<dt></dt>
<dd>2010, Anthony J. Bentley forks that repository. The fork becomes the
reference implementation of rgbds.</dd>
<dt></dt>
<dd>2017, Bentley's repository is moved to a neutral name. It is now
maintained by a number of contributors at
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</dd>
<dt></dt>
<dd>2018, codebase relicensed under the MIT license.</dd>
</dl>
</section>
</div>
<table class="foot">
<tr>

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
This file is part of RGBDS.
Copyright (c) 2010-2017, Anthony J. Bentley and RGBDS contributors.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBFIX(1)</title>
</head>
@@ -20,189 +21,158 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgbfix</b> &#x2014; <span class="Nd" title="Nd">Game
Boy checksum fixer</span>
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbfix</code> &#x2014;
<div class="Nd">Game Boy checksum fixer</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm">
<tr>
<td><b class="Nm" title="Nm">rgbfix</b></td>
<td>[<span class="Op"><b class="Fl" title="Fl">-CcjsVv</b></span>]
[<span class="Op"><b class="Fl" title="Fl">-f</b>
<var class="Ar" title="Ar">fix_spec</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-i</b>
<var class="Ar" title="Ar">game_id</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-k</b>
<var class="Ar" title="Ar">licensee_str</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-l</b>
<var class="Ar" title="Ar">licensee_id</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-m</b>
<var class="Ar" title="Ar">mbc_type</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-n</b>
<var class="Ar" title="Ar">rom_version</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-p</b>
<var class="Ar" title="Ar">pad_value</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-r</b>
<var class="Ar" title="Ar">ram_size</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-t</b>
<var class="Ar" title="Ar">title_str</var></span>]
<var class="Ar" title="Ar">file</var></td>
<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>
<var class="Ar">title_str</var>] <var class="Ar">file</var></td>
</tr>
</table>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <b class="Nm" title="Nm">rgbfix</b> program changes headers of Game Boy ROM
</section>
<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:
<dl class="Bl-tag">
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#C"><b class="Fl" title="Fl" id="C">-C</b></a></dt>
<dd class="It-tag">Set the Game Boy Color&#x2013;only flag:
<i class="Ad">0x143</i> = 0xC0. If both this and the
<b class="Fl" title="Fl">-c</b> flag are set, this takes precedence.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#c"><b class="Fl" title="Fl" id="c">-c</b></a></dt>
<dd class="It-tag">Set the Game Boy Color&#x2013;compatible flag:
<i class="Ad">0x143</i> = 0x80. If both this and the
<b class="Fl" title="Fl">-C</b> flag are set,
<b class="Fl" title="Fl">-C</b> takes precedence.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#f"><b class="Fl" title="Fl" id="f">-f</b></a>
<var class="Ar" title="Ar">fix_spec</var></dt>
<dd class="It-tag">Fix certain header values that the Game Boy checks for
correctness. Alternatively, intentionally trash these values by writing
their binary inverse instead. <var class="Ar" title="Ar">fix_spec</var> is
a string containing any combination of the following characters:
<div class="Pp"></div>
<dl class="Bl-tag Bl-compact" style="margin-left: 5.40ex;">
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#l"><b class="Cm" title="Cm" id="l">l</b></a></dt>
<dd class="It-tag">Fix the Nintendo logo
(<i class="Ad">0x104</i>&#x2013;<i class="Ad">0x133</i>).</dd>
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#L"><b class="Cm" title="Cm" id="L">L</b></a></dt>
<dd class="It-tag">Trash the Nintendo logo.</dd>
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#h"><b class="Cm" title="Cm" id="h">h</b></a></dt>
<dd class="It-tag">Fix the header checksum (<i class="Ad">0x14D</i>).</dd>
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#H"><b class="Cm" title="Cm" id="H">H</b></a></dt>
<dd class="It-tag">Trash the header checksum.</dd>
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#g"><b class="Cm" title="Cm" id="g">g</b></a></dt>
<dd class="It-tag">Fix the global checksum
(<i class="Ad">0x14E</i>&#x2013;<i class="Ad">0x14F</i>).</dd>
<dt class="It-tag" style="margin-left: -5.40ex;"><a class="selflink" href="#G"><b class="Cm" title="Cm" id="G">G</b></a></dt>
<dd class="It-tag">Trash the global checksum.</dd>
<dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a></dt>
<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
takes precedence.</dd>
<dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a></dt>
<dd>Set the Game Boy Color&#x2013;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></dt>
<dd>Fix certain header values that the Game Boy checks for correctness.
Alternatively, intentionally trash these values by writing their binary
inverse instead. <var class="Ar">fix_spec</var> is a string containing any
combination of the following characters:
<p class="Pp"></p>
<dl class="Bl-tag Bl-compact">
<dt><a class="permalink" href="#l"><code class="Cm" id="l">l</code></a></dt>
<dd>Fix the Nintendo logo
(<span class="Ad">0x104</span>&#x2013;<span class="Ad">0x133</span>).</dd>
<dt><a class="permalink" href="#L"><code class="Cm" id="L">L</code></a></dt>
<dd>Trash the Nintendo logo.</dd>
<dt><a class="permalink" href="#h"><code class="Cm" id="h">h</code></a></dt>
<dd>Fix the header checksum (<span class="Ad">0x14D</span>).</dd>
<dt><a class="permalink" href="#H"><code class="Cm" id="H">H</code></a></dt>
<dd>Trash the header checksum.</dd>
<dt><a class="permalink" href="#g"><code class="Cm" id="g">g</code></a></dt>
<dd>Fix the global checksum
(<span class="Ad">0x14E</span>&#x2013;<span class="Ad">0x14F</span>).</dd>
<dt><a class="permalink" href="#G"><code class="Cm" id="G">G</code></a></dt>
<dd>Trash the global checksum.</dd>
</dl>
</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#i"><b class="Fl" title="Fl" id="i">-i</b></a>
<var class="Ar" title="Ar">game_id</var></dt>
<dd class="It-tag">Set the game ID string
(<i class="Ad">0x13F</i>&#x2013;<i class="Ad">0x142</i>) 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 class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#j"><b class="Fl" title="Fl" id="j">-j</b></a></dt>
<dd class="It-tag">Set the non-Japanese region flag: <i class="Ad">0x14A</i> =
1.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#k"><b class="Fl" title="Fl" id="k">-k</b></a>
<var class="Ar" title="Ar">licensee_str</var></dt>
<dd class="It-tag">Set the new licensee string
(<i class="Ad">0x144</i>&#x2013;<i class="Ad">0x145</i>) to a given
string, truncated to at most two characters.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#l"><b class="Fl" title="Fl" id="l">-l</b></a>
<var class="Ar" title="Ar">licensee_id</var></dt>
<dd class="It-tag">Set the old licensee code, <i class="Ad">0x14B</i>, to a
given value from 0 to 0xFF. This value is deprecated and should be set to
0x33 in all new software.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#m"><b class="Fl" title="Fl" id="m">-m</b></a>
<var class="Ar" title="Ar">mbc_type</var></dt>
<dd class="It-tag">Set the MBC type, <i class="Ad">0x147</i>, to a given value
from 0 to 0xFF.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#n"><b class="Fl" title="Fl" id="n">-n</b></a>
<var class="Ar" title="Ar">rom_version</var></dt>
<dd class="It-tag">Set the ROM version, <i class="Ad">0x14C</i>, to a given
value from 0 to 0xFF.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
<var class="Ar" title="Ar">pad_value</var></dt>
<dd class="It-tag">Pad the image to a valid size with a given pad value from 0
to 0xFF. <b class="Nm" title="Nm">rgbfix</b> will automatically pick a
size from 32KiB, 64KiB, 128KiB, ..., 8192KiB and give a warning
thereafter. The cartridge size byte (<i class="Ad">0x148</i>) will be
changed to reflect this new size.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#r"><b class="Fl" title="Fl" id="r">-r</b></a>
<var class="Ar" title="Ar">ram_size</var></dt>
<dd class="It-tag">Set the RAM size, <i class="Ad">0x149</i>, to a given value
from 0 to 0xFF.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#s"><b class="Fl" title="Fl" id="s">-s</b></a></dt>
<dd class="It-tag">Set the SGB flag: <i class="Ad">0x146</i> = 3.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#t"><b class="Fl" title="Fl" id="t">-t</b></a>
<var class="Ar" title="Ar">title</var></dt>
<dd class="It-tag">Set the title string
(<i class="Ad">0x134</i>&#x2013;<i class="Ad">0x143</i>) to a given
string, truncated to at most 16 characters. It is recommended to use 15
characters instead, to avoid clashing with the CGB flag
(<b class="Fl" title="Fl">-c</b> or <b class="Fl" title="Fl">-C</b>). If
both this and the game ID are set, the game ID will overwrite the
overlapping portion of the title.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#V"><b class="Fl" title="Fl" id="V">-V</b></a></dt>
<dd class="It-tag">Print the version of the program and exit.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#v"><b class="Fl" title="Fl" id="v">-v</b></a></dt>
<dd class="It-tag">Equivalent to <b class="Fl" title="Fl">-f</b>
<b class="Cm" title="Cm">lhg</b>.</dd>
<dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a>
<var class="Ar">game_id</var></dt>
<dd>Set the game ID string
(<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,
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>
<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></dt>
<dd>Set the new licensee string
(<span class="Ad">0x144</span>&#x2013;<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></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></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></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></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>
<dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
<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="#t"><code class="Fl" id="t">-t</code></a>
<var class="Ar">title</var></dt>
<dd>Set the title string
(<span class="Ad">0x134</span>&#x2013;<span class="Ad">0x143</span>) to a
given string, truncated to at most 16 characters. It is recommended to use
15 characters instead, to avoid clashing with the CGB flag
(<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>
<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>
<dd>Equivalent to <code class="Fl">-f</code> <code class="Cm">lhg</code>.</dd>
</dl>
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
</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
(&#x201C;valid&#x201D; meaning a multiple of 32KiB).
<div class="Pp"></div>
The following will make a plain, no-color Game Boy game without checking for a
valid size:
<div class="Pp"></div>
<div class="D1">$ rgbfix -v foo.gb</div>
<div class="Pp"></div>
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 Game Boy
itself does not use the title, but some emulators or ROM managers might.)
<div class="Pp"></div>
<div class="D1">$ rgbfix -vcs -l 0x33 -p 0 -t foobar baz.gb</div>
<div class="Pp"></div>
The following will duplicate the header (sans global checksum) of the game
&#x201C;Survival Kids&#x201D;:
<div class="Pp"></div>
<div class="D1">$ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t
<p class="Pp">The following will make a plain, no-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 &#x201C;foobar&#x201D;, 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>
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -vcs -l 0x33 -p 0 -t foobar baz.gb</div>
<p class="Pp">The following will duplicate the header (sans global checksum) of
the game &#x201C;Survival Kids&#x201D;:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t
SURVIVALKIDAVKE SurvivalKids.gbc</div>
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbds(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgbfix</b> was originally released by Carsten
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
<a class="Xr">rgbds(7)</a>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgbfix</code> was originally released by Carsten
S&#x00F8;rensen as a standalone program called gbfix, and was later packaged
in RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">March 11, 2018</td>

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
This file is part of RGBDS.
Copyright (c) 2013-2018, stag019 and RGBDS contributors.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBGFX(1)</title>
</head>
@@ -20,151 +21,153 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgbgfx</b> &#x2014; <span class="Nd" title="Nd">Game
Boy graphics converter</span>
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgbgfx</code> &#x2014;
<div class="Nd">Game Boy graphics converter</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm">
<tr>
<td><b class="Nm" title="Nm">rgbgfx</b></td>
<td>[<span class="Op"><b class="Fl" title="Fl">-DfFhPTVv</b></span>]
[<span class="Op"><b class="Fl" title="Fl">-o</b>
<var class="Ar" title="Ar">outfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-d</b>
<var class="Ar" title="Ar">depth</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-p</b>
<var class="Ar" title="Ar">palfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-t</b>
<var class="Ar" title="Ar">mapfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-x</b>
<var class="Ar" title="Ar">tiles</var></span>]
<var class="Ar" title="Ar">file</var></td>
<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>
</tr>
</table>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <b class="Nm" title="Nm">rgbgfx</b> program converts PNG images into the
Nintendo Game Boy's planar tile format.
<div style="height: 1.00em;">&#x00A0;</div>
The resulting colors and their palette indices are determined differently
depending on the input PNG file:
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
Game Boy's planar tile format.
<p class="Pp">The resulting colors and their palette indices are determined
differently depending on the input PNG file:</p>
<ul class="Bl-dash">
<li class="It-dash">If the file has an embedded palette, that palette's color
and order are used.</li>
<li class="It-dash">If not, and the image only contains shades of gray, rgbgfx
maps them to 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>
<li class="It-dash">If the image has color (or the grayscale method failed),
the colors are sorted from lightest to darkest.</li>
<li>If the file has an embedded palette, that palette's color and order are
used.</li>
<li>If not, and the image only contains shades of gray, rgbgfx maps them to
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>
<li>If the image has color (or the grayscale method failed), the colors are
sorted from lightest to darkest.</li>
</ul>
<div style="height: 1.00em;">&#x00A0;</div>
The input image may not contain more colors than the selected bit depth allows.
Transparent pixels are set to palette index 0.
<h1 class="Sh" title="Sh" id="ARGUMENTS"><a class="selflink" href="#ARGUMENTS">ARGUMENTS</a></h1>
<p class="Pp">The input image may not contain more colors than the selected bit
depth allows. Transparent pixels are set to palette index 0.</p>
</section>
<section class="Sh">
<h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1>
<dl class="Bl-tag">
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#D"><b class="Fl" title="Fl" id="D">-D</b></a></dt>
<dd class="It-tag">Debug features are enabled.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#f"><b class="Fl" title="Fl" id="f">-f</b></a></dt>
<dd class="It-tag">Fix the input PNG file to be a correctly indexed
image.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#F"><b class="Fl" title="Fl" id="F">-F</b></a></dt>
<dd class="It-tag">Same as <b class="Fl" title="Fl">-f</b>, but additionally,
the supplied command line parameters are saved within the PNG and will be
loaded and automatically used next time.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#d"><b class="Fl" title="Fl" id="d">-d</b></a>
<var class="Ar" title="Ar">depth</var></dt>
<dd class="It-tag">The bit depth of the output image (either 1 or 2). By
default, the bit depth is 2 (two bits per pixel).</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#h"><b class="Fl" title="Fl" id="h">-h</b></a></dt>
<dd class="It-tag">Lay out tiles horizontally rather than vertically.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#o"><b class="Fl" title="Fl" id="o">-o</b></a>
<var class="Ar" title="Ar">outfile</var></dt>
<dd class="It-tag">The name of the output file.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
<var class="Ar" title="Ar">palfile</var></dt>
<dd class="It-tag">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 class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#P"><b class="Fl" title="Fl" id="P">-P</b></a></dt>
<dd class="It-tag">Same as <b class="Fl" title="Fl">-p</b>, but the palette
file output name is made by taking the input PNG file's filename, removing
the file extension, and appending <i class="Pa" title="Pa">.pal</i>.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#t"><b class="Fl" title="Fl" id="t">-t</b></a>
<var class="Ar" title="Ar">mapfile</var></dt>
<dd class="It-tag">If any tiles are the same, don't place the repeat tiles in
the output file, and make a tilemap file.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#T"><b class="Fl" title="Fl" id="T">-T</b></a></dt>
<dd class="It-tag">Same as <b class="Fl" title="Fl">-t</b>, but the tilemap
file output name is made by taking the input filename, removing the file
extension, and appending <i class="Pa" title="Pa">.tilemap</i>.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#u"><b class="Fl" title="Fl" id="u">-u</b></a></dt>
<dd class="It-tag">Truncate repeated tiles. Useful with tilemaps.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#V"><b class="Fl" title="Fl" id="V">-V</b></a></dt>
<dd class="It-tag">Print the version of the program and exit.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#v"><b class="Fl" title="Fl" id="v">-v</b></a></dt>
<dd class="It-tag">Verbose. Print errors when the command line parameters and
the parameters in the PNG file don't match.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#x"><b class="Fl" title="Fl" id="x">-x</b></a>
<var class="Ar" title="Ar">tiles</var></dt>
<dd class="It-tag">Trim the end of the output file by this many tiles.</dd>
<dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a>
<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>
<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="#D"><code class="Fl" id="D">-D</code></a></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></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>
<dd>Lay out tiles horizontally rather than vertically.</dd>
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a></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>
<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
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>
<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></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>
<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>
<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>
<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>
<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></dt>
<dd>Trim the end of the output file by this many tiles.</dd>
</dl>
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
The following will take a PNG file with a bit depth of 1, 2, or 8, and output
planar 2bpp data:
<div class="Pp"></div>
<div class="D1">$ rgbgfx -o out.2bpp in.png</div>
<div class="Pp"></div>
The following creates a planar 2bpp file with only unique tiles, and its tilemap
<i class="Pa" title="Pa">out.tilemap</i>:
<div class="Pp"></div>
<div class="D1">$ rgbgfx -T -u -o out.2bpp in.png</div>
<div class="Pp"></div>
The following will do nothing:
<div class="Pp"></div>
<div class="D1">$ rgbgfx in.png</div>
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbgfx -o out.2bpp in.png</div>
<p class="Pp">The following creates a planar 2bpp file with only unique tiles,
and its tilemap <span class="Pa">out.tilemap</span>:</p>
<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">out.attrmap</span>:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbgfx -A -T -m -o out.2bpp in.png</div>
<p class="Pp">The following will do nothing:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbgfx in.png</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbds(7)</a>, <a class="Xr" title="Xr">rgbasm(1)</a>,
<a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgbgfx</b> was created by
<span class="An" title="An">stag019</span> to be included in RGBDS. It is now
maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<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>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgbgfx</code> was created by <span class="An">stag019</span> to
be included in RGBDS. It is now maintained by a number of contributors at
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 26, 2018</td>

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- 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.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBLINK(1)</title>
</head>
@@ -20,137 +21,113 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgblink</b> &#x2014; <span class="Nd" title="Nd">Game
Boy linker</span>
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgblink</code> &#x2014;
<div class="Nd">Game Boy linker</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm">
<tr>
<td><b class="Nm" title="Nm">rgblink</b></td>
<td>[<span class="Op"><b class="Fl" title="Fl">-dtVw</b></span>]
[<span class="Op"><b class="Fl" title="Fl">-m</b>
<var class="Ar" title="Ar">mapfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-n</b>
<var class="Ar" title="Ar">symfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-O</b>
<var class="Ar" title="Ar">overlayfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-o</b>
<var class="Ar" title="Ar">outfile</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-p</b>
<var class="Ar" title="Ar">pad_value</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-s</b>
<var class="Ar" title="Ar">symbol</var></span>]
[<span class="Op"><b class="Fl" title="Fl">-l</b>
<var class="Ar" title="Ar">linkerscript</var></span>]
<var class="Ar" title="Ar">file ...</var></td>
<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>
</tr>
</table>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <b class="Nm" title="Nm">rgblink</b> program links objects created by
<a class="Xr" title="Xr">rgbasm(1)</a> into a single Game Boy ROM file.
<div class="Pp"></div>
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 <b class="Fl" title="Fl">-t</b> option to
override this.
<div class="Pp"></div>
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 <b class="Fl" title="Fl">-w</b> option to override
this.
<div class="Pp"></div>
Also, if your ROM is designed for DMG, you can make sure that you don't use any
prohibited section by using the option <b class="Fl" title="Fl">-d</b>, which
implies <b class="Fl" title="Fl">-w</b> but also prohibits the use of VRAM
bank 1.
<div class="Pp"></div>
The arguments are as follows:
</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>
<dl class="Bl-tag">
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#m"><b class="Fl" title="Fl" id="m">-m</b></a>
<var class="Ar" title="Ar">mapfile</var></dt>
<dd class="It-tag">Write a mapfile to the given filename.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#n"><b class="Fl" title="Fl" id="n">-n</b></a>
<var class="Ar" title="Ar">symfile</var></dt>
<dd class="It-tag">Write a symbol file to the given filename.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#O"><b class="Fl" title="Fl" id="O">-O</b></a>
<var class="Ar" title="Ar">overlayfile</var></dt>
<dd class="It-tag">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 class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#o"><b class="Fl" title="Fl" id="o">-o</b></a>
<var class="Ar" title="Ar">outfile</var></dt>
<dd class="It-tag">Write ROM image to the given filename.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
<var class="Ar" title="Ar">pad_value</var></dt>
<dd class="It-tag">When padding an image, pad with this value. The default is
0x00.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#s"><b class="Fl" title="Fl" id="s">-s</b></a>
<var class="Ar" title="Ar">symbol</var></dt>
<dd class="It-tag">???</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#w"><b class="Fl" title="Fl" id="w">-w</b></a></dt>
<dd class="It-tag">Expand the WRAM0 section size from 4KiB to the full 8KiB
assigned to WRAM and prohibit the use of WRAMX sections.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#d"><b class="Fl" title="Fl" id="d">-d</b></a></dt>
<dd class="It-tag">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 <b class="Fl" title="Fl">-w</b>.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#t"><b class="Fl" title="Fl" id="t">-t</b></a></dt>
<dd class="It-tag">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 class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#l"><b class="Fl" title="Fl" id="l">-l</b></a>
<var class="Ar" title="Ar">linkerscript</var></dt>
<dd class="It-tag">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" title="Xr">rgblink(5)</a> for more information about its
format.</dd>
<dt class="It-tag">&#x00A0;</dt>
<dd class="It-tag">&#x00A0;</dd>
<dt class="It-tag"><a class="selflink" href="#V"><b class="Fl" title="Fl" id="V">-V</b></a></dt>
<dd class="It-tag">Print the version of the program and exit.</dd>
<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>
<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>
<dd>Print the version of the program and exit.</dd>
</dl>
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
All you need for a basic ROM is an object file, which can be made into a ROM
image like so:
<div class="Pp"></div>
<div class="D1">$ rgblink -o bar.gb foo.o</div>
<div class="Pp"></div>
The resulting bar.gb will not have correct checksums (unless you put them in the
assembly source). You should use <a class="Xr" title="Xr">rgbfix(1)</a> to fix
these so that the program will actually run in a Game Boy:
<div class="Pp"></div>
<div class="D1">$ rgbfix -v bar.gb</div>
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
<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"></p>
<div class="Bd Bd-indent">$ rgbfix -v bar.gb</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(5)</a>,
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">rgbds(5)</a>,
<a class="Xr" title="Xr">rgbds(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgblink</b> was originally written by Carsten
<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>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgblink</code> was originally written by Carsten
S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 26, 2018</td>

View File

@@ -1,13 +1,14 @@
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file. Do not edit.
This file is part of RGBDS.
Copyright (c) 2017-2018, Antonio Nino Diaz and RGBDS contributors.
SPDX-License-Identifier: MIT
-->
<head>
<meta charset="utf-8"/>
<style>
table.head, table.foot { width: 100%; }
td.head-rtitle, td.foot-os { text-align: right; }
td.head-vol { text-align: center; }
div.Pp { margin: 1ex 0ex; }
</style>
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
<title>RGBLINK(5)</title>
</head>
@@ -20,23 +21,24 @@
</tr>
</table>
<div class="manual-text">
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
<b class="Nm" title="Nm">rgblink</b> &#x2014;
<span class="Nd" title="Nd">linkerscript file format</span>
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgblink</code> &#x2014;
<div class="Nd">linkerscript file format</div>
</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.
<div class="Pp"></div>
The placement of sections specified in the linkerscript is done before the
sections whose placement is defined in the source code.
<div class="Pp"></div>
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
&#x2018;<code class="Li">;</code>&#x2019; that ends at the end of the line:
<div class="Pp"></div>
<div class="Bd" style="margin-left: 5.00ex;">
<pre class="Li">
<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
&#x2018;<code class="Li">;</code>&#x2019; that ends at the end of the
line:</p>
<div class="Bd Pp Bd-indent">
<pre>
ROMX $F ; This is a comment
&quot;Functions to read array&quot;
ALIGN 8
@@ -46,55 +48,53 @@ WRAMX 2
&quot;Some variables&quot;
</pre>
</div>
<div class="Pp"></div>
Numbers can be in decimal or hexadecimal format (the prefix is
&#x2018;<code class="Li">$</code>&#x2019;). It is an error if any section name
or command are found before setting a bank.
<div class="Pp"></div>
Files can be included by using the <var class="Ar" title="Ar">INCLUDE</var>
<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
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
included.
<div class="Pp"></div>
The possible bank types are: <b class="Sy" title="Sy">ROM0</b>,
<b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
<b class="Sy" title="Sy">WRAM0</b>, <b class="Sy" title="Sy">WRAMX</b>,
<b class="Sy" title="Sy">OAM</b> and <b class="Sy" title="Sy">HRAM</b>. Types
<b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
<b class="Sy" title="Sy">WRAMX</b> and <b class="Sy" title="Sy">SRAM</b> are
banked, which means that it is needed to specify a bank after the type.
<div class="Pp"></div>
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.
<div class="Pp"></div>
The only two commands are <var class="Ar" title="Ar">ORG</var> and
<var class="Ar" title="Ar">ALIGN</var>:
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">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>
<ul class="Bl-bullet">
<li class="It-bullet"><var class="Ar" title="Ar">ORG</var> sets the address in
which new sections will be placed. It can not be lower than the current
address.</li>
<li class="It-bullet"><var class="Ar" title="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" title="Sy">ALIGN 8</b> will align to $100).</li>
<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>
</ul>
<div class="Pp"></div>
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.
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
<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>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
ALSO</a></h1>
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">rgbds(5)</a>,
<a class="Xr" title="Xr">rgbds(7)</a>
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
<b class="Nm" title="Nm">rgblink</b> was originally written by Carsten
<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>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgblink</code> was originally written by Carsten
S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
<a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
<tr>
<td class="foot-date">January 27, 2018</td>

View File

@@ -12,14 +12,24 @@
#include <stdint.h>
#include "gfx/main.h"
#define XFLIP 0x40
#define YFLIP 0x20
void raw_to_gb(const struct RawIndexedImage *raw_image, struct GBImage *gb);
void output_file(const struct Options *opts, const struct GBImage *gb);
int get_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles,
int tile_size);
void create_tilemap(const struct Options *opts, struct GBImage *gb,
struct Tilemap *tilemap);
uint8_t reverse_bits(uint8_t b);
void xflip(uint8_t *tile, uint8_t *tile_xflip, int tile_size);
void yflip(uint8_t *tile, uint8_t *tile_yflip, int tile_size);
int get_mirrored_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles,
int tile_size, int *flags);
void create_mapfiles(const struct Options *opts, struct GBImage *gb,
struct Mapfile *tilemap, struct Mapfile *attrmap);
void output_tilemap_file(const struct Options *opts,
const struct Tilemap *tilemap);
const struct Mapfile *tilemap);
void output_attrmap_file(const struct Options *opts,
const struct Mapfile *attrmap);
void output_palette_file(const struct Options *opts,
const struct RawIndexedImage *raw_image);

View File

@@ -21,10 +21,13 @@ struct Options {
bool hardfix;
bool fix;
bool horizontal;
bool mirror;
bool unique;
int trim;
char *mapfile;
bool mapout;
char *tilemapfile;
bool tilemapout;
char *attrmapfile;
bool attrmapout;
char *palfile;
bool palout;
char *outfile;
@@ -40,8 +43,10 @@ struct RGBColor {
struct ImageOptions {
bool horizontal;
int trim;
char *mapfile;
bool mapout;
char *tilemapfile;
bool tilemapout;
char *attrmapfile;
bool attrmapout;
char *palfile;
bool palout;
};
@@ -71,7 +76,7 @@ struct GBImage {
int trim;
};
struct Tilemap {
struct Mapfile {
uint8_t *data;
int size;
};

View File

@@ -85,8 +85,87 @@ int get_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles, int tile_size)
return -1;
}
void create_tilemap(const struct Options *opts, struct GBImage *gb,
struct Tilemap *tilemap)
uint8_t reverse_bits(uint8_t b)
{
uint8_t rev = 0;
rev |= (b & 0x80) >> 7;
rev |= (b & 0x40) >> 5;
rev |= (b & 0x20) >> 3;
rev |= (b & 0x10) >> 1;
rev |= (b & 0x08) << 1;
rev |= (b & 0x04) << 3;
rev |= (b & 0x02) << 5;
rev |= (b & 0x01) << 7;
return rev;
}
void xflip(uint8_t *tile, uint8_t *tile_xflip, int tile_size)
{
int i;
for (i = 0; i < tile_size; i++)
tile_xflip[i] = reverse_bits(tile[i]);
}
void yflip(uint8_t *tile, uint8_t *tile_yflip, int tile_size)
{
int i;
for (i = 0; i < tile_size; i++)
tile_yflip[i] = tile[(tile_size - i - 1) ^ (depth - 1)];
}
/*
* get_mirrored_tile_index looks for `tile` in tile array `tiles`, also
* checking x-, y-, and xy-mirrored versions of `tile`. If one is found,
* `*flags` is set according to the type of mirroring and the index of the
* matched tile is returned. If no match is found, -1 is returned.
*/
int get_mirrored_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles,
int tile_size, int *flags)
{
int index;
uint8_t *tile_xflip;
uint8_t *tile_yflip;
index = get_tile_index(tile, tiles, num_tiles, tile_size);
if (index >= 0) {
*flags = 0;
return index;
}
tile_yflip = malloc(tile_size);
yflip(tile, tile_yflip, tile_size);
index = get_tile_index(tile_yflip, tiles, num_tiles, tile_size);
if (index >= 0) {
*flags = YFLIP;
free(tile_yflip);
return index;
}
tile_xflip = malloc(tile_size);
xflip(tile, tile_xflip, tile_size);
index = get_tile_index(tile_xflip, tiles, num_tiles, tile_size);
if (index >= 0) {
*flags = XFLIP;
free(tile_yflip);
free(tile_xflip);
return index;
}
yflip(tile_xflip, tile_yflip, tile_size);
index = get_tile_index(tile_yflip, tiles, num_tiles, tile_size);
if (index >= 0)
*flags = XFLIP | YFLIP;
free(tile_yflip);
free(tile_xflip);
return index;
}
void create_mapfiles(const struct Options *opts, struct GBImage *gb,
struct Mapfile *tilemap, struct Mapfile *attrmap)
{
int i, j;
int gb_i;
@@ -94,6 +173,7 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
int max_tiles;
int num_tiles;
int index;
int flags;
int gb_size;
uint8_t *tile;
uint8_t **tiles;
@@ -109,19 +189,33 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
tiles = calloc(max_tiles, sizeof(uint8_t *));
num_tiles = 0;
if (*opts->tilemapfile) {
tilemap->data = calloc(max_tiles, sizeof(uint8_t));
tilemap->size = 0;
}
if (*opts->attrmapfile) {
attrmap->data = calloc(max_tiles, sizeof(uint8_t));
attrmap->size = 0;
}
gb_i = 0;
while (gb_i < gb_size) {
flags = 0;
tile = malloc(tile_size);
for (i = 0; i < tile_size; i++) {
tile[i] = gb->data[gb_i];
gb_i++;
}
if (opts->unique) {
if (opts->mirror) {
index = get_mirrored_tile_index(tile, tiles, num_tiles,
tile_size, &flags);
} else {
index = get_tile_index(tile, tiles, num_tiles,
tile_size);
}
if (index < 0) {
index = num_tiles;
tiles[num_tiles] = tile;
@@ -132,9 +226,15 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
tiles[num_tiles] = tile;
num_tiles++;
}
if (*opts->tilemapfile) {
tilemap->data[tilemap->size] = index;
tilemap->size++;
}
if (*opts->attrmapfile) {
attrmap->data[attrmap->size] = flags;
attrmap->size++;
}
}
if (opts->unique) {
free(gb->data);
@@ -154,19 +254,35 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
}
void output_tilemap_file(const struct Options *opts,
const struct Tilemap *tilemap)
const struct Mapfile *tilemap)
{
FILE *f;
f = fopen(opts->mapfile, "wb");
f = fopen(opts->tilemapfile, "wb");
if (!f)
err(1, "Opening tilemap file '%s' failed", opts->mapfile);
err(1, "Opening tilemap file '%s' failed", opts->tilemapfile);
fwrite(tilemap->data, 1, tilemap->size, f);
fclose(f);
if (opts->mapout)
free(opts->mapfile);
if (opts->tilemapout)
free(opts->tilemapfile);
}
void output_attrmap_file(const struct Options *opts,
const struct Mapfile *attrmap)
{
FILE *f;
f = fopen(opts->attrmapfile, "wb");
if (!f)
err(1, "Opening attrmap file '%s' failed", opts->attrmapfile);
fwrite(attrmap->data, 1, attrmap->size, f);
fclose(f);
if (opts->attrmapout)
free(opts->attrmapfile);
}
void output_palette_file(const struct Options *opts,

View File

@@ -18,8 +18,8 @@
static void print_usage(void)
{
printf(
"usage: rgbgfx [-DFfhPTuVv] [-d #] [-o outfile] [-p palfile] [-t mapfile]\n"
" [-x #] infile\n");
"usage: rgbgfx [-ADFfhmPTuVv] [-o outfile] [-a attrmap] [-d #] [-p palfile]\n"
" [-t tilemap] [-x #] infile\n");
exit(1);
}
@@ -30,21 +30,29 @@ int main(int argc, char *argv[])
struct ImageOptions png_options = {0};
struct RawIndexedImage *raw_image;
struct GBImage gb = {0};
struct Tilemap tilemap = {0};
struct Mapfile tilemap = {0};
struct Mapfile attrmap = {0};
char *ext;
const char *errmsg = "Warning: The PNG's %s setting is not the same as the setting defined on the command line.";
if (argc == 1)
print_usage();
opts.mapfile = "";
opts.tilemapfile = "";
opts.attrmapfile = "";
opts.palfile = "";
opts.outfile = "";
depth = 2;
while ((ch = getopt(argc, argv, "Dd:Ffho:Tt:uPp:Vvx:")) != -1) {
while ((ch = getopt(argc, argv, "Aa:Dd:Ffhmo:Tt:uPp:Vvx:")) != -1) {
switch (ch) {
case 'A':
opts.attrmapout = true;
break;
case 'a':
opts.attrmapfile = optarg;
break;
case 'D':
opts.debug = true;
break;
@@ -60,6 +68,10 @@ int main(int argc, char *argv[])
case 'h':
opts.horizontal = true;
break;
case 'm':
opts.mirror = true;
opts.unique = true;
break;
case 'o':
opts.outfile = optarg;
break;
@@ -70,10 +82,10 @@ int main(int argc, char *argv[])
opts.palfile = optarg;
break;
case 'T':
opts.mapout = true;
opts.tilemapout = true;
break;
case 't':
opts.mapfile = optarg;
opts.tilemapfile = optarg;
break;
case 'u':
opts.unique = true;
@@ -107,7 +119,8 @@ int main(int argc, char *argv[])
raw_image = input_png_file(&opts, &png_options);
png_options.mapfile = "";
png_options.tilemapfile = "";
png_options.attrmapfile = "";
png_options.palfile = "";
if (png_options.horizontal != opts.horizontal) {
@@ -148,25 +161,45 @@ int main(int argc, char *argv[])
(raw_image->width / 8) * (raw_image->height / 8) - 1);
}
if (strcmp(png_options.mapfile, opts.mapfile) != 0) {
if (strcmp(png_options.tilemapfile, opts.tilemapfile) != 0) {
if (opts.verbose)
warnx(errmsg, "tilemap file");
if (opts.hardfix)
png_options.mapfile = opts.mapfile;
png_options.tilemapfile = opts.tilemapfile;
}
if (!*opts.mapfile)
opts.mapfile = png_options.mapfile;
if (!*opts.tilemapfile)
opts.tilemapfile = png_options.tilemapfile;
if (png_options.mapout != opts.mapout) {
if (png_options.tilemapout != opts.tilemapout) {
if (opts.verbose)
warnx(errmsg, "tilemap file");
if (opts.hardfix)
png_options.mapout = opts.mapout;
png_options.tilemapout = opts.tilemapout;
}
if (png_options.mapout)
opts.mapout = png_options.mapout;
if (png_options.tilemapout)
opts.tilemapout = png_options.tilemapout;
if (strcmp(png_options.attrmapfile, opts.attrmapfile) != 0) {
if (opts.verbose)
warnx(errmsg, "attrmap file");
if (opts.hardfix)
png_options.attrmapfile = opts.attrmapfile;
}
if (!*opts.attrmapfile)
opts.attrmapfile = png_options.attrmapfile;
if (png_options.attrmapout != opts.attrmapout) {
if (opts.verbose)
warnx(errmsg, "attrmap file");
if (opts.hardfix)
png_options.attrmapout = opts.attrmapout;
}
if (png_options.attrmapout)
opts.attrmapout = png_options.attrmapout;
if (strcmp(png_options.palfile, opts.palfile) != 0) {
if (opts.verbose)
@@ -189,19 +222,35 @@ int main(int argc, char *argv[])
if (png_options.palout)
opts.palout = png_options.palout;
if (!*opts.mapfile && opts.mapout) {
if (!*opts.tilemapfile && opts.tilemapout) {
ext = strrchr(opts.infile, '.');
if (ext != NULL) {
size = ext - opts.infile + 9;
opts.mapfile = malloc(size);
strncpy(opts.mapfile, opts.infile, size);
*strrchr(opts.mapfile, '.') = '\0';
strcat(opts.mapfile, ".tilemap");
opts.tilemapfile = malloc(size);
strncpy(opts.tilemapfile, opts.infile, size);
*strrchr(opts.tilemapfile, '.') = '\0';
strcat(opts.tilemapfile, ".tilemap");
} else {
opts.mapfile = malloc(strlen(opts.infile) + 9);
strcpy(opts.mapfile, opts.infile);
strcat(opts.mapfile, ".tilemap");
opts.tilemapfile = malloc(strlen(opts.infile) + 9);
strcpy(opts.tilemapfile, opts.infile);
strcat(opts.tilemapfile, ".tilemap");
}
}
if (!*opts.attrmapfile && opts.attrmapout) {
ext = strrchr(opts.infile, '.');
if (ext != NULL) {
size = ext - opts.infile + 9;
opts.attrmapfile = malloc(size);
strncpy(opts.attrmapfile, opts.infile, size);
*strrchr(opts.attrmapfile, '.') = '\0';
strcat(opts.attrmapfile, ".attrmap");
} else {
opts.attrmapfile = malloc(strlen(opts.infile) + 9);
strcpy(opts.attrmapfile, opts.infile);
strcat(opts.attrmapfile, ".attrmap");
}
}
@@ -226,17 +275,20 @@ int main(int argc, char *argv[])
gb.trim = opts.trim;
gb.horizontal = opts.horizontal;
if (*opts.outfile || *opts.mapfile) {
if (*opts.outfile || *opts.tilemapfile || *opts.attrmapfile) {
raw_to_gb(raw_image, &gb);
create_tilemap(&opts, &gb, &tilemap);
create_mapfiles(&opts, &gb, &tilemap, &attrmap);
}
if (*opts.outfile)
output_file(&opts, &gb);
if (*opts.mapfile)
if (*opts.tilemapfile)
output_tilemap_file(&opts, &tilemap);
if (*opts.attrmapfile)
output_attrmap_file(&opts, &attrmap);
if (*opts.palfile)
output_palette_file(&opts, raw_image);

View File

@@ -649,10 +649,16 @@ static void get_text(const struct PNGImage *img,
png_options->trim = strtoul(text[i].text, NULL, 0);
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
} else if (strcmp(text[i].key, "t") == 0) {
png_options->mapfile = text[i].text;
png_options->tilemapfile = text[i].text;
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
} else if (strcmp(text[i].key, "T") == 0 && !*text[i].text) {
png_options->mapout = true;
png_options->tilemapout = true;
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
} else if (strcmp(text[i].key, "a") == 0) {
png_options->attrmapfile = text[i].text;
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
} else if (strcmp(text[i].key, "A") == 0 && !*text[i].text) {
png_options->attrmapout = true;
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
} else if (strcmp(text[i].key, "p") == 0) {
png_options->palfile = text[i].text;
@@ -699,18 +705,30 @@ static void set_text(const struct PNGImage *img,
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(img->png, img->info, text, 1);
}
if (*png_options->mapfile) {
if (*png_options->tilemapfile) {
text[0].key = "t";
text[0].text = "";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(img->png, img->info, text, 1);
}
if (png_options->mapout) {
if (png_options->tilemapout) {
text[0].key = "T";
text[0].text = "";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(img->png, img->info, text, 1);
}
if (*png_options->attrmapfile) {
text[0].key = "a";
text[0].text = "";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(img->png, img->info, text, 1);
}
if (png_options->attrmapout) {
text[0].key = "A";
text[0].text = "";
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
png_set_text(img->png, img->info, text, 1);
}
if (*png_options->palfile) {
text[0].key = "p";
text[0].text = "";

View File

@@ -13,11 +13,12 @@
.Nd Game Boy graphics converter
.Sh SYNOPSIS
.Nm rgbgfx
.Op Fl DfFhPTVv
.Op Fl ADfFhmPTuVv
.Op Fl o Ar outfile
.Op Fl a Ar attrmap
.Op Fl d Ar depth
.Op Fl p Ar palfile
.Op Fl t Ar mapfile
.Op Fl t Ar tilemap
.Op Fl x Ar tiles
.Ar file
.Sh DESCRIPTION
@@ -47,6 +48,19 @@ The input image may not contain more colors than the selected bit depth
allows. Transparent pixels are set to palette index 0.
.Sh ARGUMENTS
.Bl -tag -width Ds
.It Fl a Ar attrmap
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
.Fl m
to keep track the mirror direction of mirrored duplicate tiles.
.It Fl A
Same as
.Fl a ,
but the attrmap file output name is made by taking the input filename, removing
the file extension, and appending
.Pa .attrmap .
.It Fl D
Debug features are enabled.
.It Fl f
@@ -61,6 +75,12 @@ The bit depth of the output image (either 1 or 2).
By default, the bit depth is 2 (two bits per pixel).
.It Fl h
Lay out tiles horizontally rather than vertically.
.It Fl m
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
.Fl u .
.It Fl o Ar outfile
The name of the output file.
.It Fl p Ar palfile
@@ -74,17 +94,24 @@ Same as
but the palette file output name is made by taking the input PNG file's
filename, removing the file extension, and appending
.Pa .pal .
.It Fl t Ar mapfile
If any tiles are the same, don't place the repeat tiles in the output file, and
make a tilemap file.
.It Fl t Ar tilemap
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
.Fl u
or
.Fl m
to keep track of duplicate tiles.
.It Fl T
Same as
.Fl t ,
but the tilemap file output name is made by taking the input filename,
removing the file extension, and appending
but the tilemap file output name is made by taking the input filename, removing
the file extension, and appending
.Pa .tilemap .
.It Fl u
Truncate repeated tiles. Useful with tilemaps.
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.
.It Fl V
Print the version of the program and exit.
.It Fl v
@@ -105,6 +132,14 @@ The following creates a planar 2bpp file with only unique tiles, and its tilemap
.Pp
.D1 $ rgbgfx -T -u -o out.2bpp in.png
.Pp
The following creates a planar 2bpp file with only unique tiles (accounting for
tile mirroring) and its associated tilemap
.Pa out.tilemap
and attrmap
.Pa out.attrmap :
.Pp
.D1 $ rgbgfx -A -T -m -o out.2bpp in.png
.Pp
The following will do nothing:
.Pp
.D1 $ rgbgfx in.png