someone with a better knowledge of these chess machine should probably check why these 16/32 bit machines use "invalid" mask while reading the board lines (maybe they use masks with size > 8bits?)
This commit is contained in:
Fabio Priuli 2013-05-24 06:12:42 +00:00
parent e5a3a3e4a3
commit b1bbce2a7b

View File

@ -102,15 +102,20 @@ data: 0 0000 0000 all fields occupied
if (data && Line18_REED)
{
i_18=get_first_cleared_bit(Line18_REED);
i_18 = get_first_cleared_bit(Line18_REED);
/* looking for a piece in this line and clear bit in data if found */
for ( i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
if (IsPiece(64-(i_18*8 + 8-i_AH)))
data &= ~(1 << i_AH); // clear bit
read_board_flag = TRUE;
if (i_18 == NOT_VALID)
printf("No cleared bit in mask Line18_REED!\n");
else
{
/* looking for a piece in this line and clear bit in data if found */
for (i_AH = 0; i_AH < 8; i_AH = i_AH + 1)
if (IsPiece(64 - (i_18 * 8 + 8 - i_AH)))
data &= ~(1 << i_AH); // clear bit
read_board_flag = TRUE;
}
}
return data;