zentools

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2026 License: Apache-2.0

README

zentools

A library of ZX Spectrum binary-format tools written in Go: tape images, snapshots, and related formats, packaged as reusable, dependency-free packages that other tools (assemblers, emulators, disk utilities) can import.

Status

Early. The first package is pkg/tap, with TZX, BASIC tokenisation, and snapshot formats to follow.

Packages

pkg/tap

Reads and writes ZX Spectrum TAP files. The core works in memory:

import "github.com/ha1tch/zentools/pkg/tap"

// Wrap assembled bytes as a CODE block loaded at 0x8000.
image := tap.EncodeCode("mygame", code, 0x8000)
os.WriteFile("mygame.tap", image, 0o644)

EncodeCode and EncodeProgram return the complete TAP bytes; WriteCodeFile is a file-to-file convenience wrapper. The CODE-block encoding is verified byte-identical to pasmo's --tap output.

Requirements

  • Go 1.25 or later

Building

go build ./...
go test ./...

License

Licensed under the Apache License, Version 2.0. See the LICENSE file.

Directories

Path Synopsis
pkg
basic
Package basic tokenises and detokenises Sinclair BASIC programs.
Package basic tokenises and detokenises Sinclair BASIC programs.
snapshot
Package snapshot reads and writes ZX Spectrum snapshot files (.sna and .z80) via a neutral MachineState.
Package snapshot reads and writes ZX Spectrum snapshot files (.sna and .z80) via a neutral MachineState.
tap
Package tap reads and writes ZX Spectrum TAP files.
Package tap reads and writes ZX Spectrum TAP files.
tzx
Package tzx reads and writes ZX Spectrum TZX tape images.
Package tzx reads and writes ZX Spectrum TZX tape images.
version
Package version provides version information for zenas.
Package version provides version information for zenas.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL