Sprite Attribute Upload

From SpecNext Wiki
Revision as of 15:09, 18 August 2017 by wiki>Hyphz
Jump to: navigation, search
Number PortNumber::$xx57
Decimal NumberDec::
Short desc. ShortDesc::Uploads sprite positions, visibility and effect flags.
Bit Mask PortMask::
Readable Readable::No
Writable Writable::Yes
Subsystem Subsystem::Sprites

Uploads attributes of the sprite slot selected by {{#ask: PortNumber::$303B }} ($303B{{#ask: PortNumber::$303B |mainlabel=- |headers=hide |intro= /  |?NumberDec#- }}). Attributes are in 4 byte blocks sent in the following order; after sending 4 bytes the address auto-increments to the next sprite. This auto-increment is independent of other sprite ports. The 4 bytes are as follows:

Byte 1 is the low bits of the X position. Legal X positions are 0-319 if sprites are allowed over the border or 32-287 if not. The MSB is in byte 3.

Byte 2 is the Y position. Legal Y positions are 0-255 if sprites are allowed over the border or 32-223 if not.

Byte 3 is bitmapped:

Bit Description
4-7 Palette offset, added to each palette index from pattern before drawing
3 Enable X mirror
2 Enable Y mirror
1 Enable rotation
0 MSB of X coordinate

Byte 4 is also bitmapped:

Bit Description
7 Enable visibility
6 Reserved
5-0 Pattern index ("Name")