Skip to content

Commit

Permalink
- added: support the c2 offset of the plextor 712A or newer for GD (#154
Browse files Browse the repository at this point in the history
)
  • Loading branch information
saramibreak committed Nov 15, 2022
1 parent 79cab1f commit 68502df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion DiscImageCreator/DiscImageCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,14 @@ int execForDumping(PEXEC_TYPE pExecType, PEXT_ARG pExtArg, _TCHAR* pszFullPath,

if (*pExecType == gd) {
if (IsValidPlextorDrive(pDevice) && pExtArg->uiSubAddionalNum == 0) {
pExtArg->uiSubAddionalNum = 1;
if (IsPrextor712OrNewer(pDevice)) {
OutputString("[INFO] This drive has 295 offset in the c2. Changed /s 0 to /s 2.\n");
pExtArg->uiSubAddionalNum = 2;
}
else {
OutputString("[INFO] This drive has 294 offset in the c2. Changed /s 0 to /s 1.\n");
pExtArg->uiSubAddionalNum = 1;
}
}
// This func needs the combined offsets
if (!ReadGDForTOC(pExtArg, pDevice, pDisc)) {
Expand Down
5 changes: 3 additions & 2 deletions DiscImageCreator/execScsiCmdforCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,7 @@ BOOL ReadCDPartial(
}
BYTE byTransferLen = 1;
if (pDevice->byPlxtrDrive) {
byTransferLen = 2;
byTransferLen = (BYTE)(pExtArg->uiSubAddionalNum + 1);
}
// store main+(c2)+sub data
if (!GetAlignedCallocatedBuffer(pDevice, &pBuf,
Expand Down Expand Up @@ -2169,7 +2169,8 @@ BOOL ReadCDPartial(
bC2Error = TRUE;
// C2 error points the current LBA - 1 (offset?)
OutputLog(standardError | fileC2Error,
" LBA[%06d, %#07x] Detected C2 error %u bit\n", nLBA, (UINT)nLBA, pDiscPerSector->uiC2errorNum);
" LBA[%06d], LBA translation to SCM address in hex[%#x], LBA in C2 file[%#x] Detected C2 error %u bit\n"
, nLBA, nLBA* CD_RAW_SECTOR_SIZE, nLBA* CD_RAW_READ_C2_294_SIZE, pDiscPerSector->uiC2errorNum);
if (pExtArg->byC2 && pDevice->FEATURE.byC2ErrorData) {
if (!(IsValidIntentionalC2error(pDisc, pDiscPerSector, nLBA, GetC2ErrorFileIdx(pExtArg, pDisc, nLBA)))) {
pDisc->MAIN.lpAllLBAOfC2Error[pDisc->MAIN.nC2ErrorCnt++] = nLBA;
Expand Down

0 comments on commit 68502df

Please sign in to comment.