mirror of
https://github.com/holub/mame
synced 2025-06-02 02:49:44 +03:00
fixed MT #05131
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:
parent
e5a3a3e4a3
commit
b1bbce2a7b
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user