X-Git-Url: http://winboard.nl/cgi-bin?p=bonanza.git;a=blobdiff_plain;f=main.c;h=89c031616d39b08a3190895cf71d3f7cc9d29b92;hp=f84ad15fc31b334cae7ccbcf7e9209c806e60736;hb=cygwin;hpb=18b507e1b20fc6c32ee50f00fb910a59110c1a1d diff --git a/main.c b/main.c index f84ad15..89c0316 100644 --- a/main.c +++ b/main.c @@ -1,36 +1,3 @@ -/* - BUG LIST - - - detection of repetitions can be wrong due to collision of hash keys and - limitation of history table size. - - - detection of mates fails if all of pseudo-legal evasions are perpetual - checks. Father more, inferior evasions, such as unpromotion of - bishop, rook, and lance at 8th rank, are not counted for the mate - detection. - - - detection of perpetual checks fails if one of those inferior - evasions makes a position that occurred four times. -*/ -/* - TODO: - - idirec && is_pinned_on_black_king(); - - aifile and airank - - incheck at quies - - max legal moves - - tactical macro - - out_warning( "A node returns a value lower than mate." ); is obsolate. - - do_mate in hash - - pv store to hash - - no threat - - use IsDiscover macro - - change hash_store_pv() - - dek.c is obsolate. - - limit time ? ? num - - hash.bin - - SHARE to all transition table - */ - #include #include #include @@ -41,8 +8,8 @@ static int main_child( tree_t * restrict ptree ); -int CONV_CDECL -#if defined(CSASHOGI) +int +#if defined(CSASHOGI) || defined(USI) main( int argc, char *argv[] ) #else main() @@ -51,6 +18,9 @@ main() int iret; tree_t * restrict ptree; +#ifdef XBOARD + Out("feature done=0\n"); +#endif #if defined(TLP) ptree = tlp_atree_work; #else @@ -58,7 +28,6 @@ main() #endif #if defined(CSASHOGI) && defined(_WIN32) - FreeConsole(); if ( argc != 2 || strcmp( argv[1], "csa_shogi" ) ) { MessageBox( NULL, @@ -70,6 +39,11 @@ main() } #endif +#if defined(USI) + if ( argc == 2 && ! strcmp( argv[1], "usi" ) ) { usi_mode = usi_on; } + else { usi_mode = usi_off; } +#endif + if ( ini( ptree ) < 0 ) { out_error( "%s", str_error ); @@ -82,13 +56,13 @@ main() if ( iret == -1 ) { out_error( "%s", str_error ); - ShutdownClient; + ShutdownAll(); break; } else if ( iret == -2 ) { out_warning( "%s", str_error ); - ShutdownClient; + ShutdownAll(); continue; } else if ( iret == -3 ) { break; } @@ -105,18 +79,6 @@ main_child( tree_t * restrict ptree ) { int iret; -#if defined(DEKUNOBOU) - if ( dek_ngame && ( game_status & mask_game_end ) ) - { - TlpEnd(); - if ( dek_next_game( ptree ) < 0 ) - { - out_error( "%s", str_error ); - return -3; - } - } -#endif - /* ponder a move */ ponder_move = 0; iret = ponder( ptree );