Skip to content

Commit

Permalink
2017-10-10
Browse files Browse the repository at this point in the history
- changed: /r option is used only by data command
- changed: /raw option is used only by the multi-session disc
- changed: Enable multiple execution
- fixed: Getting the subchannel offsets (Resident Evil 2 Disc 2 (Eu))
- fixed: Descrambling from 00:01:00 to 00:01:74 when used /p option
- fixed: GMT of the CD log, UTC of the DVD log
- improved: Checking argument (cd, dvd)
- improved: Reading directory record (SimCity 3000 (USA))
- improved: Reading DVD structure
  • Loading branch information
saramibreak committed Oct 9, 2017
1 parent da4d2ae commit 2b2d431
Show file tree
Hide file tree
Showing 17 changed files with 865 additions and 961 deletions.
392 changes: 169 additions & 223 deletions DiscImageCreator/DiscImageCreator.cpp

Large diffs are not rendered by default.

42 changes: 18 additions & 24 deletions DiscImageCreator/check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1155,7 +1155,7 @@ VOID CheckAndFixSubQ(
// LBA[208052, 0x32cb4], Audio, 2ch, Copy NG, Pre-emphasis No, Track[56], Idx[01], RMSF[03:15:35], AMSF[46:16:00], RtoW[0, 0, 0, 0]
// LBA[208053, 0x32cb5], Audio, 2ch, Copy NG, Pre-emphasis No, Track[56], Idx[01], RMSF[03:15:36], AMSF[46:16:03], RtoW[0, 0, 0, 0]
// LBA[208054, 0x32cb6], Audio, 2ch, Copy NG, Pre-emphasis No, Track[56], Idx[01], RMSF[03:15:37], AMSF[46:16:04], RtoW[0, 0, 0, 0]
BOOL bAMSF = IsValidSubQAMSF(pExecType, pDisc->SUB.byIndex0InTrack1, pSubQ, lpSubcode, nLBA);
BOOL bAMSF = IsValidSubQAMSF(pExecType, pExtArg->byPre, pSubQ, lpSubcode, nLBA);
BOOL bAFrame = IsValidSubQAFrame(lpSubcode, nLBA);

if (-76 < nLBA) {
Expand Down Expand Up @@ -1400,7 +1400,7 @@ VOID CheckAndFixSubQ(
lpSubcode[18] = 0;
}

if (!IsValidSubQAMSF(pExecType, pDisc->SUB.byIndex0InTrack1, pSubQ, lpSubcode, nLBA)) {
if (!IsValidSubQAMSF(pExecType, pExtArg->byPre, pSubQ, lpSubcode, nLBA)) {
BYTE byFrame = 0;
BYTE bySecond = 0;
BYTE byMinute = 0;
Expand Down Expand Up @@ -1664,7 +1664,7 @@ VOID CheckAndFixSubChannel(
BOOL bSecuRom
)
{
if (pDisc->SUB.nSubchOffset) {
if (pDisc->SUB.nSubChannelOffset) {
SetTmpSubQDataFromBuffer(&pDiscPerSector->subQ.next, pDiscPerSector->subcode.next);
if (1 <= pExtArg->dwSubAddionalNum) {
SetTmpSubQDataFromBuffer(&pDiscPerSector->subQ.nextNext, pDiscPerSector->subcode.nextNext);
Expand Down Expand Up @@ -1742,36 +1742,30 @@ BOOL ContainsC2Error(
return bRet;
}

BOOL SupportIndex0InTrack1(
VOID SupportIndex0InTrack1(
PEXT_ARG pExtArg,
PDEVICE pDevice,
PDISC pDisc
PDEVICE pDevice
)
{
BOOL bRet = TRUE;
if (pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX760A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX755A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX716AL ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX716A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX714A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX712A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX708A2 ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX708A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PX704A ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PREMIUM2 ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PREMIUM ||
pDevice->byPlxtrDrive == PLXTR_DRIVE_TYPE::PXW5224A) {
pDisc->SUB.byIndex0InTrack1 = TRUE;
}
else {
if (pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX760A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX755A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX716AL &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX716A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX714A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX712A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX708A2 &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX708A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PX704A &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PREMIUM2 &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PREMIUM &&
pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::PXW5224A) {
OutputString(
_T("This drive doesn't support to rip from 00:00:00 to 00:01:74 AMSF. /p option is ignored\n"));
pExtArg->byPre = FALSE;
}
return bRet;
}

BOOL ExecCheckingSubchannnel(
BOOL IsCheckingSubChannel(
PEXT_ARG pExtArg,
PDISC pDisc,
INT nLBA
Expand Down
7 changes: 3 additions & 4 deletions DiscImageCreator/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,12 @@ BOOL ContainsDiffByte(
UINT i
);

BOOL SupportIndex0InTrack1(
VOID SupportIndex0InTrack1(
PEXT_ARG pExtArg,
PDEVICE pDevice,
PDISC pDisc
PDEVICE pDevice
);

BOOL ExecCheckingSubchannnel(
BOOL IsCheckingSubChannel(
PEXT_ARG pExtArg,
PDISC pDisc,
INT nLBA
Expand Down
10 changes: 9 additions & 1 deletion DiscImageCreator/execScsiCmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ BOOL ReadTOCFull(
ReadTOCText(pExtArg, pDevice, pDisc, fpCcd);
}
}
pDisc->SCSI.bMultiSession = fullToc.LastCompleteSession > 1 ? TRUE : FALSE;

WORD wFullTocLenFix = wTocEntriesAll + sizeof(CDROM_TOC_FULL_TOC_DATA);
// 4 byte padding
Expand Down Expand Up @@ -794,7 +795,7 @@ BOOL ReadDriveInformation(
IsValidPlextorDrive(pDevice);
if ((PLXTR_DRIVE_TYPE)pDevice->byPlxtrDrive != PLXTR_DRIVE_TYPE::No) {
if (pExtArg->byPre) {
SupportIndex0InTrack1(pExtArg, pDevice, pDisc);
SupportIndex0InTrack1(pExtArg, pDevice);
}
ReadEeprom(pExtArg, pDevice);
SetSpeedRead(pExtArg, pDevice, TRUE);
Expand Down Expand Up @@ -896,6 +897,13 @@ BOOL ReadDirectoryRecordDetail(
CHAR szCurDirName[MAX_FNAME_FOR_VOLUME] = { 0 };
LPBYTE lpDirRec = lpBuf + uiOfs;
if (lpDirRec[0] >= MIN_LEN_DR) {
if (lpDirRec[0] == MIN_LEN_DR && uiOfs > 0 && uiOfs % DISC_RAW_READ_SIZE == 0) {
// SimCity 3000 (USA)
OutputVolDescLogA(
"Direcory record size of the %d sector maybe incorrect. Skip the reading of this sector\n", nLBA);
nSectorNum++;
break;
}
DWORD dwExtentPos = GetSizeOrDwordForVolDesc(lpDirRec + 2) / byLogicalBlkCoef;
DWORD dwDataLen = GetSizeOrDwordForVolDesc(lpDirRec + 10);
OutputFsDirectoryRecord(
Expand Down
Loading

0 comments on commit 2b2d431

Please sign in to comment.