- if (probe_kpk(wksq, wpsq, bksq, stm))
- return SCALE_FACTOR_NONE;
- else
- return ScaleFactor(0);
-}
-
-
-/// init_bitbases() is called during program initialization, and simply loads
-/// bitbases from disk into memory. At the moment, there is only the bitbase
-/// for KP vs K, but we may decide to add other bitbases later.
-
-void init_bitbases() {
- generate_kpk_bitbase(KPKBitbase);
-}
-
-
-namespace {
-
- // Probe the KP vs K bitbase:
-
- int probe_kpk(Square wksq, Square wpsq, Square bksq, Color stm) {
-
- int wp = int(square_file(wpsq)) + (int(square_rank(wpsq)) - 1) * 4;
- int index = int(stm) + 2*int(bksq) + 128*int(wksq) + 8192*wp;
-
- assert(index >= 0 && index < 24576*8);
- return KPKBitbase[index/8] & (1 << (index&7));
- }
+ return probe_kpk_bitbase(wksq, wpsq, bksq, stm) ? SCALE_FACTOR_NONE : SCALE_FACTOR_ZERO;