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