Clipping means cutting out (clipping) so that it does not draw in areas other than the set display area. There are two types of clipping: system clipping, which sets the system drawing area, and user clipping, which can be set freely using software.
When the command selection bits (bits 3 to 0) are 1001B, it is a system clipping coordinate setting command, and when it is 1000B, it is a user clipping coordinate setting command.
The contents of the table of system clipping coordinate setting commands 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
0
1
CMDLINK
+02
LINK specification/8H
0
0
+04
+06
+08
+0A
+0C
+0E
+10
+12
CMDXC
+14
0
0
0
0
0
0
Lower right X coordinate (XC)
CMDYC
+16
0
0
0
0
0
0
0
Lower right Y coordinate (YC)
+18
+1A
+1C
【note】
is ignored (don't care)
The system clipping coordinate setting command is defined as follows.
Setting the end bit (bit 15) to 0B and the command selection bit to 1001B becomes the system clipping coordinate setting command.
Specify the jump format. When the jump format is Assign or Call, divide the address of the next command table to be processed by 8H and set it to CMDLINK.
Define the lower right coordinates of the clipping area to CMDXC and CMDYC. The upper left coordinate is fixed at (0,0). The drawing area is on and inside the rectangle (square) represented by the upper left coordinates (0,0) and the lower right coordinates (XC, YC).
●System clipping
System clipping coordinates are always valid when drawing, and the area outside the set area is clipped. In other words, the inside is drawn.
The clipping process is done rectangularly. The specification method is that the upper left coordinates are fixed at (0,0), so define the values for the lower right coordinates (XC, YC) in the command table.
Since the clipping coordinates are not checked, please set them so that XC≧0 and YC≧0 in advance. XC< 0, or YC< If set to 0, operation is not guaranteed.
Points on the clipping line are treated as inside the clipping area and drawn.
The clipping coordinate set command rewrites the internal clipping coordinate register. Subsequent parts that have been rewritten will be drawn referring to that value.
This command can be defined as many times as you want within one frame, so each group of parts can have different clipping coordinates.
The system clipping coordinates must be set before drawing starts, as their values are undefined after power is turned on or reset.
Figure 7.1 System clipping
(a) System clipping settings
The interior of the area is shown
(b) Incorrect system clipping settings
Operation is not guaranteed if XC<0 or YC<0 is set.