| 24 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 25 | 
   | 
 {$R *.dfm} | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 | 
   | 
 uses ABSMain, ABSDecUtil, Main, | 
 
 
 
 
 
 
 
 
 
 
 
 | 27 | 
 < | 
     ConnectionManager, TypeDefs, DataAccess, OniImgClass, Data, RawList; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 | 
 > | 
     ConnectionManager, TypeDefs, DataAccess, OniImgClass, Data, RawList,  | 
 
 
 
 
 
 | 28 | 
 > | 
   Access_OniArchive; | 
 
 
 
 
 
 
 
 
 
 
 
 | 29 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 30 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 31 | 
   | 
   Converting:  Boolean = False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 203 | 
   | 
   Stream_Names := TMemoryStream.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 204 | 
   | 
   Stream_Dat   := TFileStream.Create(Target, fmCreate); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 205 | 
   | 
   Stream_Raw   := TFileStream.Create(AnsiReplaceStr(Target, '.dat', '.raw'), fmCreate); | 
 
 
 
 
 
 
 
 
 | 206 | 
 + | 
   Stream_Raw.Write(EmptyBytes[0], 32); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 207 | 
   | 
   if Connection.DataOS in [DOS_WINDEMO, DOS_MAC, DOS_MACBETA] then | 
 
 
 
 
 
 
 
 
 | 208 | 
 + | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 209 | 
   | 
     Stream_Sep := TFileStream.Create(AnsiReplaceStr(Target, '.dat', '.sep'), fmCreate); | 
 
 
 
 
 
 
 
 
 | 210 | 
 + | 
     Stream_Sep.Write(EmptyBytes[0], 32); | 
 
 
 
 
 
 
 
 
 | 211 | 
 + | 
   end; | 
 
 
 
 
 
 
 
 
 | 212 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 213 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 214 | 
   | 
   DoStep('Creating header'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 215 | 
   | 
   progress.Position      := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 361 | 
   | 
       DatFileStream.Seek(0, soFromBeginning); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 362 | 
   | 
       Stream_Body.CopyFrom(DatFileStream, DatFileStream.Size); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 363 | 
   | 
       if (Stream_Body.Size mod 32) > 0 then | 
 
 
 
 
 
 
 
 
 | 364 | 
 + | 
       begin | 
 
 
 
 
 
 
 
 
 | 365 | 
 + | 
         ShowMessage( | 
 
 
 
 
 
 
 
 
 | 366 | 
 + | 
             IntToStr(FileID) + '-' + FileInfo.Name + '.' + FileInfo.Extension + #13#10 + | 
 
 
 
 
 
 
 
 
 | 367 | 
 + | 
             IntToStr(FileInfo.Size) + ' - 0x' + IntToHex(FileInfo.Size, 6) + ' - real: ' + IntToStr(DatFileStream.Size) + ' - 0x' + IntToHex(DatFileStream.Size, 6) + #13#10 + | 
 
 
 
 
 
 
 
 
 | 368 | 
 + | 
             IntToStr(Stream_Body.Size) + ' - 0x' + IntToHex(Stream_Body.Size, 6) ); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 369 | 
   | 
         Stream_Body.Write(EmptyBytes[0], 32 - (Stream_Body.Size mod 32)); | 
 
 
 
 
 
 
 
 
 | 370 | 
 + | 
       end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 371 | 
   | 
     end | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 372 | 
   | 
     else | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 373 | 
   | 
       FilesHeader[FileID].DataAddr := 0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 632 | 
   | 
   DoStep('Writing .dat-fileslist'); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 633 | 
   | 
   Application.ProcessMessages; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 634 | 
   | 
  | 
 
 
 
 
 
 
 
 
 | 635 | 
 + | 
   TAccess_OniArchive(Connection).UnloadWhenUnused := False; | 
 
 
 
 
 
 
 
 
 | 636 | 
 + | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 637 | 
   | 
   FileTime := Time; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 638 | 
   | 
   Database.StartTransaction; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 639 | 
   | 
   for FileID := 0 to Connection.GetFileCount - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 678 | 
   | 
               BoolToStr(RawLinks[i].LocSep) + ', 0);'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 679 | 
   | 
             Query.ExecSQL; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 680 | 
   | 
           end; | 
 
 
 
 
 
 
 
 
 
 | 667 | 
 – | 
           if ((i mod 100) = 0) and (FileID > 0) then | 
 
 
 
 
 
 
 
 
 
 | 668 | 
 – | 
           begin | 
 
 
 
 
 
 
 
 
 
 | 669 | 
 – | 
             Database.Commit(False); | 
 
 
 
 
 
 
 
 
 
 | 670 | 
 – | 
             Database.StartTransaction; | 
 
 
 
 
 
 
 
 
 
 | 671 | 
 – | 
           end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 681 | 
   | 
         end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 682 | 
   | 
       end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 683 | 
   | 
  |