diff -Naur e-uae-0.8.28.orig/src/picasso96.c e-uae-0.8.28/src/picasso96.c
--- e-uae-0.8.28.orig/src/picasso96.c	2005-09-01 22:17:22.000000000 +0400
+++ e-uae-0.8.28/src/picasso96.c	2006-06-14 20:53:06.000000000 +0400
@@ -5,7 +5,7 @@
  *
  * Copyright 1997-2001 Brian King <Brian_King@Mitel.com, Brian_King@Cloanto.com>
  * Copyright 2000-2001 Bernd Roesch
- * Copyright 2003-2004 Richard Drummond
+ * Copyright 2003-2005 Richard Drummond
  *
  * Theory of operation:
  * On the Amiga side, a Picasso card consists mainly of a memory area that
@@ -27,7 +27,6 @@
  * accesses which may be rather slow.
  *
  * TODO:
- * - add panning capability
  * - we want to add a manual switch to override SetSwitch for hardware banging
  *   programs started from a Picasso workbench.
  */
@@ -615,7 +614,7 @@
      * coordinates for the source rectangle in the framebuffer - not the source
      * coordinates.
      */
-    srcp = ri->Memory + dstx * Bpp + dsty * ri->BytesPerRow;
+    srcp = ri->Memory + (dstx + xoff) * Bpp + (dsty + yoff) * ri->BytesPerRow;
 
     dstp += dsty * picasso_vidinfo.rowbytes + dstx * picasso_vidinfo.pixbytes;
 
@@ -625,7 +624,6 @@
 	       width,height, picasso_vidinfo.pixbytes));
     P96TRACE (("P96: gfxmem is at 0x%x\n", gfxmemory));
 
-    DX_Invalidate (dsty, dsty + height - 1);
 
 
 
@@ -771,11 +769,11 @@
 
 static void flush_currline (void)
 {
-   unsigned int line_no = (unsigned int)(currline_y - picasso96_state.YOffset);
+    int line_no = currline_y - picasso96_state.YOffset;
 
-   /* We only need to flush this line to the screen if the line
-    * is acutally visible on screen */
-   if (/*line_no >= 0 && */line_no < picasso96_state.Height) {
+    /* We only need to flush this line to the screen if the line
+     * is acutally visible on screen */
+    if (line_no >= 0 && line_no < picasso96_state.Height) {
 
 	/* Tell the graphics system that this line needs to be
 	 * redrawn */
@@ -795,10 +793,11 @@
 		srcp       += first_byte;
 		first_byte = 0;
 	    }
-	    if (first_byte + byte_count > picasso96_state.Width * fb_bpp)
+	    if ((first_byte + byte_count) > (picasso96_state.Width * fb_bpp))
 		byte_count = picasso96_state.Width * fb_bpp - first_byte;
 
-	    write_currline (srcp, line_no, first_byte, byte_count);
+	    if (byte_count > 0)
+		write_currline (srcp, line_no, first_byte, byte_count);
 	}
     }
     currline_start = 0xFFFFFFFF;
@@ -1548,6 +1547,8 @@
     picasso96_state.YOffset   = (uae_s16) m68k_dreg (&regs, 2);
     picasso96_state.RGBFormat =           m68k_dreg (&regs, 7);
 
+    wgfx_flushline();
+
     /* Get our BoardInfo ptr's BitMapExtra ptr */
     bmeptr = get_long (bi + PSSO_BoardInfo_BitMapExtra);
 
@@ -2830,7 +2831,7 @@
 
 	    /* If this line is outside of the p96 screen in the framebuffer
 	     * we ignore it */
-	    if (line_no < picasso96_state.VirtualHeight) {
+	    if ((line_no >= picasso96_state.YOffset) && (line_no < picasso96_state.YOffset + picasso96_state.Height)) {
 	        currline_start = picasso96_state.Address + line_no * picasso96_state.BytesPerRow;
 	        currline_end   = currline_start + picasso96_state.BytesPerRow;
  	        currline_min   = addr;