(0,0)
\ Visible screen area
\_______________________ /
| | /
| ____________|____________/
| | Y |
| | | |
| | |______ |
|-------X--------| /\ | |
| | |__\/__| |
| | |
| | |
Figure 4-1: (Defining Sprite On-screen Position)
The amount of viewable area is also affected by the size of the playfield display window
(defined by the values in DDFSTRT, DDFSTOP, DIWSTRT, DIWSTOP, etc.). See the
"Playfield Hardware" chapter for more information about overscan and display windows.
HORIZONTAL POSITION
A sprite's horizontal position (X value) can be at any pixel on the screen from 0 to 447. To
be visible, however, an object must be within the boundaries of the playfield display
window. In the examples in this chapter, a window with horizontal positions from pixel 64
to pixel 383 is used (that is, each line is 320 pixels long). Larger or smaller windows can
be defined as required, but it is recommended that you read the "Playfield Hardware"
chapter before attempting to do so. A larger area is actually scanned by the video beam
but is not usually visible on the screen.
If you specify an X value for a sprite that takes it outside the display window, then part or
all of the sprite may not appear on the screen. This is sometimes desirable; such a sprite
is said to be "clipped. "
To make a sprite appear in its correct on-screen horizontal position in the display window,
simply add its left offset to the desired X value. In the example given above, this would
involve adding 64 to the X value. For example, to make the upper leftmost pixel of a
sprite appear at a position 94 pixels from the left edge of the screen, you would perform
this calculation:
Desired X position + horizontal-offset of display window = 94 + 64 = 158
- Sprite Hardware 95 -