fixed: transfer lengthaxisleon wrote:DIC v.20140518 read HDA slowly and easy to fail, back to old v.20120707
fixed: c2 error fix logic
about edccchk
oh.. I didn't know this tool. it is recommended than my tool in the error report.
fixed: transfer lengthaxisleon wrote:DIC v.20140518 read HDA slowly and easy to fail, back to old v.20120707
Code: Select all
////////////////////////////////////////////////////////////////////////////////
//
// Check if this is a sector we can compress
//
// Sector types:
// 0: Literal bytes (not a sector)
// 1: 2352 mode 1 predict sync, mode, reserved, edc, ecc
// 2: 2336 mode 2 form 1 predict redundant flags, edc, ecc
// 3: 2336 mode 2 form 2 predict redundant flags, edc
//
static int8_t detect_sector(const uint8_t* sector, size_t size_available) {
if (
size_available >= 2352 &&
sector[0x000] == 0x00 && // sync (12 bytes)
sector[0x001] == 0xFF &&
sector[0x002] == 0xFF &&
sector[0x003] == 0xFF &&
sector[0x004] == 0xFF &&
sector[0x005] == 0xFF &&
sector[0x006] == 0xFF &&
sector[0x007] == 0xFF &&
sector[0x008] == 0xFF &&
sector[0x009] == 0xFF &&
sector[0x00A] == 0xFF &&
sector[0x00B] == 0x00 &&
sector[0x00F] == 0x01 && // mode (1 byte)
sector[0x814] == 0x00 && // reserved (8 bytes)
sector[0x815] == 0x00 &&
sector[0x816] == 0x00 &&
sector[0x817] == 0x00 &&
sector[0x818] == 0x00 &&
sector[0x819] == 0x00 &&
sector[0x81A] == 0x00 &&
sector[0x81B] == 0x00
) {
//
// Might be Mode 1
//
if (
ecc_checksector(
sector + 0xC,
sector + 0x10,
sector + 0x81C
) &&
edc_compute(0, sector, 0x810) == get32lsb(sector + 0x810)
) {
return 1; // Mode 1
}
}
else if (
size_available >= 2336 &&
sector[0x10] == sector[0x14] && // flags (4 bytes)
sector[0x11] == sector[0x15] && // versus redundant copy
sector[0x12] == sector[0x16] &&
sector[0x13] == sector[0x17]
) {
//
// Might be Mode 2, Form 1 or 2
//
if (
ecc_checksector(
zeroaddress,
sector + 0x10,
sector + 0x10 + 0x80C
) &&
edc_compute(0, sector + 0x10, 0x808) == get32lsb(sector + 0x10 + 0x808)
) {
return 2; // Mode 2, Form 1
}
//
// Might be Mode 2, Form 2
//
if (
edc_compute(0, sector + 0x10, 0x91C) == get32lsb(sector + 0x10 + 0x91C)
) {
return 3; // Mode 2, Form 2
}
else {
return 4; // Mode 2, No EDC (for PlayStation)
}
}
//
// Nothing
//
return 0;
}I think so, too.Ideally, should be reported as warning.
Shouldn't I fix the subcode automatically?pablogm123 wrote:http://www.mediafire.com/?zyggub7owugg48q
Test of a PS1 disc with LibCrypt protection.
https://redump.info/disc/355/
To check what DIC does regarding the modified subcode frames, they are mentioned in the DB entry.