============================================== Illuminati for Sinclair QL (a.k.a. QLluminati) by Jim Waterman - 11-18 April 2022 ============================================== Loading instructions for noobs ------------------------------ These are provided in a separate file. READ THEM, if you're not already a QL aficionado. NOTE: this program has been designed to run on a standard black-box QL in TV mode - though it will set up the TV mode automatically if you forget and start in monitor mode. NOTE ALSO: this program can only be used in mdv1_ as it is; it loads externally-located machine code and contains an LBYTES command to do so. The line can be edited so that it will run from mdv2_, flp1_, dos1_ or any other QL drive, but it will only run from mdv1_ out of the box. QPC2 users are particularly advised to heed this warning. Those with a registered QemuLator with a Gold Card or Full Speed available, or who use QPC2 or other SMSQ/E systems will probably find the sound completely mangled if there's no way to slow it down. An unregistered copy of QemuLator (which only emulates the 128K machine at normal speed) is perfectly capable of running this game. Context ------- In the beginning - and by that I mean November 2020 - there was the original Illuminati, which was released to the comp.sys.sinclair Crap Games Competition, just as a way of showing off that I could write bits of machine code on the ZX81 as well as the Spectrum, seeing as I had to do so without the use of an assembler. Around a year later, the game was converted for the Spectrum, to be packaged with Dave Hughes' WOOT! Tape Magazine for that "ZXMas". Seeing as the original game was for the ZX81, I set myself the challenge to enhance the game with colour and sound, *and* cram it into the 16K model. It was harder than I thought - the ZX81 original was 9K, which is just fine when the screen only takes 768 bytes. On the Spectrum the screen takes just under 7K, so the ZX81 version, as it stood, would not fit! Routines had to be rewritten and optimised, much more than I'd originally planned had to be written in machine code, to save space more than to speed it up, there were VALs and NOT PIs all over the listing, just like a 1K ZX81, and even the variable names had to be shortened. With all these changes... there were 530 bytes remaining in the smaller Spectrum. Around the same time, I'd also tried to draw the Illuminati logo and the pyramid on the QL, just to see how it might look. In April 2022, I thought I'd convert the whole game - but initially I had to use a SuperBASIC function for the Illuminati's Top Secret Code. This makes it rather too easy to work out how it's done, so I had to stick to the original plan and do it in machine code. It was more of a necessity on the ZX81, but here was a fine vehicle to show that I could translate Z80 assembly language into that for the 68008. To my surprise, it wasn't too hard, although I didn't come across any Z80 instructions that didn't have easily accessible 68008 equivalents. As for memory concerns, even the smallest QL has 128K of memory available, so I could be as profligate as I wanted. I even RESPRed an entire kilobyte for the machine code, which was only 164 bytes long anyway. What might I do next? The ludicrous backstory (mostly copied from the ZX81 original) -------------------------------------------------------------- This was a feature of my 2020 CSSCGC games - but given that this one involves the Illuminati, there's no pressing need. You can believe in this cabal of very powerful elites manipulating the leaders of the world like puppets on strings, or not - the choice is yours. It is said that behind every conspiracy theory there is a seed of truth just waiting to be discovered (or an outright Spoiler Alert), but it's very hard not to be distracted from finding that truth when, for instance, David Icke mentions shape-shifting lizards, or Alex Jones starts shouting so furiously that his head looks like it'll explode. But anyway, the story is - the Illuminati are about to take over the world, and you have to stop them. (Paul Joseph Watson interjects here, to say "Well, imagine my shock!" the way he does. And he would be right do so at this point, because who didn't see that coming?) The Illuminati's Top Secret Pyramid has a combination lock which requires the input of three bytes of code in hexadecimal format - with a total of 16,777,215 possible combinations. Unfortunately, for them at least, they put a complete brainlet in charge of writing the code to secure the lock - who has only just read about it in a book that's nearly 40 years out of date. The Illuminati, of course, are not technically-minded so they have absolutely no idea about this, and they're far too busy plotting what they're going to do once they get hold of China's even-more-top-secret virus research labs (as if what we're STILL all being put through AFTER TWO YEARS isn't enough). Input the three hex codes into the pyramid, and they will propagate upwards according to a secret code known only to the Programmer... and anyone else who knows how to disassemble 164 bytes of 68008 machine code. Once the codes reach the top of the pyramid, if the final hex byte matches the one displayed in the Evil Eye, the lock will open, and the Illuminati will be destroyed - somehow, say, a bomb goes off in their headquarters, or the virus they're going to unleash turns out to be specifically targeted at themselves. (Or you make up your own story, it's not as if anyone's going to believe it anyway.) Either way, humanity is saved, and the people across the world danced and skipped in the street with delight, and feasted on steamed hams, and fruit bats, and breakfast cereals, and Pan-Galactic Gargle Blasters, and... so on, and so on, you get the idea by now. Look, I didn't say it had to make sense, did I? The Illuminati's security is so weak that only 64 out of the possible 256 bytes will ever result from any of the 16,777,215 hex combinations. I would assume they're spread evenly - I wrote a Spectrum program to output them all, with even more machine code than this one, but even running on Fuse at 40 times the correct processor speed, it would take two weeks to finish. You only have 16 attempts to match the code, and it changes every time you try... but this does at least mean you have a 1 in 4 chance of cracking the code overall. If this all sounds absolutely window-licking mental, it's because it is. November 2020, when the original ZX81 version was written, was near the end of a second entire month confined to my house (i.e. never venturing more than about five metres beyond my front door, just to put the bins out - April 2020 was the first); a third followed (January 2021), and I get the distinct impression that I am not going to live to see the end of this hideous mess. This has had absolutely no detrimental effects at all. Was that sarcasm? You decide. Extra bonus endorsement ----------------------- Those who want a game all about the Illuminati and weird conspiracy theories THAT'S ACTUALLY GOOD would do well to equip yourselves with a copy of Doom II, a suitable modern source port (GZDoom is the one I use), and the excellent megawad "Ancient Aliens". Points to mention are: (1) It is very hard - you *will* get mashed to a pulp, very regularly, if you play on Ultra-Violence; (2) It is very colourful - it has a completely different pallette to regular Doom wads, with bright neon lights everywhere and a lot of blue and magenta welded together; (3) It sounds *brilliant*, as every backing track was composed by Stuart Rynn, the Doom world's answer to Henri Sorvali; (4) I'm not saying it was made by aliens... but it was aliens. A second wad, Final Doomer, will add the choice of weapons appropriate to various custom megawads, and Ancient Aliens is included. Add this on top for twice the experience! Ancient Aliens deservedly won a Cacoward in 2016. Get it NOW! https://doomwiki.org/wiki/Ancient_Aliens https://www.doomworld.com/idgames/levels/doom2/Ports/megawads/aaliens Development log --------------- 24-26 November 2020: Wrote the ZX81 version. 1 October - 14 November 2021: Converted the game for the 16K Spectrum. 20 November 2021: Drew a test of the pyramid (which might be drawn the same way or could be better in the final version). 1 January 2022: Drew a test of the ZX81 logo, using Spectrum colours and the procedures for the ZX81 graphics so I know it's correct. 11 April 2022: Remade the main logo using BLOCK (don't need the ZX81 block-graphics procedures now) and some different colours. 12 April 2022: Made the routine to turn the main logo into "QLluminati", plus the title page and instructions. Converted the pyramid into something more befitting of the QL's graphics capability, with the Evil Eye now looking a lot more eye-like. Opened windows #3-17 to house the climbing hex codes in the pyramid and the target #18 in the pupil of the Evil Eye. 13 April 2022: Finished the pyramid - still needed the lightning strikes and the border. Converted the game (based on the ZX81 version but with a more Spectrum-esque way of propagating the pyramid). Finished the day with a fully working version in BASIC (ilv10_bas)... just need to learn some 68000 machine code, now! 14 April 2022: Found "Assembly Language Programming on the Sinclair QL" by Andrew Pennell (who wrote the Frogger game in that issue of Sinclair Programs I had that used PRINT VAL$ Q$). Started looking through the MOVE instructions, though it's still a bit of a mystery how I'm going to manipulate the RESPR function or the assembler so that the first six bytes are still available for the variables I need to POKE to and PEEK from. 18 April 2022: With a chunk of help from Norman Dunbar's QL Assembly Language Programming guide (from QL Today magazine, originally), the machine code to perform the Illuminati's calculations was written, briefly debugged... and it works! (A test program that confirms the correct values also helped.) Added sound effects just about everywhere (ilv11_bas). Once this was working, added the machine code to make the Final Proper Version (ilv20_bas, which loads ilv20_bin). Copied the BASIC illuminati$ function back into the Final Proper Version to make the Final BASIC-only version (ilv12_bas). Note that not everything is included in the "files" directory (deliberately), but there's more to see on the microdrive image...