
/*
**  This C include file was generated automatically
**  from an assembly include file
**  using I2H written by Henning Friedl.
*/

/* --------------------------------------------------------------------------- */
/*    IFND UTILITY_TAGITEM_I */
/*                 include   utility/tagitem.i */
/*    ENDC */
/* --------------------------------------------------------------------------- */
#define RETINA_LIB_VERSION	5	/* the current version of retina.library */
/* --------------------------------------------------------------------------- */
#define SEGMENTSIZE	64*1024
/* --------------------------------------------------------------------------- */
/* ---- Alerts: */

/*  an alert number like 35xx01xx identifies an alert caused by retina.library */

#define ALERT_NOHARD	0x0100	/* no Retina hardware present */

#define ALERT_NOMEM	0x0110|AG_NoMemory	/* Retina does not have any memory at all */
#define ALERT_NOMEMTOFREE	0x0111	/* tried to free memory although no memory is in use */
#define ALERT_MEMTOFREENOTFOUND	0x0112	/* tried to free memory which has not been allocated */
#define ALERT_NOMEMNODEMEM	0x0113|AG_NoMemory	/* no Amiga memory for memory listnode */
#define ALERT_MEMNOTFREED	0x0114	/* still some memory in use at library expunge */

#define ALERT_CLOSE_LIB_MONITOR	0x0121	/* tried to remove a library internal monitor */
#define ALERT_MONITOR_NOT_CLOSED	0x0122	/* LIB_Expunge and not all monitors removed */
#define ALERT_MONITOR_ID_INUSE	0x0123	/* monitor ID used twice (internal use only) */
/* --------------------------------------------------------------------------- */
/*  modes for Retina_SetDrMd() */

#define RDM_JAM1	0
#define RDM_COMPLEMENT	2
/* --------------------------------------------------------------------------- */
/*  modes for Retina_WriteBitMap() */

#define WBMMODE_STD	0	/* normal 2 to 256 color images and EHB to 8 bit */
#define WBMMODE_HAM	1	/* 4096 color HAM to 16 or 24 bit (16 Bit: (v4)) */
#define WBMMODE_HAM8	2	/* 256k color AA HAM to 24 bit */

#define WBMMODEB_EXTENDED	16
#define WBMMODEF_EXTENDED	0x00010000	/* see retina.doc/Retina_WriteBitMap() (v3) */
/* --------------------------------------------------------------------------- */
/*  modes for Retina_WriteRect(), ... */

#define RECTMODE_RGB	0	/* one byte each for red, green, blue */
#define RECTMODE_RGBA	1	/* one byte each for red, green, blue and alpha */
#define RECTMODE_BGR	2	/* same as RGB, but reverse pixel order */
#define RECTMODE_GB_R	3	/* PRIVATE, do not use */
#define RECTMODE_256	4	/* one byte for each pixel */
#define RECTMODE_GB_R0	5	/* PRIVATE, do not use */
#define RECTMODE_RAW	6	/* raw data, either 8, 16 or 24 bit (v4) */
#define RECTMODE_RGBA_0	7	/* PRIVATE, do not use (v5) */
/* --------------------------------------------------------------------------- */
/*  Tagitems for SetSprite() or SpriteFunction(): */

#define RSP_On	TAG_USER+1
#define RSP_Color0	TAG_USER+2
#define RSP_Color1	TAG_USER+3
#define RSP_ZoomX	TAG_USER+4
#define RSP_ZoomY	TAG_USER+5	/* ignored by SpriteFunction() */
/* --------------------------------------------------------------------------- */
#define MONID_LIB	0x00000000	/*  IDs used by retina.library. Do NOT use! */
#define MONID_WBEMU	0x10000000	/*  IDs used by RetinaEmu. Do NOT use! */
#define MONID_CUSTOM	0x20000000	/*  Software which adds custom monitor */
/*  definitions must set the highest */
/*  nibble of the monitor ID to 2! */
#define MONID_AUTO	0x70000000	/*  Auto-IDs created by Retina_AddMonitor(). */
/*  Do NOT use! */
#define MONID_ADDAUTO	0xffffffff	/*  Used by Retina_AddMonitor() to create */
/*  auto IDs. */

/*  flag definitions for _nrm_Flags and _rm_Flags: */

#define MDB_DBL	0
#define MDF_DBL	0x00000001	/* 1 = Double-Scan */
#define MDB_LACE	1
#define MDF_LACE	0x00000002	/* 1 = Interlace */
#define MDB_CLKDIV2	2
#define MDF_CLKDIV2	0x00000004	/* 1 = use 1/2 pixel clock */
#define MDB_PLANAR	3
#define MDF_PLANAR	0x00000008	/* 1 = screen has 16 colors on 4 planes          (v2) */
#define MDB_HIDE	4
#define MDF_HIDE	0x00000010	/* 1 = entry should not appear in public lists   (v2) */
#define MDB_GROUP	5
#define MDF_GROUP	0x00000020	/* 1 = this definition is a group-header         (v2) */
#define MDB_POSHSYNC	6
#define MDF_POSHSYNC	0x00000040	/* 1 = HSync wird positiv                        (v4) */
#define MDB_POSVSYNC	7
#define MDF_POSVSYNC	0x00000080	/* 1 = VSync wird positiv                        (v4) */

#define ATNT_MODE_8	0	/*  8 bit with color lookup */
#define ATNT_MODE_15	1	/* 15 bit true color with color lookup  (not supported) */
#define ATNT_MODE_24	2	/* 24 bit true color with color lookup */
#define ATNT_MODE_16	3	/* 16 bit true color with color lookup */
#define ATNT_MODE_res	4	/* not available */
#define ATNT_MODE_15b	5	/* same as 1, but lookup table bypassed (currently unused) */
#define ATNT_MODE_16b	6	/* same as 3, but lookup table bypassed (currently unused) */
#define ATNT_MODE_24b	7	/* same as 2, but lookup table bypassed (currently unused) */

struct __NewRetinaMonitor {
	LONG	nrm_MonitorID;	/* a unique ID to describe this monitor */
/*  0 is NOT a valid ID */
/* -1 forces Retina_Addmonitor() to */
/*    generate a unique ID */
	LONG	nrm_PixelClock;	/* the desired pixelclock, must be one */
/* out of: */
/* 25175000,28322000,36000000,44900000 */
/* 50000000,56644000,63000000,65000000 */
/* 72000000,75000000,80000000,90000000 */
	BYTE	nrm_AtntMode;	/* see definitions above */
	BYTE	nrm_Flags;	/* see definitions above */

 /* LABEL _nrm_NewGroupIDs */	/* PRIVATE (v5) */

	WORD	nrm_StdWidth;	/* standard width of the monitor */
	WORD	nrm_StdHeight;	/* standard height of the monitor */
	WORD	nrm_MaxWidth;	/* maximum (overscen) width of the monitor */
	WORD	nrm_MaxHeight;	/* maximum (overscen) height of the monitor */

 /* LABEL _nrm_GroupIDs */	/* a ULONG *, pointing to a NULL terminated */
/*   array of monitor IDs. (v2) */
	WORD	nrm_HBStart;
	WORD	nrm_HSStart;
	WORD	nrm_HSEnd;
	WORD	nrm_HBEnd;
	WORD	nrm_HTotal;

	WORD	nrm_VBStart;
	WORD	nrm_VSStart;
	WORD	nrm_VSEnd;
	WORD	nrm_VBEnd;
	WORD	nrm_VTotal;

};

/*  Do NOT refer to _nrm_SIZEOF, this structure may grow in the future! */
/* --------------------------------------------------------------------------- */
struct __RetinaMonitor {
	struct	List _rm_Node;

	LONG	rm_MonitorID;

	LONG	rm_HFrequency;
	LONG	rm_VFrequency;

	WORD	rm_BytesPerPixel;

	WORD	rm_StdWidth;
	WORD	rm_StdHeight;
	WORD	rm_MaxWidth;
	WORD	rm_MaxHeight;

	BYTE	rm_PrivateFlags;	/* PRIVATE, do not use! */
	BYTE	rm_Reserved1;	/* PRIVATE, do not use! */
	BYTE	rm_AtntMode;	/* a copy of _nrm_AtntMode */
	BYTE	rm_Flags;	/* a copy of _nrm_Flags */

	APTR	rm_GroupIDs;	/* points to a null terminated array of IDs */
/* if this is a group, otherwise NULL (v5) */
	LONG	rm_PixelClock;	/* (v5) */

};
/* --------------------------------------------------------------------------- */
/* definitions for _dsi_Flags */
#define DSIB_USEWIDTH	0
#define DSIF_USEWIDTH	0x00000001	/* If set, use the value in _dsi_Width. If not set, */
/*   pass the original value to Retina_OpenScreen(). */
#define DSIB_USEHEIGHT	1
#define DSIF_USEHEIGHT	0x00000002	/* If set, use the value in _dsi_Height. If not set, */
/*   pass the original value to Retina_OpenScreen(). */

struct _DefaultScreenInfo {
	LONG	dsi_ID;	/* the current ScreenMode-ID */
	WORD	dsi_Width;	/* the current width */
/* (only valid if DSIB_USEWIDTH is set) */
	WORD	dsi_Height;	/* the current height */
/* (only valid if DSIB_USEHEIGHT is set) */
	BYTE	dsi_Flags;	/* flag definitions see above */
	UBYTE	_dsi_Reserved[7];	/* reserved, do not use */
};
/* --------------------------------------------------------------------------- */
/*  special values vor Retina_OpenScreen() Width and Height */

#define RSCR_MINWIDTH	13	/* minimum width of a Retina screen */
#define RSCR_MINHEIGHT	1	/* minimum height of a Retina screen */

#define RSCR_STDWIDTH	-1	/* open the screen at its standard width */
#define RSCR_STDHEIGHT	-1	/* open the screen at its standard height */
#define RSCR_MAXWIDTH	-2	/* open the screen at its maximum width */
#define RSCR_MAXHEIGHT	-2	/* open the screen at its maximum height */

/*  TagItems for Retina_OpenScreen(): */

#define RSA_BitMap	TAG_USER+1	/* use this BitMap */
#define RSA_DBufBitMap	TAG_USER+2	/* not supported yet */
#define RSA_ErrorCode	TAG_USER+3	/* return an error code */
#define RSA_Name	TAG_USER+4	/* the screens name (v3) */
#define RSA_Palette	TAG_USER+5	/* the screens initial palette (v3) */
#define RSA_PaletteRange	TAG_USER+6	/* to select less then 256 colors (v3) */
/* high word of ti_Data: First */
/* low word of ti_Data: Count */
/* see: retina.doc/Retina_LoadPalette() */
#define RSA_FreeID	TAG_USER+7	/* optional ID for 'free screens' (v4) */
#define RSA_TopEdge	TAG_USER+8	/* top edge of the panel screen (v5) */
#define RSA_Parent	TAG_USER+9	/* parent screen used by the panel screen (v5) */
#define RSA_Depth	TAG_USER+10	/* PRIVATE, do not use! */

/*  values for RSA_ErrorCode: */

#define ROSERR_NONE	0	/*  everything ok if Retina_OpenScreen() returned NON-NULL */
/*    or unknown error if it returned NULL */
#define ROSERR_ID	1	/*  unknown monitor-ID */
#define ROSERR_DEFAULTID	2	/*  unknown default monitor-ID */
#define ROSERR_TOOBIG	3	/*  screen size is too big */
#define ROSERR_NOMEM	4	/*  couldn't get normal memory */
#define ROSERR_NORETINAMEM	5	/*  couldn't get Retina graphics memory */
#define ROSERR_TOOSMALL	6	/*  screen size is too small (< 13*1) (v5) */
#define ROSERR_CLOCK	7	/*  pixelclock is too high (v5) */

/*  Flags for _rs_Flags: */

#define RSFB_DONTCLEARONOPEN	0
#define RSFF_DONTCLEARONOPEN	0x00000001	/* don't clear the screens memory when opened */
#define RSFB_DONTCLEARONCLOSE	1
#define RSFF_DONTCLEARONCLOSE	0x00000002	/* don't turn off display after closing screen */
#define RSFB_DOUBLEBUFFER	2
#define RSFF_DOUBLEBUFFER	0x00000004	/* prepare screen for double buffering */
#define RSFB_CUSTOMBITMAP	3
#define RSFF_CUSTOMBITMAP	0x00000008	/* PRIVATE, do not use */
#define RSFB_CUSTOMDBUFBITMAP	4
#define RSFF_CUSTOMDBUFBITMAP	0x00000010	/* PRIVATE, do not use */
#define RSFB_AUTOADJUST	5
#define RSFF_AUTOADJUST	0x00000020	/* adjust the screens size if too big, ... */
#define RSFB_OPENBEHIND	6
#define RSFF_OPENBEHIND	0x00000040	/* open the screen behind all others */
#define RSFB_DBUFPALETTE	7
#define RSFF_DBUFPALETTE	0x00000080	/* use special palette handling (v3) */
#define RSFB_OVERSIZED	8
#define RSFF_OVERSIZED	0x00000100	/* PRIVATE, do not use (v3) */
#define RSFB_SYSTEM	9
#define RSFF_SYSTEM	0x00000200	/* PRIVATE, do not use (v3) */
#define RSFB_DONTCLOSEONCLOSE	10
#define RSFF_DONTCLOSEONCLOSE	0x00000400	/* don't close the screen on CloseScreen() (v4) */
#define RSFB_FREE	11
#define RSFF_FREE	0x00000800	/* PRIVATE, do not use (v4) */
#define RSFB_ZEROBITMAP	12
#define RSFF_ZEROBITMAP	0x00001000	/* PRIVATE, do not use (v5) */
#define RSFB_PANEL	13
#define RSFF_PANEL	0x00002000	/* screen is a panel screen (v5) */
#define RSFB_LOCKPANEL	14
#define RSFF_LOCKPANEL	0x00004000	/* panel screen is locked to its parent (v5) */

struct __RetinaScreen {
	struct	List List;	/* ListNode for internal use only */
/* LN_NAME MAY point to the screens name */
/*   it also may be NULL! (v3) */
	WORD	rs_Width;	/* number of pixels in one horizontal line */
	WORD	rs_Height;	/* number of lines */
/* --- */
	APTR	rs_BitMap;	/* the screen's address in Retina memory */
	APTR	rs_DBufBitMap;	/* used for double buffered screens */

	LONG	rs_Flags;	/* flags see above */

 /* LABEL _rs_APen */
	BYTE	rs_APen_reserved;	/* reserved */
	BYTE	rs_APenR;	/* the red component (true color only) */
	BYTE	rs_APenG;	/* the green component (true color only) */
 /* LABEL _rs_APen256 */	/* the number of the palette register */
/*   on a 256 color screen */
	BYTE	rs_APenB;	/*   or the blue component (true color) */
/* --- */
	BYTE	rs_DrawMode;	/* RDM_JAM1, ... */
	BYTE	rs_Reserved;	/* (v3) */
/* --- */
	WORD	rs_BytesPerPixel;	/* number of bytes per pixel (1..3) */
	WORD	rs_Modulo;	/* number of bytes in one line */
	APTR	rs_Monitor;	/* struct RetinaMonitor * */

	APTR	rs_Palette;	/* points to an array of 256 RGB values */
/*   read only! */

	WORD	rs_BitsPerPixel;	/* number of bits per pixel (4,8,16,24) (v3) */

	WORD	rs_LeftEdge;	/* currently always 0 (v3) */
	WORD	rs_TopEdge;	/* currently always 0 (v3) >0 (v5) */

	WORD	rs_VisibleWidth;	/* currently same as _rs_Width (v3) */
	WORD	rs_VisibleHeight;	/* currently same as _rs_Height (v3) */

};
/* --------------------------------------------------------------------------- */
/*  These are the currently available Mode-ID's you need for OpenScreen() */
/*  or GetDefaultMonitorID() */

#define MID_DEFAULT_08	-1	/* ask for the default 8 bit screen */
#define MID_DEFAULT_16	-2	/* ask for the default 16 bit screen */
#define MID_DEFAULT_24	-3	/* ask for the default 24 bit screen */

#define MID_UNKNOWN	0
/* --------------------------------------------------------------------------- */
/*  the public-part of retina.library */

struct _xy_RetinaBase {
	struct	Library Library;
	APTR	rb_FirstScreen;	/* A pointer to the first screen. This */
/* is the visible screen. If no screen */
/* is open, _rb_FirstScreen is NULL. */
	ULONG	rb_FrameCount;	/* This is incremented each Retina */
/* vertical blank interrupt. You may use */
/* it to check wether your animation got */
/* every frame, but NEVER use it at a */
/* clock! */
	APTR	rb_HardInfo;	/* NULL, if there is no Retina hardware */
/* Non-NULL if there is a hardware. (v2) */
/* Starting with (v5) _rb_HardInfo is a  */
/* pointer to struct HardInfo (PRIVATE)  */
/* or NULL. */
/* Do NOT use _rb_HardInfo as a pointer */
/* in earlier versions! */
	APTR	rb_BoardAddress;	/* the address of the Retina board (v3) */
	APTR	rb_SegmentAddress;	/* the address of the Retina memory */
/* window (v3) */
	UBYTE	_rb_private1[12];	/* PRIVATE, do not use */

	struct	List _rb_ScreenList;	/* all open Retina screens (v3) */

	APTR	rb_SpriteMem;	/* PRIVATE, do not use */
	struct	List _rb_MemList;	/* PRIVATE, do not use */

};

/*  subsequent fields in the library base are RETINA PRIVATE */
/* --------------------------------------------------------------------------- */
struct __MemNode {
	struct	MinList MinList;	/* PRIVATE, do not use */
	APTR	mn_Memory;	/* PRIVATE, do not use */
	LONG	mn_Size;	/* PRIVATE, do not use */
};
/* --------------------------------------------------------------------------- */
/*  You may use this macro to call the functions in retina.library. To avoid */
/*  conflicts with existing functions, they have a slightly unusual name. */

/* --------------------------------------------------------------------------- */
