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 

Difficulties moving my homebrew to 3.52 from 1.5

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



Joined: 13 Jan 2007
Posts: 25

PostPosted: Sun Apr 06, 2008 4:10 pm    Post subject: Difficulties moving my homebrew to 3.52 from 1.5 Reply with quote

Trying to make my pspgl + SDL game to work on my 3.52 MM3-4 has proven more difficult than I'd expected/intended. I haven't played around with this stuff for about a year.

About this time last year I compiled an app using 'make kxploit' and it worked fine on my 1.5 kernel. Now that I've upgraded to 3.52, it still works fine.

However, because I'm struggling to build a new project of mine, I've gone back to that original app to try and build and run it. Unfortunately it crashes the PSP (turns it off). The only thing that it different is that the PSP toolchain is a year newer.

There was an error that I haven't seen in a while though.
Quote:

Error, could not fixup imports, stubs out of order.
Ensure the SDK libraries are linked in last to correct this error

but it compiles fine when I just use make kxploit again. Is this the problem?

In case my makefile throws any hints, here it is.

Code:

TARGET = heli
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
OBJS =   helicoptergame.o Cursor.o Geometry.o MainApp.o Trackball2.o Display.o

DEFAULT_CFLAGS =

MORE_CFLAGS = -G0 -O2

CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CXXFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) -fno-exceptions -fno-rtti

LIBS = $(shell $(SDL_CONFIG) --libs) -lSDL -lglut -lGLU -lGL -lm -lc -lpsputility -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lpspvfpu -lpsplibc -lpspuser -lpspkernel -lpsprtc -lpsppower -lstdc++ -lSDLmain -lSDL_ttf

EXTRA_TARGETS = EBOOT.PBP

BUILD_PRX = 1
PSP_FW_VERSION = 352
include $(PSPSDK)/lib/build.mak



I'd rather build for the 3.xx kernels now. I've read http://www.ghoti.nl/PSPtutorialm0.php and made the recommended tweaks to my code and makefile. I've assumed there are no kernel calls though

Basically I
- build my app using 'make'
- copy the EBOOT.PBP into psp/game352/HeliGame


I'm pretty miffed at this point. So some help would be great.

Cheers
Back to top
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Sun Apr 06, 2008 5:03 pm    Post subject: Reply with quote

Try linking your libs differently, you're linking something early on that should be at the end (order matters) is what the error is telling you.

Try these and let the build.mak that you're including tap the others you need on the end.
Code:
LIBS = $(shell $(SDL_CONFIG) --libs) -lSDL -lglut -lGLU -lGL -lm -lpspctrl -lpspvfpu -lpsprtc -lpsppower -lSDLmain -lSDL_ttf -lstdc++
Back to top
View user's profile Send private message
GlennNZ



Joined: 13 Jan 2007
Posts: 25

PostPosted: Sun Apr 06, 2008 5:41 pm    Post subject: Reply with quote

I still get the same error (for compiling for 1.5 which should run on my PSP). The whole thing looks like:

Quote:
make kxploit
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib helicoptergame.o Cursor.o Geometry.o MainApp.o Trackball2.o Display.o -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspnet_inet -lSDL -lGLU -lGL -lm -lpspctrl -lpspvfpu -lpsprtc -lpsppower -lstdc++ -lSDLmain -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o Helicopter_psp.elf
psp-fixup-imports Helicopter_psp.elf
Error, could not fixup imports, stubs out of order.
Ensure the SDK libraries are linked in last to correct this error
make: *** [Helicopter_psp.elf] Error 1


The libs now look like the following. I took out some unnecessary ones.
Code:
LIBS = $(shell $(SDL_CONFIG) --libs) -lSDL -lGLU -lGL -lm -lpspctrl -lpspvfpu -lpsprtc -lpsppower -lstdc++ -lSDLmain


Note that if I run 'make kxploit' again, then everything 'seems' fine.
Quote:

make kxploit
mksfo 'Helicopter_psp' PARAM.SFO
mkdir -p "Helicopter_psp"
psp-strip Helicopter_psp.elf -o Helicopter_psp/EBOOT.PBP
mkdir -p "Helicopter_psp%"
pack-pbp "Helicopter_psp%/EBOOT.PBP" PARAM.SFO NULL \
NULL NULL NULL \
NULL NULL NULL
[0] 408 bytes | PARAM.SFO
[1] 0 bytes | NULL
[2] 0 bytes | NULL
[3] 0 bytes | NULL
[4] 0 bytes | NULL
[5] 0 bytes | NULL
[6] 0 bytes | NULL
[7] 0 bytes | NULL


But it will crash the PSP.
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Sun Apr 06, 2008 7:17 pm    Post subject: Reply with quote

Maybe a "make clean" would do the trick.
Back to top
View user's profile Send private message
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Sun Apr 06, 2008 7:24 pm    Post subject: Reply with quote

From the looks of the output of your compile, the "$(shell $(SDL_CONFIG) --libs)" is causing the problems. ;)
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Mon Apr 07, 2008 5:27 am    Post subject: Reply with quote

The SDLmain library uses kernel mode for historical reasons.
It needs to be fixed...
For now you can just remove -Dmain=SDL_Main and -lSDLmain and do the psp startup stuff yourself.
Back to top
View user's profile Send private message
GlennNZ



Joined: 13 Jan 2007
Posts: 25

PostPosted: Mon Apr 07, 2008 9:36 pm    Post subject: Reply with quote

Well, part of the problem has gone away. I went into sdl-config, commented out -Dmain=SDL_main, recompiled and installed and now I don't get make complaining about stubs being out of order. The odd part though is that because I configured SDL using whats in the README.PSP, it just restored the sdl-config back to what it was so maybe it was all coincidence.

Honestly, I don't know what I'm doing and am just stabbing in the dark. Is there an updated SDL for PSP tutorial around anymore? The ones I think I used are dead links now.

I did a little better than before. When running my SDL app on the PSP, I now get a black screen with an oversized cursor arrow at the top left of the screen that is constructed out of dots. After about 10s the PSP shuts off.

I'm clueless so here's a link to my code to anyone whose keen. Its of my 3D helicopter that I spent ages making out of arrays. You can download it here. It should just need pspgl and sdl. http://www.mediafire.com/?texvzzk0unc

How's this. If someone can help me get this to work, I'll write an SDL tutorial and give it to the guy at http://www.ghoti.nl/PSPtutorialm0.php to put on his website (if he wants it). That way all the poor mugs like me who only know a bit of opengl and sdl, may have a better chance of getting things going.
Back to top
View user's profile Send private message
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Tue Apr 08, 2008 4:42 am    Post subject: Reply with quote

SDL displays a cursor when you have a shadow surface. Use SDL_ShowCursor (SDL_DISABLE); to turn it off.

As for the crash, try using psplink to debug it...

edit: I bet you divide by zero in the first iteration through the loop in main().
Back to top
View user's profile Send private message
GlennNZ



Joined: 13 Jan 2007
Posts: 25

PostPosted: Tue Apr 08, 2008 6:50 am    Post subject: Reply with quote

jimparis wrote:
SDL displays a cursor when you have a shadow surface. Use SDL_ShowCursor (SDL_DISABLE); to turn it off.

I've done this and it is still there. It doesn't really look like an SDL arrow. Unless it's just a very zoomed in one. It never appear on my linux version anyway.

jimparis wrote:

As for the crash, try using psplink to debug it...

Yes, I might have to look into what psplink is all about. Normally I just get the app to work in linux, then I just use the makefile to get it onto the PSP.

jimparis wrote:

edit: I bet you divide by zero in the first iteration through the loop in main().

I'm assuming you're talking about my game loop. I can't see how that is possible looking at my code. Sure, if SDL_GetTicks() kept returning the same value then I would have problems, but that is unlikely.

All this compiles and runs fine as a standalone app using OpenGL and SDL on my linux box. For those who are curious, download the files from http://www.mediafire.com/?uw4otxy1za1 (it's a different link than above)
You can just compile it with the command line.
Code:
g++ helicoptergame.cpp Cursor.cpp Geometry.cpp MainApp.cpp Trackball2.cpp Display.cpp -o helicoptergame -lX11 -lXmu -lXi -lm -lglut -lGL -lGLU -lSDL -lSDLmain
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