|
I guess it's because I've been working with the NES's registers so long that I've got them all memorized. I did have an old nestech doc printed up, but I've lost track of it since I rarely refer to it anymore.
A standard nes.h file might be good for those who are just now learning this stuff, though. As long as it's standard, otherwise source codes might be confusing to read. (then again, if someone is going to learn from existing sources they're mostly going to see the actual register addresses)
I think it's OK to use longer register names (but just short enough to still be descriptive). Myself, when programming I spend most of the time planning, and little time doing the actual typing, anyways.
When I messed around on the SNES, I definitely could see how register names would be helpful. I was needing to refer to docs to be able to understand code that I wrote the day before. :P
The SNES must've had at least 20 times more registers than the NES, though.
Happy Dude, I think your NES.h is usable enough, other than the sound register names. Usually there will be only one or two routines in a program that uses those registers, so I think using longer names won't be too much of a burden.
I'd suggest something like this: (anyone feel free to tear this apart, just kicking around some ideas)
Pulse0Ctrl = $4000 Pulse0Sweep = $4001 Pulse0FreqLo = $4002 Pulse0FreqHi = $4003
Pulse1Ctrl = $4004 Pulse1Sweep = $4005 Pulse1FreqLo = $4006 Pulse1FreqHi = $4007
TriangleTimer = $4008 TriangleFreqLo = $400A TriangleFreqHi = $400B
NoiseCtrl = $400C NoiseFreq = $400E NoiseTimer = $400F
DeltaCtrl = $4010 DC_Offset = $4011 (this is a tough one to name) DeltaAddr = $4012 DeltaLength = $4013
SoundCtrl = $4015 (another kinda tough one, this is readable and writable for different purposes)
$4003, $4007, $400B, and $400F are kinda multi-purpose, though. So I'm not sure if my naming describes them well enough. FreqLo and FreqHi are just my personal preference (descriptive enough of their primary use, too).
Also, it seems kinda redundant to use the name OAMIOReg, since it's given that it's a register anyways. :P
Wasn't the source code to the NES version of Elite released at one point? I thought it was, but I can't find it anywhere. That might be interesting to see.
|