The Cookie Jar
===========#==#=======#===============================================#=====
----------------------|The Cookie Jar |-----
===========#==#=======#===============================================#=====
The cookie jar is a table in RAM listing what hardware and software is
present. It is the supported way to find out what machine you are on,
rather than probing registers or reading TOS version numbers.
The pointer to it is the system variable _p_cookie at $000005A0,
documented on the System variables and low RAM page. A null pointer
means no cookie jar exists, which is the case before TOS 1.06.
Structure: an array of longword PAIRS.
long tag four ASCII characters, e.g. '_MCH'
long value meaning depends on the tag
The list ends with an entry whose TAG is zero. In that final entry the
VALUE is the total number of slots allocated, not the number in use, so
a program installing a cookie can tell whether there is room.
Tags beginning with an underscore are reserved for Atari. Everything
else is fair game, though in practice most well known ones are taken.
===========#==#=======#===============================================#=====
----------------------|_CPU Processor type |-----
===========#==#=======#===============================================#=====
Value is the processor number in DECIMAL in the lowest byte:
0 = 68000
10 = 68010
20 = 68020
30 = 68030
40 = 68040
60 = 68060
So a Falcon reads 30, a CT60 reads 60.
===========#==#=======#===============================================#=====
----------------------|_VDO Video hardware |-----
===========#==#=======#===============================================#=====
Value in the high word:
$0000 ST shifter
$0001 STE shifter
$0002 TT shifter
$0003 Falcon VIDEL
$FFFF no ST compatible video hardware
The low word is a subtype, normally zero.
This describes the VIDEO hardware, which is not always the same as the
machine. Check _VDO when you care what the display can do, and _MCH
when you care what machine you are on.
Values confirmed against EmuTOS include/cookie.h (VDO_ST, VDO_STE,
VDO_TT, VDO_FALCON, VDO_NOHARD).
===========#==#=======#===============================================#=====
----------------------|_MCH Machine type |-----
===========#==#=======#===============================================#=====
Value, high word is the machine, low word the variant:
$00000000 ST or Mega ST
$00010000 STE
$00010010 Mega STE
$00020000 TT
$00030000 Falcon
$00040000 Milan
$00050000 ARAnyM
$FFFFFFFF no ST compatible hardware
Note the Mega STE is a VARIANT of the STE, $00010010, not a machine of
its own. Testing only the high word will report it as a plain STE. The
ST Book is another STE variant, $00010001.
Values confirmed against EmuTOS include/cookie.h (MCH_ST, MCH_STE,
MCH_MSTE, MCH_TT, MCH_FALCON, MCH_MILAN_C, MCH_ARANYM, MCH_NOHARD).
The Milan and ARAnyM values are additions not present in the older
Atari documentation.
===========#==#=======#===============================================#=====
----------------------|_SND Sound hardware |-----
===========#==#=======#===============================================#=====
Value is a bitmap. A set bit means that hardware is present:
Bit 5 $20 XBIOS sound functions available
Bit 4 $10 Connection matrix (the Falcon crossbar)
Bit 3 $08 DSP56001
Bit 2 $04 16 bit CODEC
Bit 1 $02 8 bit DMA stereo
Bit 0 $01 YM2149 PSG
So a plain ST reads $01, an STE reads $03, and a Falcon reads $1F.
Bit masks confirmed against EmuTOS include/cookie.h (SND_PSG 0x01,
SND_8BIT 0x02, SND_16BIT 0x04, SND_DSP 0x08, SND_MATRIX 0x10,
SND_XBIOS 0x20).
===========#==#=======#===============================================#=====
----------------------|_FPU Floating point unit |-----
===========#==#=======#===============================================#=====
Value describes both software and hardware FPU support.
Software FPU, bits 20-16:
Bit 20 68060 internal FPU
Bit 19 68040 internal FPU
Bits 18-17 00 none, 01 6888x present, 10 68881, 11 68882
Bit 16 SFP004 present
Hardware FPU, bits 27-24:
Bit 27 68040 internal FPU
Bits 26-25 00 none, 01 6888x present, 10 68881, 11 68882
Bit 24 SFP004 present
"6888x present" means an FPU was detected but the type could not be
determined; 68881 and 68882 mean it was identified for certain.
===========#==#=======#===============================================#=====
----------------------|_FDC Floppy controller |-----
===========#==#=======#===============================================#=====
Value, bits 25-24 give the format capability:
00 DD, normal 720K floppy interface
01 HD, 1.44MB with 3.5 inch drives
10 ED, 2.88MB with 3.5 inch drives
Bits 23-0 hold a three character controller ID:
0 no information available
'ATC' fully compatible interface, built to behave as though it
were part of the system
'DP1' DreamPark. All IDs beginning 'DP' are reserved for them.
EmuTOS defines FDC_0ATC, FDC_1ATC and FDC_2ATC as $00415443,
$01415443 and $02415443, which is 'ATC' with the density code in the
top byte, matching the layout above.
===========#==#=======#===============================================#=====
----------------------|_AKP Keyboard and language |-----
===========#==#=======#===============================================#=====
Bits 15-8 keyboard layout
Bits 7-0 language
Both use the same codes:
1 German 5 Italian
2 French 7 Swiss French
4 Spanish 8 Swiss German
anything else English
The two are separate because a machine can have, for instance, a German
keyboard with English menus.
===========#==#=======#===============================================#=====
----------------------|_IDT Date and time format |-----
===========#==#=======#===============================================#=====
Bit 12 time format: 0 = AM/PM, 1 = 24 hour
Bits 9-8 date format:
00 MMDDYY
01 DDMMYY
10 YYMMDD
11 YYDDMM
Bits 7-0 date separator, as an ASCII character, e.g. "." or "/"
===========#==#=======#===============================================#=====
----------------------|_FRB and XFRB Fast RAM buffers |-----
===========#==#=======#===============================================#=====
_FRB 64K buffer for DMA transfers to and from fast RAM.
0 means no buffer assigned; otherwise the buffer address.
This exists because TT RAM cannot be a DMA target. Anything going to
or from disk has to pass through a buffer in ST RAM, and _FRB is where
that buffer lives. See the TT RAM entry on the Exception vectors page.
XFRB Extended version, points to a structure rather than a buffer:
word version BCD, e.g. $0101
long xflock semaphore
long buffer pointer to the buffer
long size size in bytes, e.g. 64K
long next pointer to the next XFRB structure, 0 if last
===========#==#=======#===============================================#=====
----------------------|Other tags |-----
===========#==#=======#===============================================#=====
_SWI State of the configuration switches, where the machine has them
_FLK File locking extensions present (see Fopen bits 3-7)
_NET Networking software present
MiNT MiNT or MultiTOS active. Value is the kernel version in hex,
so $0104 is version 1.04
CT60 Present on a CT60 accelerator. Value is 0
NVDI NVDI graphics driver installed
XHDI XHDI hard disk interface present. See the XHDI specification
SCSI SCSI driver present
_5MS 200Hz timer replaced by a 5ms timer
__NF NatFeats, native features interface, used by emulators
_C F_ ColdFire processor (EmuTOS on ColdFire hardware)
_MCF ColdFire configuration structure
The last four are EmuTOS and emulator additions not present in the
original Atari documentation. Tag list confirmed against EmuTOS
include/cookie.h.
===========#==#=======#===============================================#=====
Sources: cookie tag values and bit masks verified against EmuTOS
include/cookie.h and bios/machine.c; machine type values cross-checked
against Hatari src/lilo.c, which carries the same ST/STE/TT/Falcon
encoding. Structure and the older tag descriptions from the Atari
F030 and CT60 Hardware Register Listing and the Atari Compendium.
===========#==#=======#===============================================#=====