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?
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.
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.
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.