A tiny MMU for controlling the paged portion of RAM and the placement of the custom chip RAM, as well as an output LED and an input button. The computer offers a memory map which always begins with some unpaged SRAM (memory which is unaffected by the MMU). The stack should be placed at the end of this region. The interrupt vectors and initial program counter all reside at the beginning of this region. The portions of the main program, as well as bank-switching code, should/could also reside here. The size of this unpaged memory, is controlled by the S value in this register. Following the unpaged memory, is (possibly) a region of paged RAM, which will be discussed shortly. Following the paged RAM, is the custom chip RAM (Audio & Video). The content of these memory regions, depends upon the configuration of the specific chip. Following the custom chip memory, is (possibly) a region of paged RAM. Basically, the paged RAM shows through wherever there is not something else. The paged RAM can be manipulated using a variety of bits in this register, which can ultimately expose the entire 128K of SRAM through the available window. NOTE that you can (accidentally or intentionally) configure the MMU to mirror the unpaged memory to another region of the memory map. The unpaged memory always lies at the very beginning of SRAM.
u8 in IO at 0x00 called CONTROLREG
76543210
NBSSSLBB
B: RW [MMU] Selected Bank.0 (3 bits, select 0..7)
B: RW [MMU] Selected Bank.1
L: RW LED (1 = ON, 0 = OFF).
S: RW [MMU] Unpaged Memory Size (0..7 = 0x1000..0x8000.
B: RW [MMU] Selected Bank.2
N: R. Button (1 = released, 0 = pressed).