/* definitions of the transfer routines */

int prinit (void);			/* initializes the routines */
void prclose (void);			/* closes the routines */

void output (unsigned char byte);	/* outputs a byte */
unsigned input (void);			/* inputs a byte */
unsigned wait_input (void);		/* ditto, without busy-waiting */

void send (unsigned char *buffer, unsigned length);	/* sends bytes */
void receive (unsigned char *buffer, unsigned length);	/* receives bytes */

void ascii2petscii(unsigned char *p);
void petscii2ascii(unsigned char *p);

typedef int main_t(int argc, char **argv);

extern main_t main_prload, main_prsave, main_prcart, main_prsample,
	      main_prrfile, main_prwfile, main_prdisk;

int vmain(main_t main, int argc, char *argv0, ...);

#define SLEEP_TIME 10000 /* amount of microseconds to wait in wait_input */

#ifdef MSDOS
#  define outb outportb
#  define inb inportb
#endif /* MSDOS */

#define REQ_INFO 0
#define REQ_LOAD 1
#define REQ_SAVE 2
#define REQ_JUMP 3
#define REQ_RUN  4

#ifndef DEFAULT_PORT
#  define DEFAULT_PORT 0
#endif

#ifndef TRUE
#  define TRUE (1)
#  define FALSE (0)
#endif

#ifdef __MAIN_C__
unsigned portaddr[] = {0x3BC, 0x378, 0x2BC, 0x278};
unsigned baseaddr;
#else
extern unsigned portaddr[];
extern unsigned baseaddr;
#endif /* __MAIN_C__ */
