h6. [[OS SWI Calls]] h6(. » OS_Plot h2. OS_Plot h5. (SWI &45) |_<^{width:4em}. Entry | | |<^. R0 |<^. "Plot command code":#reason, | |<^. R1 |<^. X co-ordinate | |<^. R2 |<^. Y co-ordinate | |_<^{width:4em}. Exit | | |<^. R0 |<^. Corrupted | |<^. R1 |<^. Corrupted | |<^. R2 |<^. Corrupted | h4. Use The purpose of this call is to perform a direct VDU call. h4(#reason). Plot Command Codes |_<^{width:4em}. #|_<^. Description|_<^. Sequence of moves| |<^. 0|<^. Solid line including both end points|<^. "Line":#sequence | |<^. 8|<^. Solid line excluding the final end point|<^. "Line":#sequence | |<^. 16|<^. Dotted line including both end points (pattern restarted)|<^. "Line":#sequence | |<^. 24|<^. Dotted line excluding the final end point (pattern restarted)|<^. "Line":#sequence| |<^. 32|<^. Solid line excluding 1^st^ point|<^. "Line":#sequence | |<^. 40|<^. Solid line excluding both end points|<^. "Line":#sequence | |<^. 48|<^. Dotted line excluding 1^st^ point (pattern continued)|<^. "Line":#sequence | |<^. 56|<^. Dotted line excluding both end points (pattern continued)|<^. "Line":#sequence | |<^. 64|<^. Point plot|<^. | |<^. 72|<^. Horizontal line fill (left and right) to non-background|<^. | |<^. 80|<^. Triangle fill|<^. "Triangle":#sequence| |<^. 88|<^. Horizontal line fill (right only) to background|<^. | |<^. 96|<^. Rectangle fill|<^. "Rectangle":#sequence| |<^. 104|<^. Horizontal line fill (left and right) to foreground|<^. | |<^. 112|<^. Parallelogram fill|<^. "Parallelogram":#sequence| |<^. 120|<^. Horizontal line fill (right only) to non-foreground|<^. | |<^. 128|<^. Flood to non-background|<^. | |<^. 136|<^. Floor to foreground|<^. | |<^. 144|<^. Circle outline|<^. "Circle":#sequence| |<^. 152|<^. Circle fill|<^. "Circle":#sequence | |<^. 160|<^. Circular arc|<^. "Arc":#sequence| |<^. 168|<^. Segment|<^. "Segment":#sequence| |<^. 176|<^. Sector|<^. "Sector":#sequence| |<^. 184|<^. Block copy/move|<^. "Block copy/move":#sequence| |<^. 192|<^. Ellipse outline|<^. "Ellipse":#sequence| |<^. 200|<^. Ellipse fill|<^. "Ellipse":#sequence| |<^. 208|<^. Font printing (do not use)|<^. | |<^. 216|<^. Reserved|<^. | |<^. 224|<^. Reserved|<^. | |<^. 232|<^. Sprite Plot|<^. | |<^. 240|<^. Reserved|<^. | |<^. 248|<^. Reserved|<^. | h4(#sequence). Sequence of Moves Some shapes need to be defined by a sequence of points. The VDU drivers use the previous positions of the graphics cursor to define these. These can be specified by a sequence of absolute or relative moves (commands 64 or 68). |_<^{width:8em}. Shape |_<^. Sequence of moves| |<^. Arc|<^. To plot an arc move to centre, move to start, then plot arc to a point on the line joining centre to end. The arc will be plotted anticlockwise| |<^. Block copy/move|<^. First define the source rectangle: move to one corner, then move to diagonally opposite corner. Then plot bottom left corner of destination| |<^. Circle|<^. To plot a circle, move to centre, then plot circle to a point on the circumference| |<^. Ellipse|<^. To plot an ellipse, move to centre, move to point on circumference with same Y co-ordinate as centre, then plot ellipse to the lowest or highest point on the circumference| |<^. Line|<^. To plot a line, move to one endpoint, then plot line to other endpoint| |<^. Parallelogram|<^. To plot a parallelogram, move to vertex, move to next vertex, then plot parallelogram to third vertex. Fourth vertex will be opposite second| |<^. Rectangle|<^. To plot a rectangle, move to one corner, then plot rectangle to diagonally opposite corner| |<^. Sector|<^. To plot a sector, move to centre, move to start, then plot sector to a point on the line joining centre to end. The sector will be plotted anticlockwise| |<^. Segment|<^. To plot a segment, move to centre, move to start, then plot segment to a point on the line joining centre to end. The segment will be plotted anticlockwise| |<^. Triangle|<^. To plot a triangle, move to vertex, move to next vertex, then plot triangle to third vertex| h4(#modifiers). Modifiers The plot commands use the top 5 bits. The bottom 3 bits are used to specify the 'modifier'. Most plot command codes use the standard modifier codes, however, a special set of modifiers are available for block copy/move commands. |_<^{width:4em}. # |_<^. Standard modifier type | |<^. 0 |<^. Move relative | |<^. 1 |<^. Plot relative, foreground | |<^. 2 |<^. Plot relative, inverse | |<^. 3 |<^. Plot relative, background | |<^. 4 |<^. Move absolute | |<^. 5 |<^. Plot absolute, foreground | |<^. 6 |<^. Plot absolute, inverse | |<^. 7 |<^. Plot absolute, background | |_<^{width:4em}. # |_<^. Block copy/move modifier type | |<^. 0 |<^. Move relative | |<^. 1 |<^. Relative rectangle move | |<^. 2 |<^. Relative rectangle copy | |<^. 3 |<^. Relative rectangle | |<^. 4 |<^. Move absolute | |<^. 5 |<^. Absolute rectangle move | |<^. 6 |<^. Absolute rectangle copy | |<^. 7 |<^. Absolute rectangle copy | h4. Notes The action performed depends on the plot command code value in R0. Unknown plot codes (216-231,240-255) are sent to the [[UKPLOTV|unknown plot vector]], which by default does nothing. The dash pattern is set with [[VDU 23,6]] and can be read with [[OS_Word 10|OS_Word 10,6]]. Its length is set and read with [[OS_Byte 163]]. h4. See also * [[OS_Byte 163]] * [[OS_Word 10]] * [[UKPLOTV|Unknown Plot Vector]] * [[VDU 23,6]]