Skip to navigation

Elite on the BBC Micro and NES

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.

NameComments
DVID3B2
Maths (Arithmetic)
DVID4 / dvid4_duplicate
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.
EQSHP
Equipment
  • 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?
EXNO
Sound
FMLTU
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).
FX200
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.
Ghy
Flight
  • 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).
GTNME / GTNMEW
Save and load
HANGER
Ship hangar
  • The ship hangar 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 hangar display hang around for longer, or is it just a mistake?
hyp
Flight
hyp1
Universe
  • The main bug fix for the "hyperspace while docking" bug, which affects the cassette, disc and Electron versions. 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.
LL28
Maths (Arithmetic)
LOIN (Part 2 of 7)
Drawing lines
LOIN (Part 3 of 7)
Drawing lines
  • The original versions contain a bug where the last pixel is skipped instead of the first pixel, but only when drawing lines that go right and up or left and down. This leads to a messy line join between this kind of line and lines with different slopes. This bug was fixed in the advanced versions.
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
MEBRK
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?
MLS2
Maths (Arithmetic)
MU11
Maths (Arithmetic)
MULT1
Maths (Arithmetic)
MV40
Moving
PIXEL
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.
PLANET
Drawing planets
PLL1 (Part 1 of 3)
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 part 1 of the Saturn-drawing routine in the loader.
PLL1 (Part 2 of 3)
Drawing planets
PLL1 (Part 3 of 3)
Drawing planets
  • The disc version contains various bits of copy protection code injected into part 3 of 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.
refund
Equipment
SPIN
Universe
  • 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?).
SVE
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)
Tactics
  • 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.
TITLE
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.
TT102
Keyboard
  • 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.
TT103
Charts
  • 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?
TT111
Universe
  • 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.
TT18
Flight
  • 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.
TT219
Market
Ze
Universe
  • 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.
ZES2
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.