Skip to navigation

Technical information on the Compendium version of Acorn Electron Elite

How I backported BBC Micro disc Elite to the Acorn Electron with sideways RAM

The Compendium version of Electron Elite is a massively extended and enhanced variant of the original, but at its core it is still Acorn Electron Elite: all the extra features have been added on to the original code, as opposed to being a backport of a different version from a different platform. Fans of the original will feel right at home, as this is Electron Elite, lovingly enhanced into the game that it should have been.

In this article I'll take a deeper look at all the extra features, especially the use of sideways RAM, which gives the game a considerable speed boost compared to the 1984 original.

If you want to see exactly how the code for the Compendium version of Electron Elite differs from the code in the original Acornsoft version, you can check out the elite-compendium branch in the project's repository. Search the source code files for "Mod:" to see every single modification to the original version.

Speeding up the Acorn Electron version
--------------------------------------

On the Acorn Electron, the Compendium version of Elite is a lot faster than the original. Here's a side-by-side comparison, with the original version on the left and the Compendium on the right:

The bulk of this improvement is down to the use of sideways RAM. All versions of the Elite Compendium use sideways RAM, but on the Electron the impact is far more profound than simply having more memory to play with.

On the Electron, the custom ULA controls the entire system, and all memory access is done via the ULA. Due to cost-cutting in the design of the RAM system and the need to interleave screen memory access with main memory, code can only access locations in main memory at 1MHz, which is half the 2MHz access speed that the BBC Micro boasts. This is the primary reason that the Electron is noticeably slower than the BBC Micro.

However, this speed restriction only applies to main memory, i.e. from address &0000 to &7FFF. Memory from &8000 to &FFFF is accessed at the full 2MHz, so fetching data and instructions from the operating system and language ROMs is as fast as on the BBC Micro. Because sideways RAM lives at &8000, this means it can also be accessed at 2MHz. The Electron has the same 2MHz 6502 CPU as the BBC Micro, so code that lives above address &8000 and which only accesses data from above &8000 will effectively run at the same speed as it would on the BBC.

For the Compendium version of Electron Elite, I've moved all speed-critical code and variables into sideways RAM. I've left zero page alone, as although it is accessed at 1MHz, the 6502's faster and smaller zero-page instructions cancel out any advantage of moving zero page variables into sideways RAM.

The speed difference is impressive. It doesn't run as fast as BBC Micro Elite, because we still have to access screen memory at 1MHz (as screen memory runs from &5800 to &7FFF), but outside of screen-poking, the core flight code runs as fast as it possibly can. Non-critical code still lives in main memory, as we don't need to speed up aspects like trading, system charts or saving commander files, but everything that matters is now in sideways RAM.

On top of this, I've backported the logarithm-based multiplication and division routines from the 6502 Second Processor, which run noticeably faster than the loop-based routines from the original version (though they take up a lot more memory). And I've backported various specialist routines, such as the dedicated horizontal line-drawing routine at HLOIN, which were left out of the Electron version due to a lack of free space.

In all, this extra speed and memory means the Electron can finally run all the features of BBC Micro Elite, and without grinding to a halt.

New features in the Acorn Electron version
------------------------------------------

To bring Acorn Electron Elite up to the level of the other 6502 versions, I not only wanted to backport all the extra features from the BBC Micro disc version of Elite, but I also wanted to add as many extra Compendium features as possible.

With the exception of the four-colour dashboard and Bitstik support, Electron players can now enjoy everything that the BBC Micro had back in 1984. Here's a complete list of features I've added to the Compendium version of Electron Elite, and below that is a blow-by-blow comparison between the various versions.

Unless otherwise stated, features have been backported from the BBC Micro disc version of Elite.

  • Speed improvements
    • Significant speed increase over the standard version due to fast sideways RAM
    • Logarithm-based maths routines for a further speed boost (6502 Second Processor)
    • Optimised routines (such as HLOIN) backported from various other 6502 versions
  • Graphical improvements
    • Flicker-free ships (BBC Master)
    • Flicker-free planets (using the same algorithm as ships)
    • Circular planets with meridians, equators and craters (no more 50p planets!)
    • Energy bomb lightning effect (BBC Master)
    • Escape capsule animation
    • Three sizes of stardust rather than two (one-pixel stardust added)
    • Variable star sizes in the Short-range Chart
  • In-station features
    • Extra lasers (military, mining)
    • Improved selling mechanism (sell all or part of your cargo)
    • Extended system descriptions (edible poets!)
    • System search in the Long-range Chart
    • Hold SHIFT to move the chart pointer more quickly
  • In-flight features
    • All 31 ship and station designs from the BBC Micro disc version
    • Advanced enemy tactics (NEWB) and spawning logic
    • Suns, cabin temperatures and fuel scooping
    • Fuel scoops only work when moving (NES)
    • Asteroid mining
    • Thargoids and witchspace
  • Docking
    • Proper docking computer sequence
    • Pressing "J" will dock instantly when docking computer is activated (NES)
    • Transporters no longer spawn in the station slot when we're auto-docking (NES)
    • Docking fee for using the docking computer (NES)
    • The ship hangar is shown on docking
  • Missions
    • Both BBC Micro missions (Constrictor and Thargoid plans)
    • Trumbles mission (Commodore 64 and NES)
  • Loading and saving
    • Disc access menu for saving, loading, cataloguing and deleting commander files
    • Full support for ADFS, DFS and MMFS on all media, including the Plus 3
    • The Acornsoft loading screen no longer has the panel for showing tape progress
  • Joysticks
    • Joystick support added for Plus 1 analogue joysticks (BBC Micro)
    • Joystick support added for Slogger and First Byte digital joysticks (BBC Master Compact)
    • Keyboard fire button still works when joysticks are enabled (BBC Master)
  • Bug fixes and tweaks
    • Includes bug fixes from the Elite Compendium (Data on System, Moray spawning)
    • Broken sound priorities and durations have been fixed in the sound generation routine
    • The second title screen now has a rotating Constrictor instead of a Mamba (so the Compendium has its own unique ship, rather than reusing the BBC Micro cassette's Mamba)

Notes:

  • When launching, hyperspacing, docking and restarting, there is a small pause while the game loads ship blueprints from disc, just like the BBC Micro disc version.
  • When using ADFS on the Plus 3, the screen might flicker during disc access.
  • All features from the original BBC Micro disc version are included except for the four-colour dashboard and Bitstik.
  • All features from the Elite Compendium are included except for music, volume control and Delta 14B support (the standard Electron can't physically support the last two).
  • I am investigating adding music and the four-colour dashboard.

Here's a feature-by-feature comparison showing how the Compendium version of Electron Elite has finally caught up with the original 1984 versions. (See the full feature comparison table for more information on the items in the table and to compare all the other versions of 6502 Elite.)

FeatureBBC Micro CassetteBBC Micro DiscCompendium ElectronStandard Electron
Release year1984198420251984
Ship types13313111
Thargoids, ThargonsYesYesYesNo
Dodo space stationNoYesYesNo
CougarNoNoNoNo
Cougar has a cloaking devicen/an/an/an/a
Rock hermitsNoNoNoNo
Distinct ship designs12292910
Max. ships in the local bubble10101010
Max. cops in the local bubble4433
Bytes in each ship's data block36373736
Enhanced AI and spawning (NEWB)NoYesYesNo
Ships that Anacondas can spawnn/aWormWormn/a
Colours in the space view2222
Colours in the dashboard4422
Flashing dashboard indicatorsYesYesNoNo
Ship colours in the 3D scanner2211
Dot height in the 3D scanner (pixels)2222
Compass dot (in front)Thick yellowThick yellowThick whiteThick white
Compass dot (behind)Thin greenThin greenThin whiteThin white
Space view height (pixels)192192192192
Space view width (pixels)256256256256
Dashboard height (pixels)56565656
Dashboard width (pixels)128128256256
Escape pod colour schemePalettePaletteNoNo
Mining lasers and asteroid miningNoYesYesNo
Military lasersNoYesYesNo
Crosshair colour varies with laser typeNoNoNoNo
Crosshair design varies with laser typeNoNoNoNo
Enemy laser colourWhiteWhiteWhiteWhite
Proper docking computerNoYesYesNo
Sun, fuel scooping, cabin temperatureYesYesYesNo
Planet meridians and cratersYesYesYesNo
Extended text tokensNoYesYesNo
Extended system descriptionsNoYesYesNo
MissionsNo23No
Energy bomb kills Constrictorn/aYesYesn/a
Energy bomb kills ThargoidsYesYesYesn/a
Energy bomb graphical effectFlashFlashLightningNo
"Press Fire or Space" shipMambaKraitConstrictorMamba
Search for systems by nameNoYesYesNo
Key to move chart pointer quicklyNoSHIFTSHIFTNo
Buy/sell specific amounts of cargoNoYesYesNo
Buy all available cargo with "Y"NoYesYesNo
Display ship hangar on dockingNoYesYesNo
Launch tunnel colourWhiteWhiteWhiteWhite
Disc access menuNoYesYesNo
Revert to default commanderNoNoNoNo
Fractional kill countsNoNoNoNo
Kill count varies by ship typeNoNoNoNo
Kill count for cargo, asteroids, escape pods, ThargonsNoYesYesNo
"S/E" indicator width (in space view pixels)6677
Fuel goes red when lowYesYesNoNo
Volume controlNoNoNoNo
Sound effectsStandardStandardBasicBasic
Laser sound attack phase amplitude112126n/an/a
Save screenshotNoNoNoNo
Send trade screens to printerNoNoNoNo
Logarithm-based maths routinesNoNoYesNo
Hostile ships spawning distance32253232
Galactic hyperspace counts down from15151515
Hyperspace countdown text column5655
Rings in the hyperspace tunnel16161616
WitchspaceYesYesYesNo
Launch escape pod in witchspaceFatalYesYesn/a
Thargoids in witchspace442n/a
Docking check #3YesNoYesYes
Docking check #4 vectorStationPlanetStationStation
Docking check #4 angle22.0°26.3°22.0°22.0°
Medium circle radius range8-608-608-609+
Explosion particles per vertex151577
Stardust particles18181010
Top laser line vertical offset0000
In-flight message positionColumn 9Column 9Column 9Column 9
Max. junk shown on our death4544
Version bit number in save file12 or 533
"Star Wars" scroll text and demoNoNoNoNo
Random Saturn on load screenYesYesYesYes
Title banners on load screenYesYesYesYes
Saturn planet dot counts128076812801280
Saturn ring dot counts128081912801280
Saturn dot plotting logicOROverwriteOROR
TINA hookNoNoNoNo
Joystick supportYesYesYesNo
Bitstik supportNoYesNoNo
Loading pause on launch/dockNoYesYesNo

As well as the list above, the Compendium version of Acorn Electron Elite has the following Compendium-specific features:

  • Flicker-free ships
  • Flicker-free planets
  • Trumbles mission
  • Docking computer improvements
  • Fuel scoop improvements
  • Joystick improvements

Read about the Elite Compendium for more information on these extra features.