I'm using C++.
I'm planning on expanding to throwing this into classes, kinda like (psuedocode):
class BaseDevice {
int isinitialized();
int id(); // Get ID of device
void update(); // update device if initialized
}
BaseDevice[0xFFFF];
Then I can just add multiple devices and interface with them. I'm actually trying to learn how computers work, and build my own CPU/computer from scratch. albeit, not too complex, of course!
Macros were used in this little section because it allowed easy access to change them. I was focused primarily on if the actual logic could use any changes.