#================================================================#
[ ___ __ _ ______ ______ ]
[ | || || | ______ | __ | ________ | | ]
[ | || || || _ || | ||| || | ]
[ | || || || | ||| |__|||__ __|| | ]
[ | || || || | ||| | | | | | ]
[ | || |_||| | | | |_ _| ]
[ | || || | | | |__| ]
[ | ||______|| | |__| __ ]
[ |__________| |______| |__| ]
[ ]
[ === P R O B A B L Y P R E S E N T S === ]
[ ]
[ ILLUMINATI: 2021 WOOT! EDITION - by Jim Waterman ]
[ Original 16K ZX81 version for CSSCGC 2020: 24-26 November 2020 ]
[ This 16K Spectrum update: 1 October & 13-14 November 2021 ]
#================================================================#
Context
Behind the scenes during my tenure of the 2021 CSSCGC, I've been converting some of my previous entries from non-Spectrum computers for the Spectrum, some of which will be unleashed on the unsuspecting host of the 2022 competition. I thought I'd save one of them for WOOT! Tape Magazine, though - and I figured that Illuminati was as good a choice as any. Not everyone in the Spectrum community was a ZX81 aficionado back in the day, so why should they miss out on "a ludicrously over-polished game" (by ZX81 CSSCGC standards, anyway) "for an equally ludicrous concept in the most ludicrous year" (which 2020 most certainly was, just not for the reasons that the doomsayers of 30 years previously were telling us).
Seeing as this was a ZX81 game, I thought it would be a reasonable target if I tried to make this work on the 16K Spectrum. The original took 9,022 bytes of wobbly ZX81 external RAM. Then I remembered that the ZX81 takes 768 bytes of screen memory, and the Spectrum takes 6,912 bytes - and thus has only 8,828 bytes for BASIC. Cue a lot of cramming - bits of the original ZX81 BASIC listing were turned into machine code to save memory rather than speed it up (although it does that as well), other routines were completely rewritten, and turning the entire listing into a series of NOT/SGN/INT PIs and VALs, the way it used to be on the 1K ZX81, saved an entire 1K ZX81's worth of memory and more. With the listing down to 6,203 bytes, now I could start enhancing it with extra Spectrum features...
...in short, you get some colours - six different schemes, only one of which is any variation on monochrome - and sound effects, which have mostly been plagiarised from existing Spectrum games in days of yore. If your name is Martyn C. Davis or Michael J. Levers, you may recognise them. I'm not that good with CALL 949 routines yet, that's why.
I can barely cram any more into the half-cut Spectrum, and had to do even more surgery on the variable names to get it to fit, after realising at the 59th minute of the 11th hour that I had to move all the UDGs 32K higher up the memory if I wanted the title and pyramid to display correctly on any other model! At least there were 12 bytes spare in the UDG area for a quick LDIR...
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 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 85 bytes of Z80 machine code. Once the codes reach the top of the pyramid, if the final hex byte matches the one displayed above 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 palette 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
There isn't a lot to see here, given that it took a total of two evenings and one full day. This is still far more than most CSSCGC entries ever get, but I don't do things by halves.
24 November 2020:
- Drew the screen, and developed a crude BASIC method of generating the pyramid (to check the results against machine code) on a Spectrum, so I could use a combination of BASin, Fuse, Spectaculator, Spin and Notepad++ to get everything right, as entering lines into a ZX81 on EightyOne is a fair bit more laborious.
25 November 2020:
- Worked out the machine code routine to generate the pyramid on the ZX81. It's a bit simpler as A-F are immediately after 0-9 in the character set. Also discovered which final combinations in the pyramid are possible: the first digit will always be 8-F, the second will always be an odd number (inc. B,D,F). This gives a total of 64 possible combinations of the 256 two-hex-digit bytes.
26 November 2020:
- Everything else. Tested the machine code routine, and once that was going, the rest of the game practically built itself. Wrote the routines to input the three hex codes, check that they're valid, propagate the pyramid - most of that had already been done on a Spectrum during the initial testing of the machine code - then see if we've won or not. The instructions and ludicrous backstory were bolted on right at the end when everything else was done.
And then there was the further development of this version, which was more of a problem than the original once I'd decided to cram it into a memory space about 6K smaller than the expanded ZX81...
1 October 2021
- Made Spectrum versions up to V0.3 (still in 48K) where this is effectively a Spectrum port of the ZX81 original, with ZX81 dithered graphics defined as UDGs (even the ones we don't need), CHR$ and CODE changed to account for the Spectrum's different values for 0-9, A-F and a-f, and the machine code rebuilt to simplify the process from initial POKE of the input to PEEK of the result (with the same results as the ZX81 had).
- V0.4 optimised some of the lines with multiple statements - this is a minor process.
- V0.5 optimised the pyramid building process in a way that was not available to the ZX81, using a series of DATA statements to hold the PRINT AT positions of the boxes on the pyramid and which ones are to be filled next. (Thinking about it now, I could have put that in the initial REM after the machine code, but what's done is done...)
- V0.6 was intended for transfer to the "main machine" (i.e. not BASin) by amputating all the BASIC that generated the machine code and UDGs so that they could be loaded in externally, and see if it is possible to fit this game into a 16K Spectrum. It was... just about, with less than 1K left to implement all the extra embellishments I had planned.
13 November 2021
- V0.7: Came back to this to finish it off. Rewrote the ROT13 routine in machine code and it works - that saved a few bytes! (42 bytes of MC at 32404.)
- V0.7a: Scrunched the entire program into about 1.5K less than it was by using the old 1K ZX81 technique of NOT/SGN/INT PI and lots of VALs. Only GOTO and GOSUB numbers survived!
- V0.7b: Stored all the data for building the pyramid (was lines 2300-2390 in V0.5) as single bytes of code. (50 non-MC bytes at 32354.)
14 November 2021
- V0.8: Started on the Spectrum enhancements. Added the six different colour options - although only one of these will have more than two colours on screen at once!. Used USR "o" to USR "r"+7 to score the colour codes for each one.
- V0.9: Added the sounds - adapted some machine code routines from M.J. Levers' Defender (Sinclair Programs, July 1983) and from Martyn C. Davies' Starfire (Virgin Games, 1983) so that the same routine will make long rising or falling tones (as in Starfire) or short ones (as in Defender, or the SAM Coupé's ZOOM command). As many sounds as possible were added before the dreaded "4 Out of memory" error report appeared!
- V0.9f - the last one that worked before making the tape version. Needed an extra routine to LDIR the ZX81 graphics to 65368 on any other model than the 16K Spectrum. Has 530 bytes spare at the end of a successful game (i.e. with all the variables defined and the longest final version of w$). That's within 100 bytes of the computer crashing when it runs again and tries to load the code from microdrive (which admittedly does not appear in the final version).
Share your thoughts about the article