#ifdef MEDIA426_A20ED_A20E_A20F_A20G_A21E_A22E_A22G_A36M_A31E_A31M_A33M_A35E_A35M_AU1E_AU2E_AU2F_AU2G_AU3E
/* ******************** types.h ******************** */
#define GLOBAL extern
#define IMPORT extern
#define STATIC static
#define REGISTER register
#define VOID void
typedef long LONG;
typedef unsigned long ULONG;
typedef unsigned long LONGBITS;
typedef short WORD;
typedef unsigned short UWORD;
typedef unsigned short WORDBITS;
typedef char BYTE;
typedef unsigned char UBYTE;
typedef unsigned char BYTEBITS;
typedef unsigned char *STRPTR;
typedef STRPTR *APTR;
typedef ULONG CPTR;
typedef short SHORT;
typedef unsigned short USHORT;
typedef float FLOAT;
typedef double DOUBLE;
typedef short COUNT;
typedef unsigned short UCOUNT;
typedef short BOOL;
typedef unsigned char TEXT;
#define TRUE 1L
#define FALSE 0L
#define NULL 0L
#define BYTEMASK 0xFFL
#define LIBRARY_VERSION 33L

/* ******************** custom.h ******************** */
struct Custom {
UWORD bltddat;
UWORD dmaconr;
UWORD vposr;
UWORD vhposr;
UWORD dskdatr;
UWORD joy0dat;
UWORD joy1dat;
UWORD clxdat;
UWORD adkconr;
UWORD pot0dat;
UWORD pot1dat;
UWORD potinp;
UWORD serdatr;
UWORD dskbytr;
UWORD intenar;
UWORD intreqr;
APTR dskpt;
UWORD dsklen;
UWORD dskdat;
UWORD refptr;
UWORD vposw;
UWORD vhposw;
UWORD copcon;
UWORD serdat;
UWORD serper;
UWORD potgo;
UWORD joytest;
UWORD strequ;
UWORD strvbl;
UWORD strhor;
UWORD strlong;
UWORD bltcon0;
UWORD bltcon1;
UWORD bltafwm;
UWORD bltalwm;
APTR bltcpt;
APTR bltbpt;
APTR bltapt;
APTR bltdpt;
UWORD bltsize;
UWORD pad2d[3];
UWORD bltcmod;
UWORD bltbmod;
UWORD bltamod;
UWORD bltdmod;
UWORD pad34[4];
UWORD bltcdat;
UWORD bltbdat;
UWORD bltadat;
UWORD pad3b[4];
UWORD dsksync;
ULONG cop1lc;
ULONG cop2lc;
UWORD copjmp1;
UWORD copjmp2;
UWORD copins;
UWORD diwstrt;
UWORD diwstop;
UWORD ddfstrt;
UWORD ddfstop;
UWORD dmacon;
UWORD clxcon;
UWORD intena;
UWORD intreq;
UWORD adkcon;
struct AudChannel {
UWORD *ac_ptr;
UWORD ac_len;
UWORD ac_per;
UWORD ac_vol;
UWORD ac_dat;
UWORD ac_pad[2];
} aud[4];
APTR bplpt[6];
UWORD pad7c[4];
UWORD bplcon0;
UWORD bplcon1;
UWORD bplcon2;
UWORD pad83;
UWORD bpl1mod;
UWORD bpl2mod;
UWORD pad86[2];
UWORD bpldat[6];
UWORD pad8e[2];
APTR sprpt[8];
struct SpriteDef {
UWORD pos;
UWORD ctl;
UWORD dataa;
UWORD datab;
} spr[8];
UWORD color[32];
};
#define custom (*((struct Custom *)0xdff000))

/* ******************** cia.h ******************** */
struct CIA {
UBYTE ciapra;
UBYTE pad0[0xff];
UBYTE ciaprb;
UBYTE pad1[0xff];
UBYTE ciaddra;
UBYTE pad2[0xff];
UBYTE ciaddrb;
UBYTE pad3[0xff];
UBYTE ciatalo;
UBYTE pad4[0xff];
UBYTE ciatahi;
UBYTE pad5[0xff];
UBYTE ciatblo;
UBYTE pad6[0xff];
UBYTE ciatbhi;
UBYTE pad7[0xff];
UBYTE ciatodlow;
UBYTE pad8[0xff];
UBYTE ciatodmid;
UBYTE pad9[0xff];
UBYTE ciatodhi;
UBYTE pad10[0xff];
UBYTE unusedreg;
UBYTE pad11[0xff];
UBYTE ciasdr;
UBYTE pad12[0xff];
UBYTE ciaicr;
UBYTE pad13[0xff];
UBYTE ciacra;
UBYTE pad14[0xff];
UBYTE ciacrb;
};
#define CIAICRB_TA 0L
#define CIAICRB_TB 1L
#define CIAICRB_ALRM 2L
#define CIAICRB_SP 3L
#define CIAICRB_FLG 4L
#define CIAICRB_IR 7L
#define CIAICRB_SETCLR 7L
#define CIACRAB_START 0L
#define CIACRAB_PBON 1L
#define CIACRAB_OUTMODE 2L
#define CIACRAB_RUNMODE 3L
#define CIACRAB_LOAD 4L
#define CIACRAB_INMODE 5L
#define CIACRAB_SPMODE 6L
#define CIACRAB_TODIN 7L
#define CIACRBB_START 0L
#define CIACRBB_PBON 1L
#define CIACRBB_OUTMODE 2L
#define CIACRBB_RUNMODE 3L
#define CIACRBB_LOAD 4L
#define CIACRBB_INMODE0 5L
#define CIACRBB_INMODE1 6L
#define CIACRBB_ALARM 7L
#define CIAICRF_TA (1L<<CIAICRB_TA)
#define CIAICRF_TB (1L<<CIAICRB_TB)
#define CIAICRF_ALRM (1L<<CIAICRB_ALRM)
#define CIAICRF_SP (1L<<CIAICRB_SP)
#define CIAICRF_FLG (1L<<CIAICRB_FLG)
#define CIAICRF_IR (1L<<CIAICRB_IR)
#define CIAICRF_SETCLR (1L<<CIAICRB_SETCLR)
#define CIACRAF_START (1L<<CIACRAB_START)
#define CIACRAF_PBON (1L<<CIACRAB_PBON)
#define CIACRAF_OUTMODE (1L<<CIACRAB_OUTMODE)
#define CIACRAF_RUNMODE (1L<<CIACRAB_RUNMODE)
#define CIACRAF_LOAD (1L<<CIACRAB_LOAD)
#define CIACRAF_INMODE (1L<<CIACRAB_INMODE)
#define CIACRAF_SPMODE (1L<<CIACRAB_SPMODE)
#define CIACRAF_TODIN (1L<<CIACRAB_TODIN)
#define CIACRBF_START (1L<<CIACRBB_START)
#define CIACRBF_PBON (1L<<CIACRBB_PBON)
#define CIACRBF_OUTMODE (1L<<CIACRBB_OUTMODE)
#define CIACRBF_RUNMODE (1L<<CIACRBB_RUNMODE)
#define CIACRBF_LOAD (1L<<CIACRBB_LOAD)
#define CIACRBF_INMODE0 (1L<<CIACRBB_INMODE0)
#define CIACRBF_INMODE1 (1L<<CIACRBB_INMODE1)
#define CIACRBF_ALARM (1L<<CIACRBB_ALARM)
#define CIACRBF_IN_PHI2 0L
#define CIACRBF_IN_CNT (CIACRBF_INMODE0)
#define CIACRBF_IN_TA (CIACRBF_INMODE1)
#define CIACRBF_IN_CNT_TA (CIACRBF_INMODE0|CIACRBF_INMODE1)
#define CIAB_GAMEPORT1 (7L)
#define CIAB_GAMEPORT0 (6L)
#define CIAB_DSKRDY (5L)
#define CIAB_DSKTRACK0 (4L)
#define CIAB_DSKPROT (3L)
#define CIAB_DSKCHANGE (2L)
#define CIAB_LED (1L)
#define CIAB_OVERLAY (0L)
#define CIAB_COMDTR (7L)
#define CIAB_COMRTS (6L)
#define CIAB_COMCD (5L)
#define CIAB_COMCTS (4L)
#define CIAB_COMDSR (3L)
#define CIAB_PRTRSEL (2L)
#define CIAB_PRTRPOUT (1L)
#define CIAB_PRTRBUSY (0L)
#define CIAB_DSKMOTOR (7L)
#define CIAB_DSKSEL3 (6L)
#define CIAB_DSKSEL2 (5L)
#define CIAB_DSKSEL1 (4L)
#define CIAB_DSKSEL0 (3L)
#define CIAB_DSKSIDE (2L)
#define CIAB_DSKDIREC (1L)
#define CIAB_DSKSTEP (0L)
#define CIAF_GAMEPORT1 (1L<<7)
#define CIAF_GAMEPORT0 (1L<<6)
#define CIAF_DSKRDY (1L<<5)
#define CIAF_DSKTRACK0 (1L<<4)
#define CIAF_DSKPROT (1L<<3)
#define CIAF_DSKCHANGE (1L<<2)
#define CIAF_LED (1L<<1)
#define CIAF_OVERLAY (1L<<0)
#define CIAF_COMDTR (1L<<7)
#define CIAF_COMRTS (1L<<6)
#define CIAF_COMCD (1L<<5)
#define CIAF_COMCTS (1L<<4)
#define CIAF_COMDSR (1L<<3)
#define CIAF_PRTRSEL (1L<<2)
#define CIAF_PRTRPOUT (1L<<1)
#define CIAF_PRTRBUSY (1L<<0)
#define CIAF_DSKMOTOR (1L<<7)
#define CIAF_DSKSEL3 (1L<<6)
#define CIAF_DSKSEL2 (1L<<5)
#define CIAF_DSKSEL1 (1L<<4)
#define CIAF_DSKSEL0 (1L<<3)
#define CIAF_DSKSIDE (1L<<2)
#define CIAF_DSKDIREC (1L<<1)
#define CIAF_DSKSTEP (1L<<0)
#define ciaa (*((struct CIA *)0xbfe001))
#define ciab (*((struct CIA *)0xbfd000))

/* ******************** copper.h ******************** */
#define COPPER_MOVE 0L
#define COPPER_WAIT 1L
#define CPRNXTBUF 2L
#define CPR_NT_LOF 0x8000L
#define CPR_NT_SHT 0x4000L
struct CopIns
{
short OpCode;
union
{
struct CopList *nxtlist;
struct
{
union
{
SHORT VWaitPos;
SHORT DestAddr;
} u1;
union
{
SHORT HWaitPos;
SHORT DestData;
} u2;
} u4;
} u3;
};
#define NXTLIST u3.nxtlist
#define VWAITPOS u3.u4.u1.VWaitPos
#define DESTADDR u3.u4.u1.DestAddr
#define HWAITPOS u3.u4.u2.HWaitPos
#define DESTDATA u3.u4.u2.DestData
struct cprlist
{
struct cprlist *Next;
UWORD *start;
SHORT MaxCount;
};
struct CopList
{
struct CopList *Next;
struct CopList *_CopList;
struct ViewPort *_ViewPort;
struct CopIns *CopIns;
struct CopIns *CopPtr;
UWORD *CopLStart;
UWORD *CopSStart;
SHORT Count;
SHORT MaxCount;
SHORT DyOffset;
};
struct UCopList
{
struct UCopList *Next;
struct CopList *FirstCopList;
struct CopList *CopList;
};
struct copinit
{
UWORD diagstrt[4];
UWORD sprstrtup[(2*8*2)+2+(2*2)+2];
UWORD sprstop[2];
};

/* ******************** gfx.h ******************** */
#define BITSET 0x8000L
#define BITCLR 0L
struct Rectangle
{
SHORT MinX,MinY;
SHORT MaxX,MaxY;
};
typedef UBYTE *PLANEPTR;
struct BitMap
{
UWORD BytesPerRow;
UWORD Rows;
UBYTE Flags;
UBYTE Depth;
UWORD pad;
PLANEPTR Planes[8];
};
#define RASSIZE(w,h) ((h)*( (w+15)>>3&0xFFFE))

/* ******************** nodes.h ******************** */
struct Node {
struct Node *ln_Succ;
struct Node *ln_Pred;
UBYTE ln_Type;
BYTE ln_Pri;
char *ln_Name;
};
struct MinNode {
struct MinNode *mln_Succ;
struct MinNode *mln_Pred;
};
#define NT_UNKNOWN 0L
#define NT_TASK 1L
#define NT_INTERRUPT 2L
#define NT_DEVICE 3L
#define NT_MSGPORT 4L
#define NT_MESSAGE 5L
#define NT_FREEMSG 6L
#define NT_REPLYMSG 7L
#define NT_RESOURCE 8L
#define NT_LIBRARY 9L
#define NT_MEMORY 10L
#define NT_SOFTINT 11L
#define NT_FONT 12L
#define NT_PROCESS 13L
#define NT_SEMAPHORE 14L
#define NT_SIGNALSEM 15L
#define NT_BOOTNODE 16L

/* ******************** gameport.h ******************** */
#define GPD_READEVENT (CMD_NONSTD+0)
#define GPD_ASKCTYPE (CMD_NONSTD+1)
#define GPD_SETCTYPE (CMD_NONSTD+2)
#define GPD_ASKTRIGGER (CMD_NONSTD+3)
#define GPD_SETTRIGGER (CMD_NONSTD+4)
#define GPTB_DOWNKEYS 0L
#define GPTF_DOWNKEYS (1L<<0)
#define GPTB_UPKEYS 1L
#define GPTF_UPKEYS (1L<<1)
struct GamePortTrigger {
UWORD gpt_Keys;
UWORD gpt_Timeout;
UWORD gpt_XDelta;
UWORD gpt_YDelta;
};
#define GPCT_ALLOCATED -1L
#define GPCT_NOCONTROLLER 0L
#define GPCT_MOUSE 1L
#define GPCT_RELJOYSTICK 2L
#define GPCT_ABSJOYSTICK 3L
#define GPDERR_SETCTYPE 1L

/* ******************** dos.h ******************** */
#define DOSNAME "dos.library"
#define DOSTRUE (-1L)
#define DOSFALSE (0L)
#define MODE_OLDFILE 1005L
#define MODE_NEWFILE 1006L
#define OFFSET_BEGINNING -1L
#define OFFSET_CURRENT 0L
#define OFFSET_END 1L
#define OFFSET_BEGINING OFFSET_BEGINNING
#define BITSPERBYTE 8L
#define BYTESPERLONG 4L
#define BITSPERLONG 32L
#define MAXINT 0x7FFFFFFFL
#define MININT 0x80000000L
#define SHARED_LOCK -2L
#define ACCESS_READ -2L
#define EXCLUSIVE_LOCK -1L
#define ACCESS_WRITE -1L
struct DateStamp {
LONG ds_Days;
LONG ds_Minute;
LONG ds_Tick;
};
#define TICKS_PER_SECOND 50L
struct FileInfoBlock {
LONG fib_DiskKey;
LONG fib_DirEntryType;
char fib_FileName[108];
LONG fib_Protection;
LONG fib_EntryType;
LONG fib_Size;
LONG fib_NumBlocks;
struct DateStamp fib_Date;
char fib_Comment[80];
char padding[36];
};
#define FIBB_ARCHIVE 4L
#define FIBB_READ 3L
#define FIBB_WRITE 2L
#define FIBB_EXECUTE 1L
#define FIBB_DELETE 0L
#define FIBF_ARCHIVE (1L<<FIBB_ARCHIVE)
#define FIBF_READ (1L<<FIBB_READ)
#define FIBF_WRITE (1L<<FIBB_WRITE)
#define FIBF_EXECUTE (1L<<FIBB_EXECUTE)
#define FIBF_DELETE (1L<<FIBB_DELETE)
typedef long BPTR;
typedef long BSTR;
#define BADDR( bptr ) (((ULONG)bptr) << 2)
struct InfoData {
LONG id_NumSoftErrors;
LONG id_UnitNumber;
LONG id_DiskState;
LONG id_NumBlocks;
LONG id_NumBlocksUsed;
LONG id_BytesPerBlock;
LONG id_DiskType;
BPTR id_VolumeNode;
LONG id_InUse;
};
#define ID_WRITE_PROTECTED 80L
#define ID_VALIDATING 81L
#define ID_VALIDATED 82L
#define ID_NO_DISK_PRESENT (-1L)
#define ID_UNREADABLE_DISK ('BAD\0')
#define ID_DOS_DISK ('DOS\0')
#define ID_NOT_REALLY_DOS ('NDOS')
#define ID_KICKSTART_DISK ('KICK')
#define ERROR_NO_FREE_STORE 103L
#define ERROR_TASK_TABLE_FULL 105L
#define ERROR_LINE_TOO_LONG 120L
#define ERROR_FILE_NOT_OBJECT 121L
#define ERROR_INVALID_RESIDENT_LIBRARY 122L
#define ERROR_NO_DEFAULT_DIR 201L
#define ERROR_OBJECT_IN_USE 202L
#define ERROR_OBJECT_EXISTS 203L
#define ERROR_DIR_NOT_FOUND 204L
#define ERROR_OBJECT_NOT_FOUND 205L
#define ERROR_BAD_STREAM_NAME 206L
#define ERROR_OBJECT_TOO_LARGE 207L
#define ERROR_ACTION_NOT_KNOWN 209L
#define ERROR_INVALID_COMPONENT_NAME 210L
#define ERROR_INVALID_LOCK 211L
#define ERROR_OBJECT_WRONG_TYPE 212L
#define ERROR_DISK_NOT_VALIDATED 213L
#define ERROR_DISK_WRITE_PROTECTED 214L
#define ERROR_RENAME_ACROSS_DEVICES 215L
#define ERROR_DIRECTORY_NOT_EMPTY 216L
#define ERROR_TOO_MANY_LEVELS 217L
#define ERROR_DEVICE_NOT_MOUNTED 218L
#define ERROR_SEEK_ERROR 219L
#define ERROR_COMMENT_TOO_BIG 220L
#define ERROR_DISK_FULL 221L
#define ERROR_DELETE_PROTECTED 222L
#define ERROR_WRITE_PROTECTED 223L
#define ERROR_READ_PROTECTED 224L
#define ERROR_NOT_A_DOS_DISK 225L
#define ERROR_NO_DISK 226L
#define ERROR_NO_MORE_ENTRIES 232L
#define RETURN_OK 0L
#define RETURN_WARN 5L
#define RETURN_ERROR 10L
#define RETURN_FAIL 20L
#define SIGBREAKB_CTRL_C 12L
#define SIGBREAKB_CTRL_D 13L
#define SIGBREAKB_CTRL_E 14L
#define SIGBREAKB_CTRL_F 15L
#define SIGBREAKF_CTRL_C (1L<<SIGBREAKB_CTRL_C)
#define SIGBREAKF_CTRL_D (1L<<SIGBREAKB_CTRL_D)
#define SIGBREAKF_CTRL_E (1L<<SIGBREAKB_CTRL_E)
#define SIGBREAKF_CTRL_F (1L<<SIGBREAKB_CTRL_F)

/* ******************** sprite.h ******************** */
#define SPRITE_ATTACHED 0x80L
struct SimpleSprite
{
UWORD *posctldata;
UWORD height;
UWORD x,y;
UWORD num;
};

/* ******************** libraries.h ******************** */
#define LIB_VECTSIZE 6L
#define LIB_RESERVED 4L
#define LIB_BASE (-LIB_VECTSIZE)
#define LIB_USERDEF (LIB_BASE-(LIB_RESERVED*LIB_VECTSIZE))
#define LIB_NONSTD (LIB_USERDEF)
#define LIB_OPEN (-6L)
#define LIB_CLOSE (-12L)
#define LIB_EXPUNGE (-18L)
#define LIB_EXTFUNC (-24L)
extern struct Library {
struct Node lib_Node;
UBYTE lib_Flags;
UBYTE lib_pad;
UWORD lib_NegSize;
UWORD lib_PosSize;
UWORD lib_Version;
UWORD lib_Revision;
APTR lib_IdString;
ULONG lib_Sum;
UWORD lib_OpenCnt;
};
#define LIBF_SUMMING (1L<<0)
#define LIBF_CHANGED (1L<<1)
#define LIBF_SUMUSED (1L<<2)
#define LIBF_DELEXP (1L<<3)
#define lh_Node lib_Node
#define lh_Flags lib_Flags
#define lh_pad lib_pad
#define lh_NegSize lib_NegSize
#define lh_PosSize lib_PosSize
#define lh_Version lib_Version
#define lh_Revision lib_Revision
#define lh_IdString lib_IdString
#define lh_Sum lib_Sum
#define lh_OpenCnt lib_OpenCnt

/* ******************** lists.h ******************** */
struct List {
struct Node *lh_Head;
struct Node *lh_Tail;
struct Node *lh_TailPred;
UBYTE lh_Type;
UBYTE l_pad;
};
struct MinList {
struct MinNode *mlh_Head;
struct MinNode *mlh_Tail;
struct MinNode *mlh_TailPred;
};

/* ******************** interrupts.h ******************** */
struct Interrupt {
struct Node is_Node;
APTR is_Data;
VOID (*is_Code)();
};
struct IntVector {
APTR iv_Data;
VOID (*iv_Code)();
struct Node *iv_Node;
};
struct SoftIntList {
struct List sh_List;
UWORD sh_Pad;
};
#define SIH_PRIMASK (0xf0L)
#define INTB_NMI 15L
#define INTF_NMI (1L<<15)

/* ******************** tasks.h ******************** */
extern struct Task {
struct Node tc_Node;
UBYTE tc_Flags;
UBYTE tc_State;
BYTE tc_IDNestCnt;
BYTE tc_TDNestCnt;
ULONG tc_SigAlloc;
ULONG tc_SigWait;
ULONG tc_SigRecvd;
ULONG tc_SigExcept;
UWORD tc_TrapAlloc;
UWORD tc_TrapAble;
APTR tc_ExceptData;
APTR tc_ExceptCode;
APTR tc_TrapData;
APTR tc_TrapCode;
APTR tc_SPReg;
APTR tc_SPLower;
APTR tc_SPUpper;
VOID (*tc_Switch)();
VOID (*tc_Launch)();
struct List tc_MemEntry;
APTR tc_UserData;
};
#define TB_PROCTIME 0L
#define TB_STACKCHK 4L
#define TB_EXCEPT 5L
#define TB_SWITCH 6L
#define TB_LAUNCH 7L
#define TF_PROCTIME (1L<<0)
#define TF_STACKCHK (1L<<4)
#define TF_EXCEPT (1L<<5)
#define TF_SWITCH (1L<<6)
#define TF_LAUNCH (1L<<7)
#define TS_INVALID 0L
#define TS_ADDED 1L
#define TS_RUN 2L
#define TS_READY 3L
#define TS_WAIT 4L
#define TS_EXCEPT 5L
#define TS_REMOVED 6L
#define SIGB_ABORT 0L
#define SIGB_CHILD 1L
#define SIGB_BLIT 4L
#define SIGB_SINGLE 4L
#define SIGB_DOS 8L
#define SIGF_ABORT (1L<<0)
#define SIGF_CHILD (1L<<1)
#define SIGF_BLIT (1L<<4)
#define SIGF_SINGLE (1L<<4)
#define SIGF_DOS (1L<<8)

/* ******************** ports.h ******************** */
struct MsgPort {
struct Node mp_Node;
UBYTE mp_Flags;
UBYTE mp_SigBit;
struct Task *mp_SigTask;
struct List mp_MsgList;
};
#define mp_SoftInt mp_SigTask
#define PF_ACTION 3L
#define PA_SIGNAL 0L
#define PA_SOFTINT 1L
#define PA_IGNORE 2L
struct Message {
struct Node mn_Node;
struct MsgPort *mn_ReplyPort;
UWORD mn_Length;
};

/* ******************** semaphores.h ******************** */
struct Semaphore {
struct MsgPort sm_MsgPort;
WORD sm_Bids;
};
#define sm_LockMsg mp_SigTask
struct SemaphoreRequest {
struct MinNode sr_Link;
struct Task *sr_Waiter;
};
struct SignalSemaphore {
struct Node ss_Link;
SHORT ss_NestCount;
struct MinList ss_WaitQueue;
struct SemaphoreRequest ss_MultipleLink;
struct Task *ss_Owner;
SHORT ss_QueueCount;
};

/* ******************** io.h ******************** */
struct IORequest {
struct Message io_Message;
struct Device *io_Device;
struct Unit *io_Unit;
UWORD io_Command;
UBYTE io_Flags;
BYTE io_Error;
};
struct IOStdReq {
struct Message io_Message;
struct Device *io_Device;
struct Unit *io_Unit;
UWORD io_Command;
UBYTE io_Flags;
BYTE io_Error;
ULONG io_Actual;
ULONG io_Length;
APTR io_Data;
ULONG io_Offset;
};
#define DEV_BEGINIO (-30L)
#define DEV_ABORTIO (-36L)
#define IOB_QUICK 0L
#define IOF_QUICK (1L<<0)
#define CMD_INVALID 0L
#define CMD_RESET 1L
#define CMD_READ 2L
#define CMD_WRITE 3L
#define CMD_UPDATE 4L
#define CMD_CLEAR 5L
#define CMD_STOP 6L
#define CMD_START 7L
#define CMD_FLUSH 8L
#define CMD_NONSTD 9L

/* ******************** layers.h ******************** */
#define LAYERSIMPLE 1L
#define LAYERSMART 2L
#define LAYERSUPER 4L
#define LAYERUPDATING 0x10L
#define LAYERBACKDROP 0x40L
#define LAYERREFRESH 0x80L
#define LAYER_CLIPRECTS_LOST 0x100L
#define LMN_REGION -1L
struct Layer_Info
{
struct Layer *top_layer;
struct Layer *check_lp;
struct Layer *obs;
struct MinList FreeClipRects;
struct SignalSemaphore Lock;
struct List gs_Head;
LONG longreserved;
UWORD Flags;
BYTE fatten_count;
BYTE LockLayersCount;
UWORD LayerInfo_extra_size;
WORD *blitbuff;
struct LayerInfo_extra *LayerInfo_extra;
};
#define NEWLAYERINFO_CALLED 1L
#define ALERTLAYERSNOMEM 0x83010000L

/* ******************** clip.h ******************** */
#define NEWLOCKS
struct Layer
{
struct Layer *front,*back;
struct ClipRect *ClipRect;
struct RastPort *rp;
struct Rectangle bounds;
UBYTE reserved[4];
UWORD priority;
UWORD Flags;
struct BitMap *SuperBitMap;
struct ClipRect *SuperClipRect;
APTR Window;
SHORT Scroll_X,Scroll_Y;
struct ClipRect *cr,*cr2,*crnew;
struct ClipRect *SuperSaveClipRects;
struct ClipRect *_cliprects;
struct Layer_Info *LayerInfo;
struct SignalSemaphore Lock;
UBYTE reserved3[8];
struct Region *ClipRegion;
struct Region *saveClipRects;
UBYTE reserved2[22];
struct Region *DamageList;
};
struct ClipRect
{
struct ClipRect *Next;
struct ClipRect *prev;
struct Layer *lobs;
struct BitMap *BitMap;
struct Rectangle bounds;
struct ClipRect *_p1,*_p2;
LONG reserved;
};
#define CR_NEEDS_NO_CONCEALED_RASTERS 1L
#define ISLESSX 1L
#define ISLESSY 2L
#define ISGRTRX 4L
#define ISGRTRY 8L

/* ******************** view.h ******************** */
struct ColorMap
{
UBYTE Flags;
UBYTE Type;
UWORD Count;
APTR ColorTable;
};
struct ViewPort
{
struct ViewPort *Next;
struct ColorMap *ColorMap;
struct CopList *DspIns;
struct CopList *SprIns;
struct CopList *ClrIns;
struct UCopList *UCopIns;
SHORT DWidth,DHeight;
SHORT DxOffset,DyOffset;
UWORD Modes;
UBYTE SpritePriorities;
UBYTE reserved;
struct RasInfo *RasInfo;
};
struct View
{
struct ViewPort *ViewPort;
struct cprlist *LOFCprList;
struct cprlist *SHFCprList;
short DyOffset,DxOffset;
UWORD Modes;
};
#define PFBA 0x40L
#define DUALPF 0x400L
#define HIRES 0x8000L
#define LACE 4L
#define HAM 0x800L
#define SPRITES 0x4000L
#define VP_HIDE 0x2000L
#define GENLOCK_AUDIO 0x100L
#define GENLOCK_VIDEO 2L
#define EXTRA_HALFBRITE 0x80L
struct RasInfo
{
struct RasInfo *Next;
struct BitMap *BitMap;
SHORT RxOffset,RyOffset;
};

/* ******************** text.h ******************** */
#define FS_NORMAL 0L
#define FSB_EXTENDED 3L
#define FSF_EXTENDED (1L<<3)
#define FSB_ITALIC 2L
#define FSF_ITALIC (1L<<2)
#define FSB_BOLD 1L
#define FSF_BOLD (1L<<1)
#define FSB_UNDERLINED 0L
#define FSF_UNDERLINED (1L<<0)
#define FPB_ROMFONT 0L
#define FPF_ROMFONT (1L<<0)
#define FPB_DISKFONT 1L
#define FPF_DISKFONT (1L<<1)
#define FPB_REVPATH 2L
#define FPF_REVPATH (1L<<2)
#define FPB_TALLDOT 3L
#define FPF_TALLDOT (1L<<3)
#define FPB_WIDEDOT 4L
#define FPF_WIDEDOT (1L<<4)
#define FPB_PROPORTIONAL 5L
#define FPF_PROPORTIONAL (1L<<5)
#define FPB_DESIGNED 6L
#define FPF_DESIGNED (1L<<6)
#define FPB_REMOVED 7L
#define FPF_REMOVED (1L<<7)
struct TextAttr {
STRPTR ta_Name;
UWORD ta_YSize;
UBYTE ta_Style;
UBYTE ta_Flags;
};
struct TextFont {
struct Message tf_Message;
UWORD tf_YSize;
UBYTE tf_Style;
UBYTE tf_Flags;
UWORD tf_XSize;
UWORD tf_Baseline;
UWORD tf_BoldSmear;
UWORD tf_Accessors;
UBYTE tf_LoChar;
UBYTE tf_HiChar;
APTR tf_CharData;
UWORD tf_Modulo;
APTR tf_CharLoc;
APTR tf_CharSpace;
APTR tf_CharKern;
};

/* ******************** timer.h ******************** */
#define UNIT_MICROHZ 0L
#define UNIT_VBLANK 1L
#define TIMERNAME "timer.device"
struct timeval {
ULONG tv_secs;
ULONG tv_micro;
};
struct timerequest {
struct IORequest tr_node;
struct timeval tr_time;
};
#define TR_ADDREQUEST CMD_NONSTD
#define TR_GETSYSTIME (CMD_NONSTD+1)
#define TR_SETSYSTIME (CMD_NONSTD+2)

/* ******************** preferences.h ******************** */
#define FILENAME_SIZE 30L
#define POINTERSIZE (1+16+1)*2L
#define TOPAZ_EIGHTY 8L
#define TOPAZ_SIXTY 9L
#define PREF_EXTBYTES 0
struct Preferences
{
BYTE FontHeight;
UBYTE PrinterPort;
USHORT BaudRate;
struct timeval KeyRptSpeed;
struct timeval KeyRptDelay;
struct timeval DoubleClick;
USHORT PointerMatrix[POINTERSIZE];
BYTE XOffset;
BYTE YOffset;
USHORT color17;
USHORT color18;
USHORT color19;
USHORT PointerTicks;
USHORT color0;
USHORT color1;
USHORT color2;
USHORT color3;
BYTE ViewXOffset;
BYTE ViewYOffset;
WORD ViewInitX, ViewInitY;
BOOL EnableCLI;
USHORT PrinterType;
UBYTE PrinterFilename[FILENAME_SIZE];
USHORT PrintPitch;
USHORT PrintQuality;
USHORT PrintSpacing;
UWORD PrintLeftMargin;
UWORD PrintRightMargin;
USHORT PrintImage;
USHORT PrintAspect;
USHORT PrintShade;
WORD PrintThreshold;
USHORT PaperSize;
UWORD PaperLength;
USHORT PaperType;
UBYTE SerRWBits;
UBYTE SerStopBuf;
UBYTE SerParShk;
UBYTE LaceWB;
UBYTE WorkName[FILENAME_SIZE];
BYTE sys_reserved1;
BYTE sys_reserved2;
UWORD PrintFlags;
UWORD PrintMaxWidth;
UWORD PrintMaxHeight;
UBYTE PrintDensity;
UBYTE PrintXOffset;
UWORD wb_Width;
UWORD wb_Height;
UBYTE wb_Depth;
UBYTE ext_size;
};
#define RowSizeChange sys_reserved1
#define ColumnSizeChange sys_reserved2
#define LACEWB 0x01L
#define LW_RESERVED1
#define PARALLEL_PRINTER 0x00L
#define SERIAL_PRINTER 0x01L
#define BAUD_110 0x00L
#define BAUD_300 0x01L
#define BAUD_1200 0x02L
#define BAUD_2400 0x03L
#define BAUD_4800 0x04L
#define BAUD_9600 0x05L
#define BAUD_19200 0x06L
#define BAUD_MIDI 0x07L
#define FANFOLD 0x00L
#define SINGLE 0x80L
#define PICA 0x000L
#define ELITE 0x400L
#define FINE 0x800L
#define DRAFT 0x000L
#define LETTER 0x100L
#define SIX_LPI 0x000L
#define EIGHT_LPI 0x200L
#define IMAGE_POSITIVE 0x00L
#define IMAGE_NEGATIVE 0x01L
#define ASPECT_HORIZ 0x00L
#define ASPECT_VERT 0x01L
#define SHADE_BW 0x00L
#define SHADE_GREYSCALE 0x01L
#define SHADE_COLOR 0x02L
#define US_LETTER 0x00L
#define US_LEGAL 0x10L
#define N_TRACTOR 0x20L
#define W_TRACTOR 0x30L
#define CUSTOM 0x40L
#define CUSTOM_NAME 0x00L
#define ALPHA_P_101 0x01L
#define BROTHER_15XL 0x02L
#define CBM_MPS1000 0x03L
#define DIAB_630 0x04L
#define DIAB_ADV_D25 0x05L
#define DIAB_C_150 0x06L
#define EPSON 0x07L
#define EPSON_JX_80 0x08L
#define OKIMATE_20 0x09L
#define QUME_LP_20 0x0AL
#define HP_LASERJET 0x0BL
#define HP_LASERJET_PLUS 0x0CL
#define SBUF_512 0x00L
#define SBUF_1024 0x01L
#define SBUF_2048 0x02L
#define SBUF_4096 0x03L
#define SBUF_8000 0x04L
#define SBUF_16000 0x05L
#define SREAD_BITS 0xF0L
#define SWRITE_BITS 0x0FL
#define SSTOP_BITS 0xF0L
#define SBUFSIZE_BITS 0x0FL
#define SPARITY_BITS 0xF0L
#define SPARITY_NONE 0L
#define SPARITY_EVEN 1L
#define SPARITY_ODD 2L
#define SHSHAKE_XON 0L
#define SHSHAKE_RTS 1L
#define SHSHAKE_NONE 2L
#define CORRECT_RED 0x0001
#define CORRECT_GREEN 0x0002
#define CORRECT_BLUE 0x0004
#define CENTER_IMAGE 0x0008
#define IGNORE_DIMENSIONS 0x0000
#define BOUNDED_DIMENSIONS 0x0010
#define ABSOLUTE_DIMENSIONS 0x0020
#define PIXEL_DIMENSIONS 0x0040
#define MULTIPLY_DIMENSIONS 0x0080
#define INTEGER_SCALING 0x0100
#define ORDERED_DITHERING 0x0000
#define HALFTONE_DITHERING 0x0200
#define FLOYD_DITHERING 0x0400
#define ANTI_ALIAS 0x0800
#define GREY_SCALE2 0x1000
#define CORRECT_RGB_MASK (CORRECT_RED|CORRECT_GREEN|CORRECT_BLUE)
#define DIMENSIONS_MASK (BOUNDED_DIMENSIONS|ABSOLUTE_DIMENSIONS|PIXEL_DIMENSIONS|MULTIPLY_DIMENSIONS)
#define DITHERING_MASK (HALFTONE_DITHERING|FLOYD_DITHERING)

/* ******************** rastport.h ******************** */
struct AreaInfo
{
SHORT *VctrTbl;
SHORT *VctrPtr;
BYTE *FlagTbl;
BYTE *FlagPtr;
SHORT Count;
SHORT MaxCount;
SHORT FirstX,FirstY;
};
struct TmpRas
{
BYTE *RasPtr;
LONG Size;
};
struct GelsInfo
{
BYTE sprRsrvd;
UBYTE Flags;
struct VSprite *gelHead, *gelTail;
WORD *nextLine;
WORD **lastColor;
struct collTable *collHandler;
short leftmost, rightmost, topmost, bottommost;
APTR firstBlissObj,lastBlissObj;
};
struct RastPort
{
struct Layer *Layer;
struct BitMap *BitMap;
USHORT *AreaPtrn;
struct TmpRas *TmpRas;
struct AreaInfo *AreaInfo;
struct GelsInfo *GelsInfo;
UBYTE Mask;
BYTE FgPen;
BYTE BgPen;
BYTE AOlPen;
BYTE DrawMode;
BYTE AreaPtSz;
BYTE linpatcnt;
BYTE dummy;
USHORT Flags;
USHORT LinePtrn;
SHORT cp_x, cp_y;
UBYTE minterms[8];
SHORT PenWidth;
SHORT PenHeight;
struct TextFont *Font;
UBYTE AlgoStyle;
UBYTE TxFlags;
UWORD TxHeight;
UWORD TxWidth;
UWORD TxBaseline;
WORD TxSpacing;
APTR *RP_User;
ULONG longreserved[2];
UWORD wordreserved[7];
UBYTE reserved[8];
};
#define JAM1 0L
#define JAM2 1L
#define COMPLEMENT 2L
#define INVERSVID 4L
#define FRST_DOT 0x01L
#define ONE_DOT 0x02L
#define DBUFFER 0x04L
#define AREAOUTLINE 0x08L
#define NOCROSSFILL 0x20L

/* ******************** inputevent.h ******************** */
#define IECLASS_NULL 0x00L
#define IECLASS_RAWKEY 0x01L
#define IECLASS_RAWMOUSE 0x02L
#define IECLASS_EVENT 0x03L
#define IECLASS_POINTERPOS 0x04L
#define IECLASS_TIMER 0x06L
#define IECLASS_GADGETDOWN 0x07L
#define IECLASS_GADGETUP 0x08L
#define IECLASS_REQUESTER 0x09L
#define IECLASS_MENULIST 0x0AL
#define IECLASS_CLOSEWINDOW 0x0BL
#define IECLASS_SIZEWINDOW 0x0CL
#define IECLASS_REFRESHWINDOW 0x0DL
#define IECLASS_NEWPREFS 0x0EL
#define IECLASS_DISKREMOVED 0x0FL
#define IECLASS_DISKINSERTED 0x10L
#define IECLASS_ACTIVEWINDOW 0x11L
#define IECLASS_INACTIVEWINDOW 0x12L
#define IECLASS_MAX 0x12L
#define IECODE_UP_PREFIX 0x80L
#define IECODE_KEY_CODE_FIRST 0x00L
#define IECODE_KEY_CODE_LAST 0x77L
#define IECODE_COMM_CODE_FIRST 0x78L
#define IECODE_COMM_CODE_LAST 0x7FL
#define IECODE_C0_FIRST 0x00L
#define IECODE_C0_LAST 0x1FL
#define IECODE_ASCII_FIRST 0x20L
#define IECODE_ASCII_LAST 0x7EL
#define IECODE_ASCII_DEL 0x7FL
#define IECODE_C1_FIRST 0x80L
#define IECODE_C1_LAST 0x9FL
#define IECODE_LATIN1_FIRST 0xA0L
#define IECODE_LATIN1_LAST 0xFFL
#define IECODE_LBUTTON 0x68L
#define IECODE_RBUTTON 0x69L
#define IECODE_MBUTTON 0x6AL
#define IECODE_NOBUTTON 0xFFL
#define IECODE_NEWACTIVE 0x01L
#define IECODE_REQSET 0x01L
#define IECODE_REQCLEAR 0x00L
#define IEQUALIFIER_LSHIFT 0x0001L
#define IEQUALIFIER_RSHIFT 0x0002L
#define IEQUALIFIER_CAPSLOCK 0x0004L
#define IEQUALIFIER_CONTROL 0x0008L
#define IEQUALIFIER_LALT 0x0010L
#define IEQUALIFIER_RALT 0x0020L
#define IEQUALIFIER_LCOMMAND 0x0040L
#define IEQUALIFIER_RCOMMAND 0x0080L
#define IEQUALIFIER_NUMERICPAD 0x0100L
#define IEQUALIFIER_REPEAT 0x0200L
#define IEQUALIFIER_INTERRUPT 0x0400L
#define IEQUALIFIER_MULTIBROADCAST 0x0800L
#define IEQUALIFIER_MIDBUTTON 0x1000L
#define IEQUALIFIER_RBUTTON 0x2000L
#define IEQUALIFIER_LEFTBUTTON 0x4000L
#define IEQUALIFIER_RELATIVEMOUSE 0x8000L
#define IEQUALIFIERB_LSHIFT 0L
#define IEQUALIFIERB_RSHIFT 1L
#define IEQUALIFIERB_CAPSLOCK 2L
#define IEQUALIFIERB_CONTROL 3L
#define IEQUALIFIERB_LALT 4L
#define IEQUALIFIERB_RALT 5L
#define IEQUALIFIERB_LCOMMAND 6L
#define IEQUALIFIERB_RCOMMAND 7L
#define IEQUALIFIERB_NUMERICPAD 8L
#define IEQUALIFIERB_REPEAT 9L
#define IEQUALIFIERB_INTERRUPT 10L
#define IEQUALIFIERB_MULTIBROADCAST 11L
#define IEQUALIFIERB_MIDBUTTON 12L
#define IEQUALIFIERB_RBUTTON 13L
#define IEQUALIFIERB_LEFTBUTTON 14L
#define IEQUALIFIERB_RELATIVEMOUSE 15L
struct InputEvent {
struct InputEvent *ie_NextEvent;
UBYTE ie_Class;
UBYTE ie_SubClass;
UWORD ie_Code;
UWORD ie_Qualifier;
union {
struct {
WORD ie_x;
WORD ie_y;
} ie_xy;
APTR ie_addr;
} ie_position;
struct timeval ie_TimeStamp;
};
#define ie_X ie_position.ie_xy.ie_x
#define ie_Y ie_position.ie_xy.ie_y
#define ie_EventAddress ie_position.ie_addr

/* ******************** intuitionbase.h ******************** */
struct IntuitionBase
{
struct Library LibNode;
struct View ViewLord;
struct Window *ActiveWindow;
struct Screen *ActiveScreen;
struct Screen *FirstScreen;
ULONG Flags;
WORD MouseY, MouseX;
ULONG Seconds;
ULONG Micros;
};

/* ******************** gfxbase.h ******************** */
struct GfxBase
{
struct Library LibNode;
struct View *ActiView;
struct copinit *copinit;
long *cia;
long *blitter;
UWORD *LOFlist;
UWORD *SHFlist;
struct bltnode *blthd,*blttl;
struct bltnode *bsblthd,*bsblttl;
struct Interrupt vbsrv,timsrv,bltsrv;
struct List TextFonts;
struct TextFont *DefaultFont;
UWORD Modes;
BYTE VBlank;
BYTE Debug;
SHORT BeamSync;
SHORT system_bplcon0;
UBYTE SpriteReserved;
UBYTE bytereserved;
USHORT Flags;
SHORT BlitLock;
short BlitNest;
struct List BlitWaitQ;
struct Task *BlitOwner;
struct List TOF_WaitQ;
UWORD DisplayFlags;
struct SimpleSprite **SimpleSprites;
UWORD MaxDisplayRow;
UWORD MaxDisplayColumn;
UWORD NormalDisplayRows;
UWORD NormalDisplayColumns;
UWORD NormalDPMX;
UWORD NormalDPMY;
struct SignalSemaphore *LastChanceMemory;
UWORD *LCMptr;
UWORD MicrosPerLine;
UWORD MinDisplayColumn;
ULONG reserved[2];
ULONG hedley[4];
ULONG hedley2[4];
SHORT hedley_count;
USHORT hedley_flags;
SHORT hedley_count1;
SHORT hedley_tmp;
ULONG hedley3[3];
ULONG hedley_sprites[4];
ULONG hedley_sprites1[4];
};
#define NTSC 1L
#define GENLOC 2L
#define PAL 4L
#define BLITMSG_FAULT 4L

/* ******************** input.h ******************** */
#define IND_ADDHANDLER (CMD_NONSTD+0)
#define IND_REMHANDLER (CMD_NONSTD+1)
#define IND_WRITEEVENT (CMD_NONSTD+2)
#define IND_SETTHRESH (CMD_NONSTD+3)
#define IND_SETPERIOD (CMD_NONSTD+4)
#define IND_SETMPORT (CMD_NONSTD+5)
#define IND_SETMTYPE (CMD_NONSTD+6)
#define IND_SETMTRIG (CMD_NONSTD+7)

/* ******************** audio.h ******************** */
#define AUDIONAME "audio.device"
#define ADHARD_CHANNELS 4L
#define ADALLOC_MINPREC -128L
#define ADALLOC_MAXPREC 127L
#define ADCMD_FREE (CMD_NONSTD+0)
#define ADCMD_SETPREC (CMD_NONSTD+1)
#define ADCMD_FINISH (CMD_NONSTD+2)
#define ADCMD_PERVOL (CMD_NONSTD+3)
#define ADCMD_LOCK (CMD_NONSTD+4)
#define ADCMD_WAITCYCLE (CMD_NONSTD+5)
#define ADCMDB_NOUNIT 5L
#define ADCMDF_NOUNIT (1L<<5)
#define ADCMD_ALLOCATE (ADCMDF_NOUNIT+0)
#define ADIOB_PERVOL 4L
#define ADIOF_PERVOL (1L<<4)
#define ADIOB_SYNCCYCLE 5L
#define ADIOF_SYNCCYCLE (1L<<5)
#define ADIOB_NOWAIT 6L
#define ADIOF_NOWAIT (1L<<6)
#define ADIOB_WRITEMESSAGE 7L
#define ADIOF_WRITEMESSAGE (1L<<7)
#define ADIOERR_NOALLOCATION -10L
#define ADIOERR_ALLOCFAILED -11L
#define ADIOERR_CHANNELSTOLEN -12L
struct IOAudio {
struct IORequest ioa_Request;
WORD ioa_AllocKey;
UBYTE *ioa_Data;
ULONG ioa_Length;
UWORD ioa_Period;
UWORD ioa_Volume;
UWORD ioa_Cycles;
struct Message ioa_WriteMsg;
};

/* ******************** disk.h ******************** */
struct DiscResourceUnit {
struct Message dru_Message;
struct Interrupt dru_DiscBlock;
struct Interrupt dru_DiscSync;
struct Interrupt dru_Index;
};
struct DiscResource {
struct Library dr_Library;
struct DiscResourceUnit *dr_Current;
UBYTE dr_Flags;
UBYTE dr_pad;
struct Library *dr_SysLib;
struct Library *dr_CiaResource;
ULONG dr_UnitID[4];
struct List dr_Waiting;
struct Interrupt dr_DiscBlock;
struct Interrupt dr_DiscSync;
struct Interrupt dr_Index;
};
#define DRB_ALLOC0 0L
#define DRB_ALLOC1 1L
#define DRB_ALLOC2 2L
#define DRB_ALLOC3 3L
#define DRB_ACTIVE 7L
#define DRF_ALLOC0 (1L<<0)
#define DRF_ALLOC1 (1L<<1)
#define DRF_ALLOC2 (1L<<2)
#define DRF_ALLOC3 (1L<<3)
#define DRF_ACTIVE (1L<<7)
#define DSKDMAOFF 0x4000L
#define DISKNAME "disk.resource"
#define DR_ALLOCUNIT (LIB_BASE - 0*LIB_VECTSIZE)
#define DR_FREEUNIT (LIB_BASE - 1*LIB_VECTSIZE)
#define DR_GETUNIT (LIB_BASE - 2*LIB_VECTSIZE)
#define DR_GIVEUNIT (LIB_BASE - 3*LIB_VECTSIZE)
#define DR_GETUNITID (LIB_BASE - 4*LIB_VECTSIZE)
#define DR_LASTCOMM (DR_GIVEUNIT)
#define DRT_AMIGA (0x00000000L)
#define DRT_37422D2S (0x55555555L)
#define DRT_EMPTY (0xFFFFFFFFL)

/* ******************** keyboard.h ******************** */
#define KBD_READEVENT (CMD_NONSTD+0)
#define KBD_READMATRIX (CMD_NONSTD+1)
#define KBD_ADDRESETHANDLER (CMD_NONSTD+2)
#define KBD_REMRESETHANDLER (CMD_NONSTD+3)
#define KBD_RESETHANDLERDONE (CMD_NONSTD+4)

/* ******************** memory.h ******************** */
struct MemChunk {
struct MemChunk *mc_Next;
ULONG mc_Bytes;
};
struct MemHeader {
struct Node mh_Node;
UWORD mh_Attributes;
struct MemChunk *mh_First;
APTR mh_Lower;
APTR mh_Upper;
ULONG mh_Free;
};
struct MemEntry {
union {
ULONG meu_Reqs;
APTR meu_Addr;
} me_Un;
ULONG me_Length;
};
#define me_un me_Un
#define me_Reqs me_Un.meu_Reqs
#define me_Addr me_Un.meu_Addr
struct MemList {
struct Node ml_Node;
UWORD ml_NumEntries;
struct MemEntry ml_ME[1];
};
#define ml_me ml_ME
#define MEMF_PUBLIC (1L<<0)
#define MEMF_CHIP (1L<<1)
#define MEMF_FAST (1L<<2)
#define MEMF_CLEAR (1L<<16)
#define MEMF_LARGEST (1L<<17)
#define MEM_BLOCKSIZE 8L
#define MEM_BLOCKMASK 7L

/* ******************** devices.h ******************** */
struct Device {
struct Library dd_Library;
};
struct Unit {
struct MsgPort unit_MsgPort;
UBYTE unit_flags;
UBYTE unit_pad;
UWORD unit_OpenCnt;
};
#define UNITF_ACTIVE (1L<<0)
#define UNITF_INTASK (1L<<1)

/* ******************** blit.h ******************** */
#define HSIZEBITS 6L
#define VSIZEBITS 16-HSIZEBITS
#define HSIZEMASK 0x3fL
#define VSIZEMASK 0x3FFL
#define MAXBYTESPERROW 128L
#define ABC 0x80L
#define ABNC 0x40L
#define ANBC 0x20L
#define ANBNC 0x10L
#define NABC 0x8L
#define NABNC 0x4L
#define NANBC 0x2L
#define NANBNC 0x1L
#define A_OR_B ABC|ANBC|NABC | ABNC|ANBNC|NABNC
#define A_OR_C ABC|NABC|ABNC | ANBC|NANBC|ANBNC
#define A_XOR_C NABC|ABNC | NANBC|ANBNC
#define A_TO_D ABC|ANBC|ABNC|ANBNC
#define BC0B_DEST 8L
#define BC0B_SRCC 9L
#define BC0B_SRCB 10L
#define BC0B_SRCA 11L
#define BC0F_DEST 0x100L
#define BC0F_SRCC 0x200L
#define BC0F_SRCB 0x400L
#define BC0F_SRCA 0x800L
#define BC1F_DESC 2L
#define DEST 0x100L
#define SRCC 0x200L
#define SRCB 0x400L
#define SRCA 0x800L
#define ASHIFTSHIFT 12L
#define BSHIFTSHIFT 12L
#define LINEMODE 0x1L
#define FILL_OR 0x8L
#define FILL_XOR 0x10L
#define FILL_CARRYIN 0x4L
#define ONEDOT 0x2L
#define OVFLAG 0x20L
#define SIGNFLAG 0x40L
#define BLITREVERSE 0x2L
#define SUD 0x10L
#define SUL 0x8L
#define AUL 0x4L
#define OCTANT8 24L
#define OCTANT7 4L
#define OCTANT6 12L
#define OCTANT5 28L
#define OCTANT4 20L
#define OCTANT3 8L
#define OCTANT2 0L
#define OCTANT1 16L
struct bltnode
{
struct bltnode *n;
int (*function)();
char stat;
short blitsize;
short beamsync;
int (*cleanup)();
};
#define CLEANUP 0x40L
#define CLEANME CLEANUP

/* ******************** adkbits.h ******************** */
#define ADKB_SETCLR 15L
#define ADKB_PRECOMP1 14L
#define ADKB_PRECOMP0 13L
#define ADKB_MFMPREC 12L
#define ADKB_UARTBRK 11L
#define ADKB_WORDSYNC 10L
#define ADKB_MSBSYNC 9L
#define ADKB_FAST 8L
#define ADKB_USE3PN 7L
#define ADKB_USE2P3 6L
#define ADKB_USE1P2 5L
#define ADKB_USE0P1 4L
#define ADKB_USE3VN 3L
#define ADKB_USE2V3 2L
#define ADKB_USE1V2 1L
#define ADKB_USE0V1 0L
#define ADKF_SETCLR (1L<<15)
#define ADKF_PRECOMP1 (1L<<14)
#define ADKF_PRECOMP0 (1L<<13)
#define ADKF_MFMPREC (1L<<12)
#define ADKF_UARTBRK (1L<<11)
#define ADKF_WORDSYNC (1L<<10)
#define ADKF_MSBSYNC (1L<<9)
#define ADKF_FAST (1L<<8)
#define ADKF_USE3PN (1L<<7)
#define ADKF_USE2P3 (1L<<6)
#define ADKF_USE1P2 (1L<<5)
#define ADKF_USE0P1 (1L<<4)
#define ADKF_USE3VN (1L<<3)
#define ADKF_USE2V3 (1L<<2)
#define ADKF_USE1V2 (1L<<1)
#define ADKF_USE0V1 (1L<<0)
#define ADKF_PRE000NS 0L
#define ADKF_PRE140NS (ADKF_PRECOMP0)
#define ADKF_PRE280NS (ADKF_PRECOMP1)
#define ADKF_PRE560NS (ADKF_PRECOMP0|ADKF_PRECOMP1)

/* ******************** alerts.h ******************** */
#define SF_ALERTWACK (1L<<1)
#define AT_DeadEnd 0x80000000L
#define AT_Recovery 0x00000000L
#define AG_NoMemory 0x00010000L
#define AG_MakeLib 0x00020000L
#define AG_OpenLib 0x00030000L
#define AG_OpenDev 0x00040000L
#define AG_OpenRes 0x00050000L
#define AG_IOError 0x00060000L
#define AG_NoSignal 0x00070000L
#define AO_ExecLib 0x00008001L
#define AO_GraphicsLib 0x00008002L
#define AO_LayersLib 0x00008003L
#define AO_Intuition 0x00008004L
#define AO_MathLib 0x00008005L
#define AO_CListLib 0x00008006L
#define AO_DOSLib 0x00008007L
#define AO_RAMLib 0x00008008L
#define AO_IconLib 0x00008009L
#define AO_ExpansionLib 0x0000800AL
#define AO_AudioDev 0x00008010L
#define AO_ConsoleDev 0x00008011L
#define AO_GamePortDev 0x00008012L
#define AO_KeyboardDev 0x00008013L
#define AO_TrackDiskDev 0x00008014L
#define AO_TimerDev 0x00008015L
#define AO_CIARsrc 0x00008020L
#define AO_DiskRsrc 0x00008021L
#define AO_MiscRsrc 0x00008022L
#define AO_BootStrap 0x00008030L
#define AO_Workbench 0x00008031L
#define AN_ExecLib 0x01000000L
#define AN_ExcptVect 0x81000001L
#define AN_BaseChkSum 0x81000002L
#define AN_LibChkSum 0x81000003L
#define AN_LibMem 0x81000004L
#define AN_MemCorrupt 0x81000005L
#define AN_IntrMem 0x81000006L
#define AN_InitAPtr 0x81000007L
#define AN_SemCorrupt 0x81000008L
#define AN_FreeTwice 0x81000009L
#define AN_BogusExcpt 0x8100000AL
#define AN_GraphicsLib 0x02000000L
#define AN_GfxNoMem 0x82010000L
#define AN_LongFrame 0x82010006L
#define AN_ShortFrame 0x82010007L
#define AN_TextTmpRas 0x02010009L
#define AN_BltBitMap 0x8201000AL
#define AN_RegionMemory 0x8201000BL
#define AN_MakeVPort 0x82010030L
#define AN_GfxNoLCM 0x82011234L
#define AN_LayersLib 0x03000000L
#define AN_LayersNoMem 0x83010000L
#define AN_Intuition 0x04000000L
#define AN_GadgetType 0x84000001L
#define AN_BadGadget 0x04000001L
#define AN_CreatePort 0x84010002L
#define AN_ItemAlloc 0x04010003L
#define AN_SubAlloc 0x04010004L
#define AN_PlaneAlloc 0x84010005L
#define AN_ItemBoxTop 0x84000006L
#define AN_OpenScreen 0x84010007L
#define AN_OpenScrnRast 0x84010008L
#define AN_SysScrnType 0x84000009L
#define AN_AddSWGadget 0x8401000AL
#define AN_OpenWindow 0x8401000BL
#define AN_BadState 0x8400000CL
#define AN_BadMessage 0x8400000DL
#define AN_WeirdEcho 0x8400000EL
#define AN_NoConsole 0x8400000FL
#define AN_MathLib 0x05000000L
#define AN_CListLib 0x06000000L
#define AN_DOSLib 0x07000000L
#define AN_StartMem 0x07010001L
#define AN_EndTask 0x07000002L
#define AN_QPktFail 0x07000003L
#define AN_AsyncPkt 0x07000004L
#define AN_FreeVec 0x07000005L
#define AN_DiskBlkSeq 0x07000006L
#define AN_BitMap 0x07000007L
#define AN_KeyFree 0x07000008L
#define AN_BadChkSum 0x07000009L
#define AN_DiskError 0x0700000AL
#define AN_KeyRange 0x0700000BL
#define AN_BadOverlay 0x0700000CL
#define AN_RAMLib 0x08000000L
#define AN_BadSegList 0x08000001L
#define AN_IconLib 0x09000000L
#define AN_ExpansionLib 0x0A000000L
#define AN_BadExpansionFree 0x0A000001L
#define AN_AudioDev 0x10000000L
#define AN_ConsoleDev 0x11000000L
#define AN_GamePortDev 0x12000000L
#define AN_KeyboardDev 0x13000000L
#define AN_TrackDiskDev 0x14000000L
#define AN_TDCalibSeek 0x14000001L
#define AN_TDDelay 0x14000002L
#define AN_TimerDev 0x15000000L
#define AN_TMBadReq 0x15000001L
#define AN_TMBadSupply 0x15000002L
#define AN_CIARsrc 0x20000000L
#define AN_DiskRsrc 0x21000000L
#define AN_DRHasDisk 0x21000001L
#define AN_DRIntNoAct 0x21000002L
#define AN_MiscRsrc 0x22000000L
#define AN_BootStrap 0x30000000L
#define AN_BootError 0x30000001L
#define AN_Workbench 0x31000000L
#define AN_DiskCopy 0x32000000L

/* ******************** fcntl.h ******************** */
/* Copyright (C) 1986,1987 by Manx Software Systems, Inc. */

/*#define O_RDONLY        0
#define O_WRONLY        1
#define O_RDWR                2
#define O_CREAT                0x0100
#define O_TRUNC                0x0200
#define O_EXCL                0x0400
#define O_APPEND        0x0800

#define        O_CONRAW        0x4000
#define        O_STDIO                0x8000

extern struct _dev {
        long        fd;
        short        mode;
} *_devtab;

extern short _numdev;*/

/* ******************** intbits.h ******************** */
#define INTB_SETCLR (15L)
#define INTB_INTEN (14L)
#define INTB_EXTER (13L)
#define INTB_DSKSYNC (12L)
#define INTB_RBF (11L)
#define INTB_AUD3 (10L)
#define INTB_AUD2 (9L)
#define INTB_AUD1 (8L)
#define INTB_AUD0 (7L)
#define INTB_BLIT (6L)
#define INTB_VERTB (5L)
#define INTB_COPER (4L)
#define INTB_PORTS (3L)
#define INTB_SOFTINT (2L)
#define INTB_DSKBLK (1L)
#define INTB_TBE (0L)
#define INTF_SETCLR (1L<<15)
#define INTF_INTEN (1L<<14)
#define INTF_EXTER (1L<<13)
#define INTF_DSKSYNC (1L<<12)
#define INTF_RBF (1L<<11)
#define INTF_AUD3 (1L<<10)
#define INTF_AUD2 (1L<<9)
#define INTF_AUD1 (1L<<8)
#define INTF_AUD0 (1L<<7)
#define INTF_BLIT (1L<<6)
#define INTF_VERTB (1L<<5)
#define INTF_COPER (1L<<4)
#define INTF_PORTS (1L<<3)
#define INTF_SOFTINT (1L<<2)
#define INTF_DSKBLK (1L<<1)
#define INTF_TBE (1L<<0)

/* ******************** screens.h ******************** */
struct Screen
{
struct Screen *NextScreen;
struct Window *FirstWindow;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
SHORT MouseY, MouseX;
USHORT Flags;
UBYTE *Title;
UBYTE *DefaultTitle;
BYTE BarHeight, BarVBorder, BarHBorder, MenuVBorder, MenuHBorder;
BYTE WBorTop, WBorLeft, WBorRight, WBorBottom;
struct TextAttr *Font;
struct ViewPort ViewPort;
struct RastPort RastPort;
struct BitMap BitMap;
struct Layer_Info LayerInfo;
struct Gadget *FirstGadget;
UBYTE DetailPen, BlockPen;
USHORT SaveColor0;
struct Layer *BarLayer;
UBYTE *ExtData;
UBYTE *UserData;
};
#define SCREENTYPE 0x000FL
#define WBENCHSCREEN 0x0001L
#define CUSTOMSCREEN 0x000FL
#define SHOWTITLE 0x0010L
#define BEEPING 0x0020L
#define CUSTOMBITMAP 0x0040L
#define SCREENBEHIND 0x0080L
#define SCREENQUIET 0x0100L
#define STDSCREENHEIGHT -1L
struct NewScreen
{
SHORT LeftEdge, TopEdge, Width, Height, Depth;
UBYTE DetailPen, BlockPen;
USHORT ViewModes;
USHORT Type;
struct TextAttr *Font;
UBYTE *DefaultTitle;
struct Gadget *Gadgets;
struct BitMap *CustomBitMap;
};

/* ******************** trackdisk.h ******************** */
#define NUMCYLS  80
#define MAXCYLS  (NUMCYLS+20)
#define NUMSECS 11L
#define NUMHEADS 2
#define MAXRETRY 10
#define NUMTRACKS (NUMCYLS*NUMHEADS)
#define NUMUNITS 4L
#define TD_SECTOR 512L
#define TD_SECSHIFT 9L
#define TD_NAME "trackdisk.device"
#define TDF_EXTCOM (1L<<15)
#define TD_MOTOR (CMD_NONSTD+0)
#define TD_SEEK (CMD_NONSTD+1)
#define TD_FORMAT (CMD_NONSTD+2)
#define TD_REMOVE (CMD_NONSTD+3)
#define TD_CHANGENUM (CMD_NONSTD+4)
#define TD_CHANGESTATE (CMD_NONSTD+5)
#define TD_PROTSTATUS (CMD_NONSTD+6)
#define TD_RAWREAD (CMD_NONSTD+7)
#define TD_RAWWRITE (CMD_NONSTD+8)
#define TD_GETDRIVETYPE (CMD_NONSTD+9)
#define TD_GETNUMTRACKS (CMD_NONSTD+10)
#define TD_ADDCHANGEINT (CMD_NONSTD+11)
#define TD_REMCHANGEINT (CMD_NONSTD+12)
#define TD_LASTCOMM (CMD_NONSTD+13)
#define ETD_WRITE (CMD_WRITE|TDF_EXTCOM)
#define ETD_READ (CMD_READ|TDF_EXTCOM)
#define ETD_MOTOR (TD_MOTOR|TDF_EXTCOM)
#define ETD_SEEK (TD_SEEK|TDF_EXTCOM)
#define ETD_FORMAT (TD_FORMAT|TDF_EXTCOM)
#define ETD_UPDATE (CMD_UPDATE|TDF_EXTCOM)
#define ETD_CLEAR (CMD_CLEAR|TDF_EXTCOM)
#define ETD_RAWREAD (TD_RAWREAD|TDF_EXTCOM)
#define ETD_RAWWRITE (TD_RAWWRITE|TDF_EXTCOM)
struct IOExtTD {
struct IOStdReq iotd_Req;
ULONG iotd_Count;
ULONG iotd_SecLabel;
};
#define IOTDB_INDEXSYNC 4L
#define IOTDF_INDEXSYNC (1L<<4)
#define TD_LABELSIZE 16L
#define TDB_ALLOW_NON_3_5 0L
#define TDF_ALLOW_NON_3_5 (1L<<0)
#define DRIVE3_5 1L
#define DRIVE5_25 2L
#define TDERR_NotSpecified 20L
#define TDERR_NoSecHdr 21L
#define TDERR_BadSecPreamble 22L
#define TDERR_BadSecID 23L
#define TDERR_BadHdrSum 24L
#define TDERR_BadSecSum 25L
#define TDERR_TooFewSecs 26L
#define TDERR_BadSecHdr 27L
#define TDERR_WriteProt 28L
#define TDERR_DiskChanged 29L
#define TDERR_SeekError 30L
#define TDERR_NoMem 31L
#define TDERR_BadUnitNum 32L
#define TDERR_BadDriveType 33L
#define TDERR_DriveInUse 34L
#define TDERR_PostReset 35L
struct TDU_PublicUnit {
struct Unit tdu_Unit;
UWORD tdu_Comp01Track;
UWORD tdu_Comp10Track;
UWORD tdu_Comp11Track;
ULONG tdu_StepDelay;
ULONG tdu_SettleDelay;
UBYTE tdu_RetryCnt;
};

/* ******************** dosextens.h ******************** */
struct Process {
struct Task pr_Task;
struct MsgPort pr_MsgPort;
WORD pr_Pad;
BPTR pr_SegList;
LONG pr_StackSize;
APTR pr_GlobVec;
LONG pr_TaskNum;
BPTR pr_StackBase;
LONG pr_Result2;
BPTR pr_CurrentDir;
BPTR pr_CIS;
BPTR pr_COS;
APTR pr_ConsoleTask;
APTR pr_FileSystemTask;
BPTR pr_CLI;
APTR pr_ReturnAddr;
APTR pr_PktWait;
APTR pr_WindowPtr;
};
struct FileHandle {
struct Message *fh_Link;
struct MsgPort *fh_Port;
struct MsgPort *fh_Type;
LONG fh_Buf;
LONG fh_Pos;
LONG fh_End;
LONG fh_Funcs;
#define fh_Func1 fh_Funcs
LONG fh_Func2;
LONG fh_Func3;
LONG fh_Args;
#define fh_Arg1 fh_Args
LONG fh_Arg2;
};
struct DosPacket {
struct Message *dp_Link;
struct MsgPort *dp_Port;
LONG dp_Type;
LONG dp_Res1;
LONG dp_Res2;
#define dp_Action dp_Type
#define dp_Status dp_Res1
#define dp_Status2 dp_Res2
#define dp_BufAddr dp_Arg1
LONG dp_Arg1;
LONG dp_Arg2;
LONG dp_Arg3;
LONG dp_Arg4;
LONG dp_Arg5;
LONG dp_Arg6;
LONG dp_Arg7;
};
struct StandardPacket {
struct Message sp_Msg;
struct DosPacket sp_Pkt;
};
#define ACTION_NIL 0L
#define ACTION_GET_BLOCK 2L
#define ACTION_SET_MAP 4L
#define ACTION_DIE 5L
#define ACTION_EVENT 6L
#define ACTION_CURRENT_VOLUME 7L
#define ACTION_LOCATE_OBJECT 8L
#define ACTION_RENAME_DISK 9L
#define ACTION_WRITE ((long)'W')
#define ACTION_READ ((long)'R')
#define ACTION_FREE_LOCK 15L
#define ACTION_DELETE_OBJECT 16L
#define ACTION_RENAME_OBJECT 17L
#define ACTION_MORE_CACHE 18L
#define ACTION_COPY_DIR 19L
#define ACTION_WAIT_CHAR 20L
#define ACTION_SET_PROTECT 21L
#define ACTION_CREATE_DIR 22L
#define ACTION_EXAMINE_OBJECT 23L
#define ACTION_EXAMINE_NEXT 24L
#define ACTION_DISK_INFO 25L
#define ACTION_INFO 26L
#define ACTION_FLUSH 27L
#define ACTION_SET_COMMENT 28L
#define ACTION_PARENT 29L
#define ACTION_TIMER 30L
#define ACTION_INHIBIT 31L
#define ACTION_DISK_TYPE 32L
#define ACTION_DISK_CHANGE 33L
#define ACTION_SET_DATE 34L
#define ACTION_SCREEN_MODE 994L
struct DosLibrary {
struct Library dl_lib;
APTR dl_Root;
APTR dl_GV;
LONG dl_A2;
LONG dl_A5;
LONG dl_A6;
};
struct RootNode {
BPTR rn_TaskArray;
BPTR rn_ConsoleSegment;
struct DateStamp rn_Time;
LONG rn_RestartSeg;
BPTR rn_Info;
BPTR rn_FileHandlerSegment;
};
struct DosInfo {
BPTR di_McName;
BPTR di_DevInfo;
BPTR di_Devices;
BPTR di_Handlers;
APTR di_NetHand;
};
struct CommandLineInterface {
LONG cli_Result2;
BSTR cli_SetName;
BPTR cli_CommandDir;
LONG cli_ReturnCode;
BSTR cli_CommandName;
LONG cli_FailLevel;
BSTR cli_Prompt;
BPTR cli_StandardInput;
BPTR cli_CurrentInput;
BSTR cli_CommandFile;
LONG cli_Interactive;
LONG cli_Background;
BPTR cli_CurrentOutput;
LONG cli_DefaultStack;
BPTR cli_StandardOutput;
BPTR cli_Module;
};
struct DeviceList {
BPTR dl_Next;
LONG dl_Type;
struct MsgPort * dl_Task;
BPTR dl_Lock;
struct DateStamp dl_VolumeDate;
BPTR dl_LockList;
LONG dl_DiskType;
LONG dl_unused;
BSTR * dl_Name;
};
#define DLT_DEVICE 0L
#define DLT_DIRECTORY 1L
#define DLT_VOLUME 2L
struct FileLock {
BPTR fl_Link;
LONG fl_Key;
LONG fl_Access;
struct MsgPort * fl_Task;
BPTR fl_Volume;
};
struct DevInfo {
BPTR dvi_Next;
LONG dvi_Type;
APTR dvi_Task;
BPTR dvi_Lock;
BSTR dvi_Handler;
LONG dvi_StackSize;
LONG dvi_Priority;
LONG dvi_Startup;
BPTR dvi_SegList;
BPTR dvi_GlobVec;
BSTR dvi_Name;
};

/* ******************** intuition.h ******************** */
struct Menu
{
struct Menu *NextMenu;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
USHORT Flags;
BYTE *MenuName;
struct MenuItem *FirstItem;
SHORT JazzX, JazzY, BeatX, BeatY;
};
#define MENUENABLED 0x0001L
#define MIDRAWN 0x0100L
struct MenuItem
{
struct MenuItem *NextItem;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
USHORT Flags;
LONG MutualExclude;
APTR ItemFill;
APTR SelectFill;
BYTE Command;
struct MenuItem *SubItem;
USHORT NextSelect;
};
#define CHECKIT 0x0001L
#define ITEMTEXT 0x0002L
#define COMMSEQ 0x0004L
#define MENUTOGGLE 0x0008L
#define ITEMENABLED 0x0010L
#define HIGHFLAGS 0x00C0L
#define HIGHIMAGE 0x0000L
#define HIGHCOMP 0x0040L
#define HIGHBOX 0x0080L
#define HIGHNONE 0x00C0L
#define CHECKED 0x0100L
#define ISDRAWN 0x1000L
#define HIGHITEM 0x2000L
#define MENUTOGGLED 0x4000L
struct Requester
{
struct Requester *OlderRequest;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
SHORT RelLeft, RelTop;
struct Gadget *ReqGadget;
struct Border *ReqBorder;
struct IntuiText *ReqText;
USHORT Flags;
UBYTE BackFill;
struct Layer *ReqLayer;
UBYTE ReqPad1[32];
struct BitMap *ImageBMap;
struct Window *RWindow;
UBYTE ReqPad2[36];
};
#define POINTREL 0x0001L
#define PREDRAWN 0x0002L
#define NOISYREQ 0x0004L
#define REQOFFWINDOW 0x1000L
#define REQACTIVE 0x2000L
#define SYSREQUEST 0x4000L
#define DEFERREFRESH 0x8000L
struct Gadget
{
struct Gadget *NextGadget;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
USHORT Flags;
USHORT Activation;
USHORT GadgetType;
APTR GadgetRender;
APTR SelectRender;
struct IntuiText *GadgetText;
LONG MutualExclude;
APTR SpecialInfo;
USHORT GadgetID;
APTR UserData;
};
#define GADGHIGHBITS 0x0003L
#define GADGHCOMP 0x0000L
#define GADGHBOX 0x0001L
#define GADGHIMAGE 0x0002L
#define GADGHNONE 0x0003L
#define GADGIMAGE 0x0004L
#define GRELBOTTOM 0x0008L
#define GRELRIGHT 0x0010L
#define GRELWIDTH 0x0020L
#define GRELHEIGHT 0x0040L
#define SELECTED 0x0080L
#define GADGDISABLED 0x0100L
#define RELVERIFY 0x0001L
#define GADGIMMEDIATE 0x0002L
#define ENDGADGET 0x0004L
#define FOLLOWMOUSE 0x0008L
#define RIGHTBORDER 0x0010L
#define LEFTBORDER 0x0020L
#define TOPBORDER 0x0040L
#define BOTTOMBORDER 0x0080L
#define TOGGLESELECT 0x0100L
#define STRINGCENTER 0x0200L
#define STRINGRIGHT 0x0400L
#define LONGINT 0x0800L
#define ALTKEYMAP 0x1000L
#define BOOLEXTEND 0x2000L
#define GADGETTYPE 0xFC00L
#define SYSGADGET 0x8000L
#define SCRGADGET 0x4000L
#define GZZGADGET 0x2000L
#define REQGADGET 0x1000L
#define SIZING 0x0010L
#define WDRAGGING 0x0020L
#define SDRAGGING 0x0030L
#define WUPFRONT 0x0040L
#define SUPFRONT 0x0050L
#define WDOWNBACK 0x0060L
#define SDOWNBACK 0x0070L
#define CLOSE 0x0080L
#define BOOLGADGET 0x0001L
#define GADGET0002 0x0002L
#define PROPGADGET 0x0003L
#define STRGADGET 0x0004L
struct BoolInfo
{
USHORT Flags;
UWORD *Mask;
ULONG Reserved;
};
#define BOOLMASK 0x0001L
struct PropInfo
{
USHORT Flags;
USHORT HorizPot;
USHORT VertPot;
USHORT HorizBody;
USHORT VertBody;
USHORT CWidth;
USHORT CHeight;
USHORT HPotRes, VPotRes;
USHORT LeftBorder;
USHORT TopBorder;
};
#define AUTOKNOB 0x0001L
#define FREEHORIZ 0x0002L
#define FREEVERT 0x0004L
#define PROPBORDERLESS 0x0008L
#define KNOBHIT 0x0100L
#define KNOBHMIN 6L
#define KNOBVMIN 4L
#define MAXBODY 0xFFFFL
#define MAXPOT 0xFFFFL
struct StringInfo
{
UBYTE *Buffer;
UBYTE *UndoBuffer;
SHORT BufferPos;
SHORT MaxChars;
SHORT DispPos;
SHORT UndoPos;
SHORT NumChars;
SHORT DispCount;
SHORT CLeft, CTop;
struct Layer *LayerPtr;
LONG LongInt;
struct KeyMap *AltKeyMap;
};
struct IntuiText
{
UBYTE FrontPen, BackPen;
UBYTE DrawMode;
SHORT LeftEdge;
SHORT TopEdge;
struct TextAttr *ITextFont;
UBYTE *IText;
struct IntuiText *NextText;
};
struct Border
{
SHORT LeftEdge, TopEdge;
UBYTE FrontPen, BackPen;
UBYTE DrawMode;
BYTE Count;
SHORT *XY;
struct Border *NextBorder;
};
struct Image
{
SHORT LeftEdge;
SHORT TopEdge;
SHORT Width;
SHORT Height, Depth;
USHORT *ImageData;
UBYTE PlanePick, PlaneOnOff;
struct Image *NextImage;
};
struct IntuiMessage
{
struct Message ExecMessage;
ULONG Class;
USHORT Code;
USHORT Qualifier;
APTR IAddress;
SHORT MouseX, MouseY;
ULONG Seconds, Micros;
struct Window *IDCMPWindow;
struct IntuiMessage *SpecialLink;
};
#define SIZEVERIFY 0x00000001L
#define NEWSIZE 0x00000002L
#define REFRESHWINDOW 0x00000004L
#define MOUSEBUTTONS 0x00000008L
#define MOUSEMOVE 0x00000010L
#define GADGETDOWN 0x00000020L
#define GADGETUP 0x00000040L
#define REQSET 0x00000080L
#define MENUPICK 0x00000100L
#define CLOSEWINDOW 0x00000200L
#define RAWKEY 0x00000400L
#define REQVERIFY 0x00000800L
#define REQCLEAR 0x00001000L
#define MENUVERIFY 0x00002000L
#define NEWPREFS 0x00004000L
#define DISKINSERTED 0x00008000L
#define DISKREMOVED 0x00010000L
#define WBENCHMESSAGE 0x00020000L
#define ACTIVEWINDOW 0x00040000L
#define INACTIVEWINDOW 0x00080000L
#define DELTAMOVE 0x00100000L
#define VANILLAKEY 0x00200000L
#define INTUITICKS 0x00400000L
#define LONELYMESSAGE 0x80000000L
#define MENUHOT 0x0001L
#define MENUCANCEL 0x0002L
#define MENUWAITING 0x0003L
#define OKOK MENUHOT
#define OKABORT 0x0004L
#define OKCANCEL MENUCANCEL
#define WBENCHOPEN 0x0001L
#define WBENCHCLOSE 0x0002L
struct Window
{
struct Window *NextWindow;
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
SHORT MouseY, MouseX;
SHORT MinWidth, MinHeight;
USHORT MaxWidth, MaxHeight;
ULONG Flags;
struct Menu *MenuStrip;
UBYTE *Title;
struct Requester *FirstRequest;
struct Requester *DMRequest;
SHORT ReqCount;
struct Screen *WScreen;
struct RastPort *RPort;
BYTE BorderLeft, BorderTop, BorderRight, BorderBottom;
struct RastPort *BorderRPort;
struct Gadget *FirstGadget;
struct Window *Parent, *Descendant;
USHORT *Pointer;
BYTE PtrHeight;
BYTE PtrWidth;
BYTE XOffset, YOffset;
ULONG IDCMPFlags;
struct MsgPort *UserPort, *WindowPort;
struct IntuiMessage *MessageKey;
UBYTE DetailPen, BlockPen;
struct Image *CheckMark;
UBYTE *ScreenTitle;
SHORT GZZMouseX;
SHORT GZZMouseY;
SHORT GZZWidth;
SHORT GZZHeight;
UBYTE *ExtData;
BYTE *UserData;
struct Layer *WLayer;
struct TextFont *IFont;
};
#define WINDOWSIZING 0x0001L
#define WINDOWDRAG 0x0002L
#define WINDOWDEPTH 0x0004L
#define WINDOWCLOSE 0x0008L
#define SIZEBRIGHT 0x0010L
#define SIZEBBOTTOM 0x0020L
#define REFRESHBITS 0x00C0L
#define SMART_REFRESH 0x0000L
#define SIMPLE_REFRESH 0x0040L
#define SUPER_BITMAP 0x0080L
#define OTHER_REFRESH 0x00C0L
#define BACKDROP 0x0100L
#define REPORTMOUSE 0x0200L
#define GIMMEZEROZERO 0x0400L
#define BORDERLESS 0x0800L
#define ACTIVATE 0x1000L
#define WINDOWACTIVE 0x2000L
#define INREQUEST 0x4000L
#define MENUSTATE 0x8000L
#define RMBTRAP 0x00010000L
#define NOCAREREFRESH 0x00020000L
#define WINDOWREFRESH 0x01000000L
#define WBENCHWINDOW 0x02000000L
#define WINDOWTICKED 0x04000000L
#define SUPER_UNUSED 0xFCFC0000L
struct NewWindow
{
SHORT LeftEdge, TopEdge;
SHORT Width, Height;
UBYTE DetailPen, BlockPen;
ULONG IDCMPFlags;
ULONG Flags;
struct Gadget *FirstGadget;
struct Image *CheckMark;
UBYTE *Title;
struct Screen *Screen;
struct BitMap *BitMap;
SHORT MinWidth, MinHeight;
USHORT MaxWidth, MaxHeight;
USHORT Type;
};
struct Remember
{
struct Remember *NextRemember;
ULONG RememberSize;
UBYTE *Memory;
};
#define MENUNUM(n) (n & 0x1F)
#define ITEMNUM(n) ((n >> 5) & 0x003F)
#define SUBNUM(n) ((n >> 11) & 0x001F)
#define SHIFTMENU(n) (n & 0x1F)
#define SHIFTITEM(n) ((n & 0x3F) << 5)
#define SHIFTSUB(n) ((n & 0x1F) << 11)
#define SRBNUM(n) (0x08 - (n >> 4))
#define SWBNUM(n) (0x08 - (n & 0x0F))
#define SSBNUM(n) (0x01 + (n >> 4))
#define SPARNUM(n) (n >> 4)
#define SHAKNUM(n) (n & 0x0F)
#define NOMENU 0x001FL
#define NOITEM 0x003FL
#define NOSUB 0x001FL
#define MENUNULL 0xFFFFL
#define FOREVER for(;;)
#define SIGN(x) ( ((x) > 0) - ((x) < 0) )
#define NOT !
#define CHECKWIDTH 19L
#define COMMWIDTH 27L
#define LOWCHECKWIDTH 13L
#define LOWCOMMWIDTH 16L
#define ALERT_TYPE 0x80000000L
#define RECOVERY_ALERT 0x00000000L
#define DEADEND_ALERT 0x80000000L
#define AUTOFRONTPEN 0L
#define AUTOBACKPEN 1L
#define AUTODRAWMODE JAM2
#define AUTOLEFTEDGE 6L
#define AUTOTOPEDGE 3L
#define AUTOITEXTFONT NULL
#define AUTONEXTTEXT NULL
#define SELECTUP (IECODE_LBUTTON | IECODE_UP_PREFIX)
#define SELECTDOWN (IECODE_LBUTTON)
#define MENUUP (IECODE_RBUTTON | IECODE_UP_PREFIX)
#define MENUDOWN (IECODE_RBUTTON)
#define ALTLEFT (IEQUALIFIER_LALT)
#define ALTRIGHT (IEQUALIFIER_RALT)
#define AMIGALEFT (IEQUALIFIER_LCOMMAND)
#define AMIGARIGHT (IEQUALIFIER_RCOMMAND)
#define AMIGAKEYS (AMIGALEFT | AMIGARIGHT)
#define CURSORUP 0x4CL
#define CURSORLEFT 0x4FL
#define CURSORRIGHT 0x4EL
#define CURSORDOWN 0x4DL
#define KEYCODE_Q 0x10L
#define KEYCODE_X 0x32L
#define KEYCODE_N 0x36L
#define KEYCODE_M 0x37L
#define KEYCODE_V 0x34L
#define KEYCODE_B 0x35L
#endif
