Sprite descprition and utilities

[todo] description of the SATB sprite entry

Summary
Sprite descprition and utilities[todo] description of the SATB sprite entry
Sprite entry bitmasks
SPRITE_X_MASKBitmask for the sprite X coordinate.
SPRITE_Y_MASKBitmask for the sprite Y coordinate.
SPRITE_CG_MODE_MASKBitmask for CG mode.
SPRITE_VERTICAL_FLIP_MASKBitmask for sprite vertical flip flag.
SPRITE_HORIZONTAL_FLIP_MASKBitmask for sprite horizontal flip flag.
SPRITE_HEIGHT_MASKBitmask for sprite height.
SPRITE_WIDTH_MASKBitmask for sprite width.
SPRITE_PRIORITY_MASKBitmask for sprite priority.
SPRITE_PALETTE_MASKBitmask for sprite palette index.
Sprite CG modes.
SPRITE_CG_MODE_B01Bitplanes 0 and 1 are read, 2 and 3 are treated as zeroes.
SPRITE_CG_MODE_B23Bitplanes 2 and 3 are read, 0 and 1 are treated as zeroes.
Sprite size.Sprite width can be 16 or 32.
SPRITE_HEIGHT_1616 px sprite height.
SPRITE_HEIGHT_3232 px sprite height.
SPRITE_HEIGHT_6464 px sprite height.
SPRITE_WIDTH_1616 px sprite width.
SPRITE_HEIGHT_3232 px sprite width.
Sprite control flags
SPRITE_PRIORITY_LOWThe sprite will be displayed in background.
SPRITE_PRIORITY_HIGHThe sprite will be displayed in foreground.
SPRITE_HORIZONTAL_FLIPThe sprite will be flipped horizontally.
SPRITE_VERTICAL_FLIPThe sprite will be flipped vertically.

Sprite entry bitmasks

SPRITE_X_MASK

SPRITE_X_MASK = $3f

Bitmask for the sprite X coordinate.

SPRITE_Y_MASK

SPRITE_Y_MASK = $3f

Bitmask for the sprite Y coordinate.

SPRITE_CG_MODE_MASK

SPRITE_CG_MODE_MASK = $01

Bitmask for CG mode.

SPRITE_VERTICAL_FLIP_MASK

SPRITE_VERTICAL_FLIP_MASK = $80

Bitmask for sprite vertical flip flag.

SPRITE_HORIZONTAL_FLIP_MASK

SPRITE_HORIZONTAL_FLIP_MASK = $08

Bitmask for sprite horizontal flip flag.

SPRITE_HEIGHT_MASK

SPRITE_HEIGHT_MASK = $30

Bitmask for sprite height.

SPRITE_WIDTH_MASK

SPRITE_WIDTH_MASK = $01

Bitmask for sprite width.

SPRITE_PRIORITY_MASK

SPRITE_PRIORITY_MASK = $80

Bitmask for sprite priority.

SPRITE_PALETTE_MASK

SPRITE_PALETTE_MASK = $0f

Bitmask for sprite palette index.

Sprite CG modes.

SPRITE_CG_MODE_B01

SPRITE_CG_MODE_B01 = $00

Bitplanes 0 and 1 are read, 2 and 3 are treated as zeroes.

Note

This is only valid if the VDC MWR register is set to 2 or 3.

SPRITE_CG_MODE_B23

Bitplanes 2 and 3 are read, 0 and 1 are treated as zeroes.

Note

This is only valid if the VDC MWR register is set to 2 or 3.

Sprite size.

Sprite width can be 16 or 32.  Its height can be 16, 32 or 64.

SPRITE_HEIGHT_16

SPRITE_HEIGHT_16 = $00

16 px sprite height.

SPRITE_HEIGHT_32

SPRITE_HEIGHT_32 = $10

32 px sprite height.

SPRITE_HEIGHT_64

SPRITE_HEIGHT_64 = $20

64 px sprite height.

SPRITE_WIDTH_16

SPRITE_WIDTH_16 = $00

16 px sprite width.

SPRITE_HEIGHT_32

32 px sprite width.

Sprite control flags

SPRITE_PRIORITY_LOW

SPRITE_PRIORITY_LOW = $00

The sprite will be displayed in background.

SPRITE_PRIORITY_HIGH

SPRITE_PRIORITY_HIGH = $80

The sprite will be displayed in foreground.

SPRITE_HORIZONTAL_FLIP

SPRITE_HORIZONTAL_FLIP = $08

The sprite will be flipped horizontally.

SPRITE_VERTICAL_FLIP

SPRITE_VERTICAL_FLIP = $80

The sprite will be flipped vertically.

SPRITE_X_MASK = $3f
Bitmask for the sprite X coordinate.
SPRITE_Y_MASK = $3f
Bitmask for the sprite Y coordinate.
SPRITE_CG_MODE_MASK = $01
Bitmask for CG mode.
SPRITE_VERTICAL_FLIP_MASK = $80
Bitmask for sprite vertical flip flag.
SPRITE_HORIZONTAL_FLIP_MASK = $08
Bitmask for sprite horizontal flip flag.
SPRITE_HEIGHT_MASK = $30
Bitmask for sprite height.
SPRITE_WIDTH_MASK = $01
Bitmask for sprite width.
SPRITE_PRIORITY_MASK = $80
Bitmask for sprite priority.
SPRITE_PALETTE_MASK = $0f
Bitmask for sprite palette index.
SPRITE_CG_MODE_B01 = $00
Bitplanes 0 and 1 are read, 2 and 3 are treated as zeroes.
SPRITE_HEIGHT_16 = $00
16 px sprite height.
SPRITE_HEIGHT_32 = $10
32 px sprite height.
SPRITE_HEIGHT_64 = $20
64 px sprite height.
SPRITE_WIDTH_16 = $00
16 px sprite width.
SPRITE_PRIORITY_LOW = $00
The sprite will be displayed in background.
SPRITE_PRIORITY_HIGH = $80
The sprite will be displayed in foreground.
SPRITE_HORIZONTAL_FLIP = $08
The sprite will be flipped horizontally.
SPRITE_VERTICAL_FLIP = $80
The sprite will be flipped vertically.
Close