c64_tap_tool
is a command-line tool for handling C64 TAP files. It provides functionality to analyze, convert, and export data stored in the TAP format. The tool also supports converting PRG files to TAP and WAV formats.
- Analyze TAP files: Checks the structure and validity of TAP files.
- Export PRG files: Extracts PRG files from TAP files.
- Convert PRG to TAP: Creates TAP files from PRG files with correct pulse sequences.
- Convert PRG to WAV: Creates WAV files from PRG files with 44100 Hz, mono, and float data.
- Support for C64 PAL frequencies:
- Short Pulse: 365.4 µs (2737 Hz, 360 cycles)
- Medium Pulse: 531.4 µs (1882 Hz, 524 cycles)
- Long Pulse: 697.6 µs (1434 Hz, 687 cycles)
-
Clone the repository:
git clone https://github.com/ThKattanek/c64_tap_tool.git cd c64_tap_tool
-
Build the project using CMake:
mkdir build cd build cmake .. make
-
The executable will be located in the
build
directory.
The tool supports various commands that can be executed from the command line:
-
Show help:
./c64_tap_tool --help
-
Show version:
./c64_tap_tool --version
-
Analyze a TAP file:
./c64_tap_tool --analyze <tap_filename>
-
Export PRG files from a TAP file:
./c64_tap_tool --export <tap_filename>
-
Convert PRG to TAP:
./c64_tap_tool --conv2tap <prg_filename> <tap_filename>
-
Convert PRG to WAV:
./c64_tap_tool --conv2wav <prg_filename> <wav_filename>
The TAP format stores data as pulse sequences that correspond to the C64 loading sequences. The pulses are categorized into three types:
- Short Pulse: 365.4 µs
- Medium Pulse: 531.4 µs
- Long Pulse: 697.6 µs
The tool generates TAP files with correct pulse sequences, including header and data blocks.
The WAV files are created with the following properties:
- Sample rate: 44100 Hz
- Channels: Mono
- Data format: 32-bit Float
The pulse sequences are written to the WAV file as sine waves with the corresponding frequencies (e.g., 2737 Hz for Short Pulse).
This command converts a PRG file into a TAP file with correct pulse sequences:
./c64_tap_tool --conv2tap example.prg example.tap
This command converts a PRG file into a WAV file with 44100 Hz, mono, and float data:
./c64_tap_tool --conv2wav example.prg example.wav
This command analyzes the structure and validity of a TAP file:
./c64_tap_tool --analyze example.tap
This command extracts PRG files from a TAP file:
./c64_tap_tool --export example.tap
main.cpp
: Main logic of the tool, including the implementation of commands.- Pulse Functions:
WriteTAPShortPulse
: Writes a Short Pulse to the TAP file.WriteTAPMediumPulse
: Writes a Medium Pulse to the TAP file.WriteTAPLongPulse
: Writes a Long Pulse to the TAP file.WriteTAPByte
: Converts a byte into pulse sequences and writes it to the TAP file.WriteWAVShortPulse
: Writes a Short Pulse as a sine wave to the WAV file.WriteWAVMediumPulse
: Writes a Medium Pulse as a sine wave to the WAV file.WriteWAVLongPulse
: Writes a Long Pulse as a sine wave to the WAV file.WriteWAVByte
: Converts a byte into sine wave pulse sequences and writes it to the WAV file.
- C++11 or newer
- CMake 3.5 or newer
This project is licensed under the GNU GENERAL PUBLIC LICENSE. See the LICENSE
file for details.
Created by Thorsten Kattanek. Feel free to open an issue in the repository for questions or suggestions.