Difference between revisions of "Tape\Disk Preservation"

From The Dragon Archive
(Documentation of the CAS file format.)
Line 1: Line 1:
 
(Community info on how to preserve existing tape and disk software - conversion from native Dragon to PC formats - WAV, CAS, VDK, DMK, conversion between formats and restoration back to physical media)
 
(Community info on how to preserve existing tape and disk software - conversion from native Dragon to PC formats - WAV, CAS, VDK, DMK, conversion between formats and restoration back to physical media)
  
 +
== Tools ==
  
== Tape to CAS File ==
+
=== Tape to CAS File ===
  
 
Current preferred method is a special version of XROAR that will output the byte stream its virtual ADC reads from a WAV file as the tape loads (CLOAD/CLOADM).
 
Current preferred method is a special version of XROAR that will output the byte stream its virtual ADC reads from a WAV file as the tape loads (CLOAD/CLOADM).
Line 9: Line 10:
  
  
== WAV to CAS ==
+
=== WAV to CAS ===
  
 
DC.EXE
 
DC.EXE
  
  
== CAS to WAV ==
+
=== CAS to WAV ===
  
 
DC.EXE will create a clean WAV sample from a CAS file. If the CAS file has all its SYNC bytes then the resultant WAV can be loaded by a real Dragon 32/64.
 
DC.EXE will create a clean WAV sample from a CAS file. If the CAS file has all its SYNC bytes then the resultant WAV can be loaded by a real Dragon 32/64.
  
  
== "Fixing old CAS files" ==
+
=== "Fixing old CAS files" ===
  
 
Some of the older CAS files with truncated SYNC bytes can be rescued using the FIXCAS.EXE tool that attempts to insert the appropriate number of missing SYNC bytes into the CAS file.
 
Some of the older CAS files with truncated SYNC bytes can be rescued using the FIXCAS.EXE tool that attempts to insert the appropriate number of missing SYNC bytes into the CAS file.
  
  
== Disk to VDK ==
+
=== Disk to VDK ===
  
 
Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats to .VDK files.
 
Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats to .VDK files.
  
  
== Disk to DMK ==
+
=== Disk to DMK ===
  
 
Linux - dd
 
Linux - dd
  
  
== DMK to VDK ==
+
=== DMK to VDK ===
  
 
Perl Tool to add VDK header
 
Perl Tool to add VDK header
  
  
== VDK to DMK ==
+
=== VDK to DMK ===
  
 
Perl Tool to remove VDK header
 
Perl Tool to remove VDK header
  
== VDK to Disk ==
+
=== VDK to Disk ===
  
 
Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats from .VDK files to disks. The disks must have been formatted in a real Dragon first....
 
Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats from .VDK files to disks. The disks must have been formatted in a real Dragon first....
  
== DMK to Disk ==
+
=== DMK to Disk ===
  
 
Linux - dd
 
Linux - dd
  
== Dumping ROMS ==
+
=== Dumping ROMS ===
  
 
CSAVEM, start, end, exec
 
CSAVEM, start, end, exec
Line 58: Line 59:
  
 
.DGN format is a only an 8 byte header that can be removed or added to a raw rom dump.
 
.DGN format is a only an 8 byte header that can be removed or added to a raw rom dump.
 +
 +
 +
 +
== File Formats ==
 +
 +
 +
=== CAS File Format ===
 +
 +
The CAS file format represents programs or data stored on Dragon cassette tapes.  The format closely mimics how the Dragon actually stores data on cassettes, and this format is documented in ''Inside the Dragon'' (Section 8.4.4).
 +
 +
A CAS file consists of a number of blocks.  Each block contains:
 +
* A leader, comprising of any number of bytes with value 0x55.
 +
* A sync byte of value 0x3c.
 +
* A block type byte.  Valid types are 0 for namefile block, 1 for data block and 0xff for EOF block.
 +
* A byte containing the data payload size (0-255).
 +
* 0-255 bytes of payload data.
 +
* A checksum byte.  The checksum is the sum of the block type, the payload size and the data bytes.
 +
 +
For a namefile block, the payload data contains the following information:
 +
* An 8-byte program name.
 +
* A byte indicating the file type.  Valid types are 0 for a BASIC program, 1 for a data file, and 2 for a machine code program.
 +
* A byte indicating whether the file is encoded as ASCII or binary.
 +
* A byte indicating whether the file is written with gaps between blocks.  A value of 1 indicates that the file is written without gaps, and a value of 0xff indicates that it contains gaps between blocks.
 +
* Two bytes indicating the start address of a machine code program.
 +
* Two bytes indicating the load address of a machine code program.
 +
 +
The first block of a CAS file should be a namefile block, and the last block should be an EOF block.
 +
 +
Note that CAS files may omit leaders.  Use the FIXCAS utility to add leaders to more closely resemble the true Dragon cassette tape format.

Revision as of 23:21, 8 December 2009

(Community info on how to preserve existing tape and disk software - conversion from native Dragon to PC formats - WAV, CAS, VDK, DMK, conversion between formats and restoration back to physical media)

Tools

Tape to CAS File

Current preferred method is a special version of XROAR that will output the byte stream its virtual ADC reads from a WAV file as the tape loads (CLOAD/CLOADM).

Previously DC.EXE (Dragon Convert) was used to create CAS files from WAV samples but this resulted in CAS files with truncated sync bytes rather than an accurate dump of the original media.


WAV to CAS

DC.EXE


CAS to WAV

DC.EXE will create a clean WAV sample from a CAS file. If the CAS file has all its SYNC bytes then the resultant WAV can be loaded by a real Dragon 32/64.


"Fixing old CAS files"

Some of the older CAS files with truncated SYNC bytes can be rescued using the FIXCAS.EXE tool that attempts to insert the appropriate number of missing SYNC bytes into the CAS file.


Disk to VDK

Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats to .VDK files.


Disk to DMK

Linux - dd


DMK to VDK

Perl Tool to add VDK header


VDK to DMK

Perl Tool to remove VDK header

VDK to Disk

Using and old PC with a 5.25 inch drive and a DOS environment, the VCOPY.EXE tool can be used to copy some common Dragon disk formats from .VDK files to disks. The disks must have been formatted in a real Dragon first....

DMK to Disk

Linux - dd

Dumping ROMS

CSAVEM, start, end, exec Convert to CAS Use DC.EXE to extract from CAS to ROM format

.DGN format is a only an 8 byte header that can be removed or added to a raw rom dump.


File Formats

CAS File Format

The CAS file format represents programs or data stored on Dragon cassette tapes. The format closely mimics how the Dragon actually stores data on cassettes, and this format is documented in Inside the Dragon (Section 8.4.4).

A CAS file consists of a number of blocks. Each block contains:

  • A leader, comprising of any number of bytes with value 0x55.
  • A sync byte of value 0x3c.
  • A block type byte. Valid types are 0 for namefile block, 1 for data block and 0xff for EOF block.
  • A byte containing the data payload size (0-255).
  • 0-255 bytes of payload data.
  • A checksum byte. The checksum is the sum of the block type, the payload size and the data bytes.

For a namefile block, the payload data contains the following information:

  • An 8-byte program name.
  • A byte indicating the file type. Valid types are 0 for a BASIC program, 1 for a data file, and 2 for a machine code program.
  • A byte indicating whether the file is encoded as ASCII or binary.
  • A byte indicating whether the file is written with gaps between blocks. A value of 1 indicates that the file is written without gaps, and a value of 0xff indicates that it contains gaps between blocks.
  • Two bytes indicating the start address of a machine code program.
  • Two bytes indicating the load address of a machine code program.

The first block of a CAS file should be a namefile block, and the last block should be an EOF block.

Note that CAS files may omit leaders. Use the FIXCAS utility to add leaders to more closely resemble the true Dragon cassette tape format.