mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
Merge pull request #346 from qguv/tilemap-mirrored-duplicates
gfx: Add mirrored tile check when generating tilemap
This commit is contained in:
@@ -36,6 +36,8 @@ Other contributors
|
|||||||
|
|
||||||
- The OpenBSD Project <http://www.openbsd.org>
|
- The OpenBSD Project <http://www.openbsd.org>
|
||||||
|
|
||||||
|
- Quint Guvernator <quint@guvernator.net>
|
||||||
|
|
||||||
- Sanqui <gsanky@gmail.com>
|
- Sanqui <gsanky@gmail.com>
|
||||||
|
|
||||||
- YamaArashi <shadow962@live.com>
|
- YamaArashi <shadow962@live.com>
|
||||||
|
|||||||
2758
docs/gbz80.7.html
2758
docs/gbz80.7.html
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBASM(1)</title>
|
<title>RGBASM(1)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,133 +21,105 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbasm</b> — <span class="Nd" title="Nd">Game
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
Boy assembler</span>
|
<code class="Nm">rgbasm</code> —
|
||||||
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
<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">
|
<table class="Nm">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b class="Nm" title="Nm">rgbasm</b></td>
|
<td><code class="Nm">rgbasm</code></td>
|
||||||
<td>[<span class="Op"><b class="Fl" title="Fl">-EhLVvw</b></span>]
|
<td>[<code class="Fl">-EhLVvw</code>] [<code class="Fl">-b</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-b</b>
|
<var class="Ar">chars</var>] [<code class="Fl">-D</code>
|
||||||
<var class="Ar" title="Ar">chars</var></span>]
|
<var class="Ar">name</var>[=<var class="Ar">value</var>]]
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-D</b>
|
[<code class="Fl">-g</code> <var class="Ar">chars</var>]
|
||||||
<var class="Ar" title="Ar">name</var>[<span class="Op">=<var class="Ar" title="Ar">value</var></span>]</span>]
|
[<code class="Fl">-i</code> <var class="Ar">path</var>]
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-g</b>
|
[<code class="Fl">-M</code> <var class="Ar">dependfile</var>]
|
||||||
<var class="Ar" title="Ar">chars</var></span>]
|
[<code class="Fl">-o</code> <var class="Ar">outfile</var>]
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-i</b>
|
[<code class="Fl">-p</code> <var class="Ar">pad_value</var>]
|
||||||
<var class="Ar" title="Ar">path</var></span>]
|
<var class="Ar">file</var></td>
|
||||||
[<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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
</section>
|
||||||
The <b class="Nm" title="Nm">rgbasm</b> program creates an object file from an
|
<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:
|
assembly source file. Its arguments are as follows:
|
||||||
<dl class="Bl-tag">
|
<dl class="Bl-tag">
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#b"><code class="Fl" id="b">-b</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">chars</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#b"><b class="Fl" title="Fl" id="b">-b</b></a>
|
<dd>Change the two characters used for binary constants. The defaults are
|
||||||
<var class="Ar" title="Ar">chars</var></dt>
|
01.</dd>
|
||||||
<dd class="It-tag">Change the two characters used for binary constants. The
|
<dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a>
|
||||||
defaults are 01.</dd>
|
<var class="Ar">name</var>[=<var class="Ar">value</var>]</dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Add string symbol to the compiled source code. This is equivalent to
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">name</var> <code class="Cm">EQUS</code>
|
||||||
<dt class="It-tag"><a class="selflink" href="#D"><b class="Fl" title="Fl" id="D">-D</b></a>
|
“<var class="Ar">value</var>” in code. If a value is not
|
||||||
<var class="Ar" title="Ar">name</var>[<span class="Op">=<var class="Ar" title="Ar">value</var></span>]</dt>
|
specified, a value of 1 is given.</dd>
|
||||||
<dd class="It-tag">Add string symbol to the compiled source code. This is
|
<dt><a class="permalink" href="#E"><code class="Fl" id="E">-E</code></a></dt>
|
||||||
equivalent to <var class="Ar" title="Ar">name</var>
|
<dd>Export all labels, including unreferenced and local labels.</dd>
|
||||||
<b class="Cm" title="Cm">EQUS</b>
|
<dt><a class="permalink" href="#g"><code class="Fl" id="g">-g</code></a>
|
||||||
“<var class="Ar" title="Ar">value</var>” in code. If a value
|
<var class="Ar">chars</var></dt>
|
||||||
is not specified, a value of 1 is given.</dd>
|
<dd>Change the four characters used for binary constants. The defaults are
|
||||||
<dt class="It-tag"> </dt>
|
0123.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#E"><b class="Fl" title="Fl" id="E">-E</b></a></dt>
|
<dd>By default, <code class="Nm">rgbasm</code> inserts a ‘nop’
|
||||||
<dd class="It-tag">Export all labels, including unreferenced and local
|
instruction immediately after any ‘halt’ instruction. The
|
||||||
labels.</dd>
|
<code class="Fl">-h</code> option disables this behavior.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">path</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#g"><b class="Fl" title="Fl" id="g">-g</b></a>
|
<dd>Add an include path.</dd>
|
||||||
<var class="Ar" title="Ar">chars</var></dt>
|
<dt><a class="permalink" href="#L"><code class="Fl" id="L">-L</code></a></dt>
|
||||||
<dd class="It-tag">Change the four characters used for binary constants. The
|
<dd>Disable the optimization that turns loads of the form <b class="Sy">LD
|
||||||
defaults are 0123.</dd>
|
[$FF00+n8],A</b> into the opcode <b class="Sy">LDH [$FF00+n8],A</b> in
|
||||||
<dt class="It-tag"> </dt>
|
order to have full control of the result in the final ROM.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#M"><code class="Fl" id="M">-M</code></a>
|
||||||
<dt class="It-tag"><a class="selflink" href="#h"><b class="Fl" title="Fl" id="h">-h</b></a></dt>
|
<var class="Ar">dependfile</var></dt>
|
||||||
<dd class="It-tag">By default, <b class="Nm" title="Nm">rgbasm</b> inserts a
|
<dd>Print <a class="Xr">make(1)</a> dependencies to
|
||||||
‘nop’ instruction immediately after any ‘halt’
|
<var class="Ar">dependfile</var>.</dd>
|
||||||
instruction. The <b class="Fl" title="Fl">-h</b> option disables this
|
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
|
||||||
behavior.</dd>
|
<var class="Ar">outfile</var></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Write an object file to the given filename.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
||||||
<dt class="It-tag"><a class="selflink" href="#i"><b class="Fl" title="Fl" id="i">-i</b></a>
|
<var class="Ar">pad_value</var></dt>
|
||||||
<var class="Ar" title="Ar">path</var></dt>
|
<dd>When padding an image, pad with this value. The default is 0x00.</dd>
|
||||||
<dd class="It-tag">Add an include path.</dd>
|
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Print the version of the program and exit.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#L"><b class="Fl" title="Fl" id="L">-L</b></a></dt>
|
<dd>Be verbose.</dd>
|
||||||
<dd class="It-tag">Disable the optimization that turns loads of the form
|
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
|
||||||
<b class="Sy" title="Sy">LD [$FF00+n8],A</b> into the opcode
|
<dd>Disable warning output.</dd>
|
||||||
<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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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>
|
|
||||||
</dl>
|
</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:
|
Assembling a basic source file is simple:
|
||||||
<div class="Pp"></div>
|
<div class="Bd Pp Bd-indent">
|
||||||
<div class="Bd" style="margin-left: 5.00ex;">
|
<pre>
|
||||||
<pre class="Li">
|
|
||||||
$ rgbasm -o bar.o foo.asm
|
$ rgbasm -o bar.o foo.asm
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The resulting object file is not yet a usable ROM image —
|
||||||
The resulting object file is not yet a usable ROM image — it must first
|
it must first be run through <a class="Xr">rgblink(1)</a> and
|
||||||
be run through <a class="Xr" title="Xr">rgblink(1)</a> and
|
<a class="Xr">rgbfix(1)</a>.</p>
|
||||||
<a class="Xr" title="Xr">rgbfix(1)</a>.
|
</section>
|
||||||
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
<section class="Sh">
|
||||||
|
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||||
ALSO</a></h1>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(5)</a>, <a class="Xr" title="Xr">rgbfix(1)</a>,
|
<a class="Xr">rgbasm(5)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(5)</a>, <a class="Xr" title="Xr">rgbds(7)</a>,
|
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a>
|
||||||
<a class="Xr" title="Xr">gbz80(7)</a>
|
</section>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbasm</b> was originally written by Carsten
|
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||||
Sørensen as part of the ASMotor package, and was later packaged in
|
<code class="Nm">rgbasm</code> was originally written by Carsten Sørensen
|
||||||
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
|
as part of the ASMotor package, and was later packaged in RGBDS by Justin
|
||||||
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">February 24, 2018</td>
|
<td class="foot-date">February 24, 2018</td>
|
||||||
|
|||||||
1953
docs/rgbasm.5.html
1953
docs/rgbasm.5.html
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBDS(5)</title>
|
<title>RGBDS(5)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,27 +21,29 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbds</b> — <span class="Nd" title="Nd">object
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
file format documentation</span>
|
<code class="Nm">rgbds</code> —
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
<div class="Nd">object file format documentation</div>
|
||||||
This is the description of the object files used by
|
</section>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a> and
|
<section class="Sh">
|
||||||
<a class="Xr" title="Xr">rgblink(1)</a>. Please, note that the specifications
|
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
||||||
may change. This toolchain is in development and new features may require
|
This is the description of the object files used by <a class="Xr">rgbasm(1)</a>
|
||||||
adding more information to the current format, or modifying some fields, which
|
and <a class="Xr">rgblink(1)</a>. Please, note that the specifications may
|
||||||
would break compatibility with older versions.
|
change. This toolchain is in development and new features may require adding
|
||||||
<h1 class="Sh" title="Sh" id="FILE_STRUCTURE"><a class="selflink" href="#FILE_STRUCTURE">FILE
|
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>
|
STRUCTURE</a></h1>
|
||||||
The following types are used:
|
The following types are used:
|
||||||
<div class="Pp"></div>
|
<p class="Pp"><var class="Ar">LONG</var> is a 32‐bit integer stored in
|
||||||
<var class="Ar" title="Ar">LONG</var> is a 32‐bit integer stored in
|
little‐endian format (Intel). <var class="Ar">BYTE</var> is an
|
||||||
little‐endian format (Intel). <var class="Ar" title="Ar">BYTE</var> is
|
8‐bit integer. <var class="Ar">STRING</var> is a 0‐terminated
|
||||||
an 8‐bit integer. <var class="Ar" title="Ar">STRING</var> is a
|
string of <var class="Ar">BYTE</var>.</p>
|
||||||
0‐terminated string of <var class="Ar" title="Ar">BYTE</var>.
|
<div class="Bd Pp">
|
||||||
<div class="Pp"></div>
|
<pre>
|
||||||
<div class="Bd" style="margin-left: 0.00ex;">
|
|
||||||
<pre class="Li">
|
|
||||||
; Header
|
; Header
|
||||||
|
|
||||||
BYTE ID[4] ; "RGB6"
|
BYTE ID[4] ; "RGB6"
|
||||||
@@ -55,7 +58,7 @@ REPT NumberOfSymbols ; Number of symbols defined in this object file.
|
|||||||
; as "Scope.Symbol".
|
; as "Scope.Symbol".
|
||||||
|
|
||||||
BYTE Type ; 0 = LOCAL symbol only used in this file.
|
BYTE Type ; 0 = LOCAL symbol only used in this file.
|
||||||
; 1 = IMPORT this symbol from elsewhere (unused).
|
; 1 = IMPORT this symbol from elsewhere
|
||||||
; 2 = EXPORT this symbol to other objects.
|
; 2 = EXPORT this symbol to other objects.
|
||||||
|
|
||||||
IF Type != 1 ; If symbol is defined in this object file.
|
IF Type != 1 ; If symbol is defined in this object file.
|
||||||
@@ -137,7 +140,8 @@ REPT NumberOfSections
|
|||||||
ENDR
|
ENDR
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</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>
|
DATA</a></h2>
|
||||||
Expressions in the object file are stored as RPN. This is an expression of the
|
Expressions in the object file are stored as RPN. This is an expression of the
|
||||||
form “2 5 +”. This will first push the value “2”
|
form “2 5 +”. This will first push the value “2”
|
||||||
@@ -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,
|
effectively replacing the two top arguments with their sum. In the RGB format,
|
||||||
RPN expressions are stored as BYTEs with some bytes being special prefixes for
|
RPN expressions are stored as BYTEs with some bytes being special prefixes for
|
||||||
integers and symbols.
|
integers and symbols.
|
||||||
<table class="Bl-column" style="margin-left: 6.00ex;">
|
<table class="Bl-column Bd-indent">
|
||||||
<colgroup>
|
<tr>
|
||||||
<col style="width: 15.00ex;"/>
|
<td><b class="Sy">Value</b></td>
|
||||||
<col style="min-width: 10.00ex;"/>
|
<td><b class="Sy">Meaning</b></td>
|
||||||
</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>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$00"><code class="Li" id="$00">$00</code></a></td>
|
<td><a class="permalink" href="#$00"><code class="Li" id="$00">$00</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#+_operator"><code class="Li" id="+_operator">+
|
<td><a class="permalink" href="#+_operator"><code class="Li" id="+_operator">+
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$01"><code class="Li" id="$01">$01</code></a></td>
|
<td><a class="permalink" 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">-
|
<td><a class="permalink" href="#-_operator"><code class="Li" id="-_operator">-
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$02"><code class="Li" id="$02">$02</code></a></td>
|
<td><a class="permalink" 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">*
|
<td><a class="permalink" href="#*_operator"><code class="Li" id="*_operator">*
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$03"><code class="Li" id="$03">$03</code></a></td>
|
<td><a class="permalink" 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">/
|
<td><a class="permalink" href="#/_operator"><code class="Li" id="/_operator">/
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$04"><code class="Li" id="$04">$04</code></a></td>
|
<td><a class="permalink" 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">%
|
<td><a class="permalink" href="#__operator"><code class="Li" id="__operator">%
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$05"><code class="Li" id="$05">$05</code></a></td>
|
<td><a class="permalink" 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
|
<td><a class="permalink" href="#unary_-"><code class="Li" id="unary_-">unary
|
||||||
-</code></a></td>
|
-</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$10"><code class="Li" id="$10">$10</code></a></td>
|
<td><a class="permalink" href="#$10"><code class="Li" id="$10">$10</code></a></td>
|
||||||
<td class="It-column">|
|
<td>|
|
||||||
<a class="selflink" href="#operator"><code class="Li" id="operator">operator</code></a></td>
|
<a class="permalink" href="#operator"><code class="Li" id="operator">operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$11"><code class="Li" id="$11">$11</code></a></td>
|
<td><a class="permalink" href="#$11"><code class="Li" id="$11">$11</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#&_operator"><code class="Li" id="&_operator">&
|
<td><a class="permalink" href="#&_operator"><code class="Li" id="&_operator">&
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$12"><code class="Li" id="$12">$12</code></a></td>
|
<td><a class="permalink" 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">^
|
<td><a class="permalink" href="#__operator_2"><code class="Li" id="__operator_2">^
|
||||||
operator</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$13"><code class="Li" id="$13">$13</code></a></td>
|
<td><a class="permalink" 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
|
<td><a class="permalink" href="#unary_~"><code class="Li" id="unary_~">unary
|
||||||
~</code></a></td>
|
~</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$21"><code class="Li" id="$21">$21</code></a></td>
|
<td><a class="permalink" href="#$21"><code class="Li" id="$21">$21</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#&&_comparison"><code class="Li" id="&&_comparison">&&
|
<td><a class="permalink" href="#&&_comparison"><code class="Li" id="&&_comparison">&&
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$22"><code class="Li" id="$22">$22</code></a></td>
|
<td><a class="permalink" 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">||
|
<td><a class="permalink" href="#___comparison"><code class="Li" id="___comparison">||
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$23"><code class="Li" id="$23">$23</code></a></td>
|
<td><a class="permalink" 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>
|
<td><a class="permalink" href="#unary"><code class="Li" id="unary">unary</code></a>!</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$30"><code class="Li" id="$30">$30</code></a></td>
|
<td><a class="permalink" 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">==
|
<td><a class="permalink" href="#==_comparison"><code class="Li" id="==_comparison">==
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$31"><code class="Li" id="$31">$31</code></a></td>
|
<td><a class="permalink" 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">!=
|
<td><a class="permalink" href="#!=_comparison"><code class="Li" id="!=_comparison">!=
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$32"><code class="Li" id="$32">$32</code></a></td>
|
<td><a class="permalink" href="#$32"><code class="Li" id="$32">$32</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#>_comparison"><code class="Li" id=">_comparison">>
|
<td><a class="permalink" href="#__comparison"><code class="Li" id="__comparison">>
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$33"><code class="Li" id="$33">$33</code></a></td>
|
<td><a class="permalink" href="#$33"><code class="Li" id="$33">$33</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#<_comparison"><code class="Li" id="<_comparison"><
|
<td><a class="permalink" href="#__comparison_2"><code class="Li" id="__comparison_2"><
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$34"><code class="Li" id="$34">$34</code></a></td>
|
<td><a class="permalink" href="#$34"><code class="Li" id="$34">$34</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#>=_comparison"><code class="Li" id=">=_comparison">>=
|
<td><a class="permalink" href="#_=_comparison"><code class="Li" id="_=_comparison">>=
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$35"><code class="Li" id="$35">$35</code></a></td>
|
<td><a class="permalink" href="#$35"><code class="Li" id="$35">$35</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#<=_comparison"><code class="Li" id="<=_comparison"><=
|
<td><a class="permalink" href="#_=_comparison_2"><code class="Li" id="_=_comparison_2"><=
|
||||||
comparison</code></a></td>
|
comparison</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$40"><code class="Li" id="$40">$40</code></a></td>
|
<td><a class="permalink" href="#$40"><code class="Li" id="$40">$40</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#<<_comparison"><code class="Li" id="<<_comparison"><<
|
<td><a class="permalink" href="#___operator"><code class="Li" id="___operator"><<
|
||||||
comparison</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$41"><code class="Li" id="$41">$41</code></a></td>
|
<td><a class="permalink" href="#$41"><code class="Li" id="$41">$41</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#>>_comparison"><code class="Li" id=">>_comparison">>>
|
<td><a class="permalink" href="#___operator_2"><code class="Li" id="___operator_2">>>
|
||||||
comparison</code></a></td>
|
operator</code></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$50"><code class="Li" id="$50">$50</code></a></td>
|
<td><a class="permalink" href="#$50"><code class="Li" id="$50">$50</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#BANK(symbol),"><code class="Li" id="BANK(symbol),">BANK(symbol),</code></a>
|
<td><a class="permalink" href="#BANK(symbol),"><code class="Li" id="BANK(symbol),">BANK(symbol),</code></a>
|
||||||
a <var class="Ar" title="Ar">LONG</var> Symbol ID follows.</td>
|
a <var class="Ar">LONG</var> Symbol ID follows.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$51"><code class="Li" id="$51">$51</code></a></td>
|
<td><a class="permalink" href="#$51"><code class="Li" id="$51">$51</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#BANK(section_name),"><code class="Li" id="BANK(section_name),">BANK(section_name),</code></a>
|
<td><a class="permalink" href="#BANK(section_name),"><code class="Li" id="BANK(section_name),">BANK(section_name),</code></a>
|
||||||
a null-terminated string follows.</td>
|
a null-terminated string follows.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$52"><code class="Li" id="$52">$52</code></a></td>
|
<td><a class="permalink" href="#$52"><code class="Li" id="$52">$52</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#Current_BANK()"><code class="Li" id="Current_BANK()">Current
|
<td><a class="permalink" href="#Current_BANK()"><code class="Li" id="Current_BANK()">Current
|
||||||
BANK()</code></a>.</td>
|
BANK()</code></a>.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$60"><code class="Li" id="$60">$60</code></a></td>
|
<td><a class="permalink" href="#$60"><code class="Li" id="$60">$60</code></a></td>
|
||||||
<td class="It-column"><a class="selflink" href="#HRAMCheck."><code class="Li" id="HRAMCheck.">HRAMCheck.</code></a>
|
<td><a class="permalink" href="#HRAMCheck."><code class="Li" id="HRAMCheck.">HRAMCheck.</code></a>
|
||||||
Check if the value is in HRAM, AND it with 0xFF.</td>
|
Check if the value is in HRAM, AND it with 0xFF.</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$80"><code class="Li" id="$80">$80</code></a></td>
|
<td><a class="permalink" href="#$80"><code class="Li" id="$80">$80</code></a></td>
|
||||||
<td class="It-column"><var class="Ar" title="Ar">LONG</var> integer
|
<td><var class="Ar">LONG</var> integer follows.</td>
|
||||||
follows.</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="It-column">
|
<tr>
|
||||||
<td class="It-column"><a class="selflink" href="#$81"><code class="Li" id="$81">$81</code></a></td>
|
<td><a class="permalink" href="#$81"><code class="Li" id="$81">$81</code></a></td>
|
||||||
<td class="It-column"><var class="Ar" title="Ar">LONG</var> Symbol ID
|
<td><var class="Ar">LONG</var> Symbol ID follows.</td>
|
||||||
follows.</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(7)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
|
<a class="Xr">rgbds(7)</a>, <a class="Xr">gbz80(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
<b class="Nm" title="Nm">rgbds</b> was originally written by Carsten
|
<section class="Sh">
|
||||||
Sørensen as part of the ASMotor package, and was later packaged in
|
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||||
RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
|
<code class="Nm">rgbds</code> was originally written by Carsten Sørensen
|
||||||
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">January 26, 2018</td>
|
<td class="foot-date">January 26, 2018</td>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBDS(7)</title>
|
<title>RGBDS(7)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,46 +21,52 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbds</b> — <span class="Nd" title="Nd">Rednex
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
Game Boy Development System</span>
|
<code class="Nm">rgbds</code> —
|
||||||
<h1 class="Sh" title="Sh" id="EXAMPLES"><a class="selflink" href="#EXAMPLES">EXAMPLES</a></h1>
|
<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:
|
To get a working ROM image from a single assembly source file:
|
||||||
<div class="Pp"></div>
|
<div class="Bd Pp Bd-indent">
|
||||||
<div class="Bd" style="margin-left: 5.00ex;">
|
<pre>
|
||||||
<pre class="Li">
|
|
||||||
$ rgbasm -o bar.o foo.asm
|
$ rgbasm -o bar.o foo.asm
|
||||||
$ rgblink -o baz.gb bar.o
|
$ rgblink -o baz.gb bar.o
|
||||||
$ rgbfix -v -p 0 baz.gb
|
$ rgbfix -v -p 0 baz.gb
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</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>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgbfix(1)</a>,
|
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(5)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
|
<a class="Xr">gbz80(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
|
<section class="Sh">
|
||||||
|
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||||
<dl class="Bl-ohang">
|
<dl class="Bl-ohang">
|
||||||
<dt class="It-ohang"></dt>
|
<dt></dt>
|
||||||
<dd class="It-ohang">1997, Carsten Sørensen (AKA SurfSmurf) writes
|
<dd>1997, Carsten Sørensen (AKA SurfSmurf) writes ASMotor as a
|
||||||
ASMotor as a general-purpose assembler/linker system for DOS/Win32.</dd>
|
general-purpose assembler/linker system for DOS/Win32.</dd>
|
||||||
<dt class="It-ohang"></dt>
|
<dt></dt>
|
||||||
<dd class="It-ohang">1999, Justin Lloyd (AKA Otaku no Zoku) adapts ASMotor to
|
<dd>1999, Justin Lloyd (AKA Otaku no Zoku) adapts ASMotor to read and produce
|
||||||
read and produce GBZ80 assembly/machine code, and releases this version as
|
GBZ80 assembly/machine code, and releases this version as RGBDS.</dd>
|
||||||
RGBDS.</dd>
|
<dt></dt>
|
||||||
<dt class="It-ohang"></dt>
|
<dd>2009, Vegard Nossum adapts the code to be more UNIX-like and releases this
|
||||||
<dd class="It-ohang">2009, Vegard Nossum adapts the code to be more UNIX-like
|
version as rgbds-linux on GitHub.</dd>
|
||||||
and releases this version as rgbds-linux on GitHub.</dd>
|
<dt></dt>
|
||||||
<dt class="It-ohang"></dt>
|
<dd>2010, Anthony J. Bentley forks that repository. The fork becomes the
|
||||||
<dd class="It-ohang">2010, Anthony J. Bentley forks that repository. The fork
|
reference implementation of rgbds.</dd>
|
||||||
becomes the reference implementation of rgbds.</dd>
|
<dt></dt>
|
||||||
<dt class="It-ohang"></dt>
|
<dd>2017, Bentley's repository is moved to a neutral name. It is now
|
||||||
<dd class="It-ohang">2017, Bentley's repository is moved to a neutral name. It
|
maintained by a number of contributors at
|
||||||
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>
|
||||||
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</dd>
|
<dt></dt>
|
||||||
<dt class="It-ohang"></dt>
|
<dd>2018, codebase relicensed under the MIT license.</dd>
|
||||||
<dd class="It-ohang">2018, codebase relicensed under the MIT license.</dd>
|
|
||||||
</dl>
|
</dl>
|
||||||
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<table class="foot">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBFIX(1)</title>
|
<title>RGBFIX(1)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,189 +21,158 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbfix</b> — <span class="Nd" title="Nd">Game
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
Boy checksum fixer</span>
|
<code class="Nm">rgbfix</code> —
|
||||||
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
<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">
|
<table class="Nm">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b class="Nm" title="Nm">rgbfix</b></td>
|
<td><code class="Nm">rgbfix</code></td>
|
||||||
<td>[<span class="Op"><b class="Fl" title="Fl">-CcjsVv</b></span>]
|
<td>[<code class="Fl">-CcjsVv</code>] [<code class="Fl">-f</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-f</b>
|
<var class="Ar">fix_spec</var>] [<code class="Fl">-i</code>
|
||||||
<var class="Ar" title="Ar">fix_spec</var></span>]
|
<var class="Ar">game_id</var>] [<code class="Fl">-k</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-i</b>
|
<var class="Ar">licensee_str</var>] [<code class="Fl">-l</code>
|
||||||
<var class="Ar" title="Ar">game_id</var></span>]
|
<var class="Ar">licensee_id</var>] [<code class="Fl">-m</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-k</b>
|
<var class="Ar">mbc_type</var>] [<code class="Fl">-n</code>
|
||||||
<var class="Ar" title="Ar">licensee_str</var></span>]
|
<var class="Ar">rom_version</var>] [<code class="Fl">-p</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-l</b>
|
<var class="Ar">pad_value</var>] [<code class="Fl">-r</code>
|
||||||
<var class="Ar" title="Ar">licensee_id</var></span>]
|
<var class="Ar">ram_size</var>] [<code class="Fl">-t</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-m</b>
|
<var class="Ar">title_str</var>] <var class="Ar">file</var></td>
|
||||||
<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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
</section>
|
||||||
The <b class="Nm" title="Nm">rgbfix</b> program changes headers of Game Boy ROM
|
<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
|
images. It also performs other filetype operations, such as truncation. The
|
||||||
arguments are as follows:
|
arguments are as follows:
|
||||||
<dl class="Bl-tag">
|
<dl class="Bl-tag">
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#C"><code class="Fl" id="C">-C</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Set the Game Boy Color–only flag: <span class="Ad">0x143</span> =
|
||||||
<dt class="It-tag"><a class="selflink" href="#C"><b class="Fl" title="Fl" id="C">-C</b></a></dt>
|
0xC0. If both this and the <code class="Fl">-c</code> flag are set, this
|
||||||
<dd class="It-tag">Set the Game Boy Color–only flag:
|
takes precedence.</dd>
|
||||||
<i class="Ad">0x143</i> = 0xC0. If both this and the
|
<dt><a class="permalink" href="#c"><code class="Fl" id="c">-c</code></a></dt>
|
||||||
<b class="Fl" title="Fl">-c</b> flag are set, this takes precedence.</dd>
|
<dd>Set the Game Boy Color–compatible flag:
|
||||||
<dt class="It-tag"> </dt>
|
<span class="Ad">0x143</span> = 0x80. If both this and the
|
||||||
<dd class="It-tag"> </dd>
|
<code class="Fl">-C</code> flag are set, <code class="Fl">-C</code> takes
|
||||||
<dt class="It-tag"><a class="selflink" href="#c"><b class="Fl" title="Fl" id="c">-c</b></a></dt>
|
precedence.</dd>
|
||||||
<dd class="It-tag">Set the Game Boy Color–compatible flag:
|
<dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a>
|
||||||
<i class="Ad">0x143</i> = 0x80. If both this and the
|
<var class="Ar">fix_spec</var></dt>
|
||||||
<b class="Fl" title="Fl">-C</b> flag are set,
|
<dd>Fix certain header values that the Game Boy checks for correctness.
|
||||||
<b class="Fl" title="Fl">-C</b> takes precedence.</dd>
|
Alternatively, intentionally trash these values by writing their binary
|
||||||
<dt class="It-tag"> </dt>
|
inverse instead. <var class="Ar">fix_spec</var> is a string containing any
|
||||||
<dd class="It-tag"> </dd>
|
combination of the following characters:
|
||||||
<dt class="It-tag"><a class="selflink" href="#f"><b class="Fl" title="Fl" id="f">-f</b></a>
|
<p class="Pp"></p>
|
||||||
<var class="Ar" title="Ar">fix_spec</var></dt>
|
<dl class="Bl-tag Bl-compact">
|
||||||
<dd class="It-tag">Fix certain header values that the Game Boy checks for
|
<dt><a class="permalink" href="#l"><code class="Cm" id="l">l</code></a></dt>
|
||||||
correctness. Alternatively, intentionally trash these values by writing
|
<dd>Fix the Nintendo logo
|
||||||
their binary inverse instead. <var class="Ar" title="Ar">fix_spec</var> is
|
(<span class="Ad">0x104</span>–<span class="Ad">0x133</span>).</dd>
|
||||||
a string containing any combination of the following characters:
|
<dt><a class="permalink" href="#L"><code class="Cm" id="L">L</code></a></dt>
|
||||||
<div class="Pp"></div>
|
<dd>Trash the Nintendo logo.</dd>
|
||||||
<dl class="Bl-tag Bl-compact" style="margin-left: 5.40ex;">
|
<dt><a class="permalink" href="#h"><code class="Cm" id="h">h</code></a></dt>
|
||||||
<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>Fix the header checksum (<span class="Ad">0x14D</span>).</dd>
|
||||||
<dd class="It-tag">Fix the Nintendo logo
|
<dt><a class="permalink" href="#H"><code class="Cm" id="H">H</code></a></dt>
|
||||||
(<i class="Ad">0x104</i>–<i class="Ad">0x133</i>).</dd>
|
<dd>Trash the header checksum.</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>
|
<dt><a class="permalink" href="#g"><code class="Cm" id="g">g</code></a></dt>
|
||||||
<dd class="It-tag">Trash the Nintendo logo.</dd>
|
<dd>Fix the global checksum
|
||||||
<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>
|
(<span class="Ad">0x14E</span>–<span class="Ad">0x14F</span>).</dd>
|
||||||
<dd class="It-tag">Fix the header checksum (<i class="Ad">0x14D</i>).</dd>
|
<dt><a class="permalink" href="#G"><code class="Cm" id="G">G</code></a></dt>
|
||||||
<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>Trash the global checksum.</dd>
|
||||||
<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>–<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>
|
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#i"><code class="Fl" id="i">-i</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">game_id</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#i"><b class="Fl" title="Fl" id="i">-i</b></a>
|
<dd>Set the game ID string
|
||||||
<var class="Ar" title="Ar">game_id</var></dt>
|
(<span class="Ad">0x13F</span>–<span class="Ad">0x142</span>) to a
|
||||||
<dd class="It-tag">Set the game ID string
|
given string of exactly 4 characters. If both this and the title are set,
|
||||||
(<i class="Ad">0x13F</i>–<i class="Ad">0x142</i>) to a given string
|
the game ID will overwrite the overlapping portion of the title.</dd>
|
||||||
of exactly 4 characters. If both this and the title are set, the game ID
|
<dt><a class="permalink" href="#j"><code class="Fl" id="j">-j</code></a></dt>
|
||||||
will overwrite the overlapping portion of the title.</dd>
|
<dd>Set the non-Japanese region flag: <span class="Ad">0x14A</span> = 1.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#k"><code class="Fl" id="k">-k</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">licensee_str</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#j"><b class="Fl" title="Fl" id="j">-j</b></a></dt>
|
<dd>Set the new licensee string
|
||||||
<dd class="It-tag">Set the non-Japanese region flag: <i class="Ad">0x14A</i> =
|
(<span class="Ad">0x144</span>–<span class="Ad">0x145</span>) to a
|
||||||
1.</dd>
|
given string, truncated to at most two characters.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#l_2"><code class="Fl" id="l_2">-l</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">licensee_id</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#k"><b class="Fl" title="Fl" id="k">-k</b></a>
|
<dd>Set the old licensee code, <span class="Ad">0x14B</span>, to a given value
|
||||||
<var class="Ar" title="Ar">licensee_str</var></dt>
|
from 0 to 0xFF. This value is deprecated and should be set to 0x33 in all
|
||||||
<dd class="It-tag">Set the new licensee string
|
new software.</dd>
|
||||||
(<i class="Ad">0x144</i>–<i class="Ad">0x145</i>) to a given
|
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
|
||||||
string, truncated to at most two characters.</dd>
|
<var class="Ar">mbc_type</var></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Set the MBC type, <span class="Ad">0x147</span>, to a given value from 0
|
||||||
<dd class="It-tag"> </dd>
|
to 0xFF.</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#l"><b class="Fl" title="Fl" id="l">-l</b></a>
|
<dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
|
||||||
<var class="Ar" title="Ar">licensee_id</var></dt>
|
<var class="Ar">rom_version</var></dt>
|
||||||
<dd class="It-tag">Set the old licensee code, <i class="Ad">0x14B</i>, to a
|
<dd>Set the ROM version, <span class="Ad">0x14C</span>, to a given value from
|
||||||
given value from 0 to 0xFF. This value is deprecated and should be set to
|
0 to 0xFF.</dd>
|
||||||
0x33 in all new software.</dd>
|
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
||||||
<dt class="It-tag"> </dt>
|
<var class="Ar">pad_value</var></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Pad the image to a valid size with a given pad value from 0 to 0xFF.
|
||||||
<dt class="It-tag"><a class="selflink" href="#m"><b class="Fl" title="Fl" id="m">-m</b></a>
|
<code class="Nm">rgbfix</code> will automatically pick a size from 32KiB,
|
||||||
<var class="Ar" title="Ar">mbc_type</var></dt>
|
64KiB, 128KiB, ..., 8192KiB and give a warning thereafter. The cartridge
|
||||||
<dd class="It-tag">Set the MBC type, <i class="Ad">0x147</i>, to a given value
|
size byte (<span class="Ad">0x148</span>) will be changed to reflect this
|
||||||
from 0 to 0xFF.</dd>
|
new size.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#r"><code class="Fl" id="r">-r</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">ram_size</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#n"><b class="Fl" title="Fl" id="n">-n</b></a>
|
<dd>Set the RAM size, <span class="Ad">0x149</span>, to a given value from 0
|
||||||
<var class="Ar" title="Ar">rom_version</var></dt>
|
to 0xFF.</dd>
|
||||||
<dd class="It-tag">Set the ROM version, <i class="Ad">0x14C</i>, to a given
|
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a></dt>
|
||||||
value from 0 to 0xFF.</dd>
|
<dd>Set the SGB flag: <span class="Ad">0x146</span> = 3.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">title</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
|
<dd>Set the title string
|
||||||
<var class="Ar" title="Ar">pad_value</var></dt>
|
(<span class="Ad">0x134</span>–<span class="Ad">0x143</span>) to a
|
||||||
<dd class="It-tag">Pad the image to a valid size with a given pad value from 0
|
given string, truncated to at most 16 characters. It is recommended to use
|
||||||
to 0xFF. <b class="Nm" title="Nm">rgbfix</b> will automatically pick a
|
15 characters instead, to avoid clashing with the CGB flag
|
||||||
size from 32KiB, 64KiB, 128KiB, ..., 8192KiB and give a warning
|
(<code class="Fl">-c</code> or <code class="Fl">-C</code>). If both this
|
||||||
thereafter. The cartridge size byte (<i class="Ad">0x148</i>) will be
|
and the game ID are set, the game ID will overwrite the overlapping
|
||||||
changed to reflect this new size.</dd>
|
portion of the title.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Print the version of the program and exit.</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#r"><b class="Fl" title="Fl" id="r">-r</b></a>
|
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt>
|
||||||
<var class="Ar" title="Ar">ram_size</var></dt>
|
<dd>Equivalent to <code class="Fl">-f</code> <code class="Cm">lhg</code>.</dd>
|
||||||
<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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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>–<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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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>
|
|
||||||
</dl>
|
</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
|
Most values in the ROM header are only cosmetic. The bare minimum requirements
|
||||||
for a workable image are checksums, the Nintendo logo, and (if needed) the
|
for a workable 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
|
CGB/SGB flags. It is a good idea to pad the image to a valid size as well
|
||||||
(“valid” meaning a multiple of 32KiB).
|
(“valid” meaning a multiple of 32KiB).
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The following will make a plain, no-color Game Boy game without
|
||||||
The following will make a plain, no-color Game Boy game without checking for a
|
checking for a valid size:</p>
|
||||||
valid size:
|
<p class="Pp"></p>
|
||||||
<div class="Pp"></div>
|
<div class="Bd Bd-indent">$ rgbfix -v foo.gb</div>
|
||||||
<div class="D1">$ rgbfix -v foo.gb</div>
|
<p class="Pp">The following will make a SGB-enabled, color-enabled game with a
|
||||||
<div class="Pp"></div>
|
title of “foobar”, and pad it to a multiple of 32KiB. (The
|
||||||
The following will make a SGB-enabled, color-enabled game with a title of
|
Game Boy itself does not use the title, but some emulators or ROM managers
|
||||||
“foobar”, and pad it to a multiple of 32KiB. (The Game Boy
|
might.)</p>
|
||||||
itself does not use the title, but some emulators or ROM managers might.)
|
<p class="Pp"></p>
|
||||||
<div class="Pp"></div>
|
<div class="Bd Bd-indent">$ rgbfix -vcs -l 0x33 -p 0 -t foobar baz.gb</div>
|
||||||
<div class="D1">$ rgbfix -vcs -l 0x33 -p 0 -t foobar baz.gb</div>
|
<p class="Pp">The following will duplicate the header (sans global checksum) of
|
||||||
<div class="Pp"></div>
|
the game “Survival Kids”:</p>
|
||||||
The following will duplicate the header (sans global checksum) of the game
|
<p class="Pp"></p>
|
||||||
“Survival Kids”:
|
<div class="Bd Bd-indent">$ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t
|
||||||
<div class="Pp"></div>
|
|
||||||
<div class="D1">$ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t
|
|
||||||
SURVIVALKIDAVKE SurvivalKids.gbc</div>
|
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>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(7)</a>
|
<a class="Xr">rgbds(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
<b class="Nm" title="Nm">rgbfix</b> was originally released by Carsten
|
<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ørensen as a standalone program called gbfix, and was later packaged
|
Sø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
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">March 11, 2018</td>
|
<td class="foot-date">March 11, 2018</td>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBGFX(1)</title>
|
<title>RGBGFX(1)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,151 +21,153 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgbgfx</b> — <span class="Nd" title="Nd">Game
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
Boy graphics converter</span>
|
<code class="Nm">rgbgfx</code> —
|
||||||
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
<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">
|
<table class="Nm">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b class="Nm" title="Nm">rgbgfx</b></td>
|
<td><code class="Nm">rgbgfx</code></td>
|
||||||
<td>[<span class="Op"><b class="Fl" title="Fl">-DfFhPTVv</b></span>]
|
<td>[<code class="Fl">-ADfFhmPTuVv</code>] [<code class="Fl">-o</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-o</b>
|
<var class="Ar">outfile</var>] [<code class="Fl">-a</code>
|
||||||
<var class="Ar" title="Ar">outfile</var></span>]
|
<var class="Ar">attrmap</var>] [<code class="Fl">-d</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-d</b>
|
<var class="Ar">depth</var>] [<code class="Fl">-p</code>
|
||||||
<var class="Ar" title="Ar">depth</var></span>]
|
<var class="Ar">palfile</var>] [<code class="Fl">-t</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-p</b>
|
<var class="Ar">tilemap</var>] [<code class="Fl">-x</code>
|
||||||
<var class="Ar" title="Ar">palfile</var></span>]
|
<var class="Ar">tiles</var>] <var class="Ar">file</var></td>
|
||||||
[<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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
</section>
|
||||||
The <b class="Nm" title="Nm">rgbgfx</b> program converts PNG images into the
|
<section class="Sh">
|
||||||
Nintendo Game Boy's planar tile format.
|
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
||||||
<div style="height: 1.00em;"> </div>
|
The <code class="Nm">rgbgfx</code> program converts PNG images into the Nintendo
|
||||||
The resulting colors and their palette indices are determined differently
|
Game Boy's planar tile format.
|
||||||
depending on the input PNG file:
|
<p class="Pp">The resulting colors and their palette indices are determined
|
||||||
|
differently depending on the input PNG file:</p>
|
||||||
<ul class="Bl-dash">
|
<ul class="Bl-dash">
|
||||||
<li class="It-dash">If the file has an embedded palette, that palette's color
|
<li>If the file has an embedded palette, that palette's color and order are
|
||||||
and order are used.</li>
|
used.</li>
|
||||||
<li class="It-dash">If not, and the image only contains shades of gray, rgbgfx
|
<li>If not, and the image only contains shades of gray, rgbgfx maps them to
|
||||||
maps them to the indices appropriate for each shade. Any undetermined
|
the indices appropriate for each shade. Any undetermined indices are set
|
||||||
indices are set to respective default shades of gray. For example: if the
|
to respective default shades of gray. For example: if the bit depth is 2
|
||||||
bit depth is 2 and the image contains light gray and black, they become
|
and the image contains light gray and black, they become the second and
|
||||||
the second and fourth colors - and the first and third colors get set to
|
fourth colors - and the first and third colors get set to default white
|
||||||
default white and dark gray. If the image has multiple shades that map to
|
and dark gray. If the image has multiple shades that map to the same
|
||||||
the same index, the palette is instead determined as if the image had
|
index, the palette is instead determined as if the image had color.</li>
|
||||||
color.</li>
|
<li>If the image has color (or the grayscale method failed), the colors are
|
||||||
<li class="It-dash">If the image has color (or the grayscale method failed),
|
sorted from lightest to darkest.</li>
|
||||||
the colors are sorted from lightest to darkest.</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div style="height: 1.00em;"> </div>
|
<p class="Pp">The input image may not contain more colors than the selected bit
|
||||||
The input image may not contain more colors than the selected bit depth allows.
|
depth allows. Transparent pixels are set to palette index 0.</p>
|
||||||
Transparent pixels are set to palette index 0.
|
</section>
|
||||||
<h1 class="Sh" title="Sh" id="ARGUMENTS"><a class="selflink" href="#ARGUMENTS">ARGUMENTS</a></h1>
|
<section class="Sh">
|
||||||
|
<h1 class="Sh" id="ARGUMENTS"><a class="permalink" href="#ARGUMENTS">ARGUMENTS</a></h1>
|
||||||
<dl class="Bl-tag">
|
<dl class="Bl-tag">
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#a"><code class="Fl" id="a">-a</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">attrmap</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#D"><b class="Fl" title="Fl" id="D">-D</b></a></dt>
|
<dd>Generate a file of tile mirroring attributes for OAM or (CGB-only)
|
||||||
<dd class="It-tag">Debug features are enabled.</dd>
|
background tiles. For each tile in the input file, a byte is written
|
||||||
<dt class="It-tag"> </dt>
|
representing the dimensions that the associated tile in the output file
|
||||||
<dd class="It-tag"> </dd>
|
should be mirrored. Useful in combination with <code class="Fl">-m</code>
|
||||||
<dt class="It-tag"><a class="selflink" href="#f"><b class="Fl" title="Fl" id="f">-f</b></a></dt>
|
to keep track the mirror direction of mirrored duplicate tiles.</dd>
|
||||||
<dd class="It-tag">Fix the input PNG file to be a correctly indexed
|
<dt><a class="permalink" href="#A"><code class="Fl" id="A">-A</code></a></dt>
|
||||||
image.</dd>
|
<dd>Same as <code class="Fl">-a</code>, but the attrmap file output name is
|
||||||
<dt class="It-tag"> </dt>
|
made by taking the input filename, removing the file extension, and
|
||||||
<dd class="It-tag"> </dd>
|
appending <span class="Pa">.attrmap</span>.</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#F"><b class="Fl" title="Fl" id="F">-F</b></a></dt>
|
<dt><a class="permalink" href="#D"><code class="Fl" id="D">-D</code></a></dt>
|
||||||
<dd class="It-tag">Same as <b class="Fl" title="Fl">-f</b>, but additionally,
|
<dd>Debug features are enabled.</dd>
|
||||||
the supplied command line parameters are saved within the PNG and will be
|
<dt><a class="permalink" href="#f"><code class="Fl" id="f">-f</code></a></dt>
|
||||||
loaded and automatically used next time.</dd>
|
<dd>Fix the input PNG file to be a correctly indexed image.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#F"><code class="Fl" id="F">-F</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Same as <code class="Fl">-f</code>, but additionally, the supplied command
|
||||||
<dt class="It-tag"><a class="selflink" href="#d"><b class="Fl" title="Fl" id="d">-d</b></a>
|
line parameters are saved within the PNG and will be loaded and
|
||||||
<var class="Ar" title="Ar">depth</var></dt>
|
automatically used next time.</dd>
|
||||||
<dd class="It-tag">The bit depth of the output image (either 1 or 2). By
|
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a>
|
||||||
default, the bit depth is 2 (two bits per pixel).</dd>
|
<var class="Ar">depth</var></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>The bit depth of the output image (either 1 or 2). By default, the bit
|
||||||
<dd class="It-tag"> </dd>
|
depth is 2 (two bits per pixel).</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#h"><b class="Fl" title="Fl" id="h">-h</b></a></dt>
|
<dt><a class="permalink" href="#h"><code class="Fl" id="h">-h</code></a></dt>
|
||||||
<dd class="It-tag">Lay out tiles horizontally rather than vertically.</dd>
|
<dd>Lay out tiles horizontally rather than vertically.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Truncate tiles by checking for tiles that are mirrored versions of others
|
||||||
<dt class="It-tag"><a class="selflink" href="#o"><b class="Fl" title="Fl" id="o">-o</b></a>
|
and omitting these from the output file. Useful with tilemaps and attrmaps
|
||||||
<var class="Ar" title="Ar">outfile</var></dt>
|
together to keep track of the duplicated tiles and the dimension mirrored.
|
||||||
<dd class="It-tag">The name of the output file.</dd>
|
Tiles are checked for horizontal, vertical, and horizontal-vertical
|
||||||
<dt class="It-tag"> </dt>
|
mirroring. Implies <code class="Fl">-u</code>.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
|
||||||
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
|
<var class="Ar">outfile</var></dt>
|
||||||
<var class="Ar" title="Ar">palfile</var></dt>
|
<dd>The name of the output file.</dd>
|
||||||
<dd class="It-tag">Output the image's palette in standard GBC palette format -
|
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
||||||
bytes (8 bytes for two bits per pixel, 4 bytes for one bit per pixel)
|
<var class="Ar">palfile</var></dt>
|
||||||
containing the RGB15 values in little-endian byte order. If the palette
|
<dd>Output the image's palette in standard GBC palette format - bytes (8 bytes
|
||||||
contains too few colors, the remaining entries are set to black.</dd>
|
for two bits per pixel, 4 bytes for one bit per pixel) containing the
|
||||||
<dt class="It-tag"> </dt>
|
RGB15 values in little-endian byte order. If the palette contains too few
|
||||||
<dd class="It-tag"> </dd>
|
colors, the remaining entries are set to black.</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#P"><b class="Fl" title="Fl" id="P">-P</b></a></dt>
|
<dt><a class="permalink" href="#P"><code class="Fl" id="P">-P</code></a></dt>
|
||||||
<dd class="It-tag">Same as <b class="Fl" title="Fl">-p</b>, but the palette
|
<dd>Same as <code class="Fl">-p</code>, but the palette file output name is
|
||||||
file output name is made by taking the input PNG file's filename, removing
|
made by taking the input PNG file's filename, removing the file extension,
|
||||||
the file extension, and appending <i class="Pa" title="Pa">.pal</i>.</dd>
|
and appending <span class="Pa">.pal</span>.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">tilemap</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#t"><b class="Fl" title="Fl" id="t">-t</b></a>
|
<dd>Generate a file of tile indices. For each tile in the input file, a byte
|
||||||
<var class="Ar" title="Ar">mapfile</var></dt>
|
is written representing the index of the associated tile in the output
|
||||||
<dd class="It-tag">If any tiles are the same, don't place the repeat tiles in
|
file. Useful in combination with <code class="Fl">-u</code> or
|
||||||
the output file, and make a tilemap file.</dd>
|
<code class="Fl">-m</code> to keep track of duplicate tiles.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#T"><code class="Fl" id="T">-T</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Same as <code class="Fl">-t</code>, but the tilemap file output name is
|
||||||
<dt class="It-tag"><a class="selflink" href="#T"><b class="Fl" title="Fl" id="T">-T</b></a></dt>
|
made by taking the input filename, removing the file extension, and
|
||||||
<dd class="It-tag">Same as <b class="Fl" title="Fl">-t</b>, but the tilemap
|
appending <span class="Pa">.tilemap</span>.</dd>
|
||||||
file output name is made by taking the input filename, removing the file
|
<dt><a class="permalink" href="#u"><code class="Fl" id="u">-u</code></a></dt>
|
||||||
extension, and appending <i class="Pa" title="Pa">.tilemap</i>.</dd>
|
<dd>Truncate tiles by checking for tiles that are exact duplicates of others
|
||||||
<dt class="It-tag"> </dt>
|
and omitting these from the output file. Useful with tilemaps to keep
|
||||||
<dd class="It-tag"> </dd>
|
track of the duplicated tiles.</dd>
|
||||||
<dt class="It-tag"><a class="selflink" href="#u"><b class="Fl" title="Fl" id="u">-u</b></a></dt>
|
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
|
||||||
<dd class="It-tag">Truncate repeated tiles. Useful with tilemaps.</dd>
|
<dd>Print the version of the program and exit.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#v"><code class="Fl" id="v">-v</code></a></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Verbose. Print errors when the command line parameters and the parameters
|
||||||
<dt class="It-tag"><a class="selflink" href="#V"><b class="Fl" title="Fl" id="V">-V</b></a></dt>
|
in the PNG file don't match.</dd>
|
||||||
<dd class="It-tag">Print the version of the program and exit.</dd>
|
<dt><a class="permalink" href="#x"><code class="Fl" id="x">-x</code></a>
|
||||||
<dt class="It-tag"> </dt>
|
<var class="Ar">tiles</var></dt>
|
||||||
<dd class="It-tag"> </dd>
|
<dd>Trim the end of the output file by this many tiles.</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"> </dt>
|
|
||||||
<dd class="It-tag"> </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>
|
|
||||||
</dl>
|
</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
|
The following will take a PNG file with a bit depth of 1, 2, or 8, and output
|
||||||
planar 2bpp data:
|
planar 2bpp data:
|
||||||
<div class="Pp"></div>
|
<p class="Pp"></p>
|
||||||
<div class="D1">$ rgbgfx -o out.2bpp in.png</div>
|
<div class="Bd Bd-indent">$ rgbgfx -o out.2bpp in.png</div>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The following creates a planar 2bpp file with only unique tiles,
|
||||||
The following creates a planar 2bpp file with only unique tiles, and its tilemap
|
and its tilemap <span class="Pa">out.tilemap</span>:</p>
|
||||||
<i class="Pa" title="Pa">out.tilemap</i>:
|
<p class="Pp"></p>
|
||||||
<div class="Pp"></div>
|
<div class="Bd Bd-indent">$ rgbgfx -T -u -o out.2bpp in.png</div>
|
||||||
<div class="D1">$ rgbgfx -T -u -o out.2bpp in.png</div>
|
<p class="Pp">The following creates a planar 2bpp file with only unique tiles
|
||||||
<div class="Pp"></div>
|
(accounting for tile mirroring) and its associated tilemap
|
||||||
The following will do nothing:
|
<span class="Pa">out.tilemap</span> and attrmap
|
||||||
<div class="Pp"></div>
|
<span class="Pa">out.attrmap</span>:</p>
|
||||||
<div class="D1">$ rgbgfx in.png</div>
|
<p class="Pp"></p>
|
||||||
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
<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>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbds(7)</a>, <a class="Xr" title="Xr">rgbasm(1)</a>,
|
<a class="Xr">rgbds(7)</a>, <a class="Xr">rgbasm(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgblink(1)</a>, <a class="Xr">rgbfix(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">gbz80(7)</a>
|
<a class="Xr">gbz80(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
<b class="Nm" title="Nm">rgbgfx</b> was created by
|
<section class="Sh">
|
||||||
<span class="An" title="An">stag019</span> to be included in RGBDS. It is now
|
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
|
||||||
maintained by a number of contributors at
|
<code class="Nm">rgbgfx</code> was created by <span class="An">stag019</span> to
|
||||||
<a class="Lk" title="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.</div>
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">January 26, 2018</td>
|
<td class="foot-date">January 26, 2018</td>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBLINK(1)</title>
|
<title>RGBLINK(1)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,137 +21,113 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgblink</b> — <span class="Nd" title="Nd">Game
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
Boy linker</span>
|
<code class="Nm">rgblink</code> —
|
||||||
<h1 class="Sh" title="Sh" id="SYNOPSIS"><a class="selflink" href="#SYNOPSIS">SYNOPSIS</a></h1>
|
<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">
|
<table class="Nm">
|
||||||
<tr>
|
<tr>
|
||||||
<td><b class="Nm" title="Nm">rgblink</b></td>
|
<td><code class="Nm">rgblink</code></td>
|
||||||
<td>[<span class="Op"><b class="Fl" title="Fl">-dtVw</b></span>]
|
<td>[<code class="Fl">-dtVw</code>] [<code class="Fl">-m</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-m</b>
|
<var class="Ar">mapfile</var>] [<code class="Fl">-n</code>
|
||||||
<var class="Ar" title="Ar">mapfile</var></span>]
|
<var class="Ar">symfile</var>] [<code class="Fl">-O</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-n</b>
|
<var class="Ar">overlayfile</var>] [<code class="Fl">-o</code>
|
||||||
<var class="Ar" title="Ar">symfile</var></span>]
|
<var class="Ar">outfile</var>] [<code class="Fl">-p</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-O</b>
|
<var class="Ar">pad_value</var>] [<code class="Fl">-s</code>
|
||||||
<var class="Ar" title="Ar">overlayfile</var></span>]
|
<var class="Ar">symbol</var>] [<code class="Fl">-l</code>
|
||||||
[<span class="Op"><b class="Fl" title="Fl">-o</b>
|
<var class="Ar">linkerscript</var>] <var class="Ar">file ...</var></td>
|
||||||
<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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
</section>
|
||||||
The <b class="Nm" title="Nm">rgblink</b> program links objects created by
|
<section class="Sh">
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a> into a single Game Boy ROM file.
|
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
||||||
<div class="Pp"></div>
|
The <code class="Nm">rgblink</code> program links objects created by
|
||||||
By default, ROM0 sections created by the assembler are placed in the 16KiB bank
|
<a class="Xr">rgbasm(1)</a> into a single Game Boy ROM file.
|
||||||
0, and ROMX sections are placed in any bank except bank 0. If your ROM will
|
<p class="Pp">By default, ROM0 sections created by the assembler are placed in
|
||||||
only be 32KiB, you can use the <b class="Fl" title="Fl">-t</b> option to
|
the 16KiB bank 0, and ROMX sections are placed in any bank except bank 0. If
|
||||||
override this.
|
your ROM will only be 32KiB, you can use the <code class="Fl">-t</code>
|
||||||
<div class="Pp"></div>
|
option to override this.</p>
|
||||||
Similarly, WRAM0 sections are placed in the first 4KiB of WRAM bank 0 and WRAMX
|
<p class="Pp">Similarly, WRAM0 sections are placed in the first 4KiB of WRAM
|
||||||
sections are placed in any bank except bank 0. If your ROM doesn't use banked
|
bank 0 and WRAMX sections are placed in any bank except bank 0. If your ROM
|
||||||
WRAM you can use option <b class="Fl" title="Fl">-w</b> option to override
|
doesn't use banked WRAM you can use option <code class="Fl">-w</code> option
|
||||||
this.
|
to override this.</p>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">Also, if your ROM is designed for DMG, you can make sure that you
|
||||||
Also, if your ROM is designed for DMG, you can make sure that you don't use any
|
don't use any prohibited section by using the option
|
||||||
prohibited section by using the option <b class="Fl" title="Fl">-d</b>, which
|
<code class="Fl">-d</code>, which implies <code class="Fl">-w</code> but
|
||||||
implies <b class="Fl" title="Fl">-w</b> but also prohibits the use of VRAM
|
also prohibits the use of VRAM bank 1.</p>
|
||||||
bank 1.
|
<p class="Pp">The arguments are as follows:</p>
|
||||||
<div class="Pp"></div>
|
|
||||||
The arguments are as follows:
|
|
||||||
<dl class="Bl-tag">
|
<dl class="Bl-tag">
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">mapfile</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#m"><b class="Fl" title="Fl" id="m">-m</b></a>
|
<dd>Write a mapfile to the given filename.</dd>
|
||||||
<var class="Ar" title="Ar">mapfile</var></dt>
|
<dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
|
||||||
<dd class="It-tag">Write a mapfile to the given filename.</dd>
|
<var class="Ar">symfile</var></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Write a symbol file to the given filename.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#O"><code class="Fl" id="O">-O</code></a>
|
||||||
<dt class="It-tag"><a class="selflink" href="#n"><b class="Fl" title="Fl" id="n">-n</b></a>
|
<var class="Ar">overlayfile</var></dt>
|
||||||
<var class="Ar" title="Ar">symfile</var></dt>
|
<dd>The ROM image to overlay sections over. When an overlay ROM is provided,
|
||||||
<dd class="It-tag">Write a symbol file to the given filename.</dd>
|
all sections must be fixed. This may be used to patch an existing
|
||||||
<dt class="It-tag"> </dt>
|
binary.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
|
||||||
<dt class="It-tag"><a class="selflink" href="#O"><b class="Fl" title="Fl" id="O">-O</b></a>
|
<var class="Ar">outfile</var></dt>
|
||||||
<var class="Ar" title="Ar">overlayfile</var></dt>
|
<dd>Write ROM image to the given filename.</dd>
|
||||||
<dd class="It-tag">The ROM image to overlay sections over. When an overlay ROM
|
<dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
|
||||||
is provided, all sections must be fixed. This may be used to patch an
|
<var class="Ar">pad_value</var></dt>
|
||||||
existing binary.</dd>
|
<dd>When padding an image, pad with this value. The default is 0x00.</dd>
|
||||||
<dt class="It-tag"> </dt>
|
<dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>
|
||||||
<dd class="It-tag"> </dd>
|
<var class="Ar">symbol</var></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#o"><b class="Fl" title="Fl" id="o">-o</b></a>
|
<dd>???</dd>
|
||||||
<var class="Ar" title="Ar">outfile</var></dt>
|
<dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
|
||||||
<dd class="It-tag">Write ROM image to the given filename.</dd>
|
<dd>Expand the WRAM0 section size from 4KiB to the full 8KiB assigned to WRAM
|
||||||
<dt class="It-tag"> </dt>
|
and prohibit the use of WRAMX sections.</dd>
|
||||||
<dd class="It-tag"> </dd>
|
<dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a></dt>
|
||||||
<dt class="It-tag"><a class="selflink" href="#p"><b class="Fl" title="Fl" id="p">-p</b></a>
|
<dd>Enable DMG mode. Prohibit the use of sections that doesn't exist on a DMG,
|
||||||
<var class="Ar" title="Ar">pad_value</var></dt>
|
such as WRAMX and VRAM bank 1. This option automatically enables
|
||||||
<dd class="It-tag">When padding an image, pad with this value. The default is
|
<code class="Fl">-w</code>.</dd>
|
||||||
0x00.</dd>
|
<dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Expand the ROM0 section size from 16KiB to the full 32KiB assigned to ROM
|
||||||
<dd class="It-tag"> </dd>
|
and prohibit the use of ROMX sections. Useful for ROMs that fit in 32
|
||||||
<dt class="It-tag"><a class="selflink" href="#s"><b class="Fl" title="Fl" id="s">-s</b></a>
|
KiB.</dd>
|
||||||
<var class="Ar" title="Ar">symbol</var></dt>
|
<dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a>
|
||||||
<dd class="It-tag">???</dd>
|
<var class="Ar">linkerscript</var></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Specify a linkerscript file that tells the linker how sections must be
|
||||||
<dd class="It-tag"> </dd>
|
placed in the ROM. This file has priority over the attributes assigned in
|
||||||
<dt class="It-tag"><a class="selflink" href="#w"><b class="Fl" title="Fl" id="w">-w</b></a></dt>
|
the source code, but they have to be consistent. See
|
||||||
<dd class="It-tag">Expand the WRAM0 section size from 4KiB to the full 8KiB
|
<a class="Xr">rgblink(5)</a> for more information about its format.</dd>
|
||||||
assigned to WRAM and prohibit the use of WRAMX sections.</dd>
|
<dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
|
||||||
<dt class="It-tag"> </dt>
|
<dd>Print the version of the program and exit.</dd>
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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"> </dt>
|
|
||||||
<dd class="It-tag"> </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>
|
|
||||||
</dl>
|
</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
|
All you need for a basic ROM is an object file, which can be made into a ROM
|
||||||
image like so:
|
image like so:
|
||||||
<div class="Pp"></div>
|
<p class="Pp"></p>
|
||||||
<div class="D1">$ rgblink -o bar.gb foo.o</div>
|
<div class="Bd Bd-indent">$ rgblink -o bar.gb foo.o</div>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The resulting bar.gb will not have correct checksums (unless you
|
||||||
The resulting bar.gb will not have correct checksums (unless you put them in the
|
put them in the assembly source). You should use <a class="Xr">rgbfix(1)</a>
|
||||||
assembly source). You should use <a class="Xr" title="Xr">rgbfix(1)</a> to fix
|
to fix these so that the program will actually run in a Game Boy:</p>
|
||||||
these so that the program will actually run in a Game Boy:
|
<p class="Pp"></p>
|
||||||
<div class="Pp"></div>
|
<div class="Bd Bd-indent">$ rgbfix -v bar.gb</div>
|
||||||
<div class="D1">$ rgbfix -v bar.gb</div>
|
</section>
|
||||||
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
<section class="Sh">
|
||||||
|
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||||
ALSO</a></h1>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(5)</a>,
|
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(5)</a>,
|
||||||
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">rgbds(5)</a>,
|
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(7)</a>
|
<a class="Xr">rgbds(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
<b class="Nm" title="Nm">rgblink</b> was originally written by Carsten
|
<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ørensen as part of the ASMotor package, and was later packaged in
|
Sø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
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">January 26, 2018</td>
|
<td class="foot-date">January 26, 2018</td>
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<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>
|
<head>
|
||||||
<meta charset="utf-8"/>
|
<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"/>
|
<link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
|
||||||
<title>RGBLINK(5)</title>
|
<title>RGBLINK(5)</title>
|
||||||
</head>
|
</head>
|
||||||
@@ -20,23 +21,24 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="manual-text">
|
<div class="manual-text">
|
||||||
<h1 class="Sh" title="Sh" id="NAME"><a class="selflink" href="#NAME">NAME</a></h1>
|
<section class="Sh">
|
||||||
<b class="Nm" title="Nm">rgblink</b> —
|
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
|
||||||
<span class="Nd" title="Nd">linkerscript file format</span>
|
<code class="Nm">rgblink</code> —
|
||||||
<h1 class="Sh" title="Sh" id="DESCRIPTION"><a class="selflink" href="#DESCRIPTION">DESCRIPTION</a></h1>
|
<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
|
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.
|
of sections without the need for doing so before assembling each object file.
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The placement of sections specified in the linkerscript is done
|
||||||
The placement of sections specified in the linkerscript is done before the
|
before the sections whose placement is defined in the source code.</p>
|
||||||
sections whose placement is defined in the source code.
|
<p class="Pp">A linkerscript consists on a series of banks followed by a list of
|
||||||
<div class="Pp"></div>
|
sections and, optionally, commands. They can be lowercase or uppercase, it
|
||||||
A linkerscript consists on a series of banks followed by a list of sections and,
|
is ignored. Any line can contain a comment starting with
|
||||||
optionally, commands. They can be lowercase or uppercase, it is ignored. Any
|
‘<code class="Li">;</code>’ that ends at the end of the
|
||||||
line can contain a comment starting with
|
line:</p>
|
||||||
‘<code class="Li">;</code>’ that ends at the end of the line:
|
<div class="Bd Pp Bd-indent">
|
||||||
<div class="Pp"></div>
|
<pre>
|
||||||
<div class="Bd" style="margin-left: 5.00ex;">
|
|
||||||
<pre class="Li">
|
|
||||||
ROMX $F ; This is a comment
|
ROMX $F ; This is a comment
|
||||||
"Functions to read array"
|
"Functions to read array"
|
||||||
ALIGN 8
|
ALIGN 8
|
||||||
@@ -46,55 +48,53 @@ WRAMX 2
|
|||||||
"Some variables"
|
"Some variables"
|
||||||
</pre>
|
</pre>
|
||||||
</div>
|
</div>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">Numbers can be in decimal or hexadecimal format (the prefix is
|
||||||
Numbers can be in decimal or hexadecimal format (the prefix is
|
‘<code class="Li">$</code>’). It is an error if any section
|
||||||
‘<code class="Li">$</code>’). It is an error if any section name
|
name or command are found before setting a bank.</p>
|
||||||
or command are found before setting a bank.
|
<p class="Pp">Files can be included by using the <var class="Ar">INCLUDE</var>
|
||||||
<div class="Pp"></div>
|
|
||||||
Files can be included by using the <var class="Ar" title="Ar">INCLUDE</var>
|
|
||||||
keyword followed by a string with the path of the file that has to be
|
keyword followed by a string with the path of the file that has to be
|
||||||
included.
|
included.</p>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">The possible bank types are: <b class="Sy">ROM0</b>,
|
||||||
The possible bank types are: <b class="Sy" title="Sy">ROM0</b>,
|
<b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>, <b class="Sy">WRAM0</b>,
|
||||||
<b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
|
<b class="Sy">WRAMX</b>, <b class="Sy">OAM</b> and <b class="Sy">HRAM</b>.
|
||||||
<b class="Sy" title="Sy">WRAM0</b>, <b class="Sy" title="Sy">WRAMX</b>,
|
Types <b class="Sy">ROMX</b>, <b class="Sy">VRAM</b>,
|
||||||
<b class="Sy" title="Sy">OAM</b> and <b class="Sy" title="Sy">HRAM</b>. Types
|
<b class="Sy">WRAMX</b> and <b class="Sy">SRAM</b> are banked, which means
|
||||||
<b class="Sy" title="Sy">ROMX</b>, <b class="Sy" title="Sy">VRAM</b>,
|
that it is needed to specify a bank after the type.</p>
|
||||||
<b class="Sy" title="Sy">WRAMX</b> and <b class="Sy" title="Sy">SRAM</b> are
|
<p class="Pp">When a new bank statement is found, sections found after it will
|
||||||
banked, which means that it is needed to specify a bank after the type.
|
be placed right from the beginning of that bank. If the linkerscript
|
||||||
<div class="Pp"></div>
|
switches to a different bank and then it comes back to the previous one it
|
||||||
When a new bank statement is found, sections found after it will be placed right
|
will continue from the last address that was used.</p>
|
||||||
from the beginning of that bank. If the linkerscript switches to a different
|
<p class="Pp">The only two commands are <var class="Ar">ORG</var> and
|
||||||
bank and then it comes back to the previous one it will continue from the last
|
<var class="Ar">ALIGN</var>:</p>
|
||||||
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>:
|
|
||||||
<ul class="Bl-bullet">
|
<ul class="Bl-bullet">
|
||||||
<li class="It-bullet"><var class="Ar" title="Ar">ORG</var> sets the address in
|
<li><var class="Ar">ORG</var> sets the address in which new sections will be
|
||||||
which new sections will be placed. It can not be lower than the current
|
placed. It can not be lower than the current address.</li>
|
||||||
address.</li>
|
<li><var class="Ar">ALIGN</var> will increase the address until it is aligned
|
||||||
<li class="It-bullet"><var class="Ar" title="Ar">ALIGN</var> will increase the
|
to the specified boundary (it tries to set to 0 the number of bits
|
||||||
address until it is aligned to the specified boundary (it tries to set to
|
specified after the command: <b class="Sy">ALIGN 8</b> will align to
|
||||||
0 the number of bits specified after the command:
|
$100).</li>
|
||||||
<b class="Sy" title="Sy">ALIGN 8</b> will align to $100).</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<div class="Pp"></div>
|
<p class="Pp">Note: The bank, alignment, address and type of sections can be
|
||||||
Note: The bank, alignment, address and type of sections can be specified both in
|
specified both in the source code and in the linkerscript. For a section to
|
||||||
the source code and in the linkerscript. For a section to be able to be placed
|
be able to be placed with the linkerscript the bank must be left unassigned
|
||||||
with the linkerscript the bank must be left unassigned in the source code or
|
in the source code or be the same as the one specified in the linkerscript.
|
||||||
be the same as the one specified in the linkerscript. The address and
|
The address and alignment musn't be set.</p>
|
||||||
alignment musn't be set.
|
</section>
|
||||||
<h1 class="Sh" title="Sh" id="SEE_ALSO"><a class="selflink" href="#SEE_ALSO">SEE
|
<section class="Sh">
|
||||||
|
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
|
||||||
ALSO</a></h1>
|
ALSO</a></h1>
|
||||||
<a class="Xr" title="Xr">rgbasm(1)</a>, <a class="Xr" title="Xr">rgblink(1)</a>,
|
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(1)</a>,
|
||||||
<a class="Xr" title="Xr">rgbfix(1)</a>, <a class="Xr" title="Xr">rgbds(5)</a>,
|
<a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>,
|
||||||
<a class="Xr" title="Xr">rgbds(7)</a>
|
<a class="Xr">rgbds(7)</a>
|
||||||
<h1 class="Sh" title="Sh" id="HISTORY"><a class="selflink" href="#HISTORY">HISTORY</a></h1>
|
</section>
|
||||||
<b class="Nm" title="Nm">rgblink</b> was originally written by Carsten
|
<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ørensen as part of the ASMotor package, and was later packaged in
|
Sø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
|
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">
|
<table class="foot">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="foot-date">January 27, 2018</td>
|
<td class="foot-date">January 27, 2018</td>
|
||||||
|
|||||||
@@ -12,14 +12,24 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "gfx/main.h"
|
#include "gfx/main.h"
|
||||||
|
|
||||||
|
#define XFLIP 0x40
|
||||||
|
#define YFLIP 0x20
|
||||||
|
|
||||||
void raw_to_gb(const struct RawIndexedImage *raw_image, struct GBImage *gb);
|
void raw_to_gb(const struct RawIndexedImage *raw_image, struct GBImage *gb);
|
||||||
void output_file(const struct Options *opts, const 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 get_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles,
|
||||||
int tile_size);
|
int tile_size);
|
||||||
void create_tilemap(const struct Options *opts, struct GBImage *gb,
|
uint8_t reverse_bits(uint8_t b);
|
||||||
struct Tilemap *tilemap);
|
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,
|
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,
|
void output_palette_file(const struct Options *opts,
|
||||||
const struct RawIndexedImage *raw_image);
|
const struct RawIndexedImage *raw_image);
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,13 @@ struct Options {
|
|||||||
bool hardfix;
|
bool hardfix;
|
||||||
bool fix;
|
bool fix;
|
||||||
bool horizontal;
|
bool horizontal;
|
||||||
|
bool mirror;
|
||||||
bool unique;
|
bool unique;
|
||||||
int trim;
|
int trim;
|
||||||
char *mapfile;
|
char *tilemapfile;
|
||||||
bool mapout;
|
bool tilemapout;
|
||||||
|
char *attrmapfile;
|
||||||
|
bool attrmapout;
|
||||||
char *palfile;
|
char *palfile;
|
||||||
bool palout;
|
bool palout;
|
||||||
char *outfile;
|
char *outfile;
|
||||||
@@ -40,8 +43,10 @@ struct RGBColor {
|
|||||||
struct ImageOptions {
|
struct ImageOptions {
|
||||||
bool horizontal;
|
bool horizontal;
|
||||||
int trim;
|
int trim;
|
||||||
char *mapfile;
|
char *tilemapfile;
|
||||||
bool mapout;
|
bool tilemapout;
|
||||||
|
char *attrmapfile;
|
||||||
|
bool attrmapout;
|
||||||
char *palfile;
|
char *palfile;
|
||||||
bool palout;
|
bool palout;
|
||||||
};
|
};
|
||||||
@@ -71,7 +76,7 @@ struct GBImage {
|
|||||||
int trim;
|
int trim;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Tilemap {
|
struct Mapfile {
|
||||||
uint8_t *data;
|
uint8_t *data;
|
||||||
int size;
|
int size;
|
||||||
};
|
};
|
||||||
|
|||||||
130
src/gfx/gb.c
130
src/gfx/gb.c
@@ -85,8 +85,87 @@ int get_tile_index(uint8_t *tile, uint8_t **tiles, int num_tiles, int tile_size)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void create_tilemap(const struct Options *opts, struct GBImage *gb,
|
uint8_t reverse_bits(uint8_t b)
|
||||||
struct Tilemap *tilemap)
|
{
|
||||||
|
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 i, j;
|
||||||
int gb_i;
|
int gb_i;
|
||||||
@@ -94,6 +173,7 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
|
|||||||
int max_tiles;
|
int max_tiles;
|
||||||
int num_tiles;
|
int num_tiles;
|
||||||
int index;
|
int index;
|
||||||
|
int flags;
|
||||||
int gb_size;
|
int gb_size;
|
||||||
uint8_t *tile;
|
uint8_t *tile;
|
||||||
uint8_t **tiles;
|
uint8_t **tiles;
|
||||||
@@ -109,19 +189,33 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
|
|||||||
tiles = calloc(max_tiles, sizeof(uint8_t *));
|
tiles = calloc(max_tiles, sizeof(uint8_t *));
|
||||||
num_tiles = 0;
|
num_tiles = 0;
|
||||||
|
|
||||||
|
if (*opts->tilemapfile) {
|
||||||
tilemap->data = calloc(max_tiles, sizeof(uint8_t));
|
tilemap->data = calloc(max_tiles, sizeof(uint8_t));
|
||||||
tilemap->size = 0;
|
tilemap->size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*opts->attrmapfile) {
|
||||||
|
attrmap->data = calloc(max_tiles, sizeof(uint8_t));
|
||||||
|
attrmap->size = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gb_i = 0;
|
gb_i = 0;
|
||||||
while (gb_i < gb_size) {
|
while (gb_i < gb_size) {
|
||||||
|
flags = 0;
|
||||||
tile = malloc(tile_size);
|
tile = malloc(tile_size);
|
||||||
for (i = 0; i < tile_size; i++) {
|
for (i = 0; i < tile_size; i++) {
|
||||||
tile[i] = gb->data[gb_i];
|
tile[i] = gb->data[gb_i];
|
||||||
gb_i++;
|
gb_i++;
|
||||||
}
|
}
|
||||||
if (opts->unique) {
|
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,
|
index = get_tile_index(tile, tiles, num_tiles,
|
||||||
tile_size);
|
tile_size);
|
||||||
|
}
|
||||||
if (index < 0) {
|
if (index < 0) {
|
||||||
index = num_tiles;
|
index = num_tiles;
|
||||||
tiles[num_tiles] = tile;
|
tiles[num_tiles] = tile;
|
||||||
@@ -132,9 +226,15 @@ void create_tilemap(const struct Options *opts, struct GBImage *gb,
|
|||||||
tiles[num_tiles] = tile;
|
tiles[num_tiles] = tile;
|
||||||
num_tiles++;
|
num_tiles++;
|
||||||
}
|
}
|
||||||
|
if (*opts->tilemapfile) {
|
||||||
tilemap->data[tilemap->size] = index;
|
tilemap->data[tilemap->size] = index;
|
||||||
tilemap->size++;
|
tilemap->size++;
|
||||||
}
|
}
|
||||||
|
if (*opts->attrmapfile) {
|
||||||
|
attrmap->data[attrmap->size] = flags;
|
||||||
|
attrmap->size++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (opts->unique) {
|
if (opts->unique) {
|
||||||
free(gb->data);
|
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,
|
void output_tilemap_file(const struct Options *opts,
|
||||||
const struct Tilemap *tilemap)
|
const struct Mapfile *tilemap)
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
f = fopen(opts->mapfile, "wb");
|
f = fopen(opts->tilemapfile, "wb");
|
||||||
if (!f)
|
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);
|
fwrite(tilemap->data, 1, tilemap->size, f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
if (opts->mapout)
|
if (opts->tilemapout)
|
||||||
free(opts->mapfile);
|
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,
|
void output_palette_file(const struct Options *opts,
|
||||||
|
|||||||
106
src/gfx/main.c
106
src/gfx/main.c
@@ -18,8 +18,8 @@
|
|||||||
static void print_usage(void)
|
static void print_usage(void)
|
||||||
{
|
{
|
||||||
printf(
|
printf(
|
||||||
"usage: rgbgfx [-DFfhPTuVv] [-d #] [-o outfile] [-p palfile] [-t mapfile]\n"
|
"usage: rgbgfx [-ADFfhmPTuVv] [-o outfile] [-a attrmap] [-d #] [-p palfile]\n"
|
||||||
" [-x #] infile\n");
|
" [-t tilemap] [-x #] infile\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,21 +30,29 @@ int main(int argc, char *argv[])
|
|||||||
struct ImageOptions png_options = {0};
|
struct ImageOptions png_options = {0};
|
||||||
struct RawIndexedImage *raw_image;
|
struct RawIndexedImage *raw_image;
|
||||||
struct GBImage gb = {0};
|
struct GBImage gb = {0};
|
||||||
struct Tilemap tilemap = {0};
|
struct Mapfile tilemap = {0};
|
||||||
|
struct Mapfile attrmap = {0};
|
||||||
char *ext;
|
char *ext;
|
||||||
const char *errmsg = "Warning: The PNG's %s setting is not the same as the setting defined on the command line.";
|
const char *errmsg = "Warning: The PNG's %s setting is not the same as the setting defined on the command line.";
|
||||||
|
|
||||||
if (argc == 1)
|
if (argc == 1)
|
||||||
print_usage();
|
print_usage();
|
||||||
|
|
||||||
opts.mapfile = "";
|
opts.tilemapfile = "";
|
||||||
|
opts.attrmapfile = "";
|
||||||
opts.palfile = "";
|
opts.palfile = "";
|
||||||
opts.outfile = "";
|
opts.outfile = "";
|
||||||
|
|
||||||
depth = 2;
|
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) {
|
switch (ch) {
|
||||||
|
case 'A':
|
||||||
|
opts.attrmapout = true;
|
||||||
|
break;
|
||||||
|
case 'a':
|
||||||
|
opts.attrmapfile = optarg;
|
||||||
|
break;
|
||||||
case 'D':
|
case 'D':
|
||||||
opts.debug = true;
|
opts.debug = true;
|
||||||
break;
|
break;
|
||||||
@@ -60,6 +68,10 @@ int main(int argc, char *argv[])
|
|||||||
case 'h':
|
case 'h':
|
||||||
opts.horizontal = true;
|
opts.horizontal = true;
|
||||||
break;
|
break;
|
||||||
|
case 'm':
|
||||||
|
opts.mirror = true;
|
||||||
|
opts.unique = true;
|
||||||
|
break;
|
||||||
case 'o':
|
case 'o':
|
||||||
opts.outfile = optarg;
|
opts.outfile = optarg;
|
||||||
break;
|
break;
|
||||||
@@ -70,10 +82,10 @@ int main(int argc, char *argv[])
|
|||||||
opts.palfile = optarg;
|
opts.palfile = optarg;
|
||||||
break;
|
break;
|
||||||
case 'T':
|
case 'T':
|
||||||
opts.mapout = true;
|
opts.tilemapout = true;
|
||||||
break;
|
break;
|
||||||
case 't':
|
case 't':
|
||||||
opts.mapfile = optarg;
|
opts.tilemapfile = optarg;
|
||||||
break;
|
break;
|
||||||
case 'u':
|
case 'u':
|
||||||
opts.unique = true;
|
opts.unique = true;
|
||||||
@@ -107,7 +119,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
raw_image = input_png_file(&opts, &png_options);
|
raw_image = input_png_file(&opts, &png_options);
|
||||||
|
|
||||||
png_options.mapfile = "";
|
png_options.tilemapfile = "";
|
||||||
|
png_options.attrmapfile = "";
|
||||||
png_options.palfile = "";
|
png_options.palfile = "";
|
||||||
|
|
||||||
if (png_options.horizontal != opts.horizontal) {
|
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);
|
(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)
|
if (opts.verbose)
|
||||||
warnx(errmsg, "tilemap file");
|
warnx(errmsg, "tilemap file");
|
||||||
|
|
||||||
if (opts.hardfix)
|
if (opts.hardfix)
|
||||||
png_options.mapfile = opts.mapfile;
|
png_options.tilemapfile = opts.tilemapfile;
|
||||||
}
|
}
|
||||||
if (!*opts.mapfile)
|
if (!*opts.tilemapfile)
|
||||||
opts.mapfile = png_options.mapfile;
|
opts.tilemapfile = png_options.tilemapfile;
|
||||||
|
|
||||||
if (png_options.mapout != opts.mapout) {
|
if (png_options.tilemapout != opts.tilemapout) {
|
||||||
if (opts.verbose)
|
if (opts.verbose)
|
||||||
warnx(errmsg, "tilemap file");
|
warnx(errmsg, "tilemap file");
|
||||||
|
|
||||||
if (opts.hardfix)
|
if (opts.hardfix)
|
||||||
png_options.mapout = opts.mapout;
|
png_options.tilemapout = opts.tilemapout;
|
||||||
}
|
}
|
||||||
if (png_options.mapout)
|
if (png_options.tilemapout)
|
||||||
opts.mapout = png_options.mapout;
|
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 (strcmp(png_options.palfile, opts.palfile) != 0) {
|
||||||
if (opts.verbose)
|
if (opts.verbose)
|
||||||
@@ -189,19 +222,35 @@ int main(int argc, char *argv[])
|
|||||||
if (png_options.palout)
|
if (png_options.palout)
|
||||||
opts.palout = png_options.palout;
|
opts.palout = png_options.palout;
|
||||||
|
|
||||||
if (!*opts.mapfile && opts.mapout) {
|
if (!*opts.tilemapfile && opts.tilemapout) {
|
||||||
ext = strrchr(opts.infile, '.');
|
ext = strrchr(opts.infile, '.');
|
||||||
|
|
||||||
if (ext != NULL) {
|
if (ext != NULL) {
|
||||||
size = ext - opts.infile + 9;
|
size = ext - opts.infile + 9;
|
||||||
opts.mapfile = malloc(size);
|
opts.tilemapfile = malloc(size);
|
||||||
strncpy(opts.mapfile, opts.infile, size);
|
strncpy(opts.tilemapfile, opts.infile, size);
|
||||||
*strrchr(opts.mapfile, '.') = '\0';
|
*strrchr(opts.tilemapfile, '.') = '\0';
|
||||||
strcat(opts.mapfile, ".tilemap");
|
strcat(opts.tilemapfile, ".tilemap");
|
||||||
} else {
|
} else {
|
||||||
opts.mapfile = malloc(strlen(opts.infile) + 9);
|
opts.tilemapfile = malloc(strlen(opts.infile) + 9);
|
||||||
strcpy(opts.mapfile, opts.infile);
|
strcpy(opts.tilemapfile, opts.infile);
|
||||||
strcat(opts.mapfile, ".tilemap");
|
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.trim = opts.trim;
|
||||||
gb.horizontal = opts.horizontal;
|
gb.horizontal = opts.horizontal;
|
||||||
|
|
||||||
if (*opts.outfile || *opts.mapfile) {
|
if (*opts.outfile || *opts.tilemapfile || *opts.attrmapfile) {
|
||||||
raw_to_gb(raw_image, &gb);
|
raw_to_gb(raw_image, &gb);
|
||||||
create_tilemap(&opts, &gb, &tilemap);
|
create_mapfiles(&opts, &gb, &tilemap, &attrmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*opts.outfile)
|
if (*opts.outfile)
|
||||||
output_file(&opts, &gb);
|
output_file(&opts, &gb);
|
||||||
|
|
||||||
if (*opts.mapfile)
|
if (*opts.tilemapfile)
|
||||||
output_tilemap_file(&opts, &tilemap);
|
output_tilemap_file(&opts, &tilemap);
|
||||||
|
|
||||||
|
if (*opts.attrmapfile)
|
||||||
|
output_attrmap_file(&opts, &attrmap);
|
||||||
|
|
||||||
if (*opts.palfile)
|
if (*opts.palfile)
|
||||||
output_palette_file(&opts, raw_image);
|
output_palette_file(&opts, raw_image);
|
||||||
|
|
||||||
|
|||||||
@@ -649,10 +649,16 @@ static void get_text(const struct PNGImage *img,
|
|||||||
png_options->trim = strtoul(text[i].text, NULL, 0);
|
png_options->trim = strtoul(text[i].text, NULL, 0);
|
||||||
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
|
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
|
||||||
} else if (strcmp(text[i].key, "t") == 0) {
|
} 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);
|
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
|
||||||
} else if (strcmp(text[i].key, "T") == 0 && !*text[i].text) {
|
} 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);
|
png_free_data(img->png, img->info, PNG_FREE_TEXT, i);
|
||||||
} else if (strcmp(text[i].key, "p") == 0) {
|
} else if (strcmp(text[i].key, "p") == 0) {
|
||||||
png_options->palfile = text[i].text;
|
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;
|
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
png_set_text(img->png, img->info, text, 1);
|
png_set_text(img->png, img->info, text, 1);
|
||||||
}
|
}
|
||||||
if (*png_options->mapfile) {
|
if (*png_options->tilemapfile) {
|
||||||
text[0].key = "t";
|
text[0].key = "t";
|
||||||
text[0].text = "";
|
text[0].text = "";
|
||||||
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
png_set_text(img->png, img->info, text, 1);
|
png_set_text(img->png, img->info, text, 1);
|
||||||
}
|
}
|
||||||
if (png_options->mapout) {
|
if (png_options->tilemapout) {
|
||||||
text[0].key = "T";
|
text[0].key = "T";
|
||||||
text[0].text = "";
|
text[0].text = "";
|
||||||
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
text[0].compression = PNG_TEXT_COMPRESSION_NONE;
|
||||||
png_set_text(img->png, img->info, text, 1);
|
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) {
|
if (*png_options->palfile) {
|
||||||
text[0].key = "p";
|
text[0].key = "p";
|
||||||
text[0].text = "";
|
text[0].text = "";
|
||||||
|
|||||||
@@ -13,11 +13,12 @@
|
|||||||
.Nd Game Boy graphics converter
|
.Nd Game Boy graphics converter
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.Nm rgbgfx
|
.Nm rgbgfx
|
||||||
.Op Fl DfFhPTVv
|
.Op Fl ADfFhmPTuVv
|
||||||
.Op Fl o Ar outfile
|
.Op Fl o Ar outfile
|
||||||
|
.Op Fl a Ar attrmap
|
||||||
.Op Fl d Ar depth
|
.Op Fl d Ar depth
|
||||||
.Op Fl p Ar palfile
|
.Op Fl p Ar palfile
|
||||||
.Op Fl t Ar mapfile
|
.Op Fl t Ar tilemap
|
||||||
.Op Fl x Ar tiles
|
.Op Fl x Ar tiles
|
||||||
.Ar file
|
.Ar file
|
||||||
.Sh DESCRIPTION
|
.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.
|
allows. Transparent pixels are set to palette index 0.
|
||||||
.Sh ARGUMENTS
|
.Sh ARGUMENTS
|
||||||
.Bl -tag -width Ds
|
.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
|
.It Fl D
|
||||||
Debug features are enabled.
|
Debug features are enabled.
|
||||||
.It Fl f
|
.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).
|
By default, the bit depth is 2 (two bits per pixel).
|
||||||
.It Fl h
|
.It Fl h
|
||||||
Lay out tiles horizontally rather than vertically.
|
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
|
.It Fl o Ar outfile
|
||||||
The name of the output file.
|
The name of the output file.
|
||||||
.It Fl p Ar palfile
|
.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
|
but the palette file output name is made by taking the input PNG file's
|
||||||
filename, removing the file extension, and appending
|
filename, removing the file extension, and appending
|
||||||
.Pa .pal .
|
.Pa .pal .
|
||||||
.It Fl t Ar mapfile
|
.It Fl t Ar tilemap
|
||||||
If any tiles are the same, don't place the repeat tiles in the output file, and
|
Generate a file of tile indices. For each tile in the input file, a byte is
|
||||||
make a tilemap file.
|
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
|
.It Fl T
|
||||||
Same as
|
Same as
|
||||||
.Fl t ,
|
.Fl t ,
|
||||||
but the tilemap file output name is made by taking the input filename,
|
but the tilemap file output name is made by taking the input filename, removing
|
||||||
removing the file extension, and appending
|
the file extension, and appending
|
||||||
.Pa .tilemap .
|
.Pa .tilemap .
|
||||||
.It Fl u
|
.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
|
.It Fl V
|
||||||
Print the version of the program and exit.
|
Print the version of the program and exit.
|
||||||
.It Fl v
|
.It Fl v
|
||||||
@@ -105,6 +132,14 @@ The following creates a planar 2bpp file with only unique tiles, and its tilemap
|
|||||||
.Pp
|
.Pp
|
||||||
.D1 $ rgbgfx -T -u -o out.2bpp in.png
|
.D1 $ rgbgfx -T -u -o out.2bpp in.png
|
||||||
.Pp
|
.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:
|
The following will do nothing:
|
||||||
.Pp
|
.Pp
|
||||||
.D1 $ rgbgfx in.png
|
.D1 $ rgbgfx in.png
|
||||||
|
|||||||
Reference in New Issue
Block a user