1RGBLINK(1)                BSD General Commands Manual               RGBLINK(1)
2

NAME

4     rgblink — Game Boy linker
5

SYNOPSIS

7     rgblink [-t] [-w] [-d] [-m mapfile] [-n symfile] [-O overlayfile]
8             [-o outfile] [-p pad_value] [-s symbol] [-l linkerscript]
9             file ...
10

DESCRIPTION

12     The rgblink program links objects created by rgbasm(1) into a single Game
13     Boy ROM file.
14
15     By default, ROM0 sections created by the assembler are placed in the
16     16KiB bank 0, and ROMX sections are placed in any bank except bank 0.  If
17     your ROM will only be 32KiB, you can use the -t option to override this.
18
19     Similarly, WRAM0 sections are placed in the first 4KiB of WRAM bank 0 and
20     WRAMX sections are placed in any bank except bank 0.  If your ROM doesn't
21     use banked WRAM you can use option -w option to override this.
22
23     Also, if your ROM is designed for DMG, you can make sure that you don't
24     use any prohibited section by using the option -d, which implies -w but
25     also prohibits the use of VRAM bank 1.
26
27     The arguments are as follows:
28
29     -m mapfile
30             Write a mapfile to the given filename.
31
32     -n symfile
33             Write a symbol file to the given filename.
34
35     -O overlayfile
36             The ROM image to overlay sections over.  When an overlay ROM is
37             provided, all sections must be fixed.  This may be used to patch
38             an existing binray.
39
40     -o outfile
41             Write ROM image to the given filename.
42
43     -p pad_value
44             When padding an image, pad with this value.  The default is 0x00.
45
46     -s symbol
47             ???
48
49     -w      Expand the WRAM0 section size from 4KiB to the full 8KiB assigned
50             to WRAM and prohibit the use of WRAMX sections.
51
52     -d      Enable DMG mode.  Prohibit the use of sections that doesn't exist
53             on a DMG, such as WRAMX and VRAM bank 1.  This option automati‐
54             cally enables -w.
55
56     -t      Expand the ROM0 section size from 16KiB to the full 32KiB
57             assigned to ROM and prohibit the use of ROMX sections.  Useful
58             for ROMs that fit in 32 KiB.
59
60     -l linkerscript
61             Specify a linkerscript file that tells the linker how sections
62             must be placed in the ROM.  This file has priority over the
63             attributes assigned in the source code, but they have to be con‐
64             sistent.  See rgblink(5) for more information about its format.
65

EXAMPLES

67     All you need for a basic ROM is an object file, which can be made into a
68     ROM image like so:
69
70           $ rgblink -o bar.gb foo.o
71
72     The resulting bar.gb will not have correct checksums (unless you put them
73     in the assembly source).  You should use rgbfix(1) to fix these so that
74     the program will actually run in a Game Boy:
75
76           $ rgbfix -v bar.gb
77

SEE ALSO

79     rgbasm(1), rgblink(5), rgbfix(1), rgbds(5), rgbds(7)
80

HISTORY

82     rgblink was originally written by Carsten Sørensen as part of the ASMotor
83     package, and was later packaged in RGBDS by Justin Lloyd. It is now main‐
84     tained by a number of contributors at .:
85           https://github.com/rednex/rgbds
86
87RGBDS Manual                    April 17, 2017                    RGBDS Manual
Impressum