home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 July
/
Ahoy_Magazine_85-07_1985_Double_L.d64
/
etch
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
2KB
|
62 lines
0 poke53280,0:poke53281,1:poke646,6
1 rem before loading poke44,64:poke256*64,0:new
2 s0 = peek(46)*256+peek(45)
3 s1 = s0-210:s2 = s0-150
9 print:print:print"[147]""in addition to normal cursor movements,"
10 print"the following codes are used: f-fast"
11 print"scan; s-slow scan; d-draw; e-erase"
12 print"i-initial point of slanted line;"
13 print"l-line back to initial point; f1-"
14 print"dump screen image to printer"
15 print"f7-clear screen"
16 input "do you want to play squares";an$
17 sys s1
18 x=0:y=0:sv=0:by=8192:f=1:d=0:e=0:gosub 1000
19 if an$="y" then gosub 200
20 get m$:ifm$="" then 20
21 if m$=chr$(136) then 17
22 if m$="f" then f=5:goto 20
24 if m$="s" then f=1:goto 20
25 if m$="d" then d=not d:e=o:goto 20
26 if m$="e" then e=not e:d=0:goto20
27 if m$="i" then xi=x:yi=y:goto 20
28 if m$="l" then 100
29 if m$=chr$(133) then 1100
30 if m$="[145]" then y=y-f:if y<0 then y=0
35 if m$="" then y=y+f:if y>199 then y=199
40 if m$="" then x=x+f:if x>319 then x=319
45 if m$="[157]" then x=x-f:if x<0 then x=0
50 gosub 1000:goto 20
100 dx=x-xi : dy=y-yi
110 m=dy/dx : b=yi-m*xi
115 sp = (sgn(xi-x))*f : xf=x
120 for x=xf to xi step sp
130 y = int(m*x+b)
140 gosub 1000
150 next
160 d=0:goto 20
200 d=1:for y = 0 to 199 step 21
210 for x = 0 to 249 step 25
220 gosub 1000
230 nextx : nexty
240 x = 128 : y = 95 : gosub 1000
250 d=0 : return
1000 ch=int(x/8):ro=int(y/8):ln=yand7
1010 if d=0 then poke by,sv
1015 if e=0 then 1020
1017 z = sv and (2^bt):poke by,sv-z
1020 by=8192+ro*320+ch*8+ln:bt=7-(xand7)
1030 sv = peek(by)
1040 poke by,sv or(2^bt)
1050 return
1100 open 4,4,5:cmd4
1110 print chr$(27)chr$(51)chr$(16)
1120 poke 251,0:poke 252,32
1130 for i=0 to 7:poke 2048+i,2^i:next
1140 for l=0 to 24:print chr$(27)chr$(76)chr$(250)chr$(2);
1150 sys s2
1160 print chr$(245)chr$(10);
1170 next l
1180 print#4,chr$(27)"@":print#4,:close4
1190 end