CloneCD (.ccd)

From Emulation General Wiki
(Redirected from Clonecd)
Jump to navigation Jump to search
Main article: Ripping games

A CloneCD Control File, or .CCD file, is a text descriptor used by CloneCD to store the subcode data of a CD/DVD image. It contains control information such as track locations and header data, which are essential for accurately reproducing the disc layout when burning or emulating the image. The .CCD file must be used in conjunction with an .IMG file, which holds the actual disc data, and optionally a .SUB file for subchannel data. This format is particularly useful for creating exact copies of discs, including those with copy protection, making it relevant for game emulation.

Format

[edit | edit source]

The .CCD file is structured in an INI-like format, consisting of sections and properties. Each section is denoted by a name in square brackets, and properties are key-value pairs in the format `name=value` (no spaces around `=`). Sections cannot be nested, and each non-indexed section or property appears only once per file.

Sections and Properties

[edit | edit source]

[CloneCD]

[edit | edit source]
Property Description
Version Indicates the version of the CloneCD format, typically 3.

[Disc]

[edit | edit source]
Property Description
TocEntries Number of [Entry N] sections, which contain lead-in information.
Sessions Number of sessions on the disc, usually 1 for most CDs.
DataTracksScrambled Indicates if data tracks are scrambled, usually 0.
CDTextLength Total size of CD-TEXT data in bytes, often 0 if no CD-TEXT is present.
CATALOG Optional, 13-digit EAN-13 barcode if present.

[CDText]

[edit | edit source]
Property Description
Entries Number of CD-TEXT entries.
Entry 0..N-1 Each entry contains 16 bytes of CD-TEXT data in hexadecimal format.

[Session 1]

[edit | edit source]
Property Description
PreGapMode Mode of the pregap, possibly 0=Audio, 1=Mode1, 2=Mode2.
PreGapSubC Unknown purpose, usually 0 or 1.

[Entry 0..N]

[edit | edit source]

These sections contain lead-in information for each track or special points like A0, A1, A2.

Property Description
Session Session number, usually 1.
Point Track number (1-99) or special values (A0-A2).
ADR Lower 4 bits of ADR/Control, usually 1.
Control Upper 4 bits of ADR/Control, e.g., 0 for audio, 4 for data.
TrackNo Usually 0 for lead-in entries.
AMin, ASec, AFrame Dummy zero values.
ALBA Calculated as ((AMin*60+ASec)*75+AFrame)-PreGapSize.
Zero Probably reserved, usually 0.
PMin, PSec, PFrame Referenced MSF address (non-BCD).
PLBA Calculated as ((PMin*60+PSec)*75+PFrame)-PreGapSize.

[TRACK N]

[edit | edit source]

For each track, where N is the track number.

Property Description
MODE 0=Audio, 1=Mode1, 2=Mode2.
ISRC Optional, 12-character ISRC code.
INDEX 0 First sector with index 0, if present.
INDEX 1 First sector with index 1, usually the start of the track.
INDEX 2..etc Additional indices if present.

Notes:

  • PreGapSize is typically constant at 150 sectors, and SectorSize is 2352 bytes (930h).
  • All Min/Sec/Frame/Track/Index values are non-BCD; convert to BCD for real CD values, except in special cases (e.g., PSec=32 for Point A0h indicates DiscType=20h=CD-ROM-XA).
  • The .SUB file is optional, containing 96 bytes per sector for subchannel data (P..W), and may be omitted or empty for discs without non-standard subchannel data.

Examples

[edit | edit source]

Single-track Game

[edit | edit source]

Most PS1 games are single-track, so a .CCD file for such a game might look like this: ```

[CloneCD]
Version=3

[Disc]
TocEntries=3
Sessions=1
DataTracksScrambled=0
CDTextLength=0

[Session 1]
PreGapMode=1
PreGapSubC=0

[Entry 0]
Session=1
Point=0xa0
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=1
PSec=0
PFrame=0
PLBA=0

[Entry 1]
Session=1
Point=0x01
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=0
PSec=2
PFrame=0
PLBA=0

[Entry 2]
Session=1
Point=0xaa
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=74
PSec=0
PFrame=0
PLBA=332250

[TRACK 1]
MODE=1
INDEX 1=0

``` Replace the filenames in the corresponding .IMG file (e.g., "GAME NAME [1] US.img") to match your game's file name.

Multi-track Game

[edit | edit source]

Certain PS1 games like Rayman or Brave Fencer Musashi are multi-track, requiring multiple [TRACK N] sections. Below is an example for a multi-track game like Brave Fencer Musashi: ```

[CloneCD]
Version=3

[Disc]
TocEntries=6
Sessions=1
DataTracksScrambled=0
CDTextLength=0

[Session 1]
PreGapMode=2
PreGapSubC=0

[Entry 0]
Session=1
Point=0xa0
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=1
PSec=0
PFrame=0
PLBA=0

[Entry 1]
Session=1
Point=0xa1
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=4
PSec=0
PFrame=0
PLBA=0

[Entry 2]
Session=1
Point=0xa2
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=74
PSec=0
PFrame=0
PLBA=332250

[Entry 3]
Session=1
Point=0x01
ADR=1
Control=4
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=0
PSec=2
PFrame=0
PLBA=0

[Entry 4]
Session=1
Point=0x02
ADR=1
Control=0
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=10
PSec=0
PFrame=0
PLBA=4500

[Entry 5]
Session=1
Point=0x03
ADR=1
Control=0
TrackNo=0
AMin=0
ASec=0
AFrame=0
ALBA=-150
Zero=0
PMin=20
PSec=0
PFrame=0
PLBA=13500

[TRACK 1]
MODE=2
INDEX 1=0

[TRACK 2]
MODE=0
INDEX 0=4500
INDEX 1=6000

[TRACK 3]
MODE=0
INDEX 0=13500
INDEX 1=15000

```

For complex multi-track games like Rayman with many audio tracks, the .CCD file would include additional [TRACK N] sections for each track, similarly to the .cue file example provided previously. Due to space constraints, a full example is not included here, but you can refer to redump.info for specific track layouts.

Usage in Emulation

[edit | edit source]

For PS1 games, emulators like Mednafen support loading games via .CCD files along with their corresponding .IMG and .SUB files. To use a .CCD file in Mednafen, ensure that all related files (.CCD, .IMG, .SUB) are in the same directory and load the .CCD file. This setup ensures accurate emulation of the disc's structure, which is critical for games with multiple tracks or specific data layouts.

If a .CCD file is missing or incorrect, you may need to create one based on the disc's structure. Tools like ImgBurn or IsoBuster can help generate or validate .CCD files. For specific PS1 games, checking resources like redump.info can provide accurate track information to construct a proper .CCD file.

Conversion Tools

[edit | edit source]
  • ccd2iso: A Linux command-line tool to convert ISO9660-compliant .CCD/.IMG files to an .ISO image.
  • ccd2cue: A GNU tool to convert a .CCD file to a .cue sheet, useful for compatibility with emulators that prefer .cue files.

Notes

[edit | edit source]
  • The .CCD format is proprietary, and no authoritative, free, public specification exists. The information provided is based on observations and community documentation.
  • The .SUB file is optional and typically used for discs with non-standard subchannel data, such as copy-protected games. Some .CCD images may include an empty 0-byte .SUB file, which is equivalent to omitting it.
  • For PS1 games, the .CCD format is one of the few that supports Mixed Mode CDs (containing both audio and data tracks), alongside .CUE/.BIN and .MDS/.MDF formats.
[edit | edit source]