From ffbec9996e8488280b608f5377478191c8ad4bf0 Mon Sep 17 00:00:00 2001 From: RibShark <1957489+RibShark@users.noreply.github.com> Date: Sat, 23 Dec 2023 05:00:55 +0000 Subject: [PATCH 1/2] Update Alcohol.bt, Fixed DPM structures and added error sector structures --- Alcohol.bt | 51 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) diff --git a/Alcohol.bt b/Alcohol.bt index fac3430..82b0d36 100644 --- a/Alcohol.bt +++ b/Alcohol.bt @@ -11,6 +11,7 @@ // History: // 0.1 2018-01-08 Natalia Portillo: Initial release // 0.2 2020-07-15 RibShark: Added DPM structures +// 0.3 2023-12-23 RibShark: Fixed DPM structures and added error sector structures //------------------------------------------------ enum AlcoholMediumType @@ -32,7 +33,7 @@ enum AlcoholTrackMode Mode2F1 = 0xEC, Mode2F2 = 0xED, Mode2F1Alt = 0xAC, - Mode2F2Alt = 0xAD, + Mode2F2Alt = 0xAD }; enum AlcoholSubchannelMode @@ -41,6 +42,12 @@ enum AlcoholSubchannelMode Interleaved = 0x08 }; +enum AlcoholPhysicalType +{ + DPM = 0x01, + ErrorSectors = 0x02 +}; + typedef struct { char signature[16]; @@ -56,7 +63,7 @@ typedef struct unsigned int structuresOffset; unsigned int unknown4[3]; unsigned int sessionOffset; - unsigned int dpmOffset; + unsigned int physicalHeaderOffset; } AlcoholHeader; typedef struct @@ -122,15 +129,26 @@ typedef struct typedef struct { - uint unknown; // 0x01 - uint unknown2; // 0x1FC - uint unknown3; // 0x01 + uint blockCount; + uint blockOffsets[this.blockCount]; +} AlcoholPhysicalHeader; + +typedef struct +{ uint dpmStartSector; // 0x00 uint dpmResolution; uint dpmEntryCount; uint dpmEntries[this.dpmEntryCount]; } AlcoholDPM; +typedef struct +{ + uint unknown1; // 0x04 + uint unknown2; // 0x01 + uint errorCount; + uint errorSectors[this.errorCount]; +} AlcoholErrorSectors; + LittleEndian(); AlcoholHeader header; FSeek(header.sessionOffset); @@ -148,6 +166,23 @@ if(FTell() > 0) string Filename; } } -======= -FSeek(header.dpmOffset); -AlcoholDPM dpm; + +FSeek(header.physicalHeaderOffset); +AlcoholPhysicalHeader physicalHeader; + +local int i; +for (i = 0; i < physicalHeader.blockCount; i++) { + FSeek(physicalHeader.blockOffsets[i]); + AlcoholPhysicalType type; + + switch (type) { + case DPM: + AlcoholDPM dpm; + break; + case ErrorSectors: + AlcoholErrorSectors errorSectors; + break; + default: + break; + } +} From d9c763140227f8618b6b4ad2d7414373136f3f98 Mon Sep 17 00:00:00 2001 From: RibShark <1957489+RibShark@users.noreply.github.com> Date: Sat, 23 Dec 2023 05:06:58 +0000 Subject: [PATCH 2/2] Rename alcohol physical block type for clarity --- Alcohol.bt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Alcohol.bt b/Alcohol.bt index 82b0d36..fa4324e 100644 --- a/Alcohol.bt +++ b/Alcohol.bt @@ -42,7 +42,7 @@ enum AlcoholSubchannelMode Interleaved = 0x08 }; -enum AlcoholPhysicalType +enum AlcoholPhysicalBlockType { DPM = 0x01, ErrorSectors = 0x02 @@ -173,9 +173,9 @@ AlcoholPhysicalHeader physicalHeader; local int i; for (i = 0; i < physicalHeader.blockCount; i++) { FSeek(physicalHeader.blockOffsets[i]); - AlcoholPhysicalType type; + AlcoholPhysicalBlockType physicalBlockType; - switch (type) { + switch (physicalBlockType) { case DPM: AlcoholDPM dpm; break;