mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-14 13:51:42 +00:00
Fix mistakes in RGBDS man pages
As reported by `mandoc -Wall`
This commit is contained in:
+7
-47
@@ -12,7 +12,6 @@
|
|||||||
.Nm rgbasm
|
.Nm rgbasm
|
||||||
.Nd language documentation
|
.Nd language documentation
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
.Pp
|
|
||||||
This is the full description of the language used by
|
This is the full description of the language used by
|
||||||
.Xr rgbasm 1 .
|
.Xr rgbasm 1 .
|
||||||
The description of the instructions supported by the Game Boy CPU is in
|
The description of the instructions supported by the Game Boy CPU is in
|
||||||
@@ -30,7 +29,6 @@ but any program that processes RGB object files (described in
|
|||||||
.Xr rgbds 5 )
|
.Xr rgbds 5 )
|
||||||
can be used in its place.
|
can be used in its place.
|
||||||
.Sh SYNTAX
|
.Sh SYNTAX
|
||||||
.Pp
|
|
||||||
The syntax is line‐based, just as in any other assembler, meaning that you do one instruction or pseudo‐op per line:
|
The syntax is line‐based, just as in any other assembler, meaning that you do one instruction or pseudo‐op per line:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl Oo Ar label Oc Oo Ar instruction Oc Oo Ar ;\ comment Oc
|
.Dl Oo Ar label Oc Oo Ar instruction Oc Oo Ar ;\ comment Oc
|
||||||
@@ -47,7 +45,8 @@ The assembler
|
|||||||
.Em always
|
.Em always
|
||||||
ignores comments and their contents.
|
ignores comments and their contents.
|
||||||
.Pp
|
.Pp
|
||||||
There are three syntaxes for comments. The most common is that anything that follows a semicolon
|
There are three syntaxes for comments.
|
||||||
|
The most common is that anything that follows a semicolon
|
||||||
.Ql \&;
|
.Ql \&;
|
||||||
not inside a string, is a comment until the end of the line.
|
not inside a string, is a comment until the end of the line.
|
||||||
The second is a block comment, beginning with
|
The second is a block comment, beginning with
|
||||||
@@ -81,7 +80,6 @@ like this:
|
|||||||
"world!")
|
"world!")
|
||||||
.Ed
|
.Ed
|
||||||
.Sh EXPRESSIONS
|
.Sh EXPRESSIONS
|
||||||
.Pp
|
|
||||||
An expression can be composed of many things.
|
An expression can be composed of many things.
|
||||||
Numerical expressions are always evaluated using signed 32-bit math.
|
Numerical expressions are always evaluated using signed 32-bit math.
|
||||||
Zero is considered to be the only "false" number, all non-zero numbers (including negative) are "true".
|
Zero is considered to be the only "false" number, all non-zero numbers (including negative) are "true".
|
||||||
@@ -95,9 +93,7 @@ section.
|
|||||||
.Pp
|
.Pp
|
||||||
The instructions in the macro-language generally require constant expressions.
|
The instructions in the macro-language generally require constant expressions.
|
||||||
.Ss Numeric Formats
|
.Ss Numeric Formats
|
||||||
.Pp
|
|
||||||
There are a number of numeric formats.
|
There are a number of numeric formats.
|
||||||
.Pp
|
|
||||||
.Bl -column -offset indent "Fixed point (16.16)" "Prefix"
|
.Bl -column -offset indent "Fixed point (16.16)" "Prefix"
|
||||||
.It Sy Format type Ta Sy Prefix Ta Sy Accepted characters
|
.It Sy Format type Ta Sy Prefix Ta Sy Accepted characters
|
||||||
.It Hexadecimal Ta $ Ta 0123456789ABCDEF
|
.It Hexadecimal Ta $ Ta 0123456789ABCDEF
|
||||||
@@ -128,9 +124,7 @@ is equivalent to
|
|||||||
.Pp
|
.Pp
|
||||||
You can also use symbols, which are implicitly replaced with their value.
|
You can also use symbols, which are implicitly replaced with their value.
|
||||||
.Ss Operators
|
.Ss Operators
|
||||||
.Pp
|
|
||||||
A great number of operators you can use in expressions are available (listed from highest to lowest precedence):
|
A great number of operators you can use in expressions are available (listed from highest to lowest precedence):
|
||||||
.Pp
|
|
||||||
.Bl -column -offset indent "!= == <= >= < >"
|
.Bl -column -offset indent "!= == <= >= < >"
|
||||||
.It Sy Operator Ta Sy Meaning
|
.It Sy Operator Ta Sy Meaning
|
||||||
.It Li \&( \&) Ta Precedence override
|
.It Li \&( \&) Ta Precedence override
|
||||||
@@ -176,7 +170,6 @@ and
|
|||||||
.Pp
|
.Pp
|
||||||
! returns 1 if the operand was 0, and 0 otherwise.
|
! returns 1 if the operand was 0, and 0 otherwise.
|
||||||
.Ss Fixed‐point Expressions
|
.Ss Fixed‐point Expressions
|
||||||
.Pp
|
|
||||||
Fixed-point numbers are basically normal (32-bit) integers, which count 65536th's instead of entire units, offering better precision than integers but limiting the range of values.
|
Fixed-point numbers are basically normal (32-bit) integers, which count 65536th's instead of entire units, offering better precision than integers but limiting the range of values.
|
||||||
The upper 16 bits are used for the integer part and the lower 16 bits are used for the fraction (65536ths).
|
The upper 16 bits are used for the integer part and the lower 16 bits are used for the fraction (65536ths).
|
||||||
Since they are still akin to integers, you can use them in normal integer expressions, and some integer operators like
|
Since they are still akin to integers, you can use them in normal integer expressions, and some integer operators like
|
||||||
@@ -191,7 +184,6 @@ The following functions are designed to operate with fixed-point numbers:
|
|||||||
.EQ
|
.EQ
|
||||||
delim $$
|
delim $$
|
||||||
.EN
|
.EN
|
||||||
.Pp
|
|
||||||
.Bl -column -offset indent "ATAN2(x, y)"
|
.Bl -column -offset indent "ATAN2(x, y)"
|
||||||
.It Sy Name Ta Sy Operation
|
.It Sy Name Ta Sy Operation
|
||||||
.It Fn DIV x y Ta $x \[di] y$
|
.It Fn DIV x y Ta $x \[di] y$
|
||||||
@@ -222,7 +214,6 @@ ANGLE = ANGLE + 256.0 ; 256 = 65536 / table_len, with table_len = 256
|
|||||||
ENDR
|
ENDR
|
||||||
.Ed
|
.Ed
|
||||||
.Ss String Expressions
|
.Ss String Expressions
|
||||||
.Pp
|
|
||||||
The most basic string expression is any number of characters contained in double quotes
|
The most basic string expression is any number of characters contained in double quotes
|
||||||
.Pq Ql \&"for instance" .
|
.Pq Ql \&"for instance" .
|
||||||
The backslash character
|
The backslash character
|
||||||
@@ -231,8 +222,7 @@ is special in that it causes the character following it to be
|
|||||||
.Dq escaped ,
|
.Dq escaped ,
|
||||||
meaning that it is treated differently from normal.
|
meaning that it is treated differently from normal.
|
||||||
There are a number of escape sequences you can use within a string:
|
There are a number of escape sequences you can use within a string:
|
||||||
.Pp
|
.Bl -column -offset indent "Qo \[rs]1 Qc \[en] Qo \[rs]9 Qc"
|
||||||
.Bl -column -offset indent "'\1' - '\9'"
|
|
||||||
.It Sy String Ta Sy Meaning
|
.It Sy String Ta Sy Meaning
|
||||||
.It Ql \[rs]\[rs] Ta Produces a backslash
|
.It Ql \[rs]\[rs] Ta Produces a backslash
|
||||||
.It Ql \[rs]" Ta Produces a double quote without terminating
|
.It Ql \[rs]" Ta Produces a double quote without terminating
|
||||||
@@ -287,7 +277,6 @@ The symbol's value is again inserted directly.
|
|||||||
.Pp
|
.Pp
|
||||||
The following functions operate on string expressions.
|
The following functions operate on string expressions.
|
||||||
Most of them return a string, however some of these functions actually return an integer and can be used as part of an integer expression!
|
Most of them return a string, however some of these functions actually return an integer and can be used as part of an integer expression!
|
||||||
.Pp
|
|
||||||
.Bl -column "STRSUB(str, pos, len)"
|
.Bl -column "STRSUB(str, pos, len)"
|
||||||
.It Sy Name Ta Sy Operation
|
.It Sy Name Ta Sy Operation
|
||||||
.It Fn STRLEN string Ta Returns the number of characters in Ar string .
|
.It Fn STRLEN string Ta Returns the number of characters in Ar string .
|
||||||
@@ -299,7 +288,6 @@ Most of them return a string, however some of these functions actually return an
|
|||||||
.It Fn STRLWR str Ta Converts all characters in Ar str No to lower case and returns the new string.
|
.It Fn STRLWR str Ta Converts all characters in Ar str No to lower case and returns the new string.
|
||||||
.El
|
.El
|
||||||
.Ss Character maps
|
.Ss Character maps
|
||||||
.Pp
|
|
||||||
When writing text that is meant to be displayed in the Game Boy, the characters used in the source code may have a different encoding than the default of ASCII.
|
When writing text that is meant to be displayed in the Game Boy, the characters used in the source code may have a different encoding than the default of ASCII.
|
||||||
For example, the tiles used for uppercase letters may be placed starting at tile index 128, which makes it difficult to add text strings to the ROM.
|
For example, the tiles used for uppercase letters may be placed starting at tile index 128, which makes it difficult to add text strings to the ROM.
|
||||||
.Pp
|
.Pp
|
||||||
@@ -334,9 +322,7 @@ This means that any string that the code may want to print as debug information
|
|||||||
The output value of a mapping can be 0.
|
The output value of a mapping can be 0.
|
||||||
If this happens, the assembler will treat this as the end of the string and the rest of it will be trimmed.
|
If this happens, the assembler will treat this as the end of the string and the rest of it will be trimmed.
|
||||||
.Ss Other functions
|
.Ss Other functions
|
||||||
.Pp
|
|
||||||
There are a few other functions that do various useful things:
|
There are a few other functions that do various useful things:
|
||||||
.Pp
|
|
||||||
.Bl -column "DEF(label)"
|
.Bl -column "DEF(label)"
|
||||||
.It Sy Name Ta Sy Operation
|
.It Sy Name Ta Sy Operation
|
||||||
.It Fn BANK arg Ta Returns a bank number.
|
.It Fn BANK arg Ta Returns a bank number.
|
||||||
@@ -365,7 +351,6 @@ String symbols are not expanded within the parentheses.
|
|||||||
or 0 if only RGBLINK can compute its value.
|
or 0 if only RGBLINK can compute its value.
|
||||||
.El
|
.El
|
||||||
.Sh SECTIONS
|
.Sh SECTIONS
|
||||||
.Pp
|
|
||||||
Before you can start writing code, you must define a section.
|
Before you can start writing code, you must define a section.
|
||||||
This tells the assembler what kind of information follows and, if it is code, where to put it.
|
This tells the assembler what kind of information follows and, if it is code, where to put it.
|
||||||
.Pp
|
.Pp
|
||||||
@@ -382,7 +367,6 @@ All other sections must have a unique name, even in different source files, or t
|
|||||||
Possible section
|
Possible section
|
||||||
.Ar type Ns s
|
.Ar type Ns s
|
||||||
are as follows:
|
are as follows:
|
||||||
.Pp
|
|
||||||
.Bl -tag
|
.Bl -tag
|
||||||
.It Ic ROM0
|
.It Ic ROM0
|
||||||
A ROM section.
|
A ROM section.
|
||||||
@@ -568,7 +552,6 @@ SECTION "VRAM Data",ROMX,BANK[2],ALIGN[4] ;\ align to 16 bytes
|
|||||||
.Ed
|
.Ed
|
||||||
.El
|
.El
|
||||||
.Ss Section Stack
|
.Ss Section Stack
|
||||||
.Pp
|
|
||||||
.Ic POPS
|
.Ic POPS
|
||||||
and
|
and
|
||||||
.Ic PUSHS
|
.Ic PUSHS
|
||||||
@@ -581,7 +564,6 @@ will push the current section context on the section stack.
|
|||||||
can then later be used to restore it.
|
can then later be used to restore it.
|
||||||
Useful for defining sections in included files when you don't want to override the section context at the point the file was included.
|
Useful for defining sections in included files when you don't want to override the section context at the point the file was included.
|
||||||
.Ss RAM Code
|
.Ss RAM Code
|
||||||
.Pp
|
|
||||||
Sometimes you want to have some code in RAM.
|
Sometimes you want to have some code in RAM.
|
||||||
But then you can't simply put it in a RAM section, you have to store it in ROM and copy it to RAM at some point.
|
But then you can't simply put it in a RAM section, you have to store it in ROM and copy it to RAM at some point.
|
||||||
.Pp
|
.Pp
|
||||||
@@ -642,7 +624,6 @@ You cannot nest
|
|||||||
.Ic LOAD
|
.Ic LOAD
|
||||||
blocks, nor can you change the current section within them.
|
blocks, nor can you change the current section within them.
|
||||||
.Ss Unionized Sections
|
.Ss Unionized Sections
|
||||||
.Pp
|
|
||||||
When you're tight on RAM, you may want to define overlapping blocks of variables, as explained in the
|
When you're tight on RAM, you may want to define overlapping blocks of variables, as explained in the
|
||||||
.Sx Unions
|
.Sx Unions
|
||||||
section.
|
section.
|
||||||
@@ -736,12 +717,11 @@ and the one from
|
|||||||
.Ql bar.o
|
.Ql bar.o
|
||||||
last.
|
last.
|
||||||
.Sh SYMBOLS
|
.Sh SYMBOLS
|
||||||
.Pp
|
|
||||||
RGBDS supports several types of symbols:
|
RGBDS supports several types of symbols:
|
||||||
.Pp
|
|
||||||
.Bl -hang
|
.Bl -hang
|
||||||
.It Sy Label
|
.It Sy Label
|
||||||
Numerical symbol designating a memory location. May or may not have a value known at assembly time.
|
Numerical symbol designating a memory location.
|
||||||
|
May or may not have a value known at assembly time.
|
||||||
.It Sy Constant
|
.It Sy Constant
|
||||||
Numerical symbol whose value has to be known at assembly time.
|
Numerical symbol whose value has to be known at assembly time.
|
||||||
.It Sy Macro
|
.It Sy Macro
|
||||||
@@ -861,7 +841,6 @@ str_SIZEOF EQU 259
|
|||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
There are five commands in the RS group of commands:
|
There are five commands in the RS group of commands:
|
||||||
.Pp
|
|
||||||
.Bl -column "RSSET constexpr"
|
.Bl -column "RSSET constexpr"
|
||||||
.It Sy Command Ta Sy Meaning
|
.It Sy Command Ta Sy Meaning
|
||||||
.It Ic RSRESET Ta Equivalent to Ql RSSET 0 .
|
.It Ic RSRESET Ta Equivalent to Ql RSSET 0 .
|
||||||
@@ -940,7 +919,6 @@ following the macro's name is required.
|
|||||||
Macros can't be exported or imported.
|
Macros can't be exported or imported.
|
||||||
.El
|
.El
|
||||||
.Ss Exporting and importing symbols
|
.Ss Exporting and importing symbols
|
||||||
.Pp
|
|
||||||
Importing and exporting of symbols is a feature that is very useful when your project spans many source files and, for example, you need to jump to a routine defined in another file.
|
Importing and exporting of symbols is a feature that is very useful when your project spans many source files and, for example, you need to jump to a routine defined in another file.
|
||||||
.Pp
|
.Pp
|
||||||
Exporting of symbols has to be done manually, importing is done automatically if
|
Exporting of symbols has to be done manually, importing is done automatically if
|
||||||
@@ -960,7 +938,6 @@ do not use it.
|
|||||||
Note also that only exported symbols will appear in symbol and map files produced by
|
Note also that only exported symbols will appear in symbol and map files produced by
|
||||||
.Xr rgblink 1 .
|
.Xr rgblink 1 .
|
||||||
.Ss Purging symbols
|
.Ss Purging symbols
|
||||||
.Pp
|
|
||||||
.Ic PURGE
|
.Ic PURGE
|
||||||
allows you to completely remove a symbol from the symbol table as if it had never existed.
|
allows you to completely remove a symbol from the symbol table as if it had never existed.
|
||||||
.Em USE WITH EXTREME CAUTION!!!
|
.Em USE WITH EXTREME CAUTION!!!
|
||||||
@@ -979,9 +956,7 @@ Note that, as an exception, string symbols in the argument list of a
|
|||||||
command
|
command
|
||||||
.Em will not be expanded .
|
.Em will not be expanded .
|
||||||
.Ss Predeclared Symbols
|
.Ss Predeclared Symbols
|
||||||
.Pp
|
|
||||||
The following symbols are defined by the assembler:
|
The following symbols are defined by the assembler:
|
||||||
.Pp
|
|
||||||
.Bl -column -offset indent "EQUS" "__ISO_8601_LOCAL__"
|
.Bl -column -offset indent "EQUS" "__ISO_8601_LOCAL__"
|
||||||
.It Sy Type Ta Sy Name Ta Sy Contents
|
.It Sy Type Ta Sy Name Ta Sy Contents
|
||||||
.It Ic EQU Ta Dv @ Ta PC value (essentially, the current memory address)
|
.It Ic EQU Ta Dv @ Ta PC value (essentially, the current memory address)
|
||||||
@@ -1006,7 +981,6 @@ The following symbols are defined by the assembler:
|
|||||||
.El
|
.El
|
||||||
.Sh DEFINING DATA
|
.Sh DEFINING DATA
|
||||||
.Ss Declaring variables in a RAM section
|
.Ss Declaring variables in a RAM section
|
||||||
.Pp
|
|
||||||
.Ic DS
|
.Ic DS
|
||||||
allocates a number of empty bytes.
|
allocates a number of empty bytes.
|
||||||
This is the preferred method of allocating space in a RAM section.
|
This is the preferred method of allocating space in a RAM section.
|
||||||
@@ -1027,7 +1001,6 @@ In ROM sections, it will be filled with the value passed to the
|
|||||||
command-line option, except when using overlays with
|
command-line option, except when using overlays with
|
||||||
.Fl O .
|
.Fl O .
|
||||||
.Ss Defining constant data
|
.Ss Defining constant data
|
||||||
.Pp
|
|
||||||
.Ic DB
|
.Ic DB
|
||||||
defines a list of bytes that will be stored in the final image.
|
defines a list of bytes that will be stored in the final image.
|
||||||
Ideal for tables and text.
|
Ideal for tables and text.
|
||||||
@@ -1079,7 +1052,6 @@ can be used in a
|
|||||||
.Ic SRAM
|
.Ic SRAM
|
||||||
section.
|
section.
|
||||||
.Ss Including binary files
|
.Ss Including binary files
|
||||||
.Pp
|
|
||||||
You probably have some graphics, level data, etc. you'd like to include.
|
You probably have some graphics, level data, etc. you'd like to include.
|
||||||
Use
|
Use
|
||||||
.Ic INCBIN
|
.Ic INCBIN
|
||||||
@@ -1101,9 +1073,9 @@ The example below includes 256 bytes from data.bin, starting from byte 78.
|
|||||||
INCBIN "data.bin",78,256
|
INCBIN "data.bin",78,256
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
.Pp
|
||||||
The length argument is optional. If only the start position is specified, the bytes from the start position until the end of the file will be included.
|
The length argument is optional.
|
||||||
|
If only the start position is specified, the bytes from the start position until the end of the file will be included.
|
||||||
.Ss Unions
|
.Ss Unions
|
||||||
.Pp
|
|
||||||
Unions allow multiple memory allocations to overlap, like unions in C.
|
Unions allow multiple memory allocations to overlap, like unions in C.
|
||||||
This does not increase the amount of memory available, but allows re-using the same memory region for different purposes.
|
This does not increase the amount of memory available, but allows re-using the same memory region for different purposes.
|
||||||
.Pp
|
.Pp
|
||||||
@@ -1155,7 +1127,6 @@ like commands (see
|
|||||||
.Sx Declaring variables in a RAM section ) .
|
.Sx Declaring variables in a RAM section ) .
|
||||||
.Sh THE MACRO LANGUAGE
|
.Sh THE MACRO LANGUAGE
|
||||||
.Ss Invoking macros
|
.Ss Invoking macros
|
||||||
.Pp
|
|
||||||
You execute the macro by inserting its name.
|
You execute the macro by inserting its name.
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
add a,b
|
add a,b
|
||||||
@@ -1217,7 +1188,6 @@ Also, a macro can have inside an
|
|||||||
.Sy EQUS
|
.Sy EQUS
|
||||||
which references the same macro, which has the same problem.
|
which references the same macro, which has the same problem.
|
||||||
.Pp
|
.Pp
|
||||||
.Pp
|
|
||||||
It's possible to pass arguments to macros as well!
|
It's possible to pass arguments to macros as well!
|
||||||
You retrieve the arguments by using the escape sequences
|
You retrieve the arguments by using the escape sequences
|
||||||
.Ic \[rs]1
|
.Ic \[rs]1
|
||||||
@@ -1306,7 +1276,6 @@ This is the only way of accessing the value of arguments from 10 to 256.
|
|||||||
.Ic SHIFT
|
.Ic SHIFT
|
||||||
can optionally be given an integer parameter, and will apply the above shifting that number of times.
|
can optionally be given an integer parameter, and will apply the above shifting that number of times.
|
||||||
.Ss Printing things during assembly
|
.Ss Printing things during assembly
|
||||||
.Pp
|
|
||||||
The next four commands print text and values to the standard output.
|
The next four commands print text and values to the standard output.
|
||||||
Useful for debugging macros, or wherever you may feel the need to tell yourself some important information.
|
Useful for debugging macros, or wherever you may feel the need to tell yourself some important information.
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
@@ -1315,7 +1284,6 @@ PRINTI (2 + 3) / 5
|
|||||||
PRINTV $FF00 + $F0
|
PRINTV $FF00 + $F0
|
||||||
PRINTF MUL(3.14, 3987.0)
|
PRINTF MUL(3.14, 3987.0)
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
|
||||||
.Bl -inset
|
.Bl -inset
|
||||||
.It Ic PRINTT
|
.It Ic PRINTT
|
||||||
prints out a string.
|
prints out a string.
|
||||||
@@ -1334,7 +1302,6 @@ prints out a fixed point value.
|
|||||||
Be careful that none of those automatically print a line feed; if you need one, use
|
Be careful that none of those automatically print a line feed; if you need one, use
|
||||||
.Ic PRINTT "\[rs]n" .
|
.Ic PRINTT "\[rs]n" .
|
||||||
.Ss Automatically repeating blocks of code
|
.Ss Automatically repeating blocks of code
|
||||||
.Pp
|
|
||||||
Suppose you want to unroll a time consuming loop without copy-pasting it.
|
Suppose you want to unroll a time consuming loop without copy-pasting it.
|
||||||
.Ic REPT
|
.Ic REPT
|
||||||
is here for that purpose.
|
is here for that purpose.
|
||||||
@@ -1371,7 +1338,6 @@ As in macros, you can also use the escape sequence
|
|||||||
.Ic REPT
|
.Ic REPT
|
||||||
blocks can be nested.
|
blocks can be nested.
|
||||||
.Ss Aborting the assembly process
|
.Ss Aborting the assembly process
|
||||||
.Pp
|
|
||||||
.Ic FAIL
|
.Ic FAIL
|
||||||
and
|
and
|
||||||
.Ic WARN
|
.Ic WARN
|
||||||
@@ -1392,7 +1358,6 @@ If you need to ensure some assumption is correct when compiling, you can use
|
|||||||
and
|
and
|
||||||
.Ic STATIC_ASSERT .
|
.Ic STATIC_ASSERT .
|
||||||
Syntax examples are given below:
|
Syntax examples are given below:
|
||||||
.Pp
|
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
Function:
|
Function:
|
||||||
xor a
|
xor a
|
||||||
@@ -1443,7 +1408,6 @@ to be emitted;
|
|||||||
.Ic FATAL
|
.Ic FATAL
|
||||||
immediately aborts.
|
immediately aborts.
|
||||||
.Ss Including other source files
|
.Ss Including other source files
|
||||||
.Pp
|
|
||||||
Use
|
Use
|
||||||
.Ic INCLUDE
|
.Ic INCLUDE
|
||||||
to process another assembler file and then return to the current file when done.
|
to process another assembler file and then return to the current file when done.
|
||||||
@@ -1459,7 +1423,6 @@ calls infinitely (or until you run out of memory, whichever comes first).
|
|||||||
INCLUDE "irq.inc"
|
INCLUDE "irq.inc"
|
||||||
.Ed
|
.Ed
|
||||||
.Ss Conditional assembling
|
.Ss Conditional assembling
|
||||||
.Pp
|
|
||||||
The four commands
|
The four commands
|
||||||
.Ic IF , ELIF , ELSE ,
|
.Ic IF , ELIF , ELSE ,
|
||||||
and
|
and
|
||||||
@@ -1509,7 +1472,6 @@ Also, if there is more than one
|
|||||||
block, all of them but the first one are ignored.
|
block, all of them but the first one are ignored.
|
||||||
.Sh MISCELLANEOUS
|
.Sh MISCELLANEOUS
|
||||||
.Ss Changing options while assembling
|
.Ss Changing options while assembling
|
||||||
.Pp
|
|
||||||
.Ic OPT
|
.Ic OPT
|
||||||
can be used to change some of the options during assembling from within the source, instead of defining them on the command-line.
|
can be used to change some of the options during assembling from within the source, instead of defining them on the command-line.
|
||||||
.Pp
|
.Pp
|
||||||
@@ -1539,7 +1501,6 @@ can then later be used to restore them.
|
|||||||
Useful if you want to change some options in an include file and you don't want to destroy the options set by the program that included your file.
|
Useful if you want to change some options in an include file and you don't want to destroy the options set by the program that included your file.
|
||||||
The stack's number of entries is limited only by the amount of memory in your machine.
|
The stack's number of entries is limited only by the amount of memory in your machine.
|
||||||
.Ss Requesting alignment
|
.Ss Requesting alignment
|
||||||
.Pp
|
|
||||||
While
|
While
|
||||||
.Ic ALIGN
|
.Ic ALIGN
|
||||||
as presented in
|
as presented in
|
||||||
@@ -1567,7 +1528,6 @@ is a shorthand for
|
|||||||
.Xr rgbds 7 ,
|
.Xr rgbds 7 ,
|
||||||
.Xr gbz80 7
|
.Xr gbz80 7
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Pp
|
|
||||||
.Nm
|
.Nm
|
||||||
was originally written by Carsten S\(/orensen as part of the ASMotor package,
|
was originally written by Carsten S\(/orensen as part of the ASMotor package,
|
||||||
and was later packaged in RGBDS by Justin Lloyd.
|
and was later packaged in RGBDS by Justin Lloyd.
|
||||||
|
|||||||
@@ -22,12 +22,10 @@ as destination can omit the destination as it is assumed to be register
|
|||||||
.Sy A
|
.Sy A
|
||||||
by default.
|
by default.
|
||||||
The following two lines have the same effect:
|
The following two lines have the same effect:
|
||||||
.Pp
|
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
OR A,B
|
OR A,B
|
||||||
OR B
|
OR B
|
||||||
.Ed
|
.Ed
|
||||||
.Pp
|
|
||||||
.Sh LEGEND
|
.Sh LEGEND
|
||||||
List of abbreviations used in this document.
|
List of abbreviations used in this document.
|
||||||
.Bl -tag
|
.Bl -tag
|
||||||
|
|||||||
+3
-3
@@ -26,7 +26,7 @@
|
|||||||
The
|
The
|
||||||
.Nm
|
.Nm
|
||||||
program converts PNG images into the Nintendo Game Boy's planar tile format.
|
program converts PNG images into the Nintendo Game Boy's planar tile format.
|
||||||
|
.Pp
|
||||||
The resulting colors and their palette indices are determined differently depending on the input PNG file:
|
The resulting colors and their palette indices are determined differently depending on the input PNG file:
|
||||||
.Bl -dash -width Ds
|
.Bl -dash -width Ds
|
||||||
.It
|
.It
|
||||||
@@ -39,7 +39,7 @@ If the image has multiple shades that map to the same index, the palette is inst
|
|||||||
.It
|
.It
|
||||||
If the image has color (or the grayscale method failed), the colors are sorted from lightest to darkest.
|
If the image has color (or the grayscale method failed), the colors are sorted from lightest to darkest.
|
||||||
.El
|
.El
|
||||||
|
.Pp
|
||||||
The input image may not contain more colors than the selected bit depth allows.
|
The input image may not contain more colors than the selected bit depth allows.
|
||||||
Transparent pixels are set to palette index 0.
|
Transparent pixels are set to palette index 0.
|
||||||
.Sh ARGUMENTS
|
.Sh ARGUMENTS
|
||||||
@@ -53,7 +53,7 @@ is invalid because it could also be
|
|||||||
.Fl Fl version .
|
.Fl Fl version .
|
||||||
The arguments are as follows:
|
The arguments are as follows:
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Fl a Ar attrmap, Fl Fl attr-map Ar attrmap
|
.It Fl a Ar attrmap , Fl Fl attr-map Ar attrmap
|
||||||
Generate a file of tile mirroring attributes for OAM or (CGB-only) background tiles.
|
Generate a file of tile mirroring attributes for OAM or (CGB-only) background tiles.
|
||||||
For each tile in the input file, a byte is written representing the dimensions that the associated tile in the output file should be mirrored.
|
For each tile in the input file, a byte is written representing the dimensions that the associated tile in the output file should be mirrored.
|
||||||
Useful in combination with
|
Useful in combination with
|
||||||
|
|||||||
+2
-4
@@ -66,7 +66,7 @@ Enable DMG mode.
|
|||||||
Prohibit the use of sections that doesn't exist on a DMG, such as VRAM bank 1.
|
Prohibit the use of sections that doesn't exist on a DMG, such as VRAM bank 1.
|
||||||
This option automatically enables
|
This option automatically enables
|
||||||
.Fl w .
|
.Fl w .
|
||||||
.It Fl l Ar linker_script, Fl Fl linkerscript Ar linker_script
|
.It Fl l Ar linker_script , Fl Fl linkerscript Ar linker_script
|
||||||
Specify a linker script file that tells the linker how sections must be placed in the ROM.
|
Specify a linker script file that tells the linker how sections must be placed in the ROM.
|
||||||
The attributes assigned in the linker script must be consistent with any assigned in the code.
|
The attributes assigned in the linker script must be consistent with any assigned in the code.
|
||||||
See
|
See
|
||||||
@@ -116,7 +116,7 @@ option!
|
|||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
All you need for a basic ROM is an object file, which can be made into a ROM image like so:
|
All you need for a basic ROM is an object file, which can be made into a ROM image like so:
|
||||||
.Pp
|
.Pp
|
||||||
.D1 $ rgblink -o bar.gb foo.o
|
.Dl $ rgblink -o bar.gb foo.o
|
||||||
.Pp
|
.Pp
|
||||||
The resulting
|
The resulting
|
||||||
.Ar bar.gb
|
.Ar bar.gb
|
||||||
@@ -126,12 +126,10 @@ You should use
|
|||||||
to fix these so that the program will actually run in a Game Boy:
|
to fix these so that the program will actually run in a Game Boy:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl $ rgbfix -v bar.gb
|
.Dl $ rgbfix -v bar.gb
|
||||||
.Ed
|
|
||||||
.Pp
|
.Pp
|
||||||
Here is a more complete example:
|
Here is a more complete example:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl $ rgblink -o bin/game.gb -n bin/game.sym -p 0xFF obj/title.o obj/engine.o
|
.Dl $ rgblink -o bin/game.gb -n bin/game.sym -p 0xFF obj/title.o obj/engine.o
|
||||||
.Ed
|
|
||||||
.Sh BUGS
|
.Sh BUGS
|
||||||
Please report bugs on
|
Please report bugs on
|
||||||
.Lk https://github.com/gbdev/rgbds/issues GitHub .
|
.Lk https://github.com/gbdev/rgbds/issues GitHub .
|
||||||
|
|||||||
+2
-3
@@ -19,7 +19,6 @@ They can be lowercase or uppercase, it is ignored.
|
|||||||
Any line can contain a comment starting with
|
Any line can contain a comment starting with
|
||||||
.Ql \&;
|
.Ql \&;
|
||||||
that ends at the end of the line:
|
that ends at the end of the line:
|
||||||
.Pp
|
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
ROMX $F ; This is a comment
|
ROMX $F ; This is a comment
|
||||||
"Functions to read array"
|
"Functions to read array"
|
||||||
@@ -86,6 +85,6 @@ in the linker script.
|
|||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Nm
|
.Nm
|
||||||
was originally written by Carsten S\(/orensen as part of the ASMotor package,
|
was originally written by Carsten S\(/orensen as part of the ASMotor package,
|
||||||
and was later packaged in RGBDS by Justin Lloyd. It is now maintained by a
|
and was later packaged in RGBDS by Justin Lloyd.
|
||||||
number of contributors at
|
It is now maintained by a number of contributors at
|
||||||
.Lk https://github.com/gbdev/rgbds .
|
.Lk https://github.com/gbdev/rgbds .
|
||||||
|
|||||||
+1
-5
@@ -18,7 +18,6 @@ and
|
|||||||
.Xr rgblink 1 .
|
.Xr rgblink 1 .
|
||||||
.Em Please note that the specifications may change .
|
.Em Please note that the specifications may change .
|
||||||
This toolchain is in development and new features may require adding more information to the current format, or modifying some fields, which would break compatibility with older versions.
|
This toolchain is in development and new features may require adding more information to the current format, or modifying some fields, which would break compatibility with older versions.
|
||||||
.Pp
|
|
||||||
.Sh FILE STRUCTURE
|
.Sh FILE STRUCTURE
|
||||||
The following types are used:
|
The following types are used:
|
||||||
.Pp
|
.Pp
|
||||||
@@ -29,7 +28,6 @@ is an 8‐bit integer.
|
|||||||
.Ar STRING
|
.Ar STRING
|
||||||
is a 0‐terminated string of
|
is a 0‐terminated string of
|
||||||
.Ar BYTE .
|
.Ar BYTE .
|
||||||
.Pp
|
|
||||||
.Bd -literal
|
.Bd -literal
|
||||||
; Header
|
; Header
|
||||||
|
|
||||||
@@ -219,8 +217,7 @@ The
|
|||||||
In the RGB format, RPN expressions are stored as
|
In the RGB format, RPN expressions are stored as
|
||||||
.Ar BYTE Ns s
|
.Ar BYTE Ns s
|
||||||
with some bytes being special prefixes for integers and symbols.
|
with some bytes being special prefixes for integers and symbols.
|
||||||
.Pp
|
.Bl -column -offset indent "Sy String" "Sy String"
|
||||||
.Bl -column -offset indent ".Sy String" ".Sy String"
|
|
||||||
.It Sy Value Ta Sy Meaning
|
.It Sy Value Ta Sy Meaning
|
||||||
.It Li $00 Ta Li + operator
|
.It Li $00 Ta Li + operator
|
||||||
.It Li $01 Ta Li - operator
|
.It Li $01 Ta Li - operator
|
||||||
@@ -259,7 +256,6 @@ integer follows.
|
|||||||
.It Li $81 Ta Ar LONG
|
.It Li $81 Ta Ar LONG
|
||||||
symbol ID follows.
|
symbol ID follows.
|
||||||
.El
|
.El
|
||||||
.Pp
|
|
||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr rgbasm 1 ,
|
.Xr rgbasm 1 ,
|
||||||
.Xr rgblink 1 ,
|
.Xr rgblink 1 ,
|
||||||
|
|||||||
+3
-4
@@ -13,7 +13,6 @@
|
|||||||
.Nd Rednex Game Boy Development System
|
.Nd Rednex Game Boy Development System
|
||||||
.Sh EXAMPLES
|
.Sh EXAMPLES
|
||||||
To get a working ROM image from a single assembly source file:
|
To get a working ROM image from a single assembly source file:
|
||||||
.Pp
|
|
||||||
.Bd -literal -offset indent
|
.Bd -literal -offset indent
|
||||||
$ rgbasm \-o bar.o foo.asm
|
$ rgbasm \-o bar.o foo.asm
|
||||||
$ rgblink \-o baz.gb bar.o
|
$ rgblink \-o baz.gb bar.o
|
||||||
@@ -26,7 +25,7 @@ $ rgbfix \-v \-p 0 baz.gb
|
|||||||
.Xr rgbds 5 ,
|
.Xr rgbds 5 ,
|
||||||
.Xr gbz80 7
|
.Xr gbz80 7
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
.Bl -ohang
|
.Bl -item
|
||||||
.It
|
.It
|
||||||
1997, Carsten S\(/orensen (AKA SurfSmurf) writes ASMotor as a general-purpose
|
1997, Carsten S\(/orensen (AKA SurfSmurf) writes ASMotor as a general-purpose
|
||||||
assembler/linker system for DOS/Win32.
|
assembler/linker system for DOS/Win32.
|
||||||
@@ -37,8 +36,8 @@ assembly/machine code, and releases this version as RGBDS.
|
|||||||
2009, Vegard Nossum adapts the code to be more UNIX-like and releases this
|
2009, Vegard Nossum adapts the code to be more UNIX-like and releases this
|
||||||
version as rgbds-linux on GitHub.
|
version as rgbds-linux on GitHub.
|
||||||
.It
|
.It
|
||||||
2010, Anthony J. Bentley forks that repository. The fork becomes the reference
|
2010, Anthony J. Bentley forks that repository.
|
||||||
implementation of rgbds.
|
The fork becomes the reference implementation of rgbds.
|
||||||
.It
|
.It
|
||||||
2017, Bentley's repository is moved to a neutral name.
|
2017, Bentley's repository is moved to a neutral name.
|
||||||
It is now maintained by a number of contributors at
|
It is now maintained by a number of contributors at
|
||||||
|
|||||||
Reference in New Issue
Block a user