Index: include/ascii.h
===================================================================
--- include/ascii.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/ascii.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,47 @@
+/*
+   ==========================================================================
+	ascii.h -- Standard ASCII character definitions
+	Version 5 -- 1987-06-03 -- D.N. Lynx Crowe
+   ==========================================================================
+*/
+
+#define	A_NUL	0x00	/* ^@ */
+#define	A_SOH	0x01	/* ^A */
+#define	A_STX	0x02	/* ^B */
+#define	A_ETX	0x03	/* ^C */
+#define	A_EOT	0x04	/* ^D */
+#define	A_ENQ	0x05	/* ^E */
+#define	A_ACK	0x06	/* ^F */
+#define	A_BEL	0x07	/* ^G */
+#define	A_BS	0x08	/* ^H */
+#define	A_HT	0x09	/* ^I */
+#define	A_LF	0x0A	/* ^J */
+#define	A_VT	0x0B	/* ^K */
+#define	A_FF	0x0C	/* ^L */
+#define	A_CR	0x0D	/* ^M */
+#define	A_SO	0x0E	/* ^N */
+#define	A_SI	0x0F	/* ^O */
+
+#define	A_DLE	0x10	/* ^P */
+#define	A_DC1	0x11	/* ^Q */
+#define	A_DC2	0x12	/* ^R */
+#define	A_DC3	0x13	/* ^S */
+#define	A_DC4	0x14	/* ^T */
+#define	A_NAK	0x15	/* ^U */
+#define	A_SYN	0x16	/* ^V */
+#define	A_ETB	0x17	/* ^W */
+#define	A_CAN	0x18	/* ^X */
+#define	A_EM	0x19	/* ^Y */
+#define	A_SUB	0x1A	/* ^Z */
+#define	A_ESC	0x1B	/* ^[ */
+#define	A_FS	0x1C	/* ^\ */
+#define	A_GS	0x1D	/* ^] */
+#define	A_RS	0x1E	/* ^^ */
+#define	A_US	0x1F	/* ^_ */
+
+#define	A_DEL	0x7F	/* DEL */
+
+#define	A_XON	0x11	/* DC1 = old ASCII XON */
+#define	A_XOFF	0x13	/* DC3 = old ASCII XOFF */
+
+#define	CTL(x)	(x - '@')
Index: include/biosdefs.h
===================================================================
--- include/biosdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/biosdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,204 @@
+/*
+   ============================================================================
+	biosdefs.h -- Buchla 700 BIOS and XBIOS definitions
+	Version 22 -- 1988-04-11 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+extern	long	trap13();	/* BIOS linkage */
+extern	long	trap14();	/* XBIOS linkage */
+
+#define	BIOS	trap13
+#define	XBIOS	trap14
+
+/* BIOS functions */
+
+/* function 0 unused (getmpb) */
+
+#define	B_RDAV	1
+#define	B_GETC	2
+#define	B_PUTC	3
+#define	B_RDWR	4
+#define	B_SETV	5
+
+/* function 6 unused (tickcal) */
+
+#define	B_GBPB	7
+#define	B_THRE	8
+#define	B_MCHG	9
+#define	B_DMAP	10
+
+/* function 11 unused (shift) */
+
+/* XBIOS functions */
+
+#define	X_PIOREC	0
+#define	X_SETPRT	1
+#define	X_FLOPRD	2
+#define	X_FLOPWR	3
+#define	X_FORMAT	4
+#define	X_VERIFY	5
+#define	X_PRBOOT	6
+#define	X_RANDOM	7
+#define	X_ANALOG	8
+#define	X_CLRAFI	9
+#define	X_APICHK	10
+#define	X_MTDEFS	11
+
+/* device unit numbers */
+
+#define	PRT_DEV	0
+#define	AUX_DEV	1
+#define	CON_DEV	2
+#define	MC1_DEV	3
+#define	MC2_DEV	4
+
+/* 
+ */
+/*
+   ============================================================================
+	bpb -- BIOS parameter block
+   ============================================================================
+*/
+
+
+struct bpb {			/* BIOS parameter block returned by B_GBPB */
+
+	unsigned short	recsiz;		/* physical sector size in bytes */
+	unsigned short	clsiz;		/* cluster size in sectors */
+	unsigned short	clsizb;		/* cluster size in bytes */
+	unsigned short	rdlen;		/* root directory length in sectors */
+	unsigned short	fsiz;		/* FAT size in sectors */
+	unsigned short	fatrec;		/* sector number of 1st sector of 2nd FAT */
+	unsigned short	datrec;		/* sector number of 1st data sector */
+	unsigned short	numcl;		/* number of data clusters on disk */
+	unsigned short	bflags;		/* flags */
+	unsigned short	ntracks;	/* number of tracks */
+	unsigned short	nsides;		/* number of sides (heads) */
+	unsigned short	dspc;		/* sectors per cylinder */
+	unsigned short	dspt;		/* sectors per track */
+	unsigned short	hidden;		/* number of hidden files */
+	char	serno[3];		/* disk serial number */
+	char	nada;			/* --- filler - nothing here --- */
+};
+
+#define	BPBSIZE	32		/* length of a BPB */
+
+#define	B_FAT16	0x0001		/* flag for using 16 bit FAT entries */
+
+/* 
+
+*/
+
+/*
+   ============================================================================
+	dirent -- Directory entry
+   ============================================================================
+*/
+
+struct dirent {			/* Directory entry */
+
+	char	fname[8];		/* file name */
+	char	fext[3];		/* file extension */
+	char	atrib;			/* attribute byte */
+	char	unused[10];		/* unused space */
+	unsigned short	crtime;		/* 'LLHH' creation time */
+	unsigned short	crdate;		/* 'LLHH' creation date */
+	unsigned short	bclust;		/* 'LLHH' starting cluster number */
+	long	flen;			/* 'LLHH' file length */
+};
+
+#define	DENTSIZE	(sizeof (struct dirent))
+
+#define	F_RDONLY	0x01	/* Read only file */
+#define	F_HIDDEN	0x02	/* Hidden file */
+#define	F_SYSTEM	0x04	/* System file */
+#define	F_VOLUME	0x08	/* Volume label */
+#define	F_SUBDIR	0x10	/* Sub-directory */
+#define	F_ARCHIV	0x20	/* Archived */
+
+/* 
+
+*/
+
+/*
+   ============================================================================
+	fcb -- File Control Block
+   ============================================================================
+*/
+
+struct	fcb {			/* file control block */
+
+	struct	dirent	de;	/* directory entry image for file */
+	unsigned short	modefl;	/* fcb flags */
+	unsigned short	clsec;	/* current sector in cluster */
+	unsigned short	curcls;	/* current cluster */
+	unsigned short	offset;	/* current offset into sector */
+	long	curlsn;		/* current logical sector number in file */
+	long	curdsn;		/* current logical sector number on disk */
+	long	curlen;		/* current file length in bytes */
+	long	asects;		/* allocated file length in sectors */
+};
+
+#define	FC_EOF	0x8000		/* end of file */
+#define	FC_BAD	0x4000		/* bad FAT entry encountered */
+#define	FC_ERR	0x2000		/* error encountered */
+#define	FC_OPN	0x1000		/* file open */
+
+#define	FC_CR	0x0800		/* create mode */
+#define	FC_AP	0x0400		/* append mode */
+#define	FC_WR	0x0200		/* write mode */
+#define	FC_RD	0x0100		/* read mode */
+
+#define	FC_EX	0x0080		/* exclusive mode */
+#define	FC_TR	0x0040		/* truncate mode */
+#define	FC_NB	0x0020		/* non-blocking mode */
+#define	FC_BF	0x0010		/* binary file mode */
+
+#define	FC_RW	(FC_RD | FC_WR)	/* read-write mode */
+
+/* 
+ */
+
+/*
+   ============================================================================
+    BIOS and XBIOS function call formats
+    ------------------------------------
+
+	In the list below, .W and .L refer to the size of the parameter
+	passed to the BIOS/XBIOS routine.
+
+	The first parameter is always the function code, "code.W".
+
+   BIOS calls are:
+   ---------------
+
+	BIOS(B_RDAV, unit.W);
+	BIOS(B_GETC, unit.W);
+	BIOS(B_PUTC, unit.W, c.W);
+	BIOS(B_RDWR, rwflag.W, buf.L, count.W, recno.W, dev.W);
+	BIOS(B_SETV, vecnum.W, vecadr.L);
+	BIOS(B_GBPB, dev.W);
+	BIOS(B_THRE, unit.W);
+	BIOS(B_MCHG, unit.W);
+	BIOS(B_DMAP);
+
+   XBIOS calls are:
+   ----------------
+
+	XBIOS(X_PIOREC, unit.W)
+	XBIOS(X_SETPRT, unit.W, mode.W, baud.W, cfr0.W, cr1.W)
+	XBIOS(X_FLOPRD, buf.L, filler.L, dev.W, sector.W, track.W,
+		side.W, count.W)
+	XBIOS(X_FLOPWR, buf.L, filler.L, dev.W, sector.W, track.W,
+		side.W, count.W)
+	XBIOS(X_FORMAT, buf.L, filler.L, dev.W, spt.W, track.W, side.W,
+		intrlv.W, magic.L, virgin.W)
+	XBIOS(X_VERIFY, buf.L, filler.L, dev.W, sector.W, track.W,
+		side.W, count.W)
+	XBIOS(X_PRBOOT, buf.L, serial.L, type.W, execflag.W)
+	XBIOS(X_RANDOM)
+	XBIOS(X_ANALOG)
+	XBIOS(X_CLRAFI)
+   ============================================================================
+*/
Index: include/ctype.h
===================================================================
--- include/ctype.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/ctype.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,137 @@
+/*
+   ============================================================================
+	ctype.h -- extended character macros, ala' Unix(tm)
+	Version 8 -- 1987-06-16 -- D.N. Lynx Crowe
+
+	These macros are a superset of those provided for System 5 Unix(tm).
+
+	This set of macros will return status for characters 0x80..0xFF as
+	though they were in the range 0x00..0x7F for compatibility with
+	the equivalent Lattice C macros.  This means that isascii(c) should
+	be used if it is necessary to restrict the results to true ASCII.
+
+	If SYS5CODE is TRUE these macros will use the same table definitions
+	as System 5 Unix(tm).  In this case these behave well even when fed
+	an EOF.  The EOF character value, -1, is not defined as being in any
+	of the classes tested for.  If SYS5CODE is FALSE, the Alcyon table
+	will be used, and EOF will not work properly.
+
+	Define _CTYPE_C for compiling the ctype.c file, undefine otherwise.
+
+	The symbol _ii_ is defined to be the base of the table used.
+
+		isascii(c)  non-zero if c is ASCII
+
+		isprint(c)  non-zero if c is printable (including blank)
+		isgraph(c)  non-zero if c is graphic (excluding blank)
+		iscntrl(c)  non-zero if c is control character
+
+		isalpha(c)  non-zero if c is alpha
+		isupper(c)  non-zero if c is upper case
+		islower(c)  non-zero if c is lower case
+
+		isdigit(c)  non-zero if c is a digit (0 to 9)
+		isxdigit(c) non-zero if c is a hexadecimal digit (0 to 9, A to F, a to f)
+
+		isalnum(c)  non-zero if c is alpha or digit
+
+		isspace(c)  non-zero if c is white space
+		ispunct(c)  non-zero if c is punctuation
+
+		iscsym(c)   non-zero if valid character for C symbols
+		iscsymf(c)  non-zero if valid first character for C symbols
+
+		toascii(c)  returns c masked to 7 bits
+
+		_tolower(c) returns the lower case version of c
+		_toupper(c) returns the upper case version of c
+
+		tonumber(c) converts c from ASCII to integer
+   ============================================================================
+*/
+
+/* 
+
+*/
+
+#define	SYS5CODE	0	/* define non-zero for System 5 / Aztec C */
+
+#if	SYS5CODE
+
+#define	_ii_	_ctype+1
+
+/* System 5 Unix(tm) / Aztec C table definitions */
+
+#define _U	0x01	/* upper case */
+#define _L	0x02	/* lower case */
+#define _N	0x04	/* numeric 0..9 */
+#define _S	0x08	/* whitespace */
+#define	_P	0x10	/* punctuation */
+#define	_C	0x20	/* control 00..1F */
+#define _B	0x40	/* blank */
+#define _X	0x80	/* hex digit */
+
+#else
+
+#define	_ii_	__atab
+
+/* Digital Research / Alcyon C table definitions */
+
+#define	_C	0x01	/* control 00.1F */
+#define	_P	0x02	/* punctuation */
+#define	_N	0x04	/* numeric 0..9 */
+#define	_U	0x08	/* upper case */
+#define	_L	0x10	/* lower case */
+#define	_S	0x20	/* whitespace */
+#define	_B	0x40	/* blank */
+#define	_X	0x80	/* hex digit */
+
+#endif
+
+#ifndef	_CTYPE_C
+
+#if	SYS5CODE
+
+extern	char _ctype[];		/* character type table */
+
+#else	/* SYS5CODE */
+
+extern	char ___atab();		/* so the loader sees us ... */
+extern	char __atab[];		/* character type table */
+
+#endif	/* SYS5CODE */
+
+#endif	/* _CTYPE_C */
+
+/* 
+
+*/
+
+#define	isascii(c)	(!((c)&~0x7F))
+
+#define	isprint(c)	((_ii_)[c]&(_P|_U|_L|_N|_B))
+#define	isgraph(c)	((_ii_)[c]&(_P|_U|_L|_N))
+#define	iscntrl(c)	((_ii_)[c]&_C)
+
+#define	isalpha(c)	((_ii_)[c]&(_U|_L))
+#define	isupper(c)	((_ii_)[c]&_U)
+#define	islower(c)	((_ii_)[c]&_L)
+
+#define	isdigit(c)	((_ii_)[c]&_N)
+#define	isxdigit(c)	((_ii_)[c]&_X)
+
+#define	isalnum(c)	((_ii_)[c]&(_U|_L|_N))
+
+#define	isspace(c)	((_ii_)[c]&_S)
+#define	ispunct(c)	((_ii_)[c]&_P)
+
+#define	iscsym(c)	(isalnum(c)||(((c)&127)==0x5F))
+#define	iscsymf(c)	(isalpha(c)||(((c)&127)==0x5F))
+
+#define	toascii(c)	((c)&0x7F)
+
+#define _toupper(c)	((c)-'a'+'A')
+#define _tolower(c)	((c)-'A'+'a')
+
+#define	tonumber(c)	((((c)&0x7F)>'9')?((islower(c)?_toupper(c):c)-'A'+10):(c&0x0F))
+
Index: include/errdefs.h
===================================================================
--- include/errdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/errdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,24 @@
+/*
+   ============================================================================
+	errdefs.h -- Buchla 700 BIOS error codes
+	Version 1 -- 1987-02-04 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+#define	ERR01	-1L	/* All purpose general error code */
+#define	ERR02	-2L	/* Drive not ready */
+#define	ERR03	-3L	/* Unknown command */
+#define	ERR04	-4L	/* CRC error */
+#define	ERR05	-5L	/* Invalid request */
+#define	ERR06	-6L	/* Seek error */
+#define	ERR07	-7L	/* Unknown media */
+#define	ERR08	-8L	/* Sector not found */
+#define	ERR09	-9L	/* End of media or out of paper */
+#define	ERR10	-10L	/* Write fault */
+#define	ERR11	-11L	/* Read fault */
+#define	ERR12	-12L	/* General mishap */
+#define	ERR13	-13L	/* Write protected */
+#define	ERR14	-14L	/* Media change */
+#define	ERR15	-15L	/* Unknown device */
+#define	ERR16	-16L	/* Bad sectors */
+#define	ERR17	-17L	/* Insert disk */
Index: include/errno.h
===================================================================
--- include/errno.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/errno.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,55 @@
+
+/*
+   ============================================================================
+	errno.h - Standard C library error codes
+	Version 2 -- 1987-03-06 -- D.N. Lynx Crowe
+   ============================================================================
+ */
+
+extern	int	errno;
+
+#define EPERM	1
+#define ENOENT	2
+#define ESRCH	3
+#define EINTR	4
+#define EIO	5
+#define ENXIO	6
+#define E2BIG	7
+#define ENOEXEC	8
+#define EBADF	9
+#define ECHILD	10
+#define EAGAIN	11
+#define ENOMEM	12
+#define EACCES	13
+#define EFAULT	14
+#define ENOTBLK	15
+#define EBUSY	16
+#define EEXIST	17
+#define EXDEV	18
+#define ENODEV	19
+#define ENOTDIR	20
+#define EISDIR	21
+#define EINVAL	22
+#define ENFILE	23
+#define EMFILE	24
+#define ENOTTY	25
+#define ETXTBSY	26
+#define EFBIG	27
+#define ENOSPC	28
+#define ESPIPE	29
+#define EROFS	30
+#define EMLINK	31
+#define EPIPE	32
+
+/* math software */
+
+#define EDOM	33
+#define ERANGE	34
+
+/* hereafter is available for specials */
+
+#define ENODSPC	35
+#define ERENAME	36
+
+/* ***** end of errno.h ***** */
+
Index: include/fcntl.h
===================================================================
--- include/fcntl.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/fcntl.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,44 @@
+/*
+   =============================================================================
+	fcntl.h -- file control function header
+	Version 3 -- 1987-06-26 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+/*
+   =============================================================================
+	The following symbols are used with open(), creat() and fcntl().
+	The first 3 can only be set by open().
+   =============================================================================
+*/
+
+#ifndef	O_RDONLY	/* only define these once */
+
+#define	O_RDONLY	0x0000	/* Read-only value  */
+#define	O_WRONLY	0x0001	/* Write-only value */
+#define	O_RDWR		0x0002	/* Read-write value */
+
+#define O_NDELAY	0x0004	/* Non-blocking I/O flag */
+#define O_APPEND	0x0008	/* Append mode flag (write only at end) */
+
+#define O_CREAT		0x0100	/* File creation flag (uses 3rd argument) */
+#define O_TRUNC		0x0200	/* File truncation flag */
+#define O_EXCL		0x0400	/* Exclusive access flag */
+
+#define	O_RAW		0x8000	/* Raw (binary) I/O flag for getc and putc */
+
+#endif
+
+/*
+   =============================================================================
+	The following symbols define requests used with the fcntl() function.
+   =============================================================================
+*/
+
+#define	F_DUPFD	0	/* Duplicate file descriptor */
+
+#define	F_GETFD	1	/* Get file descriptor flags */
+#define	F_SETFD	2	/* Set file descriptor flags */
+
+#define	F_GETFL	3	/* Get file flags */
+#define	F_SETFL	4	/* Set file flags */
Index: include/fspars.h
===================================================================
--- include/fspars.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/fspars.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,28 @@
+/*
+   =============================================================================
+	fspars.h -- File system parameters
+	Version 4 -- 1987-12-15 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+#ifndef	NSTREAMS		/* ony define these once */
+
+#define	TBUFFER		1	/* non-zero to enable track buffering */
+
+#define	NSTREAMS	11	/* maximum number of file streams */
+#define MAXCHAN		11	/* maximum number of I/O channel fd's */
+#define MAXDFILE	8	/* maximum number of open DISK files */
+
+#define	BUFSIZL	256				/* buffer length -- longs */
+#define BUFSIZ	(sizeof (long) * BUFSIZL)	/* buffer length -- chars */
+
+#define	BPSEC		512	/* bytes per disk sector */
+#define	FILESHFT	9	/* file shift */
+
+#define	MAXFAT		7	/* maximum number of fat sectors */
+#define	WDPSEC		256	/* words per sector */
+#define	MAXDIRNT	224	/* maximum number of directory entries */
+
+typedef	char	*io_arg;	/* must be big enough to contain a pointer */
+
+#endif
Index: include/glcdefs.h
===================================================================
--- include/glcdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/glcdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,37 @@
+/*
+   =============================================================================
+	glcdefs.h -- definitions for the Epson GLC
+	Version 4 -- 1988-08-03 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+#define	G_INIT		(char)0x40
+#define	G_MWRITE	(char)0x42
+#define	G_MREAD		(char)0x43
+#define	G_SETSAD	(char)0x44
+#define	G_CRSWR		(char)0x46
+#define	G_CRSRD		(char)0x47
+#define	G_CRSMRT	(char)0x4C
+#define	G_CRSMLT	(char)0x4D
+#define	G_CRSMUP	(char)0x4E
+#define	G_CRSMDN	(char)0x4F
+#define	G_ERASE		(char)0x52
+#define	G_SLEEP		(char)0x53
+#define	G_DSPCTL	(char)0x58
+#define	G_HSCRL		(char)0x5A
+#define	G_OVRLAY	(char)0x5B
+#define	G_CGRAM		(char)0x5C
+#define	G_CRSFRM	(char)0x5D
+
+#define	LCD_WC		lcd_a1
+#define	LCD_RS		lcd_a0
+#define	LCD_WD		lcd_a0
+#define	LCD_RD		lcd_a1
+
+#define	G_PLANE1	(unsigned)0x0000
+#define	G_PLANE2	(unsigned)0x2000
+
+#define	G_OFF		0		/* off */
+#define	G_ON		1		/* on */
+#define	G_B2		2		/* blink - FR/32 */
+#define	G_B1		3		/* blink - FR/64 */
Index: include/graphdef.h
===================================================================
--- include/graphdef.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/graphdef.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,43 @@
+/*
+   ===========================================================================
+	graphdef.h -- graphics primitives package header
+	Version 6 -- 1987-05-27 -- D.N. Lynx Crowe
+	Setup for the Buchla 700 and the Matra-Harris 82716 VSDD
+	Copyright 1985,1976,1987 -- D.N. Lynx Crowe
+   ===========================================================================
+*/
+
+#define CLR 0
+#define SET 1
+
+#define XPIX	512
+#define YPIX	350
+
+#define XCTR	XPIX/2
+#define YCTR	YPIX/2
+
+#define XMAX	XPIX-1
+#define YMAX	YPIX-1
+
+#define	P_BLK	0		/* colors for external PROM color table */
+#define	P_DKGRY	1
+#define	P_DKBLU	2
+#define	P_LTBLU	3
+#define	P_DKGRN	4
+#define	P_LTGRN	5
+#define	P_DKCYN	6
+#define	P_LTCYN	7
+#define	P_RED	8
+#define	P_ORG	9
+#define	P_PUR	10
+#define	P_MGN	11
+#define	P_BRN	12
+#define	P_YEL	13
+#define	P_LTGRY	14
+#define	P_WHT	15
+
+#define	DEFCBGND	P_DKBLU
+#define	DEFCFGND	P_WHT
+
+#define	DEFPBGND	P_BLK
+#define	DEFPFGND	P_DKGRY
Index: include/hwdefs.h
===================================================================
--- include/hwdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/hwdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,32 @@
+/*
+   ============================================================================
+	hwdefs.h -- Buchla 700 I/O addresses defined in hwdefs.s
+	Version 12 -- 1988-08-15 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+/* hardware addresses */
+
+extern	char	io_time[], io_lcd, io_ser, io_midi;
+extern	char	io_disk, io_tone, io_leds, io_kbrd;
+extern	char	lcd_a0, lcd_a1;
+
+extern	unsigned	io_vreg[], io_vraw[], io_vram[], io_fpu[];
+
+
+/* video memory allocations */
+
+extern	unsigned	v_regs[], v_odtab[][4], v_actab[];
+extern	unsigned	v_ct0[], v_gt1[], v_score[], v_cgtab[];
+
+extern	unsigned	v_curs0[], v_curs1[], v_curs2[], v_curs3[];
+extern	unsigned	v_curs4[], v_curs5[], v_curs6[], v_curs7[];
+extern	unsigned	v_tcur[], v_kbobj[], v_lnobj[];
+extern	unsigned	v_win0[], v_cur[];
+
+
+/* stuff in the depths of the bios */
+
+extern	short	fc_sw;
+
+extern	long	fc_val;
Index: include/io.h
===================================================================
--- include/io.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/io.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,41 @@
+/*
+   ============================================================================
+	io.h -- Buchla 700 I/O library definitions
+	Version 12 -- 1987-09-25 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+#include "fspars.h"		/* file system parameters */
+
+struct channel {		/* channel table entry */
+
+	char	c_read;		/* read routine index */
+	char	c_write;	/* write routine index */
+	char	c_ioctl;	/* ioctl routine index */
+	char	c_seek;		/* seek routine index */
+	int	(*c_close)();	/* close function pointer */
+	io_arg	c_arg;		/* argument to channel driver */
+};
+
+struct device {			/* device control structure */
+
+	char	d_read;		/* read routine code */
+	char	d_write;	/* write routine code */
+	char	d_ioctl;	/* ioctl routine code */
+	char	d_seek;		/* seek routine code */
+	int	(*d_open)();	/* special open function */
+};
+
+struct devtabl {		/* device table entry */
+
+	char	*d_name;	/* device name */
+	struct	device	*d_dev;	/* pointer to device structure */
+	io_arg	d_arg;		/* argument to device driver */
+};
+
+#ifndef	_FS_DEF_
+
+extern	struct channel chantab[MAXCHAN];	/* defined in fsinit.c */
+extern	char	Wrkbuf[BPSEC];			/* defined in fsinit.c */
+
+#endif
Index: include/memory.h
===================================================================
--- include/memory.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/memory.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,9 @@
+/*
+   ============================================================================
+	memory.h -- header for memory functions
+	Version 3 -- 1987-04-06 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+extern	char	*memccpy(), *memchr(), *memcpy(), *memset();
+extern	int	memcmp(), *memsetw(), *memcpyw(), memcmpu();
Index: include/objdefs.h
===================================================================
--- include/objdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/objdefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,40 @@
+/*
+   ============================================================================
+	objdefs.h -- Object file format for as68  (Atari 1040ST TOS objects)
+	Version 7 -- 1987-12-30 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+struct EXFILE {			/* executable file header */
+
+	unsigned	F_Magic;	/* File type magic */
+	long		F_Text;		/* SIze of text segment */
+	long		F_Data;		/* Size of data segment */
+	long		F_BSS;		/* Size of BSS segment */
+	long		F_Symtab;	/* Size of symbol table */
+	long		F_Res1;		/* Reserved area #1 */
+	long		F_Res2;		/* Reserved area #2 -- text origin */
+	unsigned	F_Res3;		/* Reserved area #3 -- flag word */
+
+					/* data origin - long */
+					/* bss origin - long */
+};
+
+#define	F_R_C	0x601A		/* Magic for contiguous file */
+#define	F_R_D	0x601B		/* Magic for discontiguous file */
+
+struct SYMBOL {			/* Symbol table entry -- 14 bytes */
+
+	char		symname[8];	/* Symbol name  (LJZF) */
+	unsigned	symtype;	/* Symbol type flags */
+	long		symvalue;	/* Symbol value */
+};
+
+#define	S_Def	0x8000		/* Defined */
+#define	S_Equ	0x4000		/* Equated */
+#define	S_Glb	0x2000		/* Global */
+#define	S_Reg	0x1000		/* Equated register */
+#define	S_Ext	0x0800		/* External reference */
+#define	S_Data	0x0400		/* Data based relocatable */
+#define	S_Text	0x0200		/* Text based relocatable */
+#define	S_BSS	0x0100		/* BSS based relocatable */
Index: include/portab.h
===================================================================
--- include/portab.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/portab.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,56 @@
+/*
+   =============================================================================
+	portab.h -- Pointless redefinitions of C syntax.
+	Version 1 -- 1985-01-01 -- Atari
+	Copyright 1985 Atari Corp.
+
+	WARNING: Use of this file may make your code incompatible with
+		 C compilers throughout the civilized world.
+   =============================================================================
+*/
+
+#define mc68k 0
+
+#define UCHARA 1				/* if char is unsigned     */
+
+/*
+ *	Standard type definitions
+ */
+
+#define	BYTE	char				/* Signed byte		   */
+#define BOOLEAN	int				/* 2 valued (true/false)   */
+#define	WORD	int  				/* Signed word (16 bits)   */
+#define	UWORD	unsigned int			/* unsigned word	   */
+
+#define	LONG	long				/* signed long (32 bits)   */
+#define	ULONG	long				/* Unsigned long	   */
+
+#define	REG	register			/* register variable	   */
+#define	LOCAL	auto				/* Local var on 68000	   */
+#define	EXTERN	extern				/* External variable	   */
+#define	MLOCAL	static				/* Local to module	   */
+#define	GLOBAL	/**/				/* Global variable	   */
+#define	VOID	/**/				/* Void function return	   */
+#define	DEFAULT	int				/* Default size		   */
+
+#ifdef UCHARA
+#define UBYTE	char				/* Unsigned byte 	   */
+#else
+#define	UBYTE	unsigned char			/* Unsigned byte	   */
+#endif
+
+/****************************************************************************/
+/*	Miscellaneous Definitions:					    */
+/****************************************************************************/
+
+#define	FAILURE	(-1)			/*	Function failure return val */
+#define SUCCESS	(0)			/*	Function success return val */
+#define	YES	1			/*	"TRUE"			    */
+#define	NO	0			/*	"FALSE"			    */
+#define	FOREVER	for(;;)			/*	Infinite loop declaration   */
+#define	NULL	0			/*	Null pointer value	    */
+#define NULLPTR (char *) 0		/*				    */
+#define	EOF	(-1)			/*	EOF Value		    */
+#define	TRUE	(1)			/*	Function TRUE  value	    */
+#define	FALSE	(0)			/*	Function FALSE value	    */
+
Index: include/rawio.h
===================================================================
--- include/rawio.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/rawio.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,12 @@
+/*
+   ============================================================================
+	rawio.h -- header for raw BIOS I/O
+	Version 2 -- 1987-02-20 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+int	getln(), getrln(), readln();
+
+/* The following should really be void ... */
+
+int	writeln();
Index: include/regs.h
===================================================================
--- include/regs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/regs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,20 @@
+/*
+   ============================================================================
+	regs.h -- register structure for Buchla 700 ROMP debug facility
+	Version 6 -- 1987-06-15 -- D.N. Lynx Crowe
+	(c) Copyright 1987 -- D.N. Lynx Crowe
+
+	Defines the registers saved on the stack when a breakpoint occurs.
+   ============================================================================
+*/
+
+struct regs {
+
+	long	d_reg[8];		/* Data registers d0..d7 */
+
+	char	*a_reg[8];		/* Address registers */
+
+	unsigned short	reg_fill,	/* Filler to keep long alignment */
+			reg_sr,		/* Status register */
+			*reg_pc;	/* Program counter */
+};
Index: include/setjmp.h
===================================================================
--- include/setjmp.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/setjmp.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,38 @@
+/*
+   =============================================================================
+	setjmp.h -- header for setjmp() and longjmp() functions
+	Version 1 -- 1987-06-11 -- D.N. Lynx Crowe
+
+	Registers a0 and d0 are assumed to be scratch registers,
+	and are not saved by these functions.
+
+	Register d0 is usually used as the return value register.
+	Exception:  Motorola C uses a0 for the return value if it's a pointer.
+
+	This is true of most C compilers for the 68000, including:
+	Digital Research / Alcyon, Lattice, Aztec / Manx, Greenhills, Motorola.
+   =============================================================================
+*/
+
+struct	JMP_BUF {	/* setjmp() / longjmp() environment structure */
+
+	long	jmpret;		/* return address */
+
+	long	jmp_d1;		/* data registers */
+	long	jmp_d2;
+	long	jmp_d3;
+	long	jmp_d4;
+	long	jmp_d5;
+	long	jmp_d6;
+	long	jmp_d7;
+
+	long	jmp_a1;		/* address registers */
+	long	jmp_a2;
+	long	jmp_a3;
+	long	jmp_a4;
+	long	jmp_a5;
+	long	jmp_a6;
+	long	jmp_a7;
+};
+
+typedef struct JMP_BUF jmp_buf;
Index: include/stddefs.h
===================================================================
--- include/stddefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/stddefs.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,100 @@
+/*
+   ============================================================================
+	stddefs.h -- Standard definitions for C programs
+	Version 12 -- 1987-12-15 -- D.N. Lynx Crowe
+
+	Must follow stdio.h if stdio.h is used as both define:
+
+		NULL, EOF.
+
+	Must follow define.h on the Atari if define.h is used as both define:
+
+		NULL, EOF, FOREVER, TRUE, FALSE, FAILURE, SUCCESS,
+		YES, NO, EOS, NIL.
+
+	Released to Public Domain - 1987-06 - D.N. Lynx Crowe
+   ============================================================================
+*/
+
+#ifndef	STD_DEFS		/* so we only define these once */
+
+#define	STD_DEFS	1
+
+/* relational operators */
+
+#define	EQ	==
+#define	NE	!=
+#define	GE	>=
+#define	LE	<=
+#define	GT	>
+#define	LT	<
+
+/* logical operators */
+
+#define	NOT	!
+#define	AND	&&
+#define	OR	||
+
+/* infinite loop constructs */
+
+#ifndef	FOREVER
+#define	FOREVER		for(;;)
+#endif
+
+#ifndef	REPEAT
+#define	REPEAT		for(;;)
+#endif
+
+/* 
+
+*/
+
+/* various terminators */
+
+#ifndef	EOF
+#define	EOF		(-1)
+#endif
+
+#ifndef	EOS
+#define	EOS		'\0'
+#endif
+
+#ifndef	NIL
+#define	NIL		0
+#endif
+
+/* manifest constants for function return and flag values */
+
+#ifndef	NULL
+#define	NULL		0
+#endif
+
+#ifndef	YES
+#define	YES		1
+#endif
+
+#ifndef	NO
+#define	NO		0
+#endif
+
+#ifndef	FALSE
+#define	FALSE		0
+#endif
+
+#ifndef	TRUE
+#define	TRUE		1
+#endif
+
+#ifndef	SUCCESS
+#define	SUCCESS		0
+#endif
+
+#ifndef	FAILURE
+#define	FAILURE		(-1)
+#endif
+
+/* BOOL type definition for flag variables */
+
+typedef	char	BOOL;
+
+#endif
Index: include/stdio.h
===================================================================
--- include/stdio.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/stdio.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,73 @@
+/*
+   =============================================================================
+	stdio.h -- Standard I/O Package header for the Buchla 700
+	Version 6 -- 1987-10-20 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+#include "fspars.h"		/* file system parameters */
+
+#define NULL	0
+#define EOF	-1
+
+#define	fgetc	getc
+#define	fputc	putc
+
+#define	_BUSY	0x01
+#define	_ALLBUF	0x02
+#define	_DIRTY	0x04
+#define	_EOF	0x08
+#define	_IOERR	0x10
+
+typedef struct {
+
+	char	*_bp;		/* current position in buffer */
+	char	*_bend;		/* last character in buffer + 1 */
+	char	*_buff;		/* address of buffer */
+	char	_flags;		/* {_BUSY, _ALLBUF, _DIRTY, _EOF, _IOERR} */
+	char	_unit;		/* fd token returned by open */
+	char	_bytbuf;	/* single byte buffer for unbuffered streams */
+	char	_pad;		/* pad for alignment -- possibly use later */
+	int	_buflen;	/* length of buffer */
+
+} FILE;
+
+#ifndef	_FS_DEF_
+
+extern	FILE	Cbuffs[NSTREAMS];		/* table of FILE structures */
+extern	char	*Stdbufs;			/* free list of buffers */
+extern	long	Stdbuf[MAXDFILE][BUFSIZL];	/* buffers */
+
+#endif
+
+extern	long	ftell();
+extern	char	*gets(), *fgets();
+extern	FILE	*fopen(), *fopena(), *fopenb();
+
+#define	stdin	(&Cbuffs[0])
+#define	stdout	(&Cbuffs[1])
+#define	stderr	(&Cbuffs[2])
+
+#define	getchar()	getc(stdin)
+#define	putchar(c)	putc(c, stdout)
+#define	feof(fp)	(((fp)->_flags & _EOF) != 0)
+#define	ferror(fp)	(((fp)->_flags & _IOERR) != 0)
+#define	clearerr(fp)	((fp)->_flags &= ~(_IOERR | _EOF))
+#define	fileno(fp)	((fp)->_unit)
+
+#ifndef	O_RDONLY	/* only define these once */
+
+#define	O_RDONLY	0x0000	/* Read-only value  */
+#define	O_WRONLY	0x0001	/* Write-only value */
+#define	O_RDWR		0x0002	/* Read-write value */
+
+#define O_NDELAY	0x0004	/* Non-blocking I/O flag */
+#define O_APPEND	0x0008	/* Append mode flag (write only at end) */
+
+#define O_CREAT		0x0100	/* File creation flag (uses 3rd argument) */
+#define O_TRUNC		0x0200	/* File truncation flag */
+#define O_EXCL		0x0400	/* Exclusive access flag */
+
+#define	O_RAW		0x8000	/* Raw (binary) I/O flag for getc and putc */
+
+#endif
Index: include/strings.h
===================================================================
--- include/strings.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/strings.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,14 @@
+/*
+   ============================================================================
+	strings.h -- definitions for strnglib
+	Version 3 -- 1987-04-21 -- D.N. Lynx Crowe
+   ============================================================================
+*/
+
+extern	char	*strccpy(), *strcpy(), *strncpy(), *strcat(), *strncat();
+extern	char	*strchr(), *strrchr(), *strpbrk(), *strtok();
+extern	char	*index(), *rindex(), *str2lc(), *str2uc();
+
+extern	int	strcmp(), strlcmp(), strncmp(), strlen(), strspn(), strcspn();
+
+extern	long	strtol();
Index: include/vsdd.h
===================================================================
--- include/vsdd.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/vsdd.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,71 @@
+/*
+   =============================================================================
+	vsdd.h -- header for Matra-Harris 82716 VSDD video display functions
+	Version 10 -- 1987-05-27 -- D.N. Lynx Crowe
+	(c) Copyright 1987 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+#define	VSDD	(unsigned int *)0x200000
+
+#define	V_CHITE	12		/* Character height */
+
+/* object descriptor flags */
+
+#define	V_CBS	0x0800		/* 0 = Bit Map, 1 = Character */
+#define	V_RES0	0x0000		/* Resolution 0: char 16, bit - */
+#define	V_RES1	0x0200		/* Resolution 1: char  6, bit - */
+#define	V_RES2	0x0400		/* Resolution 2: char  8, bit 2 */
+#define	V_RES3	0x0600		/* Resolution 3: char 12, bit 4 */
+#define	V_CRS	0x0100		/* Conceal/Reveal Select */
+
+#define	V_PSE	0x0080		/* Proportional space enable */
+#define	V_FAD	0x0040		/* Full attributes select */
+#define	V_OBL	0x0020		/* Object blink */
+#define	V_BLA	0x0010		/* Object blank */
+
+#define	V_HCR	0x0008		/* High color resolution */
+#define	V_TDE	0x0004		/* Transparency detect enable */
+#define	V_DCS0	0x0000		/* Default color select 0 */
+#define	V_DCS1	0x0001		/* Default color select 1 */
+#define	V_DCS2	0x0002		/* Default color select 2 */
+#define	V_DCS3	0x0003		/* Default color select 3 */
+
+/* Preset flags for bitmap and character objects */
+
+#define	V_BTYPE	0
+#define	V_CTYPE	(V_CBS | V_RES2 | ((V_CHITE - 1) << 12))
+
+/* character attribute flags */
+
+#define	C_ALTCS	0x8000
+#define	C_TFGND	0x4000
+#define	C_TBGND	0x2000
+#define	C_WIDE	0x1000
+
+#define	C_MASK	0x0800
+#define	C_INVRT	0x0400
+#define	C_BLINK	0x0200
+#define	C_ULINE	0x0100
+
+/* 
+
+*/
+
+struct octent {			/* Object control table entry */
+
+	unsigned int	ysize,	/* Height of object in pixels */
+			xsize;	/* Width of object in pixels */
+
+	int		objx,	/* Object x location */
+			objy;	/* Object y location */
+
+	unsigned int	*obase;	/* Base of object data */
+
+	char		opri,	/* Current object priority */
+			obank;	/* Object bank 0..3 */
+
+	unsigned int	odtw0,	/* Object descriptor table word 0 */
+			odtw1;	/* Object descriptor table word 1 */
+};
+
Index: include/vsddsw.h
===================================================================
--- include/vsddsw.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/vsddsw.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,19 @@
+/*
+   =============================================================================
+	VSDDSW.H -- VSDD software support definitions
+	Version 6 -- 1987-05-27 -- D.N. Lynx Crowe
+	Copyright 1987 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+/* functions */
+
+extern	unsigned	vbank();
+extern	int	vputp(), vwputp();
+
+/* these should be voids ... */
+
+extern	int	vfwait(), vputs(), vputsa(), vputc(), VHinit();
+extern	int	objclr(), objon(), objoff();
+extern	int	vcputs(), vwputs(), vwputm(), vmput(), vmputa(), VSinit();
+extern	int	SelObj(), SetPri(), SetObj(), CpyObj();
Index: include/vsddvars.h
===================================================================
--- include/vsddvars.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
+++ include/vsddvars.h	(revision 109c83b4de0a1be1740921110e1aab18add40866)
@@ -0,0 +1,14 @@
+/*
+   =============================================================================
+	vsddvars.h -- variable definitions for the VSDD package
+	Version 1 -- 1987-04-15 -- D.N. Lynx Crowe
+	(c) Copyright 1987 -- D.N. Lynx Crowe
+   =============================================================================
+*/
+
+extern	struct	octent	v_obtab[];	/* object control table */
+
+extern	struct	octent	*v_curob;	/* working object control pointer */
+extern	int	v_nobj;			/* working object number */
+extern	int	v_obpri;		/* working object priority */
+
