Ignore:
Timestamp:
Feb 20, 2007, 5:34:20 PM (18 years ago)
Author:
alloc
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • VisualSwapcodes/Unit1.pas

    r98 r99  
    104104          current_list.AddElem('SWAPC_2BYTE', 2)
    105105        else if datas = 'SWAPC_1BYTE' then
    106           current_list.AddElem('SWAPC_1BYTE', 1)
    107         else if datas = 'SWAPC_FIXARR_S' then
    108         begin
    109           ReadLn(descfile, line);
    110           if Pos('h', line) > 0 then
    111             datas := MidStr(line, Pos('db ', line) + 3, Pos('h', line) - (Pos('db ', line) + 3) )
    112           else
    113             datas := MidStr(line, Pos('db ', line) + 3, Length(Line) - (Pos('db ', line) + 3) );
    114           i := current_list.AddArray('SWAPC_FIXARR_S', StrToInt('$'+datas));
    115           current_list := TSwapList(current_list.Child(i));
    116         end else if datas = 'SWAPC_VARARR_S' then
    117         begin
    118           ReadLn(descfile, line);
    119           i := current_list.AddArray('SWAPC_VARARR_S', 0);
    120           current_list := TSwapList(current_list.Child(i));
    121         end else if datas = 'SWAPC_TMPL_PTR' then
    122         begin
    123           ReadLn(descfile, line);
    124           datas := MidStr(line, Pos('dd ', line) + 4, 4);
    125           current_list.AddElem('SWAPC_TMPL_PTR: ' + datas, 4);
    126         end;
     106          current_list.AddElem('SWAPC_1BYTE', 1);
    127107      end;
    128108      if Pos('gTemplate_', line) = 1 then
     
    170150      begin
    171151        ReadLn(descfile, line);
    172         i := current_list.AddArray('SWAPC_VARARR_S', 0);
     152        datas := MidStr(line, Pos(' d', line) + 4, Length(line) - (Pos(' d', line) + 3));
     153        if datas = 'SWAPC_8BYTE' then
     154          i := current_list.AddArray('SWAPC_VARARR_S', 8)
     155        else if datas = 'SWAPC_4BYTE' then
     156          i := current_list.AddArray('SWAPC_VARARR_S', 4)
     157        else if datas = 'SWAPC_2BYTE' then
     158          i := current_list.AddArray('SWAPC_VARARR_S', 2)
     159        else if datas = 'SWAPC_1BYTE' then
     160          i := current_list.AddArray('SWAPC_VARARR_S', 1);
    173161        current_list := TSwapList(current_list.Child(i));
    174162      end else if datas = 'SWAPC_VARARR_E' then
     
    223211function TSwapList.CloseArray: TSwapList;
    224212begin
    225   Self.size := Self.size * Self.count;
     213  if Self.name = 'SWAPC_FIXARR_S' then
     214    Self.size := Self.size * Self.count
     215  else
     216    Self.size := Self.count;
    226217  Result := Self.parent;
    227218end;
     
    239230  node:    PVirtualNode;
    240231  name:    String;
    241   address: Integer;
    242 
    243   procedure AddChilds(parent: PVirtualNode; SwapList: TSwapList);
     232
     233  procedure AddChilds(parent: PVirtualNode; SwapList: TSwapList; address: Integer);
    244234  var
    245235    i: Integer;
     
    252242        data.Size := SwapList.Child(i).size;
    253243        data.Address := address;
    254         if parent = nil then
    255           address := address + data.Size;
     244        address := address + data.Size;
    256245        node := AddVSTEntry(VST, parent, data);
    257246        if SwapList.Child(i) is TSwapList then
    258           AddChilds(node, TSwapList(SwapList.Child(i)));
     247          AddChilds(node, TSwapList(SwapList.Child(i)), address);
    259248      end;
    260249    end;
     
    264253  VST.Clear;
    265254  VST.BeginUpdate;
    266 
    267   address := 0;
    268255
    269256  name := list.Items.Strings[list.ItemIndex];
     
    274261  if i < Length(Types) then
    275262  begin
    276     AddChilds(nil, Types[i].SwapList);
     263    AddChilds(nil, Types[i].SwapList, 0);
    277264  end;
    278265
Note: See TracChangeset for help on using the changeset viewer.