shithub: rgbds

ref: 6f46058e21cd7752b004288a8deb0d458fe74ac1
dir: /src/link/rgblink.1/

View raw version
.Dd $\&Mdocdate$
.Dt RGBLINK 1
.Os RGBDS Manual
.Sh NAME
.Nm rgblink
.Nd Game Boy linker
.\" SECTION
.Sh SYNOPSIS
.Nm rgblink
.Op Fl t
.Op Fl l Ar library
.Op Fl m Ar mapfile
.Op Fl n Ar symfile
.Op Fl o Ar outfile
.Op Fl p Ar pad_value
.Op Fl s Ar symbol
.Ar
.\" SECTION
.Sh DESCRIPTION
The
.Nm
program links objects created by
.Xr rgbasm 1
into a single Game Boy ROM file.
.Pp
By default, HOME sections created by the assembler are placed in the 16KiB
bank 0, and CODE/DATA sections are placed in any bank except bank 0.
If your ROM will only be 32KiB, you can use the
.Fl t
option to override this.
.Pp
The arguments are as follows:
.Bl -tag -width Ds
.\" ITEM
.It Fl l Ar library
Include a referenced library module created with
.Xr rgblib 1 .
Note that specified libraries will be included only if needed\(emthat is, if
a SECTION from a library is referenced by an object file.
Only the relevant SECTION will be included, rather than the entire module.
.\" ITEM
.It Fl m Ar mapfile
Write a mapfile to the given filename.
.\" ITEM
.It Fl n Ar symfile
Write a symbol file to the given filename.
.\" ITEM
.It Fl o Ar outfile
Write ROM image to the given filename.
.\" ITEM
.It Fl p Ar pad_value
When padding an image, pad with this value. The default is 0x00.
.\" ITEM
.It Fl s Ar symbol
???
.\" ITEM
.It Fl t
Write a tiny (32KiB) ROM file. This forces all DATA/CODE sections to be of
type HOME, and increases the HOME section size from 16KiB to 32KiB.
.El
.\" SECTION
.Sh EXAMPLES
All you need for a basic ROM is an object file, which can be made into a ROM
image like so:
.Pp
.D1 $ rgblink \-o bar.gb foo.o
.Pp
The resulting bar.gb will not have correct checksums (unless you put them in
the assembly source).
You should use
.Xr rgbfix 1
to fix these so that the program will actually run in a Game Boy:
.Pp
.D1 $ rgbfix \-v bar.gb
.\" SECTION
.Sh SEE ALSO
.Xr rgbds 7 ,
.Xr rgbasm 1 ,
.Xr rgbfix 1 ,
.Xr rgblib 1 ,
.Xr gbz80 7
.\" SECTION
.Sh HISTORY
.Nm
was originally written by Carsten S\(/orensen as part of the ASMotor package,
and was later packaged in RGBDS by Justin Lloyd.