Difference between revisions of "Chapter II - The Playfield Hardware"
Line 126: | Line 126: | ||
== EXAMPLE THREE: HOW 5 BIT-PLANES SELECT A COLOR == | == EXAMPLE THREE: HOW 5 BIT-PLANES SELECT A COLOR == | ||
− | |||
= SELECTING COMBINATIONS OF BIT-PLANES = | = SELECTING COMBINATIONS OF BIT-PLANES = |
Revision as of 23:16, 18 August 2024
Contents
- 1 INTRODUCTION
- 2 PLAYFIELD HARDWARE
- 3 HOW TO SELECT THE COLOR OF PLAYFIELD ELEMENTS
- 4 SELECTING COMBINATIONS OF BIT-PLANES
- 5 HOW BIT-PLANE DATA IS STORED IN MEMORY
- 6 WHERE IS THE BIT-PLANE DATA STORED
- 7 HOW TO CONTROL THE SIZE OF THE DISPLAY
- 8 DETERMINING HOW MUCH DISPLAY MEMORY IS NEEDED
- 9 SCROLLING THE PLAYFIELDS
- 10 HOW PLAYFIELDS INTERACT WITH OTHER ELEMENTS
- 11 PLAYFIELD SELECTION COLOR CHARTS
INTRODUCTION
There are two basic parts to the display which you see on the screen:
- Things which move, called "sprites", and
- Things which don't move, called "playfields" or playfield objects.
A playfield is the backdrop against which the sprites may be displayed or with which the sprites can interact. A playfield object is simply a smaller subsection of the playfield which is considered by the software to be an object of some kind.
Even though playfield objects are classed as non-moving object, these objects can appear to move by using a technique called playfield animation. The chapter titled "THE BLITTER" shows that playfield objects can be rapidly redrawn on the screen, while saving and restoring the background onto which they are drawn, to give the illusion of motion. Much of the demonstration software which you may have already seen uses this animation technique.
This chapter concentrates on the playfield hardware itself. It shows you what defines a playfield, how its colors are specified, how it is controlled, and how other parts of the computer interact with the playfield hardware.
WHAT TOPICS ARE COVERED IN THIS CHAPTER
This chapter covers:
- How to define playfield resolution
- How to select the color of the playfield elements using one or more bit-planes
- How Hold & Modify mode increases your choice of onscreen colors available
- How to use the bit-planes as a single playfield, or how to split the static display into two independently controllable playfields.
- How to control the size of the static display.
- How to determine how much memory space is used by the display
- What part of the display memory actually appears on the screen
- How to smoothly scroll (move the playfield) in either a horizontal or vertical direction
- How the playfield display interacts with other parts of the Amiga Personal Computer
PLAYFIELD HARDWARE
There are two different operating modes for the playfield display:
- Normal Resolution Mode
- High Resolution Mode
NORMAL RESOLUTION MODE
In normal resolution mode, there are 320 picture elements or "pixels" which form each horizontal line of the screen display. This is for the resolution which is generally used for the standard home television screen. It allows clear text at 40 columns per line as well as good resolution while displaying multi-colored images.
You can define a "color palette", essentially a set of paint pots, which contains 32 out of a possible 4096 available colors. Normal resolution mode allows you to select any one of these 32 colors which you have defined for any one of the pixel elements which make up the overall picture. This allows you to create detailed multi-colored pictures on the screen.
A special operating mode, called Hold & Modify, allows you to control the color even more closely. This mode, shown later in this chapter, lets you write up to 3616 colors on the screen at the same time on a standard television set, or up to 4096 different colors on an RGB monitor.
HIGH RESOLUTION MODE
In high resolution mode, there are 640 pixels which form each horizontal line of the screen display. In this mode, each pixel can be any one of 16 colors which you have defined.
High resolution pictures are normally only produced on a high resolution monochrome or RGB monitor. (A standard television set does not have a high enough resolution to respond correctly to the high resolution signal.)
NON-INTERLACE MODE
In non-interlace mode, you have about 200 lines per screen in a vertical direction.
INTERLACE MODE
In interlace mode, you have about 400 lines per screen in the vertical direction. Note that this does NOT mean you are using more screen area in the interlace mode than in non-interlace mode. It simply means that the video scanning circuitry, on one frame (roughly once each 1/60th of a second) displays 200 lines. Then on the next display frame, it interlaces (places a line in between two existing lines) the next picture frame along with the existing one onscreen. This provides additional vertical resolution.
TEXT ON A GRAPHICS SCREEN
The normal operating mode of this system is GRAPHICS. Text is simply treated as a special form of graphics element.
On a 320 element horizontal line (normal resolution mode) you can generally expect to use 40 characters of text. In this mode, each character could be defined as a series of dots (pixels) in an 8 by 8 square matrix.
On a 640 element horizontal line (high resolution mode), you can use 80 characters of text per line. Again the same character set may be used.
Because text is simply a special case of graphics, you can easily mix multi-colored graphics and text on the same screen. You may use either the built-in character-set or your own special font. Likewise, the placement for text need not be limited to a hard-and-fast 40 or 80 positions on 25 fixed lines. A special purpose DMA channel called the blitter allows you to place any kind of graphics element anywhere on the screen.
This lets you use subscripts, superscripts, underlines, embedded special characters or graphics, proportional spacing and many other features for a what-you-see-is-what-you-get presentation to the computer user.
CONTROL REGISTERS WHICH SELECT PLAYFIELD RESOLUTION
The register named BPLCON0 contains the bits which control both the horizontal bit resolution and the interlace/non-interlace mode.
Bit 15 - HIRES
High Resolution Mode Select
When a 1, selects 640 mode.
When the power is first applied, this bit is a 0.
Bit 2 - LACE
Interlace Mode Enable
When a 1, selects interlace mode.
(400 lines vertical resolution)
When the power is first applied, this bit is a 0.
A summary of the functions of all of the bits of this register is contained in the section titled "BIT-PLANE REGISTERS", later in this chapter.