Here's a preview of the new Linux-based system, tentatively named "BASIC Engine LT". š
There are numerous new features, and also a few breakages. The most important feature, though, is portability. To demonstrate that, I have created builds for two new platforms, the Raspberry Pi 4 and the good old IBM PC, in its 64-bit incarnation. (That does not necessarily imply that RPi4 and PC will be first-class platforms from now on; they just happen to be what I had lying around here.)
Most testing has been done on the Orange Pi Lite and Orange Pi PC, with very limited testing done on a Raspberry Pi 400 and my x64 notebook (Asus F510U, with an Optimus NVIDIA/Intel graphics setup). YMMV considerably on other devices.
The H3 version comes up with a boot menu in which you have to choose the board you are using. I have included device trees for all H3 and H2+ boards that are supported, but only OPi Lite and OPi PC have been tested. (There are also device trees for A20-based Orange Pis in there; no idea if those do anything.)
On first boot, all versions create a BASIC partition on the SD card/USB stick, then reboot and install the Engine BASIC system files on that partition. Be VERY CAREFUL when using the PC version if you have any
valuable data on it! It may be wiped out if I got anything wrong with this procedure!
In case you are wondering why this new system is so big, the answer is hardware support. You can plug an infinite number of USB devices into all available platforms, and on the PC you can also plug in yet another infinite number of PCIe devices. Linux supports all of them. I thought long and hard about what to include or not, but ultimately there is a legitimate use case for virtually everything. Picking out the three devices that nobody is going to use is not going to help significantly with size, and it is all but guaranteed that someone will pop up who wants to use them immediately. You can therefore expect the size of the images to grow a little going forward as I re-enable the few things I have disabled.
The reason the PC port is x64 and not x86 is that I checked eBay Germany, and the very bottomest-of-the-barrel devices (both notebooks and PCs) are all 64-bit, so I felt there to be no advantage in supporting 32-bit devices.
If anybody is interested in porting this to another platform, the most important requirement is hardware-accelerated OpenGL ES support, which may be surprising, considering we are not doing any 3D stuff (yet). The reason is that the SDL2 kmsdrm driver uses GBM, and that only works reasonably well with hardware acceleration. It would be possible to implement graphics backends on the Engine BASIC side that lift that requirement, but those would probably be platform-specific, and that's not something I want to re-introduce.
Stuff that is new and improved:
SHELL
command. Allows you to run all that Unix goodness.
- Remote file system access; run
SHELL "sshfs <user>@<host>:<path> <local path>"
and you can access any file over the network.
- Improved text mode performance (I think; mode 20 seems to be faster than before; I haven't done any measurements, though.)
- Support for ANSI terminal commands integrated into the Engine BASIC text mode system for seamless integration of Unix stuff into your BASIC workflow. (Not 100% there yet, but works well enough for shell commands and the bundled text editors.)
- Out-of-the-box support for virtually all USB game controllers, including XBox.
- More editors. Enjoy
nano
, joe
and everybody's favorite beginner editor, vi
. (Atto is still there.)
- Saving programs without line numbers (
SAVE "foo.bas" LINE OFF
). (Only possible with Linux, I swear!)
- Automatically creates a BASIC partition on first boot that spans the entire SD card.
Stuff that is as good as it was on the bare-metal platform:
- Impossible to break accidentally. The file system is read-only, so it even survives
SHELL "rm -fr /"
. User files will be gone, of course, but the system will still be fine. Unlike the bare metal system, it will also restore BASIC system files if they have been deleted. (Only tested on OPi; do not try this on other platforms!)
- Stutter-free video output at 60 fps.
CPUSPEED
. It's still manually controlled, mostly because changing frequencies caused stuttering in the video output on H3.
- separate graphics rendering thread (SDL1 version was single-threaded)
- Most things, actually.
Stuff that technically works, but is not easy to use:
- WiFi on the OPi Lite; the driver is there, and so is
wpa_supplicant
, so it's probably possible to bring it up somehow. (Same probably applies to PC and RPi4.)
- wired network setup (run
SHELL "udhcpc"
for now)
Stuff that is expected to work, but is untested:
- GPIOs
- I2C, SPI. To use those devices, you have to use the
DTBLOAD
command on a device tree overlay (can be found in /boot/overlays
) that enables the specific controller. Then use I2CBUS
or SPIDEV
to select a bus/device.
- UARTs 1 to 3. Again, use
DTBLOAD
to enable. You can then use the standard file functions with "/dev/ttyS1" to "/dev/ttyS3" to access the serial ports.
- analog audio (will only work without HDMI display, might have issues with audio levels)
Stuff that sort of works a bit:
- TV output on OPi PC; the picture has the wrong aspect ratio; I don't have an actual TV at hand, so that might be an issue with my CVBS-to-VGA converter. Not enabled on any other board.
Stuff that doesn't work because it's not implemented yet:
- BASIC network commands
- direct hardware access; still not sure if there is a point to that or not
- borders
Stuff that doesn't work even though it is implemented:
- controller hotplugging (new controllers are not detected; make sure you boot with the controller(s) plugged in)
- mounting files on the BASIC Engine from another host via sshfs (no idea what's wrong with that; sftp is there)
Other known issues:
- Rebooting sometimes fails on the Orange Pi PC; not sure if that is a fault of my unit or a general problem.
- Sound is muted on PC by default. Use
SHELL "alsamixer"
, unmute the master channel (M key) and turn up the volume.
- The terminal emulation is lacking many features.
BOOT
command doesn't work, use SHELL "reboot"
or SHELL "poweroff"
. (Or SYSTEM
if you only want to restart Engine BASIC, not the whole system.)
- NEON is disabled for the BG engine blending/scaling code, so there may be a performance hit on ARM devices.
Downloads:
Check https://github.com/uli/basicengine-buildroot/releases for SD/USB images.