Thus, 158 becomes the X value, which will be written into the data structure. NOTE The X position represents the location of the very first (leftmost) pixel in the full 16-bit- wide sprite. This is always the case, even if the leftmost pixels are specified as transparent and do not appear on the screen. If the sprite shown in Figure 4-2 were located at an X value of 158, the actual image would begin on-screen four pixels later at 162. The first four pixels in this sprite are transparent and allow the background to show through. Figure 4-2: (Position of Sprites) VERTICAL POSITION You can select any position from line 0 to line 262 for the topmost edge of the sprite.
In the examples in this chapter, an NTSC window with vertical positions from line 44 to line 243 is used. This allows the normal display height of 200 lines in non-interlaced mode. If you specify a vertical position (Y value) of less than 44 (i.e., above the top of the display window) the top edge of the sprite may not appear on screen. To make a sprite appear in its correct on-screen vertical position, add the Y value to the desired position. Using the above numbers, add 44 to the desired Y position. For example, to make the upper leftmost pixel appear 25 lines below the top edge of the screen, perform this calculation:
Desired Y position + vertical-offset of the display window = 25 + 44 = 69 Thus, 69 is the Y value you will write into the data structure. - 96 Sprite Hardware -