Index: ram/msl.c
===================================================================
--- ram/msl.c	(revision 60288f548947383de9a52a06e402df2698a3ce5d)
+++ ram/msl.c	(revision 8618599ab825088c720c202c6e50a52572282c0f)
@@ -58,5 +58,5 @@
 extern	void	(*cx_key)(void);
 extern	void	(*cy_key)(void);
-extern	void	(*d_key)(short k);
+extern	void	(*d_key)(int16_t k);
 extern	void	(*e_key)(void);
 extern	void	(*m_key)(void);
@@ -65,79 +65,79 @@
 extern	LPF	(*swpt)[];
 
-extern	short	aflag;
-extern	short	amplval;
-extern	short	ancmsw;
-extern	short	angroup;
-extern	short	asig;
-extern	short	astat;
-extern	short	aval;
-extern	short	clkctl;
-extern	short	clkrun;
-extern	short	ctrsw;
-extern	short	cxrate;
-extern	short	cxval;
-extern	short	cyrate;
-extern	short	cyval;
-extern	short	dsp_ok;
-extern	short	editss;
-extern	short	editsw;
-extern	short	lampsw;
-extern	short	ndisp;
-extern	short	nxtflag;
-extern	short	pchsw;
-extern	short	recsw;
-extern	short	runit;
-extern	short	swback;
-extern	short	swctrl;
-extern	short	swdelta;
-extern	short	swdir;
-extern	short	swfiin;
-extern	short	swflag;
-extern	short	swlast;
-extern	short	swndx;
-extern	short	swstop;
-extern	short	swthr;
-extern	short	swtime;
-extern	short	swwait;
-extern	short	sd;
-extern	short	se;
-extern	short	stcrow;
-extern	short	stccol;
-extern	short	tglclk;
-extern	short	tglpch;
-extern	short	timemlt;
-extern	short	tmpomlt;
-extern	short	tmpoval;
-extern	short	tuneval;
-extern	short	vtpcol;
-extern	short	vtprow;
-
-/* 
-
-*/
-
-extern	unsigned	*obj8;
-
-extern	long	afi;
-extern	long	lcdtime;
-extern	long	swcount;
-extern	long	swrate;
-extern	long	swrmin;
-extern	long	swtemp;
-
-extern	short	grpmode[];
-extern	short	grpstat[];
-extern	short	prstab[];
-extern	short	simled[];
-extern	short	swfifo[NSWFIFO];
-extern	short	tmultab[];
-extern	short	vce2trg[];
-extern	short	veltab[];
-
-extern	char	trgtab[];
-
-extern	short	grp2prt[][2];
-extern	short	sigtab[][2];
-extern	short	varmode[][16];
+extern	int16_t	aflag;
+extern	int16_t	amplval;
+extern	int16_t	ancmsw;
+extern	int16_t	angroup;
+extern	int16_t	asig;
+extern	int16_t	astat;
+extern	int16_t	aval;
+extern	int16_t	clkctl;
+extern	int16_t	clkrun;
+extern	int16_t	ctrsw;
+extern	int16_t	cxrate;
+extern	int16_t	cxval;
+extern	int16_t	cyrate;
+extern	int16_t	cyval;
+extern	int16_t	dsp_ok;
+extern	int16_t	editss;
+extern	int16_t	editsw;
+extern	int16_t	lampsw;
+extern	int16_t	ndisp;
+extern	int16_t	nxtflag;
+extern	int16_t	pchsw;
+extern	int16_t	recsw;
+extern	int16_t	runit;
+extern	int16_t	swback;
+extern	int16_t	swctrl;
+extern	int16_t	swdelta;
+extern	int16_t	swdir;
+extern	int16_t	swfiin;
+extern	int16_t	swflag;
+extern	int16_t	swlast;
+extern	int16_t	swndx;
+extern	int16_t	swstop;
+extern	int16_t	swthr;
+extern	int16_t	swtime;
+extern	int16_t	swwait;
+extern	int16_t	sd;
+extern	int16_t	se;
+extern	int16_t	stcrow;
+extern	int16_t	stccol;
+extern	int16_t	tglclk;
+extern	int16_t	tglpch;
+extern	int16_t	timemlt;
+extern	int16_t	tmpomlt;
+extern	int16_t	tmpoval;
+extern	int16_t	tuneval;
+extern	int16_t	vtpcol;
+extern	int16_t	vtprow;
+
+/* 
+
+*/
+
+extern	uint16_t	*obj8;
+
+extern	int32_t	afi;
+extern	int32_t	lcdtime;
+extern	int32_t	swcount;
+extern	int32_t	swrate;
+extern	int32_t	swrmin;
+extern	int32_t	swtemp;
+
+extern	int16_t	grpmode[];
+extern	int16_t	grpstat[];
+extern	int16_t	prstab[];
+extern	int16_t	simled[];
+extern	int16_t	swfifo[NSWFIFO];
+extern	int16_t	tmultab[];
+extern	int16_t	vce2trg[];
+extern	int16_t	veltab[];
+
+extern	int8_t	trgtab[];
+
+extern	int16_t	grp2prt[][2];
+extern	int16_t	sigtab[][2];
+extern	int16_t	varmode[][16];
 
 extern	struct	gdsel	*gdstbc[];
@@ -145,5 +145,5 @@
 extern	struct 	wordq	ptefifo;
 
-unsigned short fifoval;
+uint16_t fifoval;
 
 /* 
@@ -157,5 +157,5 @@
 */
 
-void clk_ped(short stat)
+void clk_ped(int16_t stat)
 {
 	if (stat)
@@ -169,5 +169,5 @@
 */
 
-void pch_ped(short stat)
+void pch_ped(int16_t stat)
 {
 	if (stat AND pchsw)
@@ -187,12 +187,12 @@
 void msl(void)
 {
-	register char *ioadr;
-	register unsigned *fpu;
+	register int8_t *ioadr;
+	register uint16_t *fpu;
 	register struct s_entry *ep;
-	register short i, ti, val;
-	register long rt;
-	unsigned short chan, crel, oldsr, port, trg, trig, vel;
-	short cxprev, cyprev, esi, newsig, oldclk, oldrec;
-	long fctemp;
+	register int16_t i, ti, val;
+	register int32_t rt;
+	uint16_t chan, crel, oldsr, port, trg, trig, vel;
+	int16_t cxprev, cyprev, esi, newsig, oldclk, oldrec;
+	int32_t fctemp;
 
 #if	DEBUGIT
@@ -398,5 +398,5 @@
 										ep->e_type = EV_ANVL;
 										ep->e_data1 = i;
-										ep->e_dn = (struct s_entry *)((long)val << 16);
+										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 										ctrsw = TRUE;
@@ -435,5 +435,5 @@
 										ep->e_type = EV_ANVL;
 										ep->e_data1 = 0x0010 | i;
-										ep->e_dn = (struct s_entry *)((long)val << 16);
+										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 										ctrsw = TRUE;
@@ -480,5 +480,5 @@
 										ep->e_type = EV_ANVL;
 										ep->e_data1 = 0x0020 | i;
-										ep->e_dn = (struct s_entry *)((long)val << 16);
+										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 										ctrsw = TRUE;
@@ -543,5 +543,5 @@
 #else
 					ti  = (tmpomlt + 50) * tmpoval;
-					ti  = (short)( (19200000L / ti) - 1);
+					ti  = (int16_t)( (19200000L / ti) - 1);
 #endif
 					TIME_T2H = ti >> 8;
@@ -661,5 +661,5 @@
 										ep->e_type = EV_ANVL;
 										ep->e_data1 = 0x0040 | i;
-										ep->e_dn = (struct s_entry *)((long)val << 16);
+										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 										ctrsw = TRUE;
@@ -699,5 +699,5 @@
 										ep->e_type = EV_ANVL;
 										ep->e_data1 = 0x0030 | i;
-										ep->e_dn = (struct s_entry *)((long)val << 16);
+										ep->e_dn = (struct s_entry *)((int32_t)val << 16);
 										p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
 										ctrsw = TRUE;
