--- sed1330-orig.c	2007-04-14 16:38:14.000000000 +0200
+++ sed1330.c	2010-04-01 14:43:21.000000000 +0200
@@ -584,7 +584,9 @@
 	sed1330_command(p, CMD_SYSTEM_SET, 8, data);
 
 	// TODO: The memory locations need to be calculated !
-	sed1330_command(p, CMD_SCROLL, 6, ((unsigned char[6]) {SCR1_L,SCR1_H,0xC7,SCR2_L,SCR2_H,0xC7})); // screen1 and screen2 memory locations
+	sed1330_command(p, CMD_SCROLL, 6,
+		((unsigned char[6]) {SCR1_L,SCR1_H,p->graph_height -1,
+	                         SCR2_L,SCR2_H,p->graph_height -1})); // screen1 and screen2 memory locations
 
 	data[0] = p->cellwidth-1;
 	data[1] = 7;
@@ -613,17 +615,23 @@
 {
 	int i;
 	int port = p->port;
-
+	int s = 2;
+	
 	port_out(port+2, (p->nRESET|p->nWR|p->A0) ^ OUTMASK);		// set A0 to indicate command
 	port_out(port, command);				// set up p
+	uPause(s);
 	port_out(port+2, (p->nRESET|p->A0) ^ OUTMASK);		// activate ^WR
+	uPause(s);
 	port_out(port+2, (p->nRESET|p->nWR|p->A0) ^ OUTMASK);		// deactivate ^WR again
 	port_out(port+2, (p->nRESET|p->nWR) ^ OUTMASK);		// clear A0 to indicate p
 
 	for (i = 0; i < datacount; i++) {
 		port_out(port, data[i]);			// set up data
+		uPause(s);
 		port_out(port+2, (p->nRESET) ^ OUTMASK);		// activate ^WR
+		uPause(s);
 		port_out(port+2, (p->nRESET|p->nWR) ^ OUTMASK);	// deactivate ^WR again
+		uPause(s);
 	}
 }
 
