Entry | |
---|---|
R0 | 52 (Reason code) + Area value? |
R1 | Unused/Sprite area (as defined by area value in R0) |
R2 | Sprite name/pointer (as defined by area value in R0) |
R3 | X coordinate |
R4 | Y coordinate |
R5 | Flags |
R6 | Pointer to scaling factors, or 0 for 1:1 scaling |
R7 | Pointer to pixel translation table, or 0 for no translation |
Exit | |
---|---|
All registers preserved |
Supported flags are:
Bits | |
---|---|
0-2 | GCOL action |
3 | Blend using mask/alpha channel |
4 | Translation table can be ignored |
5 | Translation table is wide |
6 | Enable dithering |
7 | R7 is pointer to colour mapping descriptor |
8-15 | Translucency (0 = opaque, 255 = 1/256 visibility) |
This call paints a scaled sprite to the screen. When supplied with the right translation table, it is able to paint a sprite created in any source mode to any destination mode. If a translation table is not supplied when one is required, an error will be generated. Therefore when plotting arbitrary sprites it is recommended to always call ColourTrans_SelectTable or ColourTrans_GenerateTable before the plot in order to generate a suitable table.
Coordinates are in OS units, and are relative to the bottom-left corner of the sprite.
1:1 scaling maps directly from source pixels to destination pixels; the DPI and eigen values of the source and destination are ignored.
If bit 3 is clear, the sprite mask/alpha channel will be ignored and all pixels of the sprite will be rendered. If the sprite and screen have an alpha channel then the alpha channel of the sprite will be copied to the alpha channel of the screen.
If bit 3 is set, the sprite mask/alpha channel will be used to determine which pixels to render and which pixels to skip. If the sprite has an alpha mask or alpha channel then this will enable alpha blending.
If translucency is enabled (bits 8-15) or alpha blending is enabled (bit 3 with alpha mask/channel) then the GCOL action will be ignored.
It is recommended to set bit 4 whenever an ordinary translation table is supplied; i.e. a table which merely converts the colours from one palette/colour depth to another. This allows OS_SpriteOp to ignore the table in certain situations in which it believes it can produce higher quality output itself, e.g. by reading directly from the sprite palette. If you are applying a custom transform in the translation table (e.g. the table was created with the help of a colour mapping function) then bit 4 must be left clear otherwise the table may be incorrectly discarded.
Bit 5 must be set whenever bit 4 was set in the ColourTrans_SelectTable/ColourTrans_GenerateTable flags. Likewise, bit 5 must be clear if that bit was not set.
If dithering is enabled by bit 6, an ordered dither will be applied where possible. For example when painting a 16bpp or 32bpp sprite to a lower depth destination. Dithering is also used in some situations to improve the output of blending operations.
It is only valid to set bit 7 if the source sprite is a true colour sprite (i.e. not palletised). For colour mapping of palletised sprites you should instead pass the colour mapping function to ColourTrans.