For this session I’d like to shed some light on how the Atari screen is generated learning about the Atari display list. When you first turn on the computer, it follows a brief waiting period signaled by a loading sound and then you are presented with the word READY.
The computer is performing what is known as a warm boot to complete some necessary start up sequences. If you load from DOS then the Atari disk drive will thump until the DOS environment reserves a space in memory and creates in memory a token that accepts DOS as an appended command in Basic in order to launch the DOS environment, read from the DOS disk.
The graphics on your Atari home computer are made possible by a microchip processor called ANTIC (Alpha-Numeric Television Interface Circuit). Although this chip manages a lot of the graphics functionality of your system, in this session we will cover only the Display List.
So in order to take full advantage of the very powerful graphic abilities packed into the Atari’s hardware with the Atari display list, it is necessary to get a brief overview of the display list and how the screen works behind the scenes as referenced in memory.
The Atari Display List
Depending on the appropriate chip utilized by your Atari personal computer, you will have access to a varying number of Graphic modes. For the Atari 65xe with the aid of the GTIA chip you have new additional graphics mode capabilities. For now though we will lock our focus on the current screen, which is Graphics mode zero. In Basic this is accessed in a program as GRAPHICS 0
A quick point to mention before talking about Graphics zero is understanding that every mode beyond Graphics 0 occupies a four line text window positioned on the last lines at the bottom of the screen. Graphics 0 does not have these particular mode lines. This is known commonly as a “text window”, which will be reviewed when we advanced our understanding of the other graphics modes much later.
Beyond Graphics 0, all other modes occupy a four-line text window positioned on the last lines of the screen at the bottom.
Graphics mode above zero utilize the same Graphics 0 scan lines at the bottom. Mode zero is made up of 40 lines across and 24 lines in a vertical direction.
Graphic Mode Lines
The Atari computers utilize a display list to manage their Graphics screens. Each screen conserves memory for that particular mode and generates a display list that manages that individual mode lines that make up the display. The display list vertical line (in rows) keeps track of the mode lines needed. Each line references the total pixels and colors from left to right.
A scan line’s measurement is determined by the height. the count of scan lines can vary for each mode line. Each screen mode consists of 192 scan lines, but restricts above this to prevent overflow. See the article on Atari Raster Scan to learn more. To make up the graphics for each particular mode on the Atari, the total number of scan lines (192) is divided by the count of scan lins for each mode line.
Understanding the Display List
Take a look at the total number of lines in the display list for Graphics 0 (mode zero). The top three lines represent blank scan lines generated by the hardware, which consists of 24 scan lines to make that section of the upper border. This is set in place to protect the system from overscan (common on televisions).
The values seen in the display list are derived from the formual (N-1). N determines the total of lines. So to break down the empty scan lines at the top we take the 8 blank lines, 8-1=7 so that 7*16=112. The value of 112 will create these in the background color.
Each blank line is constructed as:
0 1 blank line
16 2 blank lines
32 3 blank lines
48 4 blank lines
64 5 blank lines
80 6 blank lines
96 7 blank lines
112 8 blank lines
Look at the next value in the display below the three 112 numbers and you will see a 66. This is calculated actually as 64+2 = 66. The 2 is how a Graphics 0 mode is displayed. This result is known as a “load memory scan counter (LMS)” command. It confirms that the two lines below this are an address pointer to display memory for the screen data starting address. This will be different for each mode since they are confimed to their own memory areas.
Now to calculate the two lines below the 66, a crash course in low and high bytes is necessary. The calculation for this to to take the high byte (second value) and multiply it by 256 then add the result to the low byte (first value).
Below these are the remaining bytes (2’s) that create the blue mode lines you see trickling down the screen. At the bottom though, notice the 65. This is a command that according to the book Compute!’s first book of Atari Graphics, “performs a display list jump and waits for the vertical sync”. Just understand this marks the end of the display list.
Eventually I plan to write an article teaching you how to mix display modes to create your own graphics masterpieces with the display list.
Finally a discussion on how the display list functions, would be incomplete without a program that prints out the display lists packed into our Graphics 0 example.
10 DL=PEEK(560)+PEEK(561)*256
20 FOR X=0 TO 31:PRINT X,PEEK(DL+X):NEXT X
Pingback: Atari Graphics 1 - Atari 65XE