Add PG option to show tablebase hits
[polyglot.git] / xboard2uci.c
index dfae34c..b8bcea1 100644 (file)
@@ -606,6 +606,8 @@ void xboard2uci_gui_step(char string[]) {
                 }
                 my_log("POLYGLOT EGTB Cache is %dMb\n",egt_cache);
                 real_memory=memory-egt_cache;
+               opt=option_find(Uci->option,"Hash");
+               if(opt && real_memory > atoi(opt->max)) real_memory = atoi(opt->max); // [HGM] top off
                 if(real_memory>0){
                     start_protected_command();
                     uci_send_option(Uci,"Hash", "%d", real_memory);
@@ -1688,6 +1690,7 @@ static void send_info() {
     }else{
         min_depth=1;
     }
+    if(!strncmp(Uci->info, "xboard ", 7)) gui_send(GUI,"%s",Uci->info+7); else // kludge to allow UCI engines to use WB protocol
     gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth>min_depth?Uci->best_depth:min_depth,
             0,0.0,U64(0),Uci->info);  
 }
@@ -1715,7 +1718,9 @@ static void send_pv() {
 
                 if(Uci->depth==-1) //hack to clear the engine output window
              gui_send(GUI,"%d %+d %.0f "S64_FORMAT" ",0,report_best_score(),Uci->time*100.0,Uci->node_nb);
-
+               if(option_get_bool(Option,"ShowTbHits"))
+                gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {"S64_FORMAT"} %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,Uci->tbhit_nb,pv_string);
+               else
                 gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,pv_string);
 
       } else if (State->state == PONDER &&