Index: .cproject
===================================================================
--- .cproject	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ .cproject	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -37,12 +37,5 @@
 									<listOptionValue builtIn="false" value="&quot;${workspace_loc:/buchla-68k/include}&quot;"/>
 								</option>
-								<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1679007067" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
-									<listOptionValue builtIn="false" value="int8_t=char"/>
-									<listOptionValue builtIn="false" value="&quot;uint8_t=unsigned char&quot;"/>
-									<listOptionValue builtIn="false" value="int16_t=short"/>
-									<listOptionValue builtIn="false" value="&quot;uint16_t=unsigned short&quot;"/>
-									<listOptionValue builtIn="false" value="int32_t=long"/>
-									<listOptionValue builtIn="false" value="&quot;uint32_t=unsigned long&quot;"/>
-								</option>
+								<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1679007067" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols"/>
 								<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.807901839" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
 							</tool>
Index: include/all.h
===================================================================
--- include/all.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
+++ include/all.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -0,0 +1,70 @@
+/*
+   =============================================================================
+	all.h -- top-level include file
+	Version 1 -- 2017-07-10 -- Thomas Lopatic
+   =============================================================================
+*/
+
+#pragma once
+
+/* macros and types */
+
+#include "ascii.h"
+#include "asgdsp.h"
+#include "biosdefs.h"
+#include "charset.h"
+#include "cmeta.h"
+#include "configs.h"
+#include "ctype.h"
+#include "curpak.h"
+#include "debug.h"
+#include "dfltins.h"
+#include "errdefs.h"
+#include "errno.h"
+#include "fcntl.h"
+#include "fields.h"
+#include "fpu.h"
+#include "fspars.h"
+#include "glcbars.h"
+#include "glcdefs.h"
+#include "graphdef.h"
+#include "hwdefs.h"
+#include "instdsp.h"
+#include "io.h"
+#include "knmtab.h"
+#include "lcdline.h"
+#include "libdsp.h"
+#include "macros.h"
+#include "menu.h"
+#include "midas.h"
+#include "objdefs.h"
+#include "panel.h"
+#include "patch.h"
+#include "ptdisp.h"
+#include "ptoftab.h"
+#include "ratio.h"
+#include "regs.h"
+#include "scdsp.h"
+#include "sclock.h"
+#include "score.h"
+#include "scwheel.h"
+#include "secops.h"
+#include "setjmp.h"
+#include "slice.h"
+#include "smdefs.h"
+#include "stdarg.h"
+#include "stddefs.h"
+#include "stdint.h"
+#include "stdio.h"
+#include "swrtab.h"
+#include "timers.h"
+#include "tundsp.h"
+#include "uartio.h"
+#include "vsdd.h"
+#include "wdcurtb.h"
+#include "wordq.h"
+#include "wsdsp.h"
+
+/* global variable and function declarations */
+
+#include "glob.h"
Index: include/ascii.h
===================================================================
--- include/ascii.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/ascii.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    ==========================================================================
 */
+
+#pragma once
 
 #define	A_NUL	0x00	/* ^@ */
Index: include/asgdsp.h
===================================================================
--- include/asgdsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/asgdsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,8 +3,9 @@
 	asgdsp.h -- assignment editor common parameter header file
 	Version 8 -- 1988-04-18 -- D.N. Lynx Crowe
-
-	Uses definitions from:  "graphdef.h", "midas.h", "vsdd.h"
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct	asgent	{	/* assignment table library entry structure */
@@ -32,5 +33,5 @@
 #define	ASGPRI		8		/* display object priority */
 
-#define	ASGNFL		(V_RES3)	/* display object flags */
+#define	ASGNFL		V_RES3		/* display object flags */
 
 #define	AK_BASE		158		/* top y value of group 1 select line */
Index: include/biosdefs.h
===================================================================
--- include/biosdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/biosdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,6 +6,6 @@
 */
 
-extern	int32_t	trap13(int16_t fun, ...);
-extern	int32_t	trap14(int16_t fun, ...);
+#pragma once
+#include "stdint.h"
 
 #define	BIOS	trap13
Index: include/charset.h
===================================================================
--- include/charset.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/charset.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	SP_P1	0xA0	/* normal +1 */
Index: include/cmeta.h
===================================================================
--- include/cmeta.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/cmeta.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,28 +6,5 @@
 */
 
-extern	void	CMinit(int8_t *ip);
-extern	int16_t	CMstat(int8_t *msg);
-extern	int16_t	CMchr(int8_t c);
-extern	int16_t	CMuchr(int8_t c);
-extern	int16_t	CMstr(int8_t *s);
-extern	int16_t	CMustr(int8_t *s);
-extern	int16_t	CMlong(void);
-extern	int16_t	CMdig(void);
-extern	int16_t	CMlist(int8_t *l[]);
-extern	int16_t	CMulist(int8_t *l[]);
-
-extern	int16_t	QQsw;
-extern	int16_t	QQanch;
-
-extern	int8_t	*QQin;
-extern	int8_t	*QQip;
-extern	int8_t	*QQop;
-
-extern	int32_t	QQnum;
-extern	int16_t	QQlnum;
-extern	int8_t	QQchr;
-extern	int8_t	QQdig;
-
-extern	int8_t	QQstr[];
+#pragma once
 
 #define	CM_CHR(c)	CMchr(c)
Index: include/configs.h
===================================================================
--- include/configs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/configs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -1,2 +1,5 @@
+#pragma once
+#include "stdint.h"
+
 #define	MAXCFG	12
 
Index: include/ctype.h
===================================================================
--- include/ctype.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/ctype.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -10,14 +10,4 @@
 	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
@@ -46,6 +36,4 @@
 		_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
    ============================================================================
 */
@@ -55,24 +43,5 @@
 */
 
-#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
+#pragma once
 
 /* Digital Research / Alcyon C table definitions */
@@ -87,54 +56,31 @@
 #define	_X	0x80	/* hex digit */
 
-#endif
-
-#ifndef	_CTYPE_C
-
-#if	SYS5CODE
-
-extern	char _ctype[];		/* character type table */
-
-#else	/* SYS5CODE */
-
-extern	void	___atab(void);
-extern	int8_t __atab[];		/* character type table */
-
-#endif	/* SYS5CODE */
-
-extern	int16_t	tolower(int16_t c);
-extern	int16_t	toupper(int16_t c);
-
-#endif	/* _CTYPE_C */
-
 /* 
 
 */
 
-#define	isascii(c)	(!((c)&~0x7F))
+#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	isprint(c)	(__atab[(c) & 0xff] & (_P | _U | _L | _N | _B))
+#define	isgraph(c)	(__atab[(c) & 0xff] & (_P | _U | _L | _N))
+#define	iscntrl(c)	(__atab[(c) & 0xff] & _C)
 
-#define	isalpha(c)	((_ii_)[c]&(_U|_L))
-#define	isupper(c)	((_ii_)[c]&_U)
-#define	islower(c)	((_ii_)[c]&_L)
+#define	isalpha(c)	(__atab[(c) & 0xff] & (_U | _L))
+#define	isupper(c)	(__atab[(c) & 0xff] & _U)
+#define	islower(c)	(__atab[(c) & 0xff] & _L)
 
-#define	isdigit(c)	((_ii_)[c]&_N)
-#define	isxdigit(c)	((_ii_)[c]&_X)
+#define	isdigit(c)	(__atab[(c) & 0xff] & _N)
+#define	isxdigit(c)	(__atab[(c) & 0xff] & _X)
 
-#define	isalnum(c)	((_ii_)[c]&(_U|_L|_N))
+#define	isalnum(c)	(__atab[(c) & 0xff] & (_U | _L | _N))
 
-#define	isspace(c)	((_ii_)[c]&_S)
-#define	ispunct(c)	((_ii_)[c]&_P)
+#define	isspace(c)	(__atab[(c) & 0xff] & _S)
+#define	ispunct(c)	(__atab[(c) & 0xff] & _P)
 
-#define	iscsym(c)	(isalnum(c)||(((c)&127)==0x5F))
-#define	iscsymf(c)	(isalpha(c)||(((c)&127)==0x5F))
+#define	iscsym(c)	(isalnum(c) || (((c) & 0x7f) == 0x5f))
+#define	iscsymf(c)	(isalpha(c) || (((c) & 0x7f) == 0x5f))
 
-#define	toascii(c)	((c)&0x7F)
+#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))
-
+#define _toupper(c)	((c) - 'a' + 'A')
+#define _tolower(c)	((c) - 'A' + 'a')
Index: include/curpak.h
===================================================================
--- include/curpak.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/curpak.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,4 +6,7 @@
 
 */
+
+#pragma once
+#include "stdint.h"
 
 /* cursor types */
Index: include/debug.h
===================================================================
--- include/debug.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/debug.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #ifdef	DEBUGGER
Index: include/dfltins.h
===================================================================
--- include/dfltins.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/dfltins.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -1,2 +1,4 @@
+#pragma once
+#include "stdint.h"
 
 uint16_t	dfltins[] = {		/* default instrument */
Index: include/errdefs.h
===================================================================
--- include/errdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/errdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,19 +6,21 @@
 */
 
-#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 */
+#pragma once
+
+#define	ERR01	-1	/* All purpose general error code */
+#define	ERR02	-2	/* Drive not ready */
+#define	ERR03	-3	/* Unknown command */
+#define	ERR04	-4	/* CRC error */
+#define	ERR05	-5	/* Invalid request */
+#define	ERR06	-6	/* Seek error */
+#define	ERR07	-7	/* Unknown media */
+#define	ERR08	-8	/* Sector not found */
+#define	ERR09	-9	/* End of media or out of paper */
+#define	ERR10	-10	/* Write fault */
+#define	ERR11	-11	/* Read fault */
+#define	ERR12	-12	/* General mishap */
+#define	ERR13	-13	/* Write protected */
+#define	ERR14	-14	/* Media change */
+#define	ERR15	-15	/* Unknown device */
+#define	ERR16	-16	/* Bad sectors */
+#define	ERR17	-17	/* Insert disk */
Index: include/errno.h
===================================================================
--- include/errno.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/errno.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -7,5 +7,5 @@
  */
 
-extern	int16_t	errno;
+#pragma once
 
 #define EPERM	1
Index: include/fcntl.h
===================================================================
--- include/fcntl.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/fcntl.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,4 +6,6 @@
 */
 
+#pragma once
+
 /*
    =============================================================================
@@ -12,6 +14,4 @@
    =============================================================================
 */
-
-#ifndef	O_RDONLY	/* only define these once */
 
 #define	O_RDONLY	0x0000	/* Read-only value  */
@@ -28,6 +28,4 @@
 #define	O_RAW		0x8000	/* Raw (binary) I/O flag for getc and putc */
 
-#endif
-
 /*
    =============================================================================
Index: include/fields.h
===================================================================
--- include/fields.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/fields.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 #define	MAXEBUF	80		/* maximum length of data in the edit buffer */
@@ -34,10 +37,2 @@
 				/* box-hit function */
 };
-
-#ifndef	FET_DEFS
-extern	int16_t	ebflag;			/* edit buffer setup flag */
-extern	int8_t	ebuf[MAXEBUF+1];	/* edit buffer */
-
-extern	struct	fet *curfet;		/* current fet table pointer */
-extern	struct	fet *cfetp, *infetp;	/* current and new fet entry pointers */
-#endif
Index: include/fpu.h
===================================================================
--- include/fpu.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/fpu.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 /* preprocessor functions */
Index: include/fspars.h
===================================================================
--- include/fspars.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/fspars.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,5 +6,5 @@
 */
 
-#ifndef	NSTREAMS		/* ony define these once */
+#pragma once
 
 #define	TBUFFER		1	/* non-zero to enable track buffering */
@@ -14,6 +14,7 @@
 #define MAXDFILE	8	/* maximum number of open DISK files */
 
-#define	BUFSIZL	256				/* buffer length -- longs */
-#define BUFSIZ	(sizeof (int32_t) * BUFSIZL)	/* buffer length -- chars */
+#define	BUFSIZL	256		/* buffer length -- longs */
+#define BUFSIZ	(sizeof (int32_t) * BUFSIZL)
+				/* buffer length -- chars */
 
 #define	BPSEC		512	/* bytes per disk sector */
@@ -24,5 +25,3 @@
 #define	MAXDIRNT	224	/* maximum number of directory entries */
 
-typedef	int8_t	*io_arg;	/* must be big enough to contain a pointer */
-
-#endif
+typedef	void	*io_arg;	/* must be big enough to contain a pointer */
Index: include/glcbars.h
===================================================================
--- include/glcbars.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/glcbars.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,4 +3,7 @@
 	Created:  1988-08-04  17:50:28
 */
+
+#pragma once
+#include "stdint.h"
 
 int16_t	BBase   = 9;		/* bottom line of bar graph */
Index: include/glcdefs.h
===================================================================
--- include/glcdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/glcdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	G_INIT		(int8_t)0x40
Index: clude/glcfns.h
===================================================================
--- include/glcfns.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,20 +1,0 @@
-/*
-   =============================================================================
-	glcfns.h -- definitions for the Epson GLC driver
-	Version 6 -- 1988-01-10 -- D.N. Lynx Crowe
-   =============================================================================
-*/
-
-extern	uint16_t	GLCcrc(uint16_t row, uint16_t col);
-extern	uint16_t	GLCcxy(uint16_t x, uint16_t y);
-extern	void	GLCplot(uint16_t x, uint16_t y, uint16_t val);
-extern	void	GLCinit(void);
-extern	void	GLCwrts(int8_t *s);
-extern	void	GLCtext(uint16_t row, uint16_t col, int8_t *s);
-extern	void	GLCdisp(int16_t dsp, int16_t crs, int16_t blk1, int16_t blk2, int16_t blk3);
-extern	void	GLCcurs(int16_t crs);
-
-extern	uint16_t	lcdx, lcdy, lcdbit, lcdrow, lcdcol, lcdbase;
-extern	uint16_t	lcdctl1, lcdctl2;
-
-
Index: include/graphdef.h
===================================================================
--- include/graphdef.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/graphdef.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -8,4 +8,6 @@
 */
 
+#pragma once
+
 #define CLR 0
 #define SET 1
@@ -14,9 +16,9 @@
 #define YPIX	350
 
-#define XCTR	XPIX/2
-#define YCTR	YPIX/2
+#define XCTR	(XPIX / 2)
+#define YCTR	(YPIX / 2)
 
-#define XMAX	XPIX-1
-#define YMAX	YPIX-1
+#define XMAX	(XPIX - 1)
+#define YMAX	(YPIX - 1)
 
 #define	P_BLK	0		/* colors for external PROM color table */
Index: include/hwdefs.h
===================================================================
--- include/hwdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/hwdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,28 +6,51 @@
 */
 
+#pragma once
+#include "stdint.h"
+
 /* hardware addresses */
 
-extern	int8_t	io_time[], io_lcd, io_ser, io_midi;
-extern	int8_t	io_disk, io_tone, io_leds, io_kbrd;
-extern	int8_t	lcd_a0, lcd_a1;
+extern	uint16_t	io_fpu[];
+extern	uint8_t		io_time[];
+extern	uint8_t		io_lcd;
+extern	uint8_t		io_ser;
+extern	uint8_t		io_midi;
+extern	uint8_t		io_disk;
+extern	uint8_t		io_tone;
+extern	uint8_t		io_leds;
+extern	uint8_t		io_kbrd;
+extern	uint8_t		lcd_a0;
+extern	uint8_t		lcd_a1;
 
-extern	uint16_t	io_vreg[], io_vraw[], io_vram[], io_fpu[];
-
+extern	uint16_t	io_vreg[];
+extern	uint16_t	io_vraw[];
+extern	uint16_t	io_vram[];
 
 /* video memory allocations */
 
-extern	uint16_t	v_regs[], v_odtab[][4], v_actab[];
-extern	uint16_t	v_ct0[], v_gt1[], v_score[], v_cgtab[];
+extern	uint16_t	v_regs[];
+extern	uint16_t	v_odtab[][4];
+extern	uint16_t	v_actab[];
+extern	uint16_t	v_ct0[];
+extern	uint16_t	v_gt1[];
+extern	uint16_t	v_score[];
+extern	uint16_t	v_cgtab[];
 
-extern	uint16_t	v_curs0[], v_curs1[], v_curs2[], v_curs3[];
-extern	uint16_t	v_curs4[], v_curs5[], v_curs6[], v_curs7[];
-extern	uint16_t	v_tcur[], v_kbobj[], v_lnobj[];
-extern	uint16_t	v_win0[], v_cur[];
-
+extern	uint16_t	v_curs0[];
+extern	uint16_t	v_curs1[];
+extern	uint16_t	v_curs2[];
+extern	uint16_t	v_curs3[];
+extern	uint16_t	v_curs4[];
+extern	uint16_t	v_curs5[];
+extern	uint16_t	v_curs6[];
+extern	uint16_t	v_curs7[];
+extern	uint16_t	v_tcur[];
+extern	uint16_t	v_kbobj[];
+extern	uint16_t	v_lnobj[];
+extern	uint16_t	v_win0[];
+extern	uint16_t	v_cur[];
 
 /* stuff in the depths of the bios */
 
-extern	int16_t	fc_sw;
-
-extern	int32_t	fc_val;
-
+extern	int16_t		fc_sw;
+extern	int32_t		fc_val;
Index: include/instdsp.h
===================================================================
--- include/instdsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/instdsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,8 +3,10 @@
 	instdsp.h -- instrument editor definitions
 	Version 37 -- 1988-08-30 -- D.N. Lynx Crowe
-
-	Uses definitions from:  "graphdef.h", "midas.h", "vsdd.h"
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
+#include "midas.h"
 
 /* --------------- Miscellaneous Instrument display definitions ------------- */
@@ -19,6 +21,6 @@
 #define	TCPRI		15		/* text cursor priority */
 
-#define	INSTFL		(V_RES3)	/* instrument display object flags */
-#define	TCURFL		(V_RES3)	/* text cursor display flags */
+#define	INSTFL		V_RES3		/* instrument display object flags */
+#define	TCURFL		V_RES3		/* text cursor display flags */
 
 #define	CBORD		9		/* color of border */
@@ -197,8 +199,8 @@
 	int16_t	idhflag;		/* flags */
 
-	int8_t	idhname[MAXIDLN+1];	/* instrument name */
-	int8_t	idhcom1[MAXIDLN+1];	/* first line of comments */
-	int8_t	idhcom2[MAXIDLN+1];	/* second line of comments */
-	int8_t	idhcom3[MAXIDLN+1];	/* third line of comments */
+	int8_t	idhname[MAXIDLN + 1];	/* instrument name */
+	int8_t	idhcom1[MAXIDLN + 1];	/* first line of comments */
+	int8_t	idhcom2[MAXIDLN + 1];	/* second line of comments */
+	int8_t	idhcom3[MAXIDLN + 1];	/* third line of comments */
 
 	int8_t	idhcfg;			/* configuration byte */
Index: include/io.h
===================================================================
--- include/io.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/io.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,4 +6,6 @@
 */
 
+#pragma once
+#include "stdint.h"
 #include "fspars.h"		/* file system parameters */
 
@@ -33,9 +35,2 @@
 	io_arg	d_arg;		/* argument to device driver */
 };
-
-#ifndef	_FS_DEF_
-
-extern	struct channel chantab[MAXCHAN];	/* defined in fsinit.c */
-extern	int8_t	Wrkbuf[BPSEC];			/* defined in fsinit.c */
-
-#endif
Index: include/knmtab.h
===================================================================
--- include/knmtab.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/knmtab.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 /*
Index: include/lcdline.h
===================================================================
--- include/lcdline.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/lcdline.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,5 +6,5 @@
 	Note:	LCD characters are 5x7 in a 6x8 envelope.
 
-		The LCD charcter addresses start with (0,0) in the
+		The LCD character addresses start with (0,0) in the
 		upper left corner.  8 rows of 85 characters.
 
@@ -13,4 +13,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	RP_PL	153		/* "R/P" underscore - "P" X left */
@@ -25,16 +27,16 @@
 
 #define	LAMP_XL	78
-#define	LAMP_XR	LAMP_XL+23
+#define	LAMP_XR	(LAMP_XL + 23)
 #define	LAMP_Y	54
 
 #define	GOTO_XL	186
-#define	GOTO_XR	GOTO_XL+29
+#define	GOTO_XR	(GOTO_XL + 29)
 #define	GOTO_Y	54
 
 #define	ASGN_XL	258
-#define	ASGN_XR	ASGN_XL+29
+#define	ASGN_XR	(ASGN_XL + 29)
 #define	ASGN_Y	54
 
 #define	LOAD_XL	294
-#define	LOAD_XR	LOAD_XL+23
+#define	LOAD_XR	(LOAD_XL + 23)
 #define	LOAD_Y	54
Index: include/libdsp.h
===================================================================
--- include/libdsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/libdsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -7,4 +7,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 #define	LIBROBJ		8		/* librarian display object number */
@@ -117,8 +120,4 @@
 #define	LH_LEN		(sizeof (struct mlibhdr))
 
-#define	OR_LEN1		((int32_t)&idefs[0].idhwvaf[0]-(int32_t)&idefs[0].idhflag)
+#define	OR_LEN1		((int32_t)&idefs[0].idhwvaf[0] - (int32_t)&idefs[0].idhflag)
 #define	OR_LEN2		(2 * (NUMWPNT + NUMHARM))
-
-#ifndef	M7CAT
-extern	struct	fcat	filecat[];
-#endif
Index: include/macros.h
===================================================================
--- include/macros.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/macros.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -8,21 +8,12 @@
 */
 
-#ifndef	abs
+#pragma once
+
 #define	abs(x)		((x) < 0 ? -(x) : (x))
-#endif
+#define	sign(x, y)	((x) < 0 ? -(y) : (y))
 
-#ifndef	sign
-#define	sign(x,y)	((x) < 0 ? -(y) : (y))
-#endif
+#define	min(x, y)	((x) > (y) ? (y) : (x))
+#define	max(x, y)	((x) > (y) ? (x) : (y))
 
-#ifndef	min
-#define	min(x,y)	((x) > (y) ? (y) : (x))
-#endif
-
-#ifndef	max
-#define	max(x,y)	((x) > (y) ? (x) : (y))
-#endif
-
-#ifndef	inrange
-#define	inrange(var,lo,hi)	(((var) >= (lo)) && ((var) <= (hi)))
-#endif
+#define	inrange(var, lo, hi) \
+			(((var) >= (lo)) && ((var) <= (hi)))
Index: clude/memory.h
===================================================================
--- include/memory.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,17 +1,0 @@
-/*
-   ============================================================================
-	memory.h -- header for memory functions
-	Version 3 -- 1987-04-06 -- D.N. Lynx Crowe
-   ============================================================================
-*/
-
-extern	void	*memccpy(void *vp1, void *vp2, int8_t c, int16_t n);
-extern	void	*memchr(void *vp, int8_t c, int16_t n);
-extern	void	*memcpy(void *vp1, void *vp2, int16_t n);
-extern	void	*memset(void *vp, int8_t c, int16_t n);
-extern	int16_t	memcmp(void *vp1, void *vp2, int16_t n);
-extern	void	*memsetw(void *vp, int16_t s, int16_t n);
-extern	void	*memcpyw(void *vp1, void *vp2, int16_t n);
-extern	int16_t	memcmpu(void *vp1, void *vp2, int16_t n);
-
-
Index: include/menu.h
===================================================================
--- include/menu.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/menu.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	MCURSOR		1	/* cursor color */
@@ -21,4 +23,3 @@
 #define	MENUPRI		8
 
-#define	MENUFL		(V_RES3)
-
+#define	MENUFL		V_RES3
Index: include/midas.h
===================================================================
--- include/midas.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/midas.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,15 +3,16 @@
 	midas.h -- MIDAS 700 global definitions
 	Version 38 -- 1989-12-19 -- D.N. Lynx Crowe
-
-	Uses definitions from:  "graphdef.h", "vsdd.h" 
    =============================================================================
 */
 
-typedef	void	(*LPF)(int16_t _1, int16_t _2);	/* pointer to a LCD panel function */
+#pragma once
+#include "stdint.h"
 
-#define	SM_SCALE(x)	(((x) * 252) & 0x7FE0)
-#define	ART_VAL(x)	(((((x)-5) > 100) ? 100 : (((x)-5) < 0 ? 0 : ((x)-5)))*320)
+typedef	void (*LPF)(int16_t _1, int16_t _2);	/* pointer to a LCD panel function */
 
-#define	CWORD(x)	((short)((x)|((x)<<4)|((x)<<8)|((x)<<12)))
+#define	SM_SCALE(x)	(((x) * 252) & 0x7fe0)
+#define	ART_VAL(x)	(((((x) - 5) > 100) ? 100 : (((x) - 5) < 0 ? 0 : ((x) - 5))) * 320)
+
+#define	CWORD(x)	((int16_t)((x) | ((x) << 4) | ((x) << 8) | ((x) << 12)))
 
 #define	CTOX(C)		((C) << 3)	/* column to x pixel value */
@@ -25,12 +26,12 @@
 #define	GCURS	0			/* graphic cursor object number */
 
-#define	BIT2	(V_RES2)		/* graphics - 2 bit pixels */
-#define	BIT3	(V_RES3)		/* graphics - 4 bit pixels */
-#define	CHR2	(0)			/* characters - no attributes */
+#define	BIT2	V_RES2			/* graphics - 2 bit pixels */
+#define	BIT3	V_RES3			/* graphics - 4 bit pixels */
+#define	CHR2	0			/* characters - no attributes */
 #define	CHR3	(V_FAD | V_HCR)		/* characters - full attributes */
 
 #define	OBFL_00	(BIT3 | V_TDE)		/* cursor - arrow */
 
-#define	LIBRFL		(V_RES3)	/* librarian display object flags */
+#define	LIBRFL		V_RES3		/* librarian display object flags */
 
 #define	TTCURS		2		/* typewriter cursor object */
@@ -102,8 +103,9 @@
 #define	M_LCLHLD	0x40	/* MIDI local hold status */
 #define	M_CHNHLD	0x80	/* MIDI channel hold status */
-#define	MKEYHELD	(M_CHNHLD | M_LCLHLD)	/* key held */
+#define	MKEYHELD	(M_CHNHLD | M_LCLHLD)
+				/* key held */
 
-#define	PITCHMIN	320		/* C0 in 1/2 cents (160 cents) */
-#define	PITCHMAX	21920		/* C9 in 1/2 cents (10960 cents) */
+#define	PITCHMIN	320	/* C0 in 1/2 cents (160 cents) */
+#define	PITCHMAX	21920	/* C9 in 1/2 cents (10960 cents) */
 
 #define	GTAG1		0x0100
Index: clude/neddefs.h
===================================================================
--- include/neddefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,14 +1,0 @@
-/*
-   =============================================================================
-	neddefs.h -- note editor definition file
-	Version 3 -- 1988-05-17 -- D.N. Lynx Crowe
-
-	Must follow "score.h" if used  (for definition of s_entry).
-   =============================================================================
-*/
-
-extern	int16_t	noteop, notesel;
-
-extern	int32_t	t_note;
-
-extern	struct	n_entry	*p_nbeg, *p_nend;
Index: include/objdefs.h
===================================================================
--- include/objdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/objdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    ============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct EXFILE {			/* executable file header */
Index: include/panel.h
===================================================================
--- include/panel.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/panel.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 /* ----- performance key states (in pkctrl) ----- */
Index: include/patch.h
===================================================================
--- include/patch.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/patch.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 #define	MAXPATCH	256		/* patch table size */
@@ -19,6 +22,7 @@
 #define	NPTEQELS	256		/* number of trigger fifo entries */
 
-#define	NPTEQLO		(NPTEQELS >> 2)		/* trigger fifo lo water */
-#define	NPTEQHI		(NPTEQELS - NPTEQLO)	/* trigger fifo hi water */
+#define	NPTEQLO		(NPTEQELS >> 2)	/* trigger fifo lo water */
+#define	NPTEQHI		(NPTEQELS - NPTEQLO)
+					/* trigger fifo hi water */
 
 #define	NULL_DEF	0x1200		/* blank definer code */
@@ -69,34 +73,4 @@
 	uint16_t	seqdat3;	/* action 3 data */
 };
-
-/* 
-
-*/
-
-/* Patch table references */
-
-#ifndef	PATCHDEF
-extern	int8_t		stmptr[];	/* stimulus pointer table */
-extern	int8_t		defptr[];	/* definition pointer table */
-
-extern	struct patch	patches[];	/* patch table */
-
-extern	struct defent	defents[];	/* definition control table */
-#endif
-
-
-/* Sequence table references */
-
-#ifndef	SEQDEFS
-extern	struct seqent	seqtab[];		/* sequence table */
-
-extern	uint16_t	seqflag[16];		/* sequence flags */
-extern	uint16_t	seqline[16];		/* sequence line */
-extern	uint16_t	seqstim[16];		/* sequence stimulus */
-extern	uint16_t	seqtime[16];		/* sequence timers */
-extern	uint16_t	sregval[16];		/* register values */
-extern	uint16_t	trstate[16];		/* trigger states */
-
-#endif
 
 /* 
Index: clude/portab.h
===================================================================
--- include/portab.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,56 +1,0 @@
-/*
-   =============================================================================
-	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/ptdisp.h
===================================================================
--- include/ptdisp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/ptdisp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,4 +6,6 @@
 */
 
+#pragma once
+
 #define	OB08LOC		0		/* offset to headings */
 #define	OB09LOC		1024		/* offset to patches */
@@ -11,8 +13,8 @@
 #define	OB11LOC		4096		/* offset to menu */
 
-#define	PDFL_08		(CHR3)		/* heading object flags */
-#define	PDFL_09		(CHR3)		/* patch entry object flags  */
-#define	PDFL_10		(BIT3)		/* sequence status object flags */
-#define	PDFL_11		(CHR3)		/* menu object flags */
+#define	PDFL_08		CHR3		/* heading object flags */
+#define	PDFL_09		CHR3		/* patch entry object flags  */
+#define	PDFL_10		BIT3		/* sequence status object flags */
+#define	PDFL_11		CHR3		/* menu object flags */
 
 #define	PTBATR		0x00E2		/* colors for border */
Index: include/ptoftab.h
===================================================================
--- include/ptoftab.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/ptoftab.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -1,2 +1,4 @@
+#pragma once
+#include "stdint.h"
 
 /* Pitch to Frequency */
Index: include/ratio.h
===================================================================
--- include/ratio.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/ratio.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -1,2 +1,4 @@
+#pragma once
+#include "stdint.h"
 
 /* ratio.h -- generated:  1988-08-25  19:23:42 */
Index: clude/rawio.h
===================================================================
--- include/rawio.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,16 +1,0 @@
-/*
-   ============================================================================
-	rawio.h -- header for raw BIOS I/O
-	Version 2 -- 1987-02-20 -- D.N. Lynx Crowe
-   ============================================================================
-*/
-
-int16_t	getln(int16_t unit, int16_t nb, int8_t *buf);
-int16_t	getrln(int16_t unit, int16_t nb, int8_t *buf);
-int16_t	readln(int16_t unit, int16_t nc, int8_t *ctl, int16_t nb, int8_t *buf);
-
-/* The following should really be void ... */
-
-void	writeln(int16_t unit, int8_t *buf);
-
-
Index: include/regs.h
===================================================================
--- include/regs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/regs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -8,4 +8,7 @@
    ============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct regs {
Index: include/scdsp.h
===================================================================
--- include/scdsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/scdsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,8 +3,8 @@
 	scdsp.h -- score display definitions
 	Version 14 -- 1988-08-16 -- D.N. Lynx Crowe
-
-	Uses definitions from "graphdef.h", "midas.h" and "vsdd.h"
    =============================================================================
 */
+
+#pragma once
 
 #define	SCOROBP	1			/* score object priority */
@@ -13,11 +13,11 @@
 #define	N_FLAT	1			/* note control code for flats */
 
-#define	OBFL_01	(BIT3)			/* cursor - underline */
+#define	OBFL_01	BIT3			/* cursor - underline */
 
-#define	OBFL_08	(CHR3)			/* character text */
+#define	OBFL_08	CHR3			/* character text */
 
-#define	OBFL_11	(BIT3)			/* window */
+#define	OBFL_11	BIT3			/* window */
 
-#define	OBFL_13	(BIT3)			/* keyboard */
+#define	OBFL_13	BIT3			/* keyboard */
 #define	OBFL_14	(BIT3 | V_TDE)		/* score */
 #define	OBFL_15	(BIT3 | V_TDE)		/* lines */
Index: clude/scfns.h
===================================================================
--- include/scfns.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,46 +1,0 @@
-/*
-   =============================================================================
-	scfns.h -- score function and variable definitions
-	Version 14 -- 1988-04-20 -- D.N. Lynx Crowe
-
-	Must follow stddefs.h and score.h if used.
-   =============================================================================
-*/
-
-extern	void	eh_ins(struct s_entry *ne, int16_t et);
-extern	void	eh_rmv(struct s_entry *ev, int16_t et);
-extern	void	sc_clr(int16_t ns);
-
-extern	int16_t	e_del(struct s_entry *e1);
-extern	int16_t	selscor(int16_t ns);
-extern	int16_t	sc_goto(int32_t tval);
-
-extern	int32_t	scinit(void);
-extern	int32_t	evleft(void);
-
-extern	struct	s_entry	*e_alc(int16_t w);
-extern	struct	s_entry	*e_ins(struct s_entry *e1, struct s_entry *e2);
-extern	struct	s_entry	*e_rmv(struct s_entry *e1);
-extern	struct	s_entry	*e_clr(struct s_entry *e1);
-extern	struct	s_entry	*ehfind(int16_t eh, int32_t te, int16_t d1, int16_t d2);
-extern	struct	s_entry	*frfind(int32_t tval, int16_t sdir);
-extern	struct	s_entry	*ep_adj(struct s_entry *sep, int16_t sdir, int32_t tval);
-extern	struct	s_entry	*se_exec(struct s_entry *ep, int16_t sd);
-extern	struct	s_entry	*findev(struct s_entry *ep, int32_t te, int16_t et, int16_t d1, int16_t d2);
-
-extern	int8_t	ac_code;
-extern	int8_t	scname[][16];
-
-extern	BOOL	se_chg;
-
-extern	int16_t	curscor, cursect;
-
-extern	int32_t	se1_cnt, se2_cnt, se3_cnt;
-extern	int32_t	spool[], *pspool;
-extern	int32_t	spcount, frags;
-extern	int32_t	t_bak, t_cur, t_ctr, t_fwd;
-
-extern	struct	s_entry	*size1, *size2, *size3;
-extern	struct	s_entry	*scores[], *scp;
-extern	struct	s_entry	*seclist[][N_SECTS], *hplist[][N_TYPES];
-extern	struct	s_entry	*p_bak, *p_cur, *p_ctr, *p_fwd;
Index: include/sclock.h
===================================================================
--- include/sclock.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/sclock.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	CK_LOCAL	0
Index: include/score.h
===================================================================
--- include/score.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/score.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 #define	MAX_SE		32768L	/* number of longs for score storage */
@@ -70,5 +73,5 @@
 /* constant definitions */
 
-#define	E_NULL	(struct s_entry *)0L
+#define	E_NULL		((struct s_entry *)0L)
 
 #define	E_SIZE1		5	/* event size 1 -- 5 longs -- 20 bytes */
Index: include/scwheel.h
===================================================================
--- include/scwheel.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/scwheel.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	NSWFIFO		100		/* scroll wheel FIFO size */
Index: clude/secdefs.h
===================================================================
--- include/secdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,11 +1,0 @@
-/*
-   =============================================================================
-	secdefs.h -- section operation functions and variables
-	Version 2 -- 1988-05-06 -- D.N. Lynx Crowe
-   =============================================================================
-*/
-
-extern	int16_t	secopok;
-extern	int32_t	t_sbgn, t_send, t_sect, t_sec1, t_sec2, t_cbgn, t_cend;
-extern	struct	s_entry	*p_sbgn, *p_send, *p_sec1, *p_sec2, *p_cbgn, *p_cend;
-
Index: include/secops.h
===================================================================
--- include/secops.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/secops.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	SOP_NUL		0	/* No section operation pending */
Index: include/setjmp.h
===================================================================
--- include/setjmp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/setjmp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -14,4 +14,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct	JMP_BUF {	/* setjmp() / longjmp() environment structure */
Index: include/slice.h
===================================================================
--- include/slice.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/slice.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 #define	MAXFSL	256			/* size of the gdsel free list */
Index: include/smdefs.h
===================================================================
--- include/smdefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/smdefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct	sment {
Index: include/stdarg.h
===================================================================
--- include/stdarg.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/stdarg.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,4 +6,7 @@
 */
 
+#pragma once
+#include "stdint.h"
+
 typedef	int8_t	*va_list;
 
@@ -11,3 +14,2 @@
 #define	va_arg(ap, type)	(ap += sizeof(type), ap[-1])
 #define	va_end(ap)
-
Index: include/stddefs.h
===================================================================
--- include/stddefs.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/stddefs.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -3,21 +3,10 @@
 	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
+#pragma once
+#include "stdint.h"
 
 /* relational operators */
@@ -36,65 +25,21 @@
 #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
+#define	FAILURE	-1			/*	Function failure return val */
+#define SUCCESS	0			/*	Function success return val */
 
-#ifndef	YES
-#define	YES		1
-#endif
+#define	FOREVER	for (;;)		/*	Infinite loop declaration   */
 
-#ifndef	NO
-#define	NO		0
-#endif
+#define	NULL	0			/*	Null pointer value	    */
 
-#ifndef	FALSE
-#define	FALSE		0
-#endif
-
-#ifndef	TRUE
-#define	TRUE		1
-#endif
-
-#ifndef	SUCCESS
-#define	SUCCESS		0
-#endif
-
-#ifndef	FAILURE
-#define	FAILURE		(-1)
-#endif
+#define	TRUE	1			/*	Function TRUE  value	    */
+#define	FALSE	0			/*	Function FALSE value	    */
 
 /* BOOL type definition for flag variables */
 
 typedef	int8_t	BOOL;
-
-#endif
Index: include/stdint.h
===================================================================
--- include/stdint.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
+++ include/stdint.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -0,0 +1,17 @@
+/*
+   =============================================================================
+	stdint.h -- fixed-size integer types
+	Version 1 -- 2017-07-10 -- Thomas Lopatic
+   =============================================================================
+*/
+
+#pragma once
+
+typedef char int8_t;
+typedef unsigned char uint8_t;
+
+typedef short int16_t;
+typedef unsigned short uint16_t;
+
+typedef long int32_t;
+typedef unsigned long uint32_t;
Index: include/stdio.h
===================================================================
--- include/stdio.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/stdio.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -6,7 +6,8 @@
 */
 
+#pragma once
+#include "stdint.h"
 #include "fspars.h"		/* file system parameters */
 
-#define NULL	0
 #define EOF	-1
 
@@ -33,31 +34,4 @@
 } FILE;
 
-#ifndef	_FS_DEF_
-
-extern	FILE	Cbuffs[NSTREAMS];		/* table of FILE structures */
-extern	int8_t	*Stdbufs;			/* free list of buffers */
-extern	int32_t	Stdbuf[MAXDFILE][BUFSIZL];	/* buffers */
-
-#endif
-
-extern	int32_t	ftell(FILE *fp);
-extern	int8_t	*gets(int8_t *line);
-extern	int8_t	*fgets(int8_t *s, int16_t n, FILE *fp);
-extern	FILE	*fopen(int8_t *name, int8_t *mode);
-extern	FILE	*fopena(int8_t *name, int8_t *mode);
-extern	FILE	*fopenb(int8_t *name, int8_t *mode);
-extern	int16_t	fread(int8_t *buffer, uint16_t size, int16_t number, FILE *stream);
-extern	int16_t	fwrite(int8_t *buffer, int16_t size, int16_t number, FILE *stream);
-extern	int16_t	fseek(FILE *fp, int32_t pos, int16_t mode);
-extern	int16_t	fflush(FILE *ptr);
-extern	int16_t	fclose(FILE *ptr);
-
-extern	int32_t	printf(int8_t *fmt, ...);
-extern	int32_t	sprintf(int8_t *str, int8_t *fmt, ...);
-
-extern	int16_t	getc(FILE *ptr);
-extern	int16_t	putc(int16_t c, FILE *ptr);
-extern	int16_t	ungetc(int16_t c, FILE *ptr);
-
 #define	stdin	(&Cbuffs[0])
 #define	stdout	(&Cbuffs[1])
@@ -70,6 +44,4 @@
 #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  */
@@ -85,4 +57,2 @@
 
 #define	O_RAW		0x8000	/* Raw (binary) I/O flag for getc and putc */
-
-#endif
Index: clude/strings.h
===================================================================
--- include/strings.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,31 +1,0 @@
-/*
-   ============================================================================
-	strings.h -- definitions for strnglib
-	Version 3 -- 1987-04-21 -- D.N. Lynx Crowe
-   ============================================================================
-*/
-
-extern	int8_t	*strccpy(int8_t *s1, int8_t *s2, int8_t c);
-extern	int8_t	*strcpy(int8_t *s1, int8_t *s2);
-extern	int8_t	*strncpy(int8_t *s1, int8_t *s2, int16_t n);
-extern	int8_t	*strcat(int8_t *s1, int8_t *s2);
-extern	int8_t	*strncat(int8_t *s1, int8_t *s2, int16_t n);
-extern	int8_t	*strchr(int8_t *sp, int8_t c);
-extern	int8_t	*strrchr(int8_t *sp, int8_t c);
-extern	int8_t	*strpbrk(int8_t *string, int8_t *brkset);
-extern	int8_t	*strtok(int8_t *string, int8_t *sepset);
-extern	int8_t	*index(int8_t *str, int8_t c);
-extern	int8_t	*rindex(int8_t *str, int8_t c);
-extern	int8_t	*str2lc(int8_t *s);
-extern	int8_t	*str2uc(int8_t *s);
-
-extern	int16_t	strcmp(int8_t *s1, int8_t *s2);
-extern	int16_t	strlcmp(int8_t *s, int8_t *l[]);
-extern	int16_t	strncmp(int8_t *s1, int8_t *s2, int16_t n);
-extern	int16_t	strlen(int8_t *s);
-extern	int16_t	strspn(int8_t *string, int8_t *charset);
-extern	int16_t	strcspn(int8_t *string, int8_t *charset);
-
-extern	int32_t	strtol(int8_t *str, int8_t **ptr, int16_t base);
-
-
Index: include/swrtab.h
===================================================================
--- include/swrtab.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/swrtab.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -1,2 +1,4 @@
+#pragma once
+#include "stdint.h"
 
 int32_t swrtab[128] = {	/* scroll rates */
Index: include/timers.h
===================================================================
--- include/timers.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/timers.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	NTIMERS		8		/* number of timers */
@@ -14,5 +16,2 @@
 #define	MSTIMER		4		/* mouse movement timer */
 #define	MUTIMER		5		/* mouse buffer flush timer */
-
-extern	int16_t	timers[NTIMERS];	/* timer array */
-
Index: include/tundsp.h
===================================================================
--- include/tundsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/tundsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -8,8 +8,10 @@
 */
 
+#pragma once
+
 #define	TUNOBJ		8		/* display object number */
 #define	TUNPRI		8		/* display object priority */
 
-#define	TUNFL		(V_RES3)	/* display object flags */
+#define	TUNFL		V_RES3		/* display object flags */
 
 #define	TDCURX		CTOX(61)	/* initial cursor x location */
@@ -44,3 +46,2 @@
 #define	TCBBX06		6		/* background color */
 #define	TCBBX07		4		/* background color */
-
Index: include/uartio.h
===================================================================
--- include/uartio.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/uartio.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,6 @@
    =============================================================================
 */
+
+#pragma once
 
 #define	PRT_DEV		0
Index: include/vsdd.h
===================================================================
--- include/vsdd.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/vsdd.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -7,5 +7,8 @@
 */
 
-#define	VSDD	(unsigned int *)0x200000
+#pragma once
+#include "stdint.h"
+
+#define	VSDD	((uint16_t *)0x200000)
 
 #define	V_CHITE	12		/* Character height */
@@ -69,3 +72,2 @@
 			odtw1;	/* Object descriptor table word 1 */
 };
-
Index: clude/vsddsw.h
===================================================================
--- include/vsddsw.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,41 +1,0 @@
-/*
-   =============================================================================
-	VSDDSW.H -- VSDD software support definitions
-	Version 6 -- 1987-05-27 -- D.N. Lynx Crowe
-	Copyright 1987 -- D.N. Lynx Crowe
-   =============================================================================
-*/
-
-/* functions */
-
-extern	void	vbank(uint16_t b);
-extern	void	vputp(struct octent *octad, int16_t xloc, int16_t yloc, int16_t val);
-extern	void	vwputp(struct octent *octad, int16_t xloc, int16_t yloc, int16_t val);
-
-/* these should be voids ... */
-
-extern	void	vfwait(void);
-extern	void	vputs(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t attrib, int8_t *str);
-extern	void	vputsa(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t *attrib, int8_t *str);
-extern	void	vputc(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t c, uint16_t attrib);
-extern	void	VHinit(void);
-extern	void	objclr(uint16_t obj);
-extern	void	objon(uint16_t obj, uint16_t line, uint16_t num);
-extern	void	objoff(uint16_t obj, uint16_t line, uint16_t num);
-extern	void	vcputs(int16_t *obase, int16_t nw, int16_t fg, int16_t bg, int16_t row, int16_t col, int8_t *str);
-extern	void	vwputs(int16_t *obase, int16_t nw, int16_t fg, int16_t bg, int16_t row, int16_t col, int8_t *str);
-extern	void	vwputm(uint16_t *obase, int16_t nw, int16_t fg, int16_t bg, int16_t row, int16_t col, int8_t *ml[]);
-extern	void	vmput(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t ma, int8_t *ms[]);
-extern	void	vmputa(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t *ma[], int8_t *ms[]);
-extern	void	VSinit(void);
-extern	void	SelObj(int16_t obj);
-extern	void	SetPri(int16_t obj, int16_t pri);
-extern	void	SetObj(int16_t obj, int16_t type, int16_t bank, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, int16_t flags, int16_t pri, uint16_t *base);
-extern	void	CpyObj(uint16_t *from, uint16_t *to, uint16_t w, uint16_t h, uint16_t sw);
-
-extern	void	lseg(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t t);
-extern	void	vbfill4(uint16_t *obj, int16_t obwidth, int16_t xmin, int16_t ymin, int16_t xmax, int16_t ymax, uint16_t color);
-
-extern	void	tsplot4(int16_t *obase, int16_t nw, int16_t fg, int16_t row, int16_t col, int8_t *str, int16_t pitch);
-extern	void	vcputsv(int16_t *obase, int16_t nw, int16_t fg, int16_t bg, int16_t row, int16_t col, int8_t *str, int16_t pitch);
-
Index: clude/vsddvars.h
===================================================================
--- include/vsddvars.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ 	(revision )
@@ -1,15 +1,0 @@
-/*
-   =============================================================================
-	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[16];	/* object control table */
-
-extern	struct	octent	*v_curob;	/* working object control pointer */
-extern	int16_t	v_nobj;			/* working object number */
-extern	int16_t	v_obpri;		/* working object priority */
-
-
Index: include/wdcurtb.h
===================================================================
--- include/wdcurtb.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/wdcurtb.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    =============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 int16_t	wdcurtb[] = {
Index: include/wordq.h
===================================================================
--- include/wordq.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/wordq.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -5,4 +5,7 @@
    ============================================================================
 */
+
+#pragma once
+#include "stdint.h"
 
 struct	wordq {
@@ -16,9 +19,2 @@
 	uint16_t	*qbuf;		/* base of queue */
 };
-
-#ifndef	WORDQHDR
-extern	int16_t	putwq(struct wordq *qp, uint16_t c);
-extern	int16_t	getwq(struct wordq *qp, uint16_t *p);
-extern	uint16_t	setwq(struct wordq *qp, uint16_t *qadr, uint16_t qsiz, uint16_t hi, uint16_t lo);
-#endif
-
Index: include/wsdsp.h
===================================================================
--- include/wsdsp.h	(revision c3aee8afc950b40e838f51b1c1172c714ce819d7)
+++ include/wsdsp.h	(revision f7428b16e721f80978c178e5269b7e75d4003bd0)
@@ -10,4 +10,8 @@
 */
 
+#pragma once
+#include "stdint.h"
+#include "midas.h"
+
 struct	wstbl	{		/* waveshape table library entry */
 
@@ -20,5 +24,5 @@
 #define	WAVEPRI		8		/* waveshape display object priority */
 
-#define	WAVEFL		(V_RES3)	/* waveshape display object flags */
+#define	WAVEFL		V_RES3		/* waveshape display object flags */
 
 #define	WCURX		256		/* initial cursor x location */
