Difference between revisions of "Sprites"
(Created page with "== SPRITES == Sprite is a computer graphics term for a two-dimensional bitmap that is integrated into a larger scene. Originally sprites referred to independent objects that...") |
|||
Line 9: | Line 9: | ||
== Sprite Registers == | == Sprite Registers == | ||
− | Each Sprite has registers composed of a total of 8 bytes for manipulation, starting at $AF:0200 and spanning through to $AF:02FF. The first one of each 8 byte block is always the | + | Each Sprite has registers composed of a total of 8 bytes for manipulation, starting at $AF:0200 and spanning through to $AF:02FF. The first one of each 8 byte block is always the control register with the following attributes: |
− | {| | + | {| {{Wikitable}} |
+ | !Attribute | ||
+ | !Bit | ||
+ | |- | ||
|SPRITE_Enable||= $01 | |SPRITE_Enable||= $01 | ||
+ | |- | ||
|SPRITE_LUT0||= $02 | |SPRITE_LUT0||= $02 | ||
+ | |- | ||
|SPRITE_LUT1||= $04 | |SPRITE_LUT1||= $04 | ||
+ | |- | ||
|SPRITE_LUT2||= $08 | |SPRITE_LUT2||= $08 | ||
+ | |- | ||
|SPRITE_DEPTH0||= $10 | |SPRITE_DEPTH0||= $10 | ||
+ | |- | ||
|SPRITE_DEPTH1||= $20 | |SPRITE_DEPTH1||= $20 | ||
+ | |- | ||
|SPRITE_DEPTH2||= $40 | |SPRITE_DEPTH2||= $40 | ||
|} | |} | ||
Line 23: | Line 32: | ||
The following is an overview of all the attributes of the 8 byte block: | The following is an overview of all the attributes of the 8 byte block: | ||
− | {| | + | {| {{Wikitable}} |
+ | !Attribute | ||
+ | !Bit | ||
+ | |- | ||
|SP00_CONTROL_REG||= $AF02*0 | |SP00_CONTROL_REG||= $AF02*0 | ||
− | |SP00_ADDY_PTR_L||= $ | + | |- |
− | |SP00_ADDY_PTR_M||= $ | + | |SP00_ADDY_PTR_L||= $AF02*1 |
− | |SP00_ADDY_PTR_H||= $ | + | |- |
− | |SP00_X_POS_L||= $ | + | |SP00_ADDY_PTR_M||= $AF02*2 |
− | |SP00_X_POS_H||= $ | + | |- |
− | |SP00_Y_POS_L||= $ | + | |SP00_ADDY_PTR_H||= $AF02*3 |
− | |SP00_Y_POS_H||= $ | + | |- |
+ | |SP00_X_POS_L||= $AF02*4 | ||
+ | |- | ||
+ | |SP00_X_POS_H||= $AF02*5 | ||
+ | |- | ||
+ | |SP00_Y_POS_L||= $AF02*6 | ||
+ | |- | ||
+ | |SP00_Y_POS_H||= $AF02*7 | ||
|} | |} |
Revision as of 03:01, 11 April 2019
SPRITES
Sprite is a computer graphics term for a two-dimensional bitmap that is integrated into a larger scene.
Originally sprites referred to independent objects that are composited together, by hardware, with other elements such as a background or tiles. The composition occurs as each scan line is prepared for the video output device, without involvement of the main CPU and without the need for a full-screen frame buffer. Sprites can be positioned or altered by setting attributes used during the hardware composition process.
Vicky is able to render 32 non-multiplexed sprites with a resolution of 32x32 pixels each. Just as bitmaps, a LUT is required for selecting 256 out of 16.777.216 colors.
Sprite Registers
Each Sprite has registers composed of a total of 8 bytes for manipulation, starting at $AF:0200 and spanning through to $AF:02FF. The first one of each 8 byte block is always the control register with the following attributes:
Attribute | Bit |
---|---|
SPRITE_Enable | = $01 |
SPRITE_LUT0 | = $02 |
SPRITE_LUT1 | = $04 |
SPRITE_LUT2 | = $08 |
SPRITE_DEPTH0 | = $10 |
SPRITE_DEPTH1 | = $20 |
SPRITE_DEPTH2 | = $40 |
The following is an overview of all the attributes of the 8 byte block:
Attribute | Bit |
---|---|
SP00_CONTROL_REG | = $AF02*0 |
SP00_ADDY_PTR_L | = $AF02*1 |
SP00_ADDY_PTR_M | = $AF02*2 |
SP00_ADDY_PTR_H | = $AF02*3 |
SP00_X_POS_L | = $AF02*4 |
SP00_X_POS_H | = $AF02*5 |
SP00_Y_POS_L | = $AF02*6 |
SP00_Y_POS_H | = $AF02*7 |