Internals and Memory Map
Mattias Gustavsson, September 10, 2008Time for another piece on my RetroBox. I've got it mostly working now, and will be releasing a first beta pretty soon, so I thought I'd talk a bit about how it works internally.

As you can see, there's a bunch of different components in the RetroBox. I've already detailed the RBCPU processor, but there's other things of interest too. We have the VDC, or Video Display Controller, which is the thing that is responsible for displaying stuff on the screen (and which deserves its own entry later on), the BIOS systems functions, which will provide things like file access and blitter functions, some Read-only memory (ROM), which holds boot code and things like a system font, the Input Controller, which handles input, and last, but not least, the Main Memory (RAM).
I will detail each of these components in due time, but first I want to focus a bit on the RAM. For the first release of the RetroBox, there won't be any BIOS functions, and not much (if any) stuff in ROM, so the only way for us to do anything with the CPU is by means of the RAM. This is not that much of a limitation though: we can do all sorts of cool things by just poking around in the memory.
Here's a full layout of the RetroBox's memory, all 64 MB of it (click to enlarge):
As you can see, the first 64K (0000-FFFF) are reserved, and can't be used for general storage. Instead, they are used to communicate with the VDC and the Input Controller. For example, if you set the LONG value at address $1000 (where the dollar sign indicates a hexadecimal number) to a memory address, the VDC will get its palette data from the memory at that address. If you modify the LONG value at $1004, you can set up the location of Video RAM, which is the area in RAM that the VDC reads when drawing things on the screen.
The keyboard can be read by looking at memory locations $1600 to $17FF, and the mouse by reading locations $1800 to $1805. The Input Controller constantly updates the values at those locations with input from the physical devices.
I will go into more detail on how this works when I describe the VDC and the Input Controller respectively, but I thought I'd mention the SysTimer now, as it is not part of either the VDC or the Input Controller. The LONG value at the SysTimer address ($100C) simply contains the number of milliseconds since the RetroBox was started, and is the easiest way to measure time.
That's it for this time - a high level overview of the RB internals and its memory structure, but stay tuned for next time, when we'll get in deep with the VDC.
