Changeset 99 for VisualSwapcodes/Unit1.pas
- Timestamp:
- Feb 20, 2007, 5:34:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
VisualSwapcodes/Unit1.pas
r98 r99 104 104 current_list.AddElem('SWAPC_2BYTE', 2) 105 105 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); 127 107 end; 128 108 if Pos('gTemplate_', line) = 1 then … … 170 150 begin 171 151 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); 173 161 current_list := TSwapList(current_list.Child(i)); 174 162 end else if datas = 'SWAPC_VARARR_E' then … … 223 211 function TSwapList.CloseArray: TSwapList; 224 212 begin 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; 226 217 Result := Self.parent; 227 218 end; … … 239 230 node: PVirtualNode; 240 231 name: String; 241 address: Integer; 242 243 procedure AddChilds(parent: PVirtualNode; SwapList: TSwapList); 232 233 procedure AddChilds(parent: PVirtualNode; SwapList: TSwapList; address: Integer); 244 234 var 245 235 i: Integer; … … 252 242 data.Size := SwapList.Child(i).size; 253 243 data.Address := address; 254 if parent = nil then 255 address := address + data.Size; 244 address := address + data.Size; 256 245 node := AddVSTEntry(VST, parent, data); 257 246 if SwapList.Child(i) is TSwapList then 258 AddChilds(node, TSwapList(SwapList.Child(i)) );247 AddChilds(node, TSwapList(SwapList.Child(i)), address); 259 248 end; 260 249 end; … … 264 253 VST.Clear; 265 254 VST.BeginUpdate; 266 267 address := 0;268 255 269 256 name := list.Items.Strings[list.ItemIndex]; … … 274 261 if i < Length(Types) then 275 262 begin 276 AddChilds(nil, Types[i].SwapList );263 AddChilds(nil, Types[i].SwapList, 0); 277 264 end; 278 265
Note:
See TracChangeset
for help on using the changeset viewer.