input: support analog read
[picodrive.git] / platform / linux / blit.c
CommitLineData
cc68a136 1
2// Convert 0000bbb0 ggg0rrr0 0000bbb0 ggg0rrr0
3// to 00000000 rrr00000 ggg00000 bbb00000 ...
645ec129 4// TODO: rm when gp2x/emu.c is no longer used
cc68a136 5
19954be1 6void bgr444_to_rgb32(void *to, void *from)
cc68a136 7{
8 unsigned short *ps = from;
9 unsigned int *pd = to;
19954be1 10 int pixels;
cc68a136 11
19954be1 12 for (pixels = 0x40; pixels; pixels--, ps++, pd++)
cc68a136 13 {
14 *pd = ((*ps<<20)&0xe00000) | ((*ps<<8)&0xe000) | ((*ps>>4)&0xe0);
15 *pd |= *pd >> 3;
16 }
17}
18
19954be1 19void bgr444_to_rgb32_sh(void *to, void *from)
cc68a136 20{
21 unsigned short *ps = from;
22 unsigned int *pd = to;
19954be1 23 int pixels;
cc68a136 24
19954be1 25 pd += 0x40;
26 for (pixels = 0x40; pixels; pixels--, ps++, pd++)
cc68a136 27 {
28 *pd = ((*ps<<20)&0xe00000) | ((*ps<<8)&0xe000) | ((*ps>>4)&0xe0);
29 *pd >>= 1;
30 *pd |= *pd >> 3;
19954be1 31 pd[0x40*2] = *pd;
cc68a136 32 }
cc68a136 33
19954be1 34 ps -= 0x40;
35 for (pixels = 0x40; pixels; pixels--, ps++, pd++)
cc68a136 36 {
37 *pd = ((*ps<<20)&0xe00000) | ((*ps<<8)&0xe000) | ((*ps>>4)&0xe0);
38 continue;
39 *pd += 0x00404040;
40 if (*pd & 0x01000000) *pd |= 0x00e00000;
41 if (*pd & 0x00010000) *pd |= 0x0000e000;
42 if (*pd & 0x00000100) *pd |= 0x000000e0;
43 *pd &= 0x00e0e0e0;
44 *pd |= *pd >> 3;
45 }
46}
47
645ec129 48void vidcpy_m2(void *dest, void *src, int m32col, int with_32c_border)
cc68a136 49{
50 unsigned char *pd = dest, *ps = src;
51 int i, u;
52
645ec129 53 if (m32col) {
54 for (i = 0; i < 224; i++)
55 {
56 ps += 8;
57 pd += 32;
58 for (u = 0; u < 256; u++)
59 *pd++ = *ps++;
60 ps += 64;
61 pd += 32;
62 }
63 } else {
64 for (i = 0; i < 224; i++)
65 {
66 ps += 8;
67 for (u = 0; u < 320; u++)
68 *pd++ = *ps++;
69 }
cc68a136 70 }
71}
72
645ec129 73void vidcpy_m2_rot(void *dest, void *src, int m32col, int with_32c_border)
cc68a136 74{
cc68a136 75}
76
645ec129 77void rotated_blit8 (void *dst, void *linesx4, int y, int is_32col)
cc68a136 78{
cc68a136 79}
80
645ec129 81void rotated_blit16(void *dst, void *linesx4, int y, int is_32col)
82{
83}