diff -urN xlife-6.7.5/data.c xlife-6.7.6/data.c
--- xlife-6.7.5/data.c	2013-10-22 22:56:19.000000000 +0400
+++ xlife-6.7.6/data.c	2014-01-14 11:25:58.000000000 +0400
@@ -21,9 +21,9 @@
  */
 
 /*
-A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
+A lot of modifications were added at 2001, 2011-14 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: data.c 216 2013-07-28 18:06:27Z micro $
+$Id: data.c 278 2014-01-13 18:19:40Z litwr $
 */
 
 #include "defs.h"
@@ -102,3 +102,8 @@
 
 char curdir[PATNAMESIZ], inidir[PATNAMESIZ], colorfile[PATNAMESIZ];
 cell_t *trans;
+
+#if VFREQ != 0
+struct timeval prev_vsync;
+#endif
+
diff -urN xlife-6.7.5/defs.h xlife-6.7.6/defs.h
--- xlife-6.7.5/defs.h	2013-10-22 22:56:19.000000000 +0400
+++ xlife-6.7.6/defs.h	2014-01-14 11:26:08.000000000 +0400
@@ -21,9 +21,9 @@
  */
 
 /*
-A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
+A lot of modifications were added at 2001, 2011-14 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: defs.h 255 2013-10-22 09:12:33Z teacher $
+$Id: defs.h 278 2014-01-13 18:19:40Z litwr $
 */
 
 #ifdef __GNUCC__
@@ -36,6 +36,7 @@
 #include <X11/cursorfont.h>
 #include <X11/keysym.h>
 #include <X11/keysymdef.h>
+#include <sys/time.h>
 #include <string.h>
 #include "common.h"
 
@@ -433,3 +434,8 @@
 #define btrans ((cell_t(*)[maxstates][maxstates][maxstates][maxstates][maxstates][maxstates][maxstates][maxstates])trans)
 extern XColor cellcolor[], exact;
 extern XGCValues xgcv;
+
+#if VFREQ != 0
+extern struct timeval prev_vsync;
+#endif
+
diff -urN xlife-6.7.5/file.c xlife-6.7.6/file.c
--- xlife-6.7.5/file.c	2013-08-04 15:10:25.000000000 +0400
+++ xlife-6.7.6/file.c	2014-01-12 22:06:19.000000000 +0400
@@ -28,7 +28,7 @@
 /*
 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: file.c 241 2013-08-04 10:00:07Z micro $
+$Id: file.c 256 2013-10-22 19:17:22Z teacher $
 */
 
 /*
@@ -478,7 +478,7 @@
    strcpy(patfile, patname);
    if (patfile[0] == '/'
 #ifdef MICROSOFT
-                         || strstr(patfile, ":/") == patfile + 1
+           || strstr(patfile, ":/") == patfile + 1 || strchr(patfile, '/') == 0
 #endif
                                                                 )
       strcpy(fullpath, patfile);
diff -urN xlife-6.7.5/file.h xlife-6.7.6/file.h
--- xlife-6.7.5/file.h	2013-03-23 13:02:49.000000000 +0400
+++ xlife-6.7.6/file.h	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: file.h 174 2013-03-23 09:02:49Z micro $
+$Id: file.h 216 2013-07-28 18:06:27Z micro $
 */
 
 extern char rfullpath[];
diff -urN xlife-6.7.5/file_misc.c xlife-6.7.6/file_misc.c
--- xlife-6.7.5/file_misc.c	2013-01-25 19:28:17.000000000 +0400
+++ xlife-6.7.6/file_misc.c	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
  * A lot of modifications were added at 2001, 2011, 2012 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: file_misc.c 73 2012-05-13 07:16:57Z micro $
+ * $Id: file_misc.c 216 2013-07-28 18:06:27Z micro $
  */
 
 #include "defs.h"
diff -urN xlife-6.7.5/generate.c xlife-6.7.6/generate.c
--- xlife-6.7.5/generate.c	2013-08-04 15:10:25.000000000 +0400
+++ xlife-6.7.6/generate.c	2014-01-12 22:06:19.000000000 +0400
@@ -25,7 +25,7 @@
 /*
 A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: generate.c 241 2013-08-04 10:00:07Z micro $
+$Id: generate.c 270 2014-01-11 15:25:55Z litwr $
 */
 
 /*
@@ -1498,7 +1498,7 @@
 
 /*
  * Offsets of current tile in hold area.  The idea here is that we need to copy
- * enough of the surrounding tiles into the hold area to do all resolution. 
+ * enough of the surrounding tiles into the hold area to do all resolution.
  * For table-driven functions one edge row suffices; for payoff-driven
  * functions, two edge rows/columns are needed (because we need to compute the
  * payoffs of the inner edge cells).
diff -urN xlife-6.7.5/gen-multirules.c xlife-6.7.6/gen-multirules.c
--- xlife-6.7.5/gen-multirules.c	2013-03-17 19:30:44.000000000 +0400
+++ xlife-6.7.6/gen-multirules.c	2014-01-11 13:55:41.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * Multirules Generator Copyright 2013 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: gen-multirules.c 152 2013-03-17 15:30:44Z micro $
+ * $Id: gen-multirules.c 216 2013-07-28 18:06:27Z micro $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff -urN xlife-6.7.5/gentab.c xlife-6.7.6/gentab.c
--- xlife-6.7.5/gentab.c	2012-05-05 20:17:09.000000000 +0400
+++ xlife-6.7.6/gentab.c	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
 A lot of modifications were added at 2011, 2012 by Vladimir Lidovski vol.litwr@gmail.com
 (C) This version of XLife may be used under the same conditions as mentioned above
-$Id: gentab.c 65 2012-05-05 16:17:09Z micro $
+$Id: gentab.c 216 2013-07-28 18:06:27Z micro $
 */
 
 #include "defs.h"
diff -urN xlife-6.7.5/history.c xlife-6.7.6/history.c
--- xlife-6.7.5/history.c	2013-05-28 08:06:55.000000000 +0400
+++ xlife-6.7.6/history.c	2014-01-11 13:55:41.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * XLife Copyright 2013 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: history.c 197 2013-05-28 04:06:55Z micro $
+ * $Id: history.c 216 2013-07-28 18:06:27Z micro $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff -urN xlife-6.7.5/history.h xlife-6.7.6/history.h
--- xlife-6.7.5/history.h	2013-03-10 09:09:06.000000000 +0400
+++ xlife-6.7.6/history.h	2014-01-11 13:55:41.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * XLife Copyright 2013 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: history.h 142 2013-03-10 05:09:06Z micro $
+ * $Id: history.h 216 2013-07-28 18:06:27Z micro $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff -urN xlife-6.7.5/isave.c xlife-6.7.6/isave.c
--- xlife-6.7.5/isave.c	2013-08-01 15:56:59.000000000 +0400
+++ xlife-6.7.6/isave.c	2014-01-12 22:06:19.000000000 +0400
@@ -5,7 +5,7 @@
 
 /*
 Several modifications were added at 2011 by Vladimir Lidovski <vol.litwr@gmail.com>
-$Id: isave.c 216 2013-07-28 18:06:27Z micro $
+$Id: isave.c 271 2014-01-11 15:33:25Z litwr $
 */
 
 /* it saves pattern in I-format.
@@ -116,7 +116,7 @@
 		for (j = 0; j < sp->xsize; j++) {
 		    transform(flip, rotation, j, i, tp->xsize-1, tp->ysize-1,
 			      &newx, &newy);
-		    if (lookcell(sp->blob, sp->blob->xmin + j, sp->blob->ymin + i) 
+		    if (lookcell(sp->blob, sp->blob->xmin + j, sp->blob->ymin + i)
 			!= lookcell(tp->blob, tp->blob->xmin + newx, tp->blob->ymin + newy))
 			goto nomatch;
 		}
diff -urN xlife-6.7.5/main.c xlife-6.7.6/main.c
--- xlife-6.7.5/main.c	2013-10-22 22:56:19.000000000 +0400
+++ xlife-6.7.6/main.c	2014-01-14 11:08:26.000000000 +0400
@@ -23,9 +23,9 @@
  */
 
 /*
- * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
+ * A lot of modifications were added at 2001, 2011-14 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: main.c 256 2013-10-22 19:17:22Z teacher $
+ * $Id: main.c 279 2014-01-14 08:09:57Z litwr $
  */
 
 #include <X11/Xlib.h>
@@ -71,6 +71,9 @@
       XClearWindow(disp, lifew);
       pivot = 0;
       drawboundedgrid();
+#if VFREQ != 0
+      prev_vsync.tv_sec--;
+#endif
       redisplay(MESH + EXPOSE);
    }
    else if (win == inputw) {
@@ -1181,6 +1184,9 @@
         fatal("Can't open X display\n");
     if (XDefaultDepth(disp, screen) < STATEBITS)
         fatal("Not enough colors for compiled STATEBITS value\n");
+#if VFREQ != 0
+    gettimeofday(&prev_vsync, 0);
+#endif
     setcurdir(LIFEDIR); /*inidir*/
     fileinit();
     initcells(&active);
@@ -1303,7 +1309,7 @@
 #ifndef MICROSOFT
                 KeyPressMask |
 #endif
-                 ExposureMask | StructureNotifyMask);
+                ExposureMask | StructureNotifyMask);
     XSelectInput(disp, inputw, ButtonPressMask | ExposureMask);
     XSelectInput(disp, lifew, KeyPressMask | ButtonPressMask | Button1MotionMask
        | PointerMotionMask | Button3MotionMask | ButtonReleaseMask | ExposureMask);
diff -urN xlife-6.7.5/patchlevel.h xlife-6.7.6/patchlevel.h
--- xlife-6.7.5/patchlevel.h	2013-10-22 12:51:32.000000000 +0400
+++ xlife-6.7.6/patchlevel.h	2014-01-13 21:18:09.000000000 +0400
@@ -23,9 +23,9 @@
 /*
  * Several modifications were added at 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: patchlevel.h 255 2013-10-22 09:12:33Z teacher $
+ * $Id: patchlevel.h 278 2014-01-13 18:19:40Z litwr $
  */
 
 static int majorversion = 6;
 static int minorversion = 7;
-static int patchlevel = 5;
+static int patchlevel = 6;
diff -urN xlife-6.7.5/tab.h xlife-6.7.6/tab.h
--- xlife-6.7.5/tab.h	2012-03-30 18:37:35.000000000 +0400
+++ xlife-6.7.6/tab.h	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
  * Several modifications were added at 2011, 2012 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: tab.h 43 2012-03-08 19:11:49Z micro $
+ * $Id: tab.h 216 2013-07-28 18:06:27Z micro $
  */
 
 int tab1[] = {
diff -urN xlife-6.7.5/tentative.c xlife-6.7.6/tentative.c
--- xlife-6.7.5/tentative.c	2013-08-04 15:10:25.000000000 +0400
+++ xlife-6.7.6/tentative.c	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: tentative.c 241 2013-08-04 10:00:07Z micro $
+ * $Id: tentative.c 245 2013-08-04 10:04:07Z teacher $
  */
 
 #include <stddef.h>     /* we need offsetof() */
diff -urN xlife-6.7.5/tile.c xlife-6.7.6/tile.c
--- xlife-6.7.5/tile.c	2013-09-29 22:21:44.000000000 +0400
+++ xlife-6.7.6/tile.c	2014-01-14 11:08:26.000000000 +0400
@@ -21,9 +21,9 @@
  */
 
 /*
- * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
+ * A lot of modifications were added at 2001, 2011-14 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: tile.c 253 2013-09-29 18:39:43Z teacher $
+ * $Id: tile.c 279 2014-01-14 08:09:57Z litwr $
  */
 
 /*
@@ -330,6 +330,9 @@
 }
 
 void display_move(int force, int dx, int dy) {
+#if VFREQ != 0
+   prev_vsync.tv_sec--;
+#endif
    if ((tentative.tiles || force) && wireframe && scale == 1)
       redraw_lifew();
    else if ((tentative.tiles || force) && wireframe && scale > 1 && !dispmesh) {
@@ -460,13 +463,15 @@
 #if VFREQ == 0
    return 1;
 #else
-   static struct timeval prev, cur;
+   struct timeval cur;
    gettimeofday(&cur, 0);
-   if ((unsigned)((cur.tv_sec - prev.tv_sec)*1000000 + cur.tv_usec
-                                             - prev.tv_usec) > 1000000/VFREQ) {
-      prev = cur;
+   if ((cur.tv_sec - prev_vsync.tv_sec)*1000000 + cur.tv_usec
+                                        - prev_vsync.tv_usec > 1000000/VFREQ) {
+      prev_vsync = cur;
       return 1;
-   }
+   } 
+   else if (cur.tv_sec < prev_vsync.tv_sec)
+      prev_vsync = cur;
    return state == STOP;
 #endif
 }
@@ -881,16 +886,16 @@
  * Determine the bounding box of the live cells.
  */
     cellcount = bounding_box(pp);
-    if (mode == '4') {
+    if (mode == '4') { /* 8-bit format */
           if (ev_mode != VALENCE_DRIVEN || (born&1) || pp->xmax - pp->xmin >= 192
                 || pp->ymax - pp->ymin >= 192 
                 || pp->xmax - pp->xmin >= 160 && pp->ymax - pp->ymin >= 160) {
              fprintf(stderr, "can't convert this pattern\n");
              return;
           }
+          fprintf(ofp, "%c%c", pp->xmax - pp->xmin + 1, pp->ymax - pp->ymin + 1);
           fwrite(&live, 2, 1, ofp);
           fwrite(&born, 2, 1, ofp);
-          fprintf(ofp, "%c%c", pp->xmax - pp->xmin + 1, pp->ymax - pp->ymin + 1);
 	  FOR_CELLS(pp, ptr, dx, dy)
 		if (val = getcell(&ptr->cells, dx, dy))
 		    fprintf(ofp, "%c%c",
diff -urN xlife-6.7.5/tile.h xlife-6.7.6/tile.h
--- xlife-6.7.5/tile.h	2013-08-04 15:10:25.000000000 +0400
+++ xlife-6.7.6/tile.h	2014-01-11 13:55:41.000000000 +0400
@@ -23,7 +23,7 @@
 /*
  * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: tile.h 240 2013-08-01 12:11:59Z micro $
+ * $Id: tile.h 240 2013-08-01 12:45:59Z  $
  */
 
 #define XMASK 0xfffffff8
diff -urN xlife-6.7.5/topology.h xlife-6.7.6/topology.h
--- xlife-6.7.5/topology.h	2013-04-07 18:11:20.000000000 +0400
+++ xlife-6.7.6/topology.h	2014-01-11 13:55:41.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * XLife Copyright 2012, 2013 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: topology.h 187 2013-04-07 14:11:20Z micro $
+ * $Id: topology.h 216 2013-07-28 18:06:27Z micro $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
diff -urN xlife-6.7.5/utils.c xlife-6.7.6/utils.c
--- xlife-6.7.5/utils.c	2013-10-22 22:56:19.000000000 +0400
+++ xlife-6.7.6/utils.c	2014-01-14 11:26:37.000000000 +0400
@@ -21,15 +21,14 @@
  */
 
 /*
- * A lot of modifications were added at 2001, 2011-13 by Vladimir Lidovski vol.litwr@gmail.com
+ * A lot of modifications were added at 2001, 2011-14 by Vladimir Lidovski vol.litwr@gmail.com
  * (C) This version of XLife may be used under the same conditions as mentioned above
- * $Id: utils.c 241 2013-08-04 10:00:07Z micro $
+ * $Id: utils.c 278 2014-01-13 18:19:40Z litwr $
  */
 
 #include <pwd.h>
 #include <stdlib.h>
 #include <ctype.h>
-#include <sys/time.h>
 #include "defs.h"
 #include "tile.h"
 #include "colors.h"
@@ -56,6 +55,27 @@
    XRaiseWindow(disp, coordw);
 }
 
+#ifdef MICROSOFT
+void fatalw(const char *s) {
+   XSelectInput(disp, mainw, KeyPressMask|ButtonPressMask|ExposureMask);
+   XMapWindow(disp, mainw);
+   XSetWindowBackground(disp, mainw, cellcolor[RED_EVER].pixel);
+   XClearWindow(disp, mainw);
+   for (;;) {
+      XDrawString(disp, mainw, ntextgc, 10, 10, s, strlen(s));
+      XMaskEvent(disp, KeyPressMask|ButtonPressMask|ExposureMask, &event);
+      switch(event.type) {
+      case ButtonPress:
+      case KeyPress:
+         goto finish;
+      case Expose:;
+      }
+   }
+finish: 
+   exit(22);
+}
+#endif
+
 void fatal(const char *s) {
    fprintf(stderr, s);
    exit(22);
@@ -225,6 +245,7 @@
          num++;
    }
    redisplay(0);
+   displaystats();
 }
 
 void settimeout(unsigned long ms) {
diff -urN xlife-6.7.5/xlife.man xlife-6.7.6/xlife.man
--- xlife-6.7.5/xlife.man	2013-03-21 18:50:17.000000000 +0400
+++ xlife-6.7.6/xlife.man	2014-01-11 13:55:41.000000000 +0400
@@ -1,5 +1,5 @@
 .TH Xlife 6
-\" $Id: xlife.man 167 2013-03-21 14:50:17Z micro $
+\" $Id: xlife.man 216 2013-07-28 18:06:27Z micro $
 .SH NAME
 Xlife \- Conway's Game of Life and other cellular automata, for X
 .SH SYNTAX
diff -urN xlife-6.7.5/xwidget.c xlife-6.7.6/xwidget.c
--- xlife-6.7.5/xwidget.c	2013-08-04 15:10:25.000000000 +0400
+++ xlife-6.7.6/xwidget.c	2014-01-12 22:06:19.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * XLife Copyright 2011-13 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: xwidget.c 241 2013-08-04 10:00:07Z micro $
+ * $Id: xwidget.c 272 2014-01-11 15:44:48Z litwr2 $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -202,9 +202,9 @@
                                                                     strlen(p));
       if (gc == itextgc)
          if (strlen(widget_fn) >= LOADW_WIDTH/FONTWIDTH) {
-	    XSetWindowBackground(disp, inputw, cellcolor[GREEN_EVER].pixel);
+            XSetWindowBackground(disp, inputw, cellcolor[GREEN_EVER].pixel);
             XClearWindow(disp, inputw);
-	    XSetWindowBackground(disp, inputw, fcolor);
+            XSetWindowBackground(disp, inputw, fcolor);
             XDrawString(disp, inputw, ntextgc, 2, FONTHEIGHT, widget_fn,
                                                             strlen(widget_fn));
          }
diff -urN xlife-6.7.5/xwidget.h xlife-6.7.6/xwidget.h
--- xlife-6.7.5/xwidget.h	2012-05-11 16:30:21.000000000 +0400
+++ xlife-6.7.6/xwidget.h	2014-01-11 13:55:41.000000000 +0400
@@ -1,6 +1,6 @@
 /*
  * XLife Copyright 2011, 2012 Vladimir Lidovski vol.litwr@gmail.com
- * $Id: xwidget.h 71 2012-05-11 12:30:21Z micro $
+ * $Id: xwidget.h 216 2013-07-28 18:06:27Z micro $
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
