Changes
moved [[Amstrad CPC plus sprite format]] to [[Programming:Amstrad CPC plus sprite format]]: Update to Programming tag
== The data ==
Each sprite has the ability to show can display 15 distinct colours, the pixel colours are indexed #0 - #F.
Index #0 is always transparency, whereas index #1 - #F is the colour index in the sprite palette.
== The colour palette ==
The ASIC can handle 4096(16x16x16) colours. Each colour is defined as values of '''red''', '''green''' and '''blue'''.
Each value is handled as 4bit values.
The hardware code send to the ASIC is #0grb.
In the below example changing the palette index colour 1 to value #0F00 gives a '''green''' Pac sprite.
[[Image:Green pac.png]]
changing the palette index colour 1 to value #00F0 gives a '''red''' Pac sprite.
[[Image:Red pac.png]]
and finally changing the palette index colour 1 to value #000F gives a '''blue''' Pac sprite.
[[Image:Blue pac.png]]
== Example ==
Below is shown an example of how a sprite is organized into raw data.To transfer the sprite data to the ASIC look here: [[Programming:CPC Plus Hardware Sprites|Transfer to ASIC]]
[[Image:Cpcplussprite.png|400px]]
db #00,#00,#00,#00,#00,#00,#00,#00
.pack_sprite_palettepac_sprite_palette
; Sprite ink 1
dw #0000 ; Red = #0 Green = #0 Blue = #0 ; The black in the PAC's eyes
; Sprite ink 3
dw #0000 0FFF ; Red = #F Green = #F Blue = #F ; The white in the PAC's eyes
</geshi>
== Links See also== *[[Sprites Multiplexing]]*[[Programming:CPC Plus Hardware Sprites]]
[[Category:CPC Plus]][[Category: Programming]][[Category:Graphic]]