board/memory.c owns the address space the CPU will run on: work RAM (256 KiB
at 0x02000000 and 32 KiB at 0x03000000), the palette, VRAM and OAM, the save
memory at 0x0E000000 and the cartridge window at 0x08000000, each with the
mirrors the console decodes. The I/O window at 0x04000000 is plain register
storage so far. The devices replace their registers with real behaviour as they
land.
Some reads see the bus rather than memory. The BIOS can only be read by the
BIOS itself, so a read from anywhere else returns the opcode the BIOS fetched
last. That opcode is fixed for the four ways control leaves the BIOS (after the
boot, after a software interrupt, inside an interrupt handler, after its
return), and the board keeps it in AgbBoard.bios_prefetch. Each of the three
cartridge windows holds the image once. Past the image the cartridge drives no
data and a read returns the halfword address the cartridge latched, address / 2.
A 32 KiB SRAM has no 16th address line, so it repeats twice in the 64 KiB save
window.
Made from docs/platforms/agb/README.md at 69237645142c. GPL-3.0-or-later.