[AaruFormat] More V1 behavior with not dumped sectors.

This commit is contained in:
2025-10-26 19:33:31 +00:00
parent b47bbb5680
commit 22314ecb07

View File

@@ -77,6 +77,14 @@ public sealed partial class AaruFormat
Status res = aaruf_read_sector(_context, sectorAddress, negative, buffer, ref length, out _);
// Sector not dumped
if(res == Status.SectorNotDumped && length > 0)
{
buffer = new byte[length];
return ErrorNumber.NoError;
}
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
buffer = new byte[length];
@@ -102,6 +110,14 @@ public sealed partial class AaruFormat
Status res = aaruf_read_track_sector(_context, buffer, sectorAddress, ref length, (byte)track, out _);
// Sector not dumped
if(res == Status.SectorNotDumped && length > 0)
{
buffer = new byte[length];
return ErrorNumber.NoError;
}
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
buffer = new byte[length];
@@ -133,6 +149,14 @@ public sealed partial class AaruFormat
Status res = aaruf_read_sector_long(_context, sectorAddress, negative, buffer, ref length, out _);
// Sector not dumped
if(res == Status.SectorNotDumped && length > 0)
{
buffer = new byte[length];
return ErrorNumber.NoError;
}
if(res != Status.BufferTooSmall) return StatusToErrorNumber(res);
buffer = new byte[length];