/*
 * @(#)cg16.h	1.1 (National Semiconductor) 4/5/90 11:57:38
 * @(#) copyrights and other release restrictions may apply
 */

#ifndef __CG16_H__

#define __CG16_H__
/*
 * Bitblt instructions
 */
typedef void  _bbfunc(char *src_addr,
		      char *dest_addr,
		      unsigned char shift_val,
		      unsigned int height,
		      unsigned int mask1,
		      unsigned int mask2,
		      int adj_src_warp,
		      int adj_dest_warp,
		      unsigned short width);

extern _bbfunc _bband,		/* plain bband */
	       _bband_s,	/* bband with inverted source */
               _bband_da,	/* bband with decreasing addresses */
               _bband_sda,	/* bband with inverted Source, decreasing 
				 * addresses */
	       _bbfor,		/* plain, fast or */
               _bbor_s,	        /* bbor with inverted source */
               _bbor_da,	/* bbor with decreasing addresses */
               _bbor_sda,	/* bbor with inverted Source, decreasing 
				 * addresses */
	       _bbxor,		/* plain bbxor */
               _bbxor_s,	/* bbxor with inverted source */
               _bbxor_da,	/* bbxor with decreasing addresses */
               _bbxor_sda,	/* bbxor with inverted Source, decreasing 
				/* addresses */
	       _bbstod,		/* plain bbstod */
               _bbstod_s,	/* bbstod with inverted source */
               _bbstod_da,	/* bbstod with decreasing addresses */
               _bbstod_sda;	/* bbstod with inverted Source, decreasing 
				/* addresses */
	
/* 
 * bitwt
 */
void  _bitwt(char **src_addr,
	     char **dest_addr,
	     int shift_val);
/*
 * extblt
 */

void  _extblt(char *src_addr,		/* Extblt without preloading */
	      char *dest_addr,
	      int width,
	      int height,
	      int horiz_incr,
	      int adj_src_warp,
	      int adj_dest_warp);

void  _extbltp(char *src_addr,		/* Extblt with preloading */
	      char *dest_addr,
	      int width,
	      int height,
	      int horiz_incr,
	      int adj_src_warp,
	      int adj_dest_warp);
/*
 * movmp
 */

void  _movmpb(void *dest_addr,
	      int incr,
	      int count,
	      unsigned char pattern);

void  _movmpw(void *dest_addr,
	      int incr,
	      int count,
	      unsigned short pattern);

void  _movmpd(void *dest_addr,
	      int incr,
	      int count,
	      unsigned int pattern);
/*
 * movmp_upd  (updates the address)
 */

void  _movmpb_upd(void **dest_addr,
	          int incr,
	          int count,
	          unsigned char pattern);

void  _movmpw_upd(void **dest_addr,
	          int incr,
	          int count,
	          unsigned short pattern);

void  _movmpd_upd(void **dest_addr,
	          int incr,
	          int count,
	          unsigned int pattern);
/*
 * sbits
 */

#define _Sbits(addr,offset,length)   _sbits((addr),(offset),(length),_sbits_tbl)

extern unsigned  _sbits_tbl[];

int   _sbits(void *dest_addr,
	     int bit_offset,
	     int run_length,
	     unsigned *lookup_table);
 
/*
 * sbitps 
 */

void  _sbitps(void *dest_addr,
	      int *bit_offset,
	      int run_length,
	      int dest_warp);
/*
 * tbits 
 */

#define IGNORE_PARAM ((void *) 0)  /* for _tbits0 and _tbits1 last parameter */

int   _tbits0(void *src_addr,		/* count a series of zeros */
	      int *bit_offset,
	      int *run_length,
	      int max_run_length,
	      int max_bit_offset,
	      unsigned int * fflag);

int   _tbits1(void *src_addr,		/* count a series of ones */
	      int *bit_offset,
	      int *run_length,
	      int max_run_length,
	      int max_bit_offset,
	      unsigned int * fflag);

#endif /* __CG16_H__ */
