Index: ram/wdfield.c
===================================================================
--- ram/wdfield.c	(revision 0292fbb837057344b92e839b5e70c803241f361b)
+++ ram/wdfield.c	(revision 8618599ab825088c720c202c6e50a52572282c0f)
@@ -26,96 +26,96 @@
 
 extern	void	select(void);
-extern	short	whatbox(void);
+extern	int16_t	whatbox(void);
 extern	void	nokey(void);
-extern	short	nonf(short k);
-extern	short	stdctp1(void);
+extern	int16_t	nonf(int16_t k);
+extern	int16_t	stdctp1(void);
 extern	void	cxkstd(void);
 extern	void	cykstd(void);
 extern	void	stdmkey(void);
-extern	void	stddkey(short k);
-
-extern	short	et_null(short n);
-extern	short	ef_null(short n);
-extern	short	rd_null(short n);
-extern	short	nd_null(short n, short k);
-extern	short	et_wavs(short n);
-extern	short	ef_wavs(short n);
-extern	short	rd_wavs(short n);
-extern	short	nd_wavs(short n, short k);
-extern	short	et_wvce(short n);
-extern	short	ef_wvce(short n);
-extern	short	rd_wvce(short n);
-extern	short	nd_wvce(short n, short k);
-extern	short	et_wslt(short n);
-extern	short	ef_wslt(short n);
-extern	short	rd_wslt(short n);
-extern	short	nd_wslt(short n, short k);
-extern	short	et_wpnt(short n);
-extern	short	ef_wpnt(short n);
-extern	short	rd_wpnt(short n);
-extern	short	nd_wpnt(short n, short k);
-extern	short	et_woff(short n);
-extern	short	ef_woff(short n);
-extern	short	rd_woff(short n);
-extern	short	nd_woff(short n, short k);
-extern	short	et_whar(short n);
-extern	short	ef_whar(short n);
-extern	short	rd_whar(short n);
-extern	short	nd_whar(short n, short k);
-extern	short	et_whrv(short n);
-extern	short	ef_whrv(short n);
-extern	short	rd_whrv(short n);
-extern	short	nd_whrv(short n, short k);
-
-extern	void	vcputsv(int *obase, int nw, int fg, int bg, int row, int col, char *str, int pitch);
-
-extern	void	*memset(void *vp, char c, int n);
-
-/* 
-
-*/
-
-extern	short	astat;
-extern	short	cmtype;
-extern	short	curfunc;
-extern	short	curinst;
-extern	short	curslim;
-extern	short	curvce;
-extern	short	curwave;
-extern	short	curwdth;
-extern	short	curwfnl;
-extern	short	curwhrm;
-extern	short	curwhrv;
-extern	short	curwoff;
-extern	short	curwpnt;
-extern	short	curwslt;
-extern	short	cxrate;
-extern	short	cxval;
-extern	short	cyrate;
-extern	short	cyval;
-extern	short	hitbox;
-extern	short	lstwoff;
-extern	short	lstwpnt;
-extern	short	stccol;
-extern	short	stcrow;
-extern	short	wdupdfl;
-extern	short	wplast;
-extern	short	wpntsv;
-extern	short	wvlast;
-
-/* 
-
-*/
-
-extern	short	crate1[];
-extern	short	offsets[NUMWPCAL];
-extern	short	vmtab[NUMHARM];
-extern	short	wsbuf[NUMWPCAL];
-
-extern	short	wsnmod[12][2];
-
-extern	unsigned *waveob;
-
-extern	char	bfs[];
+extern	void	stddkey(int16_t k);
+
+extern	int16_t	et_null(int16_t n);
+extern	int16_t	ef_null(int16_t n);
+extern	int16_t	rd_null(int16_t n);
+extern	int16_t	nd_null(int16_t n, int16_t k);
+extern	int16_t	et_wavs(int16_t n);
+extern	int16_t	ef_wavs(int16_t n);
+extern	int16_t	rd_wavs(int16_t n);
+extern	int16_t	nd_wavs(int16_t n, int16_t k);
+extern	int16_t	et_wvce(int16_t n);
+extern	int16_t	ef_wvce(int16_t n);
+extern	int16_t	rd_wvce(int16_t n);
+extern	int16_t	nd_wvce(int16_t n, int16_t k);
+extern	int16_t	et_wslt(int16_t n);
+extern	int16_t	ef_wslt(int16_t n);
+extern	int16_t	rd_wslt(int16_t n);
+extern	int16_t	nd_wslt(int16_t n, int16_t k);
+extern	int16_t	et_wpnt(int16_t n);
+extern	int16_t	ef_wpnt(int16_t n);
+extern	int16_t	rd_wpnt(int16_t n);
+extern	int16_t	nd_wpnt(int16_t n, int16_t k);
+extern	int16_t	et_woff(int16_t n);
+extern	int16_t	ef_woff(int16_t n);
+extern	int16_t	rd_woff(int16_t n);
+extern	int16_t	nd_woff(int16_t n, int16_t k);
+extern	int16_t	et_whar(int16_t n);
+extern	int16_t	ef_whar(int16_t n);
+extern	int16_t	rd_whar(int16_t n);
+extern	int16_t	nd_whar(int16_t n, int16_t k);
+extern	int16_t	et_whrv(int16_t n);
+extern	int16_t	ef_whrv(int16_t n);
+extern	int16_t	rd_whrv(int16_t n);
+extern	int16_t	nd_whrv(int16_t n, int16_t k);
+
+extern	void	vcputsv(int16_t *obase, int16_t nw, int16_t fg, int16_t bg, int16_t row, int16_t col, int8_t *str, int16_t pitch);
+
+extern	void	*memset(void *vp, int8_t c, int16_t n);
+
+/* 
+
+*/
+
+extern	int16_t	astat;
+extern	int16_t	cmtype;
+extern	int16_t	curfunc;
+extern	int16_t	curinst;
+extern	int16_t	curslim;
+extern	int16_t	curvce;
+extern	int16_t	curwave;
+extern	int16_t	curwdth;
+extern	int16_t	curwfnl;
+extern	int16_t	curwhrm;
+extern	int16_t	curwhrv;
+extern	int16_t	curwoff;
+extern	int16_t	curwpnt;
+extern	int16_t	curwslt;
+extern	int16_t	cxrate;
+extern	int16_t	cxval;
+extern	int16_t	cyrate;
+extern	int16_t	cyval;
+extern	int16_t	hitbox;
+extern	int16_t	lstwoff;
+extern	int16_t	lstwpnt;
+extern	int16_t	stccol;
+extern	int16_t	stcrow;
+extern	int16_t	wdupdfl;
+extern	int16_t	wplast;
+extern	int16_t	wpntsv;
+extern	int16_t	wvlast;
+
+/* 
+
+*/
+
+extern	int16_t	crate1[];
+extern	int16_t	offsets[NUMWPCAL];
+extern	int16_t	vmtab[NUMHARM];
+extern	int16_t	wsbuf[NUMWPCAL];
+
+extern	int16_t	wsnmod[12][2];
+
+extern	uint16_t *waveob;
+
+extern	int8_t	bfs[];
 
 extern	struct	instdef	vbufs[];
@@ -127,5 +127,5 @@
 
 void	wdxkey(void);
-short	wdnfld(short k);
+int16_t	wdnfld(int16_t k);
 void	wdcxupd(void);
 void	wdcyupd(void);
@@ -137,7 +137,7 @@
 */
 
-#include "wdcurtb.h"		/* short wdcurtb[];  short wdcurct[8][2]; */
-
-short	wxrate = 1;		/* WS interpolate X movement increment */
+#include "wdcurtb.h"		/* int16_t wdcurtb[];  int16_t wdcurct[8][2]; */
+
+int16_t	wxrate = 1;		/* WS interpolate X movement increment */
 
 struct	fet	wd_fet1[] = {
@@ -155,5 +155,5 @@
 };
 
-short	wdbox[][8] = {	/* display box parameters */
+int16_t	wdbox[][8] = {	/* display box parameters */
 
 	{  1,   1, 510, 307, WCFBX00, WCBBX00,  0,  1},	/*  0 */
@@ -165,5 +165,5 @@
 };
 
-char	*wdbxlb0[] = {	/* display box labels -- row 0 */
+int8_t	*wdbxlb0[] = {	/* display box labels -- row 0 */
 
 	"",			/*  0 */
@@ -179,5 +179,5 @@
 };
 
-char	*wdbxlb1[] = {	/* display box labels -- row 1 */
+int8_t	*wdbxlb1[] = {	/* display box labels -- row 1 */
 
 	"",			/*  0 */
@@ -230,6 +230,6 @@
 void updfpu(void)
 {
-	register short i;
-	register short *wsp1, *wsp2;
+	register int16_t i;
+	register int16_t *wsp1, *wsp2;
 
 	/* calculate instrument source and FPU destination pointers */
@@ -270,6 +270,6 @@
 void wsupd(void)
 {
-	register short i;
-	register short *wsp1, *wsp2;
+	register int16_t i;
+	register int16_t *wsp1, *wsp2;
 
 	/* update the offsets[] array from the instrument definition */
@@ -303,6 +303,6 @@
 void whupd(void)
 {
-	register short i;
-	register short *wsp1;
+	register int16_t i;
+	register int16_t *wsp1;
 
 	/* update the final values in the instrument definition */
@@ -330,7 +330,7 @@
 {
 	register struct instdef *ip;
-	short *ov;
-	register short i, j, k, tv, curdif;
-	short cwnp, cwin;
+	int16_t *ov;
+	register int16_t i, j, k, tv, curdif;
+	int16_t cwnp, cwin;
 
 	ip = &vbufs[curvce];			/* instrument definition */
@@ -406,8 +406,8 @@
 {
 	register struct instdef *ip;
-	register short *ov;
-	register short i, j, k, n;
+	register int16_t *ov;
+	register int16_t i, j, k, n;
 	register long t;
-	short to, from;
+	int16_t to, from;
 
 	to   = curwpnt;
@@ -436,5 +436,5 @@
 
 		for (i = 0; i < n; i++)
-			ov[j++] = ((short)((t * (1 + i)) >> 16) + k) << 5;
+			ov[j++] = ((int16_t)((t * (1 + i)) >> 16) + k) << 5;
 	}
 
@@ -509,8 +509,8 @@
 {
 	register struct instdef *ip;
-	register short *ov, *hv;
-	register short i, j, k, tv;
-	register char wsgn;
-	short wval, cwnp, cwin;
+	register int16_t *ov, *hv;
+	register int16_t i, j, k, tv;
+	register int8_t wsgn;
+	int16_t wval, cwnp, cwin;
 
 	ip = &vbufs[curvce];
@@ -669,7 +669,7 @@
 */
 
-short wdnfld(short k)
-{
-	register short *hv;
+int16_t wdnfld(int16_t k)
+{
+	register int16_t *hv;
 	register struct instdef *ip;
 
