Japanese
HARDWARE ManualVDP1 User's ManualChapter 7 Command
BackForward
VDP1 User's Manual/Chapter 7 Commands

■7.3 Relative coordinate setting command

The relative coordinate setting command uses the coordinates specified in the drawing command as relative coordinate values, and adds the values specified in the relative coordinate command to obtain the drawing coordinates.
When the command selection bit is 1010B, it is a relative coordinate setting command.
The contents of the command table are as follows:

 bit
 15
 14
 13
 12
 11
 10
 9
 8
 7
 6
 5
 4
 3
 2
 1
 0
CMDCTRL
+00
0 JP 0 0 0 0 0 0 0 0 1 0 1 0
CMDLINK
+02
LINK specification/8H 0 0
+04
+06
+08
+0A
CMDXA
+0C
sign extension Relative coordinates (XA)
CMDYA
+0E
sign extension Relative coordinates (YA)
+10
+12
+14
+16
+18
+1A
+1C
【note】
is ignored (don't care)

The relative coordinate setting command is defined as follows.

●Relative coordinates

Set the relative coordinates in the relative coordinate register. The coordinates specified in the drawing command become the drawing coordinates by adding the relative coordinate values. Parts are drawn to the framebuffer based on drawing coordinates.

When the relative coordinates are (0,0), the part is drawn at the coordinates specified in the drawing command, with the upper left corner of the screen at (0,0). To set the approximate center of the screen to (0,0), specify the relative coordinates as (160,112).

Relative coordinates are held in the register until they are reset, so if you want to move and draw the coordinates of several parts at once, set them before the drawing command.

Coordinate comparison during clipping is processed using the value obtained by adding this relative coordinate to the drawing specified coordinates of the part.

Also, since relative coordinates are not added to clipping coordinates, the clipping area will not move.

The value of the relative coordinate register becomes undefined after the power is turned on or reset, so be sure to set it before starting drawing.


BackForward
HARDWARE ManualVDP1 User's ManualChapter 7 Command
Copyright SEGA ENTERPRISES, LTD., 1997