BBC Micro

Finding a BBC Micro Emulator I Really Liked Became a Quest…

… or why I ended up working on two Beeb emulations for different platforms

TL;DR

Here are the links to the two projects I worked on.

Introduction

I've written before about my BBC Micro. Like a lot of people I had a yen to take a step back and explore retro computing. Some people like the original hardware, but for me it's too bulky to have it setup at home. So, I've been more interested in emulations on modern platforms.

Web Emulations

The easiest way to get started with BBC Micro emulation is definitely the web emulations. I really like JSBeeb a very convincing emulator and nicely presented. The spin-off project Virtual Beeb which runs JSBeeb in a 3D environment is very special and does invoke strong memories of using the real thing. It's an amazing example of what can be done in the browser now.

Lastly I want to give a shout-out to the BBC Micro Games Archive for offering integration with JSBeeb so you can plan games in one click. Great for exploring.

BBC Micro on MiSTer (Part 1)

Nice though the Web options are, somehow they aren't the same as a dedicated computer. My ideal would be something stand-alone and compact with the same "instant on" feeling that a real BBC Micro has.

I really like the potential of ASIC-based emulation to give "gate accurate" emulation for multiple machines, so my first choice was to look at the MiSTer BBC Micro Core .Unfortunately what I found was that the core (at that time) was a "games jukebox" with notable issues if you wanted to use it for anything other than playing popular games, and even for games there were major titles like Revs (still not working at time of writing) and Elite (now fixed) that didn't work.

To be honest I was disappointed. Many people, myself included, loved the Beeb but the MiSTer implementation didn't have the same quality or attention to detail as the best software emulations.

So I thought maybe I can help fix some of the rough edges in this project. After a bit of work I found what I thought was a pretty elegant solution to fix Elite and potentially other mixed-mode games. Unfortunately the maintainer didn't agree with my fix and I got discouraged and gave-up.

Pi Pico (Part 1)

With my MiSTer abandoned I went searching for other solutions. When the Pi Pico came out I was really struck with the demo of the Pi Pico running a Beeb emulator with very little external hardware (just a break-out board to VGA essentially). I was intrigued by the potential of the Pi Pico and wanted to have a go with that project.

Initially it was a bit of a struggle to work out how to build the project, but with that resolved I got the project going. The gotcha that isn't immediately obvious is that by default the project doesn't let you connect a USB keyboard directly to the Pico. It needs an external device, typically a normal Pi, to convert the keystrokes in to serial characters. That failed my requirement for the project to be stand-alone.

As a build-option the project can support USB keyboards on the Pi, but the documentation wasn't exactly encouraging about the quality. In the end it didn't matter as I could never pin-down which version of dependencies (particularly TinyUSB) was right to build the USB support option. This was further complicated because TinyUSB had changed their API for USB hosts shortly after the project was written so that code was not compatible with latest versions of TinyUSB.

I got busy again and modified the project to use the latest TinyUSB API which allowed me to do a successful build against the latest version. Initially joy - everything seemed to work fine, but then despair as wrong modifier keys were being detected intermittently. As far as I could tell the modifier key problem was in the TinyUSB code, and I couldn't see any easy approach to go about fixing that.

So, again, my quest reached a dead-end.

BBC Micro on MiSTer (Part 2)

While working on the Pi Pico project I had got to know a bit the friendly and helpful crowd on the Stardot forums some of their projects. In particular David Banks ("Hoglet") had put a lot of effort into BeebFPGA to create a very accurate and portable emulation. BeebFGPA supports multiple platforms, but not the MiSTer. However, it actually does have a common root with the emulation used in MiSTer and has a lot of commonality. I thought that it BeebFGPA could be ported to MiSTer then that would be a big improvement over the official core.

Given my previous setbacks with MiSTer I decided to do this as a personal project that was optimized for my requirements. The MiSTer core I created uses code originally from the official core (to interface with the MiSTer API) and from BeebFPGA (for the emulation). The main changes to the emulation are to rework the IO, including the video, to work with the MiSTer framework.

I am very pleased with the result. It is much more accurate and "Beeb like" than the official core.

BBC Micro on Pi Pico (Part 2)

In the meantime, I got a message that work was being done on TinyUSB to improve the USB host implementation on the Pi Pico. I went back to my code and rebuilt against the latest version of TinyFPGA and happily all the keyboard bugs seem fixed!

Conclusion

So, I now have two options for my stand-alone hardware Beeb emulation. The MiSTer based option is much the more accurate and feature rich. The Pi Pico option is good considering it was pretty quickly done and I think could be impressive with more work, but for now it lacks finesse, but it's fun to play with.