VDU 25

From BeebWiki
Revision as of 23:17, 29 January 2008 by Beardo (talk) (added metasyntactic variables to ELLIPSE FILL)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PLOT commands

VDU 25
Syntax VDU 25,<numeric>,<numeric>;<numeric>;
Character stream (hex) 19 <command> <Xlow> <Xhigh> <Ylow> <Yhigh>
Description Performs a vector graphics operation.
Plot Numbers
------------
b0-b1: 00 move
       01 plot in current foreground colour
       10 plot in logical inverse colour
       11 plot in current background colour
b2   : 0  relative coords
       1  absolute coords

b6-b7=00 - draw line:
b3   : 0  last point not omitted
       1  last point omitted
b4   : 0  solid line
       1  dot-dash line
b5   : 0  first point not omitted
       1  first point omitted

b6-b7<>00:
40 Plot point
48 Fill to non-background
50 Fill triangle
58 Fill to background
60 Fill rectangle
68 Fill to foreground
70 Fill parallelogram
78 Fill to non-foreground

80 Flood to non-background
88 Flood to foreground
90 Circle outline
98 Circle fill
A0 Circle arc
A8 Circle segment
B0 Circle sector
B8 Block copy/move/swap:
    b0-b1: 00 no action
           01 copy
           10 move
           11 swap (copy and move)

C0 Ellipse outline
C8 Ellipse fill
D0 Font plot
D8 Reserved
E0 Reserved
E8 Sprite plot (BBFW: block swap)
F0 User plot
F8 User plot

PLOT k,x,y                        -> VDU 25,k,x;y;

MOVE x,y                          -> PLOT 4,x,y
DRAW x,y                          -> PLOT 5,x,y

CIRCLE x,y,r                      -> MOVE x,y:PLOT 145,r,0
CIRCLE FILL x,y,r                 -> MOVE x,y:PLOT 153,r,0
DRAW BY x,y                       -> PLOT 1,x,y
ELLIPSE x,y,a,b                   -> MOVE x,y:PLOT 0,a,0:PLOT 193,0,b
ELLIPSE FILL x,y,a,b              -> MOVE x,y:PLOT 0,a,0:PLOT 201,0,b
FILL x,y                          -> PLOT 133,x,y
FILL BY x,y                       -> PLOT 129,x,y
LINE x1,y1,x2,y2                  -> MOVE x1,y1:DRAW x2,y2
MOVE BY x,y                       -> PLOT 0,x,y
PLOT x,y                          -> PLOT 69,x,y
PLOT BY x,y                       -> PLOT 65,x,y
RECTANGLE x,y,w,h                 -> MOVE x,y:PLOT 13,x+w,y:PLOT 13,x+w,y+h:PLOT 13,x,y+h:PLOT 13,x,y
RECTANGLE FILL x,y,w,h            -> MOVE x,y:PLOT 101,x+w,y+h
RECTANGLE FILL x1,y1,w,h TO x2,y2 -> MOVE x1,y1:MOVE x1+w,y1+h:PLOT 189,x2,y2
RECTANGLE SWAP x1,y1,w,h TO x2,y2 -> MOVE x1,y1:MOVE x1+w,y1+h:PLOT 191,x2,y2
RECTANGLE x1,y1,w,h TO x2,y2      -> MOVE x1,y1:MOVE x1+w,y1+h:PLOT 190,x2,y2