Sprite Attribute Upload: Difference between revisions

From SpecNext Wiki
Jump to: navigation, search
No edit summary
No edit summary
Line 2: Line 2:
|Number=$xx57
|Number=$xx57
|ShortDesc=Uploads sprite positions, visibility and effect flags.
|ShortDesc=Uploads sprite positions, visibility and effect flags.
|PortMask=%---- ---- 0101 0111
|Readable=No
|Readable=No
|Writable=Yes
|Writable=Yes

Revision as of 16:56, 28 August 2017

Number PortNumber::$xx57
Decimal NumberDec::
Short desc. ShortDesc::Uploads sprite positions, visibility and effect flags.
Bit Mask PortMask::%---- ---- 0101 0111
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")