Reviewed, simplified code.

This commit is contained in:
meffi@lab313.ru
2014-04-14 23:48:39 +00:00
parent 90c0e78a66
commit 519a7f2e86
15 changed files with 1058 additions and 2346 deletions

View File

@@ -1,9 +1,9 @@
unit uCDIMAGE;
unit ucdimage;
interface
uses
Windows, uTIM;
utim;
const
cSectorHeaderSize = 12;
@@ -40,7 +40,7 @@ procedure ReplaceTimInFileFromMemory(const FileName: string; TIM: PTIM;
implementation
uses
uCommon, ecc, edc, System.SysUtils, System.Classes;
ucommon, ecc, edc, classes, sysutils, windows;
function bin2bcd(P: Integer): byte;
begin
@@ -72,10 +72,10 @@ var
tmp: TFileStream;
begin
Result := False;
Sz := GetFileSizeAPI(FileName);
Sz := FileSize(FileName);
tmp := nil;
if (Sz > cMaxFileSize) or (Sz = 0) then
Exit;
if (Sz > cMaxFileSize) or (Sz = 0) then Exit;
pFile := GetMemory(cSectorHeaderSize);
@@ -214,7 +214,7 @@ var
begin
Result := False;
SIZE := GetFileSizeAPI(TimToInsert);
SIZE := FileSize(TimToInsert);
P := 0;
TIM := LoadTimFromFile(TimToInsert, P, False, SIZE);
// SaveTimToFile('test.tim', TIM);