home *** CD-ROM | disk | FTP | other *** search
- {$I-}
- uses
- DOS, CRT, Hex;
-
- type
- TResult =
- Array [1..1024] of
- record
- Num :Word;
-
- Drive, Head :Byte;
- Sector, Track:Byte;
- Count :Byte;
-
- Size :Word;
- Buffer :Pointer;
-
- DPT :Array [0..10] of Byte;
- end;
-
- TCommon =
- record
- Id :String[8];
- RMax,
- RNum, RPos :Word;
- Result :TResult;
- end;
-
- var
- C :^TCommon;
- i, iDPT :Integer;
- CurDPT :Array [0..10] of Byte;
- DPTAddr :Pointer;
-
- FileName :String[12];
- f :File;
-
- function NormalDPT(var DPT :Array of Byte) :Boolean;
- begin
- NormalDPT:=True;
- for iDPT:=0 to 10 do
- if DPT[iDPT]<>CurDPT[iDPT] then NormalDPT:=False;
- end;
-
- procedure ShowRead;
- begin
- with C^.Result[i] do
- begin
- Write(i:3, ' ', Char(Drive+Ord('A')), ': ',
- 'Head ', Head:1, ' Track ', Track:2, ' Sector ', Sector:2,
- ' Count ', Count:1, ' Size ', Size:5);
- if Not NormalDPT(DPT) then
- begin
- WriteLn;
- Write(' Used DPT :');
- for iDPT:=0 to 10 do
- begin
- if DPT[iDPT]<>CurDPT[iDPT] then HighVideo else LowVideo;
- Write(HexByte(DPT[iDPT]):3);
- end;
- WriteLn;
- Write(' Current DPT :');
- for iDPT:=0 to 10 do
- begin
- if DPT[iDPT]<>CurDPT[iDPT] then HighVideo else LowVideo;
- Write(HexByte(CurDPT[iDPT]):3);
- end;
- LowVideo; WriteLn;
- end
- else WriteLn(' ; DPT is normal');
-
- if (Buffer<>nil) and (Size<>0) then
- begin
- Str(i:3, FileName);
- if FileName[1]=' ' then FileName[1]:='0';
- if FileName[2]=' ' then FileName[2]:='0';
- FileName:='SAVEREAD.'+FileName;
- Assign(f, FileName);
- Rewrite(f, 1);
- BlockWrite(f, Buffer^, Size);
- Close(f);
- end;
- end;
- end;
-
- begin
- WriteLn('Floppy Drive Reads Viewer Copyright (c) 1994 by Sasha Peslyak');
-
- GetIntVec($64, Pointer(C));
- with C^ do
- begin
- if Id<>'SAVEREAD' then
- begin
- WriteLn('SAVEREAD.EXE not loaded.'); Halt;
- end;
-
- GetIntVec($1E, DPTAddr);
- Move(DPTAddr^, CurDPT, 11);
-
- WriteLn(#13#10'Total reads : ', RNum, #13#10);
- if RPos<RNum then for i:=RPos+1 to RMax do ShowRead;
- for i:=1 to RPos do ShowRead;
- end;
- end.
-