diff --git a/docs/spec/spec.adoc b/docs/spec/spec.adoc index 9e74d69..9bd2d96 100644 --- a/docs/spec/spec.adoc +++ b/docs/spec/spec.adoc @@ -102,4 +102,8 @@ include::structs/tape_file.adoc[] <<< -include::structs/tape_partition.adoc[] \ No newline at end of file +include::structs/tape_partition.adoc[] + +<<< + +include::structs/cd_indexes.adoc[] \ No newline at end of file diff --git a/docs/spec/structs/cd_indexes.adoc b/docs/spec/structs/cd_indexes.adoc new file mode 100644 index 0000000..b48fcae --- /dev/null +++ b/docs/spec/structs/cd_indexes.adoc @@ -0,0 +1,74 @@ +=== Compact Disc Indexes Block ('CDIX') + +On CompactDisc and related media, tracks can contain multiple indexes. +These are used to mark separations in the data, such as distinct segments of a musical performance. + +The table of contents always references index 1. All other indexes—including index 0 (the pregap)—are stored in the subchannel information. + +This block holds a list of all known indexes for quick lookup. + +==== Structure Definition + +[source,c] +#define CD_INDEXES_MAGIC 0x58444943 +/* TODO */ + +==== Field Descriptions + +[cols="2,2,2,6",options="header"] +|=== +|Type +|Size +|Name +|Description + +|uint32_t +|4 bytes +|identifier +|The compact disc indexes block identifier, always `CDIX` + +|uint16_t +|2 bytes +|entries +|The number of entries following this header + +|uint32_t +|4 bytes +|length +|The length in bytes of the data following this header. + +|uint64_t +|8 bytes +|crc64 +|The CRC64-ECMA checksum of the data following this header +|=== + +==== Index entries + +[source,c] +/* TODO */ + +==== Field Descriptions + +[cols="2,2,2,6",options="header"] +|=== +|Type +|Size +|Name +|Description + +|uint16_t +|2 bytes +|track +|Track this index belongs to. + +|uint16_t +|2 bytes +|index +|Index number. + +|int32_t +|4 bytes +|lba +|LBA where this index starts. +|=== \ No newline at end of file