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

NAME

4     rgbfix — Game Boy header utility and checksum fixer
5

SYNOPSIS

7     rgbfix [-jsVv] [-C | -c] [-f fix_spec] [-i game_id] [-k licensee_str]
8            [-l licensee_id] [-m mbc_type] [-n rom_version] [-p pad_value]
9            [-r ram_size] [-t title_str] file
10

DESCRIPTION

12     The rgbfix program changes headers of Game Boy ROM images.  It also per‐
13     forms other correctness operations, such as padding.
14
15     Note that options can be abbreviated as long as the abbreviation is unam‐
16     biguous: --verb is --verbose, but --ver is invalid because it could also
17     be --version.  The arguments are as follows:
18
19     -C, --color-only
20             Set the Game Boy Color–only flag: 0x143 = 0xC0.  If both this and
21             the -c flag are set, this takes precedence.
22
23     -c, --color-compatible
24             Set the Game Boy Color–compatible flag: 0x143 = 0x80.  If both
25             this and the -C flag are set, -C takes precedence.
26
27     -f fix_spec, --fix-spec fix_spec
28             Fix certain header values that the Game Boy checks for correct‐
29             ness.  Alternatively, intentionally trash these values by writing
30             their binary inverse instead.  fix_spec is a string containing
31             any combination of the following characters:
32
33             l   Fix the Nintendo logo (0x1040x133).
34             L   Trash the Nintendo logo.
35             h   Fix the header checksum (0x14D).
36             H   Trash the header checksum.
37             g   Fix the global checksum (0x14E0x14F).
38             G   Trash the global checksum.
39
40     -i game_id, --game-id game_id
41             Set the game ID string (0x13F0x142) to a given string of exactly
42             4 characters.  If both this and the title are set, the game ID
43             will overwrite the overlapping portion of the title.
44
45     -j, --non-japanese
46             Set the non-Japanese region flag: 0x14A = 1.
47
48     -k licensee_str, --new-licensee licensee_str
49             Set the new licensee string (0x1440x145) to a given string,
50             truncated to at most two characters.
51
52     -l licensee_id, --old-licensee licensee_id
53             Set the old licensee code, 0x14B, to a given value from 0 to
54             0xFF.  This value is deprecated and should be set to 0x33 in all
55             new software.
56
57     -m mbc_type, --mbc-type mbc_type
58             Set the MBC type, 0x147, to a given value from 0 to 0xFF.
59
60     -n rom_version, --rom-version rom_version
61             Set the ROM version, 0x14C, to a given value from 0 to 0xFF.
62
63     -p pad_value, --pad-value pad_value
64             Pad the image to a valid size with a given pad value from 0 to
65             0xFF.  rgbfix will automatically pick a size from 32 KiB, 64 KiB,
66             128 KiB, ..., 8192 KiB.  The cartridge size byte (0x148) will be
67             changed to reflect this new size.
68
69     -r ram_size, --ram-size ram_size
70             Set the RAM size, 0x149, to a given value from 0 to 0xFF.
71
72     -s, --sgb-compatible
73             Set the SGB flag: 0x146 = 3. This flag will be ignored by the SGB
74             unless the old licensee code is 0x33!
75
76     -t title, --title title
77             Set the title string (0x1340x143) to a given string, truncated
78             to at most 16 characters.  It is recommended to use 15 characters
79             instead, to avoid clashing with the CGB flag (-c or -C).  If both
80             this and the game ID are set, the game ID will overwrite the
81             overlapping portion of the title.
82
83     -V, --version
84             Print the version of the program and exit.
85
86     -v, --validate
87             Equivalent to -f lhg.
88

EXAMPLES

90     Most values in the ROM header are only cosmetic.  The bare minimum
91     requirements for a workable program are the header checksum, the Nintendo
92     logo, and (if needed) the CGB/SGB flags.  It is a good idea to pad the
93     image to a valid size as well (“valid” meaning a power of 2, times 32
94     KiB).
95
96     The following will make a plain, non-color Game Boy game without checking
97     for a valid size:
98
99           $ rgbfix -v foo.gb
100
101     The following will make a SGB-enabled, color-enabled game with a title of
102     “foobar”, and pad it to a valid size.  (The Game Boy itself does not use
103     the title, but some emulators or ROM managers do.)
104
105           $ rgbfix -vcs -l 0x33 -p 255 -t foobar baz.gb
106
107     The following will duplicate the header (sans global checksum) of the
108     game “Survival Kids”:
109
110           $ rgbfix -cjsv -k A4 -l 0x33 -m 0x1B -p 0xFF -r 3 -t
111           SURVIVALKIDAVKE SurvivalKids.gbc
112

BUGS

114     Please report bugs on GitHub:
115           https://github.com/gbdev/rgbds/issues.
116

SEE ALSO

118     rgbasm(1), rgblink(1), rgbds(7)
119

HISTORY

121     rgbfix was originally released by Carsten Sørensen as a standalone pro‐
122     gram called gbfix, and was later packaged in RGBDS by Justin Lloyd.  It
123     is now maintained by a number of contributors at .:
124           https://github.com/gbdev/rgbds
125
126BSD                            December 5, 2019                            BSD
Impressum