[35] | 1 | unit Unit3_data;
|
---|
| 2 | interface
|
---|
| 3 | uses Classes, Graphics;
|
---|
| 4 |
|
---|
| 5 | const
|
---|
| 6 | Version:String='v0.32a';
|
---|
| 7 | DBVersion:String='0.3';
|
---|
| 8 | CrLf:String[2]=#13+#10;
|
---|
| 9 |
|
---|
| 10 | type
|
---|
| 11 | TData=Array of Byte;
|
---|
| 12 | THeader=packed Record
|
---|
| 13 | Ident:Array[0..$13] of Byte;
|
---|
| 14 | Files:LongWord;
|
---|
| 15 | NamedFiles:LongWord;
|
---|
| 16 | Extensions:LongWord;
|
---|
| 17 | DataAddr:LongWord;
|
---|
| 18 | DataSize:LongWord;
|
---|
| 19 | NamesAddr:LongWord;
|
---|
| 20 | NamesSize:LongWord;
|
---|
| 21 | Ident2:Array[0..$F] of Byte;
|
---|
| 22 | end;
|
---|
| 23 | TFilesMap=Array of packed Record
|
---|
| 24 | Extension:Array[0..$3] of Char;
|
---|
| 25 | DataAddr:LongWord;
|
---|
| 26 | NameAddr:LongWord;
|
---|
| 27 | FileSize:LongWord;
|
---|
| 28 | FileType:LongWord;
|
---|
| 29 | end;
|
---|
| 30 | TFileInfo=packed Record
|
---|
| 31 | ID:Integer;
|
---|
| 32 | FileName:String;
|
---|
| 33 | FileNameHex:String;
|
---|
| 34 | Extension:String[4];
|
---|
| 35 | Name:String;
|
---|
| 36 | Size:LongWord;
|
---|
| 37 | FileType:LongWord;
|
---|
| 38 | DatAddr:LongWord;
|
---|
| 39 | opened:Boolean;
|
---|
| 40 | end;
|
---|
| 41 | TFiles=Array of TFileInfo;
|
---|
| 42 |
|
---|
| 43 | TNamedFilesMap=Array of packed Record
|
---|
| 44 | FileNumber:LongWord;
|
---|
| 45 | blubb:LongWord;
|
---|
| 46 | end;
|
---|
| 47 | TExtensionsMap=Array of packed Record
|
---|
| 48 | Ident:Array[0..$7] of Byte;
|
---|
| 49 | Extension:Array[0..$3] of Char;
|
---|
| 50 | ExtCount:LongWord;
|
---|
| 51 | end;
|
---|
| 52 |
|
---|
| 53 | TLevelInfo=Record
|
---|
| 54 | Ident:Array[0..$13] of Byte;
|
---|
| 55 | LevelNumber:Byte;
|
---|
| 56 | end;
|
---|
| 57 |
|
---|
| 58 | TAppSettings=Record
|
---|
| 59 | DatPath:String[250];
|
---|
| 60 | ExtractPath:String[250];
|
---|
| 61 | FilenumbersAsHex:Boolean;
|
---|
| 62 | CharSet:TFontCharSet;
|
---|
| 63 | HideUnusedData:Boolean;
|
---|
| 64 | end;
|
---|
| 65 |
|
---|
| 66 | TExportHandlers=Record
|
---|
| 67 | Ext:String[4];
|
---|
| 68 | needed:Boolean;
|
---|
| 69 | Handler:Function(fileid:LongWord; filename:String; convert:Boolean):Integer;
|
---|
| 70 | end;
|
---|
| 71 |
|
---|
| 72 | TStringArray=Array of String;
|
---|
| 73 | TExtList=Array of Record
|
---|
| 74 | Ext:String;
|
---|
| 75 | count:LongWord;
|
---|
| 76 | end;
|
---|
| 77 |
|
---|
| 78 | TRawInfo=Record
|
---|
| 79 | src_id:LongWord;
|
---|
| 80 | src_offset:LongWord;
|
---|
| 81 | raw_addr:LongWord;
|
---|
| 82 | raw_size:LongWord;
|
---|
| 83 | loc_sep:Boolean;
|
---|
| 84 | end;
|
---|
| 85 | TRawList=Array of TRawInfo;
|
---|
| 86 |
|
---|
| 87 | TDatLinks=Array of Record
|
---|
| 88 | Src_Offset:LongWord;
|
---|
| 89 | Target:LongWord;
|
---|
| 90 | END;
|
---|
| 91 |
|
---|
| 92 | var
|
---|
| 93 | {
|
---|
| 94 | opened_state:Byte=0;
|
---|
| 95 | dat_filename:String='';
|
---|
| 96 | raw_filename:String='';
|
---|
| 97 | dat_os_mac:Boolean=False;
|
---|
| 98 | dat_header:Theader;
|
---|
| 99 | dat_filesmap:Tfilesmap;
|
---|
| 100 | dat_files:Tfiles;
|
---|
| 101 | dat_namedfilesmap:Tnamedfilesmap;
|
---|
| 102 | dat_extensionsmap:Textensionsmap;
|
---|
| 103 | }
|
---|
| 104 | AppSettings:TAppSettings;
|
---|
| 105 | AppSettingsFile:File of TAppSettings;
|
---|
| 106 | {
|
---|
| 107 | database_level:LongWord;
|
---|
| 108 | database_ident:Array[0..$13] of Byte;
|
---|
| 109 | }
|
---|
| 110 | const
|
---|
| 111 | { header_ident1_pc:Array[0..$13] of Byte=
|
---|
| 112 | ($1F,$27,$DC,$33,$DF,$BC,$03,$00,$31,$33,$52,$56,$40,$00,$14,$00,$10,$00,$08,$00);
|
---|
| 113 | header_ident1_mac:Array[0..$13] of Byte=
|
---|
| 114 | ($61,$30,$C1,$23,$DF,$BC,$03,$00,$31,$33,$52,$56,$40,$00,$14,$00,$10,$00,$08,$00);
|
---|
| 115 | header_ident2:Array[0..$F] of Byte=
|
---|
| 116 | ($99,$CF,$40,$00,$90,$4F,$63,$00,$F4,$55,$5F,$00,$90,$4F,$63,$00);
|
---|
| 117 | }
|
---|
| 118 | export_noerror:Integer=0;
|
---|
| 119 | export_nohandler:Integer=1;
|
---|
| 120 | export_handlererror:Integer=2;
|
---|
| 121 | export_error:Integer=3;
|
---|
| 122 | {
|
---|
| 123 | opened_nothing:Byte=0;
|
---|
| 124 | opened_dat:Byte=1;
|
---|
| 125 | opened_db:Byte=2;
|
---|
| 126 | }
|
---|
| 127 | implementation
|
---|
| 128 |
|
---|
| 129 | end.
|
---|
| 130 |
|
---|