5 ms·
Out of curiosity: can anyone w/ the relevant experience explain why older consoles like the NES and the GB have "mirrors" in their memory map? I haven't program
by drbawb 12y ago
Out of curiosity: can anyone w/ the relevant experience explain why older consoles like the NES and the GB have "mirrors" in their memory map? I haven't programmed embedded systems so I really don't understand what the advantage might be.
I thought the Gameboy was odd enough with it's 'echo' of WRAM. (Which isn't even a complete mirror; it stops partway through WRAM#1.)
Reading the NES memory map though it gets quite silly! There's a mirror ($2008-$3FFF) that repeats a set of 8 registers ($2000-2007) _every 8 bytes._
Was this simply a matter of having more address space than physical memory? Or were these mirrors actually useful when programming these consoles?
---
I thought it might have to do w/ different addressing modes; perhaps you could save some bytes by just storing offsets or something. But that makes no sense in the context of the Gameboy. Many of the z80's extended instructions are gone; the only "interesting" addressing mode is a handful of instructions which treat an 8-bit address as an offset from $FF00.
- wk_end 12y agoUsually it's just a side-effect of how the system is wired. Consider that GB WRAM mirror, where C000 = E000 all the way up to DDFF = FDFF. Let's look at these numbers in binary: C000 = 1100 0000 0000 0000 E000 = 1110 0000 0000 0000 DDFF = 1101 1101 1111 1111 FDFF = 1111 1101 1111 1111 If you notice, that third most significant bit is the only difference - and this is true the entire way through the mirror. Because that address line wasn't needed to access WRAM, it was probably never even wired to it - so on access the value of it is simply ignored.