Index: oup/current/FileClasses/TXMP.pas
===================================================================
--- oup/current/FileClasses/TXMP.pas	(revision 206)
+++ oup/current/FileClasses/TXMP.pas	(revision 206)
@@ -0,0 +1,124 @@
+unit TXMP;
+
+interface
+
+uses
+  TypeDefs, _DataTypes, _FileTypes;
+
+type
+  TFile_TXMP = class(TFile)
+    protected
+      procedure InitDatLinks; override;
+      procedure InitDataFields; override;
+      procedure InitRawList; override;
+  end;
+
+implementation
+
+uses
+  ConnectionManager, Math;
+
+{ TFile_SNDD }
+
+procedure TFile_TXMP.InitDatLinks;
+begin
+  SetLength(FDatLinks, 2);
+  FDatLinks[0].SrcOffset := $94;
+  FDatLinks[0].DestID := -1;
+  FDatLinks[0].PosDestExts := '*';
+  FDatLinks[1].SrcOffset := $98;
+  FDatLinks[1].DestID := -1;
+  FDatLinks[1].PosDestExts := 'TXMP';
+end;
+
+
+procedure TFile_TXMP.InitDataFields;
+var
+  tempi: Integer;
+  temps: String;
+begin
+  FDataFields := TBlock.Create(Self, 0, 'Base', '', nil);
+  with FDataFields do
+  begin
+    AddField(TFileID, $00, 'FileID', '', nil);
+    AddField(TLevelID, $04, 'LevelID', '', nil);
+    tempi := 128;
+    AddField(TString, $08, 'FileName', '', @tempi);
+    tempi := 4;
+    AddField(TInt, $88, 'Flags', '', @tempi);
+    tempi := 2;
+    AddField(TInt, $8C, 'Width', '', @tempi);
+    tempi := 2;
+    AddField(TInt, $8E, 'Height', '', @tempi);
+    tempi := 4;
+    AddField(TInt, $90, 'StoreType', '', @tempi);
+    temps := 'TXAN';
+    AddField(TLinkByID, $94, 'TXAN', '', @temps);
+    temps := 'TXMP';
+    AddField(TLinkByID, $98, 'TXMP', '', @temps);
+    AddField(TRawLink, $9C, 'RawLink', '', nil);
+    AddField(TRawLink, $A0, 'SepLink', '', nil);
+    tempi := $1C;
+    AddField(TUnused, $A4, 'Unused', '', @tempi);
+  end;
+end;
+
+
+procedure TFile_TXMP.InitRawList;
+var
+  link_pc:   Integer;
+  link_mac:  Integer;
+  x, y:      Word;
+  storetype: Byte;
+  datasize:  Integer;
+  mipmap:    Byte;
+
+  function GetImgSize(w,h, storetype: Integer): Integer;
+  begin
+    case storetype of
+      0, 1, 2:
+        Result := w*h*2;
+      8:
+        Result := w*h*4;
+      9:
+        Result :=  Max(1, w div 4) * Max(1, h div 4) * 8;
+    else
+      Result := -1;
+    end;
+  end;
+
+begin
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $88, SizeOf(mipmap), @mipmap);
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8C, SizeOf(x), @x);
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8E, SizeOf(y), @y);
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $90, SizeOf(storetype), @storetype);
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $9C, 4, @link_pc);
+  ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $A0, 4, @link_mac);
+
+  datasize := GetImgSize(x, y, storetype);
+  if (mipmap and $01) > 0 then
+  begin
+    repeat
+      x    := Max(x div 2, 1);
+      y    := Max(y div 2, 1);
+      datasize := datasize + GetImgSize(x, y, storetype);
+    until (x = 1) and (y = 1);
+  end;
+
+  SetLength(FRawParts, 1);
+  if ConManager.Connection[FConnectionID].DataOS = DOS_WIN then
+  begin
+    FRawParts[0].SrcOffset := $9C;
+    FRawParts[0].RawAddr   := link_pc;
+  end
+  else
+  begin
+    FRawParts[0].SrcOffset := $A0;
+    FRawParts[0].RawAddr   := link_mac;
+  end;
+  FRawParts[0].RawSize := datasize;
+  FRawParts[0].LocSep  := not (ConManager.Connection[FConnectionID].DataOS = DOS_WIN);
+end;
+
+end.
+
Index: oup/current/FileClasses/_DataTypes.pas
===================================================================
--- oup/current/FileClasses/_DataTypes.pas	(revision 205)
+++ oup/current/FileClasses/_DataTypes.pas	(revision 206)
@@ -10,7 +10,12 @@
       FDescription: String;
       FDataLength: Integer;
+      FParentFile: TObject;
+      FChanged: Boolean;
       function GetValueAsString: String; virtual; abstract;
     public
-      constructor Create(Offset: Integer; Name, Description: String);
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); virtual;
+
+      procedure Update(Offset, Length: Integer); virtual; abstract;
 
       property Offset: Integer read FOffset;
@@ -21,50 +26,145 @@
   end;
 
-  TDataFields = array of TDataField;
-
-
-  TInt32 = class(TDataField)
-    private
-      FInt: LongWord;
-      function GetValueAsString: String; override;
-    public
-      constructor Create(Offset: Integer; Name, Description: String);
-  end;
-
-
-  TString = class(TDataField)
-    private
-      FString: String;
-      function GetValueAsString: String; override;
-    public
-      constructor Create(Offset: Integer; Name, Description: String; Length: Integer);
-  end;
-
-
-  
-  TArray = class(TDataField)
-    private
-      FDataFields: TDataFields;
+  TFieldType = class of TDataField;
+
+  TBlock = class(TDataField)
+    private
+      FDataFields: array of TDataField;
       function GetFieldByOffset(Offset: Integer): TDataField;
       function GetFieldByIndex(ID: Integer): TDataField;
-    public
-      constructor Create(Offset: Integer; Name, Description: String; Length, Count: Integer);
+      function GetFieldCount: Integer;
+    public
+      // ExtraArgs: Pointer auf 2 Integer: Length+Count
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
       property FieldByOffset[Offset: Integer]: TDataField read GetFieldByOffset;
       property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
-  end;
+      property FieldCount: Integer read GetFieldCount;
+
+      procedure AddField(fieldtype: TFieldType; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer);
+  end;
+
+
+  TInt = class(TDataField)
+    private
+      FInt: Integer;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: Pointer auf Integer: Bytes of TInt
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TLevelID = class(TDataField)
+    private
+      FLevelID: Integer;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: keine
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TFileID = class(TDataField)
+    private
+      FFileID: Integer;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: keine
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TLinkByID = class(TDataField)
+    private
+      FFileID: Integer;
+      FPosExts: String;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: Pointer auf String: Possible Exts
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TString = class(TDataField)
+    private
+      FString: String;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: Pointer auf Integer: Length
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TArray = class(TDataField)
+    private
+      FDataFields: array of TDataField;
+      function GetFieldByOffset(Offset: Integer): TDataField;
+      function GetFieldByIndex(ID: Integer): TDataField;
+      function GetFieldCount: Integer;
+    public
+      // ExtraArgs: Pointer auf 2 Integer: Length+Count
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+      property FieldByOffset[Offset: Integer]: TDataField read GetFieldByOffset;
+      property FieldByIndex[ID: Integer]: TDataField read GetFieldByIndex;
+      property FieldCount: Integer read GetFieldCount;
+
+      procedure AddField(fieldtype: TFieldType; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer);
+  end;
+
+
+  TRawLink = class(TDataField)
+    private
+      FRawAddress: Integer;
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: keine
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
+
+  TUnused = class(TDataField)
+    private
+      function GetValueAsString: String; override;
+    public
+      // ExtraArgs: Pointer auf Integer: Length
+      constructor Create(ParentFile: TObject; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer); override;
+      procedure Update(Offset, Length: Integer); override;
+  end;
+
 
 implementation
 
 uses
-  SysUtils;
+  SysUtils, Dialogs, _FileTypes, Classes, ConnectionManager;
 
 
 { TDataType }
 
-constructor TDataField.Create(Offset: Integer; Name, Description: String);
+constructor TDataField.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
 begin
   FOffset := Offset;
   FName := Name;
-  FDescription := Description; 
+  FDescription := Description;
+  FParentFile := ParentFile; 
 end;
 
@@ -73,23 +173,49 @@
 { TInt32 }
 
-constructor TInt32.Create(Offset: Integer; Name, Description: String);
-begin
-  inherited Create(Offset, Name, Description);
-end;
-
-function TInt32.GetValueAsString: String;
+constructor TInt.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := Integer(ExtraArgs^);
+  FInt := 0;
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  fstream.Read(FInt, FDataLength);
+end;
+
+function TInt.GetValueAsString: String;
 begin
   Result := IntToStr(FInt);
 end;
 
+procedure TInt.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
 
 
 { TString }
 
-constructor TString.Create(Offset: Integer; Name, Description: String;
-  Length: Integer);
-begin
-  inherited Create(Offset, Name, Description);
-
+constructor TString.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+  i: Integer;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := Integer(ExtraArgs^);
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  SetLength(FString, FDataLength); 
+  fstream.Read(FString[1], FDataLength);
+  for i := 1 to FDataLength do
+    if FString[i] = Chr(0) then
+    begin
+      SetLength(FString, i - 1);
+      Break;
+    end;
 end;
 
@@ -99,12 +225,23 @@
 end;
 
+procedure TString.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
 
 
 { TArray }
 
-constructor TArray.Create(Offset: Integer; Name, Description: String;
-  Length, Count: Integer);
-begin
-  Exit;
+procedure TArray.AddField(fieldtype: TFieldType; Offset: Integer;
+          Name, Description: String; ExtraArgs: Pointer);
+begin
+  Exit;
+end;
+
+constructor TArray.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
 end;
 
@@ -133,4 +270,199 @@
 end;
 
+function TArray.GetFieldCount: Integer;
+begin
+  Result := Length(FDataFields);
+end;
+
+procedure TArray.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TBlock }
+
+procedure TBlock.AddField(fieldtype: TFieldType; Offset: Integer; Name,
+  Description: String; ExtraArgs: Pointer);
+var
+  i: Integer;
+begin
+  if Length(FDataFields) > 0 then
+  begin
+    for i := 0 to High(FDataFields) do
+      if FDataFields[i].FOffset = Offset then
+        Break;
+    if i < Length(FDataFields) then
+    begin
+      ShowMessage('Field exists');
+      Exit;
+    end;
+  end;
+  SetLength(FDataFields, Length(FDataFields) + 1);
+  FDataFields[High(FDataFields)] := TFieldType(fieldtype).Create(
+      FParentFile, Offset, Name, Description, ExtraArgs);
+end;
+
+constructor TBlock.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+end;
+
+function TBlock.GetFieldByIndex(ID: Integer): TDataField;
+begin
+  Result := FDataFields[ID];
+end;
+
+function TBlock.GetFieldByOffset(Offset: Integer): TDataField;
+begin
+  Exit;
+end;
+
+function TBlock.GetFieldCount: Integer;
+begin
+  Result := Length(FDataFields);
+end;
+
+procedure TBlock.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TLevelID }
+
+constructor TLevelID.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := 4;
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  fstream.Read(FLevelID, 4);
+  FLevelID := FLevelID div 256 div 256 div 256 div 2;
+end;
+
+function TLevelID.GetValueAsString: String;
+begin
+  Result := IntToStr(FLevelID);
+end;
+
+procedure TLevelID.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TFileID }
+
+constructor TFileID.Create(ParentFile: TObject; Offset: Integer;
+    Name, Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := 4;
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  fstream.Read(FFileID, 4);
+  if FFileID > 0 then
+    FFileID := FFileID div 256
+  else
+    FFileID := -1;
+end;
+
+function TFileID.GetValueAsString: String;
+begin
+  Result := IntToStr(FFileID);
+end;
+
+procedure TFileID.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TLinkByID }
+
+constructor TLinkByID.Create(ParentFile: TObject; Offset: Integer; Name,
+  Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := 4;
+  FPosExts := String(ExtraArgs^);
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  fstream.Read(FFileID, 4);
+  if FFileID > 0 then
+    FFileID := FFileID div 256
+  else
+    FFileID := -1;
+end;
+
+function TLinkByID.GetValueAsString: String;
+begin
+  Result := IntToStr(FFileID);
+end;
+
+procedure TLinkByID.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TRawLink }
+
+constructor TRawLink.Create(ParentFile: TObject; Offset: Integer; Name,
+  Description: String; ExtraArgs: Pointer);
+var
+  fstream: TMemoryStream;
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := 4;
+  fstream := TFile(ParentFile).FileStream;
+  fstream.Seek(Offset, soFromBeginning);
+  fstream.Read(FRawAddress, 4);
+end;
+
+function TRawLink.GetValueAsString: String;
+begin
+  Result := IntToStr(FRawAddress);
+end;
+
+procedure TRawLink.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
+
+
+
+{ TUnused }
+
+constructor TUnused.Create(ParentFile: TObject; Offset: Integer; Name,
+  Description: String; ExtraArgs: Pointer);
+begin
+  inherited Create(ParentFile, Offset, Name, Description, ExtraArgs);
+  FDataLength := Integer(ExtraArgs^);
+end;
+
+function TUnused.GetValueAsString: String;
+begin
+  Result := '';
+end;
+
+procedure TUnused.Update(Offset, Length: Integer);
+begin
+  Exit;
+end;
 
 end.
Index: oup/current/FileClasses/_FileTypes.pas
===================================================================
--- oup/current/FileClasses/_FileTypes.pas	(revision 205)
+++ oup/current/FileClasses/_FileTypes.pas	(revision 206)
@@ -4,16 +4,21 @@
 
 uses
-  TypeDefs, _DataTypes;
+  TypeDefs, _DataTypes, Classes;
 
 
 type
   TFile = class
-    private
+    protected
       FConnectionID: Integer;
       FFileID: Integer;
+      FFile: TMemoryStream;
 
       FDatLinks: TDatLinkList;
-      FDataFields: TDataFields;
+      FDataFields: TBlock;
       FRawParts: TRawDataList;
+
+      procedure InitDatLinks; virtual; abstract;
+      procedure InitDataFields; virtual; abstract;
+      procedure InitRawList; virtual; abstract;
 
       function GetDatLinkByOffset(Offset: Integer): TDatLink;
@@ -24,6 +29,11 @@
       function GetRawPartByIndex(ID: Integer): TRawDataInfo;
     public
-      constructor Create(ConnectionID, FileID: Integer);
-      
+      constructor Create(ConnectionID, FileID: Integer); virtual;
+      procedure Free;
+
+      property FileStream: TMemoryStream read FFile;
+      property FileID: Integer read FFileID;
+      property ConnectionID: Integer read FConnectionID;
+
       property LinkByOffset[Offset: Integer]: TDatLink read GetDatLinkByOffset;
       property LinkByIndex[ID: Integer]: TDatLink read GetDatLinkByIndex;
@@ -40,17 +50,43 @@
 
 uses
-  DatLinks, RawList;
+  DatLinks, RawList, ConnectionManager, Dialogs;
 
 { TFileType }
 
 constructor TFile.Create(ConnectionID, FileID: Integer);
+var
+  i: Integer;
 begin
   FConnectionID := ConnectionID;
   FFileID := FileID;
+  FFile := nil;
 
-  FDatLinks := DatLinksManager.GetDatLinks(ConnectionID, FileID);
-  FRawParts := RawLists.GetRawList(ConnectionID, FileID);
+  FFile := TMemoryStream.Create;
+  ConManager.Connection[ConnectionID].LoadDatFile(FileID, TStream(FFile));
+
+  InitDatLinks();
+  InitDataFields();
+  InitRawList();
+
+  if FDataFields.FieldCount > 0 then
+  begin
+    for i := 0 to FDataFields.FieldCount - 1 do
+    begin
+      ShowMessage(FDataFields.FieldByIndex[i].ValueAsString);
+    end;
+  end;
+
+  FFile.Free;
+  FFile := nil;
+
+//  FDatLinks := DatLinksManager.GetDatLinks(ConnectionID, FileID);
+//  FRawParts := RawLists.GetRawList(ConnectionID, FileID);
 end;
 
+
+procedure TFile.Free;
+begin
+  FDataFields.Free;
+end;
 
 function TFile.GetDatLinkByIndex(ID: Integer): TDatLink;
@@ -88,8 +124,5 @@
 function TFile.GetFieldByIndex(ID: Integer): TDataField;
 begin
-  if ID < Length(FDataFields) then
-    Result := FDataFields[ID]
-  else
-    Result := nil;
+  Result := FDataFields.FieldByIndex[ID];
 end;
 
@@ -98,14 +131,5 @@
   i: Integer;
 begin
-  Result := nil;
-
-  if Length(FDataFields) > 0 then
-  begin
-    for i := 0 to High(FDataFields) do
-      if FDataFields[i].Offset = Offset then
-        break;
-    if i < Length(FDataFields) then
-      Result := FDataFields[i];
-  end;
+  Result := FDataFields.FieldByOffset[Offset];
 end;
 
Index: oup/current/Global/Data.pas
===================================================================
--- oup/current/Global/Data.pas	(revision 205)
+++ oup/current/Global/Data.pas	(revision 206)
@@ -4,5 +4,5 @@
 
 const
-  Version:   String    = 'v0.34b';
+  Version:   String    = 'v0.35a';
   DBVersion: String    = '0.4';
   CrLf:      String[2] = #13 + #10;
Index: oup/current/OniUnPacker.bdsproj
===================================================================
--- oup/current/OniUnPacker.bdsproj	(revision 205)
+++ oup/current/OniUnPacker.bdsproj	(revision 206)
@@ -176,5 +176,9 @@
 			<Language Name="ProjectLang">$00000000</Language>
 			<Language Name="RootDir"></Language>
-		</Language>  <Excluded_Packages>
+		</Language>  
+    
+    
+    
+    <Excluded_Packages>
       <Excluded_Packages Name="d:\programme\borland\bds\3.0\Bin\dbwebxprt.bpl">Borland Web Wizard Package</Excluded_Packages>
     </Excluded_Packages>
Index: oup/current/OniUnPacker.dpr
===================================================================
--- oup/current/OniUnPacker.dpr	(revision 205)
+++ oup/current/OniUnPacker.dpr	(revision 206)
@@ -31,5 +31,6 @@
   _FileTypes in 'FileClasses\_FileTypes.pas',
   LevelDB in 'Helper\LevelDB.pas' {Form_LevelDB},
-  Img_DDSTypes in 'Global\Img_DDSTypes.pas';
+  Img_DDSTypes in 'Global\Img_DDSTypes.pas',
+  TXMP in 'FileClasses\TXMP.pas';
 
 {$R *.res}
@@ -38,4 +39,5 @@
 begin
   Application.Initialize;
+
   Application.Title := 'Oni Un/Packer';
   Application.CreateForm(TForm_Main, Form_Main);
Index: oup/current/Tools/TxmpReplace.pas
===================================================================
--- oup/current/Tools/TxmpReplace.pas	(revision 205)
+++ oup/current/Tools/TxmpReplace.pas	(revision 206)
@@ -42,5 +42,5 @@
 implementation
 {$R *.dfm}
-uses Main, ConnectionManager, ImagingTypes;
+uses Main, ConnectionManager, ImagingTypes, TXMP;
 
 
@@ -225,4 +225,6 @@
 
 procedure TForm_TxmpReplace.FormCreate(Sender: TObject);
+var
+  TXMP: TFile_TXMP;
 begin
   inherited;
@@ -232,4 +234,7 @@
   Self.OnNewFileSelected := SelectFile;
   opend.Filter := saved.Filter;
+
+  TXMP := TFile_TXMP.Create(ConnectionID, 8552);
+  TXMP.Free;
 end;
 
