CP2

From Just Solve the File Format Problem
Jump to: navigation, search
File Format
Name CP2
Ontology
Extension(s) .cp2

CP2 is a disk image format created by the commercial disk copier Copy-II-PC in conjunction with a separate program, Snatch-It.

Contents

 [hide

Identification

The first 24 bytes of the file are ASCII 'SOFTWARE PIRATESRelease '.

File structure

Files begin with a 30-byte header:

+0x00  DB  'SOFTWARE PIRATES'
+0x10  DB  'Release '
+0x18  DB  release (printable ASCII)
+0x1C  DB  '$'
+0x1D  DB  volume number (ASCII, starting with '0')

Following the header will be one or more segments, each 64k or less in size. A segment is formed:

+0x00  DW  segment header length, little-endian word.
+0x02  DB  cylinder
+0x03  DB  head
+0x04  DB  sector
+0x05      Sector headers, 384 bytes per track.
       DW  length of sector data
       DB  sector data

To find the sector data length and sector data, take the offset in the file of the segment header and add the segment header length + 2. This address may overlap with the end of the last sector header.

A sector header is 16 bytes:

+0x00  DB  read result
+0x01  DB  8272 status register 0
+0x02  DB  8272 status register 1
+0x03  DB  8272 status register 2
+0x04  DB  Sector ID: cylinder
+0x05  DB  Sector ID: head
+0x06  DB  Sector ID: sector
+0x07  DB  Sector ID: size (0 for 128 bytes, 1 for 256 bytes, 2 for 512 bytes etc.)
+0x08  DW  Offset to sector data from start of sector data area + 0x16AD

To find the actual offset of a sector in the file, take its offset value in the header, subtract 0x16AD, and add the offset to the address of the sector data as determined from the segment header.

Software

  • [h ttps://github.com/retrohun/pce/blob/master/src/drivers/psi/psi-img-cp2.c PCE] contains some code to parse .CP2 disk images.

Sample files

  • ht tps://discmaster.textfiles.com/browse/29984/wbiz0000-0009/wbiz0008.tar/wbiz0008
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox