                           A Guide to the Cookie Jar
                           -------------------------

    The cookie jar first appeared in TOS  v1.6  (Rainbow TOS) and is in all
    later versions of TOS. It  contains  a  list of (hopefully) unique four
    letter names  followed  by  a  longword  of  data  (that  contains some
    information about the cookie you are looking at).

    Cookies are placed in the  jar  by  the operating system (ATARI Cookies
    always start their names with an  underscore (e.g. "_CPU")) and by some
    TSR programs.

    There is a system variable at $5a0  called P_cookies that points to the
    cookie jar. It contains the longword address of the start of the cookie
    jar (or zero  if  no  cookie  jar  exists).  P_cookies  will contain an
    address of zero on cold boot of  any machine with TOS version less than
    v1.6.

    Each cookie consists of two  longwords.  The  first  is the name of the
    cookie. The second is the information about that cookie.

    The cookie jar should be searched for the name that you require until a
    name of $00000000 is found.  This  is  a  special cookie that is always
    last in the list. Its  value  longword  contains  the number of cookies
    that can be fitted in  the  current  jar.  Remember that each cookie is
    eight bytes.

    If you want to add a cookie you  must  check this value to see if there
    is enough room  to  add  another  cookie  (subtract  number  of cookies
    present, including $0 cookie, from  number  contained  in $0 cookie. If
    you are left with a  number  greater  than  zero,  copy the zero cookie
    (eight bytes) to the next slot  (eight  bytes down) and put your cookie
    in the slot that the zero cookie used to have.

    If there is  not  enough  room  to  add  a  new  cookie,  allocate some
    PERMANENT memory that has enough room  for  all cookies and eight or so
    spares and move all cookies to the new jar. Remember to change the zero
    cookie to reflect the new  number  of  slots available. Finally, change
    the cookie pointer to point to the new jar.

    Remember that the cookie pointer survives a warm reset, so your program
    that adds a cookie to it  should  also  survive a warm reset, as should
    the cookie jar memory.

    If there is no cookie jar, you  should  be  on a straight ST, all other
    machines should have a  cookie  jar.  ST's  can  have  cookie jars if a
    program makes one. If a  program  makes  a  Jar from scratch, it should
    remove it on a Warm  reset  by  setting  P_cookies  to zero, unless the
    program itself will survive the warm reset.

    KNOWN COOKIES
    -------------
    _AKP Atari Keyboard Preference

          0 = USA
          1 = Germany
          2 = France
          3 = United Kingdom
          4 = Spain
          5 = Italy
          6 = Sweden
          7 = Switzerland (French)
          8 = Switzerland (German)
          9 = Turkey
         10 = Finland
         11 = Norway
         12 = Denmark
         13 = Saudi Arabia
         14 = Holland
         15 = Czechoslovakia
         16 = Hungary
         Used by any AES >=3.30

    _CPU           CPU type

         Low Word = 0,10,20,30 (maybe 40 later?)
         This is the processor type used in the machine (680XX)

    _FDC           Floppy Disk Density (Max)

         High Byte indicates Highest Density Floppy in Machine
         00 = 360K/720K - Double Density
         01 = 1.44M - High Density
         02 = 2.88M - Extra High Density
         Low three bytes indicate whoose Floppy it is...
         Currently $415443 (ATC) used to indicate fitted by ATARI

    _FLK           File Locking Version

         If cookie is present, file sharing/locking can be used
         MINT will install this cookie, as will some GEMDOS versions
         Value is the version number of the file sharing extensions
         MINT currently puts in version 0

    _FPU           Floating Point Unit

         Bit 0 Set = I/O mapped 68881 or ATARI SFP004
         Bit 1 Set = 68881 or 68882
         Bit 2 Set = 68882 if bit 1 Set, else 68881
         Bit 3 Set = Internal FPU (in processor) or software emulation

    _FRB           Fast Ram Buffer

         Address of a 64K buffer used by the ACSI DMA Device drivers.
         Used as a temporary  storage  area  when  transferring to Fast Ram
    (TT)
         as DMA does not have access to Fast Ram.
         Use only if DMA not flock'ed by system variable.

    _IDT           International Time & Date Display Mode

         High Word Currently Unused
         Low Byte is Date Separator (e.g. #"/")
         Bits 8-11
                   00 = MM-DD-YY
                   01 = DD-MM-YY
                   02 = YY-MM-DD
                   03 = YY-DD-MM
         Bits 12-15
                   00 = 12 Hour Clock
                   01 = 24 Hour Clock

    _MCH           Machine Type

         High Word is Main type and is the part to check.
         00 = 520ST or 1040ST or Mega ST
         01 = STE
         02 = TT
         03 = Falcon
         Low Word is the Machine version and is currently always zero,
         Unless Mega STE when it is 16

    _NET           Networking Software Available

         Points to a Structure containing:
                   Long:     Software ID
                   Long:     Version
         Software ID's include :
                   "A&D",0   Application Design Software
                   "PAMS"    Pams Software
                   "ITOS"    Itos Software

    _SND           Bitmap of Sound Hardware Available

         Bit 0 Set = GI/Yamaha Sound Chip (Beep chip)
         Bit 1 Set = 8 bit Stereo DMA Sound
         Bit 2 Set = 16 bit CODEC
         Bit 3 Set = DSP chip
         Bit 4 Set = Connection Matrix

    _SWI           Configuration Switches

         Only on STE, TT and Falcon - reflects internal switch settings
         Meaning unknown
         Falcon is $BF

    _VDO           Video Shifter Revision Number

         High Word is Major Part Number and is the part to check.
         00 = ST
         01 = STE
         02 = TT
         03 = Falcon
         Low Word is Minor Part Number and is currently always zero.

    FSMC           SpeedoGDOS installed (or other Font Scaling Software)

         Contains pointer to structure:
                   Long:     Software ID         currently "_SPD"
                   Word:     Version No.         Major/Minor
                   Word:     Quality Setting

    MiNT           MiNT active (Note little i)

         High Word not used
         Low Word is Version No. (as Major/Minor)

    PMMU           Program has claimed  SOLE  access  to  Memory Management
    Unit

         Used by virtual memory managers - no known value
         Tells MiNT not to use Memory Protection.

    SAM,0          System Audio Manager is installed

         Contains pointer to structure.
