| 53 |  | procedure hexSelectionChanged(Sender: TObject); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 54 |  | procedure hexChange(Sender: TObject); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 55 |  | private | 
 
 
 
 
 
 
 
 
 
 
 | 56 | < | ConID, fileid, datoffset: Integer; | 
 
 
 
 
 
 
 
 
 | 56 | > | fileid, datoffset: Integer; | 
 
 
 
 
 
 
 
 
 
 
 | 57 |  | public | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 58 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 59 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 114 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 115 |  | for i := 0 to filelist.Count - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 116 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 | 117 | < | if ConManager.Connection[ConID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then | 
 
 
 
 
 
 
 
 
 | 117 | > | if ConManager.Connection[ConnectionID].ExtractFileIDOfName(filelist.Items.Strings[i]) = Raw_Info.SrcID then | 
 
 
 
 
 
 
 
 
 
 
 | 118 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 119 |  | filelist.ItemIndex := i; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 120 |  | listClick(Self); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 131 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 132 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 133 |  | mem := nil; | 
 
 
 
 
 
 
 
 
 
 
 | 134 | < | ConManager.Connection[ConID].LoadRawFile(raw_info.SrcID, raw_info.SrcOffset, TStream(mem)); | 
 
 
 
 
 
 
 
 
 | 134 | > | ConManager.Connection[ConnectionID].LoadRawFile(raw_info.SrcID, raw_info.SrcOffset, TStream(mem)); | 
 
 
 
 
 
 
 
 
 
 
 | 135 |  | hex.LoadFromStream(mem); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 136 |  | ClearValues; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 137 |  | hexSelectionChanged(Self); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 147 |  | ClearValues; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 148 |  | datoffset := StrToInt('$' + MidStr( | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 149 |  | list_offset.Items.Strings[list_offset.ItemIndex], 3, 8)); | 
 
 
 
 
 
 
 
 
 
 
 | 150 | < | LoadRaw(ConManager.Connection[ConID].GetRawInfo(fileid, datoffset)); | 
 
 
 
 
 
 
 
 
 | 150 | > | LoadRaw(ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset)); | 
 
 
 
 
 
 
 
 
 
 
 | 151 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 152 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 153 |  |  | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 390 |  | i:    Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 391 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 392 |  | case MessageBox(Self.Handle, PChar('Save changes to .raw-part of file ' + | 
 
 
 
 
 
 
 
 
 
 
 | 393 | < | ConManager.Connection[ConID].GetFileInfo(fileid).Name + '?'), PChar('Data changed...'), | 
 
 
 
 
 
 
 
 
 | 393 | > | ConManager.Connection[ConnectionID].GetFileInfo(fileid).Name + '?'), PChar('Data changed...'), | 
 
 
 
 
 
 
 
 
 
 
 | 394 |  | MB_YESNOCANCEL) of | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 395 |  | idYes: | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 396 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 397 |  | mem := TMemoryStream.Create; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 398 |  | hex.SaveToStream(mem); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 399 |  | mem.Seek(0, soFromBeginning); | 
 
 
 
 
 
 
 
 
 
 
 | 400 | < | ConManager.Connection[ConID].UpdateRawFile(fileid, datoffset, mem); | 
 
 
 
 
 
 
 
 
 | 400 | > | ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, mem); | 
 
 
 
 
 
 
 
 
 
 
 | 401 |  | mem.Free; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 402 |  | hex.Modified := False; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 403 |  | for i := 0 to hex.Datasize - 1 do | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 505 |  | fs: TFileStream; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 506 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 507 |  | saved.Filter     := 'Files of matching extension (*.' + | 
 
 
 
 
 
 
 
 
 
 
 | 508 | < | ConManager.Connection[ConID].GetFileInfo(fileid).Extension + ')|*.' + | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 509 | < | ConManager.Connection[ConID].GetFileInfo(fileid).Extension + | 
 
 
 
 
 
 
 
 
 | 508 | > | ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + ')|*.' + | 
 
 
 
 
 | 509 | > | ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + | 
 
 
 
 
 
 
 
 
 
 
 | 510 |  | '|All files|*.*'; | 
 
 
 
 
 
 
 
 
 
 
 | 511 | < | saved.DefaultExt := ConManager.Connection[ConID].GetFileInfo(fileid).Extension; | 
 
 
 
 
 
 
 
 
 | 511 | > | saved.DefaultExt := ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension; | 
 
 
 
 
 
 
 
 
 
 
 | 512 |  | if saved.Execute then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 513 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 514 |  | fs := TFileStream.Create(saved.FileName, fmCreate); | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 524 |  | var | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 525 |  | //  Data: Tdata; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 526 |  | fs:   TFileStream; | 
 
 
 
 
 
 
 
 
 | 527 | – | data: TByteData; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 527 |  | i: Integer; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 528 |  | rawinfo: TRawDataInfo; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 529 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 530 |  | opend.Filter := 'Files of matching extension (*.' + | 
 
 
 
 
 
 
 
 
 
 
 | 531 | < | ConManager.Connection[ConID].GetFileInfo(fileid).Extension + ')|*.' + | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 532 | < | ConManager.Connection[ConID].GetFileInfo(fileid).Extension + | 
 
 
 
 
 
 
 
 
 | 531 | > | ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + ')|*.' + | 
 
 
 
 
 | 532 | > | ConManager.Connection[ConnectionID].GetFileInfo(fileid).Extension + | 
 
 
 
 
 
 
 
 
 
 
 | 533 |  | '|All files|*.*'; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 534 |  | if opend.Execute then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 535 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 536 |  | fs := TFileStream.Create(opend.FileName, fmOpenRead); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 537 |  | if fs.Size <> hex.DataSize then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 538 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 | 539 | < | if (not (CR_ResizeRaw in ConManager.Connection[ConID].ChangeRights)) and (not (CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights)) then | 
 
 
 
 
 
 
 
 
 | 539 | > | if (not (CR_ResizeRaw in ConManager.Connection[ConnectionID].ChangeRights)) and (not (CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights)) then | 
 
 
 
 
 
 
 
 
 
 
 | 540 |  | begin | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 541 |  | ShowMessage('Can''t import ' + ExtractFilename(importd.FileName) + | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 542 |  | ', file has to have same size as file in .raw with this backend.' + CrLf + | 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 | 556 |  | Exit; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 557 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 558 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 | 559 | < | rawinfo := ConManager.Connection[ConID].GetRawInfo(fileid, datoffset); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 560 | < | if CR_ResizeRaw in ConManager.Connection[ConID].ChangeRights then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 561 | < | ConManager.Connection[ConID].UpdateRawFile(fileid, datoffset, fs) | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 562 | < | else if CR_AppendRaw in ConManager.Connection[ConID].ChangeRights then | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 563 | < | i := ConManager.Connection[ConID].AppendRawFile(rawinfo.LocSep, fs); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 564 | < | ConManager.Connection[ConID].UpdateDatFilePart(fileid, datoffset, 4, @i); | 
 
 
 
 
 
 
 
 
 | 559 | > | rawinfo := ConManager.Connection[ConnectionID].GetRawInfo(fileid, datoffset); | 
 
 
 
 
 | 560 | > | if CR_ResizeRaw in ConManager.Connection[ConnectionID].ChangeRights then | 
 
 
 
 
 | 561 | > | ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, fs) | 
 
 
 
 
 | 562 | > | else if CR_AppendRaw in ConManager.Connection[ConnectionID].ChangeRights then | 
 
 
 
 
 | 563 | > | i := ConManager.Connection[ConnectionID].AppendRawFile(rawinfo.LocSep, fs); | 
 
 
 
 
 | 564 | > | ConManager.Connection[ConnectionID].UpdateDatFilePart(fileid, datoffset, 4, @i); | 
 
 
 
 
 
 
 
 
 
 
 | 565 |  | end else begin | 
 
 
 
 
 
 
 
 
 
 
 | 566 | < | ConManager.Connection[ConID].UpdateRawFile(fileid, datoffset, fs); | 
 
 
 
 
 
 
 
 
 | 566 | > | ConManager.Connection[ConnectionID].UpdateRawFile(fileid, datoffset, fs); | 
 
 
 
 
 
 
 
 
 
 
 | 567 |  | end; | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 568 |  | fs.Seek(0, soFromBeginning); | 
 
 
 
 
 
 
 
 
 
 
 
 
 | 569 |  | hex.LoadFromStream(fs); |