ref: 114871d46de3e7c380e0fd1d27ef31badb70416e
parent: 5ae2dc4844970182ee611531de400f247504986f
author: Anthony J. Bentley <[email protected]>
date: Wed Dec 22 09:23:35 EST 2010
Move manuals to the main source directories.
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,6 @@
@rm -rf rgblink $(rgblink_obj)
@rm -rf rgbfix $(rgbfix_obj)
@rm -rf src/asm/asmy.c
- @rm -rf rgbasm.0 rgbfix.0 rgblib.0 rgblink.0
rgbasm: $(rgbasm_obj)
@${CC} $(CFLAGS) -o $@ $(rgbasm_obj) -lm
@@ -68,17 +67,3 @@
src/asm/asmy.y: $(yacc_pre)
@cat $(yacc_pre) > $@
-
-man: rgbasm.0 rgbfix.0 rgblib.0 rgblink.0
-
-rgbasm.0: man/rgbasm.1
- nroff -mdoc man/rgbasm.1 > rgbasm.0
-
-rgbfix.0: man/rgbfix.1
- nroff -mdoc man/rgbfix.1 > rgbfix.0
-
-rgblib.0: man/rgblib.1
- nroff -mdoc man/rgblib.1 > rgblib.0
-
-rgblink.0: man/rgblink.1
- nroff -mdoc man/rgblink.1 > rgblink.0
--- a/README
+++ b/README
@@ -24,13 +24,4 @@
There is no install target -- just copy the binaries (rgbasm, rgbfix, rgblib,
and rgblink) to a folder in your $PATH.
-To build the documentation, use the man target:
-
- make man
-
-This will create manual pages (rgbasm.0, rgbfix.0, rgblib.0, and rgblink.0)
-which can be read with a pager such as more(1):
-
- more rgbasm.0
-
There are no Windows installation instructions at this time.
--- a/man/rgbasm.1
+++ /dev/null
@@ -1,64 +1,0 @@
-.Dd $\&Mdocdate$
-.Dt RGBASM 1
-.Os RGBDS Manual
-.Sh NAME
-.Nm rgbasm
-.Nd Game Boy assembler
-.\" SECTION
-.Sh SYNOPSIS
-.Nm rgbasm
-.Op Fl b Ar chars
-.Op Fl g Ar chars
-.Op Fl i Ar path
-.Op Fl o Ar outfile
-.Op Fl p Ar pad_value
-.Ar file
-.\" SECTION
-.Sh DESCRIPTION
-The
-.Nm
-program creates an object file from an assembly source file.
-Its arguments are as follows:
-.Bl -tag -width Ds
-.\" ITEM
-.It Fl b Ar chars
-Change the two characters used for binary constants.
-The defaults are 01.
-.\" ITEM
-.It Fl g Ar chars
-Change the four characters used for binary constants.
-The defaults are 0123.
-.\" ITEM
-.It Fl i Ar path
-Add an include path.
-.\" ITEM
-.It Fl o Ar outfile
-Write an object file to the given filename.
-.\" ITEM
-.It Fl p Ar pad_value
-When padding an image, pad with this value.
-The default is 0x00.
-.El
-.\" SECTION
-.Sh EXAMPLES
-Assembling a basic source file is simple:
-.Pp
-.D1 $ rgbasm \-o bar.o foo.asm
-.Pp
-The resulting object file is not yet a usable ROM image \(em it must first be
-run through
-.Xr rgblink 1
-and
-.Xr rgbfix 1 .
-.\" SECTION
-.Sh SEE ALSO
-.Xr rgbds 7 ,
-.Xr rgbfix 1 ,
-.Xr rgblib 1 ,
-.Xr rgblink 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.
--- a/man/rgbfix.1
+++ /dev/null
@@ -1,123 +1,0 @@
-.Dd $\&Mdocdate$
-.Dt RGBFIX 1
-.Os RGBDS Manual
-.Sh NAME
-.Nm rgbfix
-.Nd Game Boy checksum fixer
-.\" SECTION
-.Sh SYNOPSIS
-.Nm rgbfix
-.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
-.Ar file Ns Op .gb
-.\" SECTION
-.Sh DESCRIPTION
-The
-.Nm
-program changes headers of Game Boy ROM images.
-It also performs other filetype operations, such as truncation.
-The arguments are as follows:
-.Bl -tag -width Ds
-.\" ITEM
-.It Fl C
-Set the Game Boy Color\(enonly flag: [0x143] = 0xC0.
-If both this and the
-.Fl c
-flag are set, this takes precedence.
-.\" ITEM
-.It Fl c
-Set the Game Boy Color\(encompatible flag: [0x143] = 0x80.
-If both this and the
-.Fl C
-flag are set,
-.Fl C
-takes precedence.
-.\" ITEM
-.It Fl j
-Set the non-Japanese region flag: [0x14A] = 1.
-.\" ITEM
-.It Fl k Ar licensee_str
-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
-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 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.
-.\" ITEM
-.It Fl t Ar title
-Set the title string ([0x134\(en0x143]) to a given string, truncated to at
-most 16 characters.
-It is recommended to use 15 characters instead, to avoid clashing with the CGB
-flag (
-.Fl c
-or
-.Fl C
-.Ns ).
-.\" ITEM
-.It Fl v
-Validate the header and fix checksums: the Nintendo character area
-([0x104\(en0x133]), the header checksum ([0x14D]), and the global checksum
-([0x14E\(en0x14F]).
-.El
-.\" SECTION
-.Sh EXAMPLES
-Most values in the ROM header are only cosmetic.
-The bare minimum requirements for a workable image are checksums, the Nintendo
-logo, and (if needed) the CGB/SGB flags.
-It is a good idea to pad the image to a valid size as well ("valid" meaning a
-multiple of 32KiB).
-.Pp
-The following will make a plain, no-color Game Boy game without checking for
-a valid size:
-.Pp
-.D1 $ rgbfix \-v foo.gb
-.Pp
-The following will make a SGB-enabled, color-enabled game with a title of
-"foobar", and pad it to a multiple of 32KiB.
-(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
-.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
-.\" SECTION
-.Sh SEE ALSO
-.Xr rgbds 7 ,
-.Xr rgbasm 1 ,
-.Xr rgblib 1 ,
-.Xr rgblink 1 ,
-.Xr gbz80 7
-.\" SECTION
-.Sh HISTORY
-.Nm
-was originally released by Carsten S\(/orensen as a standalone program called
-gbfix.
-It was later integrated with the ASMotor package, which became RGBDS.
--- a/man/rgblib.1
+++ /dev/null
@@ -1,44 +1,0 @@
-.Dd $\&Mdocdate$
-.Dt RGBLIB 1
-.Os RGBDS Manual
-.Sh NAME
-.Nm rgblib
-.Nd Game Boy library manager
-.\" SECTION
-.Sh SYNOPSIS
-.Nm rgblib
-.Ar library
-.Op add | delete | extract | list
-.Ar module ...
-.\" SECTION
-.Sh DESCRIPTION
-The
-.Nm
-program manages libraries for use with
-.Xr rgblink 1 .
-.Bl -tag -width Ds
-.\" ITEM
-.It add
-Add the given modules to the library.
-.\" ITEM
-.It delete
-Delete the given modules from the library.
-.\" ITEM
-.It extract
-Extract the given modules from the library.
-.\" ITEM
-.It list
-List all the modules in the library.
-.El
-.\" SECTION
-.Sh SEE ALSO
-.Xr rgbds 7 ,
-.Xr rgbasm 1 ,
-.Xr rgbfix 1 ,
-.Xr rgblink 1 ,
-.Xr gbz80 7
-.\" SECTION
-.Sh HISTORY
-.Nm
-was originally released by Carsten S\(/orensen as part of the ASMotor package,
-and was later packaged in RGBDS by Justin Lloyd.
--- a/man/rgblink.1
+++ /dev/null
@@ -1,86 +1,0 @@
-.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.
--- /dev/null
+++ b/src/asm/rgbasm.1
@@ -1,0 +1,64 @@
+.Dd $\&Mdocdate$
+.Dt RGBASM 1
+.Os RGBDS Manual
+.Sh NAME
+.Nm rgbasm
+.Nd Game Boy assembler
+.\" SECTION
+.Sh SYNOPSIS
+.Nm rgbasm
+.Op Fl b Ar chars
+.Op Fl g Ar chars
+.Op Fl i Ar path
+.Op Fl o Ar outfile
+.Op Fl p Ar pad_value
+.Ar file
+.\" SECTION
+.Sh DESCRIPTION
+The
+.Nm
+program creates an object file from an assembly source file.
+Its arguments are as follows:
+.Bl -tag -width Ds
+.\" ITEM
+.It Fl b Ar chars
+Change the two characters used for binary constants.
+The defaults are 01.
+.\" ITEM
+.It Fl g Ar chars
+Change the four characters used for binary constants.
+The defaults are 0123.
+.\" ITEM
+.It Fl i Ar path
+Add an include path.
+.\" ITEM
+.It Fl o Ar outfile
+Write an object file to the given filename.
+.\" ITEM
+.It Fl p Ar pad_value
+When padding an image, pad with this value.
+The default is 0x00.
+.El
+.\" SECTION
+.Sh EXAMPLES
+Assembling a basic source file is simple:
+.Pp
+.D1 $ rgbasm \-o bar.o foo.asm
+.Pp
+The resulting object file is not yet a usable ROM image \(em it must first be
+run through
+.Xr rgblink 1
+and
+.Xr rgbfix 1 .
+.\" SECTION
+.Sh SEE ALSO
+.Xr rgbds 7 ,
+.Xr rgbfix 1 ,
+.Xr rgblib 1 ,
+.Xr rgblink 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.
--- /dev/null
+++ b/src/fix/rgbfix.1
@@ -1,0 +1,123 @@
+.Dd $\&Mdocdate$
+.Dt RGBFIX 1
+.Os RGBDS Manual
+.Sh NAME
+.Nm rgbfix
+.Nd Game Boy checksum fixer
+.\" SECTION
+.Sh SYNOPSIS
+.Nm rgbfix
+.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
+.Ar file Ns Op .gb
+.\" SECTION
+.Sh DESCRIPTION
+The
+.Nm
+program changes headers of Game Boy ROM images.
+It also performs other filetype operations, such as truncation.
+The arguments are as follows:
+.Bl -tag -width Ds
+.\" ITEM
+.It Fl C
+Set the Game Boy Color\(enonly flag: [0x143] = 0xC0.
+If both this and the
+.Fl c
+flag are set, this takes precedence.
+.\" ITEM
+.It Fl c
+Set the Game Boy Color\(encompatible flag: [0x143] = 0x80.
+If both this and the
+.Fl C
+flag are set,
+.Fl C
+takes precedence.
+.\" ITEM
+.It Fl j
+Set the non-Japanese region flag: [0x14A] = 1.
+.\" ITEM
+.It Fl k Ar licensee_str
+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
+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 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.
+.\" ITEM
+.It Fl t Ar title
+Set the title string ([0x134\(en0x143]) to a given string, truncated to at
+most 16 characters.
+It is recommended to use 15 characters instead, to avoid clashing with the CGB
+flag (
+.Fl c
+or
+.Fl C
+.Ns ).
+.\" ITEM
+.It Fl v
+Validate the header and fix checksums: the Nintendo character area
+([0x104\(en0x133]), the header checksum ([0x14D]), and the global checksum
+([0x14E\(en0x14F]).
+.El
+.\" SECTION
+.Sh EXAMPLES
+Most values in the ROM header are only cosmetic.
+The bare minimum requirements for a workable image are checksums, the Nintendo
+logo, and (if needed) the CGB/SGB flags.
+It is a good idea to pad the image to a valid size as well ("valid" meaning a
+multiple of 32KiB).
+.Pp
+The following will make a plain, no-color Game Boy game without checking for
+a valid size:
+.Pp
+.D1 $ rgbfix \-v foo.gb
+.Pp
+The following will make a SGB-enabled, color-enabled game with a title of
+"foobar", and pad it to a multiple of 32KiB.
+(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
+.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
+.\" SECTION
+.Sh SEE ALSO
+.Xr rgbds 7 ,
+.Xr rgbasm 1 ,
+.Xr rgblib 1 ,
+.Xr rgblink 1 ,
+.Xr gbz80 7
+.\" SECTION
+.Sh HISTORY
+.Nm
+was originally released by Carsten S\(/orensen as a standalone program called
+gbfix.
+It was later integrated with the ASMotor package, which became RGBDS.
--- /dev/null
+++ b/src/lib/rgblib.1
@@ -1,0 +1,44 @@
+.Dd $\&Mdocdate$
+.Dt RGBLIB 1
+.Os RGBDS Manual
+.Sh NAME
+.Nm rgblib
+.Nd Game Boy library manager
+.\" SECTION
+.Sh SYNOPSIS
+.Nm rgblib
+.Ar library
+.Op add | delete | extract | list
+.Ar module ...
+.\" SECTION
+.Sh DESCRIPTION
+The
+.Nm
+program manages libraries for use with
+.Xr rgblink 1 .
+.Bl -tag -width Ds
+.\" ITEM
+.It add
+Add the given modules to the library.
+.\" ITEM
+.It delete
+Delete the given modules from the library.
+.\" ITEM
+.It extract
+Extract the given modules from the library.
+.\" ITEM
+.It list
+List all the modules in the library.
+.El
+.\" SECTION
+.Sh SEE ALSO
+.Xr rgbds 7 ,
+.Xr rgbasm 1 ,
+.Xr rgbfix 1 ,
+.Xr rgblink 1 ,
+.Xr gbz80 7
+.\" SECTION
+.Sh HISTORY
+.Nm
+was originally released by Carsten S\(/orensen as part of the ASMotor package,
+and was later packaged in RGBDS by Justin Lloyd.
--- /dev/null
+++ b/src/link/rgblink.1
@@ -1,0 +1,86 @@
+.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.