From: "Markus F.X.J. Oberhumer"
Subject: SDL CVS patches below you will find some small patches against the current SDL CVS. It adresses these things: 1) Use "&" instead of "%" in some cases. For negative signed integers (x % 8) is not always (x & 7), and the compiler can produce slightly faster code when using "&" here. 2) Some const issues. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4092
This commit is contained in:
parent
b4001bd1ff
commit
6369aeaaa5
8 changed files with 53 additions and 49 deletions
|
@ -384,7 +384,7 @@ do { \
|
||||||
/* 8-times unrolled loop */
|
/* 8-times unrolled loop */
|
||||||
#define DUFFS_LOOP8(pixel_copy_increment, width) \
|
#define DUFFS_LOOP8(pixel_copy_increment, width) \
|
||||||
{ int n = (width+7)/8; \
|
{ int n = (width+7)/8; \
|
||||||
switch (width % 8) { \
|
switch (width & 7) { \
|
||||||
case 0: do { pixel_copy_increment; \
|
case 0: do { pixel_copy_increment; \
|
||||||
case 7: pixel_copy_increment; \
|
case 7: pixel_copy_increment; \
|
||||||
case 6: pixel_copy_increment; \
|
case 6: pixel_copy_increment; \
|
||||||
|
@ -400,7 +400,7 @@ do { \
|
||||||
/* 4-times unrolled loop */
|
/* 4-times unrolled loop */
|
||||||
#define DUFFS_LOOP4(pixel_copy_increment, width) \
|
#define DUFFS_LOOP4(pixel_copy_increment, width) \
|
||||||
{ int n = (width+3)/4; \
|
{ int n = (width+3)/4; \
|
||||||
switch (width % 4) { \
|
switch (width & 3) { \
|
||||||
case 0: do { pixel_copy_increment; \
|
case 0: do { pixel_copy_increment; \
|
||||||
case 3: pixel_copy_increment; \
|
case 3: pixel_copy_increment; \
|
||||||
case 2: pixel_copy_increment; \
|
case 2: pixel_copy_increment; \
|
||||||
|
|
|
@ -55,7 +55,7 @@ static void BlitBto1(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -72,7 +72,7 @@ static void BlitBto1(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -108,7 +108,7 @@ static void BlitBto2(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -142,7 +142,7 @@ static void BlitBto3(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -180,7 +180,7 @@ static void BlitBto4(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -214,7 +214,7 @@ static void BlitBto1Key(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -231,7 +231,7 @@ static void BlitBto1Key(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -266,7 +266,7 @@ static void BlitBto2Key(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -299,7 +299,7 @@ static void BlitBto3Key(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -333,7 +333,7 @@ static void BlitBto4Key(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -369,7 +369,7 @@ static void BlitBtoNAlpha(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
@ -416,7 +416,7 @@ static void BlitBtoNAlphaKey(SDL_BlitInfo *info)
|
||||||
while ( height-- ) {
|
while ( height-- ) {
|
||||||
Uint8 byte = 0, bit;
|
Uint8 byte = 0, bit;
|
||||||
for ( c=0; c<width; ++c ) {
|
for ( c=0; c<width; ++c ) {
|
||||||
if ( (c%8) == 0 ) {
|
if ( (c&7) == 0 ) {
|
||||||
byte = *src++;
|
byte = *src++;
|
||||||
}
|
}
|
||||||
bit = (byte&0x80)>>7;
|
bit = (byte&0x80)>>7;
|
||||||
|
|
|
@ -137,7 +137,7 @@ static void Blit1to2(SDL_BlitInfo *info)
|
||||||
dst += 4;
|
dst += 4;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
*(Uint16 *)dst = map[*src++];
|
*(Uint16 *)dst = map[*src++];
|
||||||
dst += 2;
|
dst += 2;
|
||||||
|
@ -169,7 +169,7 @@ static void Blit1to2(SDL_BlitInfo *info)
|
||||||
dst += 4;
|
dst += 4;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
*(Uint16 *)dst = map[*src++];
|
*(Uint16 *)dst = map[*src++];
|
||||||
dst += 2;
|
dst += 2;
|
||||||
|
@ -266,7 +266,7 @@ static void Blit1to4(SDL_BlitInfo *info)
|
||||||
*dst++ = map[*src++];
|
*dst++ = map[*src++];
|
||||||
*dst++ = map[*src++];
|
*dst++ = map[*src++];
|
||||||
}
|
}
|
||||||
switch ( width % 4 ) {
|
switch ( width & 3 ) {
|
||||||
case 3:
|
case 3:
|
||||||
*dst++ = map[*src++];
|
*dst++ = map[*src++];
|
||||||
case 2:
|
case 2:
|
||||||
|
|
|
@ -78,7 +78,8 @@ static void Blit_RGB888_index8(SDL_BlitInfo *info)
|
||||||
#endif
|
#endif
|
||||||
int width, height;
|
int width, height;
|
||||||
Uint32 *src;
|
Uint32 *src;
|
||||||
Uint8 *map, *dst;
|
const Uint8 *map;
|
||||||
|
Uint8 *dst;
|
||||||
int srcskip, dstskip;
|
int srcskip, dstskip;
|
||||||
|
|
||||||
/* Set up some basic variables */
|
/* Set up some basic variables */
|
||||||
|
@ -107,7 +108,7 @@ static void Blit_RGB888_index8(SDL_BlitInfo *info)
|
||||||
RGB888_RGB332(*dst++, *src);
|
RGB888_RGB332(*dst++, *src);
|
||||||
++src;
|
++src;
|
||||||
}
|
}
|
||||||
switch ( width % 4 ) {
|
switch ( width & 3 ) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB332(*dst++, *src);
|
RGB888_RGB332(*dst++, *src);
|
||||||
++src;
|
++src;
|
||||||
|
@ -148,7 +149,7 @@ static void Blit_RGB888_index8(SDL_BlitInfo *info)
|
||||||
*dst++ = map[pixel];
|
*dst++ = map[pixel];
|
||||||
++src;
|
++src;
|
||||||
}
|
}
|
||||||
switch ( width % 4 ) {
|
switch ( width & 3 ) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB332(pixel, *src);
|
RGB888_RGB332(pixel, *src);
|
||||||
*dst++ = map[pixel];
|
*dst++ = map[pixel];
|
||||||
|
@ -235,7 +236,7 @@ static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
|
||||||
dst += 2;
|
dst += 2;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB555(dst, src);
|
RGB888_RGB555(dst, src);
|
||||||
++src;
|
++src;
|
||||||
|
@ -266,7 +267,7 @@ static void Blit_RGB888_RGB555(SDL_BlitInfo *info)
|
||||||
dst += 2;
|
dst += 2;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB555(dst, src);
|
RGB888_RGB555(dst, src);
|
||||||
++src;
|
++src;
|
||||||
|
@ -355,7 +356,7 @@ static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
|
||||||
dst += 2;
|
dst += 2;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB565(dst, src);
|
RGB888_RGB565(dst, src);
|
||||||
++src;
|
++src;
|
||||||
|
@ -386,7 +387,7 @@ static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
|
||||||
dst += 2;
|
dst += 2;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB565(dst, src);
|
RGB888_RGB565(dst, src);
|
||||||
++src;
|
++src;
|
||||||
|
@ -418,7 +419,7 @@ static void Blit_RGB888_RGB565(SDL_BlitInfo *info)
|
||||||
#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
|
#else /* ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) */
|
||||||
#define RGB565_32(dst, src, map) (map[src[1]*2] + map[src[0]*2+1])
|
#define RGB565_32(dst, src, map) (map[src[1]*2] + map[src[0]*2+1])
|
||||||
#endif
|
#endif
|
||||||
static void Blit_RGB565_32(SDL_BlitInfo *info, Uint32 *map)
|
static void Blit_RGB565_32(SDL_BlitInfo *info, const Uint32 *map)
|
||||||
{
|
{
|
||||||
#ifndef USE_DUFFS_LOOP
|
#ifndef USE_DUFFS_LOOP
|
||||||
int c;
|
int c;
|
||||||
|
@ -461,7 +462,7 @@ static void Blit_RGB565_32(SDL_BlitInfo *info, Uint32 *map)
|
||||||
src += 2;
|
src += 2;
|
||||||
}
|
}
|
||||||
/* Get any leftovers */
|
/* Get any leftovers */
|
||||||
switch (width % 4) {
|
switch (width & 3) {
|
||||||
case 3:
|
case 3:
|
||||||
*dst++ = RGB565_32(dst, src, map);
|
*dst++ = RGB565_32(dst, src, map);
|
||||||
src += 2;
|
src += 2;
|
||||||
|
@ -480,7 +481,7 @@ static void Blit_RGB565_32(SDL_BlitInfo *info, Uint32 *map)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
|
/* Special optimized blit for RGB 5-6-5 --> ARGB 8-8-8-8 */
|
||||||
static Uint32 RGB565_ARGB8888_LUT[512] = {
|
static const Uint32 RGB565_ARGB8888_LUT[512] = {
|
||||||
0x00000000, 0xff000000, 0x00000008, 0xff002000,
|
0x00000000, 0xff000000, 0x00000008, 0xff002000,
|
||||||
0x00000010, 0xff004000, 0x00000018, 0xff006100,
|
0x00000010, 0xff004000, 0x00000018, 0xff006100,
|
||||||
0x00000020, 0xff008100, 0x00000029, 0xff00a100,
|
0x00000020, 0xff008100, 0x00000029, 0xff00a100,
|
||||||
|
@ -616,7 +617,7 @@ static void Blit_RGB565_ARGB8888(SDL_BlitInfo *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
|
/* Special optimized blit for RGB 5-6-5 --> ABGR 8-8-8-8 */
|
||||||
static Uint32 RGB565_ABGR8888_LUT[512] = {
|
static const Uint32 RGB565_ABGR8888_LUT[512] = {
|
||||||
0xff000000, 0x00000000, 0xff080000, 0x00002000,
|
0xff000000, 0x00000000, 0xff080000, 0x00002000,
|
||||||
0xff100000, 0x00004000, 0xff180000, 0x00006100,
|
0xff100000, 0x00004000, 0xff180000, 0x00006100,
|
||||||
0xff200000, 0x00008100, 0xff290000, 0x0000a100,
|
0xff200000, 0x00008100, 0xff290000, 0x0000a100,
|
||||||
|
@ -752,7 +753,7 @@ static void Blit_RGB565_ABGR8888(SDL_BlitInfo *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
|
/* Special optimized blit for RGB 5-6-5 --> RGBA 8-8-8-8 */
|
||||||
static Uint32 RGB565_RGBA8888_LUT[512] = {
|
static const Uint32 RGB565_RGBA8888_LUT[512] = {
|
||||||
0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
|
0x000000ff, 0x00000000, 0x000008ff, 0x00200000,
|
||||||
0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
|
0x000010ff, 0x00400000, 0x000018ff, 0x00610000,
|
||||||
0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
|
0x000020ff, 0x00810000, 0x000029ff, 0x00a10000,
|
||||||
|
@ -888,7 +889,7 @@ static void Blit_RGB565_RGBA8888(SDL_BlitInfo *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
|
/* Special optimized blit for RGB 5-6-5 --> BGRA 8-8-8-8 */
|
||||||
static Uint32 RGB565_BGRA8888_LUT[512] = {
|
static const Uint32 RGB565_BGRA8888_LUT[512] = {
|
||||||
0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
|
0x00000000, 0x000000ff, 0x08000000, 0x002000ff,
|
||||||
0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
|
0x10000000, 0x004000ff, 0x18000000, 0x006100ff,
|
||||||
0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
|
0x20000000, 0x008100ff, 0x29000000, 0x00a100ff,
|
||||||
|
@ -1039,7 +1040,8 @@ static void Blit_RGB888_index8_map(SDL_BlitInfo *info)
|
||||||
int pixel;
|
int pixel;
|
||||||
int width, height;
|
int width, height;
|
||||||
Uint32 *src;
|
Uint32 *src;
|
||||||
Uint8 *map, *dst;
|
const Uint8 *map;
|
||||||
|
Uint8 *dst;
|
||||||
int srcskip, dstskip;
|
int srcskip, dstskip;
|
||||||
|
|
||||||
/* Set up some basic variables */
|
/* Set up some basic variables */
|
||||||
|
@ -1078,7 +1080,7 @@ static void Blit_RGB888_index8_map(SDL_BlitInfo *info)
|
||||||
*dst++ = map[pixel];
|
*dst++ = map[pixel];
|
||||||
++src;
|
++src;
|
||||||
}
|
}
|
||||||
switch ( width % 4 ) {
|
switch ( width & 3 ) {
|
||||||
case 3:
|
case 3:
|
||||||
RGB888_RGB332(pixel, *src);
|
RGB888_RGB332(pixel, *src);
|
||||||
*dst++ = map[pixel];
|
*dst++ = map[pixel];
|
||||||
|
@ -1103,7 +1105,9 @@ static void BlitNto1(SDL_BlitInfo *info)
|
||||||
int c;
|
int c;
|
||||||
#endif
|
#endif
|
||||||
int width, height;
|
int width, height;
|
||||||
Uint8 *src, *map, *dst;
|
Uint8 *src;
|
||||||
|
const Uint8 *map;
|
||||||
|
Uint8 *dst;
|
||||||
int srcskip, dstskip;
|
int srcskip, dstskip;
|
||||||
int srcbpp;
|
int srcbpp;
|
||||||
Uint32 pixel;
|
Uint32 pixel;
|
||||||
|
@ -1259,7 +1263,7 @@ static void BlitNto1Key(SDL_BlitInfo *info)
|
||||||
Uint8 *dst = info->d_pixels;
|
Uint8 *dst = info->d_pixels;
|
||||||
int dstskip = info->d_skip;
|
int dstskip = info->d_skip;
|
||||||
SDL_PixelFormat *srcfmt = info->src;
|
SDL_PixelFormat *srcfmt = info->src;
|
||||||
Uint8 *palmap = info->table;
|
const Uint8 *palmap = info->table;
|
||||||
Uint32 ckey = srcfmt->colorkey;
|
Uint32 ckey = srcfmt->colorkey;
|
||||||
Uint32 rgbmask = ~srcfmt->Amask;
|
Uint32 rgbmask = ~srcfmt->Amask;
|
||||||
int srcbpp;
|
int srcbpp;
|
||||||
|
@ -1431,11 +1435,11 @@ struct blit_table {
|
||||||
SDL_loblit blitfunc;
|
SDL_loblit blitfunc;
|
||||||
enum { NO_ALPHA, SET_ALPHA, COPY_ALPHA } alpha;
|
enum { NO_ALPHA, SET_ALPHA, COPY_ALPHA } alpha;
|
||||||
};
|
};
|
||||||
static struct blit_table normal_blit_1[] = {
|
static const struct blit_table normal_blit_1[] = {
|
||||||
/* Default for 8-bit RGB source, an invalid combination */
|
/* Default for 8-bit RGB source, an invalid combination */
|
||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
|
{ 0,0,0, 0, 0,0,0, 0, NULL, NULL },
|
||||||
};
|
};
|
||||||
static struct blit_table normal_blit_2[] = {
|
static const struct blit_table normal_blit_2[] = {
|
||||||
#ifdef USE_ASMBLIT
|
#ifdef USE_ASMBLIT
|
||||||
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
|
{ 0x0000F800,0x000007E0,0x0000001F, 2, 0x0000001F,0x000007E0,0x0000F800,
|
||||||
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
|
0, ConvertX86p16_16BGR565, ConvertX86, NO_ALPHA },
|
||||||
|
@ -1456,11 +1460,11 @@ static struct blit_table normal_blit_2[] = {
|
||||||
/* Default for 16-bit RGB source, used if no other blitter matches */
|
/* Default for 16-bit RGB source, used if no other blitter matches */
|
||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
||||||
};
|
};
|
||||||
static struct blit_table normal_blit_3[] = {
|
static const struct blit_table normal_blit_3[] = {
|
||||||
/* Default for 24-bit RGB source, never optimized */
|
/* Default for 24-bit RGB source, never optimized */
|
||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
||||||
};
|
};
|
||||||
static struct blit_table normal_blit_4[] = {
|
static const struct blit_table normal_blit_4[] = {
|
||||||
#ifdef USE_ASMBLIT
|
#ifdef USE_ASMBLIT
|
||||||
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
{ 0x00FF0000,0x0000FF00,0x000000FF, 2, 0x0000F800,0x000007E0,0x0000001F,
|
||||||
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
|
MMX_CPU, ConvertMMXpII32_16RGB565, ConvertMMX, NO_ALPHA },
|
||||||
|
@ -1497,7 +1501,7 @@ static struct blit_table normal_blit_4[] = {
|
||||||
/* Default for 32-bit RGB source, used if no other blitter matches */
|
/* Default for 32-bit RGB source, used if no other blitter matches */
|
||||||
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
{ 0,0,0, 0, 0,0,0, 0, NULL, BlitNtoN, 0 }
|
||||||
};
|
};
|
||||||
static struct blit_table *normal_blit[] = {
|
static const struct blit_table *normal_blit[] = {
|
||||||
normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
|
normal_blit_1, normal_blit_2, normal_blit_3, normal_blit_4
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1506,7 +1510,7 @@ SDL_loblit SDL_CalculateBlitN(SDL_Surface *surface, int blit_index)
|
||||||
struct private_swaccel *sdata;
|
struct private_swaccel *sdata;
|
||||||
SDL_PixelFormat *srcfmt;
|
SDL_PixelFormat *srcfmt;
|
||||||
SDL_PixelFormat *dstfmt;
|
SDL_PixelFormat *dstfmt;
|
||||||
struct blit_table *table;
|
const struct blit_table *table;
|
||||||
int which;
|
int which;
|
||||||
SDL_loblit blitfun;
|
SDL_loblit blitfun;
|
||||||
|
|
||||||
|
|
|
@ -278,8 +278,8 @@ static void PrintMode(XDGAMode *mode)
|
||||||
|
|
||||||
static int cmpmodes(const void *va, const void *vb)
|
static int cmpmodes(const void *va, const void *vb)
|
||||||
{
|
{
|
||||||
XDGAMode *a = (XDGAMode *)va;
|
const XDGAMode *a = (const XDGAMode *)va;
|
||||||
XDGAMode *b = (XDGAMode *)vb;
|
const XDGAMode *b = (const XDGAMode *)vb;
|
||||||
|
|
||||||
/* Prefer DirectColor visuals for otherwise equal modes */
|
/* Prefer DirectColor visuals for otherwise equal modes */
|
||||||
if ( (a->viewportWidth == b->viewportWidth) &&
|
if ( (a->viewportWidth == b->viewportWidth) &&
|
||||||
|
|
|
@ -247,8 +247,8 @@ int FB_OpenKeyboard(_THIS)
|
||||||
{
|
{
|
||||||
/* Open only if not already opened */
|
/* Open only if not already opened */
|
||||||
if ( keyboard_fd < 0 ) {
|
if ( keyboard_fd < 0 ) {
|
||||||
char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
|
static const char * const tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
|
||||||
char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
|
static const char * const vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
|
||||||
int i, tty0_fd;
|
int i, tty0_fd;
|
||||||
|
|
||||||
/* Try to query for a free virtual terminal */
|
/* Try to query for a free virtual terminal */
|
||||||
|
@ -524,7 +524,7 @@ fprintf(stderr, "Using ELO touchscreen\n");
|
||||||
|
|
||||||
if ( mousedev == NULL ) {
|
if ( mousedev == NULL ) {
|
||||||
/* FIXME someday... allow multiple mice in this driver */
|
/* FIXME someday... allow multiple mice in this driver */
|
||||||
char *ps2mice[] = {
|
static const char * const ps2mice[] = {
|
||||||
"/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
|
"/dev/input/mice", "/dev/usbmouse", "/dev/psaux", NULL
|
||||||
};
|
};
|
||||||
/* First try to use GPM in repeater mode */
|
/* First try to use GPM in repeater mode */
|
||||||
|
|
|
@ -62,7 +62,7 @@ static inline void outb (unsigned char value, unsigned short port)
|
||||||
#endif /* FB_TYPE_VGA_PLANES */
|
#endif /* FB_TYPE_VGA_PLANES */
|
||||||
|
|
||||||
/* A list of video resolutions that we query for (sorted largest to smallest) */
|
/* A list of video resolutions that we query for (sorted largest to smallest) */
|
||||||
static SDL_Rect checkres[] = {
|
static const SDL_Rect checkres[] = {
|
||||||
{ 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */
|
{ 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */
|
||||||
{ 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */
|
{ 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */
|
||||||
{ 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */
|
{ 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */
|
||||||
|
@ -77,7 +77,7 @@ static SDL_Rect checkres[] = {
|
||||||
{ 0, 0, 320, 240 },
|
{ 0, 0, 320, 240 },
|
||||||
{ 0, 0, 320, 200 }
|
{ 0, 0, 320, 200 }
|
||||||
};
|
};
|
||||||
static struct {
|
static const struct {
|
||||||
int xres;
|
int xres;
|
||||||
int yres;
|
int yres;
|
||||||
int pixclock;
|
int pixclock;
|
||||||
|
|
|
@ -78,8 +78,8 @@ static void restore_mode(_THIS)
|
||||||
#ifdef XFREE86_VM
|
#ifdef XFREE86_VM
|
||||||
static int cmpmodes(const void *va, const void *vb)
|
static int cmpmodes(const void *va, const void *vb)
|
||||||
{
|
{
|
||||||
XF86VidModeModeInfo *a = *(XF86VidModeModeInfo**)va;
|
const XF86VidModeModeInfo *a = *(const XF86VidModeModeInfo**)va;
|
||||||
XF86VidModeModeInfo *b = *(XF86VidModeModeInfo**)vb;
|
const XF86VidModeModeInfo *b = *(const XF86VidModeModeInfo**)vb;
|
||||||
if(a->hdisplay > b->hdisplay)
|
if(a->hdisplay > b->hdisplay)
|
||||||
return -1;
|
return -1;
|
||||||
return b->vdisplay - a->vdisplay;
|
return b->vdisplay - a->vdisplay;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue