Index: ram/dopatch.c
===================================================================
--- ram/dopatch.c	(revision 05806159f2593192d6ed2fca28358480a2383c67)
+++ ram/dopatch.c	(revision 8618599ab825088c720c202c6e50a52572282c0f)
@@ -31,22 +31,22 @@
 #define	ST_PCT	0x0002		/* break subaddress into port, chan, trig */
 
-extern	char	*S1IoRec, *S2IoRec, *M1IoRec, *M2IoRec;
-
-unsigned short	seqdupd;		/* sequence display update flag */
-
-extern	short	bform;			/* oscillator buffer format */
-extern	short	curinst;		/* current instrument being edited */
-extern	short	curvce;			/* current voice being edited */
-extern	short	timemlt;		/* time multiplier */
-
-extern	short	expbit[];		/* FPU exponent bit table */
-extern	short	ins2grp[];		/* instrument to group assignments */
-extern	short	s_inst[];		/* instrument to voice assignments */
-extern	short	vce2grp[];		/* voice to group assignments */
-
-extern	unsigned short	seqflag[16];		/* sequencer flags */
-extern	unsigned short	seqline[16];		/* current sequencer line */
-extern	unsigned short	sregval[16];		/* register values */
-extern	unsigned short	trstate[16];		/* trigger states */
+extern	int8_t	*S1IoRec, *S2IoRec, *M1IoRec, *M2IoRec;
+
+uint16_t	seqdupd;		/* sequence display update flag */
+
+extern	int16_t	bform;			/* oscillator buffer format */
+extern	int16_t	curinst;		/* current instrument being edited */
+extern	int16_t	curvce;			/* current voice being edited */
+extern	int16_t	timemlt;		/* time multiplier */
+
+extern	int16_t	expbit[];		/* FPU exponent bit table */
+extern	int16_t	ins2grp[];		/* instrument to group assignments */
+extern	int16_t	s_inst[];		/* instrument to voice assignments */
+extern	int16_t	vce2grp[];		/* voice to group assignments */
+
+extern	uint16_t	seqflag[16];		/* sequencer flags */
+extern	uint16_t	seqline[16];		/* current sequencer line */
+extern	uint16_t	sregval[16];		/* register values */
+extern	uint16_t	trstate[16];		/* trigger states */
 
 extern	struct wordq	ptefifo;	/* trigger fifo */
@@ -54,19 +54,19 @@
 extern	struct wstbl	wslib[];	/* waveshape library */
 
-char	ledstat[24];			/* LED status */
-
-/* 
-
-*/
-
-short	frq2par[] = {1, 3, 5, 7};			/* Frq to par */
-
-short	ind2par[] = {9, 11, 12, 13, 14, 15};		/* Ind to par */
-
-short	cv2vce[] = {11, 10, 6, 8};			/* CV to voice */
-
-short	lg2base[7] = { 0, 3, 7, 10, 14, 17, 21};	/* LED group bases */
-
-char	vgtype[] = {
+int8_t	ledstat[24];			/* LED status */
+
+/* 
+
+*/
+
+int16_t	frq2par[] = {1, 3, 5, 7};			/* Frq to par */
+
+int16_t	ind2par[] = {9, 11, 12, 13, 14, 15};		/* Ind to par */
+
+int16_t	cv2vce[] = {11, 10, 6, 8};			/* CV to voice */
+
+int16_t	lg2base[7] = { 0, 3, 7, 10, 14, 17, 21};	/* LED group bases */
+
+int8_t	vgtype[] = {
 
 	ST_NUL,		/* PA_NULL */
@@ -113,7 +113,7 @@
 */
 
-void pdows(short slot, short voice, short wsn)
+void pdows(int16_t slot, int16_t voice, int16_t wsn)
 {
-	unsigned short *fpuws;
+	uint16_t *fpuws;
 	
 	if (slot) {		/* waveshape slot B */
@@ -158,8 +158,8 @@
 */
 
-void pfpufn(unsigned short voice, unsigned short par, unsigned short dat1, unsigned short dat2)
+void pfpufn(uint16_t voice, uint16_t par, uint16_t dat1, uint16_t dat2)
 {
-	register unsigned short *fpu;
-	short delay;
+	register uint16_t *fpu;
+	int16_t delay;
 
 	fpu = io_fpu + FPU_OFNC + (voice << 8) + (par << 4);
@@ -172,15 +172,15 @@
 	case PSA_MLT:		/* multiplier */
 
-		*(fpu + (long)FPU_TSF1) = dat2;
+		*(fpu + (int32_t)FPU_TSF1) = dat2;
 		break;
 
 	case PSA_TIM:		/* time */
 
-		*(fpu + (long)FPU_TMNT) = (((long)dat2 & 0x0000FFF0L)
-		        * ((long)timemlt & 0x0000FFFFL)) >> 15;
+		*(fpu + (int32_t)FPU_TMNT) = (((int32_t)dat2 & 0x0000FFF0L)
+		        * ((int32_t)timemlt & 0x0000FFFFL)) >> 15;
 
 		++delay;
 
-		*(fpu + (long)FPU_TEXP) = expbit[dat2 & 0x000F];
+		*(fpu + (int32_t)FPU_TEXP) = expbit[dat2 & 0x000F];
 
 		break;
@@ -209,5 +209,5 @@
 */
 
-void pdoctl(short voice, short osc, short dat1, short dat2)
+void pdoctl(int16_t voice, int16_t osc, int16_t dat1, int16_t dat2)
 {
 	register struct instdef *ip;
@@ -230,9 +230,9 @@
 void dopatch(struct patch *pp)
 {
-	register unsigned short suba, dat1, dat2;
-	register short i, temp;
-	register char *ser, *iorec;
-	unsigned short chan, oldsr, osc, port, spec, sat,trig, vgr, vgn, vgt;
-	short baseled, curled, ledctl;
+	register uint16_t suba, dat1, dat2;
+	register int16_t i, temp;
+	register int8_t *ser, *iorec;
+	uint16_t chan, oldsr, osc, port, spec, sat,trig, vgr, vgn, vgt;
+	int16_t baseled, curled, ledctl;
 
 	spec = PE_SPEC & pp->paspec;		/* destination */
