5 uses System.SysUtils, System.Types;
19 procedure readfat(img: TBytes);
23 destructor Destroy; override;
24 procedure loadfile(clustno, size: integer; buf, img: TBytes);
25 function search(name: string; info: array of TFileInfo;
26 max: integer): integer;
35 constructor TFiles.Create;
39 SetLength(fat, 4 * 2880);
40 readfat(Pointer(ADR_DISKIMG + $00C200));
43 destructor TFiles.Destroy;
49 procedure TFiles.loadfile(clustno, size: integer; buf, img: TBytes);
58 buf[i] := img[clustno * 512 + i];
62 buf[i] := img[clustno * 512 + i];
65 clustno := fat[clustno];
69 procedure TFiles.readfat(img: TBytes);
76 fat[i] := (img[j] or img[j + 1] shl 8) and $FFF;
77 fat[i + 1] := (img[j + 1] shr 4 or img[j + 2] shl 4) and $FFF;
82 function TFiles.search(name: string; info: array of TFileInfo;
83 max: integer): integer;
91 for i := 1 to Length(name) do
98 if (name[i] = '.') and (j <= 8) then
115 if info[i].name = '' then
117 if info[i].tpye and $18 = 0 then
120 if info[i].name <> s[j] then