For those unaware, the REU plugged into the C64’s expansion port and added extra memory while also allowing for direct memory access (DMA) transfers – something the Sidekick64 couldn’t do. This meant data could be transferred to and from the main system memory whole bypassing the MOS Technology 6510/8500 CPU. “My RAD Expansion Unit was designed to do these transfers,” Carsten says. It’s a major triumph!
Radical thinking
There are many benefits to having the RAD Expansion Unit, which boosts the amount of available memory from the standard 64kB to as much as 16MB. “It helps to run Geos [a C64 OS] and it makes some tasks less annoying, such as copying disks in one go. It also functions as a RAM disk to accelerate working with the system,” Carsten says.
In order to create the project, then, two PCBs were produced: one to fit Raspberry Pi 3A+/3B+ and another to fit Raspberry Pi Zero 2 W (the latter creating a less expensive unit). “I didn’t want the glue logic that facilitates the bus communication with the available GPIOs to get too extensive and I wanted to avoid Complex Programmable Logic Devices and such which would prevent many people from building their own RAD,” Carsten says.
Indeed, the project was designed so that the RAD contains the glue logic to interface Raspberry Pi with the C64 bus. “You simply put it on to Raspberry Pi like a HAT and plug it into the expansion port of the Commodore 64,” Carsten continues. “The combination of a fast SoC and a decent number of GPIOs was great.”
An explosive result
There were challenges, of course. “The biggest was getting the bit banging right,” Carsten says. “Most of the communication has to happen within a time window of less than 500 nanoseconds – most often there’s significantly less time between all signals being read and putting data on the bus.”
To make the device run smoothly, Carsten had to use multiplexers. “More signals on the expansion port need to be read/written to than Raspberry Pi has GPIOs,” he explains. The correct data had to be put on the bus at the right time to prevent memory corruption and, in the worst case, random instructions being executed by the CPU, causing a crash. “In general, to get the timing right, I needed to hit intervals at a spacing of approximately tens of nanoseconds, which I did using CPU cycle counters.”
With all that in place, it was time to chill and RAD-Doom proved a great way to do so. Most of the processing is being done by Raspberry Pi (“it’s essentially a CPU replacement where the new CPU is a one-core ARM running at 1.4GHz with its own 512MB RAM,” Carsten says). But the important thing is that the tech demo uses the C64’s VIC-II graphics chip – and works! Sound is also streamed to the iconic SID chip.
“I wanted to see how the C64/C128’s VIC-II and SID performed if CPU power and memory was not an issue,” Carsten says. “I also wanted to experiment with real-time colour dithering for the VIC-II.” By making use of Doom to output graphics and sound, he’s certainly managed to achieve that.