logo.jpg

Suggestion for TMG V1

TMG is a new tape format developed to be used for clean tape images in place of the TAP format.

Each tape/image file consist of 1 header, and 1 or more block-markers + data blocks, it ends with a $FF block-marker.

Header (11 bytes):
   "TAPE-IMAGE" (10 bytes)
   $01 (1 byte, version of format)
1 byte block-marker:
   $00 = pause
   $01 = 2 pulse block (most turbo loads)
   $02 = 3 pulse block (commodore, superpavloda, input64)
   $03 = 4 pulse block (possible, but unlikely)
   $FF = EOF marker and a crc32
Data block:
   $00, 32 bit integer for pause length

   $01, Two 16-bit values for cycle lengths of each pulse
        32-bit value for block size (bit count)
        [data represented by single bits 0, 1]

   $02, Three 16-bit values for cycle lengths of each pulse
        32-bit value for block size (bit pair count)
        [data represented by bitpairs 00, 01, 10]

   $03, Four 16-bit values for cycle lengths of each pulse
        32-bit value for block size (bit pair count)
        [data represented by bitpairs 00, 01, 10, 11]

   $FF, 4 byte crc32 (not including the crc32)

Endianness = bit couple (MSbF) and 16/32 bit values (LSBF)

preliminary name/extension = .tmg

People involved:

Bo Gøran Kvamme (bokvamme)
John Selck (Graham)
Luigi Di Fraia (TCE)
Richard Newcombe (GremlinSA)
Scott Brockway (Fungus)
Tom Roger Skauen (SLC)

Format implemented as IFF:

'FORM'   (4 bytes) = $464F524D
 Size    (4 bytes)
'TAPE'   (4 bytes) = $54415045
chunks.....
chunks:
  PAUS   Pause
    'PAUS'                       (4 bytes) = $50415553
    Size                         (4 bytes)
    Cycles                       (4 bytes)
  PLSH   Pulse header
    'PLSH'                       (4 bytes) = $504C5348
    Size                         (4 bytes)
    Pulse atoms                  (4 bytes) not including the padding
      In n-ple, where n is the lowest power of two that accomodates 'Number of pulses'.
    CRC32                        (4 bytes) CRC32 of the following DATA chunk
    Number of pulses             (1 byte) 
    Cycle length0                (2 bytes) 
    Cycle length1                (2 bytes)
    Cycle length2                (2 bytes)
    .....
    Cycle lengthN
  2PLS   2 pulse block (most turbo loads)
    '2PLS'                       (4 bytes) = $32504C53
    Size                         (4 bytes) = $0000000C
    Pulse atoms (bit count)      (4 bytes) not including the padding
    CRC32                        (4 bytes) CRC32 of the following DATA chunk
    Cycle length pulse 0         (2 bytes)
    Cycle length pulse 1         (2 bytes)
  3PLS   3 pulse block (commodore, superpavloda, input64)
    '3PLS'                       (4 bytes) = $33504C53
    Size                         (4 bytes) = $0000000E
    Pulse atoms (bitpair count)  (4 bytes) not including the padding
    CRC32                        (4 bytes) CRC32 of the following DATA chunk
    Cycle length pulse 0         (2 bytes)
    Cycle length pulse 1         (2 bytes)
    Cycle length pulse 2         (2 bytes)
  4PLS   4 pulse block (possible, but unlikely)
    '4PLS'                       (4 bytes) = $34504C53
    Size                         (4 bytes) = $00000010
    Pulse atoms (bitpair count)  (4 bytes) not including the padding
    CRC32                        (4 bytes) CRC32 of the following DATA chunk
    Cycle length pulse 0         (2 bytes)
    Cycle length pulse 1         (2 bytes)
    Cycle length pulse 2         (2 bytes)
    Cycle length pulse 3         (2 bytes)
  DATA   The tape data
    'DATA'                       (4 bytes) = $44415441
    Size                         (4 bytes)
    Data represented by single bits 0|1, or 00|01|10, or 00|01|10|11
    Data is padded to next complete byte (not included in Pulse atoms) 
optional chunks:
  HEAD
    'HEAD' (4 bytes) = $48454144
    Size   (4 bytes)
    Data   (X bytes)
      Text in std ASCI Format.. (see IFF standard)
    CRC32  (4 bytes)

The chunk ID is followed by 4 bytes (Size: the length of the chunk) and then the payload.
The Size is the size of the chunk minus the first 8 bytes (Chunk ID and Size).
The Cycle Lengths are true cycle counts (TAP Val * 8).
The Pulse atoms is a count of the total Pulse Cycles in the bit stream.
The Bit Stream is Padded with '0' bits to complete the last byte.
The crc32 checksum DOES NOT include the first 8 bytes of the chunk (Chunk ID, Chunk Size), it's for the data (payload) only.
The PLSH, 2PLS, 3PLS and 4PLS chunks are to be followed by a DATA chunk each.
The PLSH chunk is a generic version of the 2PLS, 3PLS and 4PLS chunks.

All integers are big-endian as by the IFF standard.

“EA IFF 85” - Standard for Interchange Format Files


Personal Tools