Llamasoft History - Part 2

"Colour, Sound, Poking Around..."

6 Back in college, we finally had enough knowledge to begin making simple games. And simple they were – to the point of being ludicrously primitive by any reasonable standards. But they were our games that we had made ourselves, and there was something immensely satisfying about playing a game with your mates and knowing that it had come entirely out of your head.

I remember writing a realtime version of those Star Trek games that were popular at the time. In mine, instead of being a turn-based game, you guided the ‘Enterprise’ (a PET graphic character that was meant to be similarly shaped playing-card club symbol) across sectors of the galaxy in real-time using the keyboard, one sector per screen. Sometimes, you would encounter a ‘Klingon’ or a ‘Romulan’ (cue more PET playing-card symbols) and a firefight would ensue, with everyone firing straight and diagonal line characters at the other (‘lasers’).

Out of that grew a two-player dogfight game, in which each player controlled their ‘ship’ from opposite ends of the keyboard (a bit cramped, since the PET keyboard was tiny) and bumbled around, sniping at each another (one of the ships was just an X-shaped graphics character, so of course whoever had that was said to have the X-Wing). Ahh, you needed real imagination to flesh out your games with a little atmosphere in those days…

We spent every spare moment in front of the PET, coding up games, watching others coding up games, or playing each other’s creations. In due course, the PET was joined by a TRS-80 Model 1, which became known to us as the Trash-80. This was a Z-80 based machine, and although we were curious about it at first, it didn't appeal so much to us gamers - it lacked the PET's ‘graphics’ characters and the keyboard, although at first sight appearing to be nicer (being actually keyboard-shaped, rather than small and weird and fiddly like the PET’s) was a bit tacky and prone to double-entering. We stuck with the PET and carried on creating and played our little games.

I remember that before long I began to run into difficulty as the ambitions for my games got loftier. Everything was fine as long as there weren't many objects on the screen and the environments weren't too complex. But I wanted to have many enemies on the screen at once, and gameplay arenas more complex than just a straightforward box. But BASIC was too slow and unwieldy to do some of the things that needed doing, and although I had achieved competence at BASIC programming, I really had no idea how things actually worked inside the heart of the machine.

7 ’Ruptured’ Rawlinson was the guru of the geeks, and he had told me about some strange BASIC commands called PEEK and POKE. At first these commands seemed completely mysterious, because I had no idea what it was they actually did. I knew it was something to do with accessing parts of the machine's inner memory, and we used them mainly to try and make strange things happen by altering values in a location called, mysteriously, ‘zero page’.

We gleaned from magazines that BASIC stored some working variables in this zero page area, and by fiddling around and changing those values you could do odd things - like speeding up the flash rate of the cursor until it became a blur, or reducing the keyboard auto repeat rate so that the merest touch of a key would spew out loads of characters all at once. Sometimes, messing with these values did nothing at all, and sometimes it crashed the machine solidly. I can't say that I used PEEK and POKE on zero page to any great end, or really even knew what I was doing at all - it was all very much just voodoo… POKE about and see what happened, without really understanding why.

The problems with my games were starting to irritate me, though. I was working on a game where I wanted there to be some kind of structured, maze-like environment for the player to move around in, and it was all getting silly - I was considering dimensioning a massive array as big as the screen, and for each character I printed on the screen, storing a corresponding value in my big array for the purposes of collision checking. PET BASIC let you put a character at any position on the screen, but there was no command to let you see what was at any position. Hence my big, clunky, unwieldy array, which was as inelegant to use as it sounds. I was getting fed up with it... And then, I thought: “Well... The system has memory of its own – I know that from using PEEK and POKE. So, somewhere it must have memory for where things go on the screen...".

I sat down and proceeded to search for that memory – by using the POKE command. It took two parameters (POKE X,Y) and I knew from using it to tinker with BASIC variables that ‘X’ was a system memory ‘address’ and ‘Y’ was the value you wanted to store at that address. I knew that there was 8K of memory somewhere in the PET, and I figured that some of that memory must be used to hold a copy of what was displayed on the screen.

I POKED here, I POKED there – at first randomly, and eventually more systematically, attempting to write values in locations that fell on 1024-byte boundaries, since it seemed logical to me that system memory might be laid out according to the size of 1K memory blocks. Eventually I typed:

POKE 32768,0

…and an ‘@’ symbol appeared at the top left-hand edge of the screen. To confirm that I had found what I thought I'd found, I typed:

FOR X=0 TO 255: POKE 32768+X,X: NEXT

…and the entire PET character set appeared in neat order at the top of the screen, without a single ‘PRINT’ statement being necessary at all.

I had discovered the existence of screen RAM, and in doing so taken my first step towards real understanding of how the machine really worked, and away from the limitations of BASIC...

8 This was immediately absolutely superb for games. No more messing around uttering strings of cursor-positioning characters - you knew the screen was forty characters wide, you knew that location 0 of the screen was at 32768, and so placing a character with code ‘N’ at location ‘X,Y’ was as easy as POKE 32768+(Y*40)+X,N. And best of all, you could find out what was at a particular screen location by using the opposite PEEK command, so there was absolutely no need for the clumsy arrays I had been playing around with. It all simplified down to moving numbers around and being able to look at what numbers were already there.

This led to a whole new set of games we could write, with complex environments and lots of enemies on screen at once. One of the games we made was called Rhino, where the player had to manoeuvre for as long as possible to avoid enemies that constantly took steps towards him, in a vaguely Robotron style (the advancing ‘Rhinos’ were represented graphically by using the PET's Pi character). Another involved trying to bounce a ball towards a target using diagonal lines as ‘bats’ - you could have hundreds of bats on the screen at once and the ball would deflect through them all. We even arranged for a little bit of extra chaos in the gameplay by having the bats flip to their opposite state whenever the ball (PET character #81, bless it) hit one. The trajectories thus generated were complex and interesting.

We called that one Deflex.

Our code, of course, became incomprehensible. The price of this new power was readability. When things had been done using PRINT statements, it was at least fairly obvious what we were doing. Now, our code was just control structures and lots of arcane PEEK and POKE statements. Knowing how baffling PEEK and POKE had been to me before the Great Glorious Moment Of Understanding, I know our PET code of that era would have looked baffling indeed to any normal BASIC user. We were becoming machine-specific.

9 My social life, such as it was, now revolved totally around geekdom. Every morning I would get the early bus to college (or, if the weather was nice, cycle the eight miles or so on my bike, listening to music on a crappy mono tape deck I'd bought from Dixons, along with a pair of new-fangled ‘Walkman’ headphones). Park bike, lock bike, make a beeline for the computer room, settle down to bang out some code, listening to Gary Numan on the crappy mono tapedeck. Eventually the others would show up – Mole, Rup and Clovis – and our normal routine of coding and playing would resume.

We had the machine to ourselves in the early morning and after college at night, but during the day, access to the machine was determined by a timetable. Every Monday morning there was a stampede of geeks as the week's timetable was posted up in the computer room – everyone could claim two half-hour slots per day, and it was important to get there early to claim the prime slots for oneself. I once bumbled straight into a teacher whilst I was running to get to the booking sheet, and received the worst punishment I ever had at college – banned from using the computer for a week! I was bereft.

Most lunchtimes when we weren't coding we'd bunk off and go down town, either to play Space Invaders at Harlequin, or to find games available elsewhere – upstairs in Woolworth's was good. In the electrical department could be found loads of tellys upon which Terry Griffiths was winning the Embassy World Professional Snooker Championship, and laid out amongst them were the game consoles of that era – bright orange Binatone ‘Pong’ games, SIMON, Merlin, an oddity called Star Chess… We'd loiter there buying nothing and fiddling with the tech.

Downstairs was the record department where every now and again I'd buy the latest Gary Numan single. There was a slightly serious little computer shop up at the top of town that we once went and poked our noses into. They had a PET in there and I remember loading up one of my games – a version of the same Star Chess game that I'd seen in Woolworth's and thought it might be fun to code.

The bloke in the shop asked me if I'd ever thought of selling it – which I never had, of course. Our hobby was pretty much unheard of out in the world at large, and the only others I knew who were into it were part of our little gang of geeks. We made games for each other for the fun of it and to learn, and there was no more thought of making money from it than one would think of making money from building Airfix kits or going fishing by the canal on a Sunday afternoon. We used to joke and wonder if one day in the distant future you'd be able to buy computers in Tesco like any other household commodity, but we didn't seriously believe it would ever happen. What we did was just too obscure. So we thought…

10 Weekends were a forcible interrupt to the coding flow. I would dearly have loved a computer at home, but these were pre-Uncle Clive days, and a PET would set you back a good six-hundred quid – far too expensive for a schoolkid with no income like me, and my parents certainly weren't rich enough to buy me one or interested enough to buy one for themselves. In fact they thought of my passionate interest as just another passing fad – like most kids, I'd regularly had intense periods of interest in a subject only to move on to something else a few months later.

My fellow geeks all lived in or near Basingstoke and I was out in Tadley, so, during these computer-detached weekends, I amused myself in other ways. I'd go out for long walks with my non-geeky mate James Lisney (the Baughurst Piano Wizard), usually ending up at a country pub for a quiet bit of underage drinking. Or I’d go down to Southampton to see my gran, and have a bit of a mooch around town there, fiddling with the Pong machines in the shops, keeping an eye out for Space Invaders machines to hone my skills on, going to the cinema... I remember seeing Battlestar Galactica in Sensurround at a Southampton cinema. I was so impressed with the way my guts vibrated to the roar of Galactica's mighty engines that I went back the following weekend and saw it again.

My dad worked "behind the wire", as many people in our small town did – at the huge, sprawling compound of the Atomic Weapons Research Establishment at the edge of town. It was never entirely quiet in our town even in the dead of night - the AWRE emitted a steady background industrial rumble at all times, and you could lie in bed at night and listen to the ticking of the criticality alarms guarding the reactors.

Having a parent working behind the wire brought certain privileges – access to sports facilities at one end of the compound, which was built on the site of an old WWII airstrip (I think everyone in our town at that time took their first unofficial driving lessons on the remaining bits of runway). Young kiddies were treated to an annual Atomic Christmas Party where they got to meet Santa and were given presents, and for us older ones there was the Rec. Soc. (short for ‘Recreational Society’) where they had a small cinema and, best of all, a subsidised bar where you could get cheap beer (government-sponsored underage drinking – class!) and where there would usually be a couple of coin-ops deployed.

One day, my brother came home from a session at the Rec. Soc. talking most enthusiastically about a new game they'd got in: “Like Space Invaders but there are all these little flies, and they peel off from their squadron and swoop down on you!”. Of course, I had to get on my bike and head over to the Rec. Soc. immediately to check out this novelty…

There, I found a lovely tabletop Galaxian machine (oh, how I miss tabletop videogames - they were so lovely, and just right for sitting with a mate supping a pint and having a nice two-player game) and I remember how impressed I was with it. Colour was rarely seen in videogames at that time, and even when it was it was usually via the Space Invaders method (strips of coloured plastic overlaying a monochrome display – hardly hi-tech stuff). But in Galaxian, colour was encoded into every pixel – bright yellows and reds and blues and purples – and the action took place against a smoothly scrolling backdrop of twinkling multi-coloured stars. Astounding stuff for us PET hackers used to the limitations of a monochrome display and a fixed set of ‘graphics characters’.

The gameplay was sweet and much more flowing and intricate than the monolithic march of the Space Invaders. The brightly coloured, almost jewel-like insects hung in a buzzing swarm at the top of the screen, and just as my brother had described, individuals and groups would detach from the swarm with long looping trajectories, emitting strange warbling noises and raining sprays of bombs down on your ship at the bottom. They weren’t above taking the kamikaze option and ramming straight into an unwary player, either.

Gone was the saucer and shot-counting, and instead there were bright yellow ‘squadron leaders’ – destroy one of these when he was attacking and you would earn extra bonus points and a brief respite from the swooping attacks and rain of bombs. Pick off his wingmen first and then nail him for a nice fat 800-point bonus.

I spent many an afternoon happily hunched over that machine, either alone or opposite my brother or the Baughurst Piano Wizard, refining my skills, learning the little quirks of the game, tricks like destroying an enemy without actually firing your shot – simply touching the attacker with the nose of the ship. The cadence of the attacks was similar to Space Invaders, with the end of each wave being a frantic struggle to survive as the remaining enemies left the fleet entirely and continually swooped down the screen until finally you picked off the last one and there was a glorious moment of silence and completion before the next rack of Galaxians appeared, emitting their droning thrum.

Sound and colour… Smooth motion unconstrained by an underlying character matrix... These were things us PET geeks could only dream of, and seeing games like Galaxian put us firmly in our place. We could make little games for fun, sure, but they could never equal the wonders of proper coin-op games. And besides, I was running into more problems with my games. Again…

Also published by: Way Of The Rodent

Beam me up Scotty!