shithub: rgbds

ref: 736b7727b6e8aeff780ded36b6621464d1228550
dir: /docs/rgblink.1.html/

View raw version
<!DOCTYPE html>
<html>
<!-- This is an automatically generated file.  Do not edit.
   This file is part of RGBDS.

   Copyright (c) 2010-2018, Anthony J. Bentley and RGBDS contributors.

   SPDX-License-Identifier: MIT
   -->
<head>
  <meta charset="utf-8"/>
  <link rel="stylesheet" href="mandoc.css" type="text/css" media="all"/>
  <title>RGBLINK(1)</title>
</head>
<body>
<table class="head">
  <tr>
    <td class="head-ltitle">RGBLINK(1)</td>
    <td class="head-vol">General Commands Manual</td>
    <td class="head-rtitle">RGBLINK(1)</td>
  </tr>
</table>
<div class="manual-text">
<section class="Sh">
<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
<code class="Nm">rgblink</code> &#x2014;
<div class="Nd">Game Boy linker</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
<table class="Nm">
  <tr>
    <td><code class="Nm">rgblink</code></td>
    <td>[<code class="Fl">-dtVw</code>] [<code class="Fl">-m</code>
      <var class="Ar">mapfile</var>] [<code class="Fl">-n</code>
      <var class="Ar">symfile</var>] [<code class="Fl">-O</code>
      <var class="Ar">overlayfile</var>] [<code class="Fl">-o</code>
      <var class="Ar">outfile</var>] [<code class="Fl">-p</code>
      <var class="Ar">pad_value</var>] [<code class="Fl">-s</code>
      <var class="Ar">symbol</var>] [<code class="Fl">-l</code>
      <var class="Ar">linkerscript</var>] <var class="Ar">file ...</var></td>
  </tr>
</table>
</section>
<section class="Sh">
<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
The <code class="Nm">rgblink</code> program links objects created by
  <a class="Xr">rgbasm(1)</a> into a single Game Boy ROM file.
<p class="Pp">By default, ROM0 sections created by the assembler are placed in
    the 16KiB bank 0, and ROMX sections are placed in any bank except bank 0. If
    your ROM will only be 32KiB, you can use the <code class="Fl">-t</code>
    option to override this.</p>
<p class="Pp">Similarly, WRAM0 sections are placed in the first 4KiB of WRAM
    bank 0 and WRAMX sections are placed in any bank except bank 0. If your ROM
    doesn't use banked WRAM you can use option <code class="Fl">-w</code> option
    to override this.</p>
<p class="Pp">Also, if your ROM is designed for DMG, you can make sure that you
    don't use any prohibited section by using the option
    <code class="Fl">-d</code>, which implies <code class="Fl">-w</code> but
    also prohibits the use of VRAM bank 1.</p>
<p class="Pp">The arguments are as follows:</p>
<dl class="Bl-tag">
  <dt><a class="permalink" href="#m"><code class="Fl" id="m">-m</code></a>
    <var class="Ar">mapfile</var></dt>
  <dd>Write a mapfile to the given filename.</dd>
  <dt><a class="permalink" href="#n"><code class="Fl" id="n">-n</code></a>
    <var class="Ar">symfile</var></dt>
  <dd>Write a symbol file to the given filename.</dd>
  <dt><a class="permalink" href="#O"><code class="Fl" id="O">-O</code></a>
    <var class="Ar">overlayfile</var></dt>
  <dd>The ROM image to overlay sections over. When an overlay ROM is provided,
      all sections must be fixed. This may be used to patch an existing
    binary.</dd>
  <dt><a class="permalink" href="#o"><code class="Fl" id="o">-o</code></a>
    <var class="Ar">outfile</var></dt>
  <dd>Write ROM image to the given filename.</dd>
  <dt><a class="permalink" href="#p"><code class="Fl" id="p">-p</code></a>
    <var class="Ar">pad_value</var></dt>
  <dd>When padding an image, pad with this value. The default is 0x00.</dd>
  <dt><a class="permalink" href="#s"><code class="Fl" id="s">-s</code></a>
    <var class="Ar">symbol</var></dt>
  <dd>???</dd>
  <dt><a class="permalink" href="#w"><code class="Fl" id="w">-w</code></a></dt>
  <dd>Expand the WRAM0 section size from 4KiB to the full 8KiB assigned to WRAM
      and prohibit the use of WRAMX sections.</dd>
  <dt><a class="permalink" href="#d"><code class="Fl" id="d">-d</code></a></dt>
  <dd>Enable DMG mode. Prohibit the use of sections that doesn't exist on a DMG,
      such as WRAMX and VRAM bank 1. This option automatically enables
      <code class="Fl">-w</code>.</dd>
  <dt><a class="permalink" href="#t"><code class="Fl" id="t">-t</code></a></dt>
  <dd>Expand the ROM0 section size from 16KiB to the full 32KiB assigned to ROM
      and prohibit the use of ROMX sections. Useful for ROMs that fit in 32
    KiB.</dd>
  <dt><a class="permalink" href="#l"><code class="Fl" id="l">-l</code></a>
    <var class="Ar">linkerscript</var></dt>
  <dd>Specify a linkerscript file that tells the linker how sections must be
      placed in the ROM. This file has priority over the attributes assigned in
      the source code, but they have to be consistent. See
      <a class="Xr">rgblink(5)</a> for more information about its format.</dd>
  <dt><a class="permalink" href="#V"><code class="Fl" id="V">-V</code></a></dt>
  <dd>Print the version of the program and exit.</dd>
</dl>
</section>
<section class="Sh">
<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1>
All you need for a basic ROM is an object file, which can be made into a ROM
  image like so:
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgblink -o bar.gb foo.o</div>
<p class="Pp">The resulting bar.gb will not have correct checksums (unless you
    put them in the assembly source). You should use <a class="Xr">rgbfix(1)</a>
    to fix these so that the program will actually run in a Game Boy:</p>
<p class="Pp"></p>
<div class="Bd Bd-indent">$ rgbfix -v bar.gb</div>
</section>
<section class="Sh">
<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
  ALSO</a></h1>
<a class="Xr">rgbasm(1)</a>, <a class="Xr">rgblink(5)</a>,
  <a class="Xr">rgbfix(1)</a>, <a class="Xr">rgbds(5)</a>,
  <a class="Xr">rgbds(7)</a>
</section>
<section class="Sh">
<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
<code class="Nm">rgblink</code> was originally written by Carsten
  S&#x00F8;rensen as part of the ASMotor package, and was later packaged in
  RGBDS by Justin Lloyd. It is now maintained by a number of contributors at
  <a class="Lk" href="https://github.com/rednex/rgbds">https://github.com/rednex/rgbds</a>.
</section>
</div>
<table class="foot">
  <tr>
    <td class="foot-date">January 26, 2018</td>
    <td class="foot-os">RGBDS Manual</td>
  </tr>
</table>
</body>
</html>