Next Previous Contents

7. Output formats

Using --write it is possible to write processed data to an output file. An attribute "name" is mandatory, it is used as the file name for the output. The output format can be specified using an attribute named "format". If this attribute doesn't exist, the output format is determined by looking at the file name extension.

7.1 Binary

For this format, the processed data is written to the output file in raw binary format. There are no additional attributes (besides "name" and "format") for this output format.

7.2 Assembler code

For this format, the processed data is written to the output file in ca65 assembler format. There are several attributes for this output format:

base

The value for this attribute specifies the numeric base for the data values. It may be either 2, 10 or 16. The default is 16. If the base is 2, the numbers are prefixed by '%', if the base is 16, the numbers are prefixed by '$'. For base 10, there is no prefix.

bytesperline

The value for this attribute specifies the number of bytes output in one line of the assembler file. The default is 16.

ident

This is an optional attribute. When given, the output processor will wrap the data into a .PROC with the given name. In addition, three constants are added as local symbols within the .PROC: COLORS, WIDTH and HEIGHT.

7.3 C code

When using C output format, a small piece of C source code is generated that defines the data containing the output in an array of unsigned char.

Possible attributes for this format are:

base

The value for this attribute specifies the numeric base for the data values. It may be either 10 or 16. The default is 16. If the base is 16, the numbers are prefixed by 0x. For base 10, there is no prefix.

bytesperline

The value for this attribute specifies the number of bytes output in one line of the C source code. The default is 16.

ident

This is an optional attribute. When given, the output processor will wrap the data into an array of unsigned char with the given name. In addition, three #defines are added for <ident>_COLORS, <ident>_WIDTH and <ident>_HEIGHT.


Next Previous Contents