Difference between revisions of "Sprites"

From C256 Foenix Wiki
Jump to navigation Jump to search
(Sprite Registers)
Line 1: Line 1:
== SPRITES ==
 
 
 
Sprite is a computer graphics term for a two-dimensional bitmap that is integrated into a larger scene.
 
Sprite is a computer graphics term for a two-dimensional bitmap that is integrated into a larger scene.
  

Revision as of 07:56, 11 April 2019

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 Address
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