gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > Porting a library?

#152041 - mastastealth - Sat Mar 08, 2008 9:27 pm

I've been looking into porting a certain library to attempt some DS programming. It's used in your standard Bible software on Windows and Linux.

My question is how does one go about porting a library like this? From what I know, when you compile a program, you have a configure part that checks for any other dependencies, then the make which compiles it to your specific architecture and OS, and then you get a binary. A linux library binary is normally a simple *.so or something right? I know this library is available on PDAs that run ARM chips, so it must be possible to get on the DS.

I've set up my devkitpro, PALib, and Visual Studio 08 all for some DS homebrew dabbling. Can someone give me a rough idea on what I'd need to do first before making my app that would have to use that library?

#152127 - nczempin - Mon Mar 10, 2008 2:00 pm

mastastealth wrote:
I've been looking into porting a certain library to attempt some DS programming. It's used in your standard Bible software on Windows and Linux.

My question is how does one go about porting a library like this? From what I know, when you compile a program, you have a configure part that checks for any other dependencies, then the make which compiles it to your specific architecture and OS, and then you get a binary. A linux library binary is normally a simple *.so or something right? I know this library is available on PDAs that run ARM chips, so it must be possible to get on the DS.

I've set up my devkitpro, PALib, and Visual Studio 08 all for some DS homebrew dabbling. Can someone give me a rough idea on what I'd need to do first before making my app that would have to use that library?


My suggestion is that you should first gain a lot more development experience before you attempt to do something like this.

And if you insist, check out some DS library source code; the libnds comes to mind.

Then you could attempt to build a simple library from scratch, say one that implements Bresenham's line algo or something string-related (actually, ti doesn't have to be useful, it just needs to be compiled as a library and then you should be able to just use it with the lib binary and the headers.

Once you can do that, perhaps you want to port a simple open-source program (that doesn't involve any libraries that are not already supplied by devkitPro) to the DS.

And then, or perhaps after a few more cycles through any of the above, you are ready to go all the way and actually port a library to the DS.

#152159 - josath - Mon Mar 10, 2008 9:11 pm

a few tips:
* you can only use static libraries (.a files compiled into your binary), not dynamic (.so files linked at runtime).
* Often the 'configure' program can be used to configure for targeting the DS with just a few switches.
* There's a template for building libraries included in the libnds examples.

#152251 - nczempin - Wed Mar 12, 2008 8:34 pm

I musta scared him off. 1 Post, gone!

#152397 - mastastealth - Sat Mar 15, 2008 12:45 am

Lol, no worries, I'm still here. Definitely looks like something I'm not capable of doing at the moment. I'll probably ask around the Sword mailing list to see if someone is who knows more could help compile it. In the mean time, looks like I'll have to learn a lot. ;P