C64 Line Draw in Basic

10 print chr$(147)
15 for j=1024 to 2043 :pokej,1:next
20 b=8192 :rem hires base address
22 poke 53272,peek(53272)or8:rem bit map at 8192
25 poke 53265,peek(53265)or32:rem hires
30 for i=0 to 7999 : poke b+i,0 : next
90 rem draw lines
95 x1=160:y1=100:x2=80:y2=50: gosub 1500
96 x1=160:y1=100:x2=240:y2=50: gosub 1500
97 x1=160:y1=100:x2=240:y2=150: gosub 1500
98 x1=160:y1=100:x2=80:y2=150: gosub 1500
190 get a$: if a$="" then 190
199 poke 53272,peek(53272)and(255-8)
200 poke 53265,peek(53265)and(255-32)
210 print chr$(147)
290 end
997 rem ---------------------------
998 rem plot x,y  (hires at base b)
999 rem ---------------------------
1000 char=int(x/8)
1010 row=int(y/8)
1020 line=y and 7
1030 byte = b + row*320 + char*8 + line
1040 bit=7-(x and 7)
1050 poke byte,peek (byte) or (2^bit)
1090 return
1498 rem ---------------------------
1499 rem line x1,y1 to x2,y2
1500 rem ---------------------------
1520 dx=abs(x2-x1):sx=-1:if x1 < x2 then sx=1
1530 dy=abs(y2-y1):sy=-1:if y1 < y2 then sy=1
1540 er=-dy:if dx>dy then er=dx
1550 er=int(er/2)
1560 x=x1:y=y1:gosub 1000:rem plot x,y
1570 if x1=x2 and y1=y2 then return
1580 e2=er
1590 if e2>-dx then er=er-dy:x1=x1+sx
1600 if e2<dy then er=er+dx:y1=y1+sy
1610 goto1560
1998 rem ---------------------------