Alive
News Team Current issue History Online Support Download Forum @Pouet

01 - 02 - SE - 03 - 04 - 05 - 06 - 07 - 08 - 09 - 10 - 11 - 12 - 13 - 14

Alive 6
[ Back to main ]

 3. TT Graphics subsystem
     =====================

   The TT bears a set of 6 fixed resolutions of which 5 are accessible
   with an ordinary VGA-compatible monitor while the sixth requires a
   special Atari 19" b/w monochrome monitor to be accessed.
   The set of resolutions is separated into 3 "ST-compatible" ones, 2
   "TT-resolutions" in colour and the last monochrome one.
   The registers to control the graphics subsystem are:

     Video Base Register:

       $FFFF 8201   X X X X X X X X            Adress High Byte
       $FFFF 8203   X X X X X X X X            Adress Mid Byte
       $FFFF 820D   X X X X X 0 0 0            Adress Low Byte

       The Video Base Register can only contain multiples of 8. The
       TT-Shifter can, due to ST-RAM memory logic, access 64 bits at
       once which are interleaved over the ST-RAM memory modules. Hence,
       the adress always has to be a multiple of 8 to allow this 64-bit
       access. Only the TT-Shifter can access ST-RAM in 64 bits width.
       The register works as a default adress which is being used after
       each VBL interrupt as base adress for the screen memory.

     Video Count Register:

       $FFFF 8205   X X X X X X X X            Counter High Byte
       $FFFF 8207   X X X X X X X X            Counter Mid Byte
       $FFFF 8209   X X X X X X X X            Counter Low Byte

       This register displays the adress that the Shifter is currently
       fetching its data from. It can be read AND written, at least in
       ST-compatible and TT-colour resolutions (Thanks to Ray/.tSCc.).
       It should maybe not be touched in TT-high resolution which
       features a pixel-clock of 95 MHz, which is almost 3 times the
       TT-CPU speed and 6 times the speed of the TT-bus.
       Hence, this register should be handled with care. Besides this,
       according to certain documentation, these registers are read
       only!

     Sync-Mode Register:

       $FFFF 820A  0 0 0 0 0 0 0 0 X         ST-Sync mode

       This register is mainly there for compatibility reasons,
       however, it is NOT ST-compatible. Only Bit 0 is being used. On
       the ST, setting bit 0 to 1 switched to EXTERNAL synchronisation
       of the video timing, on the TT, setting this bit to 0 switches
       the TT to external synchronisation.

    ST Palette registers:

      $FFFF 8240  0 0 0 0 r R R R g G G G b B B B    Colour 0
      $FFFF 8242  0 0 0 0 r R R R g G G G b B B B    Colour 1
        ...                  . . . . . .
        ...                  . . . . . .
        ...                  . . . . . .
      $FFFF 825E  0 0 0 0 r R R R g G G G b B B B    Colour 15

      These palette registers are STE-compatible and allow to set 16
      colours. Each entry consists of 12 bytes for the according RGB
      values. Bit 3 of each nibble for either red, green or blue,
      features the least significant value (1), while bits 0, 1 and 2
      contain the values 2, 4 and 8. This results in 16 values for
      each red, green and blue share, giving 4096 colours in total.

      However, the TT always works with a 256 colour palette. The
      palette registers from adress $FFFF8240 to $FFFF825F contain
      just a selected subset of colours - a so-called bank - of the
      256 TT-palette registers.
      This will be dealt with in detail further on.

    ST Shift mode register:

      $FFFF 8260  0 0 0 0 0 0 X X  0 0 0 0 0 0 0 0   ST Shift mode

      This register selects one of the 3 ST-compatible graphic modes
      in the following way. The 2-bit combination and the modes are:
        0  0  -  ST-Low  mode (320x200 pixels in 16 of 4096 colours)
        0  1  -  ST-Mid  mode (640x200 pixels in  4 of 4096 colours)
        1  0  -  ST-High mode (640x400 pixels in  2 of 4096 colours)
        1  1  -  reserved

      Once again, this register is not fully ST-compatible though. If
      a TT-specific mode is selected (dealt with in detail further
      on), this ST-Shift mode register ALSO contains all bits of the
      TT-Shift mode register. Therefore, handle with care.

    TT Shift mode register:

      $FFFF 8262  S 0 0 M 0 X X X  0 0 0 0 P P P P   TT Shift mode

      This register contains basically any setting the TT-Shifter
      allows. The "middle" bits, named X X X above, contain the
      desired video mode in the following order:
        0 0 0  -  ST Low  mode (320x200 pixels in 16 of 4096 colours)
        0 0 1  -  ST Mid  mode (640x200 pixels in  4 of 4096 colours)
        0 1 0  -  ST High mode (640x400 pixels in  2 of 4096 colours)
        0 1 1  -  reserved
        1 0 0  -  TT Mid  mode (640x480 pixels in 16 of 4096 colours)
        1 0 1  -  reserved
        1 1 0  -  TT High mode (1280x960 pixels monochrome)
        1 1 1  -  TT Low  mode (320x480 pixels in 256 of 4096 colours)
      The TT-High mode is not switchable and will automatically be set
      if a TT-High-compatible monitor is detected, similarly to the
      monochrome signal detection on the Atari ST to enable monochrome
      hires mode. In contrast to the ST, the ST-High mode does NOT
      require a special monitor on the TT and allows to select the 2
      colours displayed freely from the palette.
      Bit 15, named "S" above enables "Sample & Hold", nicknamed
      "smear"-mode. In this mode, the TT-Shifter will draw all pixels
      of colour "0" in the colour of the first pixel to the left with
      a different colour than "0". This means, a pixel of a certain
      colour in a line will "smear" to the right as far as there are
      pixels of colour "0" following. Intended to work as "hardware
      polygon fill" for line-vector 3D routines.
      Bit 12, named "M", enables "Hyper-mono mode", a superior
      greyscale mode in which 256 greyscales can be displayed at once.
      The 4096 colours palette is replaced by 256 greyscales. The
      nibble containing the "red" value in the palette registers are
      being ignored, the "green" and "blue" nibbles are combined to
      contain an 8-bit number of which greyscale to display.
      Finally, bit 0 to 3, named "P" above contain the number of the
      palette-"bank" from the TT-palette that is being used as
      ST-compatible palette. Values can be anything between 0 and 15.
      A value of "1" means, the colour 16 to 31 of the TT-palette are
      being used for the "ST-compatible Palette".

    TT Palette registers:

      $FFFF 8400  0 0 0 0 r R R R  g G G G b B B B   Colour 0
      $FFFF 8402  0 0 0 0 r R R R  g G G G b B B B   Colour 1
          ...                   . . .
          ...                   . . .
          ...                   . . .
      $FFFF 85FE  0 0 0 0 r R R R  g G G G b B B B   Colour 255

      Same function and structure like the STE-palette registers, just
      that there are 256 instead of 16.


  For the programmer:
  ===================
    While the TT-Shifter seems to be highly ST-compatible first, it
    must be noted that it is not. First, the three so-called
    "ST-Compatible"-resolutions work at a line-frequency of 31.5 KHz,
    and not, like in the ST, with 15. ST-Low- and ST-Mid-resolution
    even require the TT to "doubly paint" all lines, just like the
    Falcon allows to. This may be invisible to the programmer (a HBL
    interrupt is only executed after each line has been drawn twice),
    yet again it means a totally different timing within each
    rasterline than on the ST.
    Besides that, the TT delivers a VGA compatible signal, meaning a
    vertical refresh of 60 Hz in all cases, while the ST allows both
    50 and 60 Hz. Also, all coloured ST-resolutions use the TT's
    256 palette registers basically, just that only a 16-colour subset
    of it is being used at once.
    Finally, the ST-Highres-mode is also being displayed with a
    refresh of 60 Hz (in comparison to 71 Hz on the ST) and allows to
    select the 2 colours on display (which is why it's called
    Duochrome mode).
    The 2 colour TT-modes, TT-Low and TT-mid allow higher resolutions
    and more colours.
    Hardware scrolling is being done the same way as on the STE (please
    refer to the STE-FAQ for that), just that adresses on the TT have
    to be multiples of 8. This makes horizontal fine-scrolling require
    at least 8 bytes per set of bitplanes (meaning ST-Low, TT-Mid or
    TT-Low. No other mode on the TT can be used in conjunction with
    horizontal fine-scrolling).


  Compatibilities and incompatibilities
  =====================================
  => In comparison to the Atari ST and Atari STE:
     The biggest difference is the fact that the timing of the
     ST-compatible resolutions on the TT is totally different than on
     the real ST. Additionally, note that the Sync-mode register works
     different than on the ST.
     Depending on the environment your program runs in, it might be
     possible that the ST-palette registers do not resemble colour 0
     to 15 of the TT-palette, so always access the ST-palette. If your
     program is also supposed to run in a TT-compatible resolution,
     bear in mind that the shift-mode register on the TT has
     additional bits that you might not want to change.
     As a conclusion one should note that when it comes to just write
     data to the screen memory to bring it on screen, the TT works
     just as the ST-does. "Old-school effects" like Overscan,
     Sync-Scrolling etc. would not work on the TT anyway since both
     CPU- as well as Shifter-timing differs vastly from the ST.

  => In comparison to the Atari Falcon030
     The Atari Falcon030 can be programmed to emulate the
     TT-compatible resolutions, by programming the VIDEL to display
     either 320x480 or 640x480 in either 256- or 16 of 4096 colours
     (by setting the ST(E)-compatibility-bit). However, the Falcon
     does not display a border on VGA (which the TT unfortunately
     does) and can also be programmed to display 320x480 or 640x480
     pixels on RGB using a refresh of 50 Hz, while the TT is fixed to
     refresh 60 times a second in any way.
     Besides that, the Falcon is not really capable of displaying the
     TT-High resolution. The part of the TT-Shifter that displays
     TT-High is not an Atari customchip anyway but an off-the-shelf
     circuitry by National Semiconductors. The Falcon can be "forced"
     to display 1280x960 in 2 colours by certain hard- or software
     expansions though.

  => What to look for when writing ST programs:
     Mind the Sync-mode register as well as the fact that screen
     adresses have to be multiples of 8 when trying to use
     STE-features on the TT. Also mind that screen memory has to
     reside in ST-RAM in all cases for the shifter to access.

[ Back to main ]
[ Onto Next Chapter]

Alive 6