/*****************************************************************************

			       XCopilot

This code is part of XCopilot, a port of copilot

     Portions of this code are Copyright (C) 1997 Ivan A. Curtis
		       icurtis@radlogic.com.au

The original MS-Windows95 copilot emulator was written by Greg Hewgill.
The following copyright notice appeared on the original copilot sources:

		  Copyright (c) 1996 Greg Hewgill

 MC68000 Emulation code is from Bernd Schmidt's Unix Amiga Emulator.
       The following copyright notice appeared in those files:

	  Original UAE code Copyright (c) 1995 Bernd Schmidt

This code must not be distributed without these copyright notices intact.

*******************************************************************************
*******************************************************************************

Filename:	shared.h

Description:	definition of shared image structure

Update History:   (most recent first)
   I. Curtis  26-Feb-97 15:02 -- created

******************************************************************************/

/*******************
  union flagu {
  struct {
*/
  /* v must be at the start so that the x86 seto instruction
   * changes the V flag. C must follow after V.
   */
/*
  char v;
char c;
char n;
char z;
} flags;
ULONG longflags;
};
*********************/

  typedef char flagtype; 
  
  struct regstruct {
    ULONG d[8];
    CPTR  a[8],usp;
    UWORD sr;
    flagtype t;
    flagtype s;
    flagtype x;
    flagtype v;
    flagtype c;
    flagtype n;
    flagtype z;
    flagtype stopped;
    int intmask;
    ULONG pc;
    UWORD *pc_p;
    UWORD *pc_oldp;
};

typedef struct {
  unsigned long lssa;		/* shadows dragonball LSSA register */
  int pen, pendown, penx, peny;	/* modified by lcd process */
  int key, keydown;		/* modified by lcd process */
  int kbin, kbout;		/* ring-buffer for X11 keyboard */
  char kb[8];			/* ASCII data from X11 keyboard */
  int scrnstart;		/* modified by write to LSSA */
  int run_updateisr;		/* if TRUE, must update isr */
  int quit;			/* if TRUE, must quit emulation */
  struct regstruct regs;	/* the CPU registers state */
  int ExceptionFlags[48];
  int CpuState;
  int CpuReq;
  int LcdReq;
  int LcdPower;
  int ErrNo;
} shared_img;

/*
 * Cpu States
 */
#define cpuInitial    0
#define cpuLoaded     1
#define cpuRunning    2
#define cpuStopped    3
#define cpuBreakpoint 4
#define cpuException  5

/*
 * Cpu Requests
 */
#define cpuNone    0
#define cpuReset   1
#define cpuStart   2
#define cpuStop    3
#define cpuLoadApp 4
#define cpuExit    5

/*
 * Lcd Requests
 */
#define lcdNone    0
#define lcdBell    1

/*
 * LcdPower
 */
#define lcdOn      1
#define lcdOff     0
