Skip to main content

ZXLab API Description

ZXLab presents a set of methods that allow you to run a virtual ZX Spectrum in a browser (or in a browser component for C#, Delphi, etc.) and control it using the Debug API. There are also useful methods for data conversion.

All methods can be divided into two large groups - Web API and Debug API.

Web API

The Web API methods are all accessible via HTTPS GET or POST and use REST API principles. They can be additionally divided into two separate groups - Web API / Binaries and Web API / Functions.

Web API / Binaries is just a set of methods that allows you to upload, modify, download and manage ZX Spectrum-compatible executable files in ZXLab cloud storage.

How this can be used?

For example, you can post your game or program to ZXLab cloud to allow everyone to evaluate it and comment on it. You can upload the program using the upload method and get a direct link to a page where anyone can play your game online.

You can also automate the process using the API and even publish intermediate compilation results. You don't need to write your own ZX Spectrum emulator or adapt one of the existing ones.

Using special access setting methods you can limit the users to members of your team or make the file available only to yourself.

Web API / Functions is a set of methods that can be used to convert data or files between ZX Spectrum standards and modern PC standards (for example, image files like SCR or ZXP can be converted to PNG or JPG and back) or you can use them for other things.

Debug API

Another big set of methods is Debug API methods. When the ZXLab online emulator is running, the Debug API allows you to interact with it on the emulated "hardware" level, e.g. to stop the Z80 CPU at any memory address or point in time, run Z80 instructions one-by-one, read/write memory blocks, ports or registers, debug code and do other useful things. Thus, using the Debug API you can embed the emulator in your development environment without having to develop a complex infrastructure.

Debug API is pretty clear and simple. Even if your development environment runs on "desktop-specific" programming languages, all you need is a browser component with javascript support and the ability to interact with that component's content via messages.