Index: ram/smscrl.c
===================================================================
--- ram/smscrl.c	(revision 0c834c599f225d78f3cee559f0421011b124be6d)
+++ ram/smscrl.c	(revision 7258c6ac4de2518c5430095742a27be7af0c89d7)
@@ -25,27 +25,27 @@
 #define	TOPSCAN		(NSCANS - 1)		/* top scan line */
 
-extern	short	cmtype;				/* cursor type */
-extern	short	ctcsw;				/* cursor status */
-extern	short	curslin;			/* current sequence line */
-extern	short	cxrate;				/* cursor X update rate */
-extern	short	cxval;				/* cursor X location */
-extern	short	cyrate;				/* cursor Y update rate */
-extern	short	cyval;				/* cursor Y location */
-extern	short	ptecpos;			/* current patch index */
-extern	short	pteset;				/* ptebuf set flag */
-extern	short	sqdeflg;			/* sequence data entry flag */
-extern	short	stccol;				/* main cursor column */
-extern	short	submenu;			/* submenu switch */
-extern	short	vtccol;				/* submenu cursor column */
-extern	short	vtcrow;				/* submenu cursor row */
-extern	short	vtxval;				/* submenu cursor x value */
-extern	short	vtyval;				/* subment cursor y value */
-
-extern	unsigned	*obj10;			/* sequence status object pointer */
-
-extern	int	cg3[][256];			/* character generator table */
-
-extern	char	ptdebuf[];			/* patch data entry buffer */
-extern	char	sqdebuf[];			/* sequence data entry buffer */
+extern	int16_t	cmtype;				/* cursor type */
+extern	int16_t	ctcsw;				/* cursor status */
+extern	int16_t	curslin;			/* current sequence line */
+extern	int16_t	cxrate;				/* cursor X update rate */
+extern	int16_t	cxval;				/* cursor X location */
+extern	int16_t	cyrate;				/* cursor Y update rate */
+extern	int16_t	cyval;				/* cursor Y location */
+extern	int16_t	ptecpos;			/* current patch index */
+extern	int16_t	pteset;				/* ptebuf set flag */
+extern	int16_t	sqdeflg;			/* sequence data entry flag */
+extern	int16_t	stccol;				/* main cursor column */
+extern	int16_t	submenu;			/* submenu switch */
+extern	int16_t	vtccol;				/* submenu cursor column */
+extern	int16_t	vtcrow;				/* submenu cursor row */
+extern	int16_t	vtxval;				/* submenu cursor x value */
+extern	int16_t	vtyval;				/* subment cursor y value */
+
+extern	uint16_t	*obj10;			/* sequence status object pointer */
+
+extern	int16_t	cg3[][256];			/* character generator table */
+
+extern	int8_t	ptdebuf[];			/* patch data entry buffer */
+extern	int8_t	sqdebuf[];			/* sequence data entry buffer */
 
 extern	struct patch	ptebuf;			/* current patch image */
@@ -55,34 +55,34 @@
 extern	struct seqent	seqtab[];		/* sequence table */
 
-char	TheBuf[66];				/* display build buffer */
-
-/* 
-
-*/
-
-char	*(*BakLine)(void);		/* next line backward function pointer */
-char	*(*FwdLine)(void);		/* next line forward function pointer */
-
-short	PdScDnF;			/* scroll down flag */
-short	PdScUpF;			/* scroll up flag */
-
-short	CurLine;			/* top line being displayed */
-short	CurScan;			/* current scan line */
-short	DupLine;			/* write pointer for other page */
-short	ScrlObj;			/* object descriptor table index */
-
-char	*LinePtr;			/* line to scroll onto screen */
-
-unsigned short	LineAtr;		/* attribute for the new line */
-
-unsigned short	*LineBuf;		/* current display memory pointer */
-unsigned short	*OldLine;		/* old display memory pointer */
-unsigned short	*ScObAdr;		/* display memory base pointer */
-
-short	LineCon = SS_LEN * 3;		/* line offset constant */
-short	LineLen = SS_LEN;		/* length of a scrolled line */
-short	SmScLim = SS_LIM;		/* top line limit */
-short	SmScNsl = SS_NSL;		/* number of scrolled lines */
-short	SmScTop = SS_TOP;		/* total line count */
+int8_t	TheBuf[66];				/* display build buffer */
+
+/* 
+
+*/
+
+int8_t	*(*BakLine)(void);		/* next line backward function pointer */
+int8_t	*(*FwdLine)(void);		/* next line forward function pointer */
+
+int16_t	PdScDnF;			/* scroll down flag */
+int16_t	PdScUpF;			/* scroll up flag */
+
+int16_t	CurLine;			/* top line being displayed */
+int16_t	CurScan;			/* current scan line */
+int16_t	DupLine;			/* write pointer for other page */
+int16_t	ScrlObj;			/* object descriptor table index */
+
+int8_t	*LinePtr;			/* line to scroll onto screen */
+
+uint16_t	LineAtr;		/* attribute for the new line */
+
+uint16_t	*LineBuf;		/* current display memory pointer */
+uint16_t	*OldLine;		/* old display memory pointer */
+uint16_t	*ScObAdr;		/* display memory base pointer */
+
+int16_t	LineCon = SS_LEN * 3;		/* line offset constant */
+int16_t	LineLen = SS_LEN;		/* length of a scrolled line */
+int16_t	SmScLim = SS_LIM;		/* top line limit */
+int16_t	SmScNsl = SS_NSL;		/* number of scrolled lines */
+int16_t	SmScTop = SS_TOP;		/* total line count */
 
 /* 
@@ -96,7 +96,7 @@
 */
 
-char *LineFwd(void)
-{
-	register short j, k;
+int8_t *LineFwd(void)
+{
+	register int16_t j, k;
 
 	for (j = 0; j < 48; j++)
@@ -107,8 +107,8 @@
 
 	if (0 EQ ptecpos)
-		return((char *)NULL);
+		return((int8_t *)NULL);
 
 	if (0 EQ (j = findnxt(ptecpos)))
-		return((char *)NULL);
+		return((int8_t *)NULL);
 
 	ptecpos = j;
@@ -146,7 +146,7 @@
 */
 
-char *LineBak(void)
-{
-	register short j, k;
+int8_t *LineBak(void)
+{
+	register int16_t j, k;
 
 	for (j = 0; j < 48; j++)
@@ -157,8 +157,8 @@
 
 	if (0 EQ ptecpos)
-		return((char *)NULL);
+		return((int8_t *)NULL);
 
 	if (0 EQ (j = findprv(ptecpos)))
-		return((char *)NULL);
+		return((int8_t *)NULL);
 
 	ptecpos = j;
@@ -196,7 +196,7 @@
 */
 
-void WrVideo(short row, short col, char *str, unsigned short atr)
-{
-	register char chr;
+void WrVideo(int16_t row, int16_t col, int8_t *str, uint16_t atr)
+{
+	register int8_t chr;
 
 	if (v_regs[5] & 0x0180)
@@ -222,13 +222,13 @@
 */
 
-void SetDTop(short row, short scan)
+void SetDTop(int16_t row, int16_t scan)
 {
 	if (v_regs[5] & 0x0180)
 		vbank(0);
 
-	LineBuf = (unsigned short *)((char *)ScObAdr + (row * LineCon));
+	LineBuf = (uint16_t *)((int8_t *)ScObAdr + (row * LineCon));
 
 	if (OldLine NE LineBuf)
-		v_odtab[ScrlObj][2] = ((long)LineBuf >> 1) & 0xFFFF;
+		v_odtab[ScrlObj][2] = ((int32_t)LineBuf >> 1) & 0xFFFF;
 
 	OldLine = LineBuf;
@@ -247,5 +247,5 @@
 */
 
-void UpdVid(short row, short col, char *str, unsigned short atr)
+void UpdVid(int16_t row, int16_t col, int8_t *str, uint16_t atr)
 {
 	WrVideo(CurLine + row, col, str, atr);
@@ -274,5 +274,5 @@
 void bgncm(void)
 {
-	register short j;
+	register int16_t j;
 
 	memcpyw(&ptebuf.defnum, &patches[ptecpos].defnum, 6);
@@ -306,5 +306,5 @@
 void stopcm(void)
 {
-	register short i;
+	register int16_t i;
 
 	if (PdScDnF)
@@ -348,5 +348,5 @@
 void stopsm(void)
 {
-	register short i;
+	register int16_t i;
 
 	if (PdScDnF)
@@ -380,5 +380,5 @@
 		if (CurScan EQ TOPSCAN) {	/* ready for a new line ? */
 
-			if ((char *)NULL NE (LinePtr = (*FwdLine)())) {	/* get a line */
+			if ((int8_t *)NULL NE (LinePtr = (*FwdLine)())) {	/* get a line */
 
 				if (CurLine EQ SmScLim) {	/* *** swap display pages *** */
@@ -425,5 +425,5 @@
 		if (CurScan EQ TOPSCAN) {	/* ready for a new line ? */
 
-			if ((char *)NULL NE (LinePtr = (*BakLine)())) {	/* get a line */
+			if ((int8_t *)NULL NE (LinePtr = (*BakLine)())) {	/* get a line */
 
 				if (CurLine EQ 0) {	/* *** swap display pages *** */
@@ -476,5 +476,5 @@
 void smxupd(void)
 {
-	short oldcx;
+	int16_t oldcx;
 
 	oldcx = cxval;
@@ -539,5 +539,5 @@
 */
 
-void smy_up(short tag)
+void smy_up(int16_t tag)
 {
 
@@ -609,5 +609,5 @@
 */
 
-void sqy_up(short tag)
+void sqy_up(int16_t tag)
 {
 	if (ctcsw)
