#ifndef LEOREGS_H
#define LEOREGS_H
#define LEO_ATTR_PICK_DISABLE 0x00000000
#define LEO_ATTR_PICK_2D 0x80000000
#define LEO_ATTR_PICK_3D 0xa0000000
#define LEO_ATTR_PICK_2D_REND 0xc0000000
#define LEO_ATTR_PICK_3D_REND 0xe0000000
#define LEO_ATTR_DCE_DISABLE 0x00000000
#define LEO_ATTR_DCE_ENABLE 0x10000000
#define LEO_ATTR_APE_DISABLE 0x00000000
#define LEO_ATTR_APE_ENABLE 0x08000000
#define LEO_ATTR_COLOR_VAR 0x00000000
#define LEO_ATTR_COLOR_CONST 0x04000000
#define LEO_ATTR_AA_DISABLE 0x02000000
#define LEO_ATTR_AA_ENABLE 0x01000000
#define LEO_ATTR_ABE_BG 0x00000000
#define LEO_ATTR_ABE_FB 0x00800000
#define LEO_ATTR_ABE_DISABLE 0x00000000
#define LEO_ATTR_ABE_ENABLE 0x00400000
#define LEO_ATTR_BLTSRC_A 0x00000000
#define LEO_ATTR_BLTSRC_B 0x00200000
#define LEO_ROP_ZERO (0x0 << 18)
#define LEO_ROP_NEW_AND_OLD (0x8 << 18)
#define LEO_ROP_NEW_AND_NOLD (0x4 << 18)
#define LEO_ROP_NEW (0xc << 18)
#define LEO_ROP_NNEW_AND_OLD (0x2 << 18)
#define LEO_ROP_OLD (0xa << 18)
#define LEO_ROP_NEW_XOR_OLD (0x6 << 18)
#define LEO_ROP_NEW_OR_OLD (0xe << 18)
#define LEO_ROP_NNEW_AND_NOLD (0x1 << 18)
#define LEO_ROP_NNEW_XOR_NOLD (0x9 << 18)
#define LEO_ROP_NOLD (0x5 << 18)
#define LEO_ROP_NEW_OR_NOLD (0xd << 18)
#define LEO_ROP_NNEW (0x3 << 18)
#define LEO_ROP_NNEW_OR_OLD (0xb << 18)
#define LEO_ROP_NNEW_OR_NOLD (0x7 << 18)
#define LEO_ROP_ONES (0xf << 18)
#define LEO_ATTR_HSR_DISABLE 0x00000000
#define LEO_ATTR_HSR_ENABLE 0x00020000
#define LEO_ATTR_WRITEZ_DISABLE 0x00000000
#define LEO_ATTR_WRITEZ_ENABLE 0x00010000
#define LEO_ATTR_Z_VAR 0x00000000
#define LEO_ATTR_Z_CONST 0x00008000
#define LEO_ATTR_WCLIP_DISABLE 0x00000000
#define LEO_ATTR_WCLIP_ENABLE 0x00004000
#define LEO_ATTR_MONO 0x00000000
#define LEO_ATTR_STEREO_LEFT 0x00001000
#define LEO_ATTR_STEREO_RIGHT 0x00003000
#define LEO_ATTR_WE_DISABLE 0x00000000
#define LEO_ATTR_WE_ENABLE 0x00000800
#define LEO_ATTR_FCE_DISABLE 0x00000000
#define LEO_ATTR_FCE_ENABLE 0x00000400
#define LEO_ATTR_RE_DISABLE 0x00000000
#define LEO_ATTR_RE_ENABLE 0x00000200
#define LEO_ATTR_GE_DISABLE 0x00000000
#define LEO_ATTR_GE_ENABLE 0x00000100
#define LEO_ATTR_BE_DISABLE 0x00000000
#define LEO_ATTR_BE_ENABLE 0x00000080
#define LEO_ATTR_RGBE_DISABLE 0x00000000
#define LEO_ATTR_RGBE_ENABLE 0x00000380
#define LEO_ATTR_OE_DISABLE 0x00000000
#define LEO_ATTR_OE_ENABLE 0x00000040
#define LEO_ATTR_ZE_DISABLE 0x00000000
#define LEO_ATTR_ZE_ENABLE 0x00000020
#define LEO_ATTR_FORCE_WID 0x00000010
#define LEO_ATTR_FC_PLANE_MASK 0x0000000e
#define LEO_ATTR_BUFFER_A 0x00000000
#define LEO_ATTR_BUFFER_B 0x00000001
#define LEO_CSR_BLT_BUSY 0x20000000
typedef struct LeoDraw {
unsigned char xxx0[0xe00];
volatile unsigned int csr;
volatile unsigned int wid;
volatile unsigned int wmask;
volatile unsigned int widclip;
volatile unsigned int vclipmin;
volatile unsigned int vclipmax;
volatile unsigned int pickmin;
volatile unsigned int pickmax;
volatile unsigned int fg;
volatile unsigned int bg;
volatile unsigned int src;
volatile unsigned int dst;
volatile unsigned int extent;
unsigned int xxx1[3];
volatile unsigned int setsem;
volatile unsigned int clrsem;
volatile unsigned int clrpick;
volatile unsigned int clrdat;
volatile unsigned int alpha;
unsigned char xxx2[0x2c];
volatile unsigned int winbg;
volatile unsigned int planemask;
volatile unsigned int rop;
volatile unsigned int z;
volatile unsigned int dczf;
volatile unsigned int dczb;
volatile unsigned int dcs;
volatile unsigned int dczs;
volatile unsigned int pickfb;
volatile unsigned int pickbb;
volatile unsigned int dcfc;
volatile unsigned int forcecol;
volatile unsigned int door[8];
volatile unsigned int pick[5];
} LeoDraw;
#define LEO_ADDRSPC_OBGR 0x00
#define LEO_ADDRSPC_Z 0x01
#define LEO_ADDRSPC_W 0x02
#define LEO_ADDRSPC_FONT_OBGR 0x04
#define LEO_ADDRSPC_FONT_Z 0x05
#define LEO_ADDRSPC_FONT_W 0x06
#define LEO_ADDRSPC_O 0x08
#define LEO_ADDRSPC_B 0x09
#define LEO_ADDRSPC_G 0x0a
#define LEO_ADDRSPC_R 0x0b
typedef struct LeoCommand0 {
volatile unsigned int csr;
volatile unsigned int addrspace;
volatile unsigned int fontmsk;
volatile unsigned int fontt;
volatile unsigned int extent;
volatile unsigned int src;
unsigned int dst;
volatile unsigned int copy;
volatile unsigned int fill;
} LeoCommand0;
typedef struct LeoCross {
volatile unsigned int type;
volatile unsigned int csr;
volatile unsigned int value;
} LeoCross;
typedef struct LeoCursor {
unsigned char xxx0[16];
volatile unsigned int cur_type;
volatile unsigned int cur_misc;
volatile unsigned int cur_cursxy;
volatile unsigned int cur_data;
} LeoCursor;
#endif