--- oup/current/Global/DatStructureLoader.pas 2007/02/21 03:12:33 109 +++ oup/current/Global/DatStructureLoader.pas 2007/02/25 17:20:22 113 @@ -12,10 +12,11 @@ type // 9 : float // 10 : bitset // 11 : raw-addr - // 12 : dat-file-ID + // 12 : untyped-dat-file-ID-link // 13..16: Signed Integer[1..4] // 17 : level-ID // 100..300: dat-file-name[0..200] + // 501..614: typed-dat-file-ID-link // 1000..9999: Unused data[0-8999] // 10000+: string[0+] description: String; @@ -67,6 +68,8 @@ begin Result := 4; 100..300: Result := datatype - 100; + 500..614: + Result := 4; 1000..9999: Result := datatype - 1000; 10000..65535: @@ -127,7 +130,6 @@ end; function LoadStructureDefinition(ConnectionID, FileID: Integer): TStructDef; var - i: Integer; current_type: Byte; //0: Global, 1: Undynamic, 2: Dynamic current_base, current_package, current_package_size: Integer; packages: Integer; @@ -176,7 +178,7 @@ begin 3: begin current_type := 1; - current_base := HexToLong(fields[2]); + current_base := StrToInt(fields[2]); SetLength(Result.Subs, Length(Result.Subs) + 1); Result.Subs[High(Result.Subs)].SubName := MidStr(fields[0], 2, Length(fields[0]) - 1); @@ -185,24 +187,24 @@ begin 6: begin current_type := 2; - current_base := HexToLong(fields[2]); + current_base := StrToInt(fields[2]); current_package := 0; current_package_size := StrToInt(fields[5]); if fields[4][1] <> '$' then begin case StrToInt(fields[4]) of 1: - packages := Data[HexToLong(fields[3])]; + packages := Data[StrToInt(fields[3])]; 2: - packages := Data[HexToLong(fields[3])] + Data[HexToLong(fields[3]) + 1] * 256; + packages := Data[StrToInt(fields[3])] + Data[StrToInt(fields[3]) + 1] * 256; 4: - packages := Data[HexToLong(fields[3])] + Data[HexToLong(fields[3]) + 1] * - 256 + Data[HexToLong(fields[3]) + 2] * 256 * 256 + Data[HexToLong(fields[3]) + 3] * 256 * 256 * 256; + packages := Data[StrToInt(fields[3])] + Data[StrToInt(fields[3]) + 1] * + 256 + Data[StrToInt(fields[3]) + 2] * 256 * 256 + Data[StrToInt(fields[3]) + 3] * 256 * 256 * 256; end; end else begin - packages := HexToLong(fields[4]); + packages := StrToInt(fields[4]); end; SetLength(Result.Subs, Length(Result.Subs) + packages); for current_package := 0 to packages - 1 do @@ -236,7 +238,7 @@ begin structentry.description := ''; if current_type in [0, 1] then begin - structentry.offset := HexToLong(fields[1]) + current_base; + structentry.offset := StrToInt(fields[1]) + current_base; if Length(Result.Subs) = 0 then begin SetLength(Result.Global, Length(Result.Global) + 1); @@ -255,7 +257,7 @@ begin for current_package := 0 to packages - 1 do begin structentry.offset := - current_base + current_package * current_package_size + HexToLong(fields[1]); + current_base + current_package * current_package_size + StrToInt(fields[1]); with Result.Subs[High(Result.Subs) - packages + current_package + 1] do begin SetLength(Entries, Length(Entries) + 1); @@ -274,4 +276,4 @@ begin end; -end. +end. \ No newline at end of file