SDL Crash - Need Advice For Debug

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Sharkus
Posts: 27
Joined: Sun Jun 19, 2005 6:49 am

SDL Crash - Need Advice For Debug

Post by Sharkus »

I'm porting a fairly large SDL application to the PSP (UQM). This is my first PSP development effort so I'm a bit green when it comes to debuging crashes.

My configuration:

cygwin
latest toolchain SDK / SDL / SDL_image / libTremor / libjpeg / libpng / zlib from svn (rev 1835)
PSPLINK (running elf file from host0:/)

Flags:

Code: Select all

CFLAGS='-I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include/SDL -O -W -Wall -Dmain=SDL_main -DDEBUG -DGFXMODULE_SDL -DSOUNDMODULE_SDL -DOVCODEC_TREMOR -DHAVE_ZIP=1 -I "."'

LDFLAGS='-L/usr/local/pspdev/psp/sdk/lib -L/usr/local/pspdev/psp/lib -lSDL_image -lSDLmain -lSDL -lpspsdk -lpspdebug -lc -lpspuser -lm -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpsprtc -lpspaudio -lpsputility -lpspkernel -ljpeg -lpng -lvorbisidec -lz'
SDL_Init() runs just fine, but I get a crash (see image) when the program makes the following function call:

SDL_Video = SDL_SetVideoMode (640, 480, 0, 0);

Crash Image Dump: http://www.sharkus.com/gallery2/main.ph ... itemId=769

What is strange is that I compiled the SDL test applications and this exact call is made (and it works).

Here's the output of psp-addr2line:

Code: Select all

$ psp-addr2line.exe -e ./uqm-debug.elf  -f -C 0x8031804 0x0 0x8a3c65c
??
??:0
??
??:0
sceGuInit
/tmp/pspdev/pspsdk/src/gu/sceGuInit.c:67
I've been pulling my hair out on this for two days. Anyone have some suggestions I can try?
User avatar
dot_blank
Posts: 498
Joined: Wed Sep 28, 2005 8:47 am
Location: Brasil

Post by dot_blank »

it seems that call is using 640 for width and 480 for height
for that video mode ...which of course psp does not support
the psp is 480x272 to remind you... you cannot exceed that
pixel resolution
also
i assume you have these libs to go along with the
ones you mentioned above...libmad, libogg, libvorbis
and SDL_mixer for the audio in SDL
10011011 00101010 11010111 10001001 10111010
Sharkus
Posts: 27
Joined: Sun Jun 19, 2005 6:49 am

Post by Sharkus »

Thanks dot_blank. I've tried various resolutions including : 640x480, 480x272, 320x240, etc. All crash in the same way. Also, the SDL test apps work fine on the PSP with the 640x480.

I've also tried every possible combination of SDL surfaces/bpp/flags (including the ones that work just fine with the SDL sample apps). All crash in the same way... :(
Sharkus
Posts: 27
Joined: Sun Jun 19, 2005 6:49 am

Post by Sharkus »

Hmmm. As a last resort I reordered the library linking. It's a bit scary but things are working now...

Code: Select all

LDFLAGS='-L/usr/local/pspdev/psp/lib -lpspsdk -lSDLmain -lSDL_image -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -ljpeg -lpng -lvorbisidec -lz'
Post Reply