#11754 - Archeious - Fri Oct 17, 2003 10:51 pm
K, this may be more of C/C++ question but how can I link binary data to my bin. Right now I have a program that convert the program into a .h array. I would like to make a binary file with the map data, etc. How do you do this? Thanks in adcance.
#11756 - Gopher - Fri Oct 17, 2003 11:59 pm
If you include the .h file containing your map from your c/c++ code, the array will be compiled into the resulting binary file
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein
#11757 - tepples - Sat Oct 18, 2003 12:14 am
Actually, it's best not to use a .h file because GCC compiles a multi-kilobyte initialized array of bytes into an object file so slowly that it's not funny. I used to use .h files until I switched to .s files, which compile much more quickly. There are several binary to .s converters; I just wrote my own.
Another option is appending an archive of assets such as graphics and maps to the end of your program. My GBFS tools should help here.
On the other hand, it appears you're also looking for a format to put your binary data in before you include it into your program. You'll have to come up with that yourself or use whatever your editor or conversion tool outputs; it should come with a technical reference section describing how to use its output in the GBA environment.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#11762 - Burton Radons - Sat Oct 18, 2003 7:21 am
An ELF generator just takes a couple hours to write, and once it is there exporters are simpler. I'd offer up my exporter, but it's not in C/C++. The only tricky part is that you must be sure to list local symbols first, or ld will either link incorrectly or crash.