//---------------------------------------------------------
//          file 'av50.h'  updated:  4.18.95
//---------------------------------------------------------
typedef unsigned int   UINT;
typedef unsigned char  UCHAR;
typedef unsigned char* BYTE;
typedef          char* STRING;
typedef unsigned long  ULONG;

# include <alloc.h>
# include <conio.h>
# include <ctype.h>
# include <direct.h>
# include <dos.h>
# include <fcntl.h>
# include <io.h>
# include <malloc.h>
# include <math.h>
# include <graphics.h>
# include <setjmp.h>
# include <stdio.h>
# include <stdarg.h>
# include <stdlib.h>
# include <string.h>
# include <float.h>
# include <time.h>
#include  <bios.h>

# define  pgm         "Program"
# define  dta         "Data"
# define  TMS         "TMS320C50"


# define KB_ESC    0x001b    // scan code: 0x11b ?

// do also the max for float, double, etc... ????
const int MAXLINE        = 100;
enum BOOLE {NO, YES};
enum INITMONITOR {GOOD,TESTERROR,NOESCAPE,NORESPONSE};
struct PARAMETER {
	   UINT  PGM_CNT;
	   UINT  EntryPoint;
	   BOOLE INVERSE;
	   UINT  com; // comport
	   ULONG speed; // Baudrate
	 };
//-----------------------------------------------------------------------
void        BaudRateDetect(void);
UCHAR       Bcrcv(int);
void        check_key(void);
void        ExePgm(void);         // eXcecute Go, Address, Single step
UINT        GetDskAdd(STRING pbuf);
UINT        GetDskData(STRING pbuf,UINT data[]);
void        InitializeMonitor(void);
void        init_graphics(void);
UINT        InitMonitor(void);
void        InitPort(void);
double      LoadDsk(void);
void        reset50(void);
void        sendbyte(UINT);
UINT        sendword(UINT);
void        setup_vals(void);
void        WaitFor(UINT);

//------------------------------------------------------------------
inline void sendcommand(const cmd,UINT startaddress,UINT length)
{  sendbyte(cmd); sendword(startaddress); sendword(length-1); }
