home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tiger Disk 123
/
Tiger_Disk_123_20xx_Tiger-Crew-Disk_de_Side_B.d64
/
grafik-routinen
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
3KB
|
112 lines
10 rem grafik routinen =============c64
20 rem written by a. mittelmeyer
30 rem ================================
130 vb=3
140 gb=8
150 vr=7
151 rem -------------------------------
155 vf=1
160 gosub180:gosub200:goto1150
180 vh=64*vb+4*vr:gh=64*vb+4*gb
190 va=256*vh:ga=256*gh:return
200 fori=828to1004
201 reada:pokei,a:next:return
202 data120,072,165,001,041,252,133,001
203 data104,096,072,165,001,009,003,133
204 data001,088,104,096,032,060,003,160
205 data000,145,251,200,208,251,230,252
206 data202,208,246,240,229,160,000,032
207 data207,255,176,222,032,060,003,145
208 data251,032,070,003,200,208,240,230
209 data252,202,208,235,240,204,160,000
210 data032,060,003,177,251,032,070,003
211 data032,210,255,200,208,242,230,252
212 data202,208,237,096,032,253,174,032
213 data235,183,138,032,060,003,160,000
214 data145,020,076,070,003,032,253,174
215 data032,138,173,032,247,183,032,060
216 data003,160,000,177,020,032,070,003
217 data168,032,162,179,032,253,174,032
218 data139,176,133,073,132,074,165,014
219 data076,194,169,032,253,174,032,235
220 data183,169,000,056,106,202,016,252
221 data160,000,076,060,003,032,199,003
222 data017,020,145,020,076,070,003,032
223 data199,003,073,255,049,020,076,222
224 data003
420 rem ---- grafik an ----
430 poke56576,peek(56576)and252or(3-vb)
440 poke53272,16*vr+gb
450 poke53265,peek(53265)or32:return
470 rem ---- grafik aus ----
480 poke56576,peek(56576)and252or3
490 poke53272,21
500 poke53265,peek(53265)and223:return
520 rem ---- farbe klaeren ----
530 poke780,16*vf+hf:poke781,4
540 poke251,0:poke252,vh:sys848:return
550 rem ---- bild loeschen ----
560 poke780,0:poke781,32
570 poke251,0:poke252,gh:sys848:return
580 rem ---- grafik laden ----
590 open8,8,8,fi$+",p,r":poke781,8
600 sys65478:geta$:geta$:poke251,0
610 iffg=0then630
620 poke252,vh:poke781,4:sys865
630 poke252,gh:poke781,32:sys865
640 sys65484:close8:return
645 rem ---- grafik saven ----
650 open8,8,8,fi$+",p,w":poke781,8
660 sys65481:printchr$(0);:poke251,0
670 iffg=0thenprint" ";:goto700
680 printchr$(28);:poke252,vh:poke781,4
690 sys890
700 poke252,gh:poke781,32:sys890:goto640
710 rem ---- speicherzugriff ----
720 rem i=sys912,a,i:rem pokea,i
730 rem sys929,a,i:rem i=peek(a)
750 rem ---- pixel setzen ----
760 sn=int(x/8):zn=int(y/8)
770 iffa=1thensys912,40*zn+sn+va,16*vf+hf
780 ad=312*zn+y+8*sn+ga
790 iflo=0thensys985,ad,xand7:return
800 sys995,ad,xand7:return
810 rem ---- linie ----
820 ifabs(y2-y1)>abs(x2-x1)then860
830 m=(y2-y1)/(x2-x1)
840 forx=x1tox2stepsgn(x2-x1)
850 y=int(y1+(x-x1)*m+.5):gosub760:next:return
860 m=(x2-x1)/(y2-y1)
870 fory=y1toy2stepsgn(y2-y1)
871 x=int(x1+(y-y1)*m+.5):gosub760:next:return
875 rem ---- rechteck ----
880 a=y2:y2=y1:gosub820:y2=a
890 a=x2:x2=x1:gosub820:x2=a
900 a=y1:y1=y2:gosub820:y1=a
910 a=x1:x1=x2:gosub820:x1=a:return
920 rem ---- kreis ----
930 xe=int(r/sqr(2)+.5)
940 forkx=0toxe:ky=int(sqr(r*r-kx*kx)+.5)
950 gosub970:kx=-kx:gosub970:ky=-ky
960 gosub970:kx=-kx:gosub970:next:return
970 x=xm+kx:y=ym+ky:gosub760
980 x=xm+ky:y=ym+kx:goto760
990 rem ---- cursor setzen ----
1000 zz=40*(yand248)+(xand504)+ga:return
1010 xm=160:ym=100:r=50:gosub930
1020 gosub1000
1030 poke56334,peek(56334)and254
1040 poke1,peek(1)and251
1050 forj=1tolen(tx$)
1060 iffa=1thensys912,(zz-ga)/8+va,16*vf+hf
1070 printchr$(19)mid$(tx$,j,1);
1080 ad=peek(1024)*8+1024*gz+53248
1090 fori=0to7:sys912,zz+i,peek(ad+i)
1100 next:zz=zz+8:next
1110 poke1,peek(1)or4
1115 poke56334,peek(56334)or1:return
1120 rem ====================
1130 rem hauptprogramm
1140 rem ====================
1150 rem hauptprogramm ab zeile 1150 erfassen.