mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add support for negative sectors to read and write sector calls in images.
This commit is contained in:
@@ -125,7 +125,7 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSector(byte[] data, ulong sectorAddress, SectorStatus sectorStatus)
|
||||
public bool WriteSector(byte[] data, ulong sectorAddress, bool negative, SectorStatus sectorStatus)
|
||||
{
|
||||
if(!IsWriting)
|
||||
{
|
||||
@@ -134,6 +134,13 @@ public sealed partial class MaxiDisk
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negative)
|
||||
{
|
||||
ErrorMessage = Localization.Unsupported_feature;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(data.Length != 512)
|
||||
{
|
||||
ErrorMessage = Localization.Incorrect_data_size;
|
||||
@@ -159,7 +166,7 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectors(byte[] data, ulong sectorAddress, uint length, SectorStatus[] sectorStatus)
|
||||
public bool WriteSectors(byte[] data, ulong sectorAddress, bool negative, uint length, SectorStatus[] sectorStatus)
|
||||
{
|
||||
if(!IsWriting)
|
||||
{
|
||||
@@ -168,6 +175,13 @@ public sealed partial class MaxiDisk
|
||||
return false;
|
||||
}
|
||||
|
||||
if(negative)
|
||||
{
|
||||
ErrorMessage = Localization.Unsupported_feature;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if(data.Length % 512 != 0)
|
||||
{
|
||||
ErrorMessage = Localization.Incorrect_data_size;
|
||||
@@ -193,7 +207,7 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorLong(byte[] data, ulong sectorAddress, SectorStatus sectorStatus)
|
||||
public bool WriteSectorLong(byte[] data, ulong sectorAddress, bool negative, SectorStatus sectorStatus)
|
||||
{
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
@@ -201,7 +215,8 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length, SectorStatus[] sectorStatus)
|
||||
public bool WriteSectorsLong(byte[] data, ulong sectorAddress, bool negative, uint length,
|
||||
SectorStatus[] sectorStatus)
|
||||
{
|
||||
ErrorMessage = Localization.Writing_sectors_with_tags_is_not_supported;
|
||||
|
||||
@@ -285,7 +300,7 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag)
|
||||
public bool WriteSectorTag(byte[] data, ulong sectorAddress, bool negative, SectorTagType tag)
|
||||
{
|
||||
ErrorMessage = Localization.Unsupported_feature;
|
||||
|
||||
@@ -293,7 +308,7 @@ public sealed partial class MaxiDisk
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag)
|
||||
public bool WriteSectorsTag(byte[] data, ulong sectorAddress, bool negative, uint length, SectorTagType tag)
|
||||
{
|
||||
ErrorMessage = Localization.Unsupported_feature;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user