Index: vlib/glcinit.c
===================================================================
--- vlib/glcinit.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/glcinit.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -9,14 +9,10 @@
 		Initializes the GLC.
 
-	unsigned
 	GLCcrc(row, col)
-	unsigned row, col;
 
 		Positions the GLC cursor at ('row', 'col') preparatory
 		to writing text.  Returns the calculated cursor address.
 
-	unsigned
 	GLCcxy(x, y)
-	unsigned x, y;
 
 		Positions the GLC cursor at ('x', 'y') preparatory to
@@ -26,5 +22,4 @@
 
 	GLCwrts(s)
-	char *s;
 
 		Writes the character string pointed to by 's' at the
@@ -34,6 +29,4 @@
 
 	GLCtext(row, col, s)
-	unsigned row, col;
-	char *s;
 
 		Sets the GLC cursor to ('row', 'col'), then writes the
@@ -43,10 +36,8 @@
 
 	GLCdisp(dsp, crs, blk1, blk2, blk3)
-	short dsp, crs, blk1, blk2, blk3;
 
 		Sets the overall display, cursor and block status values.
 
 	GLCcurs(crs)
-	short crs;
 
 		Turns the cursor on or off.
@@ -56,18 +47,18 @@
 #include "ram.h"
 
-uint16_t	lcdbase;	/* LCD graphics base address */
-uint16_t	lcdbit;		/* LCD graphics pixel bit mask */
-uint16_t	lcdcol;		/* LCD text column */
-uint16_t	lcdctl1;	/* LCD display control -- command */
-uint16_t	lcdctl2;	/* LCD display control -- data */
-uint16_t	lcdcurs;	/* LCD graphics pixel byte address */
-uint16_t	lcdrow;		/* LCD text row */
-uint16_t	lcdx;		/* LCD graphics x */
-uint16_t	lcdy;		/* LCD graphics y */
+int32_t		lcdbase;	/* LCD graphics base address */
+int16_t		lcdbit;		/* LCD graphics pixel bit mask */
+int16_t		lcdcol;		/* LCD text column */
+int16_t		lcdctl1;	/* LCD display control -- command */
+int16_t		lcdctl2;	/* LCD display control -- data */
+int32_t		lcdcurs;	/* LCD graphics pixel byte address */
+int16_t		lcdrow;		/* LCD text row */
+int16_t		lcdx;		/* LCD graphics x */
+int16_t		lcdy;		/* LCD graphics y */
 
 /* GLC initialization values */
 
-int8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 };
-int8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 };
+uint8_t glc_is1[] = { 0x12, 0x05, 0x07, 0x54, 0x58, 0x3F, 0x55, 0x00 };
+uint8_t glc_is2[] = { 0x00, 0x00, 0x3F, 0x00, 0x20, 0x3F, 0x00, 0x00 };
 
 /*
@@ -88,6 +79,6 @@
 	lcdctl2 = val;
 
-	LCD_WC = lcdctl1;
-	LCD_WD = lcdctl2;
+	LCD_WC = (uint8_t)lcdctl1;
+	LCD_WD = (uint8_t)lcdctl2;
 
 }
@@ -103,6 +94,6 @@
 	lcdctl2 = (crs & 3) | (lcdctl2 & ~3);
 
-	LCD_WC = lcdctl1;
-	LCD_WD = lcdctl2;
+	LCD_WC = (uint8_t)lcdctl1;
+	LCD_WD = (uint8_t)lcdctl2;
 }
 
@@ -118,5 +109,5 @@
 	register int16_t	i;
 	register int32_t ic;
-	register int8_t *gp;
+	register uint8_t *gp;
 
 	lcdbase = G_PLANE2;	/* set defaults for graphics variables */
@@ -135,5 +126,5 @@
 
 	for (i = 0; i < 8; i++)
-		LCD_WD= *gp++;
+		LCD_WD = *gp++;
 
 	LCD_WC = G_SETSAD;	/* setup scroll registers */
@@ -184,13 +175,13 @@
 */
 
-uint16_t GLCcrc(uint16_t row, uint16_t col)
-{
-	uint16_t curad;
+int16_t GLCcrc(int16_t row, int16_t col)
+{
+	int16_t curad;
 
 	curad = col + (row * 85);	/* calculate cursor location */
 
 	LCD_WC = G_CRSWR;		/* send cursor address to GLC */
-	LCD_WD = curad & 0xFF;
-	LCD_WD = (curad >> 8) & 0xFF;
+	LCD_WD = (uint8_t)(curad & 0xFF);
+	LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
 
 	lcdrow = row;			/* set text cursor variables */
@@ -210,7 +201,7 @@
 */
 
-uint16_t GLCcxy(uint16_t x, uint16_t y)
-{
-	register uint16_t curad, xby6;
+int16_t GLCcxy(int16_t x, int16_t y)
+{
+	register int32_t curad, xby6;
 
 	/* calculate cursor address */
@@ -223,6 +214,6 @@
 
 	LCD_WC = G_CRSWR;
-	LCD_WD = curad & 0xFF;
-	LCD_WD = (curad >> 8) & 0xFF;
+	LCD_WD = (uint8_t)(curad & 0xFF);
+	LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
 
 	/* set graphics variables */
@@ -256,5 +247,5 @@
 	while (*s) {		/* write string to GLC */
 
-		LCD_WD = *s++;
+		LCD_WD = (uint8_t)*s++;
 		lcdcol++;	/* keep column variable up to date */
 	}
@@ -271,13 +262,13 @@
 */
 
-void GLCtext(uint16_t row, uint16_t col, int8_t *s)
-{
-	register uint16_t curad;
+void GLCtext(int16_t row, int16_t col, int8_t *s)
+{
+	register int16_t curad;
 
 	curad = col + (row * 85);	/* calculate cursor address */
 
 	LCD_WC = G_CRSWR;		/* send cursor address to GLC */
-	LCD_WD = curad & 0xFF;
-	LCD_WD = (curad >> 8) & 0xFF;
+	LCD_WD = (uint8_t)(curad & 0xFF);
+	LCD_WD = (uint8_t)((curad >> 8) & 0xFF);
 
 	lcdrow = row;			/* set GLC text cursor variables */
@@ -290,5 +281,5 @@
 	while (*s) {			/* write string to GLC */
 
-		LCD_WD = *s++;
+		LCD_WD = (uint8_t)*s++;
 		lcdcol++;		/* keep cursor column up to date */
 	}
Index: vlib/glcinit.x
===================================================================
--- vlib/glcinit.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/glcinit.x	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -15,15 +15,15 @@
 */
 
-extern	int8_t		glc_is1[];
-extern	int8_t		glc_is2[];
-extern	uint16_t	lcdbase;
-extern	uint16_t	lcdbit;
-extern	uint16_t	lcdcol;
-extern	uint16_t	lcdctl1;
-extern	uint16_t	lcdctl2;
-extern	uint16_t	lcdcurs;
-extern	uint16_t	lcdrow;
-extern	uint16_t	lcdx;
-extern	uint16_t	lcdy;
+extern	uint8_t		glc_is1[];
+extern	uint8_t		glc_is2[];
+extern	int32_t		lcdbase;
+extern	int16_t		lcdbit;
+extern	int16_t		lcdcol;
+extern	int16_t		lcdctl1;
+extern	int16_t		lcdctl2;
+extern	int32_t		lcdcurs;
+extern	int16_t		lcdrow;
+extern	int16_t		lcdx;
+extern	int16_t		lcdy;
 
 /*
@@ -33,9 +33,9 @@
 */
 
-extern	uint16_t	GLCcrc(uint16_t row, uint16_t col);
+extern	int16_t		GLCcrc(int16_t row, int16_t col);
 extern	void		GLCcurs(int16_t crs);
-extern	uint16_t	GLCcxy(uint16_t x, uint16_t y);
+extern	int16_t		GLCcxy(int16_t x, int16_t y);
 extern	void		GLCdisp(int16_t dsp, int16_t crs, int16_t blk1, int16_t blk2, int16_t blk3);
 extern	void		GLCinit(void);
-extern	void		GLCtext(uint16_t row, uint16_t col, int8_t *s);
+extern	void		GLCtext(int16_t row, int16_t col, int8_t *s);
 extern	void		GLCwrts(int8_t *s);
Index: vlib/vhinit.c
===================================================================
--- vlib/vhinit.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/vhinit.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -18,5 +18,5 @@
 #include "ram.h"
 
-#define	VREG(h,v)	((h<<10)|v)
+#define	VREG(h, v)	(h * 1024u + v)
 
 struct octent	v_obtab[16];	/* object control table */
@@ -29,5 +29,5 @@
 /* initialized variables */
 
-int16_t	vr_data[] = {
+uint16_t	vr_data[] = {
 
 	0x825B,		/* R0  -- Mode word 0 */
Index: vlib/vhinit.x
===================================================================
--- vlib/vhinit.x	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/vhinit.x	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -20,5 +20,5 @@
 extern	int16_t		v_obpri;
 extern	struct	octent	v_obtab[16];
-extern	int16_t		vr_data[];
+extern	uint16_t	vr_data[];
 
 /*
Index: vlib/vmput.c
===================================================================
--- vlib/vmput.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/vmput.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -23,9 +23,9 @@
 	tr = row;
 
-	while (cp = *ms++) {
+	while ((cp = *ms++)) {
 
 		tc = col;
 
-		while (c = *cp++)
+		while ((c = *cp++))
 			vputc(obase, tr, tc++, c, ma);
 
@@ -49,10 +49,10 @@
 	tr = row;
 
-	while (cp = *ms++) {
+	while ((cp = *ms++)) {
 
 		tc = col;
 		tm = *ma++;
 
-		while (c = *cp++)
+		while ((c = *cp++))
 			vputc(obase, tr, tc++, c, *tm++);
 
Index: vlib/vobjfns.c
===================================================================
--- vlib/vobjfns.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/vobjfns.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -6,16 +6,12 @@
 
 	SelObj(obj)
-	int obj;
 
 		Select 'obj' as the current working object.
 
 	SetPri(obj, pri)
-	int obj, pri;
 
 		Display object 'obj' with priority 'pri'.
 
 	SetObj(obj, type, bank, base, xpix, ypix, x0, y0, flags, pri)
-	int obj, type, bank, xpix, ypix, x0, y0, flags, pri;
-	unsigned int *base;
 
 		Setup object 'obj' of type 'type' at 'base' in bank 'bank'
@@ -27,6 +23,4 @@
 
 	CpyObj(from, to, w, h, sw)
-	unsigned int *from, *to;
-	int w, h, sw;
 
 		Copy a 'w'-word by 'h'-line object from 'from' to 'to' with
@@ -51,4 +45,6 @@
 #include "ram.h"
 
+typedef		void	(**intvec)(void);
+
 int16_t		wsize;		/* object width calculated by SetObj() */
 int16_t		vi_dis;		/* disable use of VIint */
@@ -96,9 +92,9 @@
 
 	op = &v_obtab[obj];		/* point at the object table */
-	op->opri = pri;			/* set the priority */
+	op->opri = (int8_t)pri;		/* set the priority */
 
 	v_odtab[pri][0] = op->odtw0 | V_BLA;	/* start object as blanked */
 	v_odtab[pri][1] = op->odtw1;
-	v_odtab[pri][2] = ((int32_t)op->obase >> 1) & 0xFFFF;
+	v_odtab[pri][2] = (uint16_t)(((int32_t)op->obase >> 1) & 0xFFFF);
 
 	objon(pri, op->objy, op->ysize);	/* enable access table bits */
@@ -111,5 +107,5 @@
 	vi_ctl |= (1u << pri);			/* set unblank bit */
 
-	if (*((int32_t *)0x000064) NE &VIint)	/* make sure VI vector is set */
+	if (*(intvec)0x000064 NE &VIint)	/* make sure VI vector is set */
 		BIOS(B_SETV, 25, VIint);
 
@@ -142,5 +138,5 @@
 	op->objy = y0;
 	op->obase = base;
-	op->opri = pri;
+	op->opri = (int8_t)pri;
 	op->obank = bank & 3;
 
Index: vlib/vputs.c
===================================================================
--- vlib/vputs.c	(revision 09d13458eaf73781ea49a7ff93d5b5297fa74f9b)
+++ vlib/vputs.c	(revision bf89cfbcf78fe3cb5c96d5d735872139aa14889a)
@@ -27,5 +27,5 @@
 	int16_t	c;
 
-	while (c = *str++) {
+	while ((c = *str++)) {
 
 		vputc(obase, row, col, c, attr);
@@ -54,5 +54,5 @@
 	int16_t	c;
 
-	while (c = *str++) {
+	while ((c = *str++)) {
 
 		vputc(obase, row, col, c, *attr++);
