When I was about 12, I printed out the entire disassembly for the Disk version of Elite on the BBC, on a dot matrix printer.
Because dot matrix paper is continuous with perforations, the printout filled much of my room, and I pored over it, writing notes and getting to learn all the little tricks and algorithms!
So I had my own fully documented source code for Elite back in the day :-)
Heh. When I was 12, I had a Romanian Z80 based computer, that would run BASIC. Because I didn’t have a tape drive for it, I was writing entire programs and then write them down on paper, and “reload” them after the computer would reset, or if I were lucky, just the next day.
At one point I figured out the opcodes for Z80 were at the end of the somewhat thin manual, and that I can read/write straight into memory. That was so much fun.
This was a lifetime ago, I hope what I remember is correct.
Later on, I got a second hand 8086 based PC, which came with a full setup: central unit, display (monochrome), keyboard and mouse, and 5.25” floppy disk drive. Oh, right, and it had a big, loud, slow 20MiB HDD. It came with some early DOS and GEM desktop environment.
On this machine I encountered the first computer virus, named Romania.856. By that time I had access to BBS through some friends, and I got to download various docs about assembler and so on. I had and loved F-Prot antivirus for its database of virus descriptions.
So I set myself to reverse engineer this virus (I had no idea it’s called reverse engineering), by using the old debug.com (or was it exe?) that came with DOS. I wish I still had my notes from back then. At some point I got Turbo Debugger too, that made things so much easier.
I was merely 14 years old, and spent a whole summer doing things like that, while other kids were doing whatever other kids normally do. I learned everything about that virus, and later about others.
There are a couple of recent (either recently released or will be released in the future) 8-bit computers that retain the fun of those old computers while giving them some modern conveniences like an SD card and some even have ethernet.
The ZX spectrum Next looks amazing. Then there is the 8-bit guy's Commander X-16 which is being built by him and many other volunteers and should be ready for Kickstarter soon. Also there is the Mega65 project which is a very similar project to the Commander X16. Also there is the Color Maximite 2, which seems to be a screaming fast BASIC computer not meant to be fully compatible with any machine that I'm aware of. Some of these are implemented on FPGA and others on actual chips and some have the keyboard/computer integrated, while others do not. Either way, I'm really excited to finally be able to buy one of these fun old machines where you can fully understand the full system and easily make simple games.
It was DEBUG.COM until MS-DOS 5.0, then it became an EXE. I remember finding it a very mysterious program as a young child, and it was only after I'd learned some programming that I started to realize what it was for. Computing was so much easier to understand back then!
Back in the day we had to use debug.com at school to program small assembler apps. Most frustrating experience ever :) The things you had to do to fix a typo...
That's crazy. When I was 12 I tried to learn assembler on BBC from a book and just didn't get it at all, even the basics. How did you even grok a printout like that?
When I was 12, I tried to program a Mario knockoff into my calculator. I wrote the program to show the first screen of my super cool game, got about as far as programming what happened when you hit right, and realized I was likely missing something (loops).
I didn't have many books, but I did have the BBC Advanced User Guide. That's the one with all those VDU codes and ∗FX commands.
Near the back there was a two page table containing a dense opcode map (the byte values) of the 6502, its mnemonics, and a tiny notation hinting what they might do.
I've just looked it up. It's the "old" book of that name, not the "new" one. See pages 502-503 of this scan: http://bbc.nvg.org/doc/BBCUserGuide-1.00.pdf Poorly scanned, but I recognise the table.
I stared at that table, intrigued, not really knowing what it was, until I started guessing what the mnemonics stood for. Gradually it made sense - after months!
Eventually I was able to guess enough to write 6502 inside BBC Basic, and some time after that I was able to disassemble binaries in 6502 and Z80 (I had a Z80 second processor), and eventually graduated to hacking games to modify them, give them infinite lives, change the keys, things like that. No doubt there was the occasional bit of assembly language in magazine listings to provide a guide to the syntax.
I don't remember having a 6502 disassembler, but I don't remember writing one either. I did receive a lot of games and utilities so I might have received a disassembler too. Hacking games that don't want to be hacked required a fair amount of dedication though, so I might have written one among the other tools needed for hacking; I don't remember.
My favourite BBC Micro hacks were:
- Poking the ULA with a non-standard palette bit pattern, allowing me to produce a 7-colour mode in high resolution (contradicting the received wisdom about what was possible to pack into the pixel bytes), and similar colour graphics quality to a ZX Spectrum. I ported a game from the Spectrum using this technique, but never published it.
- Pixel-smooth vertical scrolling by poking the CRTC on timed interrupts to modify the character height dynamically, so as to squash a row at the top and expand a row at the bottom to shift the image with pixel precision (contradicting the received wisdom that the CRTC could only scroll character cells).
- "Super mode 7", running the Teletext mode with the pixel clock set to double frequency like in mode 0. This caused the Teletext character generator to process 80 characters per line instead of 40. But instead of showing 80 characters, it showed every alternate character, while still updating the colours or other attributes from the hidden characters. This allowed clean coloured text to be displayed without gaps between different colours as Teletext normally required. Proper syntax highlighting :-)
- Mixing graphics and Teletext on different rows using timed interrupts, so as to render something like a text editor with pixel graphics in between blocks of text. This is a variation of the technique used by Elite to show a colourful status area with a higher-resolution main 3d area.
- Modulating the volume on the sound channel at high speed, to turn the sound chip into a DAC, and therefore any audio waveform we wanted.
I miss those fun days, where we could prod and poke at things and all sorts of useful magic happened.
These are some good hacks and tricks!
The good news is that these fun days are still upon us. I'm a member of the Bitshifters collective: https://bitshifters.github.io/
If only there had been an internet then, rather than just me with my books and a few years to spare :-) I guess most of us were like that at the time.
I see the 6845 still has surprises yet. Now you've made me read the Wikipedia article on it, and I learned something new, that it can be tricked into reloading the display address in the middle of a frame. If only I'd figured that out that back in the day, that would have been very handy!
I wish there was an internet back then too, one that was fast, had a good search engine or directory ... and was only online for 2 hours a day for research purposes. A 24x7x365 internet would have gotten in the way of my tinkering which was mainly driven by boredom.
We had a classroom full of networked BBC Micros in high school. I remember that the teacher had the big one with the floppy drives (BBC Master System?) which acted as a fileserver for the smaller beebs with less RAM.
One of the students in the upper year levels gave a friend and I some POKE style commands that could be used to remotely reset the fileserver. We got immense joy out of resetting the fileserver when the teacher had his back turned away from us since it would prevent disk access for the entire class.
We would then chuckle to ourselves quietly while all the other students complained to the teacher that they couldn't load/save files over the network for a minute or two. The poor teacher became more and more exasperated, but never understood or figured out what was going on. This was very funny to my friend and I, being the immature 13 year olds that we were.
We had a classroom like yours, with BBC Micros and special BBC fileserver computer of some kind, with the important school stuff on it.
My fun command was a one-liner that repeatedly remote-PEEKed the server's keyboard buffer memory and displayed it on one of the classroom computers.
One day, when the teacher went over to the special server corner to type in the server password, I quickly entered this one-liner into a computer in the main area, and lo as teacher typed the password thinking it was all very private and special, it appeared key by key on my screen. Of course all the children were watching my screen, "hey watch this...".
Yes, the folly of youth :-)
That got me permanently banned from the computer room. I didn't expect that, I thought we'd all laugh it off and tell me not to do it again. Ironically, knowing more about computers than anyone else in the school, I wasn't allowed to study computers at school or use them.
Still won a programming competition there anyway, for making a pretty demo to tell a story :-)
Oh you too! My ban came from discovering where the station number (the 8 bit number uniquely identifying each BBC Micro on the Econet network - like a MAC address) was stored in memory. I did this by the obvious technique of searching memory for this number on several machines and comparing the addresses - it was address 3361. Then I found that by changing this you could impersonate the credentials of the person logged in to the other machine, although it worked better if you also had a co-conspirator turn off their machine at the same time.
The other hack which possibly contributed was writing a kind of "broadcast NOTIFY" that sent your keystrokes to all of the other machines on the network, allowing the user to remote control all the things. The service manual I just found online says that *NOTIFY is a dangerous command which the operator might want to remove - but in fact there was a system call which did the same thing and I used that instead.
I recall the hex address being D22 (so 3362) although it's been 30-cough-something years so I could be misremembering.
I built a full-on remote hacking utility that got to the point where it would download the remote victim's RAM, upload the infamous laugh sound, play it, then restore the RAM so the victim was - usually - back to before they got freaked out.
A small group of us built a multi-screen text scrolling and image display sequencing tool for the various school open days. I still recall the nervous look on the teacher's face as we deconstructed the computer lab to get all the Microvitec Cub's lined up! Those were fun times.
I got banned a little later (in the 90s) for writing a QBasic "chat app" that worked across the school network by way of a public NetWare shared drive. I didn't even take IT as a GCSE option because having arguments with teachers who thought a PC's base unit was "a CPU" didn't seem worth it, and my disdain for "IT" (as opposed to software engineering) unfairly remains to this day :-D
Bizarrely, at University in the UK, we had a student TV station and it used a BBC Micro for caption generation. My ZX Spectrum had a microdrive attached (the new hotness, flaky as hell but much much faster than loading from tape) I remember writing something that let the Spectrum act as a fileserver for the BBC micro over its serial port. Good times.
Similar story, just replace the BBC with another national project, the ABC 800 Z80 computer. I would change the source code of programming examples on “the Winchester” which was a huge hard drive on a cart connected to the teachers master computer.
People like me never have to poke around to find anything. Everything is either answered by a Youtube video or Stackoverflow, but it only gives a surface level understanding of everything, and we become clueless when something breaks.
The computer manuals in those days were excellent, especially the more advanced manuals.
They included circuit diagrams, data sheets for individual chips, just about every detail of how the system worked.
You'd still have to figure out a lot just to understand those reference manuals, and guess a lot, especially with no internet and no good library (my local library did not have books like this!).
I only had a very small number of books. But I did have the Advanced Guide. Having so much detail available in reference manuals was great for a young mind!
Also when I was like 7-8 (edit: previously wrote 10) I was given the Ladybird book for young children: "The Computer (How It Works)".[1] A tiny book. In retrospect I learned a lot of great grounding from that book even though I hadn't yet seen an actual computer. I guess it gave me an appreciation for the video games I played with on show in the supermarket, and the pictures of minicomputers and microcomputers I saw in hand-me-down computer magazines.
I'm occasionally asked, by people who find learning this stuff frustrating, where did I learn about logic circuits, where did I learn about assembly, where did I learn about RAM and ROM, etc. and for a long time I couldn't put my finger on it. I think it started with being exposed to that book and some early computer magazines at a young age, without even seeing or touching a real machine for a year or so afterwards.
I don’t remember when the last time I worked with a computer that even had a manual as such. I think it was my TI-99/4A, but it could have been the Tandy 1000HX.
Edit: wrongola! Turns out, the last machine I worked with that had a real manual was either a MicroVAX, or a PDP-11, both of which I used in college. Writing ASM for the PDP-11 was great! I just wish I was better at program then, lol. :)
> "Cover: Schematics for a 5V, 3A regulated power supply and a
1K x 8 read/write memory block. The power supply and three
such memory blocks can be added to the basic KIM-l microcomputer
to provide the 4K RAM required by this assembler. Parts are
available from Jameco Electronics."
Cool! That's pretty impressive. The 6502 is a beautifully simple processor. I recently started learning about it from Ben Eaters youtube series[1], and have a printout of the W65C02S (a more modern variant with optional 16bit support, but full backwards compatibility) datasheet beside my bed[1]. Tables 5-1, 5-2 and 6-4 might bring back some memories :)
> Pixel-smooth vertical scrolling by poking the CRTC on timed interrupts to modify the character height dynamically, so as to squash a row at the top and expand a row at the bottom to shift the image with pixel precision (contradicting the received wisdom that the CRTC could only scroll character cells).
How frustrating that even today that is very hard for quite a few environments. I am working on something that requires a very smooth horizontal scroll of a large canvas in the browser. So far jagged edges are my lot, most tricks only work in a small subset of the cases.
Ah, browsers. Vsync timing is basically impossible to guarantee with them. It's dependent on which browser, browser version, which OS, and I suspect even which graphics card and driver (because OpenGL is affected by those).
Thank you for that, I wasn't aware that site existed, already confirmed some of my worst suspicions. What we are working on is a music application that horizontally scrolls a score drawn on a canvas. Smooth scrolling is quite essential to be able to keep to the beat (see: https://news.ycombinator.com/item?id=24615125)
Me learning JavaScript (DHTML) circa 2004: "why does this document.write(i) override the whole thing? There is no point using loops or JavaScript if the only thing I can see is the last iteration". Then I didn’t touch that language for more than a decade, even after have learned programming.
Not the same generation but I didn't have anything remotely close to a computer at that age. Still better off than pupils with a smartphone today, but having such manuals that actually do teach would be an awesome thing to have again.
When I was 12 - probably a few years before you - I didn't have a dot matrix printer so I wrote out the entire disassembly of the Vic-20 ROM in school exercise books.
That took the first few days of the 1983 summer holidays.
The rest of the holiday was spent happily analysing it and annotating my source code, figuring out how BASIC worked, including the floating point routines.
That’s impressive indeed! When I was 12ish I was just struggling with BASIC and PASCAL on PC. No documentation nothing... had to wait a couple of years to learn assembler on an hp48 and later to have a pirate version of Borland C and some books to make sense of the things I would randomly understand ... oh and I loved elite :)
Sounds quite familiar. I was 11 years and struggling with assembler on Atari ST. There was a short series of 68000 assembly basics in a Finnish computer magazine (MikroBitti) and some sources on disk magazines (Maggie by The Lost Boys).
I remember designing glyphs on grid paper and an animating a character to walk across the screen thanks to an "advanced bbc micro techniques" book I found in the library.
I didn't understand the section on 3D objects at all though! I still don't, although I did find the book and port it to C++ the other year to draw a poor-man's 3D system in wxWidgets.
The Elite code was great for learning techniques from!
I recommend everyone should read some well optimised code occasionally, and figure out how it works, to see how it's done.
I didn't know much in the way of assembler techniques before reading the Elite code. For example I didn't even know how to do things like multiply or square root, or draw lines efficiently. That's where I learned those things.
It did take quite a lot of studying the printout to get it. So many "aha! that's how they do it" moments.
There are tables for sin, cos and arctan, but these are only used for drawing the planet’s circles. All the ship-drawing and universe manipulation is done using the small angle approximation, so there’s no need for lookup tables.
the original creator of Elite made a new version of the game, called Elite: Dangerous. It's the same essential game, but online and with modern, realistic graphics:
The really cool thing about it is that it's set in a 1:1 scale model of the Milky Way. Most known stars are in there, approximating to a large extent their true astronomical properties. Whatever isn't known is procedurally generated in a way that's motivated by real science. They even put in the TRAPPIST exoplanets, which you can go visit.
If you liked any of the old Elites or are a space nerd, you really ought to consider playing it.
How does he cope with the acidic community? They seem to be crying out for new features and can be very critical, particularly over the "slow" development of Elite and buggy/patched releases. Many of those on the forums demand various features without an understanding of the work involved (typical for software, after all!).
Personally I find Elite Dangerous to be tremendous fun, and extremely good value for money considering how little I paid for it and how many hours of gameplay I got out of it. Having played the original, I am looking forward to the updates!
One of the reviews of the company (glassdoor?) mentions the mess of the codebase, and I can imagine that contributes to the slow releases, but I guess that's true of any legacy giant codebase; having worked somewhere where the code was 20+ years old and a few key architects were the only ones who knew/understood how anything worked, they became the bottleneck to development whilst the rest of the team were under constant pressure to produce output whilst being devoid of understanding of the code. With the "gatekeepers of knowledge" being the only ones that could help the rest of the team, they were too busy to educate others as they were producing 80% of the output to keep the business operating; I wondered from an outside perspective if this was what happens at Frontier a bit?
> Elite on the Beeb was the game that started me coding
Same for me! Not that I could read the code, but my desire to try to cheat in the game led me to learning BASIC and then a career in software engineering.
One pf the original creators. Braben was only one of the two developers, Ian Bell was the other one. There is a version of the trading portion of the game available in pure C on Ian's web site[1].
"Every little step forward, I felt like I was unpicking a bit more of the story of two young developers creating a modern-day masterpiece; if you squint carefully, you can almost sense where the whole starts to become greater than the sum of the parts. Elite is the coding equivalent of 'A Day in the Life', a mash-up between the Acorn world's very own Lennon and McCartney, with results that are just as seminal in their field. They say you should never meet your heroes, but grokking their source code... well, that's another matter altogether."
Also Frontier Elite II runs great in DOSBox and is my favourite in the series. I believe it was the last big commercial game to be written entirely in assembler and fit on a single floppy disk.
I put every version I could find there, it starts as a specialised emulator to run frontier based on the ST version, then it became a 68000 to i386 asm/C and then added in OpenGL rendering.
It has some beautiful moments, but for the most part the gameplay is uninspired and repetitive. 80% of your time is spent staring at a wormhole animation or floating dust in super-cruise.
Best description I heard is "miles wide but inches deep".
The flight model is great, you get detected by your heat signature which depends on the power your ship is using. You can turn off subsystems (like shields) to reduce your heat signature so you can't be targeted, or dump all the heat into a piece of metal that you eject from your ship and shows up on enemy radar. Mining is great too, but overall there's no overarching progression target. In good game design progression should open up new experiences, here (after you collect enough money, which can be done in a few hours) every part of the game is accessible, and none of them lead to anything worthwhile. You just keep doing the same things with more expensive equipment.
If you don't mind 2D graphics and no multiplayer, I would recommend playing Starsector. It has pretty much the same basic gameplay loop as Elite, but it features more complex combat + ship mechanics, a more dynamic world and it allows you to setup your own colonies on newly discovered planets.
Also you don't need a powerful machine to play the game, it's runs flawlessly on my laptop in 1080p (Fedora + Intel HD520).
there is some truth in this. but people play and enjoy American Truck Simulator. Elite sometimes seems like Galaxy Truck Simulator. many similarities, including having to play a parking minigame before delivering your cargo.
They made it in-house. The engine is called COBRA. Their other games (Planet Coaster, Jurassic Park) use it too. The engine has gone through several generations now and started in 1988 (by name at least).
Frontier is probably my favourite game studio right now. RCT3, Zoo Tycoon 1 and Thrillville on the ps2 where probably my favourite games as a kid and they absolutely smashed it out of the park with their Planet series getting everything that made the originals good right while making it so much more advanced.
Simcity 2013 and Zoo Tycoon 2013 were such disappointments so I'm glad there is a trend along with cities skylines to revive classics in a way that doesn't stomp on what made the originals great.
After they abandoned my platform after supporting it and promising to always support it, and after they failed to support Linux, I decided not to pay for any of the newer versions and stop playing the game. Don’t get me wrong, it looks great and is decently fun, but it feels incredibly limited to even Frontier.
> There were only 150,000 or so BBC Micros in the world at that point, so the ratio was almost 1:1, one copy of Elite for every computer that could run it.
Now I'm curious. How many players who made it to Elite Elite are currently members of the anorak elite?
I probably would have been but after a 6 month long binge on Elite I one day woke up, realized there is a lot more to life than playing computer games and deleted my copy by cutting up the distribution disks.
Elite was pretty addictive, and I have a weak spot for that kind of mechanism that apparently has only one way to resolve it.
> Braben was studying natural sciences, Bell was on the maths course. Neither went anywhere near the computer science department, which they had arrogantly but accurately decided offered them nothing useful.
They're talking about Cambridge in 1982. Was the computer science dept. really useless at that time? I doubt it. Obviously, I respect their DIY ethos and their genius for invention but they might have picked up some ideas for further invention if they had done some CS courses.
Certainly ten years later it was too abstract. Lots about compiler theory. Computer science is sometimes useful for software engineering, but only occasionally.
Before then computer science was the only course really offered. Around that time some universities seemed to start offering other related courses such as "Information Technology" (I remember they had slightly lower entry requirements as "computer science" was a relatively hard course to get onto in a decent University in the UK as it was popular.)
Avoiding going to Cambridge for that reason. The Poly's offered far better Computer Science courses at that time and we got an upgrade to a university degree anyway.
The level of detail and quality of writing in this is unbelievable. I can follow it really clearly, and I don't know anything about assembly on the BBC Micro.
Indeed! This is very well documented, not necessarily by the comments per line but the explanatory information. It's a shame that most people nowadays write self-documenting code.
I still write exactly like that today, and as the years progress I've found more often than not that this is what keeps code fresh and re-usable, it also helps that be able to read the code when re-entering a portion that was untouched for a while.
Absolutely this - I’ve tried to explain things clearly in the commentary, not least so I can understand them again when I revisit bits of the code. I’ve got about 15 new deep dives that I'm going to be writing next, now that I've done the website, so that part of the site should get more interesting over time.
This is version 1.0, really. There’s an awful lot more to say about this game - it’s endlessly fascinating.
I believe that I have the longest-lived still-played savegame, of possibly any game. I started playing Elite in 1985, and my savegame has survived to this day. I transferred it from the original 5¼" disk to a disk image a few years ago, and occasionally still load it up under emulation.
I am indeed rated "Elite", although I was very disappointed to learn that only kills are tracked to determine this rating. I had hoped that trading, distance travelled, or galaxies jumped would help as well, but it doesn't.
I loved the monthly articles about Elite that let slip various secrets. They were so exciting. I'm not sure many players would have found the missions without them. It's hilarious how anti-user classic games were!
A lot of vipers died to make me Elite. Its one of my proudest achievements but in truth, I sat outside a space-station and leant a book on one of the buttons of the analogue joystick!
It took Braben and Bell just over two years to write Elite. I imagine it would take me a lot longer than two years to document their code, putting it in a website as pleasing as this one.
When Elite was new it was good enough to spend two years playing it!
Plenty did.
Out of those players not many got as far as becoming Elite and not many did missions or anything else that got you anywhere near completing the game.
Then there were those that actually bothered to look at the code and hack the game or learn from the programming techniques. You would need to get a long way playing the game before taking it apart.
This 'let's take it apart' idea didn't come to the minds of most of the experienced players. So it was a tiny minority into hacking the game.
The thing I like about computer games is this ratio between those that write the game and those that waste their lives playing it! It is like real world sports where you have the eleven players on the team on the pitch, then the grandstands filled with thousands watching.
Games wouldn't work if everyone was so inclined to hack it and write their own. You have got to have audience, those people happy to spend all their free time playing the game rather than wanting to be the next developer.
OMG. I want to go back in time when things were pure and clear. Thanks for sharing. That is what my code looked like in the beginning of time but for a different comp.
A chap called Christian Pinder reverse engineered the BBC version of Elite (written in Assembly) and faithfully reimplemented it as documented C code. It was called "Elite: The New Kind" and was even ported to IRIX!
Unfortunately he was then contacted by David Braben and asked to no longer spread this version.
If you want to see Elite running on a second processor, see https://www.youtube.com/watch?v=mP7fiaync5E . And that's where that video starts out. It later gets to the point of showing GEM, running on top of DR-DOS, on a 80286, emulated by a Rasberry Pi, connected via the Tube to a BBC Master doing all of the I/O.
I’m planning to analyse the 6502 second processor version next - the source files are on Ian Bell’s site, so hopefully I’ll be able to give it the same lavish treatment. I really want to know how the code for the “full” docking computer works... the tape one is just an instant-dock, which isn’t half as interesting.
No, this is not the "tube" version of Elite. The tube version was incredibly rare, and held a near mythical existence back in the 80s and 90s. It's much easier to find today.
I could not find the famous Fibonacci sequence method mentioned to seed the planetary systems generator (at first glance); might look harder...maybe someone spotted it in the code or is willing to explain the method?
When I was a kid, discovering "complicated" games like Elite in my uncle's library was almost like digging into the adults' secret porn stash, things you weren't supposed to know about :)
Christian Pinder translated the assembly into C; that version is called Elite: New Kind. Unfortunately, it also requires an older version of Allegro (3, I think).
I can remember spending, many, many hours looking for non-existent space dredges (or whatever they were called), that was mentioned in the marketing blurb.
When I was about 12, I printed out the entire disassembly for the Disk version of Elite on the BBC, on a dot matrix printer.
Because dot matrix paper is continuous with perforations, the printout filled much of my room, and I pored over it, writing notes and getting to learn all the little tricks and algorithms!
So I had my own fully documented source code for Elite back in the day :-)