Skip to navigation

Elite on the BBC Micro

Compare code in other interesting areas

The following table shows code variations such as bug fixes, optimisations, or other notable differences that are not covered by the other curated lists.

Click on a name to see all the code differences for that part of the codebase, or click on an individual variation to focus on that particular feature.

Maths (Arithmetic)
Maths (Arithmetic)
  • There are two differences in the DVID4 routine between the original versions and the advanced versions that look like they would affect the result of the division; I haven't yet worked out what this is all about.
  • The cassette version resets the MCNT main loop counter when we refuel, which the other versions don't. I don't know why it would do this - perhaps it's a remnant of some other code that was cleared out in later versions?
Maths (Arithmetic)
  • The FMLTU routine in the advanced versions uses logarithms to speed up the multiplication.
  • In the FMLTU multiplication routine, the Master version omits half of the logarithm algorithm when compared to the 6502SP version. The effect of this in-game is most noticeable in the Short-range Chart, where the fuel circle is a different shape to the other versions (the Master version looks rather less smooth, as if it has a slightly larger step size, though it's actually down to the less accurate FMLTU routine).
Utility routines
  • There's an extra RTS in the cassette version that is never used, which is only noteworthy because spare bytes are very hard to come by in that version, as it's so heavily optimised for compactness of code.
  • The cassette version has a bug where performing a galactic hyperspace can drop you in the middle of nowhere in the next galaxy, with no escape. The bug is in the source disc, but the text sources contain an attempted fix for the bug, which doesn't work, but which was refined in the other versions to fix the issue.
  • Part of the bug fix for the "hyperspace while docking" bug (see below).
Save and load
Ship hanger
  • The ship hanger in the advanced versions draws the vertical lines for the backdrop 60 times, when it only needs to do this 15 times. Is this a quick way of making the hanger display hang around for longer, or is it just a mistake?
  • Tha main bug fix for the "hyperspace when docking" bug. Without the fix, if your hyperspace counter hits 0 just as you're docking, then you will magically appear in the station in your hyperspace destination, without having to go to the effort of actually flying there.
Maths (Arithmetic)
LOIN (Part 2 of 7)
Drawing lines
LOIN (Part 5 of 7)
Drawing lines
Main flight loop (Part 2 of 16)
Main loop
Main game loop (Part 2 of 6)
Main loop
Main game loop (Part 5 of 6)
Main loop
Save and load
  • This might be a bug fix? The 6502SP version returns from the disc access break handler if the error printing routine loops through a whole page, so it always exits. The other versions could crash if there is no null value in the block pointed to by (&FD &FE), so perhaps this fixes this issue?
Maths (Arithmetic)
Maths (Arithmetic)
Maths (Arithmetic)
Drawing pixels
  • The Master version doesn't draw single-pixel dots, as it omits the logic to check for distant dots and plot them using one pixel. The Long-range Chart is a good example of this, where the Master version draws a two-pixel yellow dash for every system.
Drawing planets
Drawing planets
  • The disc version contains various bits of copy protection code injected into the Saturn-drawing routine in the loader. In the original versions of Elite, the only self-modifying code is in the copy protection, though later versions do use this technique in the main game code.
  • The cassette and Electron versions contain various bits of copy protection code injected into the Saturn-drawing routine in the loader.
  • This might be a bug fix? It prevents the value in A from being changed from a random number to the cargo type to be spawned, which would stop the amount of cargo being spawned from being random (so presumably the 6502SP and Master versions always spawn the same amount of cargo from each ship type, with no random factor at all?).
Save and load
  • This is a bug fix in the enhanced versions to stop the competition code being printed with a decimal point, which can sometimes happen in the cassette and Electron versions.
TACTICS (Part 6 of 7)
  • This might be a bug fix? When enemies have no lasers, the cassette version still allows them to damage us if they are pointing at us, and it even makes the laser noise. This is fixed in other versions.
Start and end
  • The disc version contains various bits of copy protection code injected into the loader, and the results get checked in the main title sequence to make sure nothing has been changed.
  • This might be a bug fix? If "O" is pressed in the advanced versions, then the target system is set to home, and the routine terminates, which is different to the other versions; they stick around for one more move of the cursor, so presumably this fixes a bug where pressing "O" might not always move the cursor exactly to the current system.
  • The cassette version doesn't draw crosshairs in routine TT103 if this is a space view, but the other versions don't do this check, so perhaps it isn't required?
  • The Master version fixes a bug in the code to calculate the distance between two systems, which can overflow in the other versions and give an incorrect result.
  • This might be a bug fix? The 6502SP version makes sure we don't end up with a negative fuel amount should we try a hyperspace jump that we don't have enough fuel for, though quite how we would get to this point is not clear.
  • When spawning hostile ships in space, the cassette and 6502SP versions reuse the previous random number in X for the 4% check (i.e. the one used to determine the x and y signs of the new ship), while the disc version generates a new random number instead of reusing, so this change presumably improves the randomness of the spawning in the disc version somehow.
Utility routines
  • The disc version's flight code has a different ZES2 routine - it still zero-fills a part of a page, but it fills the opposite part of the page to the other versions.