Spanish Italian
17454 Users    

Programmer's Guide - Color and luminosity

  Download PDF version of the Article

Color and luminosity

 

5.0 PLAYFIELD

The FE register is used to create a play field of walls, clouds. barriers, etc., that are seldom moved. This low resolution register is written into to draw the left half of the TV screen only. The right half of the screen is drawn by software selection of either a duplication or a reflection (mirror image) of the left half.

The PF register is 20 bits wide, so the 20 bits are written into 3 addresses: PF0, FF1, and PF2. PF0 is only 4 bits wide and constructs the first 4 "bits" of the playfield, starting at the left edge of the TV screen. PF1 constructs the next 8 "bits". and PF2 the last 8 "bits" which end at the center of the screen. The PF register is scanned from left to right and where a "1" is found the PF color is drawn, and where a "0" is found the BK color is drawn. To clear the playfield, obviously zeroes must be written into PF0, PFD, and PF2.

To make the right half of the playfield a duplication or a copy of the left half, a "0" is written to D0 of the CTLPF (control playfield) register. Writing a "1" will cause the reflection to be displayed.

 

6.0 THE MOVEABLE OBJECTS GRAPHICS

All 5 moveable objects (P0, M0, P1, Ml, BL) can be assigned a horizontal location on the screen and moved left or right relative to that location. Vertical positions, however, are treated in an entirely different manner. In principle, these objects appear at whatever scan lines their graphics registers are enabled. For example, let us assume the ball is to be positioned vertically in the center of the screen. The screen has 192 scan lines and we want the ball to be 2 scan lines "thick". The ball graphics would be disabled until scan line 96, enable for 2 scan lines, then disabled for the rest of the frame. Each type of object (players, missiles, and the ball) has its own characteristics and limitations.

 

6.1 MISSILE GRAPHICS (M0, Ml)

The two missile graphics registers will draw a missle on any scan line by writing a "1" to the one bit enable missile registers (ENAM0, ENAM1). Writing a "0" to these registers will disable the graphics. The missiles' left edge is positioned by a horizontal position register, but the right edge is a function of how wide the missile is made. Width of a missile is controlled by writing into bits D4 and D5 of the number-size registers (NUSIZO, NUSIZ1). This has the effect of "stretching" the missiles out over 1, 2, 4, or 8 color clock counts (a full scan line is 160 color clocks).

 

6.2 BALL GRAPHICS (BL)

The ball graphics register works just like the missile registers. Writing a "1" to the enable ball register ENABL) enables the ball graphics until the register is disabled. The ball can also be "stretched" to widths of 1, 2, 4, or 8 color clock counts by writing to bits D4 and D5 of the CTRLPF register.

The ball can also be vertically delayed one scan line. For example, if the ball graphics were enabled on scan line 95, it could be delayed to not display on the screen until scan line 96 by writing a "1" to D0 of the vertical delay (VDELBL) register. The reason for having a vertical delay capability is because most programs will update the TIA every 2 lines. This confines all vertical movements of objects to 2 scan line "jumps". The use of vertical delay allows the objects to move one scan line at a time.

 

6.3 PLAYER GRAPHICS (P0, P1)

The player graphics are the most sophisticated of all the moveable objects. They have all the capabilities of the missiles and ball graphics, plus three more capabilities. Players can take on a 'shape" such as a man or an airplane, and the player can be easily flipped over horizontally to display the mirror image (reflection) instead of the original image, plus multiple copies of the players can be created.

The player graphics are drawn line-by-line like all other graphics. The difference here is each scan line of the player is 8 "bits" wide, whereas the missiles and ball are one "bit" wide. Therefore, a player can be thought of as being drawn on graph paper 8 squares wide and as tall as desired. To "color In the squares" of this imaginary graph paper, 8 data bits are written into the players graphics registers (GPO, GP1). This 8 bit register is scanned from D7 to DO, and wherever a "1" is found that "square" gets the players' color (from the color-lum register) and where a "0" is found that "square" gets the background color. To position a player vertically, simply leave all "0"s" in the graphics resisters (GPO, GPI) until the electron beam is on the scan line desired, write to the graphics register line-by-line describing the player, then write all "0's" to turn off the players' graphics until the end of that frame.

To display a mirror image (reflection) instead of the original figure write a "1" to D3 of the one bit reflection register (REFP0 REFP1). A "0" written to these registers restores the original figure.

Multiple copies of players as well as their size are controlled by writing 3 bits (DO, 131, D2) into the number-size registers (NUSIZ0, NUSIZ1). These three bits select from 1 to 3 copies of the player, spacing of those copies, as well as the size of the player (each "square" of the player can be 1, 2, or 4 clocks wide). Whenever multiple copies are selected, the TIA automatically creates the same number of copies of the missile for that player. Again, the specifics of all this are laid out in the TIA hardware manual.

Vertical delay for the players works exactly like the ball by writing a "1" to D0 in the players' vertical delay registers (VDELP0, VDELP1). Writing a "0" to these locations disables the vertical delay.

Thank you for making this

Thank you for making this article, lighthouse. I would like to ask what you are referring here, is it part of programming in a 3D game? What software are you using in creating a program?

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.

Who's new

  • fernand
  • Ligrock
  • paolo_0665
  • chanuei
  • JM
  • samsilva77
  • araghube
  • stoll
  • mt
  • orionkw

Who's online

There are currently 0 users and 44 guests online.