Part 14 - ROM in RAM
This article continues on from Part 13 - Better Aspect Ratio.
Today I've made some changes so that the Microbee ROM images are loaded from the SD card - rather than requiring they be manually configured into the Nexys-3's flash RAM using the Adept utility.
Setting up the SD Card
To setup the SD card, first copy the ROM image:
c:\retro\ubee512\roms\>fbfs f: add hd18.rom
and select it as the first ROM pack:
c:\retro\ubee512\roms\>fbfs f: select rom 0 hd18.rom
How it Works
The Nexys-3 board has 16Mb of on-board RAM - plenty enough for the Microbee's 128K RAM + the PCU RAM + enough to also store the Microbee's boot ROM image. The memory map looks like this:
- 0x00000 - 0x1FFFF - Microbee's main memory (4 x 32K banks = 128K)
- 0x20000 - 0x2FFFF - 4 x 16K ROM Pack Images (though only 3 ever used)
- 0x30000 - 0x3FFFF - 64K of RAM for the PCU
In Microbee mode, the RAM at 0x20000-0x2FFFF is accessed when the Z80 is addressing ROM space and it's read-only.
The PCU get's read-write access to this memory as 4x16K banks that can be mapped into 0x8000-0xBFFF using port 0xD0. When bit 7 of port 0xD0 is set, bits 0-2 indicate which 16K bank to map to 0x8000.
(NB: Port 0xD0 - is port 0x50 with the high bit set - continuing the trend of mimicking the Microbee ports of similar functionality).
The PCU startup code now looks at the FBFS configuration, works out which file goes to which ROM pack slot and loads it in.
Saving Configuration Changes
Another minor improvement today - the configuration of loaded disks is now written back to the SD card. So you can switch disks with the PCU menu and following a reboot, they'll stay switched.
This is the end of Building FPGABee Version 2.