-
Notifications
You must be signed in to change notification settings - Fork 82
/
draw.src
49 lines (40 loc) · 988 Bytes
/
draw.src
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
.page
.subttl DRAW Command
;********************************************************
;
; draw {s} { ,p ! to p }
;
; where:
; s = optional color selection (1-4)
; p = point to plot
; to p = draw a line to the point p
;
;********************************************************
draw jsr isgrap ;make sure graphics area has been allocated
ldx #1
stx colsel ;set default color selection
jsr chrgot
cmp #totk ;check if of the form 'draw to'
beq 10$ ;yes, use defaults
jsr incolr ;get color, or set up default
jsr chrgot ;eol?
bne 10$ ;no, go on.
jmp gplot ;form is 'DRAW' : plot one point at xpos,ypos
10$ jsr chrgot
cmp #','
beq 20$ ;statement of form ',p'
cmp #totk
beq 20$ ;'to p'
rts ;ok if end of statement, anything else will crash
20$ pha
jsr chrget ;skip over comma or semicolon
ldx #xdest-vwork
jsr incord
pla
bpl 40$ ;branch if ','
jsr drawln
jmp 10$
40$ jsr dstpos
jsr gplot ;plot to the point
jmp 10$
;.end