From fa5c9bb8ab140af80c50ad6b5233110d59a06c4d Mon Sep 17 00:00:00 2001 From: Bruno Raoult Date: Thu, 22 Feb 2024 09:29:10 +0100 Subject: [PATCH] bitboard8_sprint -> bitboard_rank_sprint (temp, need BB+rank as input) --- src/bitboard.h | 2 +- src/chessdefs.h | 2 ++ src/move.h | 17 ++++++++--------- src/position.h | 2 +- test/fen-test.c | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/bitboard.h b/src/bitboard.h index f99c8b2..f8b36f1 100644 --- a/src/bitboard.h +++ b/src/bitboard.h @@ -101,6 +101,6 @@ extern bitboard_t bb_king_moves(bitboard_t occ, square_t sq); extern void bitboard_print(const char *title, const bitboard_t bitboard); extern void bitboard_print_multi(const char *title, const int n, ...); -extern char *bitboard8_sprint(char *str, const uchar bb8); +extern char *bitboard_rank_sprint(char *str, const uchar bb8); #endif /* _BITBOARD_H */ diff --git a/src/chessdefs.h b/src/chessdefs.h index 85bc150..89bdbae 100644 --- a/src/chessdefs.h +++ b/src/chessdefs.h @@ -47,6 +47,8 @@ typedef enum { #define MIDDLEGAME 1 #define ENDGAME 2 +/* forward defs */ +typedef struct _pos_s pos_t; /* bitboard */ //typedef u64 bitboard_t; diff --git a/src/move.h b/src/move.h index 9647109..70bedec 100644 --- a/src/move.h +++ b/src/move.h @@ -34,7 +34,6 @@ */ #define move_t u32 -#define M_ /* move flags */ #define M_FLAGS_BEG 18 #define M_HAS_FLAGS mask(_M_FLAGS_BEG + 0) /* probably unused */ @@ -88,16 +87,16 @@ typedef struct { int pseudo_moves_castle(pos_t *pos, bool color, bool doit, bool do_king); //int pseudo_moves_gen(pos_t *pos, piece_list_t *piece, bool doit, bool do_king); //int pseudo_moves_pawn(pos_t *pos, piece_list_t *piece, bool doit); -int moves_gen(pos_t *pos, bool color, bool doit, bool do_king); -int moves_gen_king_moves(pos_t *pos, bool color, bool doit); +//extern int moves_gen(pos_t *pos, bool color, bool doit, bool do_king); +//extern int moves_gen_king_moves(pos_t *pos, bool color, bool doit); -void moves_sort(pos_t *pos); -void moves_gen_eval_sort(pos_t *pos); +//extern void moves_sort(pos_t *pos); +//extern void moves_gen_eval_sort(pos_t *pos); -void moves_gen_all(pos_t *pos); -void moves_gen_all_nomoves(pos_t *pos); +//extern void moves_gen_all(pos_t *pos); +//extern void moves_gen_all_nomoves(pos_t *pos); -pos_t *move_do(pos_t *pos, move_t *move); -void move_undo(pos_t *pos, move_t *move); +//extern pos_t *move_do(pos_t *pos, move_t *move); +//extern void move_undo(pos_t *pos, move_t *move); #endif /* MOVE_H */ diff --git a/src/position.h b/src/position.h index c229b2b..efc4338 100644 --- a/src/position.h +++ b/src/position.h @@ -24,7 +24,7 @@ #include "piece.h" #include "move.h" -typedef struct { +typedef struct _pos_s { u64 node_count; /* evaluated nodes */ int turn; /* WHITE or BLACK */ u16 clock_50; diff --git a/test/fen-test.c b/test/fen-test.c index e1bd182..d4b1660 100644 --- a/test/fen-test.c +++ b/test/fen-test.c @@ -1,6 +1,7 @@ #include "debug.h" #include "pool.h" +#include "../src/chessdefs.h" #include "../src/bitboard.h" #include "../src/position.h" #include "../src/fen.h"