diff --git a/docs/gbz80.7.html b/docs/gbz80.7.html index 830ee3f6..0c535630 100644 --- a/docs/gbz80.7.html +++ b/docs/gbz80.7.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbasm.1.html b/docs/rgbasm.1.html index db71d91a..e5a7ef0e 100644 --- a/docs/rgbasm.1.html +++ b/docs/rgbasm.1.html @@ -2,9 +2,9 @@ @@ -39,6 +39,7 @@ [-M dependfile] [-o outfile] [-p pad_value] + [-r recursion_depth] file @@ -46,7 +47,9 @@

The rgbasm program creates an object file from an - assembly source file. Its arguments are as follows: + assembly source file. The input file can be a file path, + or - denoting stdin. Its + arguments are as follows:
chars
@@ -85,6 +88,10 @@ The rgbasm program creates an object file from an
pad_value
When padding an image, pad with this value. The default is 0x00.
+
+ recursion_depth
+
Specifies the recursion depth at which RGBASM will assume being in an + infinite loop.
Print the version of the program and exit.
@@ -95,12 +102,19 @@ The rgbasm program creates an object file from an

-Assembling a basic source file is simple: +You can assemble a source file in two ways. Straight forward way:
 $ rgbasm -o bar.o foo.asm
 
+

Pipes way:

+
+
+$ cat foo.asm | rgbasm -o bar.o -
+$ rgbasm -o bar.o - < foo.asm
+
+

The resulting object file is not yet a usable ROM image — it must first be run through rgblink(1) and rgbfix(1).

@@ -122,7 +136,7 @@ $ rgbasm -o bar.o foo.asm - +
February 24, 2018July 8, 2019 RGBDS Manual
diff --git a/docs/rgbasm.5.html b/docs/rgbasm.5.html index f974342e..1ecd3bf1 100644 --- a/docs/rgbasm.5.html +++ b/docs/rgbasm.5.html @@ -2,9 +2,9 @@ @@ -426,11 +426,11 @@ PUSHA EQUS "push af\npush bc\npush de\npush hl\n"

Note that a colon (:) following the label-name is not allowed. String equates can't be exported or imported.

Important note: An EQUS can be expanded to a - string that contains another EQUS and it will be expanded as well. This - means that, if you aren't careful, you may trap the assembler into an - infinite loop if there's a circular dependency in the expansions. Also, - a MACRO can have inside an EQUS which references the same MACRO, which - has the same problem.

+ string that contains another EQUS and it will be expanded as well. If + this creates an infinite loop, RGBASM will error out once a certain + depth is reached. See the -r command-line option. Also, a MACRO can have + inside an EQUS which references the same MACRO, which has the same + problem.

MACRO
@@ -534,16 +534,16 @@ LoopyMacro MyVars,54 you can only use the first 9 like this. If you want to use the rest, you need to use the keyword SHIFT.

Line continuations work as usual inside macros or lists of - arguments of macros. Strings, however, are a bit trickier. The following - example shows how to use strings as arguments for a macro:

+ arguments of macros. However, some characters need to be escaped, as in + the following example:

 PrintMacro : MACRO
     PRINTT \1
 ENDM
 
-    PrintMacro STRCAT(\"Hello\"\,  \
-                      \" world\\n\")
+    PrintMacro STRCAT("Hello"\,  \
+                      " world\\n")
     

SHIFT is a special command only @@ -1189,55 +1189,88 @@ The most basic string expression is any number of characters contained in double This will examine the type of the symbol and insert its value accordingly. If symbol is a string symbol, the symbols value is simply copied. If it's a numeric symbol, the value is converted to hexadecimal notation and inserted - as a string.

-

HINT: The {symbol} construct can also be used - outside strings. The symbol's value is again inserted as a string. This is - just a short way of doing “{symbol}”.

-

Whenever the macro-language expects a string you can actually use - a string expression. This consists of one or more of these function (yes, - you can nest them). Note that some of these functions actually return an - integer and can be used as part of an integer expression!

- + as a string with a dollar prepended.

+

It's possible to change the way numeric symbols are converted by + specifying a print type like so: {d:symbol} Valid print + types are:

+
- - + + + - - + + + - - + + + - - + + + - - - - - - - - - - - - - - + + +
NameOperationPrint typeFormatExample
STRLEN(string)Returns the number of characters in stringDecimal42
STRCAT(str1, - str2)Appends str2 to str1.Lowercase hexadecimal2a
STRCMP(str1, - str2)Returns negative if str1 is alphabetically lower than str2, zero if they - match, positive if str1 is greater than str2.Uppercase hexadecimal2A
STRIN(str1, - str2)Returns the position of str2 in str1 or zero if it's not present (first - character is position 1).
STRSUB(str, - pos, len)Returns a substring from str starting at pos (first character is - position 1) and with len characters.
STRUPR(str)Converts all characters in str to capitals and returns the new - string.
STRLWR(str)Converts all characters in str to lower case and returns the new - string.Binary101010 +

Note that print types should only be used with numeric values, + not strings.

+

HINT: The {symbol} construct can also be + used outside strings. The symbol's value is again inserted as a string. + This is just a short way of doing “{symbol}”.

+

Whenever the macro-language expects a string you can actually + use a string expression. This consists of one or more of these function + (yes, you can nest them). Note that some of these functions actually + return an integer and can be used as part of an integer expression!

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameOperation
STRLEN(string)Returns the number of characters in string
STRCAT(str1, + str2)Appends str2 to str1.
STRCMP(str1, + str2)Returns negative if str1 is alphabetically lower than str2, zero if + they match, positive if str1 is greater than str2.
STRIN(str1, + str2)Returns the position of str2 in str1 or zero if it's not present + (first character is position 1).
STRSUB(str, + pos, len)Returns a substring from str starting at pos (first character is + position 1) and with len characters.
STRUPR(str)Converts all characters in str to capitals and returns the new + string.
STRLWR(str)Converts all characters in str to lower case and returns the new + string.
+
@@ -1258,10 +1291,48 @@ CHARMAP "&iacute", 20 CHARMAP "A", 128 +

It is possible to create multiple character maps and then switch + between them as desired. This can be used to encode debug information in + ASCII and use a different encoding for other purposes, for example. + Initially, there is one character map called main and it + is automatically selected as the current character map from the beginning. + There is also a character map stack that can be used to save and restore + which character map is currently active.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CommandMeaning
+ nameCreates a new, empty character map called + name.
+ name, basenameCreates a new character map called name, copied + from character map basename.
+ nameSwitch to character map name.
Push the current character map onto the stack.
Pop a character map off the stack and switch to it.

Note: Character maps affect all strings in the - file from the point in which they are defined. This means that any string - that the code may want to print as debug information will also be affected - by it.

+ file from the point in which they are defined, until switching to a + different character map. This means that any string that the code may want + to print as debug information will also be affected by it.

Note: 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.

diff --git a/docs/rgbds.5.html b/docs/rgbds.5.html index f3f4c737..fc0e5156 100644 --- a/docs/rgbds.5.html +++ b/docs/rgbds.5.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbds.7.html b/docs/rgbds.7.html index aa51b345..2f0ed658 100644 --- a/docs/rgbds.7.html +++ b/docs/rgbds.7.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbfix.1.html b/docs/rgbfix.1.html index 36739fdc..4d4dbfee 100644 --- a/docs/rgbfix.1.html +++ b/docs/rgbfix.1.html @@ -2,9 +2,9 @@ diff --git a/docs/rgbgfx.1.html b/docs/rgbgfx.1.html index 47845101..088167af 100644 --- a/docs/rgbgfx.1.html +++ b/docs/rgbgfx.1.html @@ -2,9 +2,9 @@ @@ -77,6 +77,8 @@ The rgbgfx program converts PNG images into the Nintendo
Same as -a, but the attrmap file output name is made by taking the input filename, removing the file extension, and appending .attrmap.
+
+
Use the color curve of the Game Boy Color when generating palettes.
Debug features are enabled.
diff --git a/docs/rgblink.1.html b/docs/rgblink.1.html index 9e059686..1761f727 100644 --- a/docs/rgblink.1.html +++ b/docs/rgblink.1.html @@ -2,9 +2,9 @@ diff --git a/docs/rgblink.5.html b/docs/rgblink.5.html index bfb65e39..18624050 100644 --- a/docs/rgblink.5.html +++ b/docs/rgblink.5.html @@ -2,9 +2,9 @@