GP2X Any Other Solution Than Sdl?


Akuma no Houkon

Certified Guru
Joined
Mar 4, 2004
Messages
1,194
Age
44
Location
USA > Washington > Everett
Website
akuma.gp32news.com
The GP32 had a official graphics libs, they were built in to the GP32s firmware, does the GP2x have this? I hate SDL, and the idea of requiring more dependencies doesnt sit well with me, and would like to use built in functions where available.

I have been reading the wiki, and I cant find any information about graphics libs that doesnt include SDL.

Does this
http://www.pulia.nu/code/junk/gph_sdk_installer.sh
install a NON SDL lib? Is there a fancy PDF doc or atleast some minimal demo?

Note that I am using devkitGP2X.
 
If its built into the firmware, why does the official wiki have this
QUOTE
How to run games which require SDL?
* First download the SDL from the gp2x archive: http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,31,869
* Then install SDL by extracting all files to the root folder (not in a subfolder !) of your SD card.
* Start your GP2X and select Utility->install_libs.gpu.
* Wait until the screen comes up again and that's it. You can then delete the files from your card.



That to me says that its not built in, and requires extra work on the users end.
 
I think that was for an old firmware version?

Anyhow, stuff compiled with the devcpp released by GPH works great, without any extra libs or anything.
 
Akuma no Houkon said:
That to me says that its not built in, and requires extra work on the users end.
I'm fairly sure that the official GPH toolchain contains their SDL library too, so you won't need to download an additional library and mess about.
 
Last edited by a moderator:
That to me says that its not built in, and requires extra work on the users end.



Not sure at what point, but AFAIK the more recent firmware versions include the SDL libraries.

Edit: Beaten!
 
Last edited by a moderator:
Akuma no Houkon said:
If its built into the firmware, why does the official wiki have this
QUOTE
How to run games which require SDL?
* First download the SDL from the gp2x archive: http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,31,869
* Then install SDL by extracting all files to the root folder (not in a subfolder !) of your SD card.
* Start your GP2X and select Utility->install_libs.gpu.
* Wait until the screen comes up again and that's it. You can then delete the files from your card.



That to me says that its not built in, and requires extra work on the users end.

From the firmware 2.0 the lib SDL are integrated to the firmware before we have to install them
 
Last edited by a moderator:
Ok...so I wonder now why my app doesnt work...

It compiles and runs perfectly in Linux with SDL, and compiles perfectly with the dev kit.

I rename it to MyApp.gpe, it shows up in the launcher, I select it and a blank screen is all I get.

I have been downloading sources to see if there is some kind of Init procedure that the GP2X needs, but cant find any specific example.

Anyone?
 
Akuma no Houkon said:
Ok...so I wonder now why my app doesnt work...

It compiles and runs perfectly in Linux with SDL, and compiles perfectly with the dev kit.

I rename it to MyApp.gpe, it shows up in the launcher, I select it and a blank screen is all I get.

I have been downloading sources to see if there is some kind of Init procedure that the GP2X needs, but cant find any specific example.

Anyone?
Try posting your source and maybe someone can spot something. Without seeing the code it's kind of like going to a mechanic and saying "my car broke down, whats wrong with it?" Without having let him see it :p
 
Last edited by a moderator:
Akuma no Houkon said:
Ok...so I wonder now why my app doesnt work...

It compiles and runs perfectly in Linux with SDL, and compiles perfectly with the dev kit.

I rename it to MyApp.gpe, it shows up in the launcher, I select it and a blank screen is all I get.

I have been downloading sources to see if there is some kind of Init procedure that the GP2X needs, but cant find any specific example.

Anyone?
Is there a test app included with the dev kit that you can try to compile and run, to check your set up?
 
Last edited by a moderator:
There wasnt one included with this one (it was the devkitGP2X_buildscript) unless it was installed to some random, unknown spot.

However I made a small test case that runs perfectly in Linux+SDL, compiles fine with the devkit, but blackscreens on run.

http://gp32.indiedevs.com/gp2x_test.tar.gz

If anyone wants to check it out. I am compiling with the following line:

/usr/local/devkitPro/devkitGP2X/bin/arm-linux-gcc -I/usr/local/devkitPro/devkitGP2X/include/SDL -L/usr/local/devkitPro/devkitGP2X/lib -o main main.c -lpng -lSDLmain -lSDL -lSDL_image -lSDL_gfx
 
The built in sdl libs (ignore the wiki, sdl itself has been built in since day 1 but some of the additional libs like gfx weren't always there) only work with an older slower version of gcc (3.3 or lower I think). To use the newer gcc in devkitgp2x you need to add -static when you link so the libs are included with the app. Makes your app quite a bit bigger (mb instead of kb), but it's much easier than trying to make sure your app will still work with all newer firmwares.
 
Don't forget if your prog just aborts (or exits) you'll just get a black screen.

So the best thing to do whilst debugging this kind of thing is to telnet into your gp2x, and run your program through that, then you'll get any debugging messages (and can of course also print your own).
 
Static doesnt work too well, I get a boatload of
SDL_sysmutex.c:(.text+0x2c): undefined reference to `pthread_mutexattr_init'
Type errors, I tried linking ptheads and others to no avail.

How does everyone else compile for the GP2x? Im sure everyone doesnt go through this.

Can anyone see if its in my code? Does that compile and run for you?

How does one ssh to their GP2x? Is a docking station required or can I use the Mini USB?
 
Akuma no Houkon said:
Static doesnt work too well, I get a boatload of
SDL_sysmutex.c:(.text+0x2c): undefined reference to `pthread_mutexattr_init'
Type errors, I tried linking ptheads and others to no avail.

How does everyone else compile for the GP2x? Im sure everyone doesnt go through this.

Can anyone see if its in my code? Does that compile and run for you?

How does one ssh to their GP2x? Is a docking station required or can I use the Mini USB?

The code compiled and ran fine here, without static linking. I'm using *embarrassed* Windows. I did have to comment out time.h to get it to compile for arm tho :unsure:
 
Last edited by a moderator:
Akuma no Houkon said:
/usr/local/devkitPro/devkitGP2X/bin/arm-linux-gcc -I/usr/local/devkitPro/devkitGP2X/include/SDL -L/usr/local/devkitPro/devkitGP2X/lib -o main main.c -lpng -lSDLmain -lSDL -lSDL_image -lSDL_gfx
If I remember rightly you'll need to make a static binary to get devkitPro executables to run on a stock GP2X, so add -static to the end of your gcc args.


Edit: "SDL_sysmutex.c:(.text+0x2c): undefined reference to `pthread_mutexattr_init'". Sorry, is a bit late for me... :( I don't think threading works too well in devkitPro...

Akuma no Houkon said:
How does everyone else compile for the GP2x? Im sure everyone doesnt go through this.
Install the open2x toolchain.

Akuma no Houkon said:
How does one ssh to their GP2x? Is a docking station required or can I use the Mini USB?
Once you've got it networked (via USB), just telnet into it as root and there is no password. (the supplied USB cable sucks though...)
 
Last edited by a moderator:
QUOTE
Sorry, is a bit late for me... sad.gif I don't think threading works too well in devkitPro...


Its SDL that is calling ptheads and wants to link. There is no pthreads lib with devkitpro though....

I will try Open2x, but the wiki has some contradicting info
* If you are using Linux DO NOT install the toolchain as ROOT.
and then.....
These should end up installed to /opt/open2x/

I have used many distributions in my life, and never has a non root user been allowed write access to /opt.

Hrmm.


EDIT:

I installed Open2x, I tried to use the SDL package I downloaded from the Ope2x but I get all of those pthreads errors. when I statically link.

The GP32 was much easier and straight forward to setup...what happened?
 
Back
Top