Loading routine "cores"

From Sinclair Wiki
Revision as of 20:53, 28 July 2018 by Pak21 (talk | contribs) (Document Bleepload.)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

This page documents the "core" of the loading routine used in the various turboloaders: the part of the loader which actually finds an edge from the tape.

ROM loader

The basis for every loading routine out there, this is the one found in the Spectrum ROM (at 05ED). The LD-SAMPLE name is taken from Logan and O'Hara's The Complete Spectrum ROM Disassembly.

LD-SAMPLE  INC B
           RET Z
           LD A,7F
           IN A,(FE)
           RRA
           RET NC
           XOR C
           AND 20
           JR Z,LD-SAMPLE

This routine is used unchanged (just copied elsewhere in memory) by a large number of turboloaders, for example Cybernoid and Dan Dare.

Turboloaders

The names given to each of these loading routines are not meant to imply that loaders was the first to use the specific loading loop; it is the most common usage of the loading loop, or just the first place that it was seen by the authors of this page.

Speedlock

The Speedlock loader, used in huge numbers of games, for example Daley Thompson's Decathlon and Head over Heels.

LD-SAMPLE  INC B
           RET Z
           LD A,7F
           IN A,(FE)
           RRA
           XOR C
           AND 20
           JR Z,LD-SAMPLE

This is essentially identical to the ROM loader, but just without the RET NC which aborts if space is pressed during the ROM loading routine.

Alkatraz

The Alkatraz loader, used in games like 720° and Cobra.

LD-SAMPLE  INC B
           JR NZ,LD-SAMPLE2
           JP <somewhere else>
LD-SAMPLE2 IN A,(FE)
           RRA
           RET Z
           XOR C
           AND 20
           JR Z,LD-SAMPLE

This again isn't that different from the ROM loader; the minor changes are:

  • Inverting the "no edge found" condition
  • Using a JP if an edge is not found rather than a RET
  • Not setting the high byte of the IN - this isn't critical as it affects only which keyboard half-rows are scanned
  • Replacing the RET NC with a RET Z. I think this makes it essentially a no-op unless lots of keys are pressed at once.

"Variant" Alkatraz

A very close variant of the Alkatraz loader, seen only in three late era Spectrum games: Gauntlet III, Out Run Europa and Shadow Dancer.

LD-SAMPLE  INC B
           JR NZ,LD-SAMPLE2
           RET
LD-SAMPLE2 IN A,(FE)
           RRA
           RET Z
           XOR C
           AND 20
           JR Z,LD-SAMPLE

This actually makes the Alkatraz routine closer to the original ROM code as it now uses a RET to exit in the "no edge found" case.

Bleepload

The Bleepload routine, used in lots of Firebird games, for example Bubble Bobble and Starglider 2.

LD-SAMPLE  INC B
           RET Z
           LD A,7F
           IN A,(FE)
           RRA
           NOP
           XOR C
           AND 20
           JR Z,LD-SAMPLE

This is just the ROM routine, but with the "space pressed" check explicitly replaced with a NOP.