diff --git a/src/eval-defs.c b/src/eval-defs.c index f93e2d4..b47992f 100644 --- a/src/eval-defs.c +++ b/src/eval-defs.c @@ -80,16 +80,6 @@ void param_set(int num, eval_t val) * A1 .... H1 * } */ -/** - * pst_defs - pre-defined piece-square tables. - */ -enum { - PST_ROFCHADE, - PST_CPW, - PST_SJENG, - PST_NB -}; - static const struct pst { char *name; /* one word only, no spaces */ int val[PIECE_TYPE_NB][PHASE_NB][SQUARE_NB]; /* MG then EG */ @@ -536,7 +526,7 @@ static const struct pst { }, /* sjeng end */ }; -int pst_current = 0; +int pst_current = PST_DEFAULT; eval_t pst_mg[COLOR_NB][PT_NB][SQUARE_NB]; eval_t pst_eg[COLOR_NB][PT_NB][SQUARE_NB]; @@ -578,3 +568,10 @@ void pst_init(int set) } } } + +char *pst_name(int i) +{ + if (i >= 0 && i < PST_NB) + return pst_defs[i].name; + return "undef"; +} diff --git a/src/eval-defs.h b/src/eval-defs.h index 9194187..d2c4977 100644 --- a/src/eval-defs.h +++ b/src/eval-defs.h @@ -83,7 +83,17 @@ extern eval_t parameters[EV_PARAMS_NB]; void param_set (int num, eval_t val); /* PST data */ -#define PST_DEFAULT "cpw" +/** + * pst_defs - pre-defined piece-square tables. + */ +enum { + PST_ROFCHADE, + PST_CPW, + PST_SJENG, + PST_NB +}; + +#define PST_DEFAULT PST_CPW extern int pst_current; extern eval_t pst_mg[COLOR_NB][PT_NB][SQUARE_NB]; extern eval_t pst_eg[COLOR_NB][PT_NB][SQUARE_NB]; diff --git a/src/init.c b/src/init.c index 9683680..cc49abe 100644 --- a/src/init.c +++ b/src/init.c @@ -68,9 +68,7 @@ void init_all(void) /* eval tables */ printf("pst tables... "); - int pst; - bug_on_always((pst = pst_find(PST_DEFAULT)) < 0); - pst_init(pst); + pst_init(PST_DEFAULT); printf("done.\n"); } diff --git a/src/uci.c b/src/uci.c index c72fe63..13a0087 100644 --- a/src/uci.c +++ b/src/uci.c @@ -27,6 +27,7 @@ #include "move-gen.h" #include "move-do.h" #include "search.h" +#include "eval-defs.h" struct command { char *name; /* command name */ @@ -224,8 +225,16 @@ int do_uci(__unused pos_t *pos, __unused char *arg) { printf("id name brchess " VERSION "\n"); printf("id author Bruno Raoult\n"); - printf("option option name Hash type spin default %d min %d max %d\n", + printf("option name Hash type spin default %d min %d max %d\n", hash_tt.mb, HASH_SIZE_MIN, HASH_SIZE_MAX); + + if (PST_NB > 1) { + printf("option name pst type combo default %s", + pst_name(pst_current)); + for (int i = 0; i < PST_NB; ++i) + printf(" var %s", pst_name(i)); + } + printf("\n"); printf("uciok\n"); return 1; }