Skip to main content

Visualize floppy disk flux patterns

Project description

a2woz - minimally process a2r files into woz files

Usage

One-time installation:

pip install https://github.com/adafruit/a2woz

Convert a single file:

a2woz input.a2r

Convert multiple files, with output directory:

a2woz --output-dir out *.a2r

Full usage:

a2woz --help

Theory of a2r to woz raw conversion:

The a2r file contains "1 and a fraction" revolutions, for each track. (It can actually contain multiple revolutions, but ignore that for now)

a2woz takes a revolution, then finds all the "sync points". "sync points" are a sequence of 2 or more "FF36" or "FF40", which are used by the floppy interface controller to synchronize with data on the floppy.

For each pair of sync points within some distance of the start of the capture, and some distance of the "estimated bit length" of the capture, find the similarity measure. A similarity of 1.0 indicates that the next few thousand bits (at least one full 256-byte sector) are an exact match; a similiary of 0.67 seems to happen for random/fake flux regions.

The pair of sync points with the best similarity is used as the "exact bit length" of the track. Ties are broken by choosing the resulting track length that is closest to the estimated bit length. Chop the flux after exactly this many bits, and write it to the output woz file.

That's about all there is to it.

This has worked for a small set of a2r files:

  • Amnesia - Disk 1, Side A.a2r (4am from archive.org)
  • DOS 3.3 System Master [1983] - Disk 1, Side A.a2r (cowgod from archive.org)
  • skyfox.a2r (jepler from fluxengine)

TODO

  • Share with the world
  • Try more a2rs
  • Graft in the greaseweazle flux readers & use them as input formats
  • Try different revolutions, if available in the a2r file, hopefully finding a single best revolution
  • Properly handle "weak bits" by locating stretches that look like they are not valid flux (due to sequences of 3+ zeros), and setting all the bits in the region to 0. A proper emulator then generates fake flux for these sections of the track.

Credits

a2woz is based on passport.py, a2rchery, and wozardry from @a2-4am.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2woz-0.1.0a0.tar.gz (34.5 kB view details)

Uploaded Source

Built Distribution

a2woz-0.1.0a0-py3-none-any.whl (27.7 kB view details)

Uploaded Python 3

File details

Details for the file a2woz-0.1.0a0.tar.gz.

File metadata

  • Download URL: a2woz-0.1.0a0.tar.gz
  • Upload date:
  • Size: 34.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for a2woz-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 faff1b838d50b22dc65431c8c83c26338da93c54328254a1a9c53234c9eadbf0
MD5 23b6ccec0383bd5eacee1fcfb9f5020d
BLAKE2b-256 8a9c08c3d98e8f57b5f347cc56ba2ec6e1e6eca9a4569b53bf499b27350d04cd

See more details on using hashes here.

File details

Details for the file a2woz-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: a2woz-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 27.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.4

File hashes

Hashes for a2woz-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 017d2c54c53f24c2771b311d17785cd545c3108c22a7cafbdcfc3d4065155699
MD5 27e8c6e97d95b9e7c9dcac9a3bd1fd19
BLAKE2b-256 7b00216a9e06c02aa2ab1711b145f58f6565c5db41fc037e10613b544f0f3ea6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page