Difference between revisions of "STIC"

From Intellivision Wiki
Jump to: navigation, search
(Background)
 
(21 intermediate revisions by 12 users not shown)
Line 1: Line 1:
The STIC provides the video display for the Intellivision Master Component.  It is capable of displaying a background resolution of 160x96 pixels and up to 8 hardware sprites, referred to as Moveable OBjects or MOBs.<br/><br/>
+
[[Category:STIC]]
 +
The STIC (General Instruments AY-3-8900) provides the video display for the Intellivision Master Component.  It is capable of displaying a background resolution of 160x96 pixels and up to 8 hardware sprites, referred to as Moveable OBjects or MOBs.<br/><br/>
  
==Register Summary==
+
==Registers==
 
The STIC has a fair number of registers visible in the CPU's memory map.  The [[System RAM]] appears to decode addresses $00 - $7F to the STIC, although the STIC itself only responds to the range $00 - $3F.  Furthermore, that address space is not entirely populated.  The following table lists the known STIC registers:
 
The STIC has a fair number of registers visible in the CPU's memory map.  The [[System RAM]] appears to decode addresses $00 - $7F to the STIC, although the STIC itself only responds to the range $00 - $3F.  Furthermore, that address space is not entirely populated.  The following table lists the known STIC registers:
<center>
+
 
 
<table border=1>
 
<table border=1>
 
<tr><th>Address Range</th><th>Description</TH></TR>
 
<tr><th>Address Range</th><th>Description</TH></TR>
Line 20: Line 21:
 
<TR><TD>$32      </TD><TD> Border Extension Control              </TD></TR>
 
<TR><TD>$32      </TD><TD> Border Extension Control              </TD></TR>
 
<TR><TD>$33 - $3F</TD><TD> Unused/Unknown                        </TD></TR>
 
<TR><TD>$33 - $3F</TD><TD> Unused/Unknown                        </TD></TR>
</TABLE></center>
+
</TABLE>
  
 
==Display Background==
 
==Display Background==
Line 30: Line 31:
 
The program selects the STIC's Foreground/Background (FGBG) mode by writing to the STIC register at location $21 during [[VBlank Period 1]].  This sets the STIC in FGBG mode.  The STIC stays in this mode until the program accesses location $21 again.  While in this mode, the STIC interprets each value in the BACKTAB as follows:
 
The program selects the STIC's Foreground/Background (FGBG) mode by writing to the STIC register at location $21 during [[VBlank Period 1]].  This sets the STIC in FGBG mode.  The STIC stays in this mode until the program accesses location $21 again.  While in this mode, the STIC interprets each value in the BACKTAB as follows:
  
      15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
+
[[Image:Stic_fgbg_word.png|center|Word from BACKTAB in Foreground / Background Mode]]
      ?  ?  B  b  t  b  b  n  n  n  n  n  n  f  f  f<br/>
 
    where:
 
      ??        Ignored by the STIC.  Programs can use these as flag bits.
 
      bBbb      The background color (off bits), either [[Pastel Colors|pastel]] or [[Primary Colors|primary]] colors (0 - 15).
 
                Note that bit 13 of the BACKTAB word becomes bit 2 of the color number.
 
      t        Indicates where the STIC will source the image from:  0 = GROM, 1 = GRAM.
 
      nnnnnn    Actual # of the card corresponding to it's position in GRAM or GROM, (0 - 63).
 
      fff      Foreground color, primaries only (0 - 7).
 
  
 
Unlike Color Stack mode below, the Foreground/Background mode places no restrictions on where the background color changes.  With this flexibility comes a couple disadvantages:
 
Unlike Color Stack mode below, the Foreground/Background mode places no restrictions on where the background color changes.  With this flexibility comes a couple disadvantages:
Line 46: Line 39:
  
 
===Color Stack Mode===
 
===Color Stack Mode===
The program selects the STIC's Color Stack mode by reading from the STIC register at location $21 during [[VBlank Period 1]].  This sets the STIC in Color Stack mode.  The STIC stays in this mode until the program accesses location $21 again.  While in this mode, the STIC interprets each value in the BACKTAB as follows:
+
The program selects the STIC's Color Stack mode by reading from the STIC register at location $21 during [[VBlank Period 1]].  This sets the STIC in Color Stack mode.  The STIC stays in this mode until the program accesses location $21 again.  The following diagram shows the way the STIC interprets each word of BACKTAB in general while in this mode:
 +
 
 +
[[Image:Stic_color_stack_word.png|center|BACKTAB words in Color Stack Mode]]
 +
 
 +
Note that the behavior of the STIC is slightly different when cards come from [[GROM]] versus [[GRAM]].  Notably, foreground colors are restricted to the primary colors (0-7) for cards coming from GROM.  Also, two additional bits become available as flags for cards coming from GRAM.
  
      15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
+
[[Image:Stic_color_stack_grom.png|center|BACKTAB words in Color Stack Mode--card coming from GROM]]
      ?  ?  a  F  t  N  N  n  n  n  n  n  n  f  f  f<br/>
+
<br/><br/>
    where:
+
[[Image:Stic_color_stack_gram.png|center|BACKTAB words in Color Stack Mode--card coming from GRAM]]
      ??        Ignored by the STIC. Programs can use these as flag bits.
 
      a        When set, advances the color stack
 
      Ffff      Foreground color (on bits), either pastel or primary colors (0 - 15).
 
      t        Indicates where the STIC will source the image from:  0 = GROM, 1 = GRAM.
 
      NNnnnnnn  Actual # of the card corresponding to it's position in GRAM (0 - 63), or GROM (0 - 255).
 
                When 't' is 1, the STIC ignores 'NN' (bits 9 and 10).  Programs can use these bits as flags.
 
      fff      Foreground color, primaries only (0 - 7).
 
  
 
When rendering the background in color stack mode, the STIC selects the foreground color from the value stored in BACKTAB, and the background color from the current value on the top of the Color Stack.  The Color Stack registers, at locations $28 - $2B define this stack of colors.  The Color Stack is really more like a circular queue:  Initially, the STIC picks the background color from the first entry on the stack.  Whenever the STIC sees the 'Advance' bit set, it moves to the next entry on the stack prior to rendering the card.  If the STIC was already on the last entry (at location $2B), it wraps back to the first entry.
 
When rendering the background in color stack mode, the STIC selects the foreground color from the value stored in BACKTAB, and the background color from the current value on the top of the Color Stack.  The Color Stack registers, at locations $28 - $2B define this stack of colors.  The Color Stack is really more like a circular queue:  Initially, the STIC picks the background color from the first entry on the stack.  Whenever the STIC sees the 'Advance' bit set, it moves to the next entry on the stack prior to rendering the card.  If the STIC was already on the last entry (at location $2B), it wraps back to the first entry.
Line 65: Line 55:
 
Color Stack mode also supports a special display mode for individual cards, called Colored Squares mode.  Programs indicate which cards display as Colored Squares cards by setting bit 12 to '1' and bit 11 to '0'.  This also means that programs cannot display cards from GROM with a pastel foreground color, since that is what this encoding would otherwise specify.  The STIC interprets Colored Squares cards as follows:
 
Color Stack mode also supports a special display mode for individual cards, called Colored Squares mode.  Programs indicate which cards display as Colored Squares cards by setting bit 12 to '1' and bit 11 to '0'.  This also means that programs cannot display cards from GROM with a pastel foreground color, since that is what this encoding would otherwise specify.  The STIC interprets Colored Squares cards as follows:
  
 
+
[[Image:Stic_colored_squares.png|center|BACKTAB words in Colored Squares mode]]
      15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
 
      ?  ?  d  1  0  d  d  c  c  c  b  b  b  a  a  a<br />
 
    where:
 
      ??        Ignored by the STIC. Programs can use these as flag bits.
 
      ddd      Color of pixel 3
 
      ccc      Color of pixel 2
 
      bbb      Color of pixel 1
 
      aaa      Color of pixel 0<br /><br />
 
    displays as:
 
            +----+----+
 
            |aaaa|bbbb|
 
            |aaaa|bbbb|
 
            +----+----+
 
            |cccc|dddd|
 
            |cccc|dddd|
 
            +----+----+
 
  
 
Each quadrant of a Colored Square card can be one of 8 colors.  The squares have these properties:
 
Each quadrant of a Colored Square card can be one of 8 colors.  The squares have these properties:
Line 92: Line 66:
 
==Moveable Objects==
 
==Moveable Objects==
 
The STIC is capable of rendering up to 8 moveable objects, or MOBs, which may be either 8x8 or 8x16 in size.  The STIC can stretch each MOB horizontally by 2x, and can stretch each MOB vertically by 2x, 4x, or 8x.  Note that each MOB pixel is displayed by default (if no stretching is enabled) as the same width of each background pixel, but only half the height of the background pixels.  The STIC can also mirror each MOB in the horizontal direction, the vertical direction, or both.
 
The STIC is capable of rendering up to 8 moveable objects, or MOBs, which may be either 8x8 or 8x16 in size.  The STIC can stretch each MOB horizontally by 2x, and can stretch each MOB vertically by 2x, 4x, or 8x.  Note that each MOB pixel is displayed by default (if no stretching is enabled) as the same width of each background pixel, but only half the height of the background pixels.  The STIC can also mirror each MOB in the horizontal direction, the vertical direction, or both.
 
==Registers==
 

Latest revision as of 04:26, 14 August 2012

The STIC (General Instruments AY-3-8900) provides the video display for the Intellivision Master Component. It is capable of displaying a background resolution of 160x96 pixels and up to 8 hardware sprites, referred to as Moveable OBjects or MOBs.

Registers

The STIC has a fair number of registers visible in the CPU's memory map. The System RAM appears to decode addresses $00 - $7F to the STIC, although the STIC itself only responds to the range $00 - $3F. Furthermore, that address space is not entirely populated. The following table lists the known STIC registers:

Address RangeDescription
$00 - $07 MOB X Coordinate Registers
$08 - $0F MOB Y Coordinate Registers
$10 - $17 MOB Attribute Registers
$18 - $1F MOB Interaction (collision) Registers
$20 Active Display Strobe
$21 Mode Select Strobe
$22 - $27 Unused/Unknown
$28 - $2B Color Stack
$2C Border Color
$2D - $2F Unused/Unknown
$30 Horizontal Delay (Scrolling)
$31 Vertical Delay (Scrolling)
$32 Border Extension Control
$33 - $3F Unused/Unknown

Display Background

The background area is rendered by the STIC as a series of "cards", which are blocks of 8x8 pixels. The background is composed of 20 cards horizontally and 12 cards vertically for a total of 240 cards. The overall resolution of the background is 159x96. (The rightmost column does not get displayed.)

The cards to be displayed by the STIC are loaded by the program into an area of memory referred to as the BACKground TABle or BACKTAB. The BACKTAB is located within a portion of the 16-bit RAM memory space from $0200-$02EF. While drawing the display, the STIC reads each card from the BACKTAB and draws it onscreen. How the STIC interprets each card in the BACKTAB depends on whether the STIC is in Foreground/Background mode or Color Stack mode.

Foreground/Background Mode

The program selects the STIC's Foreground/Background (FGBG) mode by writing to the STIC register at location $21 during VBlank Period 1. This sets the STIC in FGBG mode. The STIC stays in this mode until the program accesses location $21 again. While in this mode, the STIC interprets each value in the BACKTAB as follows:

Word from BACKTAB in Foreground / Background Mode

Unlike Color Stack mode below, the Foreground/Background mode places no restrictions on where the background color changes. With this flexibility comes a couple disadvantages:

  • The pastel colors (8 - 15) cannot be used as foreground colors for cards in the BACKTAB.
  • For images sourced from GROM, both the BACKTAB and the MOBs are limited to GROM cards 0 through 63. (GRAM has only 64 images, and so this restriction has no effect on images sourced from GRAM.)
  • Colored Squares mode cannot be invoked from FGBG mode.

Color Stack Mode

The program selects the STIC's Color Stack mode by reading from the STIC register at location $21 during VBlank Period 1. This sets the STIC in Color Stack mode. The STIC stays in this mode until the program accesses location $21 again. The following diagram shows the way the STIC interprets each word of BACKTAB in general while in this mode:

BACKTAB words in Color Stack Mode

Note that the behavior of the STIC is slightly different when cards come from GROM versus GRAM. Notably, foreground colors are restricted to the primary colors (0-7) for cards coming from GROM. Also, two additional bits become available as flags for cards coming from GRAM.

BACKTAB words in Color Stack Mode--card coming from GROM



BACKTAB words in Color Stack Mode--card coming from GRAM

When rendering the background in color stack mode, the STIC selects the foreground color from the value stored in BACKTAB, and the background color from the current value on the top of the Color Stack. The Color Stack registers, at locations $28 - $2B define this stack of colors. The Color Stack is really more like a circular queue: Initially, the STIC picks the background color from the first entry on the stack. Whenever the STIC sees the 'Advance' bit set, it moves to the next entry on the stack prior to rendering the card. If the STIC was already on the last entry (at location $2B), it wraps back to the first entry.

In this mode, both foreground and background colors can come from the entire 16-color palette, at least for images from GRAM. This allows producing very colorful screens, but with some restriction on where the background color changes.

Color Stack mode also supports a special display mode for individual cards, called Colored Squares mode. Programs indicate which cards display as Colored Squares cards by setting bit 12 to '1' and bit 11 to '0'. This also means that programs cannot display cards from GROM with a pastel foreground color, since that is what this encoding would otherwise specify. The STIC interprets Colored Squares cards as follows:

BACKTAB words in Colored Squares mode

Each quadrant of a Colored Square card can be one of 8 colors. The squares have these properties:

  • Colors 0 through 6 display directly from the primary color set.
  • Color 7 displays the current color on the top of the color stack.
  • Colors 0 through 6 behave like "on" pixels and interact with MOBs.
  • Color 7 does not interact with MOBs.
  • The color stack never advances on a Colored Square card.

Moveable Objects

The STIC is capable of rendering up to 8 moveable objects, or MOBs, which may be either 8x8 or 8x16 in size. The STIC can stretch each MOB horizontally by 2x, and can stretch each MOB vertically by 2x, 4x, or 8x. Note that each MOB pixel is displayed by default (if no stretching is enabled) as the same width of each background pixel, but only half the height of the background pixels. The STIC can also mirror each MOB in the horizontal direction, the vertical direction, or both.