X-Git-Url: http://winboard.nl/cgi-bin?p=bonanza.git;a=blobdiff_plain;f=time.c;h=fbeb04a113863aa1766333980158fe6dfa9a053d;hp=203c3bf14680583348b7072e2cdf21f3c7fa6bb1;hb=31daebfc1031441aa180e3af2e547a8cd2b92c32;hpb=18b507e1b20fc6c32ee50f00fb910a59110c1a1d diff --git a/time.c b/time.c index 203c3bf..fbeb04a 100644 --- a/time.c +++ b/time.c @@ -7,7 +7,7 @@ #include "shogi.h" -void +void CONV set_search_limit_time( int turn ) /* [inputs] @@ -46,7 +46,16 @@ set_search_limit_time( int turn ) 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 +78,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 +124,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 +146,7 @@ renovate_time( int turn ) } -void +void CONV adjust_time( unsigned int elapsed_new, int turn ) { const char *str = "TIME SKEW DETECTED"; @@ -162,7 +171,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 +196,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 +217,7 @@ str_time( unsigned int time ) } -const char * +const char * CONV str_time_symple( unsigned int time ) { static char str[32]; @@ -226,7 +235,7 @@ str_time_symple( unsigned int time ) } -int +int CONV get_cputime( unsigned int *ptime ) { #if defined(_WIN32) @@ -269,7 +278,7 @@ get_cputime( unsigned int *ptime ) } -int +int CONV get_elapsed( unsigned int *ptime ) { #if defined(_WIN32)