[A89] Re: sprite
[Prev][Next][Index][Thread]
[A89] Re: sprite
At 00:43 2001-02-21, you wrote:
>If ~0xFFF creates four extra pixels at the beginning, then why doesn't it
>cover up those four
>pixels (erase them) when I AND the mask to the display? When the sprite
>reaches the left, it
>leaves the four pixels before the edge as they were, and doesn't erase them.
because ~0xFFF is equal to 0xF000 (~ means bitwise not), wich binary is
1111000000000000
if you 'and' something with this number, all bits will be set to 0 except
the 4 most significant bits.
When you do this in the screenbuffer, this is equal to erasing all the
pixels but the four to the left.
1101010010010011
and 1111000000000000
--------------------
= 1101000000000000
///Olle
References: