fsxNet Wiki

BBS Development & Resources

User Tools

Site Tools


probbs:sauce

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

probbs:sauce [2019/11/18 07:08]
ozz created
probbs:sauce [2019/11/18 07:26] (current)
ozz
Line 13: Line 13:
 ==== SPECIFICATIONS ==== ==== SPECIFICATIONS ====
  
-^Fieldname|^Type|^Size|^Description|^Required ​((1))|^Revision ​((2))|+^Fieldname|^Type|^Size|^Description|^Required ​[1]|^Revision ​[2]|
 ^ID||Character [3]||5||SAUCE identification. This should be equal to "​SAUCE"​.||yes||00.0| ^ID||Character [3]||5||SAUCE identification. This should be equal to "​SAUCE"​.||yes||00.0|
-^Version((6))||Character [3]||2||SAUCE version number, should be "​00"​.||yes||00.0|+^Version[6]||Character [3]||2||SAUCE version number, should be "​00"​.||yes||00.0|
 ^Title||Character [3]||35||The title of the file.||no||00.0| ^Title||Character [3]||35||The title of the file.||no||00.0|
 ^Author||Character [3]||20||The (nick)name or handle of the creator of the file.||no||00.0| ^Author||Character [3]||20||The (nick)name or handle of the creator of the file.||no||00.0|
 ^Group||Character [3]||20||The name of the group or company the creator is employed by.||no||00.0| ^Group||Character [3]||20||The name of the group or company the creator is employed by.||no||00.0|
 ^Date||Character [3]||8||The date the file was created. The format for the date is **CCYYMMDD** (century, year, month, day). Example: 4 may 2013 would be stored as ''​20130504''​.||no||00.0| ^Date||Character [3]||8||The date the file was created. The format for the date is **CCYYMMDD** (century, year, month, day). Example: 4 may 2013 would be stored as ''​20130504''​.||no||00.0|
-^FileSize||Unsigned [4]||4||The original file size not including the SAUCE information.||no ​((8))||00.0|+^FileSize||Unsigned [4]||4||The original file size not including the SAUCE information.||no ​[8]||00.0|
 ^DataType||Unsigned [4]||1||Type of data.||yes||00.0| ^DataType||Unsigned [4]||1||Type of data.||yes||00.0|
 ^FileType||Unsigned [4]||1||Type of file.||yes||00.0| ^FileType||Unsigned [4]||1||Type of file.||yes||00.0|
Line 31: Line 31:
 ^TInfoS [7]||ZString [5]||22||Type dependent string information field||no||00.5|| ^TInfoS [7]||ZString [5]||22||Type dependent string information field||no||00.5||
  
 +==== COMMENTS ====
 +
 + A SAUCE comment block is an optional, variable sized structure that holds up to 255 lines of additional information,​ each line 64 characters wide. There are as many comment lines as is mentioned in the Comments field of the SAUCE record. If the Comments field is set to 0, there should not be a comment block at all. The comment block has the following layout:
 +
 +^Field name|^Type|^Size|^Description|^Required [1]|^Revision [2]|
 +^ID||Character [3]||5||SAUCE comment block identification. This should be equal to "​COMNT"​.||yes||00.0|
 +^Comment Line 1||Character [3]||64||Line of text.||yes||00.0|
 +^...|||||||||||
 +^Comment Line x||Character [3]||64||Line of text.||yes||00.0|
 +
 +=== NOTES ===
 +
 +  - You need to provide a correct value for all required fields. A non-required field should either be set to the correct value, or when not used should be filled with spaces for the Character fields, set to 0 for the Unsigned fields or filled with binary zeroes for the ZString field.
 +  - The revision this field was introduced. Before its introduction,​ it was a filler and should have been set to binary 0.
 +  - The Character type is a string of characters encoded according to code page 437 (IBM PC / OEM ASCII). It is neither a pascal type string with a leading length byte nor is it a C-style string with a trailing terminator character. Any value shorter than the available length should be padded with spaces.
 +     * A Character field should be filled with spaces to indicate it is empty / unused.
 +        ***Example:​** the ID field is 5 bytes long and contains the string "​SAUCE"​.
 +     * I have seen SAUCE where Character fields were terminated with a binary 0 with the remainder containing garbage. When making a SAUCE reader, it is a good idea to properly handle this case. When writing SAUCE, stick with space padding.
 +     * Character fields should contain only plain text, do not insert formatting codes such as ansi escape codes, pcboard color codes, html tags, ...
 +     * Do not assume that a viewer will display this in a particular font or even if the font is fixed width or not.
 +     * Prior to revision 5, the SAUCE specifications specified ‘ASCII characters’ which implies code page 437. There are ANSI files out there however where the artist assumed an ANSI according to his native code page and also has SAUCE assumed as such.
 +  - An unsigned binary value of 1 byte (0 to 255), 2 bytes (0 to 65535) or 4 bytes (0 to 4294967295) stored in intel little-endian format.
 +      * Note that the FileSize field prior to revision 5 was listed as signed. This was an artifact of Turbo Pascal – a dominant programming language in the early 1990s – supporting a signed integer of 4 bytes but not having an unsigned integer of 4 bytes. Since a file size can never be negative, it is safe to assume unsigned.
 +      * SAUCE prior to revision 5 only allowed SAUCE on files up to 2Gb in size, which back then was hardly a problem since hard disks were typically smaller.
 +  - A C-style zero terminated string of characters encoded according to code page 437 (IBM PC / OEM ASCII). The part of the string not used should be filled with binary zero. Prior to revision 00.5 this field was a filler and was expected to be set to all binary zero, the different approach compared to the other Character fields serves as extra backwards compatibility.
 +  - If you read a SAUCE record with a version number your software does not support, do not try to interpret the rest of the SAUCE record according to the 00 version spec.
 +  - The interpretation of the TInfo1, TInfo2, TInfo3, TInfo4, TFlags and TInfoS fields are dependent on the DataType and FileType fields.
 +  - FileSize was required in SAUCE prior to revision 5, it is now optional to be more in line with established reality. Many SAUCEd files have an incorrectly set FileSize. If you need to add SAUCE to a file larger than 4Gb, set FileSize equal to 0.
 +
 +<code C>
 +struct SAUCE
 +{
 +    char           ​ID[5];​
 +    char           ​Version[2];​
 +    char           ​Title[35];​
 +    char           ​Author[20];​
 +    char           ​Group[20];​
 +    char           ​Date[8];​
 +    unsigned long  FileSize;
 +    unsigned char  DataType;
 +    unsigned char  FileType;
 +    unsigned short TInfo1;
 +    unsigned short TInfo2;
 +    unsigned short TInfo3;
 +    unsigned short TInfo4;
 +    unsigned char  Comments;
 +    unsigned char  TFlags;
 +    char           ​TInfoS[22];​
 +};
 +</​code>​
probbs/sauce.1574060892.txt.gz · Last modified: 2019/11/18 07:08 by ozz