Thursday 18 July 2013

Saturday 10 November 2012

antic thing image

ANTIC From Wikipedia, the free encyclopedia


ANTIC

From Wikipedia, the free encyclopedia
This article refers to the display chip. For the football manager, see Radomir Antić. For the magazine, see Antic (magazine).
Atari ANTIC microprocessor on an Atari 130XE motherboard
Alphanumeric Television Interface Controller[1] (ANTIC) is a LSI ASIC dedicated to generating 2D computer graphics to be shown on a televisionscreen or computer display. The chip was designed in 1977-1978 for Atari computers released in 1979 and was patented by Atari, Inc. in 1981.[2] ANTIC is also used in the Atari 5200 video game system release in 1982.
ANTIC is responsible for the generation of playfield graphics which is delivered as a datastream to the related CTIA/GTIA chip. The CTIA/GTIA provides the coloring of the playfield graphics, and is responsible for adding separately moveable, overlay graphics, that is, "sprites" also known as "Player/Missile graphics" on the Atari.
Atari advertised it as a "true microprocessor", in that it has an instruction set to run programs (called display lists) to process data. Nonetheless ANTIC has no capacity for writing back computed values to memory, it merely reads data from memory and processes it for output to the screen, therefore it does not qualify as a Turing machine in the mathematical sense of an abstracted computation device.

Contents

  [hide
  • 1 Features
  • 2 Playfield Graphics Modes
    • 2.1 Character Modes
    • 2.2 Map Modes
    • 2.3 GTIA Modes
  • 3 The Display List
    • 3.1 Display List Instruction Overview
    • 3.2 Instruction Execution
    • 3.3 Instruction Bytes
      • 3.3.1 Mode 0 Instruction - Blank Lines
      • 3.3.2 Mode 1 Instruction - Jump
      • 3.3.3 Modes 2-F Instructions - Playfield Character and Map Modes
    • 3.4 Instruction Modifiers
      • 3.4.1 DLI Modifer - Display List Interrupt
      • 3.4.2 LMS Modifer - Load Memory Scan
      • 3.4.3 VS Modifer - Vertical Scroll
      • 3.4.4 HS Modifer - Horizontal Scroll
  • 4 Scrolling
    • 4.1 Coarse Vertical Scrolling
    • 4.2 Fine Vertical Scrolling
    • 4.3 Coarse Horizontal Scrolling
    • 4.4 Fine Horizontal Scrolling
  • 5 Display List Interrupts
  • 6 Player/Missile Graphics
  • 7 Registers
    • 7.1 DMACTL $D400
    • 7.2 CHACTL $D401
  • 8 Bugs and Border Conditions
  • 9 Limitations
  • 10 Software-driven Modes
  • 11 See also
  • 12 References
  • 13 External links

Playfield Graphics Modes

While the ANTIC chip allows a variety of different playfield modes and widths, the original Atari Operating System included with the Atari 800/400 computers provides easy access to a limited subset of these graphics modes. These are exposed to users through Atari BASIC via the "GRAPHICS" command, and to some other languages, via similar system calls. Oddly, the modes not directly supported by the original OS and BASIC are modes most useful for games. The later version of the OS used in the Atari 8-bit XL/XE computers added support for most of these "missing" graphics modes.
The ANTIC chip uses a display list and other settings to create these modes. Any graphics mode in the default GTIA color interpretation can be freely mixed without CPU intervention by changing instructions in the display list.
The ANTIC screen geometry is not fixed. The hardware can be directed to display a narrow playfield (128 color clocks/256 hi-res pixels wide), the normal width playfield (160 color clocks/320 hi-res pixels wide), and a wide, overscan playfield (192 color clocks/384 hi-res pixels wide) using a register value. While the Operating System's default height for graphics modes is 192 scan lines Antic can display vertical overscan up to 240 TV scan lines tall by creating a custom display list.
The video display system was designed with careful consideration of the NTSC video timing for color output. The system CPU clock and video hardware are synchronized to one-half the NTSC clock frequency. Consequently, the pixel output of all display modes is based on the size of the NTSC color clock which is the minimum size needed to guarantee correct and consistent color regardless of the pixel location on the screen. The fundamental accuracy of the pixel color output allows horizontal fine scrolling without color "strobing" -- unsightly hue changes in pixels based on horizontal position caused when signal timing does not provide the TV/monitor hardware adequate time to reach the correct color.

[edit]Character Modes

Antic Text ModeOS modeCharacters (or Bytes) Per Mode LineTV Scan Lines per Mode LineColorsColors per Character MatrixCharacters in FontMatrix Pixel Size (Color Clocks x Scan Lines)Bits Per Matrix PixelMatrix Map (Color Clocks x Scan Lines)Matrix Map (Pixels x Pixels )Notes
2032/40/4881.511281/2 x 114 x 88 x 8High-res pixels. High bit of character displays the character data in inverse (values $80 to $FF)
3N/A32/40/48101.511281/2 x 114 x 8/108 x 8High-res pixels. Lowercase characters are displayed 2 scan lines lower allowing descenders.
412 (XL OS)32/40/488541281 x 124 x 84 x 8Two bits per pixel allowing 4 colors inside one character matrix. When the high bit of the character is set a fifth color replaces one of the other four.
513 (XL OS)32/40/4816541281 x 224 x 164 x 8Color same as above Antic Mode 4. Characters are twice as tall.
6116/20/24851641 x 118 x 88 x 8One color per character matrix. The characters in each 64 character block are shown in a different color. When the high bit of the character is set a fifth color replaces one of the other four.
7216/20/241651641 x 218 x 168 x 8Color same as above Antic Mode 6. Characters are twice as tall.

[edit]Map Modes

Antic Map ModeOS ModePixels Per Mode Line (narrow/normal/wide)TV Scan Lines per Mode LineBytes per Mode Line (narrow/normal/wide)Bits per PixelColorsColor Clocks per Pixel
8332/40/4888/10/12244
9464/80/9648/10/12122
A564/80/96416/20/24242
B6128/160/192216/20/24121
C14 (XL OS)128/160/192116/20/24121
D7128/160/192232/40/48241
E15 (XL OS)128/160/192132/40/48241
F8256/320/384132/40/4811.51/2

[edit]GTIA Modes

GTIA modes are Antic Mode F displays with an alternate color interpretation option enabled via a GTIA register. The full color expression of these GTIA modes can also be engaged in Antic text modes 2 and 3, though these will also requires a custom character set to achieve practical use of the colors.
Antic Map ModeOS ModePixels Per Mode Line (narrow/normal/wide)TV Scan Lines per Mode LineBytes per Mode Line (narrow/normal/wide)Bits Per PixelColorsColor Clocks per PixelNotes
F964/80/96132/40/48416*216 shades of the background color.
F1064/80/96132/40/48492uses all 9 playfield and player/missile color registers.
F1164/80/96132/40/48416*216 color hues all in the same luminance of the background.

[edit]The Display List

The Display List is the list of instructions, or the program, directing ANTIC how to generate the display. The Display List and the display data are written into RAM by a 6502-compatible CPU. ANTIC retrieves Display List instructions and screen memory from RAM using a technique known as direct memory access (DMA). Once the Display List instructions and screen ram are set up ANTIC automatically takes care of generating the screen display. This powerful design allows the Atari 8-bit computers to produce complex, mixed-mode displays without direct CPU intervention while other platforms, even those designed much later, cannot either mix graphics modes in one display, or do so without direct, complex CPU interrupts.
Antic processes the higher level instructions in the Display List and translates these instructions into a real-time stream of graphics data to the CTIA chip which provides the color. Together the two chips provide 6 text and 8 graphics modes (14 total). The more advanced GTIA provides three alternative color interpretations for each graphics mode providing a total of 56 (14 times four) graphics modes. However, only the Antic graphics modes based on half color clock pixels are capable of expressing the complete color palette provided by the new color interpretations, and of those modes only Antic mode F (320 horizontal pixels) is convenient for use. Thus 17 (14 + 3 additional color interpretations for mode F) recognizably different graphics modes are available.

[edit]Display List Instruction Overview

The Atari display is built as a series of ANTIC instructions each describing a line of text or graphics mode progressively from the top to the bottom of the screen until the desired display area is filled. In effect, the screen is a vertical stack of Antic mode instructions. Mixing multiple graphics modes in one display is done simply by providing different character or map mode instructions for the desired position on screen. The Atari Operating System graphics modes 1 through 8 offer full screen display, or an option for a four line text window at the bottom of the screen. This is accomplished using the inherent capabilities of ANTIC and its Display List without any CPU interrupts or custom manipulation of the video hardware.
ANTIC has four types of instructions:
  • Blank line - display horizontal blank lines (solid color using playfield color COLBK/$D01A)
  • Two jump instructions - reload ANTIC's program counter (3-byte instructions)
  • Character mode - display character data
  • Map mode - display colored pixels
Map and Character mode instructions have additional options that can be enabled:
  • Horizontal scrolling - Enables horizontal fine scrolling
  • Vertical scrolling - Enables vertical fine scrolling
  • Load Memory Scan (LMS) - Loads address of graphics/character data (3-byte instruction)
  • DLI - Display list interrupt (called "raster interrupt" or "Horizontal Blank Interrupt" on other systems)

[edit]Instruction Execution

ANTIC begins executing the display list pointed to by the 16-bit address in registers DLISTL/DLISTH ($D402-$D403hex/54274-54275dec). The address registers are updated during Display List execution by ANTIC's JMP (Jump) and JVB (Jump and wait for Vertical Blank). The address is also updated by the Operating System's Vertical Blank Interrupt (VBI) routine using the values in shadow registers SDLSTL/SDLSTH ($0230-$0231hex/560-561dec). When the OS VBI routine is enabled direct updates to the ANTIC DLIST registers by the CPU or the ANTIC Jump instructions will be overwritten by the OS during the next Vertical Blank.

[edit]Instruction Bytes

Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
DLILMSVSHSModeModeModeMode
Bits 7:4 are modifiers for Playfield Mode instructions in bits 3:0. Bit value 1 Enables the modifier, and 0 disables the modifier.
  • Bit 7 - Display List Interrupt.
  • Bit 6 - Load Memory Scan.
  • Bit 5 - Vertical Scroll.
  • Bit 4 - Horizontal Scroll.
  • Bit 3:Bit 0 - Playfield Mode Instruction. Values $0, and $1 are special instructions. Mode values $2 through $F specify Playfield Character and Map modes.

[edit]Mode 0 Instruction - Blank Lines

DLILinesLinesLinesModeModeModeMode
 ? ? ? ?0000
When Mode bits are all zero ANTIC displays one or more blank scan line(s) using the background color COLBK ($D01Ahex/53274dec) OS Shadow COLOR4 ($02C8hex/712dec). The number of blank scan lines are specified by the value of Bits 4 through Bits 6 allowing a range from 0 through 7. ANTIC adds one to this value and displays the resulting number of scan lines.
Blank lines are useful for delaying the start of the screen display until the electron beam has left the vertical overscan area at the top of the display. The Atari Operating System creates all its graphics modes beginning with three $70hex/112dec instructions (or 24 blank scan lines) for this purpose. Blank lines are also useful for partitioning parts of a custom display with different purposes (i.e a border between a status display and the main graphics.)
Instruction Values:
  • $00hex/0dec - 1 blank scan line.
  • $10hex/16dec - 2 blank scan lines.
  • $20hex/32dec - 3 blank scan lines.
  • $30hex/48dec - 4 blank scan lines.
  • $40hex/64dec - 5 blank scan lines.
  • $50hex/80dec - 6 blank scan lines.
  • $60hex/96dec - 7 blank scan lines.
  • $70hex/112dec - 8 blank scan lines.
Note that the DLI modifier is available. When enabled the Display List Interrupt will be triggered during the last scan line of the blank line(s) instruction.

[edit]Mode 1 Instruction - Jump

DLILMSVSHSModeModeModeMode
0 ?000001
When Mode value is 1 ANTIC executes a Jump in its program (the Display List). The next two bytes in the Display List are loaded into ANTIC registers DLISTL/DLISTH ($D402-$D403hex/54274-54275dec) changing the execution point of the next instruction.
There are two kinds of Jumps:
  • $01hex/1dec JMP - Jump to address. This is used to load a new execution address when the Display List will cross over a 1K boundary.
  • $41hex/65dec JVB - Jump to address and wait for Vertical Blank. (JMP + LMS bit set) This is used to end the Display List. The address used should be the starting address of the Display List.
Note that the DLIST registers are also updated by the Operating System's Vertical Blank Interrupt (VBI) routine using the values in shadow registers SDLSTL/SDLSTH ($0230-$0231hex/560-561dec). When the OS VBI routine is enabled direct updates to the ANTIC DLIST registers by the CPU or the ANTIC Jump instructions will be overwritten by the OS during the next Vertical Blank. This implies that an ANTIC JVB (Jump and wait for Vertical Blank) instruction that specifies an invalid address (or a valid address that differs from the shadow SDLST value) has no real affect on the display.
The JVB's argument usually points to the beginning of the same Display List, but it can also point to another Display List, so that a chain of Display Lists is executed after consecutive vertical blanks. Of course, to give ANTIC control over the start of the next Display List the OS Vertical Blank interrupt must be disabled to prevent it overwriting ANTIC hardware registers with the shadow register values.

[edit]Modes 2-F Instructions - Playfield Character and Map Modes

DLILMSVSHSModeModeModeMode
 ? ? ? ? ? ? ? ?
See Playfield Graphics Modes section for mode specifications.

[edit]Instruction Modifiers

Bit7Bit6Bit5Bit4Bit3:0
DLILMSVSHS-
Bits 7:4 are modifiers for Playfield Mode instructions in bits 3:0. Bit value 1 Enables the modifier, and 0 disables the modifier.
  • Bit 7 - Display List Interrupt.
  • Bit 6 - Load Memory Scan.
  • Bit 5 - Vertical Scroll.
  • Bit 4 - Horizontal Scroll.

[edit]DLI Modifer - Display List Interrupt

Bit7: position value $80, directs ANTIC to invoke a CPU-serviced interrupt on the last scan line of the Playfield Mode.
If ANTIC register NMIEN ($D40Ehex/512dec) has Bit7 ($80) set then on the last scanline of the Mode line an interrupt routine will be triggered which is vectored through address VDSLST ($200hex/512dec)

[edit]LMS Modifer - Load Memory Scan

Bit6: position value $40, loads a new address for retrieving screen memory before retrieving screen memory for the current Playfield mode line.
The LMS option loads ANTIC's screen memory scan address with the 16-bit value in the two bytes following the instruction. The Character or Map mode specified will begin displaying bytes from that address. The LMS option must appear in the first Playfield Mode Instruction line (not Blank Line) in the Display List to initialize ANTIC to begin reading at the start of screen memory. Most of the Operating System-generated full screen modes will have only that one occurrence of the LMS modifier present in the Display List. ANTIC will automatically increment its LMS address at the end of each mode line in preparation for the next line. As long as screen memory does not cross over a 4K boundary the LMS modifier is not needed on subsequent Playfield Mode Instructions.
Full screen displays using Playfield Map Modes E or F will have a second occurrence of the LMS modifier on a Map Instruction near the middle of the screen, since the full display requires more than 4K of screen memory. (Mode F displays include high res 320 pixel lines, and the GTIA display modes.)
Combining the Map and Character Mode instructions with the LMS bit makes it possible to set the screen memory address freely within the 64K address space independently for each display line. In other words, the screen memory does not have to be completely contiguous memory scanned sequentially towards higher addresses - only that a single Mode line must be provided with adequate sequential bytes of memory to meet the requirements of that Mode, width of the display, and Scrolling feature.

[edit]VS Modifer - Vertical Scroll

Bit5: position value $20, controls vertical scrolling of the Playfield mode.

[edit]HS Modifer - Horizontal Scroll

Bit4: position value $10, controls horizontal scrolling of the playfield mode.
When scrolling is enabled ANTIC retrieves more screen memory bytes than displayed in order to show partially scrolled display bytes at the beginning and end of the line. If the display is in Narrow mode ANTIC retrieves the number of screen bytes necessary for Normal mode. If the display is in Normal mode ANTIC retrieves the number of bytes needed for Wide screen mode. In Wide screen mode ANTIC does not retrieve any additional screen bytes. Scrolling in Wide screen will cause blank data to be shifted into the scrolled area. This is not a problem, because it occurs in the overscan area which is not visible on a normal NTSC/PAL display.

[edit]Scrolling

[edit]Coarse Vertical Scrolling

[edit]Fine Vertical Scrolling

[edit]Coarse Horizontal Scrolling

[edit]Fine Horizontal Scrolling

[edit]Display List Interrupts

[edit]Player/Missile Graphics

[edit]Registers

The Atari 8-bit computers and the Atari 5200 console map the ANTIC chip to the $D4xxhex page.
Hardware registers do not return the written values back when read. This problem is solved by Operating System Shadow registers implemented in regular RAM as places to store the last value written to registers. Operating System Shadow registers are copied from RAM to the hardware registers during the vertical blank. Therefore any writes to hardware registers which has a corresponding shadow register will be overwritten by the value of the Shadow register during the next vertical blank.
Some hardware registers do not have corresponding Shadow registers. They can be safely written by an application without the value being overwritten during the vertical blank. If the application needs to know the last state of the register then it is the responsibility of the application to remember what it wrote.
Operating System Shadow registers also exist for some Read registers where reading the value directly from hardware at an unknown stage in the display cycle may return inconsistent results.
NameDescriptionRead/WriteHex AddrDec AddrShadow NameShadow Hex AddrShadow Dec Addr
DMACTLDirect Memory Access ControlW$D40054272SDMCTL$022F559
CHACTLCharacter ControlW$D40154273CHART$02F3755
DLISTLDisplay List Pointer (low byte)W$D40254274SDLSTL$0230560
DLISTHDisplay List Pointer (high byte)W$D40354275SDLSTH$0231561
HSCROLHorizontal ScrollW$D40454276
VSCROLVertical ScrollW$D40554277
PMBASEPlayer/Missile Base AddressW$D40754279
CHBASECharacter Set Base AddressW$D40954281CHBAS$02F4756
WSYNCWait for Horizontal SyncW$D40A54282

[edit]DMACTL $D400

Direct Memory Access (DMA) Control
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
--------

[edit]CHACTL $D401

Character Control
Bit 7Bit 6Bit 5Bit 4Bit 3Bit 2Bit 1Bit 0
--------

[edit]Bugs and Border Conditions

[edit]Limitations

The vertical extent of the entire display can vary between 0 and 240 scanlines - this depends on what number of lines the ANTIC is programmed to display according to the display list. The horizontal width of the screen can be programmed to be 256, 320 or 384 pixels wide (in that last mode, only 352 pixels are really visible).
Although ANTIC's program counter is 16-bit, only 10 bits are changed during normal (i.e. sequential) execution of the display list. This means the display list need a JMP (Jump) instruction to cross a 1K boundary. This is not a serious limitation, because the size of a single display list usually varies from 32 to 202 bytes, and virtually never exceeds 720 bytes. Since it can be located anywhere in the memory, there is no trouble in finding a place for it that does not cross a 1K boundary.
The Memory Scan Register, a register addressing the data stored in the screen memory, is also 16-bit, but only 12 bits are changed when ANTIC is sequentially scanning the video memory. Thus an LMS (Load Memory Scan) option added to a Mode instruction is needed where screen memory crosses a 4K boundary. ANTIC's graphic modes E and F require more than 7.5K of screen memory for a full screen display. The Display Lists for these modes require the LMS option added to a Mode instruction near the middle of the display where screen memory crosses the 4K boundary. Note that the 4K boundary cannot be crossed within the middle of a Graphics Mode line. The 4K boundary address can only be crossed between the end of one Mode line and the beginning of the next line. (In other words, the memory for the previous Mode line ends at the exact last byte of the 4K block and the next Mode line begins at the exact first byte on the other side of the 4K boundary.)
The character generator can be located anywhere in the memory, but, depending on the display mode used, it has to be aligned to a 512-byte or a 1K boundary.

[edit]Software-driven Modes

Due to the ANTIC/GTIA's flexibility, it is possible with clever programming to create a number of software-driven "pseudo-modes" beyond those directly supported in hardware. These modes use combinations of mixed display lists, scrolling, page flipping, and display list interrupts to achieve displays with alternate resolution and increased color that are not possible using the hardware alone. Some possibilities include pseudo-256-color displays, 80 character wide displays, and vertical interlace.
One difficulty with some of these modes is that the grating on PAL and NTSC televisions is very different, as is the update speed, so often the modes that display well on European systems display awfully on US systems, or vice versa. For the same reason the pseudo-modes may not display well – or display rather too well – on Atari 8-bit computer emulators. Also, modern LCD TVs used as monitors may not be able to display pseudo-modes correctly.
The display list interrupt facility can be used to display far more than the usual number of sprites on the screen, with more colours shown on screen than the available color registers in the ANTIC/GTIA. This is done by writing machine language routines to change the values of hardware registers at different vertical positions on the screen. The machine language routines modifying hardware registers allow the programmer to move the sprites around and change their colours 'on the fly'. The same technique can be employed to display far more colours than seemingly allowed in any particular graphics mode, which can be mixed and altered at will.
Because the screen memory can be accessed by two pointers and relocated anywhere in available memory, it is extremely easy to implement hardware scrolling and page flipping to enable easy game design and programming.
There are many examples of demo programs available on the internet, displaying these and other features. See also Software-driven graphics modes for the Atari 8-bit computers

[edit]See also

  • List of home computers by video hardware
  • CTIA/GTIA chips
  • Software-driven graphics modes for the Atari 8-bit computers
  • De Re Atari published by the Atari Program Exchange

[edit]References

  1. ^ "I. Theory of Operation" (PDF). Atari Home Computer Field Service Manual - 400/800. Atari, Inc.. p. 1-8.
  2. ^ US patent 4296476, Mayer, Steven T.; Miner, Jay G.; Neubauer, Douglas G.; Decuir, Joseph C., "Data processing system with programmable graphics generator", issued 1 981-10-20, assigned to Atari, Inc.