/
SectorDescriptor.cs
34 lines (32 loc) · 1.3 KB
/
SectorDescriptor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/// Sharp 80 (c) Matthew Hamilton
/// Licensed Under GPL v3. See license.txt for details.
using System;
namespace Sharp80.TRS80
{
public class SectorDescriptor
{
public byte TrackNumber { get; set; }
public byte SectorNumber { get; set; }
public bool DoubleDensity { get; set; }
public byte DAM { get; set; }
public bool SideOne { get; set; }
public bool CrcError { get; set; }
public bool NonIbm { get; set; } // unused
public bool InUse { get; set; } = true;
public ushort SectorSize { get; set; }
public byte SectorSizeCode { get; set; }
public byte[] SectorData { get; set; }
public static SectorDescriptor Empty => new SectorDescriptor() { InUse = false };
public override string ToString()
{
return string.Format("Track: {0:X2} Side: {1} Sector: {2:X2} Double Density: {3} Length: {4:X4} {5}",
TrackNumber,
SideOne ? "1" : "0",
SectorNumber,
DoubleDensity,
SectorSize.ToHexString(),
InUse ? "Used" : "Unused");
}
public bool Deleted => DAM == Floppy.DAM_DELETED;
}
}