On Wed, 10 Sep 2003 09:14:35 +0530, Nitin Mahajan wrote:
>HI!  
> 
>I have written the following BIt BLT function for the Little endian byte sex.
>But same is not working for theBig endian after doing some changes.Iam using
>C&T 69030 card.
> 
>Can any one please tell how to convert it so that the same function works for
>both little and big endian.
>The commented statements were for Little endian.
 
The commented statements have exactly the same effect as the statements they 
replace.  All you've done is replace shifts with multiplications and divisions.  
Endianness does not matter in arithmetic.

The tricky part will be in moveDWORDS.  If the image in memory has a different 
endianness from the frame buffer, you will have to swap every DWORD as you 
write it.  You can't just do this:
   *puiDest = *puiSrc;
You have to swap the bytes, something like this:
   tmp = *puiSrc;
   *puiDest = (tmp & 0xff) << 24 |
              ((tmp & 0xff00) << 8) | 
              ((tmp & 0xff0000) >> 8) |
              ((tmp & 0xff000000) >> 24); 

Some graphcs chips have both a little-endian and big-endian view of their frame 
buffers.  You might check the C&T 69030 docs to see if it does.

--
- Tim Roberts, [EMAIL PROTECTED]
  Providenza & Boekelheide, Inc.


_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel

Reply via email to