Index: include/midas.h
===================================================================
--- include/midas.h	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ include/midas.h	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -31,5 +31,5 @@
 #define	BIT2	V_RES2			/* graphics - 2 bit pixels */
 #define	BIT3	V_RES3			/* graphics - 4 bit pixels */
-#define	CHR2	0			/* characters - no attributes */
+#define	CHR2	0u			/* characters - no attributes */
 #define	CHR3	(V_FAD | V_HCR)		/* characters - full attributes */
 
Index: include/vsdd.h
===================================================================
--- include/vsdd.h	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ include/vsdd.h	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -13,43 +13,43 @@
 #define	VSDD	((uint16_t *)0x200000)
 
-#define	V_CHITE	12		/* Character height */
+#define	V_CHITE	12u		/* Character height */
 
 /* object descriptor flags */
 
-#define	V_CBS	0x0800		/* 0 = Bit Map, 1 = Character */
-#define	V_RES0	0x0000		/* Resolution 0: char 16, bit - */
-#define	V_RES1	0x0200		/* Resolution 1: char  6, bit - */
-#define	V_RES2	0x0400		/* Resolution 2: char  8, bit 2 */
-#define	V_RES3	0x0600		/* Resolution 3: char 12, bit 4 */
-#define	V_CRS	0x0100		/* Conceal/Reveal Select */
+#define	V_CBS	0x0800u		/* 0 = Bit Map, 1 = Character */
+#define	V_RES0	0x0000u		/* Resolution 0: char 16, bit - */
+#define	V_RES1	0x0200u		/* Resolution 1: char  6, bit - */
+#define	V_RES2	0x0400u		/* Resolution 2: char  8, bit 2 */
+#define	V_RES3	0x0600u		/* Resolution 3: char 12, bit 4 */
+#define	V_CRS	0x0100u		/* Conceal/Reveal Select */
 
-#define	V_PSE	0x0080		/* Proportional space enable */
-#define	V_FAD	0x0040		/* Full attributes select */
-#define	V_OBL	0x0020		/* Object blink */
-#define	V_BLA	0x0010		/* Object blank */
+#define	V_PSE	0x0080u		/* Proportional space enable */
+#define	V_FAD	0x0040u		/* Full attributes select */
+#define	V_OBL	0x0020u		/* Object blink */
+#define	V_BLA	0x0010u		/* Object blank */
 
-#define	V_HCR	0x0008		/* High color resolution */
-#define	V_TDE	0x0004		/* Transparency detect enable */
-#define	V_DCS0	0x0000		/* Default color select 0 */
-#define	V_DCS1	0x0001		/* Default color select 1 */
-#define	V_DCS2	0x0002		/* Default color select 2 */
-#define	V_DCS3	0x0003		/* Default color select 3 */
+#define	V_HCR	0x0008u		/* High color resolution */
+#define	V_TDE	0x0004u		/* Transparency detect enable */
+#define	V_DCS0	0x0000u		/* Default color select 0 */
+#define	V_DCS1	0x0001u		/* Default color select 1 */
+#define	V_DCS2	0x0002u		/* Default color select 2 */
+#define	V_DCS3	0x0003u		/* Default color select 3 */
 
 /* Preset flags for bitmap and character objects */
 
-#define	V_BTYPE	0
+#define	V_BTYPE	0u
 #define	V_CTYPE	(V_CBS | V_RES2 | ((V_CHITE - 1) << 12))
 
 /* character attribute flags */
 
-#define	C_ALTCS	0x8000
-#define	C_TFGND	0x4000
-#define	C_TBGND	0x2000
-#define	C_WIDE	0x1000
+#define	C_ALTCS	0x8000u
+#define	C_TFGND	0x4000u
+#define	C_TBGND	0x2000u
+#define	C_WIDE	0x1000u
 
-#define	C_MASK	0x0800
-#define	C_INVRT	0x0400
-#define	C_BLINK	0x0200
-#define	C_ULINE	0x0100
+#define	C_MASK	0x0800u
+#define	C_INVRT	0x0400u
+#define	C_BLINK	0x0200u
+#define	C_ULINE	0x0100u
 
 struct octent {			/* Object control table entry */
Index: vlib/vbfill4.c
===================================================================
--- vlib/vbfill4.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vbfill4.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -10,5 +10,5 @@
 #include "ram.h"
 
-static int16_t	fm[] = {	/* fill masks */
+static uint16_t	fm[] = {	/* fill masks */
 
 	0x000F,
@@ -60,21 +60,23 @@
 					wp = fwp;
 					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
-
-					for (j = 0; j < mw; j++)
-						*wp++ = color;
-
-					*wp = (*wp & ~rmask) | (color & rmask);
-				}
-
-			} else {
-
-				rmask = fm[width & 3];
-
-				for (i = 0; i < nl; i++) {
-
-					wp = fwp;
-					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
+
+					for (j = 0; j < mw; j++)
+						*wp++ = color;
+
+					*wp = (*wp & ~rmask) | (color & rmask);
+				}
+
+			} else {
+
+				rmask = fm[width & 3];
+
+				for (i = 0; i < nl; i++) {
+
+					wp = fwp;
+					fwp += obwidth;
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
 					*wp = (*wp & ~rmask) | (color & rmask);
 				}
@@ -112,21 +114,23 @@
 					wp = fwp;
 					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
-
-					for (j = 0; j < mw; j++)
-						*wp++ = color;
-
-					*wp = (*wp & ~rmask) | (color & rmask);
-				}
-
-			} else {
-
-				rmask = fm[width & 3];
-
-				for (i = 0; i < nl; i++) {
-
-					wp = fwp;
-					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
+
+					for (j = 0; j < mw; j++)
+						*wp++ = color;
+
+					*wp = (*wp & ~rmask) | (color & rmask);
+				}
+
+			} else {
+
+				rmask = fm[width & 3];
+
+				for (i = 0; i < nl; i++) {
+
+					wp = fwp;
+					fwp += obwidth;
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
 					*wp = (*wp & ~rmask) | (color & rmask);
 				}
@@ -164,21 +168,23 @@
 					wp = fwp;
 					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
-
-					for (j = 0; j < mw; j++)
-						*wp++ = color;
-
-					*wp = (*wp & ~rmask) | (color & rmask);
-				}
-
-			} else {
-
-				rmask = fm[width & 3];
-
-				for (i = 0; i < nl; i++) {
-
-					wp = fwp;
-					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
+
+					for (j = 0; j < mw; j++)
+						*wp++ = color;
+
+					*wp = (*wp & ~rmask) | (color & rmask);
+				}
+
+			} else {
+
+				rmask = fm[width & 3];
+
+				for (i = 0; i < nl; i++) {
+
+					wp = fwp;
+					fwp += obwidth;
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
 					*wp = (*wp & ~rmask) | (color & rmask);
 				}
@@ -216,5 +222,6 @@
 					wp = fwp;
 					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
 
 					for (j = 0; j < mw; j++)
@@ -232,5 +239,6 @@
 					wp = fwp;
 					fwp += obwidth;
-					*wp++ = (*wp & ~lmask) | (color & lmask);
+					*wp = (*wp & ~lmask) | (color & lmask);
+					wp++;
 					*wp = (*wp & ~rmask) | (color & rmask);
 				}
Index: vlib/vclrs.c
===================================================================
--- vlib/vclrs.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vclrs.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -6,6 +6,4 @@
 
 	vclrs(obase, row, col, nc, ch, atr)
-	unsigned int obase[];
-	int row, col, nc, ch, atr;
 
 		Clear 'nc' characters in the text object 'obase' to 'ch',
@@ -24,7 +22,7 @@
 */
 
-void vclrs(uint16_t obase[], int16_t row, int16_t col, int16_t nc, int16_t ch, int16_t atr)
+void vclrs(uint16_t *obase, int16_t row, int16_t col, int16_t nc, int16_t ch, uint16_t attr)
 {
 	while (nc--)
-		vputc(obase, row, col++, ch, atr);
+		vputc(obase, row, col++, ch, attr);
 }
Index: vlib/vclrs.x
===================================================================
--- vlib/vclrs.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vclrs.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -15,3 +15,3 @@
 */
 
-extern	void		vclrs(uint16_t obase[], int16_t row, int16_t col, int16_t nc, int16_t ch, int16_t atr);
+extern	void		vclrs(uint16_t *obase, int16_t row, int16_t col, int16_t nc, int16_t ch, uint16_t attr);
Index: vlib/vmput.c
===================================================================
--- vlib/vmput.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vmput.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -4,16 +4,4 @@
 	Version 3 -- 1987-03-30 -- D.N. Lynx Crowe
 	(c) Copyright 1987 -- D.N. Lynx Crowe
-
-	vmput(sbase, row, col, ms, ma)
-	uint *sbase, rwo, col, ma;
-	char *ms[];
-
-		Copies lines from ms, with attribute ma, to sbase at (row,col).
-
-	vmputa(sbase, row, col, ms, ma)
-	uint *sbase, row, col, *ma;
-	char *ms[];
-
-		Copies lines from ms, with attributes from ma, to sbase at (row,col).
    =============================================================================
 */
@@ -23,12 +11,12 @@
 /*
    =============================================================================
-	vmput(sbase, row, col, ms, ma) -- put a menu item in a screen image.
-	Copies lines from ms, with attribute ma, to sbase at (row,col).
+	vmput(obase, row, col, ms, ma) -- put a menu item in a screen image.
+	Copies lines from ms, with attribute ma, to obase at (row,col).
    =============================================================================
 */
 
-void vmput(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t ma)
+void vmput(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t ma)
 {
-	register uint16_t c, tc, tr;
+	register int16_t c, tc, tr;
 	int8_t *cp;
 
@@ -40,5 +28,5 @@
 
 		while (c = *cp++)
-			vputc(sbase, tr, tc++, c, ma);
+			vputc(obase, tr, tc++, c, ma);
 
 		tr++;
@@ -48,12 +36,12 @@
 /*
    =============================================================================
-	vmputa(sbase, row, col, ms, ma) -- put a menu item in a screen image.
-	Copies lines from ms, with attributes from ma, to sbase at (row,col).
+	vmputa(obase, row, col, ms, ma) -- put a menu item in a screen image.
+	Copies lines from ms, with attributes from ma, to obase at (row,col).
    =============================================================================
 */
 
-void vmputa(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t *ma[])
+void vmputa(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t *ma[])
 {
-	register uint16_t c, tc, tr;
+	register int16_t c, tc, tr;
 	uint16_t *tm;
 	int8_t *cp;
@@ -67,5 +55,5 @@
 
 		while (c = *cp++)
-			vputc(sbase, tr, tc++, c, *tm++);
+			vputc(obase, tr, tc++, c, *tm++);
 
 		tr++;
Index: vlib/vmput.x
===================================================================
--- vlib/vmput.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vmput.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -15,4 +15,4 @@
 */
 
-extern	void		vmput(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t ma);
-extern	void		vmputa(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *ms[], uint16_t *ma[]);
+extern	void		vmput(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t ma);
+extern	void		vmputa(uint16_t *obase, int16_t row, int16_t col, int8_t *ms[], uint16_t *ma[]);
Index: vlib/vobjfns.c
===================================================================
--- vlib/vobjfns.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vobjfns.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -69,5 +69,5 @@
 	op = &v_obtab[obj];
 
-	newbank = ((op->obank & 0x0001) << 8) | ((op->obank & 0x0002) << 6);
+	newbank = ((op->obank & 0x0001u) << 8) | ((op->obank & 0x0002u) << 6);
 
 	v_nobj = obj;
@@ -109,5 +109,5 @@
 	setipl(7);				/* disable interrupts */
 
-	vi_ctl |= (1 << pri);			/* set unblank bit */
+	vi_ctl |= (1u << pri);			/* set unblank bit */
 
 	if (*((int32_t *)0x000064) NE &VIint)	/* make sure VI vector is set */
@@ -124,5 +124,5 @@
 */
 
-void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, int16_t flags, int16_t pri)
+void SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, uint16_t flags, int16_t pri)
 {
 	register struct octent *op;
@@ -148,5 +148,5 @@
 	if (type) {	/* character objects */
 
-		op->odtw0 = (flags & 0xF9FF) | V_CTYPE;
+		op->odtw0 = (flags & 0xF9FFu) | V_CTYPE;
 
 		switch (V_RES3 & op->odtw0) {
@@ -179,5 +179,5 @@
 	} else {	/* bitmap objects */
 
-		op->odtw0 = (flags & 0x0E37) | (V_BTYPE | ((bank & 3) << 6));
+		op->odtw0 = (flags & 0x0E37u) | (V_BTYPE | (((uint16_t)bank & 3u) << 6));
 
 		switch (V_RES3 & op->odtw0) {
@@ -201,5 +201,5 @@
 	}
 
-	op->odtw1 = ((x0 >> 1) & 0x03FF) | (0xFC00 & (wsize << 10));
+	op->odtw1 = (((uint16_t)x0 >> 1) & 0x03FFu) | (0xFC00u & ((uint16_t)wsize << 10));
 
 	if (pri < 0)
@@ -219,8 +219,8 @@
 */
 
-void CpyObj(uint16_t *from, uint16_t *to, uint16_t w, uint16_t h, uint16_t sw)
+void CpyObj(uint16_t *from, uint16_t *to, int16_t w, int16_t h, int16_t sw)
 {
 	register uint16_t *tp;
-	register uint16_t i, j;
+	register int16_t i, j;
 
 	for (i = h; i--; ) {
Index: vlib/vobjfns.x
===================================================================
--- vlib/vobjfns.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vobjfns.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -25,6 +25,6 @@
 */
 
-extern	void		CpyObj(uint16_t *from, uint16_t *to, uint16_t w, uint16_t h, uint16_t sw);
+extern	void		CpyObj(uint16_t *from, uint16_t *to, int16_t w, int16_t h, int16_t sw);
 extern	void		SelObj(int16_t obj);
-extern	void		SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, int16_t flags, int16_t pri);
+extern	void		SetObj(int16_t obj, int16_t type, int16_t bank, uint16_t *base, int16_t xpix, int16_t ypix, int16_t x0, int16_t y0, uint16_t flags, int16_t pri);
 extern	void		SetPri(int16_t obj, int16_t pri);
Index: vlib/vputs.c
===================================================================
--- vlib/vputs.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vputs.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -16,18 +16,18 @@
 /*
    =============================================================================
-	vputs(sbase, row, col, str, attrib)
+	vputs(obase, row, col, str, attrib)
 
-	Write string str to video RAM object pointed to by sbase
-	at (row,col) with attrib used for all characters.
+	Write string str to video RAM object pointed to by obase
+	at (row,col) with attr used for all characters.
    =============================================================================
 */
 
-void vputs(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib)
+void vputs(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr)
 {
-	uint16_t	c;
+	int16_t	c;
 
 	while (c = *str++) {
 
-		vputc(sbase, row, col, c, attrib);
+		vputc(obase, row, col, c, attr);
 
 		if (++col GE 64) {
@@ -43,18 +43,18 @@
 /*
    =============================================================================
-	vputsa(sbase, row, col, str, attrib)
+	vputsa(obase, row, col, str, attrib)
 
-	Write string str in video RAM pointed to by sbase starting
-	at (row, col) using attributes from the words pointed to by attrib.
+	Write string str in video RAM pointed to by obase starting
+	at (row, col) using attributes from the words pointed to by attr.
    =============================================================================
 */
 
-void vputsa(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib)
+void vputsa(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr)
 {
-	uint16_t	c;
+	int16_t	c;
 
 	while (c = *str++) {
 
-		vputc(sbase, row, col, c, *attrib++);
+		vputc(obase, row, col, c, *attr++);
 
 		if (++col GE 64) {
Index: vlib/vputs.x
===================================================================
--- vlib/vputs.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vputs.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -15,4 +15,4 @@
 */
 
-extern	void		vputs(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib);
-extern	void		vputsa(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib);
+extern	void		vputs(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr);
+extern	void		vputsa(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr);
Index: vlib/vputsv.c
===================================================================
--- vlib/vputsv.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vputsv.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -16,18 +16,18 @@
 /*
    =============================================================================
-	vputsv(sbase, row, col, str, attrib, len)
+	vputsv(obase, row, col, str, attr, len)
 
-	Write string str to video RAM object pointed to by sbase
-	at (row,col) with attrib used for all characters. Line length is len.
+	Write string str to video RAM object pointed to by obase
+	at (row,col) with attr used for all characters. Line length is len.
    =============================================================================
 */
 
-void vputsv(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len)
+void vputsv(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr, int16_t len)
 {
-	uint16_t	c;
+	int16_t	c;
 
 	while (c = *str++) {
 
-		vputcv(sbase, row, col, c, attrib, len);
+		vputcv(obase, row, col, c, attr, len);
 
 		if (++col GE 64) {
@@ -43,19 +43,19 @@
 /*
    =============================================================================
-	vputsav(sbase, row, col, str, attrib, len)
+	vputsav(obase, row, col, str, attr, len)
 
-	Write string str in video RAM pointed to by sbase starting
-	at (row, col) using attributes from the words pointed to by attrib.
+	Write string str in video RAM pointed to by obase starting
+	at (row, col) using attributes from the words pointed to by attr.
 	Line length is len.
    =============================================================================
 */
 
-void vputsav(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len)
+void vputsav(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr, int16_t len)
 {
-	uint16_t	c;
+	int16_t	c;
 
 	while (c = *str++) {
 
-		vputcv(sbase, row, col, c, *attrib++, len);
+		vputcv(obase, row, col, c, *attr++, len);
 
 		if (++col GE 64) {
Index: vlib/vputsv.x
===================================================================
--- vlib/vputsv.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vputsv.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -15,4 +15,4 @@
 */
 
-extern	void		vputsav(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t *attrib, uint16_t len);
-extern	void		vputsv(uint16_t *sbase, uint16_t row, uint16_t col, int8_t *str, uint16_t attrib, uint16_t len);
+extern	void		vputsav(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t *attr, int16_t len);
+extern	void		vputsv(uint16_t *obase, int16_t row, int16_t col, int8_t *str, uint16_t attr, int16_t len);
Index: vlib/vsetpal.c
===================================================================
--- vlib/vsetpal.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vsetpal.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -43,7 +43,7 @@
 */
 
-void vsetpal(uint16_t slot, uint16_t red, uint16_t grn, uint16_t blu)
+void vsetpal(int16_t slot, int16_t red, int16_t grn, int16_t blu)
 {
-	register uint16_t palval;
+	register int16_t palval;
 	uint16_t *pal;
 
@@ -55,5 +55,5 @@
 		 ((blu & 1) << 3) | ((blu & 2) >> 1);
 
-	*pal = palval ^ 0x003F;
+	*pal = (uint16_t)palval ^ 0x003F;
 }
 
Index: vlib/vsetpal.x
===================================================================
--- vlib/vsetpal.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vsetpal.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -23,4 +23,4 @@
 */
 
-extern	void		vsetpal(uint16_t slot, uint16_t red, uint16_t grn, uint16_t blu);
+extern	void		vsetpal(int16_t slot, int16_t red, int16_t grn, int16_t blu);
 extern	void		vsndpal(int16_t pp[16][3]);
Index: vlib/vtext.c
===================================================================
--- vlib/vtext.c	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vtext.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -10,7 +10,7 @@
 #include "ram.h"
 
-static int16_t	msk[] = { 0xFF00, 0x00FF };
+static uint16_t	msk[] = { 0xFF00, 0x00FF };
 
-void vtext(uint16_t *obj, uint16_t nc, uint16_t row, uint16_t col, int8_t *ip)
+void vtext(uint16_t *obj, int16_t nc, int16_t row, int16_t col, int8_t *ip)
 {
 	register uint16_t *op;
@@ -20,6 +20,6 @@
 		op = obj + ((nc >> 1) * row) + (col >> 1);
 
-		*op = (*op & (uint16_t)msk[col & 1]) |
-		      ((*ip++ & 0x00FF) << ((col & 1) ? 8 : 0));
+		*op = (*op & msk[col & 1]) |
+		      ((uint16_t)(*ip++ & 0x00FF) << ((col & 1) ? 8 : 0));
 
 		col++;
Index: vlib/vtext.x
===================================================================
--- vlib/vtext.x	(revision 6a37d5b75a66b9b08989170e2619867e2219e59d)
+++ vlib/vtext.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
@@ -15,3 +15,3 @@
 */
 
-extern	void		vtext(uint16_t *obj, uint16_t nc, uint16_t row, uint16_t col, int8_t *ip);
+extern	void		vtext(uint16_t *obj, int16_t nc, int16_t row, int16_t col, int8_t *ip);
