Technical Info

DC2N format (.DMP)

I introduced the DC2N format for tape recording and dumping operations. For comparison, the standard DC2N counter rate (2 MHz) is about 16 times higher than the one used by the TAP format (123.156 kHz). Each sample is the delay, expressed in clock cycles (at counter rate), between two consecutive rising [falling] edges. On a Commodore computer these occur at the computer’s write line [datassette read line] when recording [playing back] a tape, respectively.
0xFFFF at 16 bits per sample, and more in general the max value for a sample, is an overflow value, meaning that subsequent samples should be summed to this one to build up the total delay, up to the first non-0xFFFF sample (included).

The dc2nconv software is provided to convert DC2N 16-bit files to TAP v1 files, which are already supported by many emulators and tools.

Anybody can support the DMP format in their own software, as long as the following conditions are met:

  • DMP files must only be written using a hard real-time system used for doing the sampling
  • DMP files must NOT be edited: that includes trimming, splitting, enhancing, or correcting them (only exception being manual changes required to restore corrupted data: when that happens, both the original and restored DMP files together with a detailed report of the changes have to be bundled together and made available at the same time, i.e. not just “upon request”)
  • DMP files can be used for waveform generation, both in hardware or software
  • DMP files can be converted to TAP format (preferably version 1 or later)

Version 0

DC2N version 0 DMP format specification:

Offset Size Description
0x00 12 bytes ID string: “DC2N-TAP-RAW”
0x0C 1 byte Format version: 0
0x0D 1 byte Machine for which the tape content is intended

  • 0 = Commodore 64, Generic
  • 1 = VIC 20
  • 2 = Commodore 16, Plus/4

This information is only used to convert to TAP format.

0x0E 1 byte Video standard for which the tape content is intended

  • 0 = PAL
  • 1 = NTSC

This information is only used to convert to TAP format

0x0F 1 byte Bits per sample: 16 in DC2N
0x10 4 bytes Counter rate (LSBF) [Hz]: 2000000 in DC2N (0x80 0x84 0x1E 0x00)
0x14 any Samples (LSBF).

Version 1

DC2N version 1 DMP format specification:

Offset Size Description
0x00 12 bytes ID string: “DC2N-TAP-RAW”
0x0C 1 byte Format version: 1
0x0D 1 byte Lower 4 bits: Machine for which the tape content is intended

  • %0000 = Commodore 64, Generic
  • %0001 = VIC 20
  • %0010 = Commodore 16, Plus/4

Upper 4 bits: Type of event used to define pulse start/end

  • bit 4:
    0 = dump (starts at a falling edge)
    1 = record (starts at a rising edge)
  • bit 5:
    0 = measure length of 0+1 states as a whole
    1 = measure length of 0 and 1 states individually
  • bits 6-7:
    reserved for future use (must be clear)

This information is only used to convert to TAP format.

0x0E 1 byte Video standard for which the tape content is intended

  • 0 = PAL
  • 1 = NTSC

This information is only used to convert to TAP format

0x0F 1 byte Bits per sample: 16 in DC2N
0x10 4 bytes Counter rate (LSBF) [Hz]: 2000000 in DC2N (0x80 0x84 0x1E 0x00)
0x14 any Samples (LSBF).

Although DMP version 1 with all 4 event bits clear is equivalent to DMP version 0 (for tape dumps only), the latter is preferred due to the number of DMP version 0 files already available at this stage.
DMP version 1 is recommended only for those cases where recording the 0-state and 1-state of square waves is necessary (e.g. for C16, where the MCU is capable of detecting such states individually and a few turbo loaders take advantage of that – such as the turbo loaders used by some freezer).


TAP Index format (.IDX)

The TAP Index (.IDX) format is a lightweight indexing scheme that pairs a Commodore tape image (.TAP) with a small table of offsets, enabling quasi-random access into a tape compilation. It was defined by Gideon Zweijtzer and Tom Roger Skauen, with some additional feedback from myself.

For correct association, an .IDX file is expected to share the same base name as its corresponding .TAP file, differing only in extension. For example, Games.TAP would be indexed by Games.IDX. This ensures that software or hardware loaders can automatically pair tape images with their respective index files without additional configuration.

Each entry in an IDX file maps a file offset to a logical file or record within the TAP stream. By referencing this index, playback hardware such as the DC2N5-LC can “rewind to 000” and resume from a specified location, effectively skipping ahead to sub-files without scanning the whole tape from the beginning.

Users might want to think of a game such as one of Epyx’s “Games” with multiple events that one can enable individually. They would be able to skip the section of the TAP file that loads non-active events and jump straight to useful sections.

A nice feature of the format is its flexibility in expressing offsets: indices can be written as decimal values, as hexadecimal if prefixed with 0x, or as octal if prefixed with 0. The offset and its corresponding record description can be separated by either a space or a tab character, making the format forgiving and easy to edit by hand.

Example contents:

# This is a comment
0x14		Silkworm
0x8306a		The Great Gianna Sisters
; This is a comment too
' This is another one too

Although simple, the IDX scheme significantly improves usability: it never alters the underlying TAP data, but adds an index layer that makes compilations and multi-load games behave more like collections of discrete files.


PETSCII format (.PET)

I introduced the PETSCII format for exchanging PETSCII graphics between graphic editors, such as Marq’s PETSCII Editor (November 2020 Edition), and the C64 Raster Effect Editor.

Specification:

Offset Size Description
0x00 1 byte Screen columns in chars (40 for a whole C64 screen)
0x01 1 byte Screen rows in chars (25 for a whole C64 screen)
0x02 1 byte Border color ($D020)
0x03 1 byte Background color ($D021)
0x05 1 byte
  • 0 = Uppercase PETSCII set
  • 1 = Lowercase PETSCII set
0x06 width*height bytes Video RAM data (in row-major order)
0x06 + width*height width*height bytes Color RAM data (in row-major order)

Making digital backups of Sinclair Spectrum tapes with a DC2N

Here’s the process to make such backups, which was shared with me by Massi Cadenti:

Bear in mind that you might have to tweak the C2N datassette head alignment to be able to read Sinclair Spectrum tapes. You can use the monitoring mode in DC2N5-LC for this alignment purposes.