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

■ 7.3 Relative coordinate setting command

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

 bit
 15
 14
 13
 12
 11
 Ten
 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 designation / 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 coordinates register. The coordinates specified by the drawing command are added to the relative coordinate values to become the drawing coordinates. The part is drawn in the framebuffer based on the drawing coordinates.

When the relative coordinates are (0,0), the part is drawn with the coordinates specified by the drawing command with the upper left corner of the screen as (0,0). To set the 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 the coordinates of several parts together and draw them, set them before those drawing commands.

Coordinate comparison in clipping is processed by adding this relative coordinate to the drawing specified coordinate of the part.

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

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


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