/* pengo.h */

#include <exec/types.h>
#include <proto/diskfont.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <proto/intuition.h>
#include <intuition/intuition.h>
#include <setjmp.h>
#include <graphics/gfxmacros.h>
#include <libraries/dos.h>
#include <exec/memory.h>

#include "pics.h"

#define POSD 0
#define POSL 1
#define POSR 2
#define POSU 3

#define MINPOS 0
#define MAXPOS 3

#define FIRST	CARLONID
#define SECOND	PIGD
#define LUPONE	LUPONED

#define ISPOS(N)	((N)>=0 && (N)<=3)
#define ISFIRST(N)	ISPOS( (N)-FIRST  )
#define ISSECOND(N)	ISPOS( (N)-SECOND )
#define ISPLAYER(N)	(ISFIRST(N) || ISSECOND(N))
#define ISLUPONE(N)	ISPOS( (N)-LUPONE )
#define PLTOPIC(PL)	( FIRST + (PL)*(SECOND-FIRST) )
#define PLTOFADE(PL)	( FADE1 + (PL)*(FADE2 -FADE1) )
#define PUTS(S)		Write(Output(),S,strlen(S))

#define DELTAX		12	/* horizontal centering */
#define DEPTH		4
#define NCOLS		(1<<DEPTH)
#define ENEMIES		4
#define TOPS		10
#define MAXEGG		20
#define MAXLEVEL	30
#define MAXLIVES	7
#define MAXNAMELEN	12
#define OPTIONS		6
#define PICSIZE		480

#define BX0	1
#define BY0	1
#define BX1	15
#define BY1	9

#define MYUNDER	1
#define MYRIGHT	2

#define INFIELD(X,Y)	(X>BX0 && X<BX1 && Y>BY0 && Y<BY1)
#define READSCREEN(X,Y)	( INFIELD(X,Y) ? screen[X][Y] : BORDER)
#define FOR(I,L,H)	for (I=(L); I<=(H); I++)
#define FORDOWN(I,H,L)	for (I=(H); I>=(L); I--)
#define IS(X,Y,SHAPE)	(screen[X][Y]==SHAPE)
#define ISNT(X,Y,SHAPE)	(screen[X][Y]!=SHAPE)
#define PRINTAT(X,Y,TX)	iprint(1,(X)*8,(Y)*8,TX,0)
#define EGGREPORT	vertreport(eggs, 0, LITEGG, BIGEGG);

#define DF_NOWAIT	1
#define DF_NOREFRESH	2
#define DF_HALF		4
#define DF_DIGIT	8
#define DF_NORECT	16

struct topitem
{
char name[MAXNAMELEN];
int score;
USHORT level;
};

extern char	strscore[], strlives[], strlevel[], streggs[], strpaused[],
		strnobody[], strhiscotab[], stranonimous[],
		strtrytobeat[], strpoints[], strextralive[],
		strgameover[], strgofornext[], demofile[], scorename[],
		iamready[], readytorecord[], strpressfire[], strnomoreroom[],
		rgbname[], picsname[], strentername[], stralreadyrw[],
		strendofdemo[], strnodemofile[], strdiskerr[],
		strcrushen[], strstunen[], str3inarow[], str2better[];

extern char	*options[], *strpl[];

extern char *picsarr;
extern int screen[BX1+3][BY1+3];
extern struct Window *w;
extern struct Screen *s;
extern struct RastPort *rp;
extern int joyx, joyy, button, lives, level, eggs, score, nextwin;
extern int players, writingdemo, trisdone, playspeed, listos;
extern int countdown, trainer, flash, players;
extern jmp_buf jmpsave;
extern int enemyx[ENEMIES+1], enemyy[ENEMIES+1], eggx[MAXEGG+1];
extern int eggy[MAXEGG+1], slp[ENEMIES+1];
extern int myx[2], myy[2], living[2], agony[2];
extern int black[4];
extern struct topitem top[TOPS+1][2];

extern int bx0[4], bx1[4], by0[4], by1[4];
extern int wininc, flashtime;
extern struct TextAttr ta, bigta, numta;
