Index: ram/ptselbx.c
===================================================================
--- ram/ptselbx.c	(revision 60288f548947383de9a52a06e402df2698a3ce5d)
+++ ram/ptselbx.c	(revision 7258c6ac4de2518c5430095742a27be7af0c89d7)
@@ -43,79 +43,79 @@
 */
 
-extern	short	cnvp2c(void);
-extern	short	dec2fr(char *s);
-
-extern	unsigned	exp_c(unsigned c);
-
-extern	short	CurLine;
-
-extern	short	cents;
-extern	short	cmtype;
-extern	short	cxval;
-extern	short	cyval;
-extern	short	hitcx;
-extern	short	hitcy;
-extern	short	stccol;
-extern	short	stcrow;
-extern	short	submenu;
-extern	short	vtccol;
-extern	short	vtcrow;
-
-extern	short	ndvals[];
-
-extern	unsigned	*obj11;
+extern	int16_t	cnvp2c(void);
+extern	int16_t	dec2fr(int8_t *s);
+
+extern	uint16_t	exp_c(uint16_t c);
+
+extern	int16_t	CurLine;
+
+extern	int16_t	cents;
+extern	int16_t	cmtype;
+extern	int16_t	cxval;
+extern	int16_t	cyval;
+extern	int16_t	hitcx;
+extern	int16_t	hitcy;
+extern	int16_t	stccol;
+extern	int16_t	stcrow;
+extern	int16_t	submenu;
+extern	int16_t	vtccol;
+extern	int16_t	vtcrow;
+
+extern	int16_t	ndvals[];
+
+extern	uint16_t	*obj11;
 
 extern	struct selbox	*csbp;
 extern	struct selbox	*curboxp;
 
-extern	char	*smdata[];
-extern	char	*ssdata[];
-extern	char	*stdata[];
-extern	char	*trdata[];
-
-short	ptfnbox(short n);
-
-/* 
-
-*/
-
-short	ptegood;		/* pte buffer -- entire entry valid flag */
-
-short	ptedfok;		/* pte buffer -- def valid flag */
-short	ptestok;		/* pte buffer -- stm valid flag */
-short	ptedsok;		/* pte buffer -- destination valid flag */
-short	ptedtok;		/* pte buffer -- datum valid flag */
-
-short	ptedef;			/* pte buffer -- definer number */
-short	ptestm;			/* pte buffer -- stimulus number */
-short	ptespec;		/* pte buffer -- address type */
-short	ptesuba;		/* pte buffer -- sub-address */
-short	ptedat1;		/* pte buffer -- data word 1 */
-short	ptedat2;		/* pte buffer -- data word 2 */
-
-short	ptedftp;		/* definer / stimulus entry flag */
-
-short	ptedfst;		/* current definer/stimulus data entry format */
-short	ptedest;		/* current destination data entry format */
-short	ptedata;		/* current datum data entry format */
-
-short	ptemenu;		/* current submenu highlighting */
-
-short	pteset;			/* pte buffer setup flag */
-short	ptbflag;		/* pdbuf setup flag */
-
-short	ptecpos;		/* current patch entry index */
-short	ptepred;		/* predecessor entry index */
-short	ptesucc;		/* successor entry index */
+extern	int8_t	*smdata[];
+extern	int8_t	*ssdata[];
+extern	int8_t	*stdata[];
+extern	int8_t	*trdata[];
+
+int16_t	ptfnbox(int16_t n);
+
+/* 
+
+*/
+
+int16_t	ptegood;		/* pte buffer -- entire entry valid flag */
+
+int16_t	ptedfok;		/* pte buffer -- def valid flag */
+int16_t	ptestok;		/* pte buffer -- stm valid flag */
+int16_t	ptedsok;		/* pte buffer -- destination valid flag */
+int16_t	ptedtok;		/* pte buffer -- datum valid flag */
+
+int16_t	ptedef;			/* pte buffer -- definer number */
+int16_t	ptestm;			/* pte buffer -- stimulus number */
+int16_t	ptespec;		/* pte buffer -- address type */
+int16_t	ptesuba;		/* pte buffer -- sub-address */
+int16_t	ptedat1;		/* pte buffer -- data word 1 */
+int16_t	ptedat2;		/* pte buffer -- data word 2 */
+
+int16_t	ptedftp;		/* definer / stimulus entry flag */
+
+int16_t	ptedfst;		/* current definer/stimulus data entry format */
+int16_t	ptedest;		/* current destination data entry format */
+int16_t	ptedata;		/* current datum data entry format */
+
+int16_t	ptemenu;		/* current submenu highlighting */
+
+int16_t	pteset;			/* pte buffer setup flag */
+int16_t	ptbflag;		/* pdbuf setup flag */
+
+int16_t	ptecpos;		/* current patch entry index */
+int16_t	ptepred;		/* predecessor entry index */
+int16_t	ptesucc;		/* successor entry index */
 
 struct patch	ptebuf;		/* pte buffer -- patch table format */
 
-char	ptdebuf[50];		/* patch edit buffer */
-
-/* 
-
-*/
-
-char	*rawdfst[] = {		/* def/stm field initial contents */
+int8_t	ptdebuf[50];		/* patch edit buffer */
+
+/* 
+
+*/
+
+int8_t	*rawdfst[] = {		/* def/stm field initial contents */
 
 	"Key 001 1 01",
@@ -125,5 +125,5 @@
 };
 
-char	*rawdest[] = {		/* destination field initial contents */
+int8_t	*rawdest[] = {		/* destination field initial contents */
 
 	"??????? 00 ??",	/* ??????	00 */
@@ -160,22 +160,22 @@
 */
 
-char	*rawmode[] = { "Frq ",  "Pch ",   "Int ",  "Rat " };	/* oscillator modes */
-char	*rawmdat[] = { "00.1 ", "0C 00",  "+0000", "1/1  " };	/* oscillator data */
-
-short	omtabl[]   = { PSO_FRQ, PSO_PCH, PSO_INT, PSO_RAT };	/* oscillator modes */
-short	omdtab[]   = { 2,       320,     0,       0       };	/* oscillator data */
-short	omftab[]   = { 6,       7,       4,       5       };	/* mode data format */
-
-char	*rawfpud[] = { "PchWh", "+0.00", "00001", "\2400.00", "Start" };
-
-short	fpudtab[]  = { SM_HTPW,       0,          1,       0,	    1 };
-short	fpuetab[]  = {      11,       1,          2,       3,       9 };
-
-short	dfsttab[] = { 0x0000, 0x8000, 0x1100, 0x1180 };
-
-short	defcols[] = {  2,  6,  7,  8};	/* def data entry columns */
-short	stmcols[] = { 15, 19, 20, 21};	/* stm data entry columns */
-
-short	dstcols[] = {			/* destination data entry columns */
+int8_t	*rawmode[] = { "Frq ",  "Pch ",   "Int ",  "Rat " };	/* oscillator modes */
+int8_t	*rawmdat[] = { "00.1 ", "0C 00",  "+0000", "1/1  " };	/* oscillator data */
+
+int16_t	omtabl[]   = { PSO_FRQ, PSO_PCH, PSO_INT, PSO_RAT };	/* oscillator modes */
+int16_t	omdtab[]   = { 2,       320,     0,       0       };	/* oscillator data */
+int16_t	omftab[]   = { 6,       7,       4,       5       };	/* mode data format */
+
+int8_t	*rawfpud[] = { "PchWh", "+0.00", "00001", "\2400.00", "Start" };
+
+int16_t	fpudtab[]  = { SM_HTPW,       0,          1,       0,	    1 };
+int16_t	fpuetab[]  = {      11,       1,          2,       3,       9 };
+
+int16_t	dfsttab[] = { 0x0000, 0x8000, 0x1100, 0x1180 };
+
+int16_t	defcols[] = {  2,  6,  7,  8};	/* def data entry columns */
+int16_t	stmcols[] = { 15, 19, 20, 21};	/* stm data entry columns */
+
+int16_t	dstcols[] = {			/* destination data entry columns */
 
 /*	-1,  0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10	*/
@@ -183,7 +183,7 @@
 };
 
-short	dfsttp[] = { 1,  1,  2,  3 };	/* def/stm formats */
-
-short	datasrc[] = {
+int16_t	dfsttp[] = { 1,  1,  2,  3 };	/* def/stm formats */
+
+int16_t	datasrc[] = {
 
 	SM_HTPW,  SM_VTMW,  SM_LPBR,  SM_PED1,  SM_CTL1,
@@ -195,5 +195,5 @@
 */
 
-short	destype[] = {			/* destination type table */
+int16_t	destype[] = {			/* destination type table */
 
 	PA_KEY,		-1,		PA_TRG,		PA_PLS,		PA_LED,
@@ -208,5 +208,5 @@
 };
 
-char	destfmt[] = {		/* destination data entry format table */
+int8_t	destfmt[] = {		/* destination data entry format table */
 
 	 0,	-1,	 1,	 2,	 3,	/*  1 ..  5 */
@@ -218,5 +218,5 @@
 };
 
-char	datafmt[] = {		/* datum data entry format table */
+int8_t	datafmt[] = {		/* datum data entry format table */
 
 	8,		-1,		9,		8,		14,
@@ -232,5 +232,5 @@
 */
 
-char	desdatf[] = {		/* data entry default flags */
+int8_t	desdatf[] = {		/* data entry default flags */
 
 	2,		0,		2,		2,		1,
@@ -242,5 +242,5 @@
 };
 
-short	desdat1[] = {		/* data word 1 defaults */
+int16_t	desdat1[] = {		/* data word 1 defaults */
 
 	0,		0,		0,		0,		0,
@@ -252,5 +252,5 @@
 };
 
-short	desdat2[] = {		/* data word 2 defaults */
+int16_t	desdat2[] = {		/* data word 2 defaults */
 
 	0,		0,		1,		0,		0,
@@ -266,5 +266,5 @@
 */
 
-char	*rawdata[] = {
+int8_t	*rawdata[] = {
 
 	"Trans",	"     ",	"Start",	"Trans",	"000  ",
@@ -276,5 +276,5 @@
 };
 
-char	hilitab[][8] = {		/* submenu highlight table */
+int8_t	hilitab[][8] = {		/* submenu highlight table */
 
 	/* start, width, row1, row2, row3, row4, row5, pad */
@@ -308,7 +308,7 @@
 */
 
-void hilitpm(char n)
+void hilitpm(int8_t n)
 {
-	register short chr, h, v, w;
+	register int16_t chr, h, v, w;
 
 	ptemenu = n;				/* set current submenu type */
@@ -468,5 +468,5 @@
 */
 
-void movectc(short r, short c)
+void movectc(int16_t r, int16_t c)
 {
 	ctcpos(r, c);
@@ -480,5 +480,5 @@
 */
 
-void endpsm(short row, short col)
+void endpsm(int16_t row, int16_t col)
 {
 	submenu = FALSE;
@@ -503,9 +503,9 @@
 */
 
-void edefstm(short du, short n)
+void edefstm(int16_t du, int16_t n)
 {
-	short chan, port, stim;
-	register short i, left, right;
-	register long ltemp;
+	int16_t chan, port, stim;
+	register int16_t i, left, right;
+	register int32_t ltemp;
 
 #if	DEBUGIT
@@ -662,9 +662,9 @@
 */
 
-void ptdest(short du)
+void ptdest(int16_t du)
 {
-	register long ltemp;
-	register short i, left, right, stim;
-	short port, chan;
+	register int32_t ltemp;
+	register int16_t i, left, right, stim;
+	int16_t port, chan;
 
 #if	DEBUGIT
@@ -905,5 +905,5 @@
 */
 
-void setsubm(short r, short c)
+void setsubm(int16_t r, int16_t c)
 {
 	submenu = TRUE;
@@ -922,8 +922,8 @@
 */
 
-short ptfnbox(short n)
+int16_t ptfnbox(int16_t n)
 {
-	register short i, box, ptd, ptt;
-	register long ltemp;
+	register int16_t i, box, ptd, ptt;
+	register int32_t ltemp;
 
 	if (NOT submenu) {			/* PATCH DATA ENTRY LINE */
@@ -1041,5 +1041,5 @@
 				}
 
-				ptedat2 = tofpu((unsigned short)ltemp);
+				ptedat2 = tofpu((uint16_t)ltemp);
 				epatch();	/* enter -- time */
 				return(SUCCESS);
