| author | ecalot
<ecalot> 2004-07-14 16:32:06 UTC |
| committer | ecalot
<ecalot> 2004-07-14 16:32:06 UTC |
| parent | 00310e8a1e51851fb5f960afd494fcb0c6bf9303 |
| FP/doc/FormatSpecifications | +99 | -32 |
| FP/doc/FormatSpecifications.tex | +99 | -32 |
diff --git a/FP/doc/FormatSpecifications b/FP/doc/FormatSpecifications index bb2b252..9f22eb4 100644 --- a/FP/doc/FormatSpecifications +++ b/FP/doc/FormatSpecifications @@ -4,33 +4,36 @@ Table of Contents ~~~~~ ~~ ~~~~~~~~ -1. Preamble .......................................................... 35 -2. Introduction ...................................................... 40 -3. Primitives ........................................................ 54 -3.1. DAT reading and writing primitives .............................. 65 -3.2. DAT reading primitives .......................................... 77 -3.3. DAT writing primitives .......................................... 84 -4. File Specifications ............................................... 85 -4.1. General file specs, index and checksums ......................... 95 -4.2. Images ......................................................... 160 -4.2.1 Headers ....................................................... 163 -4.2.2 Algorithms .................................................... 186 -4.2.2.1 Run length encoding (RLE) ................................... 202 -4.2.2.2 LZ variant (LZG) ............................................ 213 -4.3. Palettes ....................................................... 290 -4.4. Levels ......................................................... 297 -4.4.1 Unknown blocks ................................................ 325 -4.4.2 Room mapping .................................................. 342 -4.4.3 Room linking .................................................. 448 -4.4.4 Guard handling ................................................ 464 -4.4.5 Starting Position ............................................. 491 -4.4.6 Door events ................................................... 505 -4.5. Digital Waves .................................................. 549 -4.6. Midi music ..................................................... 559 -4.7. Internal PC Speaker ............................................ 562 -4.8. Binary files ................................................... 567 -5. Credits .......................................................... 573 -6. License .......................................................... 586 +1. Preamble ............................................................. 38 +2. Introduction ......................................................... 43 +3. Primitives ........................................................... 63 +3.1. DAT reading and writing primitives ................................. 68 +3.2. DAT reading primitives ............................................. 80 +3.3. DAT writing primitives ............................................. 87 +4. DAT v1.0 Format Specifications ....................................... 95 +4.1. General file specs, index and checksums ............................ 98 +4.2. Images ............................................................ 163 +4.2.1 Headers .......................................................... 166 +4.2.2 Algorithms ....................................................... 189 +4.2.2.1 Run length encoding (RLE) ...................................... 205 +4.2.2.2 LZ variant (LZG) ............................................... 216 +4.3. Palettes .......................................................... 294 +4.4. Levels ............................................................ 301 +4.4.1 Unknown blocks ................................................... 329 +4.4.2 Room mapping ..................................................... 346 +4.4.3 Room linking ..................................................... 452 +4.4.4 Guard handling ................................................... 468 +4.4.5 Starting Position ................................................ 495 +4.4.6 Door events ...................................................... 509 +4.5. Digital Waves ..................................................... 553 +4.6. Midi music ........................................................ 563 +4.7. Internal PC Speaker ............................................... 566 +4.8. Binary files ...................................................... 571 +5. PLV v1.0 Format Specifications ...................................... 577 +5.1. User data ......................................................... 599 +5.2. Allowed Date format ............................................... 623 +6. Credits ............................................................. 636 +7. License ............................................................. 653 1. Preamble ~~~~~~~~ @@ -89,8 +92,8 @@ Table of Contents void mWriteCloseDatFile(tResource* r[],int dontSave,int optionflag, const char* backupExtension); -4. File Specifications - ~~~~ ~~~~~~~~~~~~~~ +4. DAT v1.0 Format Specifications + ~~~ ~~~~ ~~~~~~ ~~~~~~~~~~~~~~ 4.1. General file specs, index and checksums All DAT files has an index, this index has a number of items count and @@ -284,7 +287,8 @@ Table of Contents } } } - return ((pos==arraySize)&(cursor==imageSize)); /* 0 is ERROR, 1 is SUCCESS */ + return ((pos==arraySize)&(cursor==imageSize)); + /* 0 is ERROR, 1 is SUCCESS */ } 4.3. Palettes @@ -570,7 +574,66 @@ Just raw sound saving n records of a 16-color-palette of 3 bytes in the specified palette format. -5. Credits +5. PLV v1.0 Format Specifications + + PLV v1.0 files are defined in this table: + + Size Offset Description Type Content + ~~~~ ~~~~~~ ~~~~~~~~~~~ ~~~~ ~~~~~~~ + 7 0 Magic identifier text "POP_LVL" + 1 7 POP version UC 0x01 + 1 8 PLV version UC 0x01 + 1 9 Level Number UC + 4 10 Number of fields BE + 4 14 Block 1: Level size (B1) BE 2306 + B1 18 Block 1: Level code + 4 18+B1 Block 2: User data size (B2) BE + B2 22+B1 Block 2: User data + + Level code is the exact level as described in 4.4 including the checksum + byte. Note that Level size also includes the checksum byte in the count. + POP version is 1 for POP1 and 2 for POP2. + PLV version is 1 for PLV v1.0. + Only one level may be saved in a PLV, the level number is saved inside. + +5.1. User data + + User data is a block of extensible information, Number of fields is the + count of each field/value information pair. A pair is saved in the + following format: + field_name\0value\0 + where \0 is the null byte (0x00) and field_name and value are strings. + + There are mandatory pairs that must be included in all PLV files. + Those are: + + Field name Description + ~~~~~~~~~~ ~~~~~~~~~~~ + EDITORNAME The name of the editor used to save the file + EDITORVERS The version of the editor used to save the file + AUTHOR The author of the file + TITLE A title for the level + DESCRIPTION A description + TIMECREATED The time when the file was created + TIMELASTMODIF The time of the last modification to the file + ORIGINALFILENAME The name of the original file name (levels.dat) + + The content values may be empty. + +5.2. Allowed Date format + To make easy time parsing the time format must be very strict. + There are only two allowed formats: with seconds and without. + With seconds the format is "YYYY-MM-DD HH:II:SS" + Without seconds the format is "YYYY-MM-DD HH:II" + Where YYYY is the year in 4 digits, MM is the month in numbers, MM the + months, DD the days, HH the hour, II the minute and SS the second in the + military time: HH is a number from 00 to 23. + + If the month, day, hour or second have only one digit, the other digit + must be completed with 0. + i.e. 2002-11-26 22:16:39 + +6. Credits ~~~~~~~ This document: Writing . . . . . . . . . . . . . . . . . . . . . . . . . Enrique Calot @@ -582,8 +645,12 @@ Just raw sound RLE Compression . . . . . . . . . . . . . . . . . . . Tammo Jan Dijkema LZG Compression . . . . . . . . . . . . . . . . . . . . . Anke Balderer Sounds . . . . . . . . . . . . . . . . . . . . . . . Christian Lundheim + + PLV v1.0: + Definition . . . . . . . . . . . . . . . . . . . . . . . Brendon James + Enrique Calot -6. License +7. License ~~~~~~~ Copyright (c) 2004 Princed Project Team Permission is granted to copy, distribute and/or modify this document diff --git a/FP/doc/FormatSpecifications.tex b/FP/doc/FormatSpecifications.tex index bb2b252..9f22eb4 100644 --- a/FP/doc/FormatSpecifications.tex +++ b/FP/doc/FormatSpecifications.tex @@ -4,33 +4,36 @@ Table of Contents ~~~~~ ~~ ~~~~~~~~ -1. Preamble .......................................................... 35 -2. Introduction ...................................................... 40 -3. Primitives ........................................................ 54 -3.1. DAT reading and writing primitives .............................. 65 -3.2. DAT reading primitives .......................................... 77 -3.3. DAT writing primitives .......................................... 84 -4. File Specifications ............................................... 85 -4.1. General file specs, index and checksums ......................... 95 -4.2. Images ......................................................... 160 -4.2.1 Headers ....................................................... 163 -4.2.2 Algorithms .................................................... 186 -4.2.2.1 Run length encoding (RLE) ................................... 202 -4.2.2.2 LZ variant (LZG) ............................................ 213 -4.3. Palettes ....................................................... 290 -4.4. Levels ......................................................... 297 -4.4.1 Unknown blocks ................................................ 325 -4.4.2 Room mapping .................................................. 342 -4.4.3 Room linking .................................................. 448 -4.4.4 Guard handling ................................................ 464 -4.4.5 Starting Position ............................................. 491 -4.4.6 Door events ................................................... 505 -4.5. Digital Waves .................................................. 549 -4.6. Midi music ..................................................... 559 -4.7. Internal PC Speaker ............................................ 562 -4.8. Binary files ................................................... 567 -5. Credits .......................................................... 573 -6. License .......................................................... 586 +1. Preamble ............................................................. 38 +2. Introduction ......................................................... 43 +3. Primitives ........................................................... 63 +3.1. DAT reading and writing primitives ................................. 68 +3.2. DAT reading primitives ............................................. 80 +3.3. DAT writing primitives ............................................. 87 +4. DAT v1.0 Format Specifications ....................................... 95 +4.1. General file specs, index and checksums ............................ 98 +4.2. Images ............................................................ 163 +4.2.1 Headers .......................................................... 166 +4.2.2 Algorithms ....................................................... 189 +4.2.2.1 Run length encoding (RLE) ...................................... 205 +4.2.2.2 LZ variant (LZG) ............................................... 216 +4.3. Palettes .......................................................... 294 +4.4. Levels ............................................................ 301 +4.4.1 Unknown blocks ................................................... 329 +4.4.2 Room mapping ..................................................... 346 +4.4.3 Room linking ..................................................... 452 +4.4.4 Guard handling ................................................... 468 +4.4.5 Starting Position ................................................ 495 +4.4.6 Door events ...................................................... 509 +4.5. Digital Waves ..................................................... 553 +4.6. Midi music ........................................................ 563 +4.7. Internal PC Speaker ............................................... 566 +4.8. Binary files ...................................................... 571 +5. PLV v1.0 Format Specifications ...................................... 577 +5.1. User data ......................................................... 599 +5.2. Allowed Date format ............................................... 623 +6. Credits ............................................................. 636 +7. License ............................................................. 653 1. Preamble ~~~~~~~~ @@ -89,8 +92,8 @@ Table of Contents void mWriteCloseDatFile(tResource* r[],int dontSave,int optionflag, const char* backupExtension); -4. File Specifications - ~~~~ ~~~~~~~~~~~~~~ +4. DAT v1.0 Format Specifications + ~~~ ~~~~ ~~~~~~ ~~~~~~~~~~~~~~ 4.1. General file specs, index and checksums All DAT files has an index, this index has a number of items count and @@ -284,7 +287,8 @@ Table of Contents } } } - return ((pos==arraySize)&(cursor==imageSize)); /* 0 is ERROR, 1 is SUCCESS */ + return ((pos==arraySize)&(cursor==imageSize)); + /* 0 is ERROR, 1 is SUCCESS */ } 4.3. Palettes @@ -570,7 +574,66 @@ Just raw sound saving n records of a 16-color-palette of 3 bytes in the specified palette format. -5. Credits +5. PLV v1.0 Format Specifications + + PLV v1.0 files are defined in this table: + + Size Offset Description Type Content + ~~~~ ~~~~~~ ~~~~~~~~~~~ ~~~~ ~~~~~~~ + 7 0 Magic identifier text "POP_LVL" + 1 7 POP version UC 0x01 + 1 8 PLV version UC 0x01 + 1 9 Level Number UC + 4 10 Number of fields BE + 4 14 Block 1: Level size (B1) BE 2306 + B1 18 Block 1: Level code + 4 18+B1 Block 2: User data size (B2) BE + B2 22+B1 Block 2: User data + + Level code is the exact level as described in 4.4 including the checksum + byte. Note that Level size also includes the checksum byte in the count. + POP version is 1 for POP1 and 2 for POP2. + PLV version is 1 for PLV v1.0. + Only one level may be saved in a PLV, the level number is saved inside. + +5.1. User data + + User data is a block of extensible information, Number of fields is the + count of each field/value information pair. A pair is saved in the + following format: + field_name\0value\0 + where \0 is the null byte (0x00) and field_name and value are strings. + + There are mandatory pairs that must be included in all PLV files. + Those are: + + Field name Description + ~~~~~~~~~~ ~~~~~~~~~~~ + EDITORNAME The name of the editor used to save the file + EDITORVERS The version of the editor used to save the file + AUTHOR The author of the file + TITLE A title for the level + DESCRIPTION A description + TIMECREATED The time when the file was created + TIMELASTMODIF The time of the last modification to the file + ORIGINALFILENAME The name of the original file name (levels.dat) + + The content values may be empty. + +5.2. Allowed Date format + To make easy time parsing the time format must be very strict. + There are only two allowed formats: with seconds and without. + With seconds the format is "YYYY-MM-DD HH:II:SS" + Without seconds the format is "YYYY-MM-DD HH:II" + Where YYYY is the year in 4 digits, MM is the month in numbers, MM the + months, DD the days, HH the hour, II the minute and SS the second in the + military time: HH is a number from 00 to 23. + + If the month, day, hour or second have only one digit, the other digit + must be completed with 0. + i.e. 2002-11-26 22:16:39 + +6. Credits ~~~~~~~ This document: Writing . . . . . . . . . . . . . . . . . . . . . . . . . Enrique Calot @@ -582,8 +645,12 @@ Just raw sound RLE Compression . . . . . . . . . . . . . . . . . . . Tammo Jan Dijkema LZG Compression . . . . . . . . . . . . . . . . . . . . . Anke Balderer Sounds . . . . . . . . . . . . . . . . . . . . . . . Christian Lundheim + + PLV v1.0: + Definition . . . . . . . . . . . . . . . . . . . . . . . Brendon James + Enrique Calot -6. License +7. License ~~~~~~~ Copyright (c) 2004 Princed Project Team Permission is granted to copy, distribute and/or modify this document