SGE Library for SDL r030809 with examples.

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

Moderators: cheriff, TyRaNiD

Post Reply
SamuraiX
Posts: 76
Joined: Tue Jan 31, 2006 6:28 am
Location: USA
Contact:

SGE Library for SDL r030809 with examples.

Post by SamuraiX »

I tried using the supplied SGE library here for PSP and ran into many issues when compiling against my own applications (missing support for some libraries I needed, plus there were truncating issues).

Therefore, I downloaded the source from the official site: http://www.etek.chalmers.se/~e8cal1/sge/ and ported over the source myself.


One thing I noticed as well was that the version checked in SVN was a little outdated and was missing SDL_image, Freetype, and C++ Class support. Its all included in this lib.


Details are covered in the README.PSP file. but here are the instructions and requirements anyway.

Code: Select all

Requirements:

   SDL
   SDL_image
   freetype


To build and install:

   make -f Makefile.psp config
   make -f Makefile.psp
   make -f Makefile.psp install


Usage:

   LIBS += -lSGE



As for compiling and executing the examples..... README.PSP in the examples directory explains it all. Some of them are quite fun to watch... ;p


Location will be temporary for a few days after that I will only host the file thru my sites download manager which requires users to be logged into the site.


http://www.lavalit.com/temp/PSP_SGE_r030809.rar
saulotmalo2
Posts: 43
Joined: Mon Sep 10, 2007 9:32 am

Post by saulotmalo2 »

sound very interesting, thanks for porting this. Also i have my project at half so i'll won't use it i have read the specs and are very good.
fatdev
Posts: 5
Joined: Tue Sep 18, 2007 9:21 pm

Post by fatdev »

Im sorry if this is too noob.
In the examples inside the SGE, why do these examples run on the psp without the PSP_MODULE_INFO, exit callbacks, etc all the things I thought was necessary for a psp program?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

SGE is ontop of SDL and I think SDL does all that for you, it tells the compiler to use SDL_main instead of main as the entry point so it can secretly set stuff up (SDL_main calls main when it's done).
(+[__]%)
fatdev
Posts: 5
Joined: Tue Sep 18, 2007 9:21 pm

Post by fatdev »

ok thank you.

So wouldn't that mean I can't easily change it to kernel mode?
Or if theres a different way of setting module info up, enlighten me please?
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

Why do you need kernel mode? If you really need it then I think the preferred method is to put your kernel mode things into a separate prx and load that from your main program. There are some threads that explain it using sample code from HEN http://forums.ps2dev.org/viewtopic.php?p=58259#58259

There is a way to remove SDL's secret main, use this line in CFLAGS instead of sdl-config (I took out -Dmain=SDL_main):
-I/usr/local/pspdev/psp/include/SDL
You'd have to setup your own exit callback and whatever else SDL did in it's SDL_main (could just check the source code).
fatdev wrote:Or if theres a different way of setting module info up, enlighten me please?
Someone else can answer this since I don't know.
(+[__]%)
fatdev
Posts: 5
Joined: Tue Sep 18, 2007 9:21 pm

Post by fatdev »

I need it to set up wlan. I will probably do it the first way you mentioned(seperate prx).

But just in case I find out I need to do it the other way for whatever reason, I briefly looked through SDL_main.h in usr/local/pspdev/psp/include SDL but it seems to have words like W32 and MacOS....is this the one I should be looking at? plus there isnt exit callback etc in this, or other header files in the same folder...
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

I actually meant the .c file not the .h file. Since I used the psplibraries script I have it here: X:\psplibraries\build\SDL\src\main\psp\SDL_psp_main.c
There's a copy on google code too: http://www.google.com/codesearch?hl=en& ... tnG=Search

Interestingly it seems SDL programs start in kernel mode anyway, so you may not have to do anything special.

Code: Select all

PSP_MODULE_INFO("SDL App", 0x1000, 1, 1);
(+[__]%)
fatdev
Posts: 5
Joined: Tue Sep 18, 2007 9:21 pm

Post by fatdev »

ooo~ right-o it is. Oh well then I have nothing to worry about. Thanks for the tip Smong.
Post Reply