Changeset 31282f9 in mainline for genarch


Ignore:
Timestamp:
2006-05-07T15:54:38Z (20 years ago)
Author:
Jakub Vana <jakub.vana@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
381465e
Parents:
2bb8648
Message:

FB endian fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • genarch/src/fb/fb.c

    r2bb8648 r31282f9  
    8686        unsigned int startbyte = POINTPOS(x, y);
    8787
     88#ifdef BIG_ENDIAN
    8889        fbaddress[startbyte] = RED(color, 8);
    8990        fbaddress[startbyte + 1] = GREEN(color, 8);
    9091        fbaddress[startbyte + 2] = BLUE(color, 8);
     92#else
     93        fbaddress[startbyte + 2] = RED(color, 8);
     94        fbaddress[startbyte + 1] = GREEN(color, 8);
     95        fbaddress[startbyte + 0] = BLUE(color, 8);
     96#endif 
    9197}
    9298
     
    96102        unsigned int startbyte = POINTPOS(x, y);
    97103
     104#ifdef BIG_ENDIAN
    98105        return fbaddress[startbyte] << 16 | fbaddress[startbyte + 1] << 8 | fbaddress[startbyte + 2];
     106#else
     107        return fbaddress[startbyte + 2] << 16 | fbaddress[startbyte + 1] << 8 | fbaddress[startbyte + 0];
     108#endif 
    99109}
    100110
Note: See TracChangeset for help on using the changeset viewer.