Looking through your guide, it did occur to me that I might have to do an "add 1"/"sub 1" instruction for INC and DEC. It's good to know about the DBRA ending at -1 as well - at least I'd know to decrease the count from Z80 code by 1. Provided I remember, that is...
Anyway, this is what I've been making these last few days that led up to me making this thread in the first place:
I'm thinking of making an official Illuminati Project where I convert one game to as many machines as I can. The QL is third in the list - after the
ZX81 original that was entered for the comp.sys.sinclair Crap Games Competition in 2020, and the
16K Spectrum as part of Dave Hughes' annual WOOT! Tape Magazine at the end of last year. And it was specifically 16K - I set myself a challenge to package an improved version of the game (with colour and sound) into a machine that had around 6K
less available memory.
...the Spectrum version is showing off the glorious QL colours, out of six colour packages available.
The QL, even the smallest model, has no such concerns - so I thought I'd play to its strengths and beef up the graphics, as much as I could with the standard commands. Because the ZX81 original was so blocky (out of necessity), I saw no problem with using MODE 8, so I had to go all-out on using all the colours.
As a brief overview of the game, you have 16 attempts in which to "do a Wikileaks" on the Evil Lizard People's innermost secrets, by matching the hex code shown in the Evil Eye with the one that reaches the top of the Pyramid Of Power. You must enter three hex codes - which will propagate up the pyramid, according to the Illuminati's Top-Secret Calculation Formula. This, at the first attempt, was a DEFined FuNction written in SuperBASIC - but, as the ZX81 and Spectrum both used machine code to achieve this... "encryption", I thought it only right to do the same for the QL. Hence, I had to learn just enough 68008 opcodes so that the QL would perform the same job as the ZX81, in its own language.
If I do launch the Illuminati Project, this shouldn't be too hard to convert for other Z80 machines such as the Amstrad CPC, MSX series and Oric, even though I have barely one day's experience of programming the first and none at all of the other two. Still, it can't be hard, can it? Worryingly, though, my next target is... the VIC-20 (given a bit of extra memory). That would involve learning a limited amount of 6502 machine code, and I am led to believe it doesn't have quite as many registers to choose from as the Z80, let alone the 68008. Still, it'd be simple to make a C64 version from there.
The downloads are below - I've sent this game to Andy Jenkinson for the 2022 CSSCGC, but he says it's OK for me to post it here as well, where actual QL users will see it. It's designed for the original black-box QL - I wrote it with QemuLator, and if you're running it with QPC2 you'll have to find a way to slow it down to regular QL speed (which I am so far unaware of), and you'll need to change the LBYTES command to run with something other than mdv1_. Other than that I don't think there's anything that would stop it running under QPC2's S*BASIC (I always make sure to use END FOR instead of NEXT these days, for instance).
QLluminati.zip isn't a QL-zipped package, it's a regular ZIP - extract it as you would on a PC. There's a .MDV image for those who can still use that, and the game files ILV20_BAS and ILV20_BIN are held in the folder "files". Nobody here will need the loading instructions, that's just for QL noobs. The second package, files2.rar, is for those who really can't work out how the Illuminati's Top Secret Code works - or who can't be bothered to disassemble the machine code! ILV12_BAS is the final iteration of the SuperBASIC-only version of the program, which makes it a lot more obvious how it works, if you can untangle the line that performs the calculation. And if you're still stuck, there's a keygen program on there as well (which requires monitor mode).