A Sinclair QL (core) Primer – WIP
NOTE: This document will get expanded as time goes on and as more questions come in and are addressed
Source
Sources to the QL Core for the Next can be found in the following location: https://gitlab.com/thesmog358/qlnext
NOTE: The QL Core is still under heavy modification and the sources may lag a few revisions behind what’s actually being worked on. Any bugs/upstream contributions that you may have should take that into account. Read the main readme.md in git for more info (if any)
Specifications
The Sinclair QL Core running on the ZX Spectrum Next has the following specifications (A ‘*’ denotes an Issue 4 only feature:
- MC68000 or MC68020 compatible CPU @33 MHz (not cycle-accurate) – Two cores per machine
- HDMI / VGA output (following the selected ZX Spectrum Next mode display selection)
- 2 Mbytes RAM (1920 Kbytes maximum usable)
- Memory Mapped Microdrive Emulation (Microdrive images must conform to the specification set by the QLay emulator) – Other mdv images supported via the MDI driver (freely available)
- AY/YM chip (QSound)
- Mode 8 with 16 colours by disabling the ‘FLASH’ bit and special PRINT and PLOT commands to address it
- Linear Addressing mode with 256 colours (Uses Minerva’s second screen) – Requires Minerva (Included)
- QiMi mouse compatibility (via PS/2 port)
- Full support for all QL keys. Function keys realised using the yellow button + numeric keys
- Next RTC support via specialised commands
- Full ESP support via special device / SER3_ alias
- QLSD software support (Next SPI Interface)
- Triple joystick/QL Net/DIY MIDI interface support (With external adapter on the joystick ports)**
- Ability to access the Next’s FAT32 FS and transfer files via SDIR, SCOPY commands
- QView/TF Services Hermes
- PCM Audio *
- 75 Sprite – Sprite Engine *
Not Yet Supported (but coming sooner rather than later):
- Aurora modes
- FLP Image support
- RPi access
- Expansion bus access
** Requires driver (included) by Martyn Hill and open sourced external hardware
Installing (or updating) the QL core
To install (or update) the QL core follow the instructions found at: https://www.specnext.com/multicore/
Starting the QL core
There are two ways to start the QL core:
- While the Next is booting press ‘C‘ and then select Sinclair QL and press ENTER
- While in NextBASIC type the command .core QL
A quick intro to the QL and QDOS/Minerva
The Sinclair QL (Quantum Leap) was designed by Sinclair Research as a powerful and low cost business machine. It boasted at the time 128K RAM expandable to 640K, twin microdrives of a higher quality and capacity than the ones offered with the ZX Spectrum, very cheap but reliable networking, high resolution colour graphics and most of all a superb (if not the best other than the BBC variant) Basic called SuperBASIC, a trailblazing multitasking operating system called QDOS and a full office suite. Due to the limitations of the time, upon boot the QL presented you with the ability of displaying stuff on a TV (which couldn’t normally display the full width of the QL’s resolution) or a Monitor (Unlike other machines of the era, the QL had an 85 column display).
Due to some design choices especially with the way graphics and screen memory worked, as Sir Clive Sinclair wanted the machine not to be associated with games, the QL was never a great platform for gaming. It was however almost infinitely expandable and over the years developed to display thousands of colours, use vast amounts of memory and connect to spatious mass storage media.
QDOS, the QL’s operating system developed by Tony Tebby, was very much like NextZXOS in the sense that it used Jan Jones’ SuperBASIC as a front end, offered a very modern (and still relevant) abstract device driver model but as with every Sinclair product a certain amount of quirks is expected.
QDOS had also several faults all of which were addressed in many versions released from its initial version. At some point, The QView team led by Laurence Reeves produced a QDOS compatible operating system with several new features (like a RTC and a second screen – the latter is important to us as you’ll see). This operating system is called Minerva and it’s the default offering for the QL core because it allows the use of a 256 colour, 256×256 linearly addressed screen by using Minerva’s twin screen feature!
The Sinclair QL core on the ZX Spectrum Next for consistency adopts some Next conventions especially re the keyboard which will be discussed below
Device names on the QL
Just like the ZX Spectrum Next, the QL uses device names denoted by a specific identifier to communicate with its devices. Whereas on the ZX Spectrum Next this usually is a single letter followed by a colon for the SD card and a combination of letters, numbers and symbols for other devices, on the QL device names are very consistently named by 3 letters and a number (usually 1 to 8) followed by an underscore.
Device Identifier | Name/Type | Number of devices | Example |
win | Winchester (Hard Disk) | 8 | win1_ |
mdv | Microdrive | 8 | mdv2_ |
flp | Floppy | 8 | flp1_ |
ser | Serial | 8 | ser3_ |
net | Network | 63 | net12_ |
scr | Screen | ||
ram | Ramdisk | 8 | ram2_ |
There are many more available and/or potential device names. These can be provided using device drivers usually by hardware in ROM format or softloaded in RAM during boot
Every device with a file system can have a file called boot on it. If it’s the default booting device and a file named boot is on it; it’s loaded and executed much like autoexec.bas is on NextZXOS
Another concept of the QL is that of toolkits; these either extend SuperBASIC (or MBasic as its Minerva variant is called), give access to a lower level in the machine, provide device drivers (the concept of softloading from ROM as discussed above) or a combination thereof.
The QL core comes with three major toolkits: Toolkit II by QJump/Tony Tebby as extended by Marcel Kilgus, Turbo Toolkit by Simon N Goodwin, Chas Dillon as well as the core’s own which gives you access to QL extensions like MODE 8 with 16 colours etc.
Below we’ll look on actually booting the QL after the QL core has taken over your ZX Spectrum Next but first let’s look at how QL keys translate on the Next keyboard.
Key equivalences
The QL has 5 function keys. If you’re using a PS/2 keyboard you’ll find them where they normally are. The Next however has no such keys so you need to use a combination: NMI (Yellow button) + the numeric key corresponding to that Function key. So for example F3 you will need to press NMI+3
The QL has a CTRL and an ALT key. These can be located at GRAPH (CTRL) and EXTEND (ALT). On a PS/2 keyboard CTRL and ALT are on their respective keys.
The QL’s ESC key is found on the Next’s BREAK key
Backspace and Delete on QL computers do not have dedicated keys; they are combinations of CTRL (GRAPH) and the cursor keys according to the direction we’re erasing. On the Next there’s one more key: DELETE which acts like a Backspace key for your convenience although you can still use the traditional way of the key combos
SYMBOL SHIFT is used to display symbols that are one text keys if these aren’t accessible with CAPS SHIFT and finally TABULATE is located on the TRUE VIDEO key
Booting the QL
Once the core starts you will be presented with a screen similar to this (this is taken from Daniele Terdina’s QemuLator)

You will need here to select the video mode you will boot in. This requires the use of function keys; that if you remember from above requires the use of the NMI button and the numeric keys (1-4 for this use).
If you want to see the 256 colour mode of the QL core you will need the dual screen mode ergo, you will need to press F3 or F4
In order to use the QL you will need to understand a few commands first; as the QL has at times a steep learning curve, we’ll list here the absolute basic ones in their easiest variants as enhanced by Toolkit 2 (see above). Full manuals of QDOS, Minerva, SuperBASIC and its variants exist online once you get the hang of it, we are sure you’re going to enjoy using a QL immensely
LOAD filespec
LRUN filespec
LOAD unlike on the NextBASIC, strictly reserved for loading basic programs. LRUN will also automatically run the program. For example:
LOAD win1_boot will load the boot file on hard drive 1
LRUN win1_boot will load AND run the boot file on hard drive 1
DIR filespec
WDIR filespec
DIR does exactly what you’d expect it to do, provide a catalog of the files on a mass medium; WDIR (Wildcard DIR) is a bit different; it can provide you with a catalog of files that conform to some criteria:
DIR win1_ will show you the contents of hard drive 1
WDIR win2_xchange__hob (2 underscores) will show you the contents of the folder xchange that end in “hob”
ew sdir,#1 (and use space to scroll) To copy a file from the SD card into the image: ew scopy;’filename_fat filename_ql’ To copy a file from the image to the fat in sd: ew qcopy;’filename_ql filename_fat’ be careful those commands overwrite without asking for confirmation (not implemented yet)