��������������������������ķ � What is SAUCE?

� �������������������������� Recipe for SAUCE Chef cuisinier : Tasmaniac / ACiD Maitre d'h�tel : Rad Man / ACiD ANSi's used to be just ANSi's, pictures were just pictures, loaders were just loaders and quite frankly, every file was just as plain tasting as every other. This is about to change, however, because ACiD has decided to give their files an extra "je-ne-sais-quoi." In reality, we'll be adding SAUCE to every file you can imagine. Now, before we thoroughly confuse you, let us explain what we are doing here. SAUCE stands for "Standard Architecture for Universal Comment Extensions." Although originally intended for personal use in ANSi's and RIP screens, early in the developement of EFI (Extended File Information) it was decided that EFI should be extended to have support for more than just ANSi and RIP screens. Our brainchild was born and the specs were designed. The only aspect left undecided was the name, and after rejecting some very funny candidates, SAUCE was unanimously chosen. This leads us to the big question in the sky, "What is sauce?" SAUCE is a universal process to incorporate a full description for any type of file. The most outstanding aspect of this concept is that you have access to the complete file name, the file's title, the creation date, the creator of the file, the group that the creator is employed by, and much, much, more. Let us begin with a description of the record layouts used. The record layouts and code examples are in a variated pascal pseudo code, and should be transferrable enough to implement in most other programming languages. For ease of reading, the examples assume that the file is correct and that no errorchecking need be included. How rigorous you check for errors is completely up to you, and will most likely depend on the file type you are describing. SAUCE RECORD -----------This portion of the documentation is about the SAUCE record. The SAUCE record describes the file in short, and provides other information not included in the SAUCE record itself. A sauce record is _EXACTLY_ 128 bytes in size. Fieldname Size Type BYTE WORD INTEGER LONG : : : : : : : Name of the field. Size of the field in BYTES Type of data. This can be : One byte unsigned numeric value (0 to 255) Two byte unsigned numeric value (0 to 65535) Two byte signed numeric value (-32768 to 32767) Four byte signed numeric value (-2147483648 to 2147483647)

CHARACTER : One byte ASCII value. Longer character fields are padded with spaces. It is _NOT_ a PASCAL string (with a leading length byte), and it's _NOT_ a C-Style string (with a trailing nul-byte). A 10 byte character field holding the text 'ANSI' would look like this. 'ANSI '. Numeric fields should be zero when not used, character fields should be all spaces when not used. V# : SAUCE Version number. This indicates the version of SAUCE when the field was implemented.

Description : Complete description of the field. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! No fields are REQUIRED to be filled in except for ID, Version, FileSize, DataType and FileType. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FieldName Size Type V# Description --------- ---- --------- -- ----------ID 5 Character 00 SAUCE Identification. This should be equal to 'SAUCE' or the record is not a valid SAUCE record. Version 2 Character 00 Version number of SAUCE. Current version is '00'. As new features are added to the specifications of SAUCE, this version number will change. Future versions SHOULD remain compatible with version 00 only ADDING on the specifications, it is however not unlikely that this compatibility is impossible to maintain, but this is of no concern now. Title 35 Character 00 Title of the file. Author 20 Character 00 Name or handle of the creator of the file. Group 20 Character 00 Name of the group the creator is employed by. Date 8 Character 00 Date the file was created. This date is in the format CCYYMMDD (Century, year, month, day). There is a good reason why the date is in this format, but it's not used in version '00' of SAUCE. It will be used in a future version of SAUCE. FileSize 4 Long 00 Original filesize NOT including any information of SAUCE. DataType 1 Byte 00 Type of Data. (See DATATYPES further on) FileType 1 Byte 00 Type of File. (See DATATYPES further on) TInfo1 2 Word 00 Numeric information field 1 (See DATATYPES) When used, this field holds informative values. Any program using SAUCE should not rely on these values being correct or filled in. TInfo2 2 Word 00 Numeric information field 2 (See DATATYPES) TInfo3 2 Word 00 Numeric information field 3 (See DATATYPES) TInfo4 2 Word 00 Numeric information field 4 (See DATATYPES) Comments 1 Byte 00 Number of Comment lines (See COMMENTS) Flags 2 Word * 00 Flags indication optional settings/switches These flags have different meaning depending

on the data type. The flags weren't originally in the concept for Version 00 of SAUCE. but since the specification of SAUCE expects all filler bytes to be binary zero, the flags should be set to ZERO in all previous files, and cause no significant harm. An Example PASCAL record looks like this: TYPE SAUCERec = RECORD ID Version Title Author Group Date FileSize DataType FileType TInfo1 TInfo2 TInfo3 TInfo4 Comments Flags Filler END; : : : : : : : : : : : : : : : : Array[1..5] of Char; Array[1..2] of Char; Array[1..35] of Char; Array[1..20] of Char; Array[1..20] of Char; Array[1..8] of Char; Longint; Byte; Byte; Word; Word; Word; Word; Byte; Byte; Array[1..22] of Char;

An Example C record looks like this: typedef SAUCEREC char char char char char char signed long unsigned char unsigned char unsigned int unsigned int unsigned int unsigned int unsigned char char } SAUCEREC; { ID[5]; Version[2]; Title[35]; Author[20]; Group[20]; Date[8]; FileSize; DataType; FileType; TInfo1; TInfo2; TInfo3; TInfo4; Flags; Filler[22];

DATATYPES --------DataType and FileType hold the information needed to determine what type of file it is. There are 5 DataTypes, these are (with their respective numeric values) : 0) None : Undefined filetype, you could use this to add SAUCE

1) Character : 2) Graphics 3) Vector 4) Sound : : :

5) BinaryText:

information to personal datafiles needed by programs, but not having any other meaning. Any character based file. Examples are ASCII, ANSi and RIP. Any bitmap graphic file. Examples are GIF, LBM, and PCX. Any vector based graphic file. Examples are DXF and CAD files. Any sound related file. Examples are samples, MOD files and MIDI. This is RAW memory copy of a text screen. It's basically the BIN format you can save from whitin TheDraw. Each character is built up of two consecutive bytes. The first is the character to be displayed. The second is the Attribute byte.

None ---When using the 'None' datatype, you should have FileType set to zero also. This is a compatibility issue as it's not unlikely, the 'None' datatype will have filetypes in the future. Character --------When using the 'Character' datatype, you have following filetypes available : 0) ASCII 1) : Plain text file with no formatting codes or color codes. TInfo1 is used for the width of the file. TInfo2 is used to hold the number of lines in the file. ANSi : ANSi file. With ANSi color codes and cursor positioning. TInfo1 is used for the width of the file. TInfo2 is used to hold the number of ANSi screen lines in the file. ANSiMation: ANSi Animation. With ANSi color codes and cursor positioning. While an ANSi file can also have animated sequences, there is a clear distinction. While an ANSi may or may not have a beginning animated sequence introducing the group or artist the rest is just a sequence of colored characters. An ANSiMation on the other hand is a more like a text mode cartoon. TInfo1 is used for the width of the file. TInfo2 is used to hold the number of ANSi screen lines the ANSiMation was created for. A program using SAUCE may use these two values to switch to the appropriate video mode. RIP : Remote Imaging Protocol (RIP) graphics file. TInfo1 holds the width (should be 640) TInfo2 holds the height (should be 350) TInfo3 holds the number of colors (should be 16) PCBoard : File with PCBoard style @X color codes and @ macro's and ANSi codes. TInfo1 is used for the width of the file. TInfo2 is used to hold the number of ANSi screen lines in the file. AVATAR : A file with AVATAR and ANSi color codes and cursor





positioning. FLAGS for the Character Datatype. ----�� 7 ��� 6 ��� 5 ��� 4 ��� 3 ��� 2 ��� 1 ��� 0 Ŀ � � � � � � � � � � 0 � 0 � 0 � 0 � 0 � 0 � 0 � A � � � � � � � � � � ������������������������������������������������� All non-used bits should be ZERO. A) Non-Blink mode (iCE Color). When this bit is SET (equal to 1) The ANSi is created using iCE color codes. This is a special mode where the blinking is disabled, and you have 16 background colors available. Basically, you have the same choice for background colors as for foreground colors. Please note: When the picture does not make specific use of the iCE color, you should NOT have this bit set. When you do not support the iCE color mode, you should probably not display the file as it could look pretty weird in normal mode. Graphics -------For all graphics types, TInfo1 holds width of the image, TInfo2 holds the Height of the image and TInfo3 holds the number of bits per pixel (a 256 colour image would have 8 bits per pixel, a TrueColor image would have 24); Following Graphics filetypes are available : 0) 1) 2) 3) 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) GIF PCX LBM/IFF TGA FLI FLC BMP GL DL WPG SBM JPG MPG AVI (CompuServ Graphics Interchange format) (ZSoft Paintbrush PCX format) (DeluxePaint LBM/IFF format) (Targa Truecolor) (Autodesk FLI animation file) (Autodesk FLC animation file) (Windows Bitmap) (Grasp GL Animation) (DL Animation) (Wordperfect Bitmap) (SUN BitMap) (JPeg compressed File) (MPeg compressed animation/video) (Audio Visual Interlace)

FLAGS ----Not used, should be all zeroes. Vector -----Following Vector filetypes are available : 0) DXF (CAD Data eXchange File)

1) DWG 2) WPG 3) SVI

(AutoCAD Drawing file) (WordPerfect/DrawPerfect vector graphics) (Sun VectorImage)

FLAGS ----Not used, should be all zeroes. Sound ----Following sound filetypes are available : 0) MOD (4, 6 or 8 channel MOD/NST file) 1) 669 (Renaissance 8 channel 669 format) 2) STM (Future Crew 4 channel ScreamTracker format) 3) S3M (Future Crew variable channel ScreamTracker3 format) 4) MTM (Renaissance variable channel MultiTracker Module) 5) FAR (Farandole composer module) 6) ULT (UltraTracker module) 7) AMF (DMP/DSMI Advanced Module Format) 8) DMF (Delusion Digital Music Format (XTracker)) 9) OKT (Oktalyser module) 10) ROL (AdLib ROL file (FM)) 11) CMF (Creative Labs FM) 12) MIDI (MIDI file) 13) SADT (SAdT composer FM Module) 14) VOC (Creative Labs Sample) 15) WAV (Windows Wave file) 16) SMP8 (8 Bit Sample, TInfo1 holds sampling rate) 17) SMP8S (8 Bit sample stereo, TInfo1 holds sampling rate) 18) SMP16 (16 Bit sample, TInfo1 holds sampling rate) 19) SMP16S (16 Bit sample stereo, TInfo1 holds sampling rate) 20) PATCH8 (8 Bit patch-file) 21) PATCH16(16 Bit Patch-file) FLAGS ----Not used, should be all zeroes. BinaryText ---------The Binary Text format, basically has no Filetype, since the datatype has already defined how the file will look. The FileType however specifies the WIDTH of the BinaryText screen. Only the Width is required, as the Height can be calculated by dividing the filesize by the Width. In an attempt to provide as much WIDTH as possible in a possible 256 values of the Byte-sized FileType. The width is specified in Multiples of 2. The fact that the Width is specified in multiples of 2 isn't really a problem, since you also need to define the effective screen size in multiples of 2. An example : For normal 80*25 binary images as made with TheDraw the FileType value would be 40 (since 2*40 equals 80 <g>) All you need to do is divide the width of the binary text image by 2. This gives a maximum width of 510 characters. Although currently not supported, should there be a need for even bigger images, this can be arranged.

Please note. BinaryText expects the character-attribute pairs to be stored one row at a time. If you wanted to create a 80*100 Image, you could do this by just copying 4 80*25 or 2 80*50 together to form one bigger image. If for example you wanted to create a 160*25 image from 2 80*25 images, you would need to write a little program which would copy line 1 from image 1, line 1 from image 2, Line 2 from Image 1, Line 2 from Image 2 and so on. Basically, you should have all character-attribute pairs from one line of the COMPLETE image one after the other, followed by all char-attribute pairs from the next row, and so on. If the picture does not fit this format. You should use the NONE datatype. Besides. you'd probably want to have it in this format anyway, as it seems to be the most logical approach to have these kind of images. FLAGS for the BinaryText Datatype. ----�� 7 ��� 6 ��� 5 ��� 4 ��� 3 ��� 2 ��� 1 ��� 0 Ŀ � � � � � � � � � � 0 � 0 � 0 � 0 � 0 � 0 � 0 � A � � � � � � � � � � ������������������������������������������������� All non-used bits should be ZERO. A) Non-blink mode (iCE Color). This bit has exactly the same meaning as for the Character datatype. It indicates whether the picture uses iCE color. COMMENTS -------The comment holds up to 255 characters wide.

block is an addition to the SAUCE record. It lines of additional information. Each line 64 it holds the number of single comment line is fields in the SAUCE no leading length byte

When the Comments field is not zero, additional comment lines are available. A 64 characters long. Like the character record, it is padded with spaces, and has or trailing null-byte.

The comment block is preceded with a 5 character identification mark. This identification mark is 'COMNT'. SAUCE IN FILES -------------A file with SAUCE added to it. ���������������Ŀ � � � FILE DATA � � � ���������������Ĵ � �

Will look like this:

Actual file data.

As if it would be without SAUCE.

� EOF MARKER � � � ���������������Ĵ � � � COMMENT BLOCK � � � ���������������Ĵ � � � SAUCE RECORD � � � ����������������� The Comment block ���������������Ŀ � � � 'COMNT' � � � ���������������Ĵ � � � COMMENTLINE 1 � � � ���������������Ĵ � � � COMMENTLINE 2 � � � ���������������Ĵ ... ���������������Ĵ � � � COMMENTLINE N � � � �����������������

EOF marker. This will assure character files can easily determine the end of file. Optional Comment block.

SAUCE record.

Comment block ID bytes

First comment line

Second comment line

n-th comment line, n equals the Comments field in SAUCE record.

EXAMPLE CODE TO READ SAUCE -------------------------Variables: Byte : Count; Long : FileSize; file : F; Code: Open_File(F); | Open the file for read access FileSize = Size_of_file(F); | Determine filesize Seek_file (F, FileSize-128); | Seek to start of SAUCE (Eof-128) Read_File (F, SAUCE); | Read the SAUCE record IF SAUCE.ID="SAUCE" THEN | ID bytes match "SAUCE" ? IF SAUCE.Comments>0 THEN | Is there a comment block ? Seek_File(F, FileSize-128-(SAUCE.Comments*64)-5); | Seek to start of Comment block. Read_File(F, CommentID); | Read Comment ID. IF CommentID="COMNT" THEN | Comment ID matches "COMNT" ? For Count=1 to SAUCE.Comments| \ Read all comment lines. Read_File(F, CommentLine) | / ENDFOR


| Non fatal, No comment present.

| No valid SAUCE record was found.

SAUCE DATAFILE -------------The full specifications of the SAUCE datafile are not ready yet. INFORMATION OR UPGRADES ----------------------If you have a need for additional information on SAUCE, or need modifications, you can contact me at these places... Leave a message to TASMANIAC : Neo Tokyo +32-50-620112 +32-50-625717 USR 28800 Dual ZyXEL 19200

or contact SiDS at bmorin@wpi.edu