| 7 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 8 | 
   | 
 type | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 9 | 
   | 
   TFile_TXMP = class(TFile) | 
 
 
 
 
 
 
 
 
 
 
 
 | 10 | 
 < | 
     protected | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 | 
 < | 
       procedure InitDatLinks; override; | 
 
 
 
 
 
 
 
 
 
 | 10 | 
 > | 
     public | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 11 | 
   | 
       procedure InitDataFields; override; | 
 
 
 
 
 
 
 
 
 
 
 
 | 12 | 
 < | 
       procedure InitRawList; override; | 
 
 
 
 
 
 
 
 
 
 | 12 | 
 > | 
       procedure InitEditor; override; | 
 
 
 
 
 
 
 
 
 
 
 
 | 13 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 14 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 15 | 
   | 
 implementation | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 16 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 17 | 
   | 
 uses | 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | 
 < | 
   ConnectionManager, Math, Classes, TypeDefs, _DataTypes; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 18 | 
 > | 
   ConnectionManager, Math, Classes, TypeDefs, _DataTypes, ExtCtrls, StdCtrls, | 
 
 
 
 
 
 | 19 | 
 > | 
   Controls, Forms; | 
 
 
 
 
 
 
 
 
 
 
 
 | 20 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 21 | 
   | 
 { TFile_TXMP } | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 22 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 26 | 
   | 
   temps: String; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 27 | 
   | 
   templist: TStringList; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 28 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 29 | 
 < | 
   FDataFields := TBlock.Create(Self, 0, 'Base', '', nil); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 29 | 
 > | 
   inherited; | 
 
 
 
 
 
 | 30 | 
 > | 
   FDataFields := TBlock.Create(Self, nil, 0, 'Base', '', nil); | 
 
 
 
 
 
 
 
 
 
 
 
 | 31 | 
   | 
   templist := TStringList.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 32 | 
   | 
   with FDataFields do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 33 | 
   | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 104 | 
   | 
     AddField(TUnused, $A4, 'Unused', '', @tempi); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 105 | 
   | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 106 | 
   | 
   templist.Free; | 
 
 
 
 
 
 
 
 
 | 107 | 
 + | 
   FFileStream.Free; | 
 
 
 
 
 
 
 
 
 | 108 | 
 + | 
   FFileStream := nil; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 109 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 110 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 111 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 | 112 | 
 < | 
 procedure TFile_TXMP.InitDatLinks; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 110 | 
 < | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 111 | 
 < | 
   SetLength(FDatLinks, 2); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 112 | 
 < | 
   FDatLinks[0].SrcOffset := $94; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
 < | 
   FDatLinks[0].DestID := GetDatLinkValue(FFile, $94); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 114 | 
 < | 
   FDatLinks[0].PosDestExts := '*'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 115 | 
 < | 
   FDatLinks[1].SrcOffset := $98; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 116 | 
 < | 
   FDatLinks[1].DestID := GetDatLinkValue(FFile, $98); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 117 | 
 < | 
   FDatLinks[1].PosDestExts := 'TXMP'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 118 | 
 < | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 120 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 121 | 
 < | 
 procedure TFile_TXMP.InitRawList; | 
 
 
 
 
 
 
 
 
 
 | 112 | 
 > | 
 procedure TFile_TXMP.InitEditor; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 113 | 
   | 
 var | 
 
 
 
 
 
 
 
 
 
 
 
 | 114 | 
 < | 
   link_pc:   Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 115 | 
 < | 
   link_mac:  Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 125 | 
 < | 
   x, y:      Word; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 126 | 
 < | 
   storetype: Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
 < | 
   datasize:  Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
 < | 
   mipmap:    Byte; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 | 
 < | 
   function GetImgSize(w,h, storetype: Integer): Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 | 
 < | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 | 
 < | 
     case storetype of | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 133 | 
 < | 
       0, 1, 2: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 134 | 
 < | 
         Result := w*h*2; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 135 | 
 < | 
       8: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 136 | 
 < | 
         Result := w*h*4; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 | 
 < | 
       9: | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 138 | 
 < | 
         Result :=  Max(1, w div 4) * Max(1, h div 4) * 8; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 139 | 
 < | 
     else | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
 < | 
       Result := -1; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 141 | 
 < | 
     end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 142 | 
 < | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 143 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 | 114 | 
 > | 
   group: TGroupBox; | 
 
 
 
 
 
 | 115 | 
 > | 
   splitter: TSplitter; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 116 | 
   | 
 begin | 
 
 
 
 
 
 
 
 
 
 
 
 | 117 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $88, SizeOf(mipmap), @mipmap); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 118 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8C, SizeOf(x), @x); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $8E, SizeOf(y), @y); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 120 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $90, SizeOf(storetype), @storetype); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 121 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $9C, 4, @link_pc); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 122 | 
 < | 
   ConManager.Connection[FConnectionID].LoadDatFilePart(FFileID, $A0, 4, @link_mac); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 123 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 124 | 
 < | 
   datasize := GetImgSize(x, y, storetype); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 125 | 
 < | 
   if (mipmap and $01) > 0 then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 126 | 
 < | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 127 | 
 < | 
     repeat | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 128 | 
 < | 
       x    := Max(x div 2, 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 129 | 
 < | 
       y    := Max(y div 2, 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 130 | 
 < | 
       datasize := datasize + GetImgSize(x, y, storetype); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 | 
 < | 
     until (x = 1) and (y = 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 | 
 < | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 133 | 
 < | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 134 | 
 < | 
   SetLength(FRawParts, 1); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 135 | 
 < | 
   if ConManager.Connection[FConnectionID].DataOS = DOS_WIN then | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 136 | 
 < | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 | 
 < | 
     FRawParts[0].SrcOffset := $9C; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 166 | 
 < | 
     FRawParts[0].RawAddr   := link_pc; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 167 | 
 < | 
   end | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 168 | 
 < | 
   else | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 169 | 
 < | 
   begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 170 | 
 < | 
     FRawParts[0].SrcOffset := $A0; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 171 | 
 < | 
     FRawParts[0].RawAddr   := link_mac; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 172 | 
 < | 
   end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 173 | 
 < | 
   FRawParts[0].RawSize := datasize; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 174 | 
 < | 
   FRawParts[0].LocSep  := not (ConManager.Connection[FConnectionID].DataOS = DOS_WIN); | 
 
 
 
 
 
 
 
 
 
 | 117 | 
 > | 
   inherited; | 
 
 
 
 
 
 | 118 | 
 > | 
   FEditor := TFrame.Create(nil); | 
 
 
 
 
 
 | 119 | 
 > | 
   group := TGroupBox.Create(FEditor); | 
 
 
 
 
 
 | 120 | 
 > | 
   group.Align := alTop; | 
 
 
 
 
 
 | 121 | 
 > | 
   group.Height := 150; | 
 
 
 
 
 
 | 122 | 
 > | 
   group.Caption := '1. '; | 
 
 
 
 
 
 | 123 | 
 > | 
   group.Parent := FEditor; | 
 
 
 
 
 
 | 124 | 
 > | 
  | 
 
 
 
 
 
 | 125 | 
 > | 
   splitter := TSplitter.Create(FEditor); | 
 
 
 
 
 
 | 126 | 
 > | 
   splitter.Align := alTop; | 
 
 
 
 
 
 | 127 | 
 > | 
   splitter.Top := group.Height + 10; | 
 
 
 
 
 
 | 128 | 
 > | 
   splitter.AutoSnap := False; | 
 
 
 
 
 
 | 129 | 
 > | 
   splitter.MinSize := 100; | 
 
 
 
 
 
 | 130 | 
 > | 
   splitter.Beveled := True; | 
 
 
 
 
 
 | 131 | 
 > | 
   splitter.Height := 8; | 
 
 
 
 
 
 | 132 | 
 > | 
   splitter.Parent := FEditor; | 
 
 
 
 
 
 | 133 | 
 > | 
  | 
 
 
 
 
 
 | 134 | 
 > | 
   group := TGroupBox.Create(FEditor); | 
 
 
 
 
 
 | 135 | 
 > | 
   group.Align := alClient; | 
 
 
 
 
 
 | 136 | 
 > | 
   group.Caption := '2. '; | 
 
 
 
 
 
 | 137 | 
 > | 
   group.Parent := FEditor; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 138 | 
   | 
 end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 139 | 
   | 
  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 140 | 
   | 
 end. | 
 
 
 
 
 
 
 
 
 
 | 178 | 
 – | 
  |