X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=time.c;h=8e2f7c04941f98b524818a38f6aa6ef0c71e9fad;hb=refs%2Fheads%2Ftest;hp=203c3bf14680583348b7072e2cdf21f3c7fa6bb1;hpb=18b507e1b20fc6c32ee50f00fb910a59110c1a1d;p=bonanza.git diff --git a/time.c b/time.c index 203c3bf..8e2f7c0 100644 --- a/time.c +++ b/time.c @@ -7,7 +7,7 @@ #include "shogi.h" -void +void CONV set_search_limit_time( int turn ) /* [inputs] @@ -39,14 +39,26 @@ set_search_limit_time( int turn ) */ { unsigned int u0, u1; - +#ifdef XBOARD + extern char xboard_mode; + if(xboard_mode) return; +#endif /* no time-control */ if ( sec_limit_up == UINT_MAX || ( game_status & flag_pondering ) ) { time_max_limit = time_limit = UINT_MAX; return; } - + +#if defined(USI) + if ( usi_mode != usi_off && usi_byoyomi ) + { + time_max_limit = time_limit = usi_byoyomi; + Out( "- time ctrl: %u -- %u\n", time_limit, time_max_limit ); + return; + } +#endif + /* not punctual to the time */ if ( ! sec_limit && ( game_status & flag_time_extendable ) ) { @@ -69,7 +81,7 @@ set_search_limit_time( int turn ) if ( u0 == 2U ) { u0 = 3U; } /* 'byo-yomi' is so long that the ordinary time-limit is negligible. */ - if ( u0 < sec_limit_up * 3U / 2U ) { u0 = sec_limit_up * 3U / 2U; } + if ( u0 < sec_limit_up * 5U ) { u0 = sec_limit_up * 5U; } u1 = u0 * 5U; @@ -115,8 +127,8 @@ set_search_limit_time( int turn ) } -int -renovate_time( int turn ) +int CONV +update_time( int turn ) { unsigned int te, time_elapsed; int iret; @@ -137,7 +149,7 @@ renovate_time( int turn ) } -void +void CONV adjust_time( unsigned int elapsed_new, int turn ) { const char *str = "TIME SKEW DETECTED"; @@ -162,7 +174,7 @@ adjust_time( unsigned int elapsed_new, int turn ) } -int +int CONV reset_time( unsigned int b_remain, unsigned int w_remain ) { if ( sec_limit_up == UINT_MAX ) @@ -187,7 +199,7 @@ reset_time( unsigned int b_remain, unsigned int w_remain ) } -const char * +const char * CONV str_time( unsigned int time ) { static char str[32]; @@ -208,7 +220,7 @@ str_time( unsigned int time ) } -const char * +const char * CONV str_time_symple( unsigned int time ) { static char str[32]; @@ -226,7 +238,7 @@ str_time_symple( unsigned int time ) } -int +int CONV get_cputime( unsigned int *ptime ) { #if defined(_WIN32) @@ -269,7 +281,7 @@ get_cputime( unsigned int *ptime ) } -int +int CONV get_elapsed( unsigned int *ptime ) { #if defined(_WIN32)