/** PRISM .h file ... is included into Main Program. **

/************************** Sprite Defs *********************************/
UWORD NormalCursor[] = 
{
	0,0,
	0xf000, 0xf000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0xf000, 0xf000,
	0,0
};

UWORD InterlaceCursor[]=
{
	0,0,
	0xf000, 0xf000,
	0x0000, 0x0000,
	0x0000, 0x0000,
	0xf000, 0xf000,
	0,0
};

UWORD ChipBlank[] =
{
	0,0,
	0x0000, 0x0000,	0x0000, 0x0000,	0x0000, 0x0000,	0x0000, 0x0000,
	0x0000, 0x0000,	0x0000, 0x0000,	0x0000, 0x0000,	0x0000, 0x0000,
	0,0
};
WORD Spr1;
/*************************** Gadget Definitions **************************/
struct IntuiText Color15 ={0,15,JAM2,0,0,0," 15 ",0,};
struct IntuiText Color14 ={0,14,JAM2,0,0,0," 14 ",0,};
struct IntuiText Color13 ={0,13,JAM2,0,0,0," 13 ",0,};
struct IntuiText Color12 ={0,12,JAM2,0,0,0," 12 ",0,};
struct IntuiText Color11 ={0,11,JAM2,0,0,0," 11 ",0,};
struct IntuiText Color10 ={0,10,JAM2,0,0,0," 10 ",0,};
struct IntuiText Color9 ={0,9,JAM2,0,0,0,"  9 ",0,};
struct IntuiText Color8 ={0,8,JAM2,0,0,0,"  8 ",0,};
struct IntuiText Color7 ={0,7,JAM2,0,0,0,"  7 ",0,};
struct IntuiText Color6 ={0,6,JAM2,0,0,0,"  6 ",0,};
struct IntuiText Color5 ={0,5,JAM2,0,0,0,"  5 ",0,};
struct IntuiText Color4 ={0,4,JAM2,0,0,0,"  4 ",0,};
struct IntuiText Color3 ={0,3,JAM2,0,0,0,"  3 ",0,};
struct IntuiText Color2 ={0,2,JAM2,0,0,0,"  2 ",0,};
struct IntuiText Color1 ={0,1,JAM2,0,0,0,"  1 ",0,};
struct IntuiText Color0 ={1,0,JAM2,0,0,0,"  0 ",0,};

struct IntuiText ForeBackText =
{
	15,0,JAM2,2,6,0,(UBYTE *)"Fore/Back",0
};
struct Gadget ForeBackGadget =
{
	0,560,10,76,19,
	GADGHCOMP | SELECTED,RELVERIFY,BOOLGADGET,
	0,0,&ForeBackText,0,0,17,0
};
struct Gadget SelColor15 =
{
    &ForeBackGadget,512,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color15,0,0,16,0
};

struct Gadget SelColor14 =
{
    &SelColor15,478,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color14,0,0,15,0
};

struct Gadget SelColor13 =
{
    &SelColor14,444,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color13,0,0,14,0
};

struct Gadget SelColor12 =
{
    &SelColor13,410,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color12,0,0,13,0
};

struct Gadget SelColor11 =
{
    &SelColor12,376,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    
    0,0,&Color11,0,0,12,0
};

struct Gadget SelColor10 =
{
    &SelColor11,342,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color10,0,0,11,0
};

struct Gadget SelColor9 =
{
    &SelColor10,308,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color9,0,0,10,0
};

struct Gadget SelColor8 =
{
    &SelColor9,274,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color8,0,0,9,0
};

struct Gadget SelColor7 =
{
    &SelColor8,240,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color7,0,0,8,0
};

struct Gadget SelColor6 =
{
    &SelColor7,206,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color6,0,0,7,0
};

struct Gadget SelColor5 =
{
    &SelColor6,172,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color5,0,0,6,0
};

struct Gadget SelColor4 =
{
    &SelColor5,138,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color4,0,0,5,0
};

struct Gadget SelColor3 =
{
    &SelColor4,104,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color3,0,0,4,0
};

struct Gadget SelColor2 =
{
    &SelColor3,70,11,32,8,
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color2,0,0,3,0
};

struct Gadget SelColor1 =
{
    &SelColor2,36,11,32,8, 
    GADGHCOMP,RELVERIFY | GADGIMMEDIATE,BOOLGADGET,
    0,0,&Color1,0,0,2,0
};

struct Gadget SelColor0 =
{
    &SelColor1,    /* NextGadget */
    2,11,32,8,  /* LeftEdge, TopEdge, Width, Height*/
    GADGHCOMP,  /* Flags */
    RELVERIFY | GADGIMMEDIATE,   /* Activation */
    BOOLGADGET,     /* Gadget Type */
    0, /* Gadget Render */
    0,       /* Select Render */
    &Color0,       /* GadgetText */
    0,          /* MutualExclude */
    0,       /* SpecialInfo */
    1,          /* GadgetID */
    0        /* UserData */
};
/************************** Requester Definitions ************************/
/***** The About Requester *****/
struct IntuiText AboutProg7Text =
{
    4,7,JAM2,30,59,0,"Syd Bolton of Legendary Design Technologies Inc.",0
};
struct IntuiText AboutProg6Text =
{
    4,7,JAM2,30,50,0,
    "Enhancements to this program by Chris Timmerberg, and",
    &AboutProg7Text
};
struct IntuiText AboutProg5Text =
{
    4,7,JAM2,30,41,0,
    "are not modified.  This version of Prism is public domain.",
    &AboutProg6Text
};
struct IntuiText AboutProg4Text =
{
    4,7,JAM2,30,32,0,
    "distributed as long as the original files in the archive",
    &AboutProg5Text
};
struct IntuiText AboutProg3Text =
{
    4,7,JAM2,30,23,0,
    "Prism is an ANSI animator for the Amiga.  It can be",
    &AboutProg4Text
};
struct IntuiText AboutProgText =
{
    1,7,JAM1,205,9,0,"Prism by Colin Vernon",&AboutProg3Text
};
/***** The File Requester *****/
UBYTE path[512] = "";
UBYTE filename[33] = "Unnamed.ans";

/***** The Requester Window *****/
struct NewWindow RequesterWindow =
{
    135,50,370,100,0,7,
    GADGETUP,
    SIMPLE_REFRESH | ACTIVATE,0,0,0,0,0,0,0,0,0,
    CUSTOMSCREEN,
};
/***** The True Requester Definition *****/
struct Requester FileSelectBox;
/*************************************************************************/
struct TextAttr WorkFont =
{
	(STRPTR)"ibm.font",
	8, 0, 0
};
struct TextAttr DisplayFont =
{
	(STRPTR)"topaz.font", TOPAZ_EIGHTY, FS_NORMAL, FPF_ROMFONT
};
struct NewScreen FirstWorkScreen =
{
	0,0,		/* LeftEdge, TopEdge	*/
	640,210,	/* Width, Height	*/
	4,		/* Depth		*/
	4,7,		/* DetailPen, BlockPen	*/
	HIRES | SPRITES,/* ViewModes		*/
	CUSTOMSCREEN,	/* Type		    	*/
	&DisplayFont,	/* Font               	*/
	Titlebar,
	0,		/* Gadgets		*/
	0,		/* CustonBitMap	    	*/
};

struct NewWindow FirstWorkWindow =
{
	0,10,		/* LeftEdge, TopEdge	*/
	640,200,	/* Width, Height	*/
	4,7,		/* DetailPen, BlockPen	*/
	MOUSEBUTTONS |	/* IDCMP Flags		*/
	RAWKEY |
	MENUPICK,
	SMART_REFRESH |	/* Flags		*/
	ACTIVATE |
	BORDERLESS |
	GIMMEZEROZERO,
	0,           /* First Gadget         */
	0,		/* CheckMark	    	*/
	0,		/* Window Title		*/
	0,		/* Screen		*/
	0,		/* BitMap		*/
	0,0,		/* Min Width, Height	*/
	0,0,		/* Max Width, Height	*/
	CUSTOMSCREEN,	/* Type		        */
};

struct NewWindow GadgetWindow =
{
	0,170,
	640,30,
	4,7,
	GADGETUP | ACTIVEWINDOW,
	SMART_REFRESH | WINDOWDRAG,
	&SelColor0,
	0,
	"Gadget Box",
	0,
	0,
	0,0,
	0,0,
	CUSTOMSCREEN
};

struct InputEvent inputEvent =
{
    0,IECLASS_RAWKEY,0,0,0
};
UWORD AtrColors[16] =
{
	0x000, 0xA00, 0x0A0, 0xA60, 0x00A, 0xA0A, 0x0AA, 0xBBB,
	0x666, 0xF00, 0x0F0, 0xFF0, 0x00F, 0xF0F, 0x0FF, 0xFFF	
};
/**************************** Menu Definition **************************/
struct IntuiText ForplanesText =
{
	4,7,JAM2,18,1,&DisplayFont,"16 Colors",0
};
struct IntuiText ThreeplanesText =
{
	4,7,JAM2,18,1,&DisplayFont,"8 Colors",0
};
struct IntuiText TwoplanesText =
{
	4,7,JAM2,18,1,&DisplayFont,"4 Colors",0
};
struct IntuiText ColorsText =
{
	4,7,JAM2,0,1,&DisplayFont,"Colors",0
};
struct IntuiText QuitText =
{
    4,7,JAM2,0,1,&DisplayFont,"Quit",0
};
struct IntuiText AppendText =
{
    4,7,JAM2,0,1,&DisplayFont,"Append",0
};
struct IntuiText SaveText =
{
    4,7,JAM2,0,1,&DisplayFont,"Save",0
};
struct IntuiText LoadText =
{
    4,7,JAM2,0,1,&DisplayFont,"Load",0
};
struct IntuiText ClearText =
{
    4,7,JAM2,0,1,&DisplayFont,"Clear",0
};
struct IntuiText PlaybackText =
{
    4,7,JAM2,0,1,&DisplayFont,"Playback",0
};
struct IntuiText AboutText =
{
    4,7,JAM2,0,1,&DisplayFont,"About",0
};
struct IntuiText InterlaceText =
{
    4,7,JAM2,0,1,&DisplayFont,"   Lace",0
};
struct MenuItem Interlace =
{
	0, 0, 10, 110, 10, ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|CHECKIT, 0,
	(APTR)&InterlaceText, 0, 'I', 0, 0
};
struct MenuItem Forplanes =
{
	0,80,20,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
	CHECKIT|CHECKED,3,(APTR)&ForplanesText,0,'4',0,0
};
struct MenuItem Threeplanes =
{
	&Forplanes,80,10,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
	CHECKIT,5,(APTR)&ThreeplanesText,0,'3',0,0
};
struct MenuItem Twoplanes =
{
	&Threeplanes,80,0,130,10,ITEMTEXT|ITEMENABLED|HIGHCOMP|COMMSEQ|
	CHECKIT,6,(APTR)&TwoplanesText,0,'2',0,0
};
struct MenuItem Colors =
{
	&Interlace,0,0,110,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
	(APTR)&ColorsText,0,0,&Twoplanes,0
};
struct MenuItem Quit =
{
    0,0,60,120,10,ITEMTEXT | ITEMENABLED | HIGHBOX | COMMSEQ,0,
    (APTR)&QuitText,0,'Q',0,0
};
struct MenuItem AppSave =
{
    0,80,10,60,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
    (APTR)&SaveText,0,0,0,0
};
struct MenuItem AppLoad =
{
    &AppSave,80,0,60,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
    (APTR)&LoadText,0,0,0,0
};
struct MenuItem Append =
{
    &Quit,0,50,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
    (APTR)&AppendText,0,0,&AppLoad,0
};
struct MenuItem Save =
{
    &Append,0,40,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
    (APTR)&SaveText,0,'S',0,0
};
struct MenuItem Load =
{
    &Save,0,30,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
    (APTR)&LoadText,0,'L',0,0
};
struct MenuItem Clear =
{
    &Load,0,20,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
    (APTR)&ClearText,0,'C',0,0
};    
struct MenuItem Playback =
{
    &Clear,0,10,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP | COMMSEQ,0,
    (APTR)&PlaybackText,0,'P',0,0
};
struct MenuItem About =
{
    &Playback,0,0,120,10,ITEMTEXT | ITEMENABLED | HIGHCOMP,0,
    (APTR)&AboutText,0,0,0,0
};
struct Menu Setup =
{
	0,
	100,0,100,10,
	MENUENABLED,
	"Setup",
	&Colors
};
struct Menu Project =
{
    &Setup,
    0, 0, 100, 10,
    MENUENABLED,
    "Project",
    &About
};

UBYTE Buffer[MAXINPUTLEN];
USHORT scanner;
struct ANSI storage = { NULL,NULL,-1,-1,-1,-1,NULL };
struct ANSI *sdlstptr, *lastptr, *middle, *front, *back;
struct TextFont *TFont;
USHORT length = 0,position = 0;	/* used to display where editor is */
USHORT cx = 1, cy = 1;		/* cursor co-ordinates */
USHORT maxheight=25;
BOOL changes = FALSE;
static UBYTE funckey[MAXCHARSETS][8] =
{
    {0xb3, 0xc4, 0xc5, 0xc0, 0xd9, 0xda, 0xbf, 0xd8},
    {0xba, 0xcd, 0xce, 0xc8, 0xbc, 0xc9, 0xbb, 0xd7},
    {0xc1, 0xc2, 0xb4, 0xc3, 0xca, 0xcb, 0xb9, 0xcc},
    {0xbe, 0xd4, 0xb8, 0xd5, 0xbd, 0xd3, 0xb7, 0xd6},
    {0xd0, 0xd2, 0xb6, 0xc7, 0xcf, 0xd1, 0xb5, 0xc6},
    {0xdb, 0xdc, 0xdd, 0xde, 0xdf, 0xb0, 0xb1, 0xb2},
    {0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7},
    {0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7},
    {0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef},
    {0xf0, 0xf1, 0xf2, 0xf3, 0xfe, 0xf6, 0xfd, 0xfb},
    {0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf},
    {0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfc}
};
long _stack = 10000;		/* my Load-And-Stay Resident stack size */
UBYTE *_procname = "Prism";	/* my proceedure name */
long _priority = 0;		/* A regular priority */
long _BackGroundIO = 0;		/* If this != 0, I can Write() to CLI but
				   I must Close(_Backstdout) when done */
extern BPTR _Backstdout;	/* CLI file handle */

struct IntuiText GeneralText =
{
    1,0,        /* FrontPen, BackPen */
    JAM2,       /* DrawMode */
    0,0,        /* LeftEdge, TopEdge */
    &WorkFont,  /* Font */
    Buffer,
    NULL
};
