Call DoEvents during time-consuming operations
[xboard.git] / backend.c
index f5b4e59..36eca33 100644 (file)
--- a/backend.c
+++ b/backend.c
@@ -8371,10 +8371,10 @@ BitbaseProbe ()
     // probe EGBB
     if(loaded == 2) return 13; // loading failed before
     if(loaded == 0) {
-       loaded = 2; // prepare for failure
        char *p, *path = strstr(appData.egtFormats, "scorpio:"), buf[MSG_SIZ];
        HMODULE lib;
        PLOAD_EGBB loadBB;
+       loaded = 2; // prepare for failure
        if(!path) return 13; // no egbb installed
        strncpy(buf, path + 8, MSG_SIZ);
        if(p = strchr(buf, ',')) *p = NULLCHAR; else p = buf + strlen(buf);
@@ -9421,6 +9421,9 @@ printf("score=%d count=%d\n",score,count);
            if (sscanf(message, "%d%c %d %d " u64Display " %[^\n]\n",
                       &plylev, &plyext, &curscore, &time, &nodes, buf1) >= 5) {
 
+               if(nodes>>32 == u64Const(0xFFFFFFFF))   // [HGM] negative node count read
+                   nodes += u64Const(0x100000000);
+
                if (plyext != ' ' && plyext != '\t') {
                    time *= 100;
                }
@@ -15848,7 +15851,7 @@ SaveSelected (FILE *g, int dummy, char *dummy2)
        if(lg->position >= 0) { // selected?
            LoadGame(f, nItem, "", TRUE);
            SaveGamePGN2(g); // leaves g open
-           cnt++;
+           cnt++; DoEvents();
        }
         lg = (ListGame *) lg->node.succ;
     }
@@ -15884,8 +15887,11 @@ CreateBookEvent ()
 
     /* Get list size */
     for (nItem = 1; nItem <= ((ListGame *) gameList.tailPred)->number; nItem++){
-       LoadGame(f, nItem, "", TRUE);
-       AddGameToBook(TRUE);
+       if(lg->position >= 0) {
+           LoadGame(f, nItem, "", TRUE);
+           AddGameToBook(TRUE);
+           DoEvents();
+       }
         lg = (ListGame *) lg->node.succ;
     }