Subversion Repositories Games.Chess Giants

Rev

Rev 108 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
154 pmbaty 1
#pragma once
33 pmbaty 2
extern int scale;
3
extern char version[8];
4
extern int presult;
5
extern PLAYING_MODE mode;
6
extern int batch_mode;
7
extern int swindle_mode;
8
extern int call_flag;
9
extern int crafty_rating;
10
extern int opponent_rating;
11
extern int time_used;
12
extern int time_used_opponent;
13
extern uint64_t total_moves;
14
extern int allow_cores;
15
extern int allow_memory;
16
extern int initialized;
17
extern int early_exit;
18
extern char *AK_list[128];
19
extern char *GM_list[128];
20
extern char *IM_list[128];
21
extern char *B_list[128];
22
extern char *SP_list[128];
23
extern char *SP_opening_filename[128];
24
extern char *SP_personality_filename[128];
25
extern FILE *input_stream;
26
extern FILE *book_file;
27
extern FILE *books_file;
28
extern FILE *normal_bs_file;
29
extern FILE *computer_bs_file;
30
extern FILE *history_file;
31
extern FILE *log_file;
32
extern int log_id;
33
extern int output_format;
154 pmbaty 34
#if defined(SYZYGY)
33 pmbaty 35
extern int EGTBlimit;
108 pmbaty 36
extern int EGTB_use;
33 pmbaty 37
extern int EGTB_draw;
108 pmbaty 38
extern int EGTB_depth;
33 pmbaty 39
extern int EGTB_setup;
154 pmbaty 40
#endif
33 pmbaty 41
extern int last_mate_score;
42
extern int last_opponent_move;
43
extern int check_depth;
44
extern int null_depth;
108 pmbaty 45
extern int null_divisor;
46
extern int LMR_rdepth;
47
extern int LMR_min;
48
extern int LMR_max;
49
extern double LMR_db;
50
extern double LMR_mb;
51
extern double LMR_s;
52
extern uint8_t LMR[32][64];
53
extern int rep_index;
33 pmbaty 54
extern int pgn_suggested_percent;
55
extern char pgn_event[128];
56
extern char pgn_date[128];
57
extern char pgn_round[128];
58
extern char pgn_site[128];
59
extern char pgn_white[128];
60
extern char pgn_white_elo[128];
61
extern char pgn_black[128];
62
extern char pgn_black_elo[128];
63
extern char pgn_result[128];
64
extern char log_filename[256];
65
extern char history_filename[256];
66
extern int number_of_solutions;
67
extern int solutions[10];
68
extern int solution_type;
69
extern int abs_draw_score;
70
extern int accept_draws;
71
extern int offer_draws;
108 pmbaty 72
extern int dynamic_draw_score;
33 pmbaty 73
extern int adaptive_hash;
74
extern size_t adaptive_hash_min;
75
extern size_t adaptive_hash_max;
76
extern size_t adaptive_hashp_min;
77
extern size_t adaptive_hashp_max;
78
extern int over;
79
extern int xboard;
108 pmbaty 80
extern int xboard_done;
33 pmbaty 81
extern int pong;
82
extern char book_path[128];
83
extern char log_path[128];
84
extern char tb_path[128];
85
extern char rc_path[128];
86
extern char cmd_buffer[4096];
87
extern char *args[512];
88
extern char buffer[4096];
89
extern int line_length;
90
extern unsigned char convert_buff[8];
91
extern int nargs;
92
extern int kibitz;
93
extern int game_wtm;
94
extern int last_search_value;
154 pmbaty 95
extern int FP_margin[16];
96
extern int FP_depth;
97
extern int LMP[16];
98
extern int LMP_depth;
99
extern int LMP_base;
100
extern double LMP_scale;
101
extern double LMP_scale;
33 pmbaty 102
extern int failhi_delta, faillo_delta;
103
extern int ponder_value;
104
extern int move_actually_played;
105
extern int analyze_mode;
106
extern int annotate_mode;
107
extern int input_status;        /* 0=no input;
108
                                   1=predicted move read;
109
                                   2=unpredicted move read;
110
                                   3=something read, not executed. */
111
extern int resign;
112
extern int resign_counter;
113
extern int resign_count;
114
extern int draw_counter;
115
extern int draw_count;
116
extern int draw_offer_pending;
117
extern int draw_offered;
118
extern char audible_alarm;
119
extern char speech;
108 pmbaty 120
extern char ponder_text[512];
33 pmbaty 121
extern char book_hint[512];
122
extern int post;
123
extern int search_depth;
108 pmbaty 124
extern uint64_t search_nodes;
125
extern uint64_t temp_search_nodes;
33 pmbaty 126
extern int search_move;
127
extern int ponder;
128
extern int ponder_move;
129
extern int force;
108 pmbaty 130
extern unsigned ponder_moves[256];
33 pmbaty 131
extern int num_ponder_moves;
132
extern char initial_position[80];
133
extern int predicted;
134
extern int trace_level;
135
extern int book_move;
136
extern int book_accept_mask;
137
extern int book_reject_mask;
138
extern int book_random;
139
extern float book_weight_freq;
140
extern float book_weight_eval;
141
extern float book_weight_learn;
142
extern int book_search_trigger;
143
extern int book_selection_width;
144
extern int show_book;
145
extern int learn;
146
extern int learning;
147
extern int learn_value;
148
extern int abort_search;
108 pmbaty 149
extern int iteration;
33 pmbaty 150
extern int root_wtm;
151
extern int last_root_value;
152
extern ROOT_MOVE root_moves[256];
153
extern int n_root_moves;
154
extern int difficulty;
155
extern int time_limit;
156
extern int absolute_time_limit;
157
extern int search_time_limit;
158
extern int burp;
159
extern int quit;
108 pmbaty 160
extern unsigned opponent_start_time, opponent_end_time;
161
extern unsigned program_start_time, program_end_time;
162
extern unsigned start_time, end_time;
33 pmbaty 163
extern TREE *block[MAX_BLOCKS + 1];
164
extern THREAD thread[CPUS];
154 pmbaty 165
#if (CPUS > 1)
108 pmbaty 166
extern lock_t lock_smp, lock_io;
154 pmbaty 167
#  if defined(UNIX)
33 pmbaty 168
extern pthread_attr_t attributes;
169
#  endif
154 pmbaty 170
#endif
171
extern unsigned int hardware_processors;
108 pmbaty 172
extern unsigned int smp_max_threads;
173
extern unsigned int smp_split_group;
174
extern unsigned int smp_split_at_root;
175
extern unsigned int smp_min_split_depth;
176
extern unsigned int smp_gratuitous_depth;
177
extern unsigned int smp_gratuitous_limit;
154 pmbaty 178
extern int smp_nice;
108 pmbaty 179
extern int smp_affinity;
154 pmbaty 180
extern int smp_affinity_increment;
108 pmbaty 181
extern int smp_numa;
182
extern int autotune_params;
183
extern struct autotune tune[16];
184
extern unsigned smp_split_nodes;
185
extern unsigned parallel_splits;
186
extern unsigned parallel_splits_wasted;
187
extern unsigned parallel_aborts;
188
extern unsigned parallel_joins;
189
extern unsigned busy_percent;
190
extern uint64_t game_max_blocks;
33 pmbaty 191
extern volatile int smp_split;
192
extern volatile int smp_threads;
193
extern volatile int initialized_threads;
194
extern int crafty_is_white;
108 pmbaty 195
extern unsigned nodes_between_time_checks;
196
extern unsigned nodes_per_second;
33 pmbaty 197
extern int next_time_check;
198
extern int transposition_age;
199
extern int thinking;
200
extern int pondering;
201
extern int puzzling;
202
extern int booking;
203
extern int display_options;
108 pmbaty 204
extern unsigned noise_level;
33 pmbaty 205
extern int noise_block;
206
extern int tc_moves;
207
extern int tc_time;
208
extern int tc_time_remaining[2];
209
extern int tc_moves_remaining[2];
210
extern int tc_secondary_moves;
211
extern int tc_secondary_time;
212
extern int tc_increment;
213
extern int tc_sudden_death;
214
extern int tc_safety_margin;
215
extern int draw_score[2];
216
extern char kibitz_text[4096];
217
extern int kibitz_depth;
218
extern int move_number;
219
extern int moves_out_of_book;
220
extern int first_nonbook_factor;
221
extern int first_nonbook_span;
154 pmbaty 222
#if defined(SKILL)
33 pmbaty 223
extern int skill;
154 pmbaty 224
#endif
33 pmbaty 225
extern int book_learn_eval[LEARN_INTERVAL];
226
extern int book_learn_depth[LEARN_INTERVAL];
227
extern int learn_seekto[64];
228
extern uint64_t learn_key[64];
229
extern int learn_nmoves[64];
230
extern uint64_t book_learn_key;
231
extern int learn_positions_count;
232
extern int book_learn_nmoves;
233
extern int book_learn_seekto;
234
extern int usage_level;
235
extern size_t hash_table_size;
236
extern size_t hash_path_size;
108 pmbaty 237
extern uint64_t hash_mask;
238
extern uint64_t mask_clear_entry;
33 pmbaty 239
extern uint64_t hash_path_mask;
240
extern size_t pawn_hash_table_size;
241
extern uint64_t pawn_hash_mask;
108 pmbaty 242
extern HASH_ENTRY *hash_table;
33 pmbaty 243
extern HPATH_ENTRY *hash_path;
244
extern PAWN_HASH_ENTRY *pawn_hash_table;
245
extern void *segments[MAX_BLOCKS + 32][2];
246
extern int nsegments;
247
extern const int pcval[7];
248
extern const int p_vals[7];
108 pmbaty 249
extern const int MVV_LVA[7][7];
33 pmbaty 250
extern const int pieces[2][7];
108 pmbaty 251
extern const int lower_n;
252
extern const int lower_b;
253
extern const int mobility_score_n[4];
254
extern const int mobility_score_b[4];
255
extern const int mobility_score_r[4];
256
extern const int mob_curve_r[48];
33 pmbaty 257
extern PATH last_pv;
258
extern int last_value;
259
extern const char translate[13];
260
extern const char empty_sqs[9];
261
extern const int mate[64];
108 pmbaty 262
extern const uint64_t magic_rook[64];
263
extern const uint64_t magic_rook_mask[64];
264
extern const unsigned magic_rook_shift[64];
265
extern const uint64_t mobility_mask_b[4];
266
extern const uint64_t mobility_mask_r[4];
267
extern int16_t *magic_bishop_mobility_indices[64];
268
extern int16_t magic_bishop_mobility_table[5248];
33 pmbaty 269
extern uint64_t *magic_rook_indices[64];
270
extern uint64_t magic_rook_table[102400];
271
extern int16_t *magic_rook_mobility_indices[64];
272
extern int16_t magic_rook_mobility_table[102400];
108 pmbaty 273
extern const uint64_t magic_bishop[64];
274
extern const uint64_t magic_bishop_mask[64];
275
extern const unsigned magic_bishop_shift[64];
33 pmbaty 276
extern uint64_t *magic_bishop_indices[64];
277
extern uint64_t magic_bishop_table[5248];
278
extern int16_t *magic_bishop_mobility_indices[64];
279
extern int16_t magic_bishop_mobility_table[5248];
280
extern int8_t directions[64][64];
281
extern uint64_t pawn_attacks[2][64];
282
extern uint64_t knight_attacks[64];
283
extern uint64_t rook_attacks[64];
284
extern uint64_t bishop_attacks[64];
285
extern POSITION display;
286
extern uint64_t king_attacks[64];
287
extern uint64_t intervening[64][64];
108 pmbaty 288
extern int history[1024];
289
extern const uint64_t randoms[2][7][64];
290
extern const uint64_t castle_random[2][2];
291
extern const uint64_t enpassant_random[65];
33 pmbaty 292
extern uint64_t clear_mask[65];
293
extern uint64_t set_mask[65];
294
extern uint64_t file_mask[8];
295
extern uint64_t rank_mask[8];
108 pmbaty 296
extern const uint64_t OO[2];
297
extern const uint64_t OOO[2];
298
extern const uint64_t mask_efgh, mask_fgh, mask_abc, mask_abcd;
299
extern const uint64_t mask_advance_2_w;
300
extern const uint64_t mask_advance_2_b;
301
extern const uint64_t mask_left_edge;
302
extern const uint64_t mask_right_edge;
303
extern const uint64_t mask_not_edge;
304
extern const uint64_t mask_rook_files;
305
extern const uint64_t dark_squares;
306
extern const uint64_t not_rook_pawns;
307
extern const uint64_t not_rook_files;
33 pmbaty 308
extern uint64_t plus1dir[65];
309
extern uint64_t plus7dir[65];
310
extern uint64_t plus8dir[65];
311
extern uint64_t plus9dir[65];
312
extern uint64_t minus1dir[65];
313
extern uint64_t minus7dir[65];
314
extern uint64_t minus8dir[65];
315
extern uint64_t minus9dir[65];
316
extern uint64_t mask_eptest[64];
154 pmbaty 317
#if !defined(INLINEASM)
33 pmbaty 318
extern unsigned char msb[65536];
319
extern unsigned char lsb[65536];
154 pmbaty 320
#endif
33 pmbaty 321
extern unsigned char msb_8bit[256];
322
extern unsigned char lsb_8bit[256];
323
extern unsigned char pop_cnt_8bit[256];
108 pmbaty 324
extern uint64_t mask_pawn_connected[2][64];
33 pmbaty 325
extern uint64_t mask_pawn_isolated[64];
326
extern uint64_t mask_passed[2][64];
108 pmbaty 327
extern uint64_t mask_pattacks[2][64];
33 pmbaty 328
extern uint64_t pawn_race[2][2][64];
329
extern BOOK_POSITION book_buffer[BOOK_CLUSTER_SIZE];
330
extern BOOK_POSITION book_buffer_char[BOOK_CLUSTER_SIZE];
331
extern const int rankflip[2][8];
332
extern const int sqflip[2][64];
108 pmbaty 333
extern const int rank1[2];
334
extern const int rank2[2];
335
extern const int rank3[2];
336
extern const int rank4[2];
337
extern const int rank5[2];
338
extern const int rank6[2];
339
extern const int rank7[2];
340
extern const int rank8[2];
341
extern const int epdir[2];
342
extern const int csq[2];
343
extern const int dsq[2];
344
extern const int esq[2];
345
extern const int fsq[2];
346
extern const int gsq[2];
33 pmbaty 347
extern const int sign[2];
108 pmbaty 348
extern const char square_color[64];
349
extern uint64_t distance_ring[64][8];
350
extern const int OOsqs[2][3];
351
extern const int OOOsqs[2][3];
352
extern const int OOfrom[2];
353
extern const int OOto[2];
354
extern const int OOOto[2];
355
extern const int epsq[2];
356
extern const int rook_A[2];
357
extern const int rook_D[2];
358
extern const int rook_F[2];
359
extern const int rook_G[2];
360
extern const int rook_H[2];
361
extern const int capleft[2];
362
extern const int capright[2];
363
extern const int pawnadv1[2];
364
extern const int pawnadv2[2];
365
extern int piece_values[2][7];
33 pmbaty 366
extern struct personality_term personality_packet[256];