libspectrum(3)
π libspectrum(3) β the Emulators section, bestie π
okay so you found the man page for libspectrum, the Sinclair ZX Spectrum support library, and I am so glad you're here because this thing is iconic and also kind of a lot. Manual section 3, we love her. π
β¨ 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 );
and there's a whole extra pile of public helper APIs, all documented over in libspectrum.txt, bestie, including:
- the zlib helpers
libspectrum_zlib_inflate()andlibspectrum_zlib_compress() - the allocation helper macros
libspectrum_new,libspectrum_new0andlibspectrum_renew - the growable buffer API,
libspectrum_buffer_alloc()throughlibspectrum_buffer_append() - RZX signature inspection helpers like
libspectrum_rzx_get_keyid()andlibspectrum_rzx_get_signature() - state/query helpers like
libspectrum_tape_state()andlibspectrum_ide_dirty()
like, the range. the versatility. we stan. π
πΈ DESCRIPTION πΈ
libspectrum is a library for reading and writing some of the file formats used by emulators of the Sinclair ZX Spectrum. and not just that β it also has routines serving up info about all the various Spectrum clones that were out there in the wild. history lesson AND a library, no cap. πβ¨
the file formats it currently supports are:
- Snapshots:
.z80,.szx,.sna(all read/write), and.zxs,.sp.,.snpand+Dsnapshots (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,.trdand.udi(identification only). - Timex cartridges:
.dck(read only). - IDE hard disk images:
.hdf(read/write). - Microdrive cartridge images:
.mdr(read/write).
and the chef's kiss part: any files compressed with bzip2(3), gzip(3) or zip(3) can be read, and they'll get transparently decompressed for you. she just handles it. π
real talk though β the full documentation forlibspectrumlives inlibspectrum.txt. this page is the vibe check, that file is the whole syllabus. π
π SEE ALSO π
bzip2(3)fuse(1)fuse-utils(1)gzip(3)zip(3)
also the comp.sys.sinclair Spectrum FAQ, sitting pretty at http://www.worldofspectrum.org/faq/index.html β go read it, fr fr. π
π AUTHOR π
Philip Kendall (philip-fuse@shadowmagic.org.uk)
and that's the whole page, bestie!! π this was Version 1.6.3, dated 25th July, 2026, and yes I'm mentioning it here instead of copying the footer line, because we keep the facts but ditch the boring formatting. mwah. π π«Ά
π¦ where this page comes from
- nixpkgs unstable: libspectrum 1.6.3
- ubuntu stonking: libspectrum-dev 1.6.3-1 Β· GPL-2.0-or-later
- Copyright (c) 2004-2026 Philip Kendall
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms