SpectNet IDE

Visual Studio 2017/2019 integrated ZX Spectrum IDE for the Community

Tutorials v2 » Fast (Instant) LOAD

I like the retro feeling of the ZX Spectrum border stripes when a program is being loaded. Today’s kids cannot imagine being patient for three to five minutes while a bigger game gets into the memory from the tape.

Well, while you develop code, you probably do not the same time as you had in your childhood.

SpectNetIDE provides an option to load programs instantly. Open the Tools|Options dialog in the Visual Studio IDE, and navigate to the Spect.Net IDE tab. Under the Virtual machine section, you find the Use Fast Load configuration option. Set it to True.

Use fast load

Note: Setting this option requires that you restart the ZX Spectrum virtual machine – fortunately not your computer :-).

The next time you load a program, it happens instantly.

Under the Hood

SpectNetIDE uses a technique called ROM hooking.

The virtual machine senses that the execution flow enters into the LOAD routine within the ZX Spectrum ROM (at address $056C), and temporarily suspends the CPU. The virtual machine executes its custom loader subroutine to get the contents of the tape file and injects the code into the memory. Then, it sets the contents of the Z80 CPU’s registers as if the original ROM routine had run successfully, and resumes the CPU as if it just returned from the ROM routine (at address $05E2).

Note: Fast load does not work with programs that dodge the LOAD routine in the ROM, e.g., the ones which use custom loaders. In such cases, turn off fast loading.