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

@@ -36,9 +36,9 @@ public sealed partial class Apridisk
{
(ushort cylinder, byte head, byte sector) LbaToChs(ulong lba)
{
ushort cylinder = (ushort)(lba / (_imageInfo.Heads * _imageInfo.SectorsPerTrack));
byte head = (byte)(lba / _imageInfo.SectorsPerTrack % _imageInfo.Heads);
byte sector = (byte)((lba % _imageInfo.SectorsPerTrack) + 1);
var cylinder = (ushort)(lba / (_imageInfo.Heads * _imageInfo.SectorsPerTrack));
var head = (byte)(lba / _imageInfo.SectorsPerTrack % _imageInfo.Heads);
var sector = (byte)(lba % _imageInfo.SectorsPerTrack + 1);
return (cylinder, head, sector);
}