forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SDL Crash - Need Advice For Debug

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Sun Mar 19, 2006 3:49 am    Post subject: SDL Crash - Need Advice For Debug Reply with quote

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:
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.php?g2_view=core.DownloadItem&g2_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:

$ 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?
Back to top
View user's profile Send private message
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Sun Mar 19, 2006 4:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Sun Mar 19, 2006 5:08 am    Post subject: Reply with quote

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... :(
Back to top
View user's profile Send private message
Sharkus



Joined: 19 Jun 2005
Posts: 27

PostPosted: Sun Mar 19, 2006 2:22 pm    Post subject: Reply with quote

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

Code:

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'
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group