A BBC Micro in the Palm of Your Hand
By Nick Bild
The BBC Micro was a popular line of home computers in the UK during the 1980s, and it helped introduce an entire generation to programming. These days, emulating these machines is relatively easy on a modern computer, but getting accurate emulation running on a tiny microcontroller is another matter entirely. That is exactly what Dominic Pajak, the developer behind a little desk toy, has accomplished, squeezing a cycle-accurate BBC Micro emulator onto a Raspberry Pi RP2350 chip that costs just $1.20. The project runs on a Pimoroni Presto, a small development platform featuring an RP2350 microcontroller, a 480×480 touchscreen, Wi-Fi connectivity, and an SD card slot. It boots directly into Elite , the classic space trading and combat game, without requiring a separate computer. Users can interact with the game through the touchscreen or connect to a web-based control panel from another device. The software is based on Chris Evans' beebjit emulator, which accurately reproduces the BBC Micro's 6502 processor and associated hardware on a cycle-by-cycle basis. However, beebjit was originally designed for computers with substantially more processing power and memory than the RP2350. To overcome those limitations, Pajak ported the emulator to the RP2350's dual Cortex-M33 cores and created a new just-in-time (JIT) compiler for the Thumb-2 instruction set. This translates 6502 instructions into native ARM instructions, allowing them to execute much faster than conventional interpretation. Fitting everything in the available memory was also a challenge. The RP2350 has just 520 KB of SRAM, supplemented by 8 MB of PSRAM on the Presto. The developer allocated 4 MB of that PSRAM to compiled code and implemented software mechanisms to handle memory accesses and code invalidation without a memory management unit. The workload is split between the two processor cores. One handles CPU and hardware emulation, while the other processes graphics. The RP2350's programmable I/O hardware manages display timing and output. The initial JIT implementation ran Elite at 1.45 times its original speed. After taking some additional steps to optimize the software, that increased to 7.6 times original speed. When running at normal speed, the emulator uses only 13% of one processor core and 11% of the other. The project's GitHub repository contains everything needed to get started, including the source code, precompiled firmware, and instructions for flashing the Pimoroni Presto. Developers will also find build scripts, testing tools, performance monitoring utilities, and documentation explaining how the emulator works. The repository is open source under the GNU GPL v3 license, making it possible for others to study the implementation, modify it, or contribute improvements.This desk toy emulates a BBC Micro computer (📷: Dominic Pajak) A just-in-time compiler was ported to the RP2350 (📷: Dominic Pajak) The device can be controlled via a web interface (📷: Dominic Pajak)
↑ Back to top
Originally published by
Hackster News ↗
· rebuilt here from its own full-text RSS feed · all rights
remain with the publisher, please read and support them there.