Index: ram/dopatch.c
===================================================================
--- ram/dopatch.c	(revision 432327d61294cce757d5a4a7aff568c99952a3b5)
+++ ram/dopatch.c	(revision 6099cacb5e0cb602156d4647cb268ee3302d40a5)
@@ -29,5 +29,5 @@
 int16_t	lg2base[7] = { 0, 3, 7, 10, 14, 17, 21};	/* LED group bases */
 
-int8_t	vgtype[] = {
+uint8_t	vgtype[] = {
 
 	ST_NUL,		/* PA_NULL */
@@ -76,5 +76,5 @@
 	if (slot) {		/* waveshape slot B */
 
-		vbufs[voice].idhwsb = wsn;
+		vbufs[voice].idhwsb = (int8_t)wsn;
 
 		memcpyw(vbufs[voice].idhwvbf, &wslib[wsn],
@@ -85,10 +85,10 @@
 		memcpyw(fpuws, vbufs[voice].idhwvbf, NUMWPNT);
 
-		*(fpuws - 1) = vbufs[voice].idhwvbf[0];
-		*(fpuws + NUMWPNT) = vbufs[voice].idhwvbf[NUMWPNT - 1];
+		*(fpuws - 1) = (uint16_t)vbufs[voice].idhwvbf[0];
+		*(fpuws + NUMWPNT) = (uint16_t)vbufs[voice].idhwvbf[NUMWPNT - 1];
 
 	} else {		/* waveshape slot A */
 
-		vbufs[voice].idhwsa = wsn;
+		vbufs[voice].idhwsa = (int8_t)wsn;
 
 		memcpyw(vbufs[voice].idhwvaf, &wslib[wsn],
@@ -99,6 +99,6 @@
 		memcpyw(fpuws, vbufs[curvce].idhwvaf, NUMWPNT);
 
-		*(fpuws - 1) = vbufs[voice].idhwvaf[0];
-		*(fpuws + NUMWPNT) = vbufs[voice].idhwvaf[NUMWPNT - 1];
+		*(fpuws - 1) = (uint16_t)vbufs[voice].idhwvaf[0];
+		*(fpuws + NUMWPNT) = (uint16_t)vbufs[voice].idhwvaf[NUMWPNT - 1];
 
 	}
@@ -111,5 +111,5 @@
 */
 
-void pfpufn(uint16_t voice, uint16_t par, uint16_t dat1, uint16_t dat2)
+void pfpufn(int16_t voice, int16_t par, uint16_t dat1, uint16_t dat2)
 {
 	volatile uint16_t *fpu;
@@ -125,15 +125,15 @@
 	case PSA_MLT:		/* multiplier */
 
-		*(fpu + (int32_t)FPU_TSF1) = dat2;
+		*(fpu + FPU_TSF1) = dat2;
 		break;
 
 	case PSA_TIM:		/* time */
 
-		*(fpu + (int32_t)FPU_TMNT) = (((int32_t)dat2 & 0x0000FFF0L)
-			* ((int32_t)timemlt & 0x0000FFFFL)) >> 15;
+		*(fpu + FPU_TMNT) = (uint16_t)(((uint32_t)(dat2 & 0xFFF0)
+			* (uint32_t)timemlt) >> 15);
 
 		++delay;
 
-		*(fpu + (int32_t)FPU_TEXP) = expbit[dat2 & 0x000F];
+		*(fpu + FPU_TEXP) = expbit[dat2 & 0x000F];
 
 		break;
@@ -141,5 +141,5 @@
 	case PSA_VAL:		/* value */
 
-		sendval(voice, par, dat2);
+		sendval(voice, par, (int16_t)dat2);
 		break;
 
@@ -179,5 +179,6 @@
 	volatile uint8_t *ser;
 	int8_t *iorec;
-	uint16_t chan, oldsr, osc, port, spec, sat,trig, vgr, vgn, vgt;
+	uint16_t oldsr;
+	int16_t chan, osc, port, spec, sat, trig, vgr, vgn, vgt;
 	int16_t baseled, curled, ledctl;
 
@@ -191,6 +192,6 @@
 	if (ST_VGT & sat) {		/* vg, osc sub-address types */
 
-		vgr  = 0x00FF & (suba >>  8);		/* voice / group */
-		osc  = 0x00FF &  suba;			/* oscillator */
+		vgr  = (int16_t)(0x00FF & (suba >> 8));		/* voice / group */
+		osc  = (int16_t)(0x00FF &  suba);		/* oscillator */
 
 		if (vgr > 11) {		/* sort out voices from groups */
@@ -235,5 +236,5 @@
 			putwq(&ptefifo, suba);		/* closure */
 
-		seqdupd |= (1 << trig);
+		seqdupd |= ((uint16_t)1 << trig);
 		break;
 
@@ -259,16 +260,16 @@
 		case 0:				/* transient */
 
-			*ser = temp | 0x0082;			/* on */
-			*ser = (temp & 0x00FD) | 0x0080;	/* off */
+			*ser = (uint8_t)(temp | 0x0082);		/* on */
+			*ser = (uint8_t)((temp & 0x00FD) | 0x0080);	/* off */
 			break;
 
 		case 1:				/* off */
 
-			*ser = (temp & 0x00FD) | 0x0080;	/* off */
+			*ser = (uint8_t)((temp & 0x00FD) | 0x0080);	/* off */
 			break;
 
 		case 2:				/* on */
 
-			*ser = temp | 0x0082;			/* on */
+			*ser = (uint8_t)(temp | 0x0082);		/* on */
 			break;
 		}
@@ -290,10 +291,10 @@
 
 				ledstat[curled] = TRUE;
-				io_leds = curled;
+				io_leds = (uint8_t)curled;
 
 			} else if (ledctl EQ 2) {		/* off */
 
 				ledstat[curled] = FALSE;
-				io_leds = curled | 0x0080;
+				io_leds = (uint8_t)(curled | 0x0080);
 
 			} else if (ledctl EQ 3) {		/* toggle */
@@ -302,10 +303,10 @@
 
 					ledstat[curled] = FALSE;
-					io_leds = curled | 0x0080;
+					io_leds = (uint8_t)(curled | 0x0080);
 
 				} else {			/* off -> on */
 
 					ledstat[curled] = TRUE;
-					io_leds = curled;
+					io_leds = (uint8_t)curled;
 				}
 			}
@@ -317,5 +318,5 @@
 
 		seqline[suba] = dat1;
-		seqdupd |= (1 << suba);
+		seqdupd |= ((uint16_t)1 << suba);
 		break;
 
@@ -347,10 +348,10 @@
 		}
 
-		seqdupd |= (1 << suba);
+		seqdupd |= ((uint16_t)1 << suba);
 		break;
 
 	case PA_TUNE:		/* tuning table */
 
-		gettun(dat1);
+		gettun((int16_t)dat1);
 		break;
 
@@ -358,10 +359,10 @@
 
 		sregval[suba] = dat1 ? sregval[dat2] : dat2;
-		seqdupd |= (1 << suba);
+		seqdupd |= ((uint16_t)1 << suba);
 		break;
 
 	case PA_RADD:		/* regsister add */
 
-		temp = sregval[suba] + (dat1 ? sregval[dat2] : dat2);
+		temp = (int16_t)(sregval[suba] + (dat1 ? sregval[dat2] : dat2));
 
 		if (temp > 99)
@@ -370,6 +371,6 @@
 			temp = 0;
 
-		sregval[suba] = temp;
-		seqdupd |= (1 << suba);
+		sregval[suba] = (uint16_t)temp;
+		seqdupd |= ((uint16_t)1 << suba);
 		break;
 
@@ -378,5 +379,5 @@
 		if (vgt) {	/* group */
 
-			ins2grp[vgn] = (ins2grp[vgn] & 0xFF00) | dat1;
+			ins2grp[vgn] = (ins2grp[vgn] & (int16_t)0xFF00) | (int16_t)dat1;
 			setv2gi(vgn);
 
@@ -384,8 +385,8 @@
 
 			if (curvce EQ vgn)
-				curinst = dat1;
-
-			s_inst[vgn] = dat1;
-			execins(vgn, dat1, 1);
+				curinst = (int16_t)dat1;
+
+			s_inst[vgn] = (int16_t)dat1;
+			execins(vgn, (int16_t)dat1, 1);
 		}
 
@@ -398,9 +399,9 @@
 			for (i = 0; i < 12; i++)
 				if (vce2grp[i] EQ (1 + vgn))
-					pdoctl(i, osc, dat1, dat2);
+					pdoctl(i, osc, (int16_t)dat1, (int16_t)dat2);
 
 		} else {		/* voice */
 
-			pdoctl(vgn, osc, dat1, dat2);
+			pdoctl(vgn, osc, (int16_t)dat1, (int16_t)dat2);
 		}
 
@@ -413,9 +414,9 @@
 			for (i = 0; i < 12; i++)
 				if (vce2grp[i] EQ (1 + vgn))
-					pdows(0, i, dat1);
+					pdows(0, i, (int16_t)dat1);
 
 		} else {		/* voice */
 
-			pdows(0, vgn, dat1);
+			pdows(0, vgn, (int16_t)dat1);
 		}
 
@@ -428,9 +429,9 @@
 			for (i = 0; i < 12; i++)
 				if (vce2grp[i] EQ (1 + vgn))
-					pdows(1, i, dat1);
+					pdows(1, i, (int16_t)dat1);
 
 		} else {		/* voice */
 
-			pdows(1, vgn, dat1);
+			pdows(1, vgn, (int16_t)dat1);
 		}
 
@@ -444,10 +445,10 @@
 				if (vce2grp[i] EQ (1 + vgn)) {
 
-					vbufs[i].idhcfg = dat1;
+					vbufs[i].idhcfg = (int8_t)dat1;
 					dosync(i);
 				}
 		} else {
 
-			vbufs[vgn].idhcfg = dat1;
+			vbufs[vgn].idhcfg = (int8_t)dat1;
 			dosync(vgn);
 		}
Index: ram/dopatch.x
===================================================================
--- ram/dopatch.x	(revision 432327d61294cce757d5a4a7aff568c99952a3b5)
+++ ram/dopatch.x	(revision 6099cacb5e0cb602156d4647cb268ee3302d40a5)
@@ -22,5 +22,5 @@
 extern	int16_t		lg2base[7];
 extern	uint16_t	seqdupd;
-extern	int8_t		vgtype[];
+extern	uint8_t		vgtype[];
 
 /*
@@ -33,3 +33,3 @@
 extern	void		pdoctl(int16_t voice, int16_t osc, int16_t dat1, int16_t dat2);
 extern	void		pdows(int16_t slot, int16_t voice, int16_t wsn);
-extern	void		pfpufn(uint16_t voice, uint16_t par, uint16_t dat1, uint16_t dat2);
+extern	void		pfpufn(int16_t voice, int16_t par, uint16_t dat1, uint16_t dat2);
Index: ram/im700.c
===================================================================
--- ram/im700.c	(revision 432327d61294cce757d5a4a7aff568c99952a3b5)
+++ ram/im700.c	(revision 6099cacb5e0cb602156d4647cb268ee3302d40a5)
@@ -13,263 +13,263 @@
 #include "ram.h"
 
-int16_t	admctl;			/* assignment display submenu control variable */
-int16_t	adnamsw;		/* assignment display virtual typewriter flag */
-int16_t	aflag;			/* analog activity flag */
-int16_t	aform;			/* action buffer format */
-int16_t	amplval;		/* amplitude */
-int16_t	ancmsw;			/* analog variable r/p control source */
-int16_t	angroup;		/* analog variable group being shown */
-int16_t	asgfks;			/* first key selected */
-int16_t	asghit;			/* row hit / assignment in progress */
-int16_t	asgmod;			/* assignment number or table modified */
-int16_t	asig;			/* analog signal number */
-int16_t	asmode;			/* panel assignment mode */
-int16_t	astat;			/* analog signal status */
-int16_t	auxctl;			/* aux control flag */
-int16_t	aval;			/* analog signal value */
-int16_t	bform;			/* oscillator data buffer format */
-int16_t	catin;			/* catalog read in flag */
-int16_t	cents;			/* pitch to cents conversion buffer */
-int16_t	chtime;			/* horizontal cursor counter */
-int16_t	chwait;			/* horizontal cursor wait time */
-int16_t	cflag;			/* accidental flag */
-int16_t	clkctl;			/* clock control */
-int16_t	clkrun;			/* clock status */
-int16_t	clksrc;			/* clock source */
-int16_t	cmfirst;		/* first cursor motion switch */
-int16_t	cmtype;			/* cursor motion type */
-int16_t	cnote;			/* note value at cursor */
-int16_t	ctrsw;			/* scupd center update switch */
-int16_t	curasg;			/* current assignment table */
-int16_t	curfunc;		/* current function number */
-int16_t	curgrp;			/* current group */
-int16_t	curinst;		/* current instrument number */
-int16_t	curmop;			/* current MIDI output port */
-int16_t	curpnt;			/* current point number (absolute) */
-int16_t	curpos;			/* cursor pad position for current axis */
-int16_t	cursbox;		/* currently selected box */
-int16_t	curscor;		/* Current score number */
-int16_t	cursect;		/* current section */
-int16_t	curslim;		/* cursor type change point */
-int16_t	curtun;			/* current tuning table */
-int16_t	curvce;			/* current voice number */
-int16_t	curwave;		/* current waveshape library slot */
-int16_t	curwdth;		/* current waveshape cursor width */
-int16_t	curwfnl;		/* current waveshape final value */
-int16_t	curwhrm;		/* current waveshape harmonic number */
-int16_t	curwhrv;		/* current waveshape harmonic value */
-int16_t	curwoff;		/* current waveshape offset value */
-int16_t	curwpnt;		/* current waveshape point number */
-int16_t	curwslt;		/* current waveshape instrument slot */
-int16_t	cvtime;			/* vertical cursor counter */
-int16_t	cvwait;			/* veritcal cursor wait time */
-int16_t	cxrate;			/* cursor x rate */
-int16_t	cxval;			/* graphic cursor x value */
-int16_t	cyrate;			/* cursor y rate */
-int16_t	cyval;			/* graphic cursor y value */
-int16_t	debugne;		/* debug flag for note entry */
-int16_t	defect;			/* defect code */
-int16_t	dferror;		/* error code from BIOS or XBIOS */
-int16_t	dfsides;		/* number of sides */
-int16_t	dftype;			/* disk type code */
-int16_t	dsp_ok;			/* display update OK this cycle flag */
-int16_t	dubsw;			/* overdub / replace switch */
-int16_t	ebflag;			/* edit buffer data flag */
-int16_t	editss;			/* edit panel switch state */
-int16_t	editsw;			/* edit mode switch */
-int16_t	endflg;			/* !end flag */
-int16_t	ext_cv1;		/* CV-1 value */
-int16_t	ext_cv2;		/* CV-2 value */
-int16_t	ext_cv3;		/* CV-3 value */
-int16_t	ext_cv4;		/* CV-4 value */
-int16_t	ext_mod;		/* Aux Signal Mod value */
-int16_t	gomode;			/* go to mode */
-int16_t	grptran;		/* group translation value */
-int16_t	gtmsel;			/* group transpose/map select */
-int16_t	hitbox;			/* box we just hit */
-int16_t	hitcx;			/* x of cursor when we hit the box */
-int16_t	hitcy;			/* y of cursor when we hit the box */
-int16_t	idcfsw;			/* copy / fetch menu switch */
-int16_t	idimsw;			/* instrument display instrument menu switch */
-int16_t	idintmp;		/* temporary for instrument number */
-int16_t	idnamsw;		/* typewriter switch */
-int16_t	idsrcsw;		/* source menu switch */
-int16_t	idtdat;			/* current instrument vtyper data entry string */
-int16_t	imflag;			/* instrument modified flag */
-int16_t	initcfg;		/* initial configuration */
-int16_t	insmode;		/* score insert mode */
-int16_t	ismode;			/* instrument select mode */
-int16_t	lampio;			/* LCD timeout disable switch state at I/O time */
-int16_t	lampsw;			/* LCD timeout disable switch */
-int16_t	lasgsw;			/* assignments store switch */
-int16_t	lastam;			/* last assignment menu base */
-int16_t	ldelsw;			/* delete switch */
-int16_t	lderrsw;		/* error message displayed switch */
-int16_t	ldidsiz;		/* getcat() did showsiz() switch */
-int16_t	ldkind;			/* fetch file type */
-int16_t	ldpass;			/* librarian load state variable */
-int16_t	ldrow;			/* fetch select row */
-int16_t	ldslot;			/* fetch select slot */
-int16_t	legato;			/* execkey() "legato" mode switch */
-int16_t	lksel;			/* librarian key slot selector */
-int16_t	lmwtype;		/* librarian message window type */
-int16_t	loadrow;		/* librarian row selected for load letter */
-int16_t	loadsw;			/* panel "Load" mode state */
-int16_t	lorchl;			/* load hi (TRUE) / lo (FALSE) orchestra */
-int16_t	lorchsw;		/* hi orchestra (21 - 40) store switch */
-int16_t	lorclsw;		/* lo orchestra (01 - 20) store switch */
-int16_t	lpatsw;			/* patch table store switch */
-int16_t	lrasw;			/* append (TRUE) / replace (FALSE) score */
-int16_t	lscrsw;			/* score store switch */
-int16_t	lselsw;			/* fetch select switch */
-int16_t	lseqsw;			/* sequence table store switch */
-int16_t	lstbgnc;		/* last note begin entry table index */
-int16_t	lstendc;		/* last note end entry table index */
-int16_t	lstflag;		/* last note list end switch */
-int16_t	lstrsw;			/* store state switch */
-int16_t	lstwoff;		/* last waveshape offset value */
-int16_t	lstwpnt;		/* last waveshape point number */
-int16_t	ltagged;		/* load tag switch */
-int16_t	ltunsw;			/* tunings store switch */
-int16_t	lwavsw;			/* waveshapes store switch */
-int16_t	mascntr;		/* MIDI active sensing timeout counter */
-int16_t	mdb1;			/* current MIDI data byte 1 */
-int16_t	mdb2;			/* current MIDI data byte 2 */
-int16_t	michan;			/* current MIDI channel */
-int16_t	midiclk;		/* MIDI clock switch */
-int16_t	midigo;			/* MIDI run switch */
-int16_t	mistat;			/* current MIDI status */
-int16_t	nchwait;		/* next chwait value */
-int16_t	ncvwait;		/* next cvwait value */
-int16_t	ndisp;			/* current display number */
-int16_t	newflag;		/* new data entered while t_cur EQ t_ctr */
-int16_t	nkdown;			/* number of keys down */
-int16_t	notenum;		/* note number */
-int16_t	noteop;			/* pending note operation code */
-int16_t	notepit;		/* note pitch */
-int16_t	notesel;		/* note selection state */
-int16_t	npts;			/* number of points in function */
-int16_t	nxtflag;		/* next score flag */
-int16_t	oldltag;		/* previous load tag for tagslot */
-int16_t	oldpk;			/* previous pkctrl state */
-int16_t	oldsl;			/* previous sliders state */
-int16_t	pchsw;			/* punch-in enable switch */
-int16_t	pecase;			/* point edit case variable */
-int16_t	pkctrl;			/* local performance key state */
-int16_t	pntsv;			/* point selection state variable */
-int16_t	prgchan;		/* MIDI program change channel  (port 1) */
-int16_t	ps_dpth;		/* phase shifter -- depth */
-int16_t	ps_intn;		/* phase shifter -- intensity */
-int16_t	ps_rate;		/* phase shifter -- rate */
-int16_t	pulsclk;		/* pulse clock state */
-int16_t	recsw;			/* record / play switch */
-int16_t	runit;			/* run switch for main scan loop */
-int16_t	sbase;			/* score VSDD RAM scroll offset */
-int16_t	scmctl;			/* score submenu control flag */
-int16_t	scrlpot;		/* scroll pot state */
-int16_t	sd;			/* score display direction */
-int16_t	se;			/* score execution direction */
-int16_t	sdmcol;			/* score menu - saved stccol */
-int16_t	sdmctl;			/* score menu - control variable */
-int16_t	sdmrow;			/* score menu - saved stcrow */
-int16_t	secop;			/* pending score section operation */
-int16_t	secopok;		/* section operation OK flag */
-int16_t	sgcsw;			/* graphic cursor display switch */
-int16_t	sgoflag;		/* section number relative column 0..3 */
-int16_t	sharp;			/* sharp flag */
-int16_t	sliders;		/* slider and switch state */
-int16_t	soffset;		/* score scroll offset */
-int16_t	ss_ptsw;		/* smooth scroll patch scroll switch */
-int16_t	ss_sqsw;		/* smooth scroll sequence scroll switch */
-int16_t	stccol;			/* score cursor col */
-int16_t	stcrow;			/* score cursor row */
-int16_t	stepclk;		/* note entry - step clock state */
-int16_t	stepenb;		/* note entry - step enable flag */
-int16_t	stepint;		/* note entry - note interval */
-int16_t	stepwgt;		/* note entry - note weight */
-int16_t	subj;			/* edited point number (relative) */
-int16_t	submenu;		/* submenu active switch */
-int16_t	swctrl;			/* scroll wheel 'srolling' flag */
-int16_t	swdelta;		/* scroll wheel change while touched */
-int16_t	swdir;			/* scroll wheel direction */
-int16_t	swfiin;			/* scroll wheel fifo input pointer */
-int16_t	swflag;			/* scroll wheel touched flag */
-int16_t	swlast;			/* scroll wheel last value */
-int16_t	swstop;			/* scroll wheel stop flag */
-int16_t	swndx;			/* scroll wheel look back index */
-int16_t	tagslot;		/* tagged load slot */
-int16_t	tdnamsw;		/* tuning editor displaying typewriter */
-int16_t	temax;			/* time upper limit */
-int16_t	temin;			/* time lower limit */
-int16_t	testing;		/* test level */
-int16_t	tglclk;			/* clock on/off toggle flag */
-int16_t	tglpch;			/* punch in/out toggle flag */
-int16_t	thescore;		/* score selected from sqscan */
-int16_t	timemlt;		/* time scaling */
-int16_t	tkctrl;			/* trackball active flag */
-int16_t	tmpomlt;		/* tempo multiplier */
-int16_t	tmpoval;		/* tempo value */
-int16_t	trkball;		/* trackball selected switch */
-int16_t	ttcmdsv;		/* tuning editor edit state variable */
-int16_t	ttsel1;			/* tuning editor key select variable 1 */
-int16_t	ttsel2;			/* tuning editor key select variable 2 */
-int16_t	ttsel3;			/* tuning editor key select variable 3 */
-int16_t	tuneval;		/* fine tuning */
-int16_t	tunmod;			/* tuning table modified */
-int16_t	tunval;			/* tuning editor increment / transpose  value */
-int16_t	txfiin;			/* trackball x fifo input pointer */
-int16_t	txflag;			/* trackball x axis active flag */
-int16_t	txlast;			/* trackball x axis last value */
-int16_t	txstop;			/* trackball x axis filter counter */
-int16_t	tyfiin;			/* trackball y fifo input pointer */
-int16_t	tyflag;			/* trackball y axis active flag */
-int16_t	tylast;			/* trackball y axis last value */
-int16_t	tystop;			/* trackball y axis filter counter */
-int16_t	velflag;		/* velocity display flag */
-int16_t	verbose;		/* verbose output switch */
-int16_t	vlbtype;		/* type of message window display */
-int16_t	vrbw08;			/* score display video reset detail word */
-int16_t	vrbw09;			/* score display video reset detail word */
-int16_t	vrbw10;			/* score display video reset detail word */
-int16_t	vrbw11;			/* score display video reset detail word */
-int16_t	vrbw12;			/* score display video reset detail word */
-int16_t	vrbw13;			/* score display video reset detail word */
-int16_t	vrbw14;			/* score display video reset detail word */
-int16_t	vrbw15;			/* score display video reset detail word */
-int16_t	vrcw;			/* score display video reset control word */
-int16_t	vtccol;			/* virtual typewriter cursor column */
-int16_t	vtcrow;			/* virtual typewriter cursor row */
-int8_t	vtdechr;		/* virtual typewriter data entry character */
-int16_t	vtdecol;		/* virtual typewriter data entry column */
-int16_t	vtpcol;			/* virtual typewriter column */
-int16_t	vtprow;			/* virtual typewriter row */
-int16_t	vtwcol;			/* virtual typewriter window left column */
-int16_t	vtwrow;			/* virtual typewriter window top row */
-int16_t	vtxval;			/* virtual typewriter cursor x value */
-int16_t	vtyval;			/* virtual typewriter cursor y value */
-int16_t	wcflag;			/* ws/cf menu select flag (cf=0, ws=1) */
-int16_t	wcmcol;			/* ws/cf menu label column */
-int16_t	wcmrow;			/* ws/cf menu label row */
-int16_t	wcpage;			/* ws/cf menu page */
-int16_t	wdupdfl;		/* waveshape display needs updated flag */
-int16_t	wmcsel;			/* ws menu ws a/b select */
-int16_t	wmctag;			/* ws/cf display update flag */
-int16_t	wplast;			/* last point for interpolate operation */
-int16_t	wpntsv;			/* waveshape point selection state variable */
-int16_t	wshmax;			/* waveshape maximum value */
-int16_t	wvlast;			/* last value for interpolate operation */
-int16_t	xkcount;		/* cursor x key on count */
-int16_t	xkstat;			/* cursor x key status */
-int16_t	xycntr;			/* xy center for cursor pad */
-int16_t	ykcount;		/* cursor y key on count */
-int16_t	ykstat;			/* cursor y key status */
-
-int16_t	anrs[8][16];			/* analog variable resolution */
-int16_t	grp2prt[12][2];			/* group to port and channel table */
-int16_t	sctctab[10][64];		/* score background color table */
-int16_t	sigtab[128][2];			/* signals:  [0] = value, [1] = switch */
-int16_t	tunlib[NTUNS][128];		/* tuning table library */
-int16_t	varmode[8][16];			/* analog variable record mode */
-int16_t	wsnmod[12][2];			/* waveshape number / data modified */
+int16_t		admctl;			/* assignment display submenu control variable */
+int16_t		adnamsw;		/* assignment display virtual typewriter flag */
+int16_t		aflag;			/* analog activity flag */
+int16_t		aform;			/* action buffer format */
+int16_t		amplval;		/* amplitude */
+int16_t		ancmsw;			/* analog variable r/p control source */
+int16_t		angroup;		/* analog variable group being shown */
+int16_t		asgfks;			/* first key selected */
+int16_t		asghit;			/* row hit / assignment in progress */
+int16_t		asgmod;			/* assignment number or table modified */
+int16_t		asig;			/* analog signal number */
+int16_t		asmode;			/* panel assignment mode */
+int16_t		astat;			/* analog signal status */
+int16_t		auxctl;			/* aux control flag */
+int16_t		aval;			/* analog signal value */
+int16_t		bform;			/* oscillator data buffer format */
+int16_t		catin;			/* catalog read in flag */
+int16_t		cents;			/* pitch to cents conversion buffer */
+int16_t		chtime;			/* horizontal cursor counter */
+int16_t		chwait;			/* horizontal cursor wait time */
+int16_t		cflag;			/* accidental flag */
+int16_t		clkctl;			/* clock control */
+int16_t		clkrun;			/* clock status */
+int16_t		clksrc;			/* clock source */
+int16_t		cmfirst;		/* first cursor motion switch */
+int16_t		cmtype;			/* cursor motion type */
+int16_t		cnote;			/* note value at cursor */
+int16_t		ctrsw;			/* scupd center update switch */
+int16_t		curasg;			/* current assignment table */
+int16_t		curfunc;		/* current function number */
+int16_t		curgrp;			/* current group */
+int16_t		curinst;		/* current instrument number */
+int16_t		curmop;			/* current MIDI output port */
+int16_t		curpnt;			/* current point number (absolute) */
+int16_t		curpos;			/* cursor pad position for current axis */
+int16_t		cursbox;		/* currently selected box */
+int16_t		curscor;		/* Current score number */
+int16_t		cursect;		/* current section */
+int16_t		curslim;		/* cursor type change point */
+int16_t		curtun;			/* current tuning table */
+int16_t		curvce;			/* current voice number */
+int16_t		curwave;		/* current waveshape library slot */
+int16_t		curwdth;		/* current waveshape cursor width */
+int16_t		curwfnl;		/* current waveshape final value */
+int16_t		curwhrm;		/* current waveshape harmonic number */
+int16_t		curwhrv;		/* current waveshape harmonic value */
+int16_t		curwoff;		/* current waveshape offset value */
+int16_t		curwpnt;		/* current waveshape point number */
+int16_t		curwslt;		/* current waveshape instrument slot */
+int16_t		cvtime;			/* vertical cursor counter */
+int16_t		cvwait;			/* veritcal cursor wait time */
+int16_t		cxrate;			/* cursor x rate */
+int16_t		cxval;			/* graphic cursor x value */
+int16_t		cyrate;			/* cursor y rate */
+int16_t		cyval;			/* graphic cursor y value */
+int16_t		debugne;		/* debug flag for note entry */
+int16_t		defect;			/* defect code */
+int16_t		dferror;		/* error code from BIOS or XBIOS */
+int16_t		dfsides;		/* number of sides */
+int16_t		dftype;			/* disk type code */
+int16_t		dsp_ok;			/* display update OK this cycle flag */
+int16_t		dubsw;			/* overdub / replace switch */
+int16_t		ebflag;			/* edit buffer data flag */
+int16_t		editss;			/* edit panel switch state */
+int16_t		editsw;			/* edit mode switch */
+int16_t		endflg;			/* !end flag */
+int16_t		ext_cv1;		/* CV-1 value */
+int16_t		ext_cv2;		/* CV-2 value */
+int16_t		ext_cv3;		/* CV-3 value */
+int16_t		ext_cv4;		/* CV-4 value */
+int16_t		ext_mod;		/* Aux Signal Mod value */
+int16_t		gomode;			/* go to mode */
+int16_t		grptran;		/* group translation value */
+int16_t		gtmsel;			/* group transpose/map select */
+int16_t		hitbox;			/* box we just hit */
+int16_t		hitcx;			/* x of cursor when we hit the box */
+int16_t		hitcy;			/* y of cursor when we hit the box */
+int16_t		idcfsw;			/* copy / fetch menu switch */
+int16_t		idimsw;			/* instrument display instrument menu switch */
+int16_t		idintmp;		/* temporary for instrument number */
+int16_t		idnamsw;		/* typewriter switch */
+int16_t		idsrcsw;		/* source menu switch */
+int16_t		idtdat;			/* current instrument vtyper data entry string */
+int16_t		imflag;			/* instrument modified flag */
+int16_t		initcfg;		/* initial configuration */
+int16_t		insmode;		/* score insert mode */
+int16_t		ismode;			/* instrument select mode */
+int16_t		lampio;			/* LCD timeout disable switch state at I/O time */
+int16_t		lampsw;			/* LCD timeout disable switch */
+int16_t		lasgsw;			/* assignments store switch */
+int16_t		lastam;			/* last assignment menu base */
+int16_t		ldelsw;			/* delete switch */
+int16_t		lderrsw;		/* error message displayed switch */
+int16_t		ldidsiz;		/* getcat() did showsiz() switch */
+int16_t		ldkind;			/* fetch file type */
+int16_t		ldpass;			/* librarian load state variable */
+int16_t		ldrow;			/* fetch select row */
+int16_t		ldslot;			/* fetch select slot */
+int16_t		legato;			/* execkey() "legato" mode switch */
+int16_t		lksel;			/* librarian key slot selector */
+int16_t		lmwtype;		/* librarian message window type */
+int16_t		loadrow;		/* librarian row selected for load letter */
+int16_t		loadsw;			/* panel "Load" mode state */
+int16_t		lorchl;			/* load hi (TRUE) / lo (FALSE) orchestra */
+int16_t		lorchsw;		/* hi orchestra (21 - 40) store switch */
+int16_t		lorclsw;		/* lo orchestra (01 - 20) store switch */
+int16_t		lpatsw;			/* patch table store switch */
+int16_t		lrasw;			/* append (TRUE) / replace (FALSE) score */
+int16_t		lscrsw;			/* score store switch */
+int16_t		lselsw;			/* fetch select switch */
+int16_t		lseqsw;			/* sequence table store switch */
+int16_t		lstbgnc;		/* last note begin entry table index */
+int16_t		lstendc;		/* last note end entry table index */
+int16_t		lstflag;		/* last note list end switch */
+int16_t		lstrsw;			/* store state switch */
+int16_t		lstwoff;		/* last waveshape offset value */
+int16_t		lstwpnt;		/* last waveshape point number */
+int16_t		ltagged;		/* load tag switch */
+int16_t		ltunsw;			/* tunings store switch */
+int16_t		lwavsw;			/* waveshapes store switch */
+int16_t		mascntr;		/* MIDI active sensing timeout counter */
+int16_t		mdb1;			/* current MIDI data byte 1 */
+int16_t		mdb2;			/* current MIDI data byte 2 */
+int16_t		michan;			/* current MIDI channel */
+int16_t		midiclk;		/* MIDI clock switch */
+int16_t		midigo;			/* MIDI run switch */
+int16_t		mistat;			/* current MIDI status */
+int16_t		nchwait;		/* next chwait value */
+int16_t		ncvwait;		/* next cvwait value */
+int16_t		ndisp;			/* current display number */
+int16_t		newflag;		/* new data entered while t_cur EQ t_ctr */
+int16_t		nkdown;			/* number of keys down */
+int16_t		notenum;		/* note number */
+int16_t		noteop;			/* pending note operation code */
+int16_t		notepit;		/* note pitch */
+int16_t		notesel;		/* note selection state */
+int16_t		npts;			/* number of points in function */
+int16_t		nxtflag;		/* next score flag */
+int16_t		oldltag;		/* previous load tag for tagslot */
+int16_t		oldpk;			/* previous pkctrl state */
+int16_t		oldsl;			/* previous sliders state */
+int16_t		pchsw;			/* punch-in enable switch */
+int16_t		pecase;			/* point edit case variable */
+int16_t		pkctrl;			/* local performance key state */
+int16_t		pntsv;			/* point selection state variable */
+int16_t		prgchan;		/* MIDI program change channel  (port 1) */
+int16_t		ps_dpth;		/* phase shifter -- depth */
+int16_t		ps_intn;		/* phase shifter -- intensity */
+int16_t		ps_rate;		/* phase shifter -- rate */
+int16_t		pulsclk;		/* pulse clock state */
+int16_t		recsw;			/* record / play switch */
+int16_t		runit;			/* run switch for main scan loop */
+int16_t		sbase;			/* score VSDD RAM scroll offset */
+int16_t		scmctl;			/* score submenu control flag */
+int16_t		scrlpot;		/* scroll pot state */
+int16_t		sd;			/* score display direction */
+int16_t		se;			/* score execution direction */
+int16_t		sdmcol;			/* score menu - saved stccol */
+int16_t		sdmctl;			/* score menu - control variable */
+int16_t		sdmrow;			/* score menu - saved stcrow */
+int16_t		secop;			/* pending score section operation */
+int16_t		secopok;		/* section operation OK flag */
+int16_t		sgcsw;			/* graphic cursor display switch */
+int16_t		sgoflag;		/* section number relative column 0..3 */
+int16_t		sharp;			/* sharp flag */
+int16_t		sliders;		/* slider and switch state */
+int16_t		soffset;		/* score scroll offset */
+int16_t		ss_ptsw;		/* smooth scroll patch scroll switch */
+int16_t		ss_sqsw;		/* smooth scroll sequence scroll switch */
+int16_t		stccol;			/* score cursor col */
+int16_t		stcrow;			/* score cursor row */
+int16_t		stepclk;		/* note entry - step clock state */
+int16_t		stepenb;		/* note entry - step enable flag */
+int16_t		stepint;		/* note entry - note interval */
+int16_t		stepwgt;		/* note entry - note weight */
+int16_t		subj;			/* edited point number (relative) */
+int16_t		submenu;		/* submenu active switch */
+int16_t		swctrl;			/* scroll wheel 'srolling' flag */
+int16_t		swdelta;		/* scroll wheel change while touched */
+int16_t		swdir;			/* scroll wheel direction */
+int16_t		swfiin;			/* scroll wheel fifo input pointer */
+int16_t		swflag;			/* scroll wheel touched flag */
+int16_t		swlast;			/* scroll wheel last value */
+int16_t		swstop;			/* scroll wheel stop flag */
+int16_t		swndx;			/* scroll wheel look back index */
+int16_t		tagslot;		/* tagged load slot */
+int16_t		tdnamsw;		/* tuning editor displaying typewriter */
+int16_t		temax;			/* time upper limit */
+int16_t		temin;			/* time lower limit */
+int16_t		testing;		/* test level */
+int16_t		tglclk;			/* clock on/off toggle flag */
+int16_t		tglpch;			/* punch in/out toggle flag */
+int16_t		thescore;		/* score selected from sqscan */
+uint16_t	timemlt;		/* time scaling */
+int16_t		tkctrl;			/* trackball active flag */
+int16_t		tmpomlt;		/* tempo multiplier */
+int16_t		tmpoval;		/* tempo value */
+int16_t		trkball;		/* trackball selected switch */
+int16_t		ttcmdsv;		/* tuning editor edit state variable */
+int16_t		ttsel1;			/* tuning editor key select variable 1 */
+int16_t		ttsel2;			/* tuning editor key select variable 2 */
+int16_t		ttsel3;			/* tuning editor key select variable 3 */
+int16_t		tuneval;		/* fine tuning */
+int16_t		tunmod;			/* tuning table modified */
+int16_t		tunval;			/* tuning editor increment / transpose  value */
+int16_t		txfiin;			/* trackball x fifo input pointer */
+int16_t		txflag;			/* trackball x axis active flag */
+int16_t		txlast;			/* trackball x axis last value */
+int16_t		txstop;			/* trackball x axis filter counter */
+int16_t		tyfiin;			/* trackball y fifo input pointer */
+int16_t		tyflag;			/* trackball y axis active flag */
+int16_t		tylast;			/* trackball y axis last value */
+int16_t		tystop;			/* trackball y axis filter counter */
+int16_t		velflag;		/* velocity display flag */
+int16_t		verbose;		/* verbose output switch */
+int16_t		vlbtype;		/* type of message window display */
+int16_t		vrbw08;			/* score display video reset detail word */
+int16_t		vrbw09;			/* score display video reset detail word */
+int16_t		vrbw10;			/* score display video reset detail word */
+int16_t		vrbw11;			/* score display video reset detail word */
+int16_t		vrbw12;			/* score display video reset detail word */
+int16_t		vrbw13;			/* score display video reset detail word */
+int16_t		vrbw14;			/* score display video reset detail word */
+int16_t		vrbw15;			/* score display video reset detail word */
+int16_t		vrcw;			/* score display video reset control word */
+int16_t		vtccol;			/* virtual typewriter cursor column */
+int16_t		vtcrow;			/* virtual typewriter cursor row */
+int8_t		vtdechr;		/* virtual typewriter data entry character */
+int16_t		vtdecol;		/* virtual typewriter data entry column */
+int16_t		vtpcol;			/* virtual typewriter column */
+int16_t		vtprow;			/* virtual typewriter row */
+int16_t		vtwcol;			/* virtual typewriter window left column */
+int16_t		vtwrow;			/* virtual typewriter window top row */
+int16_t		vtxval;			/* virtual typewriter cursor x value */
+int16_t		vtyval;			/* virtual typewriter cursor y value */
+int16_t		wcflag;			/* ws/cf menu select flag (cf=0, ws=1) */
+int16_t		wcmcol;			/* ws/cf menu label column */
+int16_t		wcmrow;			/* ws/cf menu label row */
+int16_t		wcpage;			/* ws/cf menu page */
+int16_t		wdupdfl;		/* waveshape display needs updated flag */
+int16_t		wmcsel;			/* ws menu ws a/b select */
+int16_t		wmctag;			/* ws/cf display update flag */
+int16_t		wplast;			/* last point for interpolate operation */
+int16_t		wpntsv;			/* waveshape point selection state variable */
+int16_t		wshmax;			/* waveshape maximum value */
+int16_t		wvlast;			/* last value for interpolate operation */
+int16_t		xkcount;		/* cursor x key on count */
+int16_t		xkstat;			/* cursor x key status */
+int16_t		xycntr;			/* xy center for cursor pad */
+int16_t		ykcount;		/* cursor y key on count */
+int16_t		ykstat;			/* cursor y key status */
+
+int16_t		anrs[8][16];		/* analog variable resolution */
+int16_t		grp2prt[12][2];		/* group to port and channel table */
+int16_t		sctctab[10][64];	/* score background color table */
+int16_t		sigtab[128][2];		/* signals:  [0] = value, [1] = switch */
+int16_t		tunlib[NTUNS][128];	/* tuning table library */
+int16_t		varmode[8][16];		/* analog variable record mode */
+int16_t		wsnmod[12][2];		/* waveshape number / data modified */
 
 struct	EXFILE	mphead;		/* MIDAS-VII program header */
Index: ram/im700.x
===================================================================
--- ram/im700.x	(revision 432327d61294cce757d5a4a7aff568c99952a3b5)
+++ ram/im700.x	(revision 6099cacb5e0cb602156d4647cb268ee3302d40a5)
@@ -321,5 +321,5 @@
 extern	int16_t		thcwval;
 extern	int16_t		thescore;
-extern	int16_t		timemlt;
+extern	uint16_t	timemlt;
 extern	int16_t		tkback;
 extern	int16_t		tkctrl;
