Rewrite rgbfix from scratch, under a free ISC license.

Slight changes in usage; the man page has been updated accordingly.
This commit is contained in:
Anthony J. Bentley
2010-12-22 13:48:44 -07:00
parent 05be8e0011
commit d2f52fdd0c
2 changed files with 406 additions and 17 deletions

View File

@@ -7,9 +7,11 @@
.\" SECTION
.Sh SYNOPSIS
.Nm rgbfix
.Op Fl Ccdjqrsv
.Op Fl Ccjsv
.Op Fl k Ar licensee_str
.Op Fl l Ar licensee_id
.Op Fl m Ar mbc_type
.Op Fl n Ar rom_version
.Op Fl p Ar pad_value
.Op Fl r Ar ram_size
.Op Fl t Ar title_str
@@ -24,19 +26,18 @@ The arguments are as follows:
.Bl -tag -width Ds
.\" ITEM
.It Fl C
Set the Game Boy Color compatible flag: [0x143] = 0x80.
This flag and the
Set the Game Boy Color\(enonly flag: [0x143] = 0xC0.
If both this and the
.Fl c
flag are mutually exclusive.
flag are set, this takes precedence.
.\" ITEM
.It Fl c
Set the Game Boy Color only flag: [0x143] = 0xC0.
This flag and the
Set the Game Boy Color\(encompatible flag: [0x143] = 0x80.
If both this and the
.Fl C
flag are mutually exclusive.
.\" ITEM
.It Fl d
Don't perform any changes, just pretend to for debugging.
flag are set,
.Fl C
takes precedence.
.\" ITEM
.It Fl j
Set the non-Japanese region flag: [0x14A] = 1.
@@ -45,9 +46,16 @@ Set the non-Japanese region flag: [0x14A] = 1.
Set the new licensee string ([0x144\(en0x145]) to a given string, truncated
to at most two characters.
.\" ITEM
.It Fl l Ar licensee_id
Set the old licensee code, [0x14B], to a given value from 0 to 0xFF.
This value is deprecated and should be set to 0x33 in all new software.
.\" ITEM
.It Fl m Ar mbc_type
Set the MBC type, [0x147], to a given value from 0 to 0xFF.
.\" ITEM
.It Fl n Ar rom_version
Set the ROM version, [0x14C], to a given value from 0 to 0xFF.
.\" ITEM
.It Fl p Ar pad_value
Pad the image to a valid size with a given pad value from 0 to 0xFF.
.Nm
@@ -55,14 +63,11 @@ will automatically pick a size from 32KiB, 64KiB, 128KiB, ..., 8192KiB and
give a warning thereafter.
The cartridge size byte ([0x148]) will be changed to reflect this new size.
.\" ITEM
.It Fl q
Enable quiet mode, suppressing all text except errors.
.\" ITEM
.It Fl r Ar ram_size
Set the RAM size, [0x149], to a given value from 0 to 0xFF.
.\" ITEM
.It Fl s
Set the SGB flag: [0x146] = 3, and set the old licensee code: [0x14B] = 0x33.
Set the SGB flag: [0x146] = 3.
.\" ITEM
.It Fl t Ar title
Set the title string ([0x134\(en0x143]) to a given string, truncated to at
@@ -97,12 +102,12 @@ The following will make a SGB-enabled, color-enabled game with a title of
(The Game Boy itself does not use the title, but some emulators or ROM managers
might.)
.Pp
.D1 $ rgbfix \-vCs \-p 0 \-t foobar baz.gb
.D1 $ rgbfix \-vcs \-p 0 \-t foobar baz.gb
.Pp
The following will duplicate the header (sans global checksum) of the game
"Survival Kids":
.Pp
.D1 $ rgbfix \-Cjsv \-k A4 \-m 0x1B \-p 0xFF \-r 3 \-t SURVIVALKIDAVKE SurvivalKids.gbc
.D1 $ rgbfix \-cjsv \-k A4 \-m 0x1B \-p 0xFF \-r 3 \-t SURVIVALKIDAVKE SurvivalKids.gbc
.\" SECTION
.Sh SEE ALSO
.Xr rgbds 7 ,