Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


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


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 msmullens   Members   -  Reputation: 122

Like
Likes
Like

Posted 18 March 2002 - 07:30 PM

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?

Sponsor:

#2 Arek the Absolute   Members   -  Reputation: 350

Like
Likes
Like

Posted 19 March 2002 - 09:26 AM

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

#3 Aprosenf   Members   -  Reputation: 372

Like
Likes
Like

Posted 19 March 2002 - 09:28 AM

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.

#4 robmcq   Members   -  Reputation: 122

Like
Likes
Like

Posted 19 March 2002 - 09:33 AM

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?

#5 msmullens   Members   -  Reputation: 122

Like
Likes
Like

Posted 20 March 2002 - 04:43 AM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS