Pandora improved SDL for pandora


Hi there! Some more questions...sorry if they might have been answered before. :)


1) What happens if I export SDL_VIDEODRIVER=omapdss on an "older" OS without omapdss? Will the game fail or will the game fallback to the "standard" SDL?


If it would fail, what is a safe way to check if the new SDL is existing? Any typical file or something?


2) My game offers me 2 inbuild scalers, namely 2x and linear2x (and no scale aka 320x200).


- Best results I get if I use SDL_OMAP_LAYER_SIZE="scaled" *and* 2x inbuild. This gives a crisp fullscreen picture (doubled pixelperfect and then scaled).


- If I only use scaled the picture is blurry (of course)


Is there any way to go 2x "pixelperfect" and then scale with the new sdl? Or is my way the only "proper" way at the moment? It does not hurt performance...I'd just prefer to do it "properly".
 
On older os, the game will fail to start but I don't think anybody will run an os older than beta6. For the rare case, you can also package the sdllib with your program and preload it.


If your game has a res of 320x200, you could also render to 320x240 and then upscale to 640x480, what will produce a good image, too.


If this is no option, you might as well just do it your way.
 
Thanks for the tipp :) I misunderstood notaz comment concerning the newest update. I thought it's only there since the newest update for SuperZaxxon.
 
SDL has been updated today, get it with firmware update. It should no longer flicker on certain programs that don't do double buffering. Unfortunately this comes with performance loss, since it's impossible to have it blit directly to framebuffer and not flicker, so a offscreen buffer had to be used. This only affects programs that don't set SDL_DOUBLEBUF, those which do will continue to work as before. You can revert to old behavior by setting SDL_OMAP_FORCE_DIRECTBUF, see http://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=sdl_omap.git;a=blob;f=README.OMAP;hb=HEAD .
 
SDL has been updated today, get it with firmware update. It should no longer flicker on certain programs that don't do double buffering. Unfortunately this comes with performance loss, since it's impossible to have it blit directly to framebuffer and not flicker, so a offscreen buffer had to be used. This only affects programs that don't set SDL_DOUBLEBUF, those which do will continue to work as before. You can revert to old behavior by setting SDL_OMAP_FORCE_DIRECTBUF, see http://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=sdl_omap.git;a=blob;f=README.OMAP;hb=HEAD .
So if I have a program that does dirty buffers or only draws individual sprites, Notaz SDL now forces a fullscreen copy for every blit? I guess only a few games work that way. At least it can be disabled.
 
Not full, just what you specify with SDL_UpdateRect(s)(). Before it did all drawing directly to fb and was ignoring SDL_UpdateRect(s)(), but that often caused flickering.
 
Hi,

I am am porting sdl_omap to yocto. Have done first test with supertux and pingus: WOW - thanks - also from my kids (they won't let me on the machine anymore)!

Needed the patch below - did not find a way to attach it. Maybe there will be times yocto is stable enough for pandora and you'll need it...


From a878a24472381e8e7abcf2e719726f95975e2d76 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Sun, 10 Mar 2013 22:43:48 +0100
Subject: [PATCH] SDL_x11sym.h: add symbols for _XGetRequest
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

While intoducing to yocto few libraries complain:

| /home/tmp/oe-core-eglibc/sysroots/overo/usr/lib/libSDL.so: undefined reference to `_XGetRequest'

This is a backport from libsdl-1.2.15.

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
src/video/x11/SDL_x11sym.h | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h
index 3dfa146..f1e7841 100644
--- a/src/video/x11/SDL_x11sym.h
+++ b/src/video/x11/SDL_x11sym.h
@@ -170,6 +170,12 @@ SDL_X11_SYM(void,_XRead32,(Display *dpy,register long *data,long len),(dpy,data,
#endif

/*
+ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
+ */
+SDL_X11_MODULE(XGETREQUEST)
+SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
+
+/*
* These only show up on some variants of Unix.
*/
#if defined(__osf__)
--
1.7.4.4
Andreas
 
Yeah but either there was something wrong with it (not a proper git patch?) or I just forgot, I don't remember now..
 
Last edited by a moderator:
A line warning, but the patch works anyway (used it with your latest, have to remove the part you now include).
 
I've strictly no idea what it does, but it works. Took that from an official mailing list, maybe gentoo.

Here's the whole thing:

Code:
# HG changeset patch
# User Ryan C. Gordon <icculus@icculus.org>
# Date 1326873803 18000
# Branch SDL-1.2
# Node ID e1264a758d5030fa9ffe9904e6eefd2c38098f5b
# Parent  6f013dd0add1c6809aeab04e306892198a207616
Add dynamic symbol for _XGetRequest, which libX11 1.4.99.1 added.

Fixes Bugzilla #1376.

diff --git a/src/video/x11/SDL_x11dyn.c b/src/video/x11/SDL_x11dyn.c
--- a/src/video/x11/SDL_x11dyn.c
+++ b/src/video/x11/SDL_x11dyn.c
@@ -109,6 +109,21 @@
 #undef SDL_X11_SYM
 
 
+static void *SDL_XGetRequest_workaround(Display* dpy, CARD8 type, size_t len)
+{
+	xReq *req;
+	WORD64ALIGN
+	if (dpy->bufptr + len > dpy->bufmax)
+		_XFlush(dpy);
+	dpy->last_req = dpy->bufptr;
+	req = (xReq*)dpy->bufptr;
+	req->reqType = type;
+	req->length = len / 4;
+	dpy->bufptr += len;
+	dpy->request++;
+	return req;
+}
+
 static int x11_load_refcount = 0;
 
 void SDL_X11_UnloadSymbols(void)
@@ -168,6 +183,15 @@
 		X11_GetSym("XGetICValues",&SDL_X11_HAVE_UTF8);
 		#endif
 
+		/*
+		 * In case we're built with newer Xlib headers, we need to make sure
+		 *  that _XGetRequest() is available, even on older systems.
+		 *  Otherwise, various Xlib macros we use will call a NULL pointer.
+		 */
+		if (!SDL_X11_HAVE_XGETREQUEST) {
+			p_XGetRequest = SDL_XGetRequest_workaround;
+		}
+
 		if (SDL_X11_HAVE_BASEXLIB) {  /* all required symbols loaded. */
 			SDL_ClearError();
 		} else {
diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h
--- a/src/video/x11/SDL_x11sym.h
+++ b/src/video/x11/SDL_x11sym.h
@@ -170,6 +170,12 @@
 #endif
 
 /*
+ * libX11 1.4.99.1 added _XGetRequest, and macros use it behind the scenes.
+ */
+SDL_X11_MODULE(XGETREQUEST)
+SDL_X11_SYM(void *,_XGetRequest,(Display* a,CARD8 b,size_t c),(a,b,c),return)
+
+/*
  * These only show up on some variants of Unix.
  */
 #if defined(__osf__)
 
OK I imported this remaining part directly from SDL's hg repo, along with a few more useful-looking patches.
 
Last edited by a moderator:
Does anyone know the ev_ key name for the left and right shoulder buttons?

# can be used to bind a key to SDL keysym, good for quick ports.

# Example:

# bind ev_home = sdlk_space

bind ev_<evdev_key> = <sdl_key>
 
Last edited by a moderator:
A = SDLK_HOME


B = SDLK_END


Y = SDLK_PAGEUP


X = SDLK_PAGEDOWN


L-Shoulder = SDLK_RSHIFT


R-Shoulder = SDLK_RCTRL


START = SDLK_LALT


SELECT = SDLK_LCTRL


D-PAD-Left = SDLK_LEFT


D-PAD-Right = SDLK_RIGHT


D-PAD-Up = SDLK_UP


D-PAD-Down = SDLK_DOWN
 
I've looked at infamous cursor drift problem on standard SDL, and it turns out to be a feature intended for 3D action games and can't be "fixed" as some things (like Duke3D?) already rely on it, but it can be disabled by setting a environment variable. Added a page about it on the wiki:

http://pandorawiki.org/SDL
 
Nice one. Good to have the option to disable it.


Never knew if duke3d relies on it. Never touched the mousecode there.
 
Back
Top