7 uint64_t ehash_tbl[ EHASH_MASK + 1 ];
8 unsigned char hash_rejections_parent[ REJEC_MASK+1 ];
9 rejections_t hash_rejections[ REJEC_MASK+1 ];
10 trans_table_t *ptrans_table_orig;
11 SHARE trans_table_t *ptrans_table;
12 history_book_learn_t history_book_learn[ HASH_REG_HIST_LEN ];
13 record_t record_problems;
15 rand_work_t rand_work;
16 root_move_t root_move_list[ MAX_LEGAL_MOVES ];
19 slide_tbl_t aslide[ nsquare ];
20 bitboard_t abb_b_knight_attacks[ nsquare ];
21 bitboard_t abb_b_silver_attacks[ nsquare ];
22 bitboard_t abb_b_gold_attacks[ nsquare ];
23 bitboard_t abb_w_knight_attacks[ nsquare ];
24 bitboard_t abb_w_silver_attacks[ nsquare ];
25 bitboard_t abb_w_gold_attacks[ nsquare ];
26 bitboard_t abb_king_attacks[ nsquare ];
27 bitboard_t abb_bishop_attacks_rl45[ nsquare ][ 128 ];
28 bitboard_t abb_bishop_attacks_rr45[ nsquare ][ 128 ];
29 bitboard_t abb_file_attacks[ nsquare ][ 128 ];
30 bitboard_t abb_obstacle[ nsquare ][ nsquare ];
31 bitboard_t abb_mask[ nsquare ];
32 bitboard_t abb_mask_rl90[ nsquare ];
33 bitboard_t abb_mask_rl45[ nsquare ];
34 bitboard_t abb_mask_rr45[ nsquare ];
35 bitboard_t abb_plus_rays[ nsquare ];
36 bitboard_t abb_minus_rays[ nsquare ];
37 uint64_t b_pawn_rand[ nsquare ];
38 uint64_t b_lance_rand[ nsquare ];
39 uint64_t b_knight_rand[ nsquare ];
40 uint64_t b_silver_rand[ nsquare ];
41 uint64_t b_gold_rand[ nsquare ];
42 uint64_t b_bishop_rand[ nsquare ];
43 uint64_t b_rook_rand[ nsquare ];
44 uint64_t b_king_rand[ nsquare ];
45 uint64_t b_pro_pawn_rand[ nsquare ];
46 uint64_t b_pro_lance_rand[ nsquare ];
47 uint64_t b_pro_knight_rand[ nsquare ];
48 uint64_t b_pro_silver_rand[ nsquare ];
49 uint64_t b_horse_rand[ nsquare ];
50 uint64_t b_dragon_rand[ nsquare ];
51 uint64_t b_hand_pawn_rand[ npawn_max ];
52 uint64_t b_hand_lance_rand[ nlance_max ];
53 uint64_t b_hand_knight_rand[ nknight_max ];
54 uint64_t b_hand_silver_rand[ nsilver_max ];
55 uint64_t b_hand_gold_rand[ ngold_max ];
56 uint64_t b_hand_bishop_rand[ nbishop_max ];
57 uint64_t b_hand_rook_rand[ nrook_max ];
58 uint64_t w_pawn_rand[ nsquare ];
59 uint64_t w_lance_rand[ nsquare ];
60 uint64_t w_knight_rand[ nsquare ];
61 uint64_t w_silver_rand[ nsquare ];
62 uint64_t w_gold_rand[ nsquare ];
63 uint64_t w_bishop_rand[ nsquare ];
64 uint64_t w_rook_rand[ nsquare ];
65 uint64_t w_king_rand[ nsquare ];
66 uint64_t w_pro_pawn_rand[ nsquare ];
67 uint64_t w_pro_lance_rand[ nsquare ];
68 uint64_t w_pro_knight_rand[ nsquare ];
69 uint64_t w_pro_silver_rand[ nsquare ];
70 uint64_t w_horse_rand[ nsquare ];
71 uint64_t w_dragon_rand[ nsquare ];
72 uint64_t w_hand_pawn_rand[ npawn_max ];
73 uint64_t w_hand_lance_rand[ nlance_max ];
74 uint64_t w_hand_knight_rand[ nknight_max ];
75 uint64_t w_hand_silver_rand[ nsilver_max ];
76 uint64_t w_hand_gold_rand[ ngold_max ];
77 uint64_t w_hand_bishop_rand[ nbishop_max ];
78 uint64_t w_hand_rook_rand[ nrook_max ];
80 SHARE unsigned int game_status;
81 unsigned int move_evasion_pchk;
82 unsigned int node_per_second;
83 unsigned int node_next_signal;
84 unsigned int node_last_check;
85 unsigned int hash_mask;
86 unsigned int sec_elapsed;
87 unsigned int sec_b_total;
88 unsigned int sec_w_total;
89 unsigned int sec_limit;
90 unsigned int sec_limit_up;
91 unsigned int sec_limit_depth;
92 unsigned int time_last_result;
93 unsigned int time_last_check;
94 unsigned int time_start;
95 unsigned int time_turn_start;
96 unsigned int time_limit;
97 unsigned int time_max_limit;
98 unsigned int time_last_search;
99 unsigned int time_last_eff_search;
100 unsigned int time_response;
101 unsigned int ai_rook_attacks_r0[ nsquare ][ 128 ];
102 unsigned int ponder_move;
104 int benefit2promo[15];
113 SHARE int fmg_misc_king;
114 SHARE int fmg_cap_king;
115 unsigned int ponder_move_list[ MAX_LEGAL_MOVES ];
117 SHARE int root_abort;
128 int log2_ntrans_table;
131 int last_root_value_save;
142 int resign_threshold;
144 short pc_on_sq[nsquare][pos_n];
145 short kkp[nsquare][nsquare][kkp_end];
146 unsigned char book_section[ MAX_SIZE_SECTION+1 ];
147 unsigned char adirec[ nsquare ][ nsquare ];
148 unsigned char is_same[ 16 ][ 16 ];
149 char str_cmdline[ SIZE_CMDLINE ];
150 char str_message[ SIZE_MESSAGE ];
151 char str_buffer_cmdline[ SIZE_CMDBUFFER ];
152 const char *str_error;
158 pv_t mpv_pv[ MPV_MAX_PV*2 + 1 ];
162 # if !defined(_WIN32)
163 pthread_attr_t pthread_attr;
166 tree_t tlp_atree_work[ TLP_NUM_WORK ];
167 tree_t * volatile tlp_ptrees[ TLP_MAX_THREADS ];
168 volatile int tlp_abort;
169 volatile int tlp_idle;
170 volatile int tlp_num;
175 volatile unsigned short tlp_rejections_slot[ REJEC_MASK+1 ];
180 #if ! defined(_WIN32)
184 #if ! defined(NO_LOGGING)
186 const char *str_dir_logs = "log";
189 #if defined(CSA_LAN) || defined(MNJ_LAN)
190 unsigned int time_last_send;
198 char client_str_addr[256];
199 char client_str_id[256];
200 char client_str_pwd[256];
205 short mnj_tbl[ MNJ_MASK + 1 ];
208 unsigned int mnj_move_last;
211 #if defined(DEKUNOBOU)
212 SOCKET dek_socket_in;
215 unsigned int dek_ngame;
216 unsigned int dek_lost;
217 unsigned int dek_win;
222 check_table_t b_chk_tbl[nsquare];
223 check_table_t w_chk_tbl[nsquare];
225 #if defined(_MSC_VER)
226 #elif defined(__GNUC__) && ( defined(__i386__) || defined(__x86_64__) )
228 unsigned char aifirst_one[512];
229 unsigned char ailast_one[512];
233 # if ! defined(CSASHOGI)
234 const char *str_myname = ( "Bonanza " BNZ_VER );
236 const char *str_myname = ( "Bonanza " BNZ_VER );
239 const char *str_myname = ( "Bonanza " BNZ_VER " Debug Build ("
240 __TIME__ " " __DATE__ ")" );
243 #if defined(DBG_EASY)
244 unsigned int easy_move;
247 const char *str_resign = "%TORYO";
248 const char *str_repetition = "%SENNICHITE";
249 const char *str_jishogi = "%JISHOGI";
250 const char *str_record_error = "%ERROR";
251 const char *str_delimiters = " \t,";
252 const char *str_fmt_line = "Line %u: %s";
253 const char *str_on = "on";
254 const char *str_off = "off";
255 const char *str_book = "book.bin";
256 const char *str_hash = "hash.bin";
257 const char *str_fv = "fv.bin";
258 const char *str_book_error = "invalid opening book";
259 const char *str_io_error = "I/O error";
260 const char *str_perpet_check = "perpetual check";
261 const char *str_bad_cmdline = "invalid command line";
262 const char *str_busy_think = "I'm busy in thinking now";
263 const char *str_bad_record = "invalid record of game";
264 const char *str_bad_board = "invalid board representation";
265 const char *str_illegal_move = "illegal move";
266 const char *str_double_pawn = "double pawn";
267 const char *str_mate_drppawn = "mated by a droped pawn";
268 const char *str_unexpect_eof = "unexpected end of file";
269 const char *str_king_hang = "The king is hang.";
270 const char *str_game_ended = "move after a game was concluded";
271 const char *str_fopen_error = "Can't open a file";
272 const char *str_ovrflw_line = "Too many characters in a line.";
273 const char *str_warning = "WARNING: ";
275 const char *str_server_err = "received invalid message from the server";
278 const char *astr_table_piece[16] = { "* ", "FU", "KY", "KE", "GI", "KI",
279 "KA", "HI", "OU", "TO", "NY", "NK",
280 "NG", "##", "UM", "RY" };
282 const char ach_turn[2] = { '+', '-' };
284 const char ashell_h[ SHELL_H_LEN ] = { 1, 3, 7, 15, 31, 63, 127 };
286 const short aipos[31] = { e_dragon, e_horse, 0, e_gold,
287 e_gold, e_gold, e_gold, 0,
288 e_rook, e_bishop, e_gold, e_silver,
289 e_knight, e_lance, e_pawn, 0,
290 f_pawn, f_lance, f_knight,
291 f_silver, f_gold, f_bishop, f_rook,
292 0, f_gold, f_gold, f_gold,
293 f_gold, 0, f_horse, f_dragon };
295 const unsigned char aifile[ nsquare ]= {
296 file1, file2, file3, file4, file5, file6, file7, file8, file9,
297 file1, file2, file3, file4, file5, file6, file7, file8, file9,
298 file1, file2, file3, file4, file5, file6, file7, file8, file9,
299 file1, file2, file3, file4, file5, file6, file7, file8, file9,
300 file1, file2, file3, file4, file5, file6, file7, file8, file9,
301 file1, file2, file3, file4, file5, file6, file7, file8, file9,
302 file1, file2, file3, file4, file5, file6, file7, file8, file9,
303 file1, file2, file3, file4, file5, file6, file7, file8, file9,
304 file1, file2, file3, file4, file5, file6, file7, file8, file9 };
306 const unsigned char airank[ nsquare ]= {
307 rank1, rank1, rank1, rank1, rank1, rank1, rank1, rank1, rank1,
308 rank2, rank2, rank2, rank2, rank2, rank2, rank2, rank2, rank2,
309 rank3, rank3, rank3, rank3, rank3, rank3, rank3, rank3, rank3,
310 rank4, rank4, rank4, rank4, rank4, rank4, rank4, rank4, rank4,
311 rank5, rank5, rank5, rank5, rank5, rank5, rank5, rank5, rank5,
312 rank6, rank6, rank6, rank6, rank6, rank6, rank6, rank6, rank6,
313 rank7, rank7, rank7, rank7, rank7, rank7, rank7, rank7, rank7,
314 rank8, rank8, rank8, rank8, rank8, rank8, rank8, rank8, rank8,
315 rank9, rank9, rank9, rank9, rank9, rank9, rank9, rank9, rank9 };
317 const min_posi_t min_posi_no_handicap = {
319 { -lance, -knight, -silver, -gold, -king, -gold, -silver, -knight, -lance,
320 empty, -rook, empty, empty, empty, empty, empty, -bishop, empty,
321 -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn, -pawn,
322 empty, empty, empty, empty, empty, empty, empty, empty, empty,
323 empty, empty, empty, empty, empty, empty, empty, empty, empty,
324 empty, empty, empty, empty, empty, empty, empty, empty, empty,
325 pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn, pawn,
326 empty, bishop, empty, empty, empty, empty, empty, rook, empty,
327 lance, knight, silver, gold, king, gold, silver, knight, lance } };