#define	SPR_MAX		1023
#define	OFS_ON		32768
#define	SPR_ON		0xdfff
#define	SPR_OFF		0x2000
#define	SPR_COL16	0x8100

#define	PAL_BLOCK	32
#define SPR_BLOCK	128			/* 16 colors mode */
#define SPR_BK32K	512			/* 32 colors mode */
#define SPR_BH		2
#define SPR_DSPMAX	( 200*3 )	/* ( SCR_WC*SCR_WC + BACK_IDX + 8 ) */

#define SPR_SET(sn,pt,pl,x,y) 	SPR_setAttribute(SPR_MAX-(sn),x,y,(pt)+128,pl)
#define SPR_SET0(sn,pn)			SPR_SET(sn,pn,pattern_idx[(pn)& 1023],1,1)
#define SPR_SET1(sn,pn,pl)		SPR_SET(sn, pn, (pl)| SPR_COL16, 1, 1 )
#define SPR_SET2(sn,pn,pl)		SPR_SET((sn)+3, pn, (pl)| SPR_COL16, 2, 2 )

#define SPR_POS(sn,x,y,xs,ys,sz)	SPR_setPosition(sz,SPR_MAX-(sn),xs,ys,x,y)
#define SPR_POS1(sn,x,y)			SPR_POS(sn,x,y,1,1,0)
#define SPR_POS2(sn,x,y)			SPR_POS((sn)+3,x,y,2,2,0)

#define SPR_MOVE(sn,xm,ym,xs,ys)	SPR_setMotion(SPR_MAX-(sn),xs,ys,xm,ym)
#define SPR_MOVE1(sn,xm,ym)			SPR_MOVE(sn,xm,ym,1,1)
#define SPR_MOVE2(sn,xm,ym)			SPR_MOVE((sn)+3,xm,ym,2,2)

#define SPR_START()			SPR_display( 1, SPR_DSPMAX )
#define SPR_STOP()			SPR_display( 0, SPR_DSPMAX )
#define SPR_READY()			SPR_display( 2, SPR_DSPMAX )
