+ }
+ if (more_than_one(attackers)) {
+ // Disambiguate by file if possible.
+ Bitboard attackers_this_file = attackers & file_bb(file_of(from));
+ if (attackers != attackers_this_file) {
+ pretty += char('a' + file_of(from));
+ attackers = attackers_this_file;
+ }
+ if (more_than_one(attackers)) {
+ // Still ambiguous, so need to disambiguate by rank.
+ pretty += char('1' + rank_of(from));
+ }
+ }
+
+ if (type_of(move) == ENPASSANT || pos->piece_on(to) != NO_PIECE) {
+ pretty += "x";
+ }
+
+ pretty += UCI::square(to);
+ }
+
+ if (pos->gives_check(move)) {
+ // Check if mate.
+ StateInfo si;
+ pos->do_move(move, si, true);
+ if (MoveList<LEGAL>(*pos).size() > 0) {
+ pretty += "+";
+ } else {
+ pretty += "#";
+ }
+ pos->undo_move(move);
+ }
+
+ decoded->set_pretty(pretty);
+}
+
+void HashProbeImpl::ProbeMove(Position* pos, std::deque<StateInfo>* setup_states, bool invert, HashProbeLine* response) {
+ bool found;
+ TTEntry *entry = TT.probe(pos->key(), found);
+ response->set_found(found);
+ if (found) {
+ Value value = entry->value();
+ Value eval = entry->eval();
+ Bound bound = entry->bound();
+
+ if (invert) {
+ value = -value;
+ eval = -eval;
+ if (bound == BOUND_UPPER) {
+ bound = BOUND_LOWER;
+ } else if (bound == BOUND_LOWER) {
+ bound = BOUND_UPPER;
+ }
+ }