some audio problems fixed, missing files added
[picodrive.git] / platform / linux / blit.c
CommitLineData
cc68a136 1
2// Convert 0000bbb0 ggg0rrr0 0000bbb0 ggg0rrr0
3// to 00000000 rrr00000 ggg00000 bbb00000 ...
4
5void vidConvCpyRGB32 (void *to, void *from, int pixels)
6{
7 unsigned short *ps = from;
8 unsigned int *pd = to;
9
10 for (; pixels; pixels--, ps++, pd++)
11 {
12 *pd = ((*ps<<20)&0xe00000) | ((*ps<<8)&0xe000) | ((*ps>>4)&0xe0);
13 *pd |= *pd >> 3;
14 }
15}
16
17void vidConvCpyRGB32sh(void *to, void *from, int pixels)
18{
19 unsigned short *ps = from;
20 unsigned int *pd = to;
21
22 for (; pixels; pixels--, ps++, pd++)
23 {
24 *pd = ((*ps<<20)&0xe00000) | ((*ps<<8)&0xe000) | ((*ps>>4)&0xe0);
25 *pd >>= 1;
26 *pd |= *pd >> 3;
27 }
28}
29
30void vidConvCpyRGB32hi(void *to, void *from, int pixels)
31{
32 unsigned short *ps = from;
33 unsigned int *pd = to;
34
35 for (; pixels; pixels--, ps++, pd++)
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
48void vidCpyM2_40col(void *dest, void *src)
49{
50 unsigned char *pd = dest, *ps = src;
51 int i, u;
52
53 for (i = 0; i < 224; i++)
54 {
55 ps += 8;
56 for (u = 0; u < 320; u++)
57 *pd++ = *ps++;
58 }
59}
60
61void vidCpyM2_32col(void *dest, void *src)
62{
63 unsigned char *pd = dest, *ps = src;
64 int i, u;
65
66 for (i = 0; i < 224; i++)
67 {
68 ps += 8;
69 pd += 32;
70 for (u = 0; u < 256; u++)
71 *pd++ = *ps++;
72 ps += 64;
73 pd += 32;
74 }
75}
76
77void vidCpyM2_32col_nobord(void *dest, void *src)
78{
79 vidCpyM2_32col(dest, src);
80}
81