[HN Gopher] Fully documented source code for Elite on the BBC Micro
       ___________________________________________________________________
        
       Fully documented source code for Elite on the BBC Micro
        
       Author : iamflimflam1
       Score  : 311 points
       Date   : 2023-02-18 23:25 UTC (23 hours ago)
        
 (HTM) web link (www.bbcelite.com)
 (TXT) w3m dump (www.bbcelite.com)
        
       | Roxanne5 wrote:
       | [dead]
        
       | psychphysic wrote:
       | My first thought was what a gorgeous website.
       | 
       | My second was oh it made my phone unresponsive.
        
         | MarkMoxon wrote:
         | Author here, sorry to hear that. The side menu is quite large
         | so there is a bit of a delay on loading - the project has grown
         | pretty big, and so has the nav!
         | 
         | It works OK on my ancient iPhone 6, so it shouldn't really be
         | unresponsive anywhere, but I'm clearly going to have to look
         | into it. Apologies.
        
           | psychphysic wrote:
           | Thanks, it hangs after the page seems loaded.
           | 
           | I'm using a Motorola g31w with the chromium based adblock
           | browser 3.2.4
           | 
           | If that helps.
        
             | MarkMoxon wrote:
             | There are no ads or trackers on my site, so it can't be
             | that - it is just the page content and some JavaScript,
             | nothing more. I suspect it's because I'm using an old off-
             | the-shelf script for the navigation, and the size of the
             | nav has grown too big for it to run reliably on all
             | devices. So I need to recode it more efficiently, which
             | won't help you right now, but will hopefully do so next
             | time.
             | 
             | This is what you get when you get a site author who would
             | rather be coding in 8 bits than in HTML. ;-)
        
       | jacquesm wrote:
       | I would have paid the weight of the disk in gold to get this when
       | I was 17...
       | 
       | This game was so good that I had to delete it, it ate into my
       | productivity to a degree that really wasn't healthy so one fine
       | morning after I saw a viper on the wall of my little Amsterdam
       | studio I decided enough was enough and wiped the disk.
       | 
       | I have a serious problem with that kind of addiction and need to
       | do radical stuff to keep myself on the straight and narrow and
       | this was the first time that I ran into my lack of self
       | discipline. Kudos to Braben and Bell for what they built, they
       | _really_ set a new standard for video games on 8 bit personal
       | computers.
        
         | patrickmcnamara wrote:
         | I never played the older Elite, but Elite Dangerous was/is the
         | same for me. I love that game. I haven't played in years
         | because I don't want to get sucked in again. I imagine the
         | source code is significantly larger and less interesting
         | though.
        
         | foruhar wrote:
         | Probably the weight of the cassette if we are talking about the
         | beeb. I just recalled the "DIN to DIN" cable for the first time
         | in 30+ years.
        
           | jacquesm wrote:
           | I actually had a pair of 360K drives by that time. They cost
           | as much as my car, but it was well worth it.
        
         | sprkwd wrote:
         | Still the best game I have ever played.
        
       | andrewstuart wrote:
       | I'd love to see the source code for Turrican 2 on the Commodore
       | 64/Amiga.
       | 
       | How Manfred Trenz got so much out of the C64 I cannot imagine.
       | 
       | https://www.youtube.com/watch?v=kS6rBNhHNnU
       | 
       | https://www.youtube.com/watch?v=u1lOUaFjGxs
       | 
       | Manfred Trenz seems to have dropped off the face of the earth
       | otherwise I'd ask if he'd be willing to release the code.
        
         | gsinclair wrote:
         | You'd think (and I'd wish) that Trenz's achievements would have
         | been dissected in conferences and/or YouTube videos. If only. I
         | want to know in advanced layman's terms how he did it.
        
         | jacquesm wrote:
         | Another person in the same league: Jeff Minter aka Yak. He too
         | could make the C64 do incredible tricks.
        
         | pjmlp wrote:
         | Maybe something is described here.
         | 
         | https://amostagreeablepastime.com/2020/11/24/the-history-of-...
         | 
         | He also gave other interviews.
        
       | zabzonk wrote:
       | i do have some fond memories of the bbc micro - in the 80s i
       | wrote an implementation of the kermit file transfer protocol for
       | it in basic, but it was glacially slow. a bit later i rewrote it
       | in 6502 assembler, and incorporated a vt100 terminal emulator.
       | everything was much faster - the 6502 could be pretty quick once
       | you understood its addressing modes, which were peculiar.
       | 
       | i was always crap at elite though.
        
       | hota_mazi wrote:
       | It's hard to understate how groundbreaking Elite was when it came
       | out, let alone on the kind of processor and processor speed it
       | came out on.
       | 
       | Dave Braben is a god on the same level as Carmack.
       | 
       | He created a new game generation for decades, which we're still
       | living in.
        
         | jacquesm wrote:
         | > Dave Braben is a god on the same level as Carmack.
         | 
         | I don't think they're at the same level. The restrictions that
         | Braben & Bell were working under were orders of magnitude more
         | limiting than what was available by the time 'Doom' rolled
         | around. Doom was definitely also a game changer but the quantum
         | leap between Elite and what came before it was in my opinion of
         | a different magnitude.
         | 
         | That does not diminish Carmack in any way, what he did was
         | amazing. But what Braben & Bell did was considered absolutely
         | impossible from a cycles budget perspective. And Doom never
         | struck me as 'impossible' on the hardware that it was run on.
         | 
         | Doom got you a great game, Elite got you a career. That said:
         | it is next to impossible really qualitatively compare people
         | born at different points in time. Given the same limitations
         | who knows what Carmack would have some up with and if Braben &
         | Bell were born a few decades later it may well have been the
         | reverse.
         | 
         | One thing I know for sure: creativity thrives under
         | constraints.
        
           | gjvc wrote:
           | > One thing I know for sure: creativity thrives under
           | constraints.
           | 
           | Yes, this statement is above opinion.
        
           | prox wrote:
           | I agree. One of the problems I hear sometimes as an Elite
           | Dangerous player is that the game is a "mile wide" , yet an
           | inch deep. The game relies a lot on text (from the galnet
           | news to the station boards) to convey what is happening.
           | While that keeps things manageable from a time and money
           | angle, the problem is that in this day and age it's
           | better/expected to show and let the players experience it. It
           | also doesn't trust the players with a lot of agency beyond
           | visiting places and shooting/trading things. I think the game
           | relies a lot on its legacy rather than new bold moves that
           | elevate to the same status as its forbear.
           | 
           | That said, there is nothing like E:D out there right now, and
           | it's still a great achievement.
        
         | japanman425 wrote:
         | [dead]
        
       | JKCalhoun wrote:
       | That was the game (I saw it first on an Apple ][) that seemed to
       | take computer gaming to a whole other level. It may have actually
       | been the game, even though I played it so briefly, that made me
       | see the computer game as a beast that was suddenly unlike
       | anything you might see in the arcade at the time. It could be
       | escapist and a simulation at the same time -- you could play at
       | living some sort of Star Wars adventure.
        
         | gerdesj wrote:
         | I had a C64 (still do, it has a USB interface and some new
         | caps. these days).
         | 
         | Elite was jaw dropping stuff when it came out. For me the
         | tactical display - the oval thing with two pixel objects and
         | elevation plotted from the current nominal plane was an
         | absolute game changer. You could literally (OK graphically) see
         | what the heck was going on around you. For me the Wing
         | Commander series of games (PC) improved on that somewhat with
         | more clues wrt velocity as well as position. I'm sure there are
         | others - I grew up a bit!
         | 
         | As well as an amazing HUD thing, the scope of the game was
         | incredible. I've read write ups on how the universe was done
         | and it is very impressive.
        
           | jacquesm wrote:
           | > Elite was jaw dropping stuff when it came out.
           | 
           | Indeed, my first response was: "That's not possible". The
           | second was: Let's take it apart and see how it works. That
           | was something Braben and Bell had foreseen, Elite was very
           | hard to reverse engineer, layer upon layer of tricks to stop
           | you from getting to what actually ran. Very impressive stuff.
           | 
           | The whole idea that someone can make the computer that you
           | think you know absolutely inside-out do stuff in real time
           | that you'd have trouble doing at all no matter how much time
           | you've got is what made it so intriguing.
           | 
           | One of the more interesting moments in trying to crack the
           | copy protection that stopped you from seeing the naked
           | assembly in the loader is that at some point the game code
           | contains the string 'does your mother know that you are doing
           | this?' or something to that effect. That was more effective
           | than the last 10 hours or so of decryption stepping through
           | the code in Exmon because I realized I was utterly
           | outclassed...
        
       | dang wrote:
       | Related. Others?
       | 
       |  _In the '80s, Elite was magic. The annotated source code shows
       | how it was done_ - https://news.ycombinator.com/item?id=29254763
       | - Nov 2021 (6 comments)
       | 
       |  _Fully documented source code for Elite on the BBC Micro_ -
       | https://news.ycombinator.com/item?id=24611341 - Sept 2020 (125
       | comments)
       | 
       |  _A video game community filled my nephew 's final days with joy_
       | - https://news.ycombinator.com/item?id=20353734 - July 2019 (106
       | comments)
       | 
       |  _Elite 's crazy tokenized string routine_ -
       | https://news.ycombinator.com/item?id=8950288 - Jan 2015 (17
       | comments)
       | 
       |  _Backroom Boys (2003)_ -
       | https://news.ycombinator.com/item?id=8904587 - Jan 2015 (2
       | comments)
       | 
       |  _The Making of Elite_ -
       | https://news.ycombinator.com/item?id=7892462 - June 2014 (38
       | comments)
       | 
       |  _The making of Elite_ -
       | https://news.ycombinator.com/item?id=6604478 - Oct 2013 (56
       | comments)
       | 
       |  _Elite: Dangerous will support Oculus Rift_ -
       | https://news.ycombinator.com/item?id=6526783 - Oct 2013 (16
       | comments)
       | 
       |  _Elite video game reboot hits funding target_ -
       | https://news.ycombinator.com/item?id=5001968 - Jan 2013 (43
       | comments)
       | 
       |  _Elite Dangerous - Mac Version Stretch Goal_ -
       | https://news.ycombinator.com/item?id=4973367 - Dec 2012 (12
       | comments)
       | 
       |  _Elite: Dangerous_ -
       | https://news.ycombinator.com/item?id=4746646 - Nov 2012 (71
       | comments)
       | 
       |  _BBC interview with creator of Elite_ -
       | https://news.ycombinator.com/item?id=2331701 - March 2011 (29
       | comments)
        
         | synthax_ wrote:
         | This is an amazing talk by Braben where he goes into detail on
         | many of the hacks that was necessary to make Elite possible.
         | https://www.gdcvault.com/play/1014628/Classic-Game-Postmorte...
        
         | implements wrote:
         | Hopefully ok to hang Ian Bell's Elite pages off here:
         | 
         | http://www.iancgbell.clara.net/elite/index.htm and
         | 
         | http://www.elitehomepage.org/archive/index.htm (file archive)
         | 
         | Bit of a time capsule, but some interesting curios in there.
        
           | rwmj wrote:
           | And the infamous history of Ian Bell's website:
           | http://www.ntk.net/1999/09/17/
        
             | implements wrote:
             | Ah, _Need To Know_ - I still occasionally wonder whatever
             | happened to Dave Green ...
        
       | jlarcombe wrote:
       | The disassembly and analysis itself is impressive enough but the
       | things he's done with it since are simply incredible for anyone
       | who grew up playing the game... i mean a teletext version!! just
       | ridiculous
        
       | louthy wrote:
       | The work Mark Moxon has been doing on this is incredible, as an
       | ex-Beeb programmer it's really great to see.
       | 
       | Defo worth a Follow on twitter: https://twitter.com/markmoxon
        
         | LeoPanthera wrote:
         | He's also on Mastodon. https://universeodon.com/@markmoxon
         | 
         | @markmoxon@universeodon.com
        
           | Lio wrote:
           | As soon as I saw this article I was trying to think how I
           | knew the name.
           | 
           | He was the editor of Acorn User magazine back in the day.
           | 
           | Thanks for the Mastodon link.
        
       | codewiz wrote:
       | There is an actively developed project called Elite Harmless
       | which includes a fully commented disassembly of the original C64
       | version plus various improvements: https://github.com/Kroc/elite-
       | harmless
       | 
       | I was able to build it from sources on Linux after fixing a typo,
       | but the"fastlines" binary appears to be buggy:
       | https://codewiz.org/pub/elite-harmless-fastlines-screenshot....
        
       | esbeeb wrote:
       | But will it run on a PicoMiteVGA? (RP2040-based computer with 16
       | colors, 320x240 graphics, in "mode 2")?
       | 
       | "PicoMiteVGA: Raspberry Pi Pico Boot-to-BASIC Microcomputer":
       | https://www.youtube.com/watch?v=kZaWYgIYgd8
        
         | Narishma wrote:
         | Non-video link: https://geoffg.net/picomitevga.html
        
         | jacquesm wrote:
         | No. Elite relied very heavily on being able to reprogram the
         | video chip on the fly at different scanlines to produce custom
         | modes. If you don't have the exact same video arrangement there
         | is almost no chance that it will run unmodified.
        
           | esbeeb wrote:
           | That's straight-up "god-level" indeed.
           | 
           | "Elite" is a suitable name for the game, when the coding
           | prowess is considered as the truly "Elite" thing about it.
        
             | justinlloyd wrote:
             | Flipping modes on the VDU at specific scan lines on the
             | Beeb was a standard thing that quite a few games and demos
             | and applications did, e.g. Mode 4 or Mode 0 for B&W high
             | resolution text, and Mode 2 or Mode 5 with some clever HAM
             | for low-resolution but colourful graphics. The only mode
             | switch that didn't work well was switching back and forth
             | between Mode 7 (Teletext), it was mostly a timing issue,
             | coupled with the fact the teletext character generator did
             | weird things to the Beeb's video output.
        
               | jacquesm wrote:
               | I was pretty active in the BBC Scene at the time and had
               | a front row seat to a whole pile of the backstory here,
               | and yet I do not recall anybody that pulled this off in a
               | stable and reproducible manner (T1 + some 6845 register
               | hacks).
               | 
               | The problem was that timing the switch point in software
               | was fraught with trouble because you just might end up
               | making the switch at the wrong moment which caused it to
               | jump vertically (or garble a part of your screen). The
               | other problem was that if you wanted perfect timing it
               | was possible but that left you without enough cycles to
               | run your game. Braben & Bell solved this to the point
               | that it was considered stable enough for inclusion in
               | production. Similar hacks had been done on the Atom prior
               | to the BBC so it wasn't as if the knowledge wasn't out
               | there but no game publisher had - as far as I know - seen
               | fit to release a game that used it.
               | 
               | It would be great if you could answer this and point out
               | exactly where this was used prior to Elite on the Beeb,
               | that would set the record straight on this once and for
               | all.
        
               | MarkMoxon wrote:
               | I agree, I think Elite was the first commercial example
               | of a split-screen mode on the BBC. It does flicker a bit
               | at the switchover point when the disk is being accessed,
               | as it is interrupt-based, but it's not too bad. There's
               | lots of detail on how it works here:
               | 
               | https://www.bbcelite.com/deep_dives/the_split-
               | screen_mode.ht...
               | 
               | My favourite inplementation of this technology is in
               | Geoff Crammond's Revs, which doesn't flicker at all, as
               | the palette switches are cleverly done where they won't
               | be seen if they aren't perfect. Read all about it here:
               | 
               | https://revs.bbcelite.com/deep_dives/hidden_secrets_of_th
               | e_c...
               | 
               | It's genius.
        
               | justinlloyd wrote:
               | I don't recall if Elite was the first game or not to have
               | stable mixed mode. It was most likely the first, and once
               | demonstrated, other developers implemented the idea too.
               | I recall that the mode 4 of Elite wasn't strict mode 4
               | because they wanted a certain amount of pixels that would
               | divide evenly by a number, so when the interrupt fired,
               | the mode could be changed. It's been a few years since I
               | worked on the Beeb.
               | 
               | You probably already know this, but to fill in context
               | the screen would flicker because the NMI that handles
               | disc IO would fire, and would be serviced before IRQ1 if
               | both fired together, and also you cannot interrupt an
               | interrupt.
               | 
               | BBC Micro Advanced User Guide pages 359 and 370 detail
               | the 6845 and ULA demonstrated Mode "8" and I recall
               | Practical Computing and Acorn User also had listings for
               | doing tricks with the interrupts and the mixed mode,
               | though don't ask me issue numbers.
               | 
               | I picked a random video of yours "ABug 09 Explaining
               | Elite" and jumped forward to 2:22 to skip the intro, and
               | said "oh, that's a matrix transposition function" when
               | the code popped up on the screen. It's funny how some of
               | that crap sticks with you.
               | 
               | Elite was an amazing achievement.
        
               | jacquesm wrote:
               | What really gets me about this whole discussion is that
               | lots of this stuff feels like _yesterday_ to me. And yet,
               | it 's been almost 40 years. Mnemonics and register
               | offsets for peripherals are all jumping to attention for
               | immediate use. But don't ask me what I ate last week...
        
               | justinlloyd wrote:
               | I am prettty sure I could write a decently sized Z80 or
               | 6502 program for the Beeb or the Speccy from scratch
               | without reference, or at least a decent set of 3D
               | transformation functions. I could not tell you how to
               | load a JSON file from a folder in Python if my life
               | depended upon it. I have to write that latter code on an
               | almost weekly basis. I will say that the internet and
               | instant access to online references has absolutely
               | destroyed my memory more than any amount of age or
               | caffeine.
        
       | abraxas wrote:
       | https://www.theguardian.com/books/2003/oct/18/features.weeke...
       | 
       | A great background read about the game's conception and its
       | authors. It's a long read but it's really worth your time to get
       | the gist of the atmosphere in which many eighties classics were
       | made.
        
         | jacquesm wrote:
         | Great article.
         | 
         | > 1. These games are crap, but sell for money.
         | 
         | > 2. My games are not crap.
         | 
         | > 3. Therefore my games could sell for money.
         | 
         | That really is asking for a
         | 
         | > 4. Profit!
        
           | msla wrote:
           | Meditate on how many people followed that precise chain of
           | logic to financial ruin.
        
         | stevekemp wrote:
         | The Digital Antiquarian did a good writeup of Elite too:
         | 
         | https://www.filfre.net/tag/elite/
        
         | dang wrote:
         | Discussed a couple times:
         | 
         |  _Backroom Boys (2003)_ -
         | https://news.ycombinator.com/item?id=8904587 - Jan 2015 (2
         | comments)
         | 
         |  _The making of Elite_ -
         | https://news.ycombinator.com/item?id=6604478 - Oct 2013 (56
         | comments)
        
           | riidom wrote:
           | If I may add :)
           | 
           |  _In the '80s, Elite was magic. The annotated source code
           | shows how it was done_ -
           | https://news.ycombinator.com/item?id=29254763 - Nov 2021 (6
           | comments)
        
             | dang wrote:
             | Good catch. Added to
             | https://news.ycombinator.com/item?id=34855089. Thanks!
        
       | nickdothutton wrote:
       | There is a whole list of 8-bit games I'd love source code for,
       | and a code walkthrough. Starglider, Driller/Freescape,
       | TauCeti/Academy.
        
         | mav88 wrote:
         | I reverse engineered Starglider for DOS to put in a cheat just
         | to convince myself that I really had seen a hopping robot as an
         | enemy once above a certain game score.
        
       | mysterydip wrote:
       | Tangentially related, but the theming of that site really hits my
       | nostalgia, the web equivalent of reading a book in a chair next
       | to a fireplace.
        
       ___________________________________________________________________
       (page generated 2023-02-19 23:02 UTC)