DOCTYPE html html lang en dir ltr head title SAUCE Standard Architecture for Universal Comment Extensions Revision 5 title meta name author content Olivier Reubens Tasmaniac ACiD style type text css body font 12pt arial sans serif padding left 1em h1 font size 150 font weight bold h2 font size 125 font weight bold h3 font size 110 font weight bold h4 font size 105 font weight bold margin bottom 5em allows following p and h3 close in table data border 2px solid e0e0e0 font 10pt arial sans serif table data thead td background color b0b0b0 font weight bold table data td background color e0e0e0 padding 0 0 5em 0 0 5em table bitfield border collapse collapse font 10pt arial sans serif table bitfield td border 1px solid black padding 0 0 5em 0 0 5em td nowrap white space nowrap p max width 45em text align justify ol ul padding left 2em margin top 0 max width 43em width of p minus padding left of ol text align justify margin bottom 0 ol ul padding left 2em margin top 0 max width 41em width of p minus cumulative padding left of ol and ul text align justify ol ul ul padding left 2em margin top 0 max width 39em width of p minus cumulative padding left of ol and 2x ul text align justify pre Code span Formula font 10pt arial sans serif font style italic span Code font 10pt consolas courier new courier monospace white space nowrap style head body h1 SAUCE ndash Standard Architecture for Universal Comment Extensions h1 address class author by Olivier Tasmaniac Reubens ACiD address p The Standard Architecture for Universal Comment Extensions or SAUCE as it is more commonly known is an architecture or protocol for attaching meta data or comments to files Mainly intended for ANSI art files SAUCE has always had provisions for many different file types p h2 Why SAUCE h2 p In the early 1990s there was a growing popularity in ANSI artwork The ANSI art groups regularly released the works of their members over a certain period Some of the bigger groups also included specialised viewers in each lsquo artpack rsquo One of the problems with these artpacks was a lack of standardized way to provide meta data to the art such as the title of the artwork the author the group Some of the specialised viewers provided such information for a specific artpack either by encoding it as part of the executable or by having some sort of database or list However every viewer did it their own way This meant you either had to use the viewer included with the artpack or had to make do without the extra info SAUCE was created to address that need So if you wanted to you could use your prefered viewer to view the art in a certain artpack or even store the art files you liked in a separate folder while retaining the meta data p p The goal was simple but the way to get there certainly was not Logistically we wanted as many art groups as possible to support it Technically we wanted a system that was easy to implement and ndash if at all possible ndash manage to provide this meta data while still being compatible with all the existing software such as ANSI viewers and Bulletin Board Software p h2 The SAUCE Legacy h2 p SAUCE was created in 1994 and it continues to be in use today as a de facto standard within the ANSI art community However being created so many years ago some of the common assumptions made back then are now cause for confusion This document is a revised edition of the SAUCE specifications slightly more formal and in a fresh HTML format This specification is still compatible with the original some of the legacy confusions are explicitly addressed and a few new features have been added p p The lsquo born from DOS rsquo nature explains some of the limits of SAUCE The Title Author and Group fields are so short because part of the original design idea was that the DOS filename title and author needed to fit on a single line in text mode while still leaving some space so you could create a decent UI to select the files in the ANSI viewers Limitations were also designed around what video cards could do in text mode br The specialised viewers in the various ANSI artpacks also explain why it was possible to add SAUCE to some files even though the file format really does not like it when you just add a load of extra bytes at the end The SAUCE aware viewer could account for the SAUCE and still render the file properly even if the applications used to edit those files regarded the file as corrupt In such an event it was easy enough to remove the SAUCE p p SAUCE is not a perfect solution but at the time ndash and with a bit of friendly pressure from the right folks ndash it managed to fulfill what it was designed to do p h2 SAUCE applied to a file h2 p Applied to a file SAUCE has 4 parts The original file contents an End Of File or EOF character Decimal 26 Hex 1A Ctrl Z an optional comment block and the SAUCE record p p The EOF character is an important part of what makes SAUCE work for text files When processing a text file the DOS Windows TYPE command most BBS terminal software and ANSI viewers will all stop processing at the end of the file or when a EOF character is encountered with the EOF character itself not being rendered p h3 Writing SAUCE to a file h3 p Adding SAUCE to a file that does not already contain SAUCE is straightforward First you prepare the SAUCE record and optionally the comment block You open the file you want to add SAUCE to you append the EOF character if needed you append the comment block and you append the SAUCE record p p Updating a file that already has SAUCE can be easy as well if you only want to change some fields in the SAUCE record or change existing comment lines Things become slightly tricky if you want to add a comment block when there was no comment block before or if the new comment block has a different number of lines than the old one The simple solution in such a case is to remove the old SAUCE then add the new SAUCE you want This involves truncating a file which depending on the language library OS can be a matter of a simple function call or might involve copying the file contents without the SAUCE to a new file p h3 Reading SAUCE from a file h3 p Reading SAUCE is equally easy Read the last 128 bytes of the file into a SAUCE record structure If the ID is set to SAUCE then you can assume you have a file that has SAUCE otherwise it does not If you need the comment block as well then once you have the SAUCE record you can check the Comment field and work your way back to read the comment block p p Below you find some pseudo code to explain this This code assumes a language that can not handle variable records so the comment block is read one line at a time In a language like C or C this can be handled with a single read p pre class Code Variables Byte Count Long FileSize file F Code Open File F Open the file for read access FileSize Size of file F Determine file size 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 ELSE Invalid Comment Non fatal No comment present ENDIF ENDIF ELSE Invalid SAUCE No valid SAUCE record was found ENDIF pre h4 Warning h4 p SAUCE was initially created for supporting only the ANSi and RIP formats Since those formats are lsquo technically rsquo processed one character at a time SAUCE almost never interferes with how a program treats the files reading and processing should stop at the EOF character Files that are treated in a similar way such as ASCII PCBoard Avatar and ANSiMations equally tend to work unaffected even in programs that are not SAUCE aware p p This is b not b true for all the other types of files SAUCE has DataType FileType values for however Adding SAUCE to some of the other types of files may have serious consequences on programs using those files For this reason I would currently advise against adding SAUCE to such files unless there is a pressing reason to do so anyway p p If there are any requests for extending SAUCE to support additional file types such requests will only be honored if the file does not already have its own meta data feature and it can be proven that SAUCE can safely be added from the typical programs editing such files p h2 SAUCE Layout h2 p A SAUCE record is a structure of 128 bytes having the following layout p table class data thead tr td Field name td td Type td td Size td td Description td td Required nbsp sup 1 sup td td Revision nbsp sup 2 sup td tr thead tr td ID td td Character nbsp sup 3 sup td td 5 td td SAUCE identification br This should be equal to SAUCE br td td yes td td 00 0 td tr tr td Version nbsp sup 6 sup td td Character nbsp sup 3 sup td td 2 td td SAUCE version number should be 00 br td td yes td td 00 0 td tr tr td Title td td Character nbsp sup 3 sup td td 35 td td The title of the file td td no td td 00 0 td tr tr td Author td td Character nbsp sup 3 sup td td 20 td td The nick name or handle of the creator of the file td td no td td 00 0 td tr tr td Group td td Character nbsp sup 3 sup td td 20 td td The name of the group or company the creator is employed by td td no td td 00 0 td tr tr td Date td td Character nbsp sup 3 sup td td 8 td td The date the file was created br The format for the date is CCYYMMDD century year month day br Example 4 may 2013 would be stored as 20130504 td td no td td 00 0 td tr tr td FileSize td td Unsigned nbsp sup 4 sup td td 4 td td The original file size not including the SAUCE information td td no nbsp sup 8 sup td td 00 0 td tr tr td DataType td td Unsigned nbsp sup 4 sup td td 1 td td Type of data td td yes td td 00 0 td tr tr td FileType td td Unsigned nbsp sup 4 sup td td 1 td td Type of file td td yes td td 00 0 td tr tr td TInfo1 nbsp sup 7 sup td td Unsigned nbsp sup 4 sup td td 2 td td Type dependant numeric information field 1 td td no td td 00 0 td tr tr td TInfo2 nbsp sup 7 sup td td Unsigned nbsp sup 4 sup td td 2 td td Type dependant numeric information field 2 td td no td td 00 0 td tr tr td TInfo3 nbsp sup 7 sup td td Unsigned nbsp sup 4 sup td td 2 td td Type dependant numeric information field 3 td td no td td 00 0 td tr tr td TInfo4 nbsp sup 7 sup td td Unsigned nbsp sup 4 sup td td 2 td td Type dependant numeric information field 4 td td no td td 00 0 td tr tr td Comments td td Unsigned nbsp sup 4 sup td td 1 td td Number of lines in the extra SAUCE comment block br 0 indicates no comment block is present td td no td td 00 0 td tr tr td TFlags nbsp sup 7 sup td td Unsigned nbsp sup 4 sup td td 1 td td Type dependant flags td td no td td 00 1 td tr tr td TInfoS nbsp sup 7 sup td td ZString nbsp sup 5 sup td td 22 td td Type dependant string information field td td no td td 00 5 td tr table p 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 p table class data thead tr td Field name td td Type td td Size td td Description td td Required nbsp sup 1 sup td td Revision nbsp sup 2 sup td tr thead tr td ID td td Character nbsp sup 3 sup td td 5 td td SAUCE comment block identification br This should be equal to COMNT br td td yes td td 00 0 td tr tr td Comment Line 1 td td Character nbsp sup 3 sup td td 64 td td Line of text td td yes td td 00 0 td tr tr td td td nbsp td td nbsp td td nbsp td td nbsp td td nbsp td tr tr td Comment Line x td td Character nbsp sup 3 sup td td 64 td td Line of text br td td yes td td 00 0 td tr table h4 Notes h4 ol li 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 li li The a href RevisionHistory revision a this field was introduced Before its introduction it was a filler and should have been set to binary 0 li li 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 ul li A Character field should be filled with spaces to indicate it is empty unused li li Example the ID field is 5 bytes long and contains the string SAUCE li li 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 li li Character fields should contain only plain text do not insert formatting codes such as ansi escape codes pcboard color codes html tags li li Do not assume that a viewer will display this in a particular font or even if the font is fixed width or not li li Prior to revision 5 the SAUCE specifications specified lsquo ASCII characters rsquo 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 li ul li li An unsigned binary value of 1 byte 0 to 255 2 bytes 0 to 65535 or 4 bytes 0 to 4294967295 stored in intel a href http en wikipedia org wiki Little endian Little endian little endian a format ul li Note that the FileSize field prior to revision 5 was listed as signed This was an artefact of Turbo Pascal ndash a dominant programming language in the early 1990s ndash 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 li li 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 li ul li li 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 li li 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 li li The interpretation of the TInfo1 TInfo2 TInfo3 TInfo4 TFlags and TInfoS fields a href FileType are dependant on the DataType and FileType a fields li li 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 li ol p An Example C or C SAUCE record looks like this p pre class code 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 pre h2 SAUCE DataType h2 p SAUCE currently supports the following values for DataType p table class data thead tr td DataType td td Name td td Description td td Revision td tr thead tr td 0 td td None td td Undefined filetype br You could use this to add SAUCE to a custom or proprietary file without giving it any particular meaning or interpretation td td 00 0 td tr tr td 1 td td Character td td A character based file br These files are typically interpreted sequentially Also known as streams td td 00 0 td tr tr td 2 td td Bitmap nbsp sup 1 sup td td Bitmap graphic and animation files td td 00 0 td tr tr td 3 td td Vector td td A vector graphic file td td 00 0 td tr tr td 4 td td Audio nbsp sup 2 sup td td An audio file td td 00 0 td tr tr td 5 td td BinaryText td td This is a raw memory copy of a text mode screen Also known as a BIN file br This is essentially a collection of character and attribute pairs td td 00 0 td tr tr td 6 td td XBin td td An XBin or eXtended BIN file td td 00 2 td tr tr td 7 td td Archive td td An archive file td td 00 2 td tr tr td 8 td td Executable td td A executable file td td 00 2 td tr table h4 Notes h4 ol li Prior to revision 5 this was called Graphics li li Prior to revision 5 this was called Sound li ol h2 a id FileType SAUCE FileType a h2 p Each DataType has 1 or more possible values for FileType and associated with each FileType value there is also an interpretation of the TInfo and Flags fields p table class data thead tr td DataType td td FileType td td Name td td Description td td TInfo1 nbsp sup 1 sup td td TInfo2 nbsp sup 1 sup td td TInfo3 nbsp sup 1 sup td td TInfo4 nbsp sup 1 sup td td Flags nbsp sup 1 sup td td TInfoS nbsp sup 2 sup td tr thead tr td None td td 0 td td td td Undefined filetype td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Character td td 0 td td ASCII td td Plain ASCII text file with no formatting codes or color codes td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td a href ANSiFlags ANSiFlags a td td a href FontName FontName a td tr tr td Character td td 1 td td ANSi td td A file with ANSi coloring codes and cursor positioning td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td a href ANSiFlags ANSiFlags a td td a href FontName FontName a td tr tr td Character td td 2 td td ANSiMation td td Like an ANSi file but it relies on a fixed screen size td td Character width nbsp sup 3 sup td td Character screen height nbsp sup 5 sup td td 0 td td 0 td td a href ANSiFlags ANSiFlags a td td a href FontName FontName a td tr tr td Character td td 3 td td RIP script td td Remote Imaging Protocol graphics td td Pixel width 640 td td Pixel height 350 td td Number of colors 16 td td 0 td td 0 td td 0 td tr tr td Character td td 4 td td PCBoard td td A file with PCBoard color codes and macros and ANSi codes td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td 0 td td 0 td tr tr td Character td td 5 td td Avatar td td A file with Avatar color codes and ANSi codes td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td 0 td td 0 td tr tr td Character td td 6 td td HTML td td HyperText Markup Language td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Character td td 7 td td Source td td Source code for some programming language br The file extension should determine the programming language td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Character td td 8 td td TundraDraw td td A TundraDraw file br Like ANSI but with a custom palette td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td 0 td td 0 td tr tr td Bitmap td td 0 td td GIF td td CompuServe Graphics Interchange Format td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 1 td td PCX td td ZSoft Paintbrush PCX td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 2 td td LBM IFF td td DeluxePaint LBM IFF td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 3 td td TGA td td Targa Truecolor td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 4 td td FLI td td Autodesk FLI animation td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 5 td td FLC td td Autodesk FLC animation td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 6 td td BMP td td Windows or OS 2 Bitmap td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 7 td td GL td td Grasp GL Animation td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 8 td td DL td td DL Animation td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 9 td td WPG td td Wordperfect Bitmap td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 10 td td PNG td td Portable Network Graphics td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 11 td td JPG JPeg td td JPeg image any subformat td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 12 td td MPG td td MPeg video any subformat td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Bitmap td td 13 td td AVI td td Audio Video Interleave any subformat td td Pixel width td td Pixel height td td Pixel depth nbsp sup 6 sup td td 0 td td 0 td td 0 td tr tr td Vector td td 0 td td DXF td td CAD Drawing eXchange Format td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Vector td td 1 td td DWG td td AutoCAD Drawing File td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Vector td td 2 td td WPG td td WordPerfect or DrawPerfect vector graphics td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Vector td td 3 td td 3DS td td 3D Studio td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 0 td td MOD td td 4 6 or 8 channel MOD NoiseTracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 1 td td 669 td td Renaissance 8 channel 669 td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 2 td td STM td td Future Crew 4 channel ScreamTracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 3 td td S3M td td Future Crew variable channel ScreamTracker 3 td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 4 td td MTM td td Renaissance variable channel MultiTracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 5 td td FAR td td Farandole composer td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 6 td td ULT td td UltraTracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 7 td td AMF td td DMP DSMI Advanced Module Format td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 8 td td DMF td td Delusion Digital Music Format XTracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 9 td td OKT td td Oktalyser td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 10 td td ROL td td AdLib ROL file FM audio td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 11 td td CMF td td Creative Music File FM Audio td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 12 td td MID td td MIDI Musical Instrument Digital Interface td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 13 td td SADT td td SAdT composer FM Audio td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 14 td td VOC td td Creative Voice File td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 15 td td WAV td td Waveform Audio File Format td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 16 td td SMP8 td td Raw single channel 8bit sample td td Sample rate nbsp sup 7 sup td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 17 td td SMP8S td td Raw stereo 8 bit sample td td Sample rate nbsp sup 7 sup td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 18 td td SMP16 td td Raw single channel 16 bit sample td td Sample rate nbsp sup 7 sup td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 19 td td SMP16S td td Raw stereo 16 bit sample td td Sample rate nbsp sup 7 sup td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 20 td td PATCH8 td td 8 Bit patch file td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 21 td td PATCH16 td td 16 bit patch file td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 22 td td XM td td FastTracker module td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 23 td td HSC td td HSC Tracker FM Audio td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Audio td td 24 td td IT td td Impulse Tracker td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td BinaryText td td Variable nbsp sup 8 sup td td td td Binary screen image td td 0 td td 0 td td 0 td td 0 td td a href ANSiFlags ANSiFlags a td td a href FontName FontName a td tr tr td XBin td td 0 td td td td eXtended Bin td td Character width nbsp sup 3 sup td td Number of lines nbsp sup 4 sup td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 0 td td ZIP td td PKWare Zip td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 1 td td ARJ td td Archive Robert K Jung td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 2 td td LZH td td Haruyasu Yoshizaki Yoshi td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 3 td td ARC td td S E A td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 4 td td TAR td td Unix TAR td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 5 td td ZOO td td ZOO td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 6 td td RAR td td RAR td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 7 td td UC2 td td UC2 td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 8 td td PAK td td PAK td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Archive td td 9 td td SQZ td td SQZ td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr tr td Executable td td 0 td td td td Any executable file exe dll bat br Executable scripts such as vbs should be tagged as Source td td 0 td td 0 td td 0 td td 0 td td 0 td td 0 td tr table h4 Notes h4 ol li A 0 here means the value should always be set to zero otherwise it can optionally contain the matching value li li A 0 here means the field should be set to all binary zeroes otherwise it can optionally contain a a set of flags li li The width in characters the screen or window should be set to in order to properly display the file A value of 0 means no width was provided and you should use an appropriate default usually 80 li li Either 0 or the number of lines the file occupies when fully rendered Some ANSI files have incorrect values for this having the screen height instead You could use the value as a guide for preallocating a rendering buffer Do not assume the value is correct the actual number of screen lines could be lower or higher li li For ANSI animations to render and animate properly they require the rendering window to be set to a specific size Without this the scrolling and absolute positioning may not work as intended and cause the animation to be garbled When omitted it is probably a good idea to assume a 80 by 25 character window li li The number of bits for each pixel A monochrome image has 1 bit per pixel 16 and 256 color images have 4 and 8 bits per pixel respectively possibly assisted by a palette to select colors from a larger color set Truecolor images are 24 bit A 32 bit image typically means a truecolor image with an alpha transparency component While there are currently bitmap formats that allow for even larger pixel depths None of them are currently provided for via SAUCE Some image formats have a fixed number of colors others are variable li li The sampling rate the sample was recorded at li li The BinaryText datatype does not have a file type instead the FileType field is used to encode the width of the image In order to maximize the possible range of widths the width is halved allowing the FileType to specify any even width up to 510 255 2 characters Odd sizes are not supported but this was never a real problem because video cards also only allowed even widths br Set the FileType to half the character width of the image the height of the image can then be inferred by the formula br span class Formula Character Height File size SAUCE information sub SAUCE record comment block and EOF byte sub FileType 2 2 sub Character attribute pairs sub span li ol h2 a id ANSiFlags ANSiFlags a h2 p ANSiFlags allow an author of ANSi and similar files to provide a clue to a viewer editor how to render the image The 8 bits in the ANSiFlags contain the following information p table class bitfield tr td 0 td td 0 td td 0 td td A td td R td td L td td S td td B td tr table p These bits are interpreted as p ul li B Non blink mode iCE Color br When 0 only the 8 low intensity colors are supported for the character background The high bit set to 1 in each attribute byte results in the foreground color blinking repeatedly br When 1 all 16 colors are supported for the character background The high bit set to 1 in each attribute byte selects the high intensity color instead of blinking li li LS Letter spacing a k a 8 9 pixel font selection Introduced in Version 00 5 br Fixed width text mode as used in DOS and early graphics based computers such as the Amiga used bitmap fonts to display text Letter spacing and line spacing is a part of the font bitmap so the font box inside each bitmap was a bit smaller than the font bitmap br For the VGA IBM wanted a smoother font 2 more lines were added and the letter spacing was removed from the font and instead inserted by the VGA hardware during display All 8 pixels in the font could thus be used and still have a 1 pixel letter spacing For the line graphics characters this was a problem because they needed to match up with their neighbours on both sides The VGA hardware was wired to duplicate the 8th column of the font bitmap for the character range C0h to DFh In some code pages was undesired so this feature could be turned off to get an empty letter spacing on all characters as well via the ELG field Enable Line Graphics Character Codes in the Mode Control register 10h of the VGA Attribute Controller 3C0h While the VGA allows you to enable or disable the 8th column duplication there is no way to specify which range of characters this needs to be done for the C0h to DFh range is hardwired into the VGA br These 2 bits can be used to select the 8 pixel or 9 pixel variant of a particular font ul li 00 Legacy value No preference li li 01 Select 8 pixel font li li 10 Select 9 pixel font li li 11 Not currently a valid value li ul Changing the font width and wanting to remain at 80 characters per row means that you need to adjust for a change in horizontal resolution from 720 pixels to 640 or vice versa When you are trying to match the original aspect ratio see the AR bits you will need to adjust the vertical stretching accordingly br Only the VGA and the Hercules video cards actually supported fonts 9 pixels wide SAUCE does not prevent you from specifying you want a 9 pixel wide font for a font that technically was never used that way Note that duplicating the 8th column on non IBM fonts and even some code pages for IBM fonts may not give the desired effect br Some people like the 9 pixel fonts some do not because it causes a visible break in the 3 lsquo shadow blocks rsquo B0h B1h and B2h li li AR Aspect Ratio Introduced in Version 00 5 br Most modern display devices have square pixels but that has not always been the case Displaying an ANSI file that was created for one of the older devices on a device with square pixels will vertically compress the image slightly This can be compensated for by either taking a font that is slightly taller than was used on the legacy device or by stretching the rendered image br These 2 bits can be used to signal that the image was created with square pixels in mind or that it was created for a legacy device with the elongated pixels ul li 00 Legacy value No preference li li 01 Image was created for a legacy device When displayed on a device with square pixels either the font or the image needs to be stretched li li 10 Image was created for a modern device with square pixels No stretching is desired on a device with square pixels li li 11 Not currently a valid value li ul li ul h2 a id FontName FontName a h2 p The FontName field allows an author of ANSi and similar files to provide a clue to the viewer editor which font to use to render the image p p Prior to revision 00 5 this field was a filler so this field will be empty for legacy files Supplying a font name is not required p table class data tr td rowspan 2 Font name nbsp sup 1 sup td td rowspan 2 Font size td td rowspan 2 Resolution nbsp sup 2 sup td td colspan 2 style text align center Aspect ratio nbsp sup 3 sup td td rowspan 2 Vertical stretch nbsp sup 6 sup td td rowspan 2 Description td tr tr td Display nbsp sup 4 sup td td Pixel nbsp sup 5 sup td tr tr td span class Code IBM VGA span td td 9 times 16 nbsp sup 7 sup td td 720 times 400 td td 4 3 td td 20 27 1 1 35 td td 35 td td Standard hardware font on VGA cards for 80 times 25 text mode code page 437 td tr tr td nbsp td td 8 times 16 td td 640 times 400 td td 4 3 td td 6 5 1 1 2 td td 20 td td Modified stats when using an 8 pixel wide version of span class Code IBM VGA span or code page variant td tr tr td span class Code IBM VGA50 span td td 9 times 8 nbsp sup 7 sup td td 720 times 400 td td 4 3 td td 20 27 1 1 35 td td 35 td td Standard hardware font on VGA cards for condensed 80 times 50 text mode code page 437 td tr tr td nbsp td td 8 times 8 td td 640 times 400 td td 4 3 td td 5 6 1 1 2 td td 20 td td Modified stats when using an 8 pixel wide version of span class Code IBM VGA50 span or code page variant td tr tr td span class Code IBM VGA25G span td td 8 times 19 td td 640 times 480 td td 4 3 td td 1 1 td td 0 td td Custom font for emulating 80 times 25 in VGA graphics mode 12 640 times 480 16 color code page 437 td tr tr td span class Code IBM EGA span td td 8 times 14 td td 640 times 350 td td 4 3 td td 35 48 1 1 3714 td td 37 14 td td Standard hardware font on EGA cards for 80 times 25 text mode code page 437 td tr tr td span class Code IBM EGA43 span td td 8 times 8 td td 640 times 350 td td 4 3 td td 35 48 1 1 3714 td td 37 14 td td Standard hardware font on EGA cards for condensed 80 times 43 text mode code page 437 td tr tr td span class Code IBM VGA i i span nbsp sup 8 sup td td 9 times 16 nbsp sup 7 sup td td 720 times 400 td td 4 3 td td 20 27 1 1 35 td td 35 td td Software installed code page font for VGA 80 times 25 text mode td tr tr td span class Code IBM VGA50 i i span nbsp sup 8 sup td td 9 times 8 nbsp sup 7 sup td td 720 times 400 td td 4 3 td td 20 27 1 1 35 td td 35 td td Software installed code page font for VGA condensed 80 times 50 text mode td tr tr td span class Code IBM VGA25G i i span nbsp sup 8 sup td td 8 times 19 td td 640 times 480 td td 4 3 td td 1 1 td td 0 td td Custom font for emulating 80 times 25 in VGA graphics mode 12 640 times 480 16 color td tr tr td span class Code IBM EGA i i span nbsp sup 8 sup td td 8 times 14 td td 640 times 350 td td 4 3 td td 35 48 1 1 3714 td td 37 14 td td Software installed code page font for EGA 80 times 25 text mode td tr tr td span class Code IBM EGA43 i i span nbsp sup 8 sup td td 8 times 8 td td 640 times 350 td td 4 3 td td 35 48 1 1 3714 td td 37 14 td td Software installed code page font for EGA condensed 80 times 43 text mode td tr tr td span class Code Amiga Topaz 1 span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Original Amiga Topaz Kickstart 1 x font A500 A1000 A2000 td tr tr td span class Code Amiga Topaz 1 span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Modified Amiga Topaz Kickstart 1 x font A500 A1000 A2000 td tr tr td span class Code Amiga Topaz 2 span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Original Amiga Topaz Kickstart 2 x font A600 A1200 A4000 td tr tr td span class Code Amiga Topaz 2 span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Modified Amiga Topaz Kickstart 2 x font A600 A1200 A4000 td tr tr td span class Code Amiga P0T NOoDLE span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Original P0T NOoDLE font td tr tr td span class Code Amiga MicroKnight span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Original MicroKnight font td tr tr td span class Code Amiga MicroKnight span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Modified MicroKnight font td tr tr td span class Code Amiga mOsOul span td td 8 times 8 nbsp sup 9 sup td td 640 times 200 td td 4 3 td td 5 12 1 2 4 td td 140 td td Original mOsOul font td tr tr td span class Code C64 PETSCII unshifted span td td 8 times 8 nbsp sup 10 sup td td 320 times 200 td td 4 3 td td 5 6 1 1 2 td td 20 td td Original Commodore PETSCII font PET VIC 20 C64 CBM II Plus 4 C16 C116 and C128 in the unshifted mode Unshifted mode graphics only has uppercase letters and additional graphic characters This is the normal boot font td tr tr td span class Code C64 PETSCII shifted span td td 8 times 8 nbsp sup 10 sup td td 320 times 200 td td 4 3 td td 5 6 1 1 2 td td 20 td td Original PETSCII font in shifted mode Shifted mode text has both uppercase and lowercase letters This mode is actuated by pressing Shift Commodore key td tr tr td span class Code Atari ATASCII span td td 8 times 8 nbsp sup 11 sup td td 320 192 td td 4 3 td td 4 5 1 1 25 td td 25 td td Original ATASCII font Atari 400 800 XL XE td tr table h4 Notes h4 ol li The font name the author designed the artwork for Since these are typically bitmapped fonts that only support 256 characters these fonts have a fixed size and are designed with a specific use in mind Characters in the range 32 127 tend to follow the ASCII encoding which is now also the basis of the same range in Unicode Control characters in the range 0 to 31 are typically not displayable in text mode formats like ANSI files and require more direct access to the hardware to get them displayed The visual appearance of these control characters is not part of the ASCII standard Characters in the range 128 255 are different for each font For the IBM PC IBM designed their own encoding which later became known as code page 437 Some other systems Amiga C64 used their own encoding for the high characters that did not follow the IBM code page convention If you do not support a particular font in this list either fallback to an appropriate less specific definition of the same font or fallback to whatever default font your program supports br As a simple but effective fallback strategy for the IBM family of fonts ul li If you do not support the span class Code VGA25G span span class Code VGA50 span or span class Code EGA43 span variant of a font fallback to the span class Code VGA span or span class Code EGA span variant string replace span class Code VGA50 span and span class Code VGA25G span with span class Code VGA span and span class Code EGA43 span with span class Code EGA span li li If you do not support span class Code EGA span fonts fallback to the matching span class Code VGA span variant and vice versa string replace span class Code EGA span with span class Code VGA span or vice versa li li Code page span class Code 872 span and span class Code 855 span are mostly interchangeable only different for the euro sign li li Code page span class Code 858 span and span class Code 850 span are mostly interchangeable only different for the euro sign li li Code page span class Code 865 span and span class Code 437 span are mostly interchangeable 9Bh lsquo rsquo replacing lsquo rsquo and 9Dh lsquo rsquo replacing lsquo rsquo li li If you do not support the specific code page fallback to default variant remove span class Code span from the end of the string li li Fallback to whatever font your program uses as default li ul For the Amiga family of fonts ul li If you do not support the span class Code span version of a font fallback to the normal version remove the span class Code span from the string li li If you do not support the custom font fallback to span class Code Amiga Topaz 1 span li li Fallback to whatever font your program uses as default li ul li li The screen resolution the font was intended for li li The aspect ratio is the ratio of the width of a shape to its height The aspect ratio is expressed as two numbers separated by a colon width height These values do not express an actual measurement they represent the relation between width and height If the width is larger than the height the shape has a ldquo landscape rdquo orientation Width equal to height gives a square Width smaller than height gives a ldquo portrait rdquo orientation li li The aspect ratio of the display device the font was intended for Up until around 2003 the common display device was either a CRT computer monitor or a CRT TV which usually had a display aspect ratio of 4 3 and occasionally 5 4 Those formats are being replaced by ldquo widescreen rdquo displays commonly having a 16 10 or 16 9 aspect ratio li li Modern display devices LCD LED and plasma tend to have square pixels or at least as near square as is technically feasible because square pixels make it easy to draw squares and circles For various technical reasons square pixels have not always been the norm however br The downside of this is that if one tries to display an image or font on a display with a different aspect ratio than it was intended for the image will appear to be stretched or compressed All the old display modes tended to have a pixels that were taler than they were wide so they will appear compressed vertically on a display with a 1 1 pixel aspect ratio br You can compensate for this compression by stretching the image but this will introduce pixelation when you just duplicate pixel lines or blurring when you apply anti aliassing or interpolation br Similar to trying to display a 4 3 TV signal on a widescreen display some people will prefer the compressed but lsquo native pixel rsquo sharpness and others will prefer the native dimension and accept the loss in sharpness br The pixel aspect ratio is obtained by dividing the display aspect ratio width by the horizontal resolution and dividing the display aspect ratio height by the vertical resolution and then reducing both sides of the ratio li li The stretching percentage that needs to be applied to the composed bitmap so that its relative size matches the original device it was intended for The actual calculation for this stretch percentage would normally involve knowing the current display aspect ratio as well as the resolution However since most modern screens have a 1 1 aspect ratio this can simplified to br span class Formula pixel aspect ratio height pixel aspect ratio width 1 100 span br Or alternatively br span class Formula display aspect height y resolution display aspect width x resolution 1 100 span li li 9 pixel fonts to be completed li li The span class Code ldquo rdquo span is a placeholder these 3 characters should be replaced by one of the code pages IBM Microsoft defined for use in DOS The possible values for code page span class Code i i span are ul li span class Code 437 span The character set of the original IBM PC Also known as span class Code lsquo MS DOS Latin US rsquo span li li span class Code 720 span Arabic Also known as span class Code lsquo Windows 1256 rsquo span li li span class Code 737 span Greek Also known as span class Code lsquo MS DOS Greek rsquo span li li span class Code 775 span Baltic Rim Estonian Lithuanian and Latvian Also known as span class Code lsquo MS DOS Baltic Rim rsquo span li li span class Code 819 span Latin 1 Supplemental Also known as span class Code lsquo Windows 28591 rsquo span and span class Code lsquo ISO IEC 8859 1 rsquo span br It is commonly mistaken for span class Code lsquo Windows 1252 rsquo span which it resembles except for the 80h 9fh range C1 control codes li li span class Code 850 span Western Europe Also known as span class Code lsquo MS DOS Latin 1 rsquo span br Designed to include all the language glyphs part of the line graphics characters were sacrificed which made some DOS programs appear strange Because of this most systems in these countries stuck with span class Code CP437 span instead li li span class Code 852 span Central Europe Bosnian Croatian Czech Hungarian Polish Romanian Serbian and Slovak Also known as span class Code lsquo MS DOS Latin 2 rsquo span br Designed to include all the language glyphs part of the line graphics characters were sacrificed which made some DOS programs appear strange Because of this several countries adopted their own unofficial encoding system instead li li span class Code 855 span Cyrillic Serbian Macedonian Bulgarian Russian Also known as span class Code lsquo MS DOS Cyrillic rsquo span br Used in Serbia Macedonia and Bulgaria but eventually replaced by span class Code CP866 span Never caught on in Russia li li span class Code 857 span Turkish Also known as span class Code lsquo MS DOS Turkish rsquo span br Based on span class Code CP850 span and designed to include all characters from span class Code ISO 8859 9 span with a different encoding li li span class Code 858 span Western Europe br Identical to span class Code CP850 span but has the euro sign at D5h instead Also known as span class Code lsquo Modified code page 850 rsquo span li li span class Code 860 span Portuguese Also known as span class Code lsquo MS DOS Portuguese rsquo span br Even though this code page preserves all the line graphics characters Brazil has mainly adopted span class Code CP850 span which does not li li span class Code 861 span Icelandic Also known as span class Code lsquo MS DOS Icelandic rsquo span li li span class Code 862 span Hebrew Also known as span class Code lsquo MS DOS Hebrew rsquo span br Obsolete on modern operating systems replaced by Unicode which preserves the logical bidirectional order which DOS could not li li span class Code 863 span French Canada Also known as span class Code lsquo MS DOS French Canada rsquo span li li span class Code 864 span Arabic br Sacrifices all of the line graphics characters encoding the single line box characters differently in order to get more Arabic symbols span class Code CP720 span does preserve the line graphics characters li li span class Code 865 span Nordic li li span class Code 866 span Cyrillic li li span class Code 869 span Greek 2 Also known as span class Code lsquo MS DOS Greek 2 rsquo span br Designed to include all the glyphs from span class Code ISO 8859 7 span with a different encoding part of the line graphics characters were sacrificed which made some DOS programs appear strange This made span class Code CP869 span unpopular and most Greek systems used span class Code CP737 span instead li li span class Code 872 span Cyrillic br Identical to span class Code CP855 span but has the euro sign at CFh instead li li span class Code KAM span lsquo Kamenick rsquo encoding Also known as span class Code lsquo KEYBCS2 rsquo span br Used for Czech this code page was custom designed as an alternative for span class Code CP852 span to preserved the line graphics characters while providing the characters needed for the Czech language Supported in some DOS clones under the unofficial code page number span class Code 867 span or span class Code 895 span li li span class Code MAZ span lsquo Mazovia rsquo encoding br Used for Polish this code page was custom designed as an alternative for span class Code CP852 span to preserved the line graphics characters while providing the characters needed for the Polish language Supported in some DOS clones under the unofficial code page number span class Code 667 span or span class Code 790 span li li span class Code MIK span Cyrillic br Most widespread codepage in Bulgaria Supported in some DOS clones under the unofficial code page number span class Code 866 span li ul So for example span class Code IBM VGA 855 span would select the VGA 9 times 16 font for code page span class Code 855 span for 80 times 25 text mode br Unsupported code pages ul li span class Code 667 span Unofficial code page number for lsquo Mazovia rsquo encoding use span class Code MAZ span instead li li span class Code 790 span Unofficial code page number for lsquo Mazovia rsquo encoding on FreeDOS use span class Code MAZ span instead li li span class Code 866 span Unofficial code page number for lsquo MIK rsquo encoding use span class Code MIK span instead li li span class Code 867 span Unofficial code page number for lsquo Kamenick rsquo encoding use span class Code KAM span instead li li span class Code 895 span Unofficial code page number for lsquo Kamenick rsquo encoding use span class Code KAM span instead li li span class Code 991 span Unofficial code page number depending on the Operating System or device its meaning could differ Probably refers to span class Code MAZ span li ul li li The Amiga 500 typically works at a 640 times 200 resolution or 640 times 400 in interlaced mode on NTSC monitor USA and Japan and at 640 times 256 640 times 512 interlaced on PAL monitors most of Europe In interlaced mode rather than condensing the font to achieve double the amount of lines of text the font instead was stretched to double its size br It is not uncommon to now find programs using a pre stretched 8 16 font for displaying Amiga ANSI files In that case the pixel ratio mentioned here should be adjusted accordingly to 5 6 1 1 2 and the vertical stretching to 20 li li This font was used in a 40 times 25 character mode It may be necessary to double the size of the font or image to get the chunky look li li This font was used in a 40 times 24 character mode It may be necessary to double the size of the font or image to get the chunky look li ol h2 a id RevisionHistory Revision History a h2 table class data thead tr td Version Revision td td Date td td Description td tr thead tr td 00 0 td td class nowrap March 1 1994 td td SAUCE is released as part of the monthly ACiD acquisition artpack td tr tr td 00 1 td td class nowrap June 30 1994 td td Added the Flags field in the SAUCE record td tr tr td 00 2 td td class nowrap July 13 1996 td td Added support for ul li Character Html li li Bitmap PNG replacing Bitmap SBM li li Vector 3DS replacing Vector SVI li li Audio XM li li Audio HSC li li XBin li li Archive various formats li li Executable li ul td tr tr td 00 3 td td class nowrap July 29 1996 td td Character Avatar extended to use TInfo1 and TInfo2 br Added support for Audio IT td tr tr td 00 4 td td May 31 1997 td td Technical cleanup td tr tr td 00 5 td td class nowrap November 12 2013 td td Complete rewrite of the spec ndash this document br ul li Filler is now used as a type dependant string li li Flags for ANSI files and similar has been changed to include letter spacing selection as well as aspect ratio selection li li ANSI files and similar can now specifiy a font li ul td tr table body html