________________________________________ / \ | RUBIK CODE: LAMBDA 8300 CONVERSION | #### | Original Spectrum game by Andy Jenkinson | # # | for Jim Waterman's 2021 CSSCGC | # # | This conversion by Jim Waterman | # # # # | for Andy Jenkinson's 2022 CSSCGC \ # # \___________________________________________\ ## ## ## # # # # Kek === What is it the cool kids on the internet say? "Trololololol". With one Lambda 8300 conversion of an old Spectrum type-in safely in the bag, I turned my hand to a second, lengthier conversion. And what would make a better April Fool than to send this year's host a demake of HIS OWN GAME? After all, when I was in charge of the CSSCGC, I made sure to point out that Andy's original Rubik Code was strikingly similar to my conversion of Game I from the Casio MG-777, which was (along with Games II and III) entered for the 2020 competition. So, in a way, I'm returning the favour, having a laugh at the same time, and contributing further to the meagre amount of software that was ever written for Hong Kong's slightly-enhanced ZX81. It's Andy's own fault, really, because the original Rubik Code on the Spectrum used some diagonally-divided UDGs, which are (as luck would have it) built into the Lambda 8300's ROM. And as soon as I'd seen these on EightyOne's virtual keyboard layout (Graphics+Shift+S/D/F/G), I had this idea. Loading ======= It isn't difficult. EightyOne emulates the Lambda 8300 - select it from the "Others" tab under "Hardware", make sure the 16K RAM pack is enabled, and that Colour: "Lambda" is selected (or it'll all be in monochrome and that won't do). Also, under "Advanced Settings", make sure the 60 Hz Frame Rate is enabled. (Hong Kong's electricity supply is 50 Hz - but select 50 Hz, for a laugh, and see what happens. I dare you.) Drag the .P file onto the virtual tape recorder, type LOAD "" and ENTER (yes, it is ENTER on a Lambda, not NEWLINE) and off you go. Gameplay ======== Your mission, which is NOWHERE NEAR AS DIFFICULT AS ANDY SAID IT WAS last year (and I should know), is to turn the grid of numbers so that they all show 0. Use the square of keys Q/W/E/A/S/D/Z/X/C to move the numbers - five of them will increase, i.e. all those in the same row and column as the letter you've picked. Press Shift and the letter to decrease the numbers instead. i.e.: 2 2 2 3 3 3 3 3 4 Shift+Q D 2 3 3 <------- 3 3 3 -------> 4 4 4 2 3 3 3 3 3 3 3 4 Programming notes ================= This was programmed in a single day (25 March 2022), albeit that Andy had already done the heavy lifting for me, i.e. *writing the original game from scratch*. All I had to do was translate it (and it wasn't too hard, a bit like from Danish to Swedish, rather than, say, Danish to Arabic). If I spent more time on it, I might have tried some machine code in place of some of the BASIC routines, but it's quite hard to do what I need to do without an external assembler that speaks Lambda-ese (and can automatically dump a machine code program into a ready-prepared REM statement). This conversion is as visually similar as I could get it to Andy's original, bar a slight addition of extra text to the front page. But, due to the nature of the hardware, there have had to be a few compromises! (1) It's VERY SLOW! This is an enhanced ZX81 after all, it has SLOW and FAST commands, and it runs in SLOW mode, so that you can see what's happening on the screen. There is one exception to this... (2) Andy's "jiggle text" routine (where characters were scrolled up and down by one pixel) wasn't possible to implement - it's ROM characters only here, but I did re-use the lines in the 2900s to convert string variables to inverse. (3) "MOVES TAKEN" requires an = sign as THE LAMBDA HAS NO COLON. (Did it have bowel cancer? Kek.) (4) The rendition of "Ode to Joy" (Andy's Beepola arrangement of it, even), which hails a successful solution of the puzzle, is intact! But it's reduced to one voice because this is all the Lambda provides, and it has to be done in FAST mode or the tune will be horribly distorted. Still, it does show off the Lambda's MUSIC command which is as easy to use as the 128K Spectrum's PLAY, if not quite as versatile (it has only three octaves, but that's enough for us). (5) The Currah Microspeech has been banished to the shadow realm! And there was much rejoicing. There are a few other idiosyncrasies, seeing as this has been effectively translated into a slightly-extended ZX81 BASIC: (1) Owing to the more "standard" (i.e. no K/L cursor) input system, the Lambda doesn't need LET when defining variables. That saves a few bytes. (2) Multi-statement lines were broken up. At the risk of repeating myself, the Lambda doesn't have a colon. (One of the games-graphics is in its place.) This does mean a few extra subroutines, say, if there were multiple tasks to be performed in an IF...THEN statement. (3) There is no READ, DATA or RESTORE, hence the Big Font has to be generated from a string array instead. Even PEEKing characters stored in a REM statement was not a viable option as the Lambda deletes spaces from REM statements unless they're POKEd in manually! (4) There are no lower case letters, but use of the SHIFT key with Q/W/E/A/S/D/Z/X/C to decrease the numbers can be achieved with CHR$ - "LINE NO." (Shift+X) is a control character. (I used CHR$ for all nine.) (5) POKE 16418,0 allows the use of PRINT AT 22,X; and PRINT AT 23,X; to print in the INPUT area. (This is standard on a ZX81.) (6) The "Guru Meditations" (i.e. weird error reports) from the Spectrum version are intact - all of these correspond to a report between 0 and F as they are on the ZX81 (it's all there in the manual...), except for the unique report "MF", related to an error in the MUSIC command. (7) The Big Font has an apostrophe, which the Lambda doesn't. I've used the racing car (Graphics+Shift+A) to generate it... (8) Quit from inside a game, and you'll get the full-screen message of the original... which I've changed. The scrolling text for both "quit" scenarios has also been extensively altered. This is nothing to do with programming. Read the text and you'll see why I did it. NOTE: this full-screen message is also slightly discoloured where a character is printed at the far right edge of the screen - squares which are supposed to be blue (INK 1 - PAPER is set to 0 for the entire listing), representing the under-character shading, instead have the main colour bleeding into them. This is an unfortunate quirk of EightyOne's emulation, as I've loaded the .P file into JSZeddy (an online emulator with a Lambda mode and a useful ZX81 inbuilt assembler: http://rullf2.xs4all.nl/jszeddy/jszeddy.html) and it appears fine there. Coda ==== Apparently, the Lambda found some success in Denmark and Norway, of all places. While it might be seen as a lost opportunity for an upgraded ZX81 that it wasn't more popular elsewhere, would you have chosen one of these over a Spectrum? Thought not. - JRW 25/3/2022