Index: ram/wsdsp.c
===================================================================
--- ram/wsdsp.c	(revision 6d5247b289a9daaa4898b4b18787207457c10702)
+++ ram/wsdsp.c	(revision b2691c2c5c6452bd60a230b122d7ce277eef101b)
@@ -85,5 +85,5 @@
 	register int16_t *fv, *hv, *ov;
 	register int16_t i;
-	int16_t cx;
+	uint16_t cx;
 
 	cx = exp_c(wdbox[0][0]);
@@ -131,10 +131,9 @@
 void wdswin(int16_t n)
 {
-	register int16_t cx, wval;
-	register int8_t wsgn;
-
-	cx = wdbox[n][5];
-	cx |= cx << 4;
-	cx |= cx << 8;
+	uint16_t cx;
+	int16_t wval;
+	int8_t wsgn;
+
+	cx = exp_c(wdbox[n][5]);
 
 	/* first, fill the box with the background color */
@@ -166,5 +165,5 @@
 		sprintf(bfs, "%02d", curwave + 1);
 		tsplot4(waveob, 64,
-			exp_c(wsnmod[curvce][curwslt] ? WS_CHGC : wdbox[n][4]),
+			wsnmod[curvce][curwslt] ? WS_CHGC : wdbox[n][4],
 			wdbox[n][6], wdbox[n][7] + WAVE_OFF, bfs, 14);
 
@@ -367,6 +366,6 @@
 		for (j = 0; j < NUMWPNT; j++) {
 
-			wslib[i].final[j]  = ((j + 1) << 8) ^ 0x8000;
-			wslib[i].offset[j] = ((j + 1) << 8) ^ 0x8000;
+			wslib[i].final[j]  = ((j + 1) << 8) ^ (int16_t)0x8000;
+			wslib[i].offset[j] = ((j + 1) << 8) ^ (int16_t)0x8000;
 		}
 
