public HuFileEntry GetEntry(DataController dc, int sector, int pos) { var fe = new HuFileEntry(); string Name = TextEncoding.GetString(dc.Copy(pos + 0x01, HuFileEntry.MaxNameLength)).TrimEnd((Char)0x20); string Extension = TextEncoding.GetString(dc.Copy(pos + 0x0e, HuFileEntry.MaxExtensionLength)).TrimEnd((Char)0x20); fe.SetEntryFromSector(dc, sector, pos, Name, Extension); return(fe); }
/// <summary> /// ヘッダを読み込む /// </summary> void ReadHeader(FileStream fs) { byte[] header = new byte[0x2b0]; fs.Read(header, 0, header.Length); var dc = new DataController(header); this.DiskName = TextEncoding.GetString(dc.Copy(0, 17)).TrimEnd((Char)0); IsWriteProtect = dc.GetByte(0x1a) != 0x00; var t = dc.GetByte(0x1b); DiskType.SetImageTypeFromHeader(t); ImageSize = (long)dc.GetLong(0x1c); CurrentHeaderSize = 0; for (var i = 0; i < MaxTrack; i++) { var a = (long)dc.GetLong(0x20 + (i * 4)); TrackAddress[i] = a; if (i == 0) { CurrentHeaderSize = a; } } }
public void SetEntryFromSector(DataController dc, int sector, int pos, string Name, string Extension) { this.Name = Name; this.Extension = Extension; EntrySector = sector; EntryPosition = pos; FileMode = dc.GetByte(pos); Password = dc.GetByte(pos + 0x11); Size = dc.GetWord(pos + 0x12); LoadAddress = dc.GetWord(pos + 0x14); ExecuteAddress = dc.GetWord(pos + 0x16); DateTimeData = dc.Copy(pos + 0x18, 6); StartCluster = dc.GetByte(pos + 0x1e); StartCluster |= dc.GetByte(pos + 0x1f) << 7; }