#35545 - darkfader - Sun Feb 06, 2005 11:02 pm
<deleted>
Last edited by darkfader on Tue Mar 01, 2005 8:36 pm; edited 2 times in total
#35546 - dagamer34 - Sun Feb 06, 2005 11:07 pm
I think the best thing would be to continue the way most common GBA docs call registers, with the "REG_ " prefix. It's just simpler.
_________________
Little kids and Playstation 2's don't mix. :(
#35548 - darkfader - Sun Feb 06, 2005 11:12 pm
<deleted>
Last edited by darkfader on Tue Mar 01, 2005 8:36 pm; edited 1 time in total
#35554 - PhoenixSoft - Mon Feb 07, 2005 1:43 am
I don't care what it's called, I just want to start coding!
#35555 - josath - Mon Feb 07, 2005 2:44 am
I think R_BLAH or rBLAH would be good, i agree with the not too long thing.... io::BLAH would only apply to C++, no?
#35556 - Dwedit - Mon Feb 07, 2005 2:47 am
How about all 3?
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."
#35557 - sajiimori - Mon Feb 07, 2005 4:00 am
Can we have a new rule? Let's all double-check our subject lines to make sure they don't suggest some kind of new release or breakthrough, if they are only requests for discussion.
Definitely don't use anything C++ specific. It can be wrapped without overhead if needed.
Clear names should be preferred over short ones. In well-written programs, a small portion of the code involves direct register access, and that work is hidden by a higher level interface.
IO_ is not as good as REG_ because it's a needless deviation from convention. Also, "IO" is slightly ambiguous because it sometimes means actual keypad input and graphical/audio output, as opposed to accessing hardware outside the logical CPU and memory map (e.g. DMA, timers).
#35558 - Shock The Dark Mage - Mon Feb 07, 2005 4:36 am
I voted for IO_ but while reading the whole topic I have some thougts:
-Begin with a C library then a C++ wrapper
-Use REG_ as the GBA, will made simpler. BUT separating Memory, IO and Registers(ex: u16 *Memory_VRAM, IO_TOUCH, REG_DISPCNT)
_________________
Founding membre of Pixel Coders.
#35563 - sajiimori - Mon Feb 07, 2005 5:56 am
If input is done through registers, REG_ is appropriate.
The choice of naming conventions for memory areas is a seperate issue. Names like BG_VRAM and OAM seem ok, but prefixing them with MEM_ might be good since #defines don't obey namespace rules.
#35570 - MumblyJoe - Mon Feb 07, 2005 11:18 am
Hmmmm.... I voted for io:: because really namespaces are a far superior way of doing things, but I know that even the idea of learning c++ scares the crap out of a lot of homebrewers for some reason.
However, I'm not trying to start a C vs C++ war due to naming conventions in a library which I assume is imaginary right now anyway. Anyone who likes a certain naming convention will make there own libraries with that convention, and I will write my own and wrap them up all nicely and type-safely etc. with C++.
_________________
www.hungrydeveloper.com
Version 2.0 now up - guaranteed at least 100% more pleasing!
#35604 - tepples - Tue Feb 08, 2005 12:26 am
sajiimori wrote: |
Can we have a new rule? Let's all double-check our subject lines to make sure they don't suggest some kind of new release or breakthrough, if they are only requests for discussion. |
I've been question-marking these topics.
EDIT: Since nobody objected to my method after a few days, I've revised the forum rules accordingly.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Tue Feb 08, 2005 8:44 pm; edited 1 time in total
#35612 - quonic - Tue Feb 08, 2005 4:52 am
I voted for REG_;but, how about we or ya'll name them based on the system type, what part of the system, and what that part of the system does.
ex:
#define NDS_ARM9_SPEED = "33MHz";
_________________
Comming Soon: http://www.spyingwind.com
#35616 - chronofurb - Tue Feb 08, 2005 6:07 am
I like names with the underscore better, for some reason it makes it easier for me to read my variable names, when I am just glancing really quickly, but that may just be me...
#35655 - dagamer34 - Wed Feb 09, 2005 12:58 am
It would also be nice to easily see if a register has a GBA counterpart just by looking at it.
_________________
Little kids and Playstation 2's don't mix. :(