static int CONV next_root_move( tree_t * restrict ptree, int turn );
#endif
+#ifdef XBOARD
+extern char xboard_mode;
+#endif
+
static int CONV
search_wrapper( tree_t * restrict ptree, int alpha, int beta, int turn,
int depth, int ply, unsigned int state_node )
if ( ptree->pv[0].length )
{
+#ifdef XBOARD
+ if(xboard_mode) Out("%2d %6d %6d %8d ", iteration_depth, value, time/10, 1); else
+#endif
if ( root_move_list[root_index].status & flag_first )
{
Out( " %2d %6s %7.2f ", iteration_depth, str, dvalue );
for ( ply = 1; ply <= ptree->pv[0].length; ply++ )
{
+#ifdef XBOARD
+ if(xboard_mode && is_out) { // print PV move in WB format
+ int move = ptree->pv[0].a[ply], from = I2From(move), to = I2To(move);
+ char inPromoZone = tt > 0 ? from >= 6*9 || to >= 6*9 : to < 3*9|| from < 3*9;
+ if(from >= nsquare)
+ Out(" %c@%c%c", "PLNSGBR"[From2Drop(from)-1], 'a'+to%9, '9'-to/9);
+ else
+ Out(" %c%c%c%c%s", 'a'+from%9, '9'-from/9, 'a'+to%9, '9'-to/9,
+ inPromoZone ? I2IsPromote(move) ? "+" : "=" : "");
+ } else
+#endif
if ( is_out )
{
if ( ply > 1 && ! ( (ply-1) % 5 ) )
for ( i = 1; i < ply; i++ )
if ( ptree->pv[0].a[i] == ptree->pv[0].a[ply] ) { goto rep_esc; }
+#ifdef XBOARD
+ if(xboard_mode && is_out) { // print PV move in WB format
+ int move = ptree->pv[0].a[ply], from = I2From(move), to = I2To(move);
+ char inPromoZone = tt > 0 ? from >= 6*9 || to >= 6*9 : to < 3*9|| from < 3*9;
+ if(from >= nsquare)
+ Out(" %c@%c%c", "PLNSGBR"[From2Drop(from)-1], 'a'+to%9, '9'-to/9);
+ else
+ Out(" %c%c%c%c%s", 'a'+from%9, '9'-from/9, 'a'+to%9, '9'-to/9,
+ inPromoZone ? I2IsPromote(move) ? "+" : "=" : "");
+ } else
+#endif
if ( is_out )
{
if ( ply > 1 && ! ( (ply-1) % 5 ) )
root_index = i;
#if ! ( defined(NO_STDOUT) && defined(NO_LOGGING) )
+#ifdef XBOARD
+ if(!xboard_mode)
+#endif
if ( iteration_depth > 5 )
{
const char *str_move;