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 > graphics

#75163 - patroclus02 - Fri Mar 10, 2006 5:52 pm

I'm reading all libnds demos, and I see that all sprites and backgrounds are loaded from bin file, that generates in the build process some files to include in the source.
Which program do you use for that?
I know pagfx, but this program outputs a C file you just include in the source. Can I just use this approach?? I'm just not sure as I see no details about this in the demos. I've seen pagfx use but using PALib and its own functions...

any help? thanks

#75166 - Webez - Fri Mar 10, 2006 6:20 pm

**The answer I was writing has been deleted in the process so I will be more direct

There are 2 groups of files you can load:native files for ds (already processed) and all the others (.pcx, .jpeg,.mp3,etc). Native files can be generated in a lot of ways. You can use programs like gfx2gba (that can generate raw or .h files) or make your own. The other ones can be load with libs or your own functions (libnds provides a function to load pcx).

Then there are two ways of including them. First one is to generate a .h, .c or .s with a rule in the makefile (like the examples) or with program like the one you have mentioned . Second option and best one is to use a file system like gbfs or the fat lib

*I have make some changes to make it clearer. Bin files are raw files (binary files) and can be whatever type file

#75171 - patroclus02 - Fri Mar 10, 2006 7:22 pm

The problem is that I can't find any example of doing all this...
I don't understand all about makefile, and I don't know how GBFA example builds the file into the rom (I've seen PAlib examples that use GBFA over compiled and linked rom to append files, but I see nothing on libnds demo about GBFA).
Also, where can I find info about making the raw (bin) files?
Anyway, I still need to know how makefile works to prepare raw file into .h files...
I promise I'm spending hours trying to work this out.. I'm not just asking for the pleasure of it. Please, any help ?

I just need to know the basis of makefile editing to be able to do these kind of things, and any place whrere I can learn about making graphics to raw format, and map making.

#75175 - Sausage Boy - Fri Mar 10, 2006 7:47 pm

Go to http://www.gbadev.org/tools.php?section=gfx
Download gfx2gba v0.13

Look in the readme for information on how to convert an image file to different kinds of data. What you want depends on what kinds of backgrounds your program will use. I recommend you do some reasearch on the differences between tiled and bitmap backgrounds. Find out which one fits your project best. I believed there was a thread about that here recently.
_________________
"no offense, but this is the gayest game ever"

#75184 - patroclus02 - Fri Mar 10, 2006 9:36 pm

Thanks.
As I see, gfx2gba is like PAGfx, but lets you also output raw, not only scr.
So far, I would be able to handle scr files, and load them manuallt intro DS hardware, but I'm still stuck with the raw data.. I just don't know hot to handle makefile

#75187 - Webez - Fri Mar 10, 2006 9:50 pm

http://forum.gbadev.org/viewtopic.php?t=8610

Maybe this post can help you with gbfs

#75258 - acox - Sat Mar 11, 2006 3:14 pm

patroclus02 wrote:
I'm reading all libnds demos, and I see that all sprites and backgrounds are loaded from bin file, that generates in the build process some files to include in the source.
Which program do you use for that?
I know pagfx, but this program outputs a C file you just include in the source. Can I just use this approach?? I'm just not sure as I see no details about this in the demos. I've seen pagfx use but using PALib and its own functions...

any help? thanks


bmp2bin.exe in devkitARM/bin will convert to bin.

The Textured_Quad example by DarkFader is one standard example that has makefile support for this. Just put your image.bin in a folder called "your_project/data" and it spits out a c header for it ("image.h" in this case) into "your_project/include".
_________________
3D on GBA