GP2X Gp2x App Shows Black Screen Then Returns To Menu


shinelife

Still Fresh
Joined
Dec 18, 2005
Messages
19
Location
Leeds, UK
Website
www.shinelife.co.uk
Hi,

I'm in the process of doing a quick 'n' dirty port of my 'Legacy' IBM PC emulator (http://www.shinelife.co.uk/) to GP2X. Thankfully it already uses SDL so all I've had to do is use devKitPro to make a few changes and recompile with arm-linux-g++ and arm-linux-sdl-config.

I've managed to compile the app, create a .gpe script to launch it, and get the whole lot onto the SD card. However, upon launching, I momentarily get a black screen, followed by a return to the GP2X menu screen (functionality provided by the .gpe script).

I've no way to know if my program is executing, or if it crashes upon execution, or what. I've downloaded sterm in an attempt to find out if my .gpe script is written correctly, but executing the sterm.gpu file from the Utilities menu results in a blank black screen with no apparent way to return to the menu.

I've also tried using install_libs.gpu and install_libs.tar.gz to install SDL libraries on the GP2X to see if this is causing any problem. This results in no improvement. However, I have no way of telling if the SDL libs are getting installed - running install_libs.gpu seems to return to the GP2X menu alarmingly quickly (less than one second).

I'd appreciate guidance from anybody on how to diagnose the problems described above - how to tell if my app is executing at all, and what stage it's getting to. Note that the app logs debug messages to the standard output (hence my reasons for wanting to execute under sterm).

Cheers,

Jon
 
Hi,

I'm in the process of doing a quick 'n' dirty port of my 'Legacy' IBM PC emulator (http://www.shinelife.co.uk/) to GP2X. Thankfully it already uses SDL so all I've had to do is use devKitPro to make a few changes and recompile with arm-linux-g++ and arm-linux-sdl-config.

I've managed to compile the app, create a .gpe script to launch it, and get the whole lot onto the SD card. However, upon launching, I momentarily get a black screen, followed by a return to the GP2X menu screen (functionality provided by the .gpe script).

I've no way to know if my program is executing, or if it crashes upon execution, or what. I've downloaded sterm in an attempt to find out if my .gpe script is written correctly, but executing the sterm.gpu file from the Utilities menu results in a blank black screen with no apparent way to return to the menu.

I've also tried using install_libs.gpu and install_libs.tar.gz to install SDL libraries on the GP2X to see if this is causing any problem. This results in no improvement. However, I have no way of telling if the SDL libs are getting installed - running install_libs.gpu seems to return to the GP2X menu alarmingly quickly (less than one second).

I'd appreciate guidance from anybody on how to diagnose the problems described above - how to tell if my app is executing at all, and what stage it's getting to. Note that the app logs debug messages to the standard output (hence my reasons for wanting to execute under sterm).

Cheers,

Jon

Sounds like what I get if I try to initialize SDL video with something that the GP2X can't do. However, to start with I would strongly recommend buiding everything as static so as to be able to exclude issues with the libs installed on the GP2X. Everything I've done so far is compiled statically. FYI, my initialization of SDL (assuming that is the problem) looks like this:
Code:
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_JOYSTICK);
screen = SDL_SetVideoMode(320, 240, 16, SDL_SWSURFACE);
I hope that this is of some help and that you will post the solution when you find it. Good luck with your port!
 
Last edited by a moderator:
Yep I'm already outputting stdout to a file - the file is created but is left empty on return to the GP2X menu screen. This would seem to indicate that something is preventing the app from executing at all.

Can you point to any GP2X programs (with source code) that compile in a statically linked fashion? I'm experienced(ish) in gcc but not familiar with static linking of libraries within a Makefile.

I'm still at a loss to understand why running sterm results in a blank screen. Anybody experienced the same or have any idea how to resolve this?
 
shinelife: if you want I have a serial cable I could run your app and send the feedback from it to you if you want
 
Hooka - thanks for the offer - to make sure I'm not wasting your time, let me try all other options (static linking etc) and get back to you when I get really stuck!

Also is it possible to buy a serial cable or would I need to build one?
 
Yep I'm already outputting stdout to a file - the file is created but is left empty on return to the GP2X menu screen. This would seem to indicate that something is preventing the app from executing at all.
That's happening because of the way the card is mounted. After running your program, try looking at the output file using the GP2x ebook reader - I think you'll find that it's actually getting created.
 
Last edited by a moderator:
I've found it extremely useful to launch programs from sterm. That way you can see error messages on the screen when your program exits.

sterm has command history accessible by clicking the joystick up and down. So typically to launch my program I just have to click the joystick up a couple of times to get to a "cd /mnt/cd/myfolder" command, press "B" to enter it, click up a couple of times to get to the last "./myprogram", click "B" again and it's off.

It's the work of a second, you don't have to laboriously type out you commands each time.
 
Yep I'm already outputting stdout to a file - the file is created but is left empty on return to the GP2X menu screen. This would seem to indicate that something is preventing the app from executing at all.

Can you point to any GP2X programs (with source code) that compile in a statically linked fashion? I'm experienced(ish) in gcc but not familiar with static linking of libraries within a Makefile.

I'm still at a loss to understand why running sterm results in a blank screen. Anybody experienced the same or have any idea how to resolve this?

It doesn't actually use a makefile, but grab Space Invasion. It includes full source and a script called "buildit" which I use for building my programs. It's a messy way of doing it but it works and should be pretty clear.

Space Invasion download
 
Last edited by a moderator:
Regarding serial cables, see my post with serial-over-USB drivers - you don't need a separate cable any more, you can just use the USB one. Though there are advantages to having a real serial cable...
 
Thanks everybody for your help, I've taken on board all suggestions. But still can't get anything I've compiled myself to run!

Evening2005 - your pre-compiled Space Invasion program runs fine but I can't get this to compile myself, even after editing the paths to reflect my dev environment (compiler can't find SDL_Mixer.h - this isn't part of the files in my SDL include directory for some reason).

Firefox - I would love to use STerm but for some reason I can't get it working. I have the sterm.gpu file installed on the root dir of my SD but I just get a blank screen upon launching it with no way to exit.

Barnesy - not sure what you mean. I have redirected stdout and stderr into a .txt file within my .gpe files used to launch programs, but this .txt file is always empty.

I've returned back to basics and attempted to compile the SDL Hello World (in the Wiki). I've managed to compile this and link it statically (the resulting executable being in the region of 3 Megs!!!) but no sign of the fabled white pixel, just a blank screen with no way to exit.

Is there anybody else using Linux to develop on the GP2x? I would appreciate a response from anybody who can help me source a working dev kit and a project to compile on this dev kit.
 
Thanks everybody for your help, I've taken on board all suggestions. But still can't get anything I've compiled myself to run!

Evening2005 - your pre-compiled Space Invasion program runs fine but I can't get this to compile myself, even after editing the paths to reflect my dev environment (compiler can't find SDL_Mixer.h - this isn't part of the files in my SDL include directory for some reason).

Firefox - I would love to use STerm but for some reason I can't get it working. I have the sterm.gpu file installed on the root dir of my SD but I just get a blank screen upon launching it with no way to exit.

Barnesy - not sure what you mean. I have redirected stdout and stderr into a .txt file within my .gpe files used to launch programs, but this .txt file is always empty.

I've returned back to basics and attempted to compile the SDL Hello World (in the Wiki). I've managed to compile this and link it statically (the resulting executable being in the region of 3 Megs!!!) but no sign of the fabled white pixel, just a blank screen with no way to exit.

Is there anybody else using Linux to develop on the GP2x? I would appreciate a response from anybody who can help me source a working dev kit and a project to compile on this dev kit.

Hiya. My stuff is all Linux based. Which set of libs are you using? I'm using the open2x compiler set and libs from theoddbot.

Wait just one minute. Did you say "SDL_Mixer.h" or "SDL_mixer.h"? The latter is correct, the former won't work.

Andrew
 
Last edited by a moderator:
Firefox - I would love to use STerm but for some reason I can't get it working. I have the sterm.gpu file installed on the root dir of my SD but I just get a blank screen upon launching it with no way to exit.

Oh, I expect it just needs the SDL library installing. Not the ones you're statically linking to your program, the shared ones that live on the GP2X and get used by programs like sterm.

You can get them from the file archive:

http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,31
 
Last edited by a moderator:
Barnesy - not sure what you mean. I have redirected stdout and stderr into a .txt file within my .gpe files used to launch programs, but this .txt file is always empty.

Yes. But if you look at it in the ebook reader after running your program (and without shutting the gp2x down in the meantime) you'll see that the text file is getting written to. Or you could call /bin/sync from your .GPE after it launches your program to get the same effect. The file gets created, but without doing a sync, the data written to it is lost. I guess the ebook reader works because using it means sync gets run along the way.
 
Last edited by a moderator:
I've now got the emulator running and displaying graphics on the GP2X! Thanks everybody for your help, getting sterm running as per the advice of Firefox got me on the first rung of the ladder and the rest was working through a load of old posts and documentation, my own stupidity and some bizarreness with the GP2X.

Next step will be to bind the GP2X buttons to keys on the virtual IBM PC keyboard and do some much needed speed tuning and optimization to get things up to speed. To get an idea of the sort of games this emulator should be able to play, look at Retrograde Station (http://retrograde.trustno1.org/). You won't be playing Counter Strike on your GP2X in a hurry :D

I'll post any updates/screenshots/releases on the GP32X boards later in the week.

Cheers

Jon
 
Back
Top