GP32 libSDL on GP32


wammy

Still Fresh
Joined
Apr 23, 2003
Messages
10
Hi.

Does anybody know if there is a project of SDL port on the GP32?
It would be very helpful to code new games, and to port games onto the GP32...

Thanx!

wammy
 
AFAIK the GP32 SDK is so similar to SDL, there is no point creating extra wrapper functions - it's easier to just go through the code of an SDL program (e.g. Rick Dangerous) and change the function calls.

However, Allegro has been partially ported.
- Rico
 
It's a graphics library for windows. Pesonally i think it looks very similar to the gp sdk, so for me it would be of no use except for porting sdl games, then you would need almost no changes.
 
Sorry i omited linux, it was meant to be in the post but my brain omits things that are obvious. You would know that its one of my traits if you have talked to me on irc or msn. I seem to miss some words out, i think my brain is set to skipframes or something.
 
Ok I should have checked before... If GP32 SDK is similar to SDL, then it'll be easy to port a SDL software...
I'm planning on developping on the GP32 soon, I'm just checking out what's done and what's not... :)

For the beginners, SDL is is a Layer whose purpose is to make multimedia development platform independant. Instead of trying to use different code for every OS/toolkit/whatever you want to port your software on, you just use the SDL functions, and the SDL wraps to the right library... So Linux, Mac, Windows, Dreamcast, ... with API in many languages...

Thanx.

wammy
 
Which is how it gets is name ... Simple DirectMedia Layer.

I guess you could make a SDL for GP32, it would make porting easier, but you'd still have to change memory allocation, strings, files etc.

- Rico
 
Rico posted on Apr 24 2003 said:
Which is how it gets is name ... Simple DirectMedia Layer.

I guess you could make a SDL for GP32, it would make porting easier, but you'd still have to change memory allocation, strings, files etc.

- Rico
We shoudl slap together a giant port-helper library... I'm sure all of us have done things like:

#define read my_read
#define fread my_fread

(or at least I have; I've got a pair of files ot handle SEEK_SET, strucxt tm, all that jazz). We've all rebuilt the basic stdio routines wrapped around the GP SDK. IF Allegro has been partially done.. where is it? And SDL? Well, would be easy to make some SDL wrappers for most things... just need to define the struct screen, motion events, etc.

Ah, damn lazyness, that'll hold us up.. but I'm sure if a half dozen of us got together we could build a nice little porting package :)

jeff
 
Last edited by a moderator:
But you know as well as I do that if we write wrappers that aren't preprocessed in some way, we end up with slower code. I'm not too familiar with SDL - is it possible to wrap it without adding any extra interface? As for Allegro, one of the coders ported part of it for his own personal project (stuff like sprite rotation, etc...) but I can't remember who - craig possibly.

- Rico
 
Ok I've been working a few hours on all this SDL/GP32 SDK thing...

In fact both API are very similar, but SDL misses a lot of stuff. SDL is very very simple, I originaly thought it was much more close to DirectX... Anyway, it makes the port easier on the one hand, because there is not a lot of things to port, but on the other hand, this is much more complicated, because of all the GP32 functions (such as all "Flip" functions) that have no equivalence in the SDL API.
This will make me do some strange choice... Adding functions to the SDL API for a specific GP32 use, and to make it easier to use GP32 special effects under a SDL context (this way, coders familiar with SDL will code fastly). Or not adding functions to the SDL API, restricting SDL use to provide only a simple (and easy) port from other platforms... What do you think? I know that the first idea obviously includes the second one, if I add the functions, people can not use them... Anyway it's much more work to make things SDLish :)

I warn you guys for -maybe- being enthousiast, I have just written a few lines of code... I know this will not take a long time to build a SDL wrapper, but I don't have a lot of time... :-\

About the complexity and the lack of performance of a wrapper, as far as I know for the SDL and the GP32 API (well in fact, I don't know a lot but till then it seems to be enought), most of the wrapper functions will simply do acces to global structures and then GP32 API function calls, so I don't think we'll lose a lot of CPU...

Any idea, comment, insult, nice words are welcome...

wammy
 
I would go for a straight port of SDL. My reasoning is that if someone writes a game JUST for GP32, they might as well use the GP32 functions directly, and spare any lose in overhead, even if it is trivial. The only reason to incur the overhead (since they are apparently similar) would be if you wanted to be able to port your GP32 project to other platforms... in which case the "extra" GP32 functions couldn't be used anyway.

And for anyone porting an existing SDL project (of which there are a lot of good ones this would be great for), the extra functions are pointless. So to begin at least, just do the core functions, you could release additional ones later if you like but I don't see the point myself.

Kudos for taking on the project though!
 
Totally agree... you could also use SDL functions with GpSDK functions when you need them, then when porting the GpSDK functions could be converted. At least part SDL is better than no SDL ...
 
Hi guys.

Ok first of all thank you for your advices.

As a beginning my SDL port will be fully compliant to the SDL API, regardles of the GP32 SDK possibilities. Then, and only after everything's ok, I'll extend the SDL API in order to use the GP32 routines with the SDL look&feel... doing this, when you begin to port a game using SDL you'll do it fastly (well I hope), and if you wanna optimize, you'll use the GP32 capabilities with the SDL way of life :)

About the code of my little wrapper itself, I haven't done much since my last post 'cause my wireless keyboard ran out of batteries... I've got new ones now and I'll get back to code right now! (well in fact it's time for rollerblade now, I'll code when I'll be back home). I'm gonna buy a huge pack of rechargeables batteries : for the keyboard, and for the GP32 when I'll get it (shall I wait for the European or not?)...

Have fun on your GP32!

wammy
 
Back
Top