Heretic Sdl Again..


Have you successfully compiled any simpler programs yet? Make sure your toolchain works properly.

If you're using a nice new version of gcc, you'll need to link staticly, unless you really know what you're doing.

Other than that, you need to instrument the code - see if it's reaching the start of main. When you get the usb serial link up and running you can also run gdb on the target, and debug the program that way.
 
Have you successfully compiled any simpler programs yet? Make sure your toolchain works properly.

If you're using a nice new version of gcc, you'll need to link staticly, unless you really know what you're doing.

Other than that, you need to instrument the code - see if it's reaching the start of main. When you get the usb serial link up and running you can also run gdb on the target, and debug the program that way.


yea, i get the sdl example to compile and run properly.. and im linking all staticly.. But its hard to develop without any way to debug the code.. i dont know how to get the usb serial link to work..
and how i can check if my code (at last) reaches the main() ?
 
Last edited by a moderator:
Put something like this at the start of "main":

Code:
    printf ("reached start of main\n");
    fflush (stdout);
    sync();

Then see if it shows up in your logfile. The flush and sync are important if the gp2x is completely locking up at some point later in your program, because otherwise the print won't be synced to the SD card. If your program is actually crashing, the rest of your bash script will run - you should also have a "sync" in there, followed by the lines to fire up the gp2xmenu, so your logfile will be up-to-date and ready for reading in the ebook viewer.

If you've got the right lines to start the menu and it's still hanging on a black screen, that's a strong sign that your game is just locking up internally though.

One other thing that springs to mind is that your shell script could be in DOS format, with carriage returns before each line feed. Make sure it's saved in Unix format!
 
this is the shell script im using:

Code:
#!/bin/bash
./Heretic_Gp2x.gpe > heretic.log.txt
sync
cd /usr/gp2x/
./gp2xmenu

but my gp2x doesnt get back to the menu ;/ <> and yes.. its unix formatted

btw. there isnt any way to debug it using some app?
 
You can debug it with a serial or usb serial connection; if you can't do that, you can use sterm but typing is a bit slow!
 
Back
Top