General cleanup and refactor.

This commit is contained in:
2022-03-07 07:36:44 +00:00
parent bc6e432565
commit 762e3eb6d2
1321 changed files with 44657 additions and 45479 deletions

View File

@@ -30,14 +30,14 @@
// Copyright © 2011-2022 Natalia Portillo
// ****************************************************************************/
namespace Aaru.DiscImages;
using System;
using System.IO;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interfaces;
namespace Aaru.DiscImages;
public sealed partial class AppleDos
{
/// <inheritdoc />
@@ -46,7 +46,7 @@ public sealed partial class AppleDos
Stream stream = imageFilter.GetDataForkStream();
stream.Seek(0, SeekOrigin.Begin);
byte[] tmp = new byte[imageFilter.DataForkLength];
var tmp = new byte[imageFilter.DataForkLength];
stream.Read(tmp, 0, tmp.Length);
_extension = Path.GetExtension(imageFilter.Filename)?.ToLower();
@@ -72,11 +72,10 @@ public sealed partial class AppleDos
? _interleave
: _deinterleave;
for(int t = 0; t < 35; t++)
for(var t = 0; t < 35; t++)
{
for(int s = 0; s < 16; s++)
Array.Copy(tmp, (t * 16 * 256) + (s * 256), _deinterleaved, (t * 16 * 256) + (offsets[s] * 256),
256);
for(var s = 0; s < 16; s++)
Array.Copy(tmp, t * 16 * 256 + s * 256, _deinterleaved, t * 16 * 256 + offsets[s] * 256, 256);
}
}
@@ -96,8 +95,7 @@ public sealed partial class AppleDos
}
/// <inheritdoc />
public ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer) =>
ReadSectors(sectorAddress, 1, out buffer);
public ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer) => ReadSectors(sectorAddress, 1, out buffer);
/// <inheritdoc />
public ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer)