home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C64'er
/
C64'er.iso
/
sh6x
/
sh69b.d64
/
draw.bas
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
2KB
|
73 lines
4 REM ----------------------------
5 REM ORIGINALWERTE FUER TEXTMODUS
6 REM IN ADRESSEN 251/252 RETTEN
7 REM ----------------------------
10 POKE251,PEEK(53272)
20 POKE252,PEEK(53265)
30 BA=8192:SYS58692
40 GOSUB 1000
45 IFPEEK(254)=33THEN165
119 REM -------------------------
120 REM HIRES-BILDSCHIRM LOESCHEN
121 REM -------------------------
130 FOR I=BA TO BA+7999
140 POKE I,0
150 NEXT:POKE254,33
160 SYS58692
165 GOSUB 2000: REM TEXTMODUS EIN
170 INPUT"X-KOORDINATE START(0-319)";X1
172 INPUT"Y-KOORDINATE START(0-199)";Y1
180 INPUT"X-KOORDINATE ENDE (0-319)";X2
182 INPUT"Y-KOORDINATE ENDE (0-199)";Y2
190 GOSUB 1000: REM HIRES-GRAFIK EIN
200 GOSUB 3000: REM FARBRAM WEISS
205 GOSUB355
280 POKE198,0:WAIT198,1
281 GOTO160
355 DX=X2-X1:DY=Y2-Y1
357 IFABS(DY)<ABS(DX)THEN364
358 FORYL=Y1 TO Y2 STEP SGN(DY)
359 X=DX/DY*YL+X1
360 Y=YL
361 GOSUB400
362 NEXT YL
363 RETURN
364 FOR XL=X1 TO X2 STEP SGN(DX)
365 X=XL
366 Y=DY/DX*XL+Y1
367 GOSUB 400
368 NEXT XL
369 RETURN
400 YP=INT(Y/8)
410 XP=INT(X/8)
420 A1=(YP*40+XP)*8
430 AY=Y-8*YP+A1
450 R=X-8*XP
460 M=2^(7-R)
470 I=PEEK(AY+BA)
480 POKE AY+BA,I OR M
490 RETURN
994 REM ------------------------
995 REM UNTERPROGRAMM
996 REM HIRES-GRAFIK EINSCHALTEN
997 REM ------------------------
1000 POKE53272,PEEK(53272)OR8
1010 POKE53265,PEEK(53265)OR32
1020 RETURN
1994 REM ------------------------
1995 REM UNTERPROGRAMM
1996 REM HIRES-GRAFIK ABSCHALTEN
1997 REM TEXTMODUS WIEDER AKTIVIEREN
1998 REM ------------------------
2000 POKE53272,PEEK(251)
2010 POKE53265,PEEK(252)
2020 RETURN
2995 REM ------------------------
2996 REM UNTERPROGRAMM
2997 REM HINTERGRUND WEISS UND
2998 REM PIXELFARBE SCHWARZ
2999 REM ------------------------
3000 FOR I=1024 TO 2023
3010 POKE I,1: REM 16*CODE ZEICHENFARBE + CODE HINTERGRUNDFARBE = 0*16+1
3020 NEXT: RETURN