lcd.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * (C) Copyright 2003-2004
  3. * Stefan Roese, esd gmbh germany, stefan.roese@esd-electronics.com
  4. *
  5. * SPDX-License-Identifier: GPL-2.0+
  6. */
  7. /*
  8. * Neutralize little endians.
  9. */
  10. #define SWAP_LONG(data) ((unsigned long) \
  11. (((unsigned long)(data) >> 24) | \
  12. ((unsigned long)(data) << 24) | \
  13. (((unsigned long)(data) >> 8) & 0x0000ff00 ) | \
  14. (((unsigned long)(data) << 8) & 0x00ff0000 )))
  15. #define SWAP_SHORT(data) ((unsigned short) \
  16. (((unsigned short)(data) >> 8 ) | \
  17. ((unsigned short)(data) << 8 )))
  18. #define LOAD_LONG(data) SWAP_LONG(data)
  19. #define LOAD_SHORT(data) SWAP_SHORT(data)
  20. #define S1D_WRITE_PALETTE(p,i,r,g,b) \
  21. { \
  22. out_8(&((uchar*)(p))[palette_index], (uchar)(i)); \
  23. out_8(&((uchar*)(p))[palette_index], (uchar)(r)); \
  24. out_8(&((uchar*)(p))[palette_index], (uchar)(g)); \
  25. out_8(&((uchar*)(p))[palette_index], (uchar)(b)); \
  26. }
  27. typedef struct
  28. {
  29. ushort Index;
  30. uchar Value;
  31. } S1D_REGS;
  32. typedef struct /**** BMP file info structure ****/
  33. {
  34. unsigned int biSize; /* Size of info header */
  35. int biWidth; /* Width of image */
  36. int biHeight; /* Height of image */
  37. unsigned short biPlanes; /* Number of color planes */
  38. unsigned short biBitCount; /* Number of bits per pixel */
  39. unsigned int biCompression; /* Type of compression to use */
  40. unsigned int biSizeImage; /* Size of image data */
  41. int biXPelsPerMeter; /* X pixels per meter */
  42. int biYPelsPerMeter; /* Y pixels per meter */
  43. unsigned int biClrUsed; /* Number of colors used */
  44. unsigned int biClrImportant; /* Number of important colors */
  45. } BITMAPINFOHEADER;