Index: ram/lcdlbls.c
===================================================================
--- ram/lcdlbls.c	(revision 6dd74a91deaf351eb39ff277233faa17ef83cab5)
+++ ram/lcdlbls.c	(revision 7258c6ac4de2518c5430095742a27be7af0c89d7)
@@ -48,17 +48,17 @@
 
 */
-extern	char	gain2eq(short gain);
-
-extern	unsigned	setsr(unsigned sr);
-
-extern	void	(*d_key)(short k);
+extern	int8_t	gain2eq(int16_t gain);
+
+extern	uint16_t	setsr(uint16_t sr);
+
+extern	void	(*d_key)(int16_t k);
 extern	void	(*e_key)(void);
 extern	void	(*m_key)(void);
 extern	void	(*x_key)(void);
-extern	void	(*olddkey)(short k);
+extern	void	(*olddkey)(int16_t k);
 extern	void	(*oldekey)(void);
 extern	void	(*oldmkey)(void);
 extern	void	(*oldxkey)(void);
-extern	void	(*point)(short x, short y, short pen);
+extern	void	(*point)(int16_t x, int16_t y, int16_t pen);
 
 extern	LPF	(*oldsw)[];
@@ -67,50 +67,50 @@
 extern	LPF	aswtbl[14];
 
-extern	short	asig;
-extern	short	asmode;
-extern	short	astat;
-extern	short	aval;
-extern	short	clkrun;
-extern	short	ctrsw;
-extern	short	curasg;
-extern	short	gomode;
-extern	short	ismode;
-extern	short	lampio;
-extern	short	lampsw;
-extern	short	loadrow;
-extern	short	loadsw;
-extern	short	ltagged;
-extern	short	ndisp;
-extern	short	oldpk;
-extern	short	oldsl;
-extern	short	pkctrl;
-extern	short	recsw;
-extern	short	sliders;
-extern	short	tagslot;
-extern	short	tmpomlt;
-extern	short	tmpoval;
-extern	short	tuneval;
-
-extern	unsigned short	seqdupd;
-
-extern	short	BGeq[];
-extern	short	BGother[];
-extern	short	BGprmtr[];
-
-extern	short	articen[];
-extern	short	grpmode[];
-extern	short	grpsel[];
-extern	short	grpstat[];
-extern	short	ins2grp[];
-extern	short	lastart[];
-extern	short	s_trns[];
-extern	short	vce2grp[];
-extern	short	vce2trg[];
-
-extern	short	anrs[][16];
-
-extern	long	iotime;
-extern	long	lcdontm;
-extern	long	lcdtime;
+extern	int16_t	asig;
+extern	int16_t	asmode;
+extern	int16_t	astat;
+extern	int16_t	aval;
+extern	int16_t	clkrun;
+extern	int16_t	ctrsw;
+extern	int16_t	curasg;
+extern	int16_t	gomode;
+extern	int16_t	ismode;
+extern	int16_t	lampio;
+extern	int16_t	lampsw;
+extern	int16_t	loadrow;
+extern	int16_t	loadsw;
+extern	int16_t	ltagged;
+extern	int16_t	ndisp;
+extern	int16_t	oldpk;
+extern	int16_t	oldsl;
+extern	int16_t	pkctrl;
+extern	int16_t	recsw;
+extern	int16_t	sliders;
+extern	int16_t	tagslot;
+extern	int16_t	tmpomlt;
+extern	int16_t	tmpoval;
+extern	int16_t	tuneval;
+
+extern	uint16_t	seqdupd;
+
+extern	int16_t	BGeq[];
+extern	int16_t	BGother[];
+extern	int16_t	BGprmtr[];
+
+extern	int16_t	articen[];
+extern	int16_t	grpmode[];
+extern	int16_t	grpsel[];
+extern	int16_t	grpstat[];
+extern	int16_t	ins2grp[];
+extern	int16_t	lastart[];
+extern	int16_t	s_trns[];
+extern	int16_t	vce2grp[];
+extern	int16_t	vce2trg[];
+
+extern	int16_t	anrs[][16];
+
+extern	int32_t	iotime;
+extern	int32_t	lcdontm;
+extern	int32_t	lcdtime;
 
 extern	struct	gdsel	*gdstbc[];
@@ -124,22 +124,22 @@
 /* forward references */
 
-void	l_none(short _1, short _2);
-void	l_prmtr(short stat, short sig);
-void	l_other(short stat, short sig);
-void	l_voice(short stat, short vce);
-void	l_init(short stat, short sig);
-void	l_clock(short stat, short _2);
-void	l_eq(short stat, short sig);
-void	trapper(short stat, short _2);
-void	setlamp(short stat, short _2);
-void	rpctl(short stat, short _2);
-void	quiet(short _1, short _2);
-void	l_group(short stat, short grp);
-void	l_dflt(short stat, short _2);
-void	l_inst(short stat, short _2);
-void	l_goto(short stat, short _2);
-void	l_asgn(short stat, short _2);
-void	l_adfl(short stat, short _2);
-void	l_load(short stat, short _2);
+void	l_none(int16_t _1, int16_t _2);
+void	l_prmtr(int16_t stat, int16_t sig);
+void	l_other(int16_t stat, int16_t sig);
+void	l_voice(int16_t stat, int16_t vce);
+void	l_init(int16_t stat, int16_t sig);
+void	l_clock(int16_t stat, int16_t _2);
+void	l_eq(int16_t stat, int16_t sig);
+void	trapper(int16_t stat, int16_t _2);
+void	setlamp(int16_t stat, int16_t _2);
+void	rpctl(int16_t stat, int16_t _2);
+void	quiet(int16_t _1, int16_t _2);
+void	l_group(int16_t stat, int16_t grp);
+void	l_dflt(int16_t stat, int16_t _2);
+void	l_inst(int16_t stat, int16_t _2);
+void	l_goto(int16_t stat, int16_t _2);
+void	l_asgn(int16_t stat, int16_t _2);
+void	l_adfl(int16_t stat, int16_t _2);
+void	l_load(int16_t stat, int16_t _2);
 
 /* initialized stuff */
@@ -147,7 +147,7 @@
 /* BarType -- LCD slider bar graph type table -- 0 = bottom, 1 = centered */
 
-short	BarType[14] = { 1, 0,   0, 0, 0,   1, 1, 1, 1,   0, 0, 0,   1, 0 };
-
-short	artitab[] = {		/* articulation pot initialization values */
+int16_t	BarType[14] = { 1, 0,   0, 0, 0,   1, 1, 1, 1,   0, 0, 0,   1, 0 };
+
+int16_t	artitab[] = {		/* articulation pot initialization values */
 
 	ARTIVAL(500),	/* locn  */
@@ -170,11 +170,11 @@
 /*	   sigtab[ 25  26  27  28  29  30  31  32  33  34  35  36  37  38] */ 
 
-short	arpar[] = { 4,  2,  9, 11, 12,  1,  3,  5,  7, 13, 14, 15, 10,  6};
-
-/* 
-
-*/
-
-short	sl2gain[32] = {		/* slider value to EQ gain conversion table */
+int16_t	arpar[] = { 4,  2,  9, 11, 12,  1,  3,  5,  7, 13, 14, 15, 10,  6};
+
+/* 
+
+*/
+
+int16_t	sl2gain[32] = {		/* slider value to EQ gain conversion table */
 
 	-12, -12, -12, -12, -12, -11, -10, -9 ,-8 ,-7, -6, -5, -4, -3, -2, -1,
@@ -182,5 +182,5 @@
 };
 
-short	vmasks[16] = {		/* variable resolution masks */
+int16_t	vmasks[16] = {		/* variable resolution masks */
 
 	0x8000, 0xC000, 0xE000, 0xF000,
@@ -190,9 +190,9 @@
 };
 
-short	src2var[14] = {		/* source number to analog variable number map */
+int16_t	src2var[14] = {		/* source number to analog variable number map */
 
 	-1, -1,  3, -1, -1, -1,  5, -1,  4, -1, -1,  0,  1,  2 };
 
-char	*potlbls[] = {		/* LCD pot labels */
+int8_t	*potlbls[] = {		/* LCD pot labels */
 
 	/* Pot:  25    26    27    28    29    30    31    32    33    34    35    36    37    38 */
@@ -209,5 +209,5 @@
 
 #if	ROMPOK
-char	*swtlbls[] = {		/* LCD switch labels -- ROMP ENABLED */
+int8_t	*swtlbls[] = {		/* LCD switch labels -- ROMP ENABLED */
 
 	/* 0 */	"Quiet ROMP  Lamp  Clock  P/R  Go To Instr Asgmt Load              Other Voice Init ",
@@ -234,5 +234,5 @@
 #endif
 
-char	*aslbls[] = {		/* Assignment select key labels */
+int8_t	*aslbls[] = {		/* Assignment select key labels */
 
 	"Asgmt",	/* 0 */
@@ -446,5 +446,5 @@
 */
 
-void l_none(short _1, short _2)
+void l_none(int16_t _1, int16_t _2)
 {
 }
@@ -460,7 +460,7 @@
 */
 
-void quiet(short _1, short _2)
-{
-	register short vce;
+void quiet(int16_t _1, int16_t _2)
+{
+	register int16_t vce;
 
 	for (vce = 0; vce < 12; vce++)		/* for each voice ... */
@@ -483,5 +483,5 @@
 */
 
-void rpctl(short stat, short _2)
+void rpctl(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -502,5 +502,5 @@
 */
 
-void trapper(short stat, short _2)
+void trapper(int16_t stat, int16_t _2)
 {
 	if (stat)
@@ -514,5 +514,5 @@
 */
 
-void l_clock(short stat, short _2)
+void l_clock(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -557,5 +557,5 @@
 void preio(void)
 {
-	short oldipl;
+	int16_t oldipl;
 
 	oldipl = setipl(TIM_DI);
@@ -577,5 +577,5 @@
 void postio(void)
 {
-	short oldipl;
+	int16_t oldipl;
 
 	oldipl = setipl(TIM_DI);
@@ -602,7 +602,7 @@
 */
 
-void setlamp(short stat, short _2)
-{
-	register short oldi;
+void setlamp(int16_t stat, int16_t _2)
+{
+	register int16_t oldi;
 
 	if (NOT stat)		/* only act on key closures */
@@ -637,5 +637,5 @@
 void lcd_on(void)
 {
-	register short oldi;
+	register int16_t oldi;
 
 	oldi = setipl(TIM_DI);	/* disable interrupts to keep out the timer */
@@ -657,5 +657,5 @@
 */
 
-void loadkey(short key)
+void loadkey(int16_t key)
 {
 	if (NOT astat)
@@ -694,5 +694,5 @@
 */
 
-void pcancel(short pm)
+void pcancel(int16_t pm)
 {
 	point = GLCplot;		/* setup to plot on LCD */
@@ -743,5 +743,5 @@
 */
 
-void l_load(short stat, short _2)
+void l_load(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -823,7 +823,7 @@
 void lcdlbls(void)
 {
-	register short i, barval;
-	char buf[8];
-	char dsp[86];
+	register int16_t i, barval;
+	int8_t buf[8];
+	int8_t dsp[86];
 
 	point = GLCplot;		/* set up to plot on the LCD */
@@ -984,5 +984,5 @@
 */
 
-void selasg(short n)
+void selasg(int16_t n)
 {
 	register struct s_entry *ep;
@@ -1037,5 +1037,5 @@
 */
 
-void l_adfl(short stat, short _2)
+void l_adfl(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -1055,5 +1055,5 @@
 */
 
-void l_asgn(short stat, short _2)
+void l_asgn(int16_t stat, int16_t _2)
 {
 	if (NOT stat)			/* only do this on key closure */
@@ -1128,5 +1128,5 @@
 */
 
-void l_inst(short stat, short _2)
+void l_inst(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -1205,7 +1205,7 @@
 */
 
-void selins(short ival)
-{
-	register short n;
+void selins(int16_t ival)
+{
+	register int16_t n;
 	register struct s_entry *ep;
 
@@ -1267,5 +1267,5 @@
 */
 
-void l_dflt(short stat, short _2)
+void l_dflt(int16_t stat, int16_t _2)
 {
 	if (NOT stat)
@@ -1285,5 +1285,5 @@
 */
 
-void l_goto(short stat, short _2)
+void l_goto(int16_t stat, int16_t _2)
 {
 	if (NOT stat)			/* only do this on key closure */
@@ -1359,12 +1359,12 @@
 */
 
-void newpps(short trg, short grp, short src, short ival)
+void newpps(int16_t trg, int16_t grp, int16_t src, int16_t ival)
 {
 	register struct sment *smf, *smp;
-	register unsigned *fpu;
-	register long ltmp;
-	register short val;
-	register short vce;
-	short gs, oldi;
+	register uint16_t *fpu;
+	register int32_t ltmp;
+	register int16_t val;
+	register int16_t vce;
+	int16_t gs, oldi;
 
 	gs = (grp << 4) | src;		/* calculate group/source index */
@@ -1394,12 +1394,12 @@
 			case 10:	/* filtr */
 
-				ltmp = ((long)ival >> 1) + ((long)ival >> 2);
-
-				if (ltmp > (long)VALMAX)
-					ltmp = (long)VALMAX;
-				else if (ltmp < (long)VALMIN)
-					ltmp = (long)VALMIN;
-
-				val = (short)ltmp;
+				ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
+
+				if (ltmp > (int32_t)VALMAX)
+					ltmp = (int32_t)VALMAX;
+				else if (ltmp < (int32_t)VALMIN)
+					ltmp = (int32_t)VALMIN;
+
+				val = (int16_t)ltmp;
 				break;
 
@@ -1433,13 +1433,13 @@
 */
 
-short newsv(short grp, short src, short ival)
+int16_t newsv(int16_t grp, int16_t src, int16_t ival)
 {
 	register struct sment *smf, *smp;
-	register unsigned *fpu;
-	register long ltmp;
-	register short val;
-	register short gs;
-	register short oldi;
-	short vmask, var;
+	register uint16_t *fpu;
+	register int32_t ltmp;
+	register int16_t val;
+	register int16_t gs;
+	register int16_t oldi;
+	int16_t vmask, var;
 
 	gs  = (grp << 4) | src;			/* calculate grp/src index */
@@ -1484,12 +1484,12 @@
 		case 10:	/* filtr */
 
-			ltmp = ((long)ival >> 1) + ((long)ival >> 2);
-
-			if (ltmp > (long)VALMAX)
-				ltmp = (long)VALMAX;
-			else if (ltmp < (long)VALMIN)
-				ltmp = (long)VALMIN;
-
-			val = (short)ltmp;
+			ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
+
+			if (ltmp > (int32_t)VALMAX)
+				ltmp = (int32_t)VALMAX;
+			else if (ltmp < (int32_t)VALMIN)
+				ltmp = (int32_t)VALMIN;
+
+			val = (int16_t)ltmp;
 			break;
 
@@ -1524,12 +1524,12 @@
 */
 
-void setsv(short grp, short src, short ival)
+void setsv(int16_t grp, int16_t src, int16_t ival)
 {
 	register struct sment *smf, *smp;
-	register unsigned *fpu;
-	register long ltmp;
-	register short val;
-	register short gs;
-	register short oldi;
+	register uint16_t *fpu;
+	register int32_t ltmp;
+	register int16_t val;
+	register int16_t gs;
+	register int16_t oldi;
 
 	gs  = (grp << 4) | src;			/* calculate grp/src index */
@@ -1558,12 +1558,12 @@
 		case 10:	/* filtr */
 
-			ltmp = ((long)ival >> 1) + ((long)ival >> 2);
-
-			if (ltmp > (long)VALMAX)
-				ltmp = (long)VALMAX;
-			else if (ltmp < (long)VALMIN)
-				ltmp = (long)VALMIN;
-
-			val = (short)ltmp;
+			ltmp = ((int32_t)ival >> 1) + ((int32_t)ival >> 2);
+
+			if (ltmp > (int32_t)VALMAX)
+				ltmp = (int32_t)VALMAX;
+			else if (ltmp < (int32_t)VALMIN)
+				ltmp = (int32_t)VALMIN;
+
+			val = (int16_t)ltmp;
 			break;
 
@@ -1596,5 +1596,5 @@
 */
 
-void l_prmtr(short stat, short sig)
+void l_prmtr(int16_t stat, int16_t sig)
 {
 	if (NOT stat)
@@ -1633,10 +1633,10 @@
 */
 
-void l_voice(short stat, short vce)
-{
-	register short ap, j, par;
-	register unsigned *fpu;
-
-	char buf[8];
+void l_voice(int16_t stat, int16_t vce)
+{
+	register int16_t ap, j, par;
+	register uint16_t *fpu;
+
+	int8_t buf[8];
 
 	if (NOT stat)
@@ -1679,7 +1679,7 @@
 */
 
-void l_group(short stat, short grp)
-{
-	char buf[8];
+void l_group(int16_t stat, int16_t grp)
+{
+	int8_t buf[8];
 
 	if (NOT stat)
@@ -1702,5 +1702,5 @@
 */
 
-void l_other(short stat, short sig)
+void l_other(int16_t stat, int16_t sig)
 {
 	if (NOT stat)
@@ -1723,5 +1723,5 @@
 */
 
-void l_eq(short stat, short sig)
+void l_eq(int16_t stat, int16_t sig)
 {
 	if (NOT stat)
@@ -1750,5 +1750,5 @@
 void artclr(void)
 {
-	register short i;
+	register int16_t i;
 
 	for (i = 0; i < 14; i++)
@@ -1766,9 +1766,9 @@
 */
 
-void l_init(short stat, short sig)
-{
-	register unsigned *fpu;
-	register short barval, i, j;
-	char buf[16];
+void l_init(int16_t stat, int16_t sig)
+{
+	register uint16_t *fpu;
+	register int16_t barval, i, j;
+	int8_t buf[16];
 
 	if (NOT stat)
@@ -1846,9 +1846,9 @@
 */
 
-void sendart(short vce, short par, short ival)
-{
-	register unsigned *fpu;
-	register short val, oldi, mult;
-	short nop;
+void sendart(int16_t vce, int16_t par, int16_t ival)
+{
+	register uint16_t *fpu;
+	register int16_t val, oldi, mult;
+	int16_t nop;
 
 	lastart[par] = ival;
@@ -1919,5 +1919,5 @@
 void doslide(void)
 {
-	register short arp, bar, barval, i, slval;
+	register int16_t arp, bar, barval, i, slval;
 
 	slval = ART_VAL(aval);	/* scaled articulation value */
@@ -2029,11 +2029,11 @@
 */
 
-void settmpo(short val)
-{
-	register short timeval;
+void settmpo(int16_t val)
+{
+	register int16_t timeval;
 
 	tmpoval  = val;
 	timeval  = ( ( (tmpomlt + 50) * tmpoval) / 100);
-	timeval  = (short)( (192000L / timeval) - 1);
+	timeval  = (int16_t)( (192000L / timeval) - 1);
 	TIME_T2H = timeval >> 8;
 	TIME_T2L = timeval & 0x00FF;
@@ -2052,8 +2052,8 @@
 void settune(void)
 {
-	register short oldi, i, grp;
-	register unsigned *fpu;
-	register long trval, trmax;
-	short nop;
+	register int16_t oldi, i, grp;
+	register uint16_t *fpu;
+	register int32_t trval, trmax;
+	int16_t nop;
 
 	trmax = PCHMAX;
@@ -2067,5 +2067,5 @@
 		if (-1 NE (grp = vce2grp[i])) {
 
-			trval = (long)tuneval + ((long)s_trns[grp - 1] << 1);
+			trval = (int32_t)tuneval + ((int32_t)s_trns[grp - 1] << 1);
 
 			if (trval > trmax)
@@ -2074,10 +2074,10 @@
 		} else {
 
-			trval = (long)tuneval;
+			trval = (int32_t)tuneval;
 		}
 
 		fpu = io_fpu + FPU_OFNC + (i << 8) + 0x0010;	/* freq 1 */
 
-		*(fpu + FPU_TCV3) = (unsigned)(0x0000FFFFL & trval);
+		*(fpu + FPU_TCV3) = (uint16_t)(0x0000FFFFL & trval);
 		++nop;	++nop;	++nop;
 		*(fpu + FPU_TSF3) = 0x7FFF;
