.Option

Usage:

 

.option parameters = args

Parameters:

BM_MSK

Whether or not to include a mask in the output bitmap. This should be set to true or false. True means that SPASM will generate a mask based on the color specified in BM_MSK_RGB.

BM_MSK_RGB

The color used to specify a mask in the bitmap. Otherwise known as a key color. The default value for this is #00FF00

BM_INV_RGB

Whether or not to invert the mask color specified in BM_MSK_RGB. If true then the RGB values are inverted. By default this is false.

BM_MSK_INV

Whether or not to invert the mask bits. By default this is set to false. This means that transparent bits are 0 and solid bits are 1

BM_MSK_1ST

Whether or not to include the mask first or second. By default this value is false, meaning that the mask is included after the bitmap data.

BM_SHD

Number of shades in output bitmaps. When importing grayscale or color bitmaps, SPASM uses this option to determine the number of layers included

BM_PAD

Padding around each sprite. This is normally used in conjunction with BM_PAD but can be used on its own (if for some you wanted to have bitmaps with extra padding SPASM ignores). 

BM_MAP

This option allows you to specify a series of images in the bitmap file to be treated as seperate bitmap files.  This should be defined as [cols]x[rows]. You can also prefix this option with a label (see the example below) and SPASM will create defines for each image that allow you easy access to the data. The image are numbered in order starting at 1 in the top left column and reading left to right, top to bottom. The bottom right image data could be accessed as label10. A define label_count is created to define the total number of images imported from this bitmap file.

Example: 

label .option bm_map = 2x5 ;indicates that the bitmap file has 10 separate images in it, in a table of 2 columns and 5 rows

BM_MIN_W

Minimum width for each sprite. When this is defined it applies for all included bitmaps afeter the .option in the current file. The min width means that if your bitmap width is smaller then the value specified here, SPASM will automatically fit the pad the data to fit.

BM_HDR_FMT

Format the header should be written
W for width
H for height
S for size

Each letter stands for an 8 bit number to be inserted in the header. So you can combine them eg: WW or HH, if you need a 16 bit size prefixing your data.

The option should be assigned as a string of letters, with different letters separated by commas. See the example below as to how to define them.

BM_HDR

If this option is specified, then the header will be written to the data. The header contains information about the bitmap being inserted into the program. This allows you to let spasm automatically include any combination of the width, height, or size of the data being inserted.

This option should be either true or false. True means a header defined by the BM_HDR_FMT will be inserted. False means that SPASM will only insert the bitmap data.

Example:

 

.option bm_min_w = 16
.option bm_hdr = TRUE
.option bm_hdr_fmt="WW,HH,SS"
.option bm_shd = 4
#include "16x16Sprite.bmp"
;data included is equivalent to
.dw 16, 16, 64
.db data		;...64 bytes of data

This would import a bitmap into a 16x16 4 level grayscale sprite (2 layers of data), writing a header that consisted of a word for the width, a word for the height, and a word for the total size.

Last edited Sep 28, 2011 at 9:50 AM by BuckeyeDude, version 13

Comments

No comments yet.