Gameboy Advance C/C++ coding practices... .h file hell?

Started by
3 comments, last by msmullens 22 years, 1 month ago
Could anyone familiar with gameboy advance programming explain the common coding conventions seen on the net? It seems that all the C example code is written using one or a few C files and maybe .asm files, and a million .h files containing functions instead of just function declarations. Needless to say this is not how most developers on other platforms work. Is there any particular justification for doing this, or is it just an odd quirk?
Advertisement
I can''t answer for everyone else, of course, but I''d go for "just an odd quirk." Frankly, I learned most of my programming self-taught like, and I just started down that path before I knew that wasn''t how most people do it.

-Arek the Absolute
-Arek the Absolute"The full quartet is pirates, ninjas, zombies, and robots. Create a game which involves all four, and you risk being blinded by the sheer level of coolness involved." - Superpig
What I do is I have a source file called utils.cpp (and a header called utils.h) that contains a ton of functions for dealing with all of the GBA stuff. I have a bunch of other .h files, but I don''t have functions in them (except for a few short inline functions), I just have definitions, structures, and some other simple stuff. The other thing I use .h files are for image data that is produced from a program that converts .bmp files into a .h file.
On that note is there any other way to generate image data for a gameboy ROM image without first converting it into a text .h file. This seems a little wasteful. Am I wrong?
Creativity -- Concept -- CodeYour game is nothing if you don't have all three.http://www.wam.umd.edu/~dlg/terc.htm
An odd convention, but that appears to be all it is. I''ve begun to find some sane sourcecode that actually inhabits C files.

Robmcq, that depends on the toolset that you are using, but you may be able to link in a .asm file that uses the INCBIN directive on a data file. Its a more readable and more efficient way to do it, although it will be compiled to the same ROM size either way.

This topic is closed to new replies.

Advertisement