I don't know if anybody is still here, but there is finally some news.
As you may or may not know, I was a bit at a loss when it came to how to continue this project. The problem was that writing drivers for USB devices from scratch that actually work with the myriad of devices out there, game controllers in particular, turned out to be impractical. Also, the H3 chip would not be with us forever, and the question loomed of how I would continue at the point when we would have to switch platforms and I would have to write all drivers again. So I tried to create a Linux-hosted version of Engine BASIC that, unlike the relatively popular bare metal version for H3 SoCs, is run on top of a Linux software stack.
It was a huge failure. Nobody liked it.
Sure, it was easily portable and had good hardware support, but it was heavy; the image was huge, and it took a long time to boot. Those things might have been fixable, but there was one thing that I couldn't get rid of. Nobody mentioned it, IIRC, but I noticed it very much: The whole system felt pudgy, smudgy, rubbery. You could feel every pixel slither its way through the software stack, SDL, GLES, DRM. And as much as I tried to mitigate that issue, I just couldn't do it. I never got it to feel right.
So I pondered all sorts of things, from pushing on with the Sisyphean task of getting all these ridiculous USB devices to work all the way to going back to the ESP32 and giving up on a zillion features developed since. Eventually I just gave up.
Life went on, and at some point I found myself with a new job as maintainer of the super long term support Linux kernel at the CIP project. There I met Jan Kiszka of Siemens who, among other things, is the lead developer of a very intriguing project called "Jailhouse". Jailhouse is a type 1 hypervisor that allows you to concurrently run a Linux system and a bare metal embedded application on a single chip at the same time.
Frankly, it sounded a bit too good to be true. If that actually worked I could run Linux on one CPU core to do all the boring stuff that didn't need to be real-time but had to be there. File system, USB input, networking and all that. And on the other three cores I could run Engine BASIC bare metal, real-time, with its own display and sound drivers.
Unfortunately, it turned out a bit difficult to get Jailhouse running, even though there is an example build for the Orange Pi Zero. I wasn't sure if it would actually work in the end, so I didn't put all my energy into getting it to run, but at some point I figured out what prevented it from working, and I ported Engine BASIC to Jailhouse.
It worked brilliantly.
Of course it took a while to iron out some issues, and to tear down all the security measures that Jailhouse has in place for its serious business and that we don't want for a system to play with, but it was absolutely worth it.
I dubbed the new system BASIC Engine RX. It perfectly divides the job between Linux and Engine BASIC, and it boots in a (hopefully acceptable) eight to nine seconds. It doesn't completely solve the portability problem; switching to a new platform would still require new display and sound drivers, as well as a few other assorted bits and pieces, but that's a far cry from having to rewrite the entire thing.
Considering that it's been such a long time, the set of new features and fixes is moderate, but there is still a lot of stuff to enjoy. Just like in the ill-fated Linux-hosted system, you can run shell commands from BASIC using SHELL
, and thanks to greatly improved ANSI terminal emulation you can even run stuff with fancy text interfaces, like Midnight Commander. You can use DTBLOAD
to load device tree overlays and get weird hardware to run.
There is now support for pretty much every game controller (that was the original point of this odyssey, after all), even more than one at a time. I have tried XBox 360, DualShock 4 and generic DragonRise controllers, but most stuff out there should work. (Tell me if it doesn't.)
There is almost-working WiFi support (hardware support is there, but there are no working BASIC commands to set it up yet, and doing it on the Linux command line is notoriously difficult, albeit possible in theory). For wired networking, the network commands now actually do something. You can NET UP
, NET DOWN
and WGET
.
There are numerous bug fixes, and the text screen now runs double-buffered, getting rid of the funny cache artifacts that you would see when scrolling. 1080p text screens now don't hang the system anymore. GOSUB
in direct mode does something, UTF-8 characters in comments don't get corrupted anymore, and the Caps Lock key now actually works.
BASIC will now remember if your program had line numbers when you loaded it, and if it didn't, it will not include them when saving. I have improved help text formatting and updated the translations.
The default text editor is now JOE, and you can select any of the various editors included if you prefer something else. It is also possible to edit the program in memory using the text editor now, using EDIT
without parameters.
Oh, and FakeTime is back! Just like the venerable ESP8266 BASIC Engine, the Orange Pis don't have batteries, so I brought back the time-guessing feature that makes sure that time on your BASIC Engine is monotonic and you actually know which files are the most recent ones.
Loadable modules, as well as the entire system itself, can now be debugged from the Linux command-line over the serial console or an SSH connection.
But my favorite new feature by a country mile is screen recording support. You can press Scroll Lock, and the video and audio output will be recorded to a file on the SD card, as an AVI file with H.264 video and raw PCM audio. Everything is done in hardware, the color space conversion on the Engine BASIC side, and the encoding and multiplexing on the Linux side. You can even plug in a USB microphone, and your commentary will automatically be mixed into the audio stream. The format is compatible with YouTube, and I have already uploaded a video to my channel: https://youtu.be/RPNdoYD1sAs
Thinking about it, there are actually quite a lot of new features. I don't know if anybody still cares, but at least I'm happy with it. π
Edit: Almost forgot, you can get nightlies here: https://basicengine.org/git_builds/h3_rx/