Atari Document Format The Atari Document language consists of commands and attributes that instruct the Atari on how to format and display graphics and text. Commands all start with a colon(:) and are four characters long. A command must start at the beginning of a line. Attributes all start with one of the following characters (# byte, % word,$ string) and are two characters long. Each attribute has a value. For byte or word the value is a hexadecimal number. If the attribute is a string, the string should be within quotes "". Command format :WORD #AT 0F $AT “Attribute” %AT C0F0 …. An Example ADF command: :text #mo 6 #al 1 This shows the command "TEXT" with two attributes "mo" (mode) and "al" (alignment). Note that command names and attributes are not case sensitive. Also remember all values are in hexadecimal. Some commands can only appear in the header section of a document. Other commands can only appear in the body of a document. Command List: ; Remark Comment, everything following it is ignored :HEAD Header The start of the document (required) :LOAD Load Load a file at run time :DATA Data Load data from file and store in reference #ID :CODE Display List Interrupt code Set of values to change during display list interrupt :NAME Name Set the value of an #ID :PAGE Page Start of a new page :TEXT Text Mode Begin entering data in text mode :BYTE Byte Mode Begin entering data in bitmap mode :SHOW Literal Mode Begin entering data in literal mode :VIEW Load Memory Store Set Antic LMS pointer to memory address of data in #ID :LINK Link Hypertext link to document :FILL Fill Fill from current line to margin bottom with blank lines :CALL Call DLI Call DLI routine   Command Definition: ; Remark Attributes: NONE Description Anything following this command on a line is ignored :HEAD Header Attributes: #MO, #AL, #ML, #MR, #MT, #MB, $NA, #C0, #C1, #C2, #C3, #C4, #C5, #C6, #C7, #C8, #CM, #X0, #X1, #X2, #X3, #X4, #X5, #X6, #X7, #Z0, #Z1, #Z2, #Z3, #ZM, #PR, #DM, #CH, #PM Description: The start of the document. This is the command that starts the document. All attributes set in the :HEAD command become the default values for the entire document. :LOAD Load Attributes: #ID, %SZ,%OF,$FS Description: This command is used to load a file at run-time. This is opposed to :DATA which loads files at compile time. #ID should be a number between 00-FF and is used to refer to a databank. The command reserves %SZ + %OF bytes. The address of the beginning of reserved memory+%OF is assigned to #ID. The command loads data from $FS copying %SZ bytes to the databank starting at the offset.   :DATA Data Attributes: #ID, %SZ,%OF,$FS Description: This command is used reserve data. #ID should be a number between 00-FF and is used to refer to a databank. The command reserves %SZ + %OF bytes. The address of the beginning of reserved memory+%OF is assigned to #ID. If $FS is supplied then the command loads data from $FS copying %SZ bytes to the databank starting at the offset. If $FS is not supplied then it switches to byte entry mode allowing data to be entered in hexadecimal. :CODE Display List Interrupt Attributes: #ID, #C0, #C1, #C2, #C3, #C4, #C5, #C6, #C7, #C8, #CM, #X0, #X1, #X2, #X3, #X4, #X5, #X6, #X7, #Z0, #Z1, #Z2, #Z3, #ZM, #PR, #DM, #CH, #PM Description: This command creates a DLI routine that can later be called by #ID. #WS can be used to sync changes to the start of the display line. Note attributes refer to hardware registers instead of shadow registers. :NAME Name Attributes #ID, %SZ Description: Assigns #ID the value of %SZ. Used to refer to a memory address. :PAGE Page Attributes: #MO, #AL, #ML, #MR, #MT, #MB, $NA, #C0, #C1, #C2, #C3, #C4, #C5, #C6, #C7, #C8, #CM, #X0, #X1, #X2, #X3, #X4, #X5, #X6, #X7, #Z0, #Z1, #Z2, #Z3, #ZM, #PR, #DM, #CH, #PM Description The start of a page. All attributes are set for this page only, and do not affect other pages. A page ends either at the end of the file or with another PAGE command. If a page's length exceeds #MB (Margin Bottom) than any lines past this point are ignored. TEXT: Text Mode Attributes: #MO, #AL, #SL, #ML, #MR Description: Begin entering data in text mode. The document data should be in ATASCII. The interpreter will remain in text mode until a command is encountered. Allowing multiple lines of text to be entered with one :TEXT command. #SL is used to inverse text. BYTE: Bit Map Mode Attributes: #MO, #AL, #SL, #ML, #MR Description: Begin entering data in bitmap mode. The document data should be in hexadecimal. The interpreter will remain in byte mode until a command is encountered. Allowing multiple lines of bitmap data to be entered with one :BYTE command. #SL is used to inverse data. SHOW: Literal Mode Attributes: #MO, #AL, #SL, #ML, #MR, #LN Description: Begin entering data in literal mode. Any lines entered in as code, will be inserted as data and ignored by the interpreter. You must state the number of lines (#LN) to stay in this mode. VIEW: Load Memory Scan Attributes: #MO, #ID, %OF, #LN, %SZ Description: Allows you to use data defined elsewhere to be displayed on the screen. The data should be loaded earlier in the header section and given an #ID. This #ID can then be used by the VIEW instruction to display the data on the page. Use the %OF to offset the start of data. Use %OF and %SZ to view a portion of the data. Example you can display different parts of a Mode E screen in Mode A, using %OF and %SZ. #LN is the number of lines of data to display. LINK: Hyperlink to another document Attributes: #ML, #MR, $FS, $LI, #SL Description: Allows you to create a hyperlink to another page/document. If a $LI (Link) is given, the referenced document is searched for the page name. If it is not found, the first page is displayed. The link will be associated with the last display line created. The line the link is associated with will be inverted from #ML to #MR, allowing multiple links per line. The first link on a page is selected by default, you can modify this behavior by using #SL to select the link. FILL: Fill Attributes: #MB, #MO Description: Fills screen with blank lines of #MO (mode) from the current line to margin bottom (#MB). Use #MO 0 to fill with ANTIC blank lines. CALL: Call Attributes: #ID, #LN Description: Set's the DLI bit on the previous Antic line, for #LN number of lines. Places the address of #ID in the DLI execution queue. #ID must be created using the CODE command. Attributes: Attributes all start with one of the following characters (# byte, % word, $ string) and are two characters long. Each attribute has a value. For byte or word the value is a hexadecimal number. If the attribute is a string, the string should be within quotes "". Each command may have one or more attributes. Command attributes that are not supplied inherit values from their parent scope. ADF has the following scopes: - Document - set in the :HEAD command - Page - set in the :PAGE command - Command - set in each command :HEAD will inherit values from the default values. All header commands and the :PAGE command inherit values from :HEAD. All page body commands inherit values from :PAGE. There are two broad categories of attributes: Format & Hardware. Format attributes, generally format the data as it is interpreted. Hardware attributes correspond to the physical Atari hardware.   Attributes List: Name Description Default value #MO Antic mode 02 (Basic Graphics Mode 0). #AL Content Alignment 00 (00 – Left, 01 – Center, 02 – Right) #SL Select (Inverse) 00 (00 – Normal, 01 – Selected/Inverse) #LN Number of lines 1 #ML Margin Left 0 #MR Margin Right FF #MT Margin Top 18 #MB Margin Bottom D8 $NA Name “” $FS File specification “” $LI Page Name to Link to “” #ID Reference to memory address FF %OF Offset 00 %SZ Number of bytes to load from file 00 #C0 Player 0 Color Shadow Register 0 #C1 Player 1 Color Shadow Register 0 #C2 Player 2 Color Shadow Register 0 #C3 Player 3 Color Shadow Register 0 #C4 Playfield 0 Color Shadow Register 28 #C5 Playfield 1 Color Shadow Register CA #C6 Playfield 2 Color Shadow Register 94 #C7 Playfield 3 Color Shadow Register 46 #C8 Playfield 4 (BAK) Shadow Register 0 #CM Char Mode Shadow Register (CHACT) 02 #X0 Horizontal position of player 0 00 #X1 Horizontal position of player 1 00 #X2 Horizontal position of player 2 00 #X3 Horizontal position of player 3 00 #X4 Horizontal position of missile 0 00 #X5 Horizontal position of missile 1 00 #X6 Horizontal position of missile 2 00 #X7 Horizontal position of missile 3 00 #Z0 Size of player 0 00 Size of player 0 (0 - normal 1 - double 3 - quad) #Z1 Size of player 1 00 #Z2 Size of player 2 00 #Z3 Size of player 3 00 #ZM Size of all missiles (SIZEM – 53260) 00 #PR Priority Shadow Register (GPRIOR) NULL #DM DMA Access 34 #CH Charset Shadow Register (CHBAS) FF #PM PMBASE 0 (0 – PM disabled, else #ID of databank) #WS WSYNC 0 Sets whether changes should be synced with start of display line The following table lists when commands can be executed. :HEAD must be the first command, other will be ignored. Also, :LOAD, :DATA, :NAME, :CODE, must come after :HEAD but before :PAGE. The commands, :TEXT, :BYTE, :VIEW, :SHOW, :LINK, :FILL, & :CALL, can only come after :PAGE. Command: :HEAD :DATA :PAGE :HEAD X :LOAD X :DATA X :NAME X :CODE X :PAGE X X :TEXT X :BYTE X :VIEW X :SHOW X :LINK X :FILL X :CALL X