mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
General code style and feature fixes.
This commit is contained in:
@@ -213,8 +213,8 @@ public sealed partial class AaruFormat
|
||||
static (byte minute, byte second, byte frame) LbaToMsf(long pos) =>
|
||||
((byte)((pos + 150) / 75 / 60), (byte)((pos + 150) / 75 % 60), (byte)((pos + 150) % 75));
|
||||
|
||||
void ReconstructPrefix(ref byte[] sector, // must point to a full 2352-byte sector
|
||||
TrackType type, long lba)
|
||||
static void ReconstructPrefix(ref byte[] sector, // must point to a full 2352-byte sector
|
||||
TrackType type, long lba)
|
||||
{
|
||||
//
|
||||
// Sync
|
||||
|
||||
@@ -2225,25 +2225,23 @@ public sealed partial class AaruFormat
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
if(_sectorPrefixDdt != null &&
|
||||
_sectorSuffixDdt != null)
|
||||
if(_sectorPrefixDdt == null ||
|
||||
_sectorSuffixDdt == null)
|
||||
return ReadSectors(sectorAddress, length, out buffer);
|
||||
|
||||
buffer = new byte[2352 * length];
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
buffer = new byte[2352 * length];
|
||||
errno = ReadSectorLong(sectorAddress + i, out byte[] temp);
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
errno = ReadSectorLong(sectorAddress + i, out byte[] temp);
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
Array.Copy(temp, 0, buffer, 2352 * i, 2352);
|
||||
}
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
Array.Copy(temp, 0, buffer, 2352 * i, 2352);
|
||||
}
|
||||
|
||||
return ReadSectors(sectorAddress, length, out buffer);
|
||||
return ErrorNumber.NoError;
|
||||
|
||||
// Join prefix (sync, header) with user data
|
||||
case TrackType.CdMode2Formless:
|
||||
@@ -2268,25 +2266,24 @@ public sealed partial class AaruFormat
|
||||
return ErrorNumber.NoError;
|
||||
}
|
||||
|
||||
if(_sectorPrefixDdt != null &&
|
||||
_sectorSuffixDdt != null)
|
||||
if(_sectorPrefixDdt == null ||
|
||||
_sectorSuffixDdt == null)
|
||||
return ReadSectors(sectorAddress, length, out buffer);
|
||||
|
||||
buffer = new byte[2352 * length];
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
buffer = new byte[2352 * length];
|
||||
errno = ReadSectorLong(sectorAddress + i, out byte[] temp);
|
||||
|
||||
for(uint i = 0; i < length; i++)
|
||||
{
|
||||
errno = ReadSectorLong(sectorAddress + i, out byte[] temp);
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
if(errno != ErrorNumber.NoError)
|
||||
return errno;
|
||||
|
||||
Array.Copy(temp, 0, buffer, 2352 * i, 2352);
|
||||
}
|
||||
|
||||
return ErrorNumber.NoError;
|
||||
Array.Copy(temp, 0, buffer, 2352 * i, 2352);
|
||||
}
|
||||
|
||||
return ReadSectors(sectorAddress, length, out buffer);
|
||||
return ErrorNumber.NoError;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user