| Name: | »Draw sprite«
| ||||||||||||||||||||||||||||||||||||
| Line-A number: | $A00D
| ||||||||||||||||||||||||||||||||||||
| Syntax: | See 'Bindings for draw_sprite'
| ||||||||||||||||||||||||||||||||||||
| Description: | This Line-A function draws a sprite on the screen. The
X-position is passed in D0, the Y-position in d1. A0 points to a
structure of the type SDB that describes the construction of the
sprite. A2 points to the sprite-save buffer which stores the saved
background and has to have a minimum size of 10 + 64 * number of
colour planes. The register A6 will be destroyed.
typedef struct
{
int16_t xhot, /* X-offset */
yhot, /* Y-offset */
form, /* Format (1 = VDI, -1 = XOR) */
bgcol, /* Background colour */
fgcol, /* Foreground colour */
image[32]; /* Sprite image */
} SDB;
The result on the screen depends on the format set in form and can be gathered for each 1 bit from the foreground and background data from the following table. Old is the existing image point, new the new one after drawing the sprite:
| ||||||||||||||||||||||||||||||||||||
| Return value: | The function does not return a result.
| ||||||||||||||||||||||||||||||||||||
| Availability: | All TOS versions.
| ||||||||||||||||||||||||||||||||||||
| See also: | Binding Transform mouse Undraw sprite
|
| Pure-C: |
typedef struct
{
int16_t xhot, /* X-offset */
yhot, /* Y-offset */
form, /* Format (1 = VDI, -1 = XOR) */
bgcol, /* Background colour */
fgcol, /* Foreground colour */
image[32]; /* Sprite image */
} SDB;
typedef int16_T SSB[10 + 4 * 64];
void draw_sprite( int16_t x, int16_t y, SDB *pSdb, SSB *pSsb );
|
| Assembler: |
; Save registers movem.l D0-D2/A0-A2/A6,-(A7) ; X-position to D0 move.w x,D0 ; Y-position to D1 move.w y,D1 ; Pointer sprite-definition block to A0 move.l pSdb,A0 ; Pointer sprite-save block to A2 move.l pSsb,A2 ; Line-A opcode dc.w $A00D ; Restore registers movem.l (A7)+,D0-D2/A0-A2/A6 |