123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- diff --git a/package/sdl/0003-add-SDL_NOKBD.patch b/package/sdl/0003-add-SDL_NOKBD.patch
- new file mode 100644
- index 0000000..d944555
- --- /dev/null
- +++ b/package/sdl/0003-add-SDL_NOKBD.patch
- @@ -0,0 +1,55 @@
- +diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
- +index 5e58809..81830b6 100644
- +--- a/src/video/fbcon/SDL_fbvideo.c
- ++++ b/src/video/fbcon/SDL_fbvideo.c
- +@@ -793,9 +793,11 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat)
- + }
- +
- + /* Enable mouse and keyboard support */
- +- if ( FB_OpenKeyboard(this) < 0 ) {
- +- FB_VideoQuit(this);
- +- return(-1);
- ++ if (!SDL_getenv("SDL_NOKBD")){
- ++ if ( FB_OpenKeyboard(this) < 0 ) {
- ++ FB_VideoQuit(this);
- ++ return(-1);
- ++ }
- + }
- + if ( FB_OpenMouse(this) < 0 ) {
- + const char *sdl_nomouse;
- +@@ -944,7 +946,7 @@ static SDL_Surface *FB_SetVGA16Mode(_THIS, SDL_Surface *current,
- +
- + /* Set the terminal into graphics mode */
- + if ( FB_EnterGraphicsMode(this) < 0 ) {
- +- return(NULL);
- ++ if (!SDL_getenv("SDL_NOKBD")) return(NULL);
- + }
- +
- + /* Restore the original palette */
- +@@ -1009,7 +1011,7 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
- +
- + /* Set the terminal into graphics mode */
- + if ( FB_EnterGraphicsMode(this) < 0 ) {
- +- return(NULL);
- ++ if (!SDL_getenv("SDL_NOKBD")) return(NULL);
- + }
- +
- + /* Restore the original palette */
- +@@ -1919,7 +1921,7 @@ static void FB_VideoQuit(_THIS)
- + SDL_memcpy(flip_address[0], flip_address[1], this->screen->pitch * this->screen->h);
- + }
- +
- +- if ( !dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this) ) {
- ++ if ( (!dontClearPixels && this->screen->pixels && FB_InGraphicsMode(this)) || SDL_getenv("SDL_NOKBD") ) {
- + #if defined(__powerpc__) || defined(__ia64__) /* SIGBUS when using SDL_memset() ?? */
- + Uint8 *rowp = (Uint8 *)this->screen->pixels;
- + int left = this->screen->pitch*this->screen->h;
- +@@ -1968,7 +1970,7 @@ static void FB_VideoQuit(_THIS)
- + }
- +
- + /* Restore the original video mode and palette */
- +- if ( FB_InGraphicsMode(this) ) {
- ++ if ( FB_InGraphicsMode(this) || SDL_getenv("SDL_NOKBD") ) {
- + FB_RestorePalette(this);
- + ioctl(console_fd, FBIOPUT_VSCREENINFO, &saved_vinfo);
- + }
- diff --git a/package/sdl/0004-sdl-fbdev-blit32.patch b/package/sdl/0004-sdl-fbdev-blit32.patch
- new file mode 100644
- index 0000000..e06a57a
- --- /dev/null
- +++ b/package/sdl/0004-sdl-fbdev-blit32.patch
- @@ -0,0 +1,99 @@
- +diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c
- +index 81830b6..1399140 100644
- +--- a/src/video/fbcon/SDL_fbvideo.c
- ++++ b/src/video/fbcon/SDL_fbvideo.c
- +@@ -165,6 +165,10 @@ static void FB_RestorePalette(_THIS);
- + static FB_bitBlit FB_blit16;
- + static FB_bitBlit FB_blit16blocked;
- +
- ++static FB_bitBlit FB_blit32;
- ++static FB_bitBlit FB_blit32blocked;
- ++
- ++
- + static int SDL_getpagesize(void)
- + {
- + #ifdef HAVE_GETPAGESIZE
- +@@ -1119,6 +1123,10 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current,
- + blitFunc = (rotate == FBCON_ROTATE_NONE ||
- + rotate == FBCON_ROTATE_UD) ?
- + FB_blit16 : FB_blit16blocked;
- ++ } else if (vinfo.bits_per_pixel == 32) {
- ++ blitFunc = (rotate == FBCON_ROTATE_NONE ||
- ++ rotate == FBCON_ROTATE_UD) ?
- ++ FB_blit32 : FB_blit32blocked;
- + } else {
- + #ifdef FBCON_DEBUG
- + fprintf(stderr, "Init vinfo:\n");
- +@@ -1495,6 +1503,57 @@ static void FB_blit16blocked(Uint8 *byte_src_pos, int src_right_delta, int src_d
- + }
- + }
- +
- ++static void FB_blit32(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
- ++ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
- ++{
- ++ int w;
- ++ Uint32 *src_pos = (Uint32 *)byte_src_pos;
- ++ Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
- ++
- ++ while (height) {
- ++ Uint32 *src = src_pos;
- ++ Uint32 *dst = dst_pos;
- ++ for (w = width; w != 0; w--) {
- ++ *dst = *src;
- ++ src += src_right_delta;
- ++ dst++;
- ++ }
- ++ dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes);
- ++ src_pos += src_down_delta;
- ++ height--;
- ++ }
- ++}
- ++
- ++#define BLOCKSIZE_W 32
- ++#define BLOCKSIZE_H 32
- ++
- ++static void FB_blit32blocked(Uint8 *byte_src_pos, int src_right_delta, int src_down_delta,
- ++ Uint8 *byte_dst_pos, int dst_linebytes, int width, int height)
- ++{
- ++ int w;
- ++ Uint32 *src_pos = (Uint32 *)byte_src_pos;
- ++ Uint32 *dst_pos = (Uint32 *)byte_dst_pos;
- ++
- ++ while (height > 0) {
- ++ Uint32 *src = src_pos;
- ++ Uint32 *dst = dst_pos;
- ++ for (w = width; w > 0; w -= BLOCKSIZE_W) {
- ++ FB_blit32((Uint8 *)src,
- ++ src_right_delta,
- ++ src_down_delta,
- ++ (Uint8 *)dst,
- ++ dst_linebytes,
- ++ min(w, BLOCKSIZE_W),
- ++ min(height, BLOCKSIZE_H));
- ++ src += src_right_delta * BLOCKSIZE_W;
- ++ dst += BLOCKSIZE_W;
- ++ }
- ++ dst_pos = (Uint32 *)((Uint8 *)dst_pos + dst_linebytes * BLOCKSIZE_H);
- ++ src_pos += src_down_delta * BLOCKSIZE_H;
- ++ height -= BLOCKSIZE_H;
- ++ }
- ++}
- ++
- + static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
- + {
- + int width = cache_vinfo.xres;
- +@@ -1507,10 +1566,10 @@ static void FB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects)
- + return;
- + }
- +
- +- if (cache_vinfo.bits_per_pixel != 16) {
- +- SDL_SetError("Shadow copy only implemented for 16 bpp");
- +- return;
- +- }
- ++// if (cache_vinfo.bits_per_pixel != 16) {
- ++// SDL_SetError("Shadow copy only implemented for 16 bpp");
- ++// return;
- ++// }
- +
- + for (i = 0; i < numrects; i++) {
- + int x1, y1, x2, y2;
|