/*
 * sprite.h
 *
 * [Generated from sprite, 25 September 1996]
 */

#if !defined(__CC_NORCROFT) || !defined(__arm)
  #error You must use the Norcroft ARM Compiler for Sapphire programs
#endif

#pragma include_only_once
#pragma force_top_level

#ifndef __sprite_h
#define __sprite_h

#ifndef __sapphire_h
  #include "sapphire.h"
#endif

/*----- Overview ----------------------------------------------------------*
 *
 * Functions provided:
 *
 *  sprite_op
 *  sprite_getTable
 *  sprite_plot
 */

/* --- sprite_op --- *
 *
 * On entry:	R0,R2-R7 ==  SpriteOp parameters (R1 set up here)
 *
 * On exit:	Registers and flags altered as for the SpriteOp
 *
 * Use:		Performs an OS_SpriteOp with the given arguments, using
 *		the appication's Sprites resource as the sprite area.
 */

extern routine sprite_op;

/* --- sprite_getTable --- *
 *
 * On entry:	R0 == pointer to a sprite
 *		R1 == pointer to buffer for translate table
 *
 * On exit:	--
 *
 * Use:		Creates a colour translate table for the given sprite in
 *		the specified buffer.
 *
 *		If you have a sprite name but no pointer, use OS_SpriteOp
 *		24 to find the pointer -- this will make further sprite ops
 *		on the sprite much quicker.
 */

extern routine sprite_getTable;

/* --- sprite_plot --- *
 *
 * On entry:	R0 == pointer to a sprite
 *		R1 == x coordinate to plot at
 *		R2 == y coordinate to plot at
 *		R3 == pointer to scale block, or 0 for 1:1
 *
 * On exit:	CS if the sprite was plotted OK, else CC
 *
 * Use:		Plots a sprite on the screen.  The scaling refers to the
 *		sprite proper: /this/ routine takes care of odd pixel
 *		sizes and things, so sprites don't appear squashed or
 *		stretched unless you really want them to.
 *
 *		We return C clear on exit if we couldn't plot the sprite;
 *		typically this would be if the sprite's mode is undefined.
 */

extern routine sprite_plot;

/*----- That's all, folks -------------------------------------------------*/

#endif
