table of contents
- trixie 1.5.0-4+b2
- testing 1.6.4-1
- unstable 1.6.4-1
- experimental 1.7.0-1~exp1
| libspectrum(3) | Emulators | libspectrum(3) |
NAME¶
libspectrum — Sinclair ZX Spectrum support library
SYNOPSIS¶
#include <libspectrum.h>
libspectrum_error libspectrum_init( void );
void libspectrum_end( void );
libspectrum_error libspectrum_identify_file( libspectrum_id_t *type, const
char *filename, const unsigned char *buffer, size_t length );
libspectrum_error libspectrum_snap_read( libspectrum_snap *snap, const
libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char
*filename );
libspectrum_error libspectrum_tape_read( libspectrum_tape *tape, const
libspectrum_byte *buffer, size_t length, libspectrum_id_t type, const char
*filename );
libspectrum_error libspectrum_rzx_read( libspectrum_rzx *rzx, const
libspectrum_byte *buffer, size_t length );
const libspectrum_creator *libspectrum_rzx_creator( const libspectrum_rzx
*rzx );
Additional public helper APIs are documented in `libspectrum.txt', including the zlib helpers libspectrum_zlib_inflate() and libspectrum_zlib_compress(), the allocation helper macros libspectrum_new, libspectrum_new0 and libspectrum_renew, the growable buffer API libspectrum_buffer_alloc() through libspectrum_buffer_append(), the loaded-file API libspectrum_file_init(), libspectrum_file_open(), libspectrum_file_read_data() and libspectrum_file_take_data(), RZX metadata inspection helpers such as libspectrum_rzx_creator(), libspectrum_rzx_get_keyid() and libspectrum_rzx_get_signature(), and state/query helpers such as libspectrum_tape_state(), the opaque tape cursor API from libspectrum_tape_cursor_capture() through libspectrum_tape_cursor_position(), and libspectrum_ide_dirty().
DESCRIPTION¶
libspectrum is a library for reading and writing some of the file formats used by emulators of the Sinclair ZX Spectrum. It also contains routines providing information about the various Spectrum clones which were available.
The file formats currently supported by libspectrum are:
- Snapshots: .z80, .szx, .sna (all read/write), .zxs, .sp., .snp and +D snapshots (read only).
- Tape images: .tzx, .tap, .spc, .sta, .ltp (read/write) and .pzx, Warajevo .tap, Z80Em and CSW version 1 (read only).
- Input recordings: .rzx (read/write).
- Disk images: .dsk (both plain and extended), .d40, .d80, .fdi, .img, .mgt, .opd, .sad, .scl, .td0, .trd and .udi (identification only).
- Timex cartridges: .dck (read only).
- IDE hard disk images: .hdf (read/write).
- Microdrive cartridge images: .mdr (read/write).
Additionally, any files compressed with bzip2(3), gzip(3) or zip(3) can be read and will be transparently decompressed. Expanded wrapper files are limited to 64 MiB; input which exceeds this limit is rejected with LIBSPECTRUM_ERROR_LIMIT.
Full documentation for libspectrum is provided in `libspectrum.txt'.
SEE ALSO¶
bzip2(3), fuse(1), fuse-utils(1), gzip(3), zip(3).
The comp.sys.sinclair Spectrum FAQ, at
http://www.worldofspectrum.org/faq/index.html.
AUTHOR¶
Philip Kendall (philip-fuse@shadowmagic.org.uk)
| 16th September, 2026 | Version 1.7.0 |