![]() |
|
Why are the IO registers stored redundantly? - Printable Version +- VBA-M Forums (http://vba-m.com/forum) +-- Forum: VisualBoy Advance-M (/Forum-visualboy-advance-m) +--- Forum: Suggestions (/Forum-suggestions) +---- Forum: Core (/Forum-core--44) +---- Thread: Why are the IO registers stored redundantly? (/Thread-why-are-the-io-registers-stored-redundantly) |
Why are the IO registers stored redundantly? - spacy51 - 08-18-2009 06:20 AM In Globals.cpp, there is "u8 *ioMem = 0;", which should contain all the IO registers, but all the IO registers are declared again seperately in the same file. I can see that whenever a register has to be changed, it looks like this: Code: DISPCNT = (value & 0xFFF7);Here's the definition for UPDATE_REG: Code: #define UPDATE_REG(address, value)\Why is it done like that? Couldn't we delete all the single registers and only use ioMem? Proposal: Code: #define DISPCNT ioMem[0x0000] |