Rastergraf
3-8 Programming On-board Devices
3.2.11 Coordinate System
The screen coordinate system has its origin at the upper left hand corner of
the screen, with the X coordinates incrementing left to right and the Y
coordinates incrementing top to bottom. The coordinate system for a 1280
by 1024 display is shown in below.
(0,0)
(1279,0)
(0,1023)
(1279,1023)
Everything performed in X-Y space is done using 16-bit 2's complement
integers. This includes: destination X and Y coordinates, registers that are
specified in XY format, and arithmetic operations.
Rendering commands use X and Y coordinates that are specified in IEEE
Single Precision Floating Point (
ISPFP
) format and then converted to 16-
bit 2's complement integers.
In all cases, no overflows will be detected or reported. Care must be
taken for drawing operations not to exceed the 16 bit coordinate space.
The display buffer is accessed in this format by specifying the coordinate,
the source and/or destination space origin, and the buffer pitch. From this
organization it can be seen that the pitch of the display buffer can be
changed on a command by command basis.
The Z buffer can be either 16 bits in 16 bpp mode or 24 bits (packed into
the lower 3 bytes of a 4 byte DWORD) in 32 bpp mode. As with the
display buffer, the Z buffer can be accessed by specifying the Z buffer
origin, Z buffer pitch and the (x,y) coordinate of the Z buffer. The Z
values goes through an
ISPFP
setup engine and are converted to the
appropriate format (16 or 24 bits) before it is stored into the Z buffer.