home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
64'er
/
64ER_CD.iso
/
sh3x
/
sh34c.d64
/
musterbrueter
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
11KB
|
499 lines
100 REM ************************
110 REM * MUSTERBRUETER V2.8 *
120 REM * VOM 25.12.87 *
130 REM * AUTOR: *
140 REM * I. CAMPHAUSEN *
150 REM * ASPENWEG 29 *
160 REM * 1000 BERLIN 20 *
170 REM * HARDWARE: C64 + 1541 *
180 REM ************************
190 :
200 IF ZX=0 THEN ZX=1:LOAD"MB.MC",8,1
210 :
1000 POKE 56,20000/256:POKE 55,20000 AND 255:CLR
1010 DIM HM$(9),MZ$(9)
1020 ZF=0:HF=15:RF=11:F1=0:F0=12
1030 :
1040 S1=49152+11*256:REM ADRESSEN FUER SPEICHERBEREICHE
1050 S2=S1+64
1060 SD=21519
1070 NA=S2+64
1080 AN=49152+10*256
1090 VIC=53248
1100 VRAM=49152+12*256
1105 :
1110 CALC=20000:REM STARTADRESSEN MASCHINENPGM'S
1120 COPY=20003
1130 GCL=20006
1140 FARBSET=20009
1150 EIN=20012
1160 AUS=20015
1170 DIR=20018
1180 DEVPRES=20021
1190 SA=20024
1200 SPEICHERMAN=20027
1210 SS=20030
1220 AS=20033
1230 ZEICHENNEU=20036
1240 IS=20039
1250 :
1260 :
1280 SYS 58784:REM VIC INITIALISIEREN
1290 POKE 53281,HF:POKE 53280,RF:POKE 646,ZF
1300 SYS ZEICHENNEU:PRINT CHR$(8):REM <C=> <SHIFT> VERRIEGELN
1310 PRINT "[147]"
1320 PRINT TAB(13)"[205]USTERMAKER 64"
1330 PRINT:PRINT TAB(9)"VON [201]NGMAR [195]AMPHAUSEN"
1340 FOR I=1 TO 9:READ HM$(I):NEXT I
1350 DATA"[193]USGANGSSTELLUNG EDITIEREN","AKTIVE [206]ACHBARSCHAFT EDITIEREN"
1360 DATA"N;CHSTES [194]ILD BERECHNEN","[194]ILDERSERIE BERECHNEN","[199]RAFIK LADEN"
1370 DATA"[199]RAFIK SAVEN","[218]WISCHENSPEICHER BENUTZEN"
1380 DATA"[199]RAFIK ZEIGEN","[198]ARBEN ;NDERN"
1390 FOR I=1 TO 9:READ MZ$(I):NEXT I
1400 DATA"[211]PEICHER L:SCHEN"
1410 DATA"[199]RAFIK > [211]PEICHER"
1420 DATA"[211]PEICHER > [199]RAFIK"
1430 DATA"[199]RAFIK [207][210] [211]PEICHER"
1440 DATA"[199]RAFIK [193][206][196] [211]PEICHER"
1450 DATA"[199]RAFIK [216][207][210] [211]PEICHER"
1460 DATA"[199]RAFIK INVERTIEREN"
1470 DATA"[211]PEICHER INVERTIEREN"
1480 DATA"[199]RAFIK ZEIGEN"
1490 :
1500 FOR I=AN TO AN+64:POKE I,0:NEXT I
1510 FOR I=0 TO 63:POKE S1+I,0:POKE S2+I,PEEK(SD+I):NEXT I
1520 :
1530 US$=CHR$(183):FOR I=1 TO 5:US$=US$+US$:NEXT I
1540 :
1550 :
1560 REM **********
1570 REM HAUPTMENUE
1580 REM **********
1590 :
1600 T$="[200]AUPTMENUE":PRINT"[147]":GOSUB 5300:PRINT
1610 FOR I=1 TO 9
1620 PRINT TAB(2)I"[157])";SPC(2);HM$(I):PRINT
1630 NEXT I
1635 POKE 198,0
1640 GET A$:IF A$="" THEN GOTO 1640
1650 IF (A$<"1") OR (A$>"9") THEN GOTO 1640
1660 A=VAL(A$):T$=HM$(A)
1670 ON A GOSUB 1700,3300,4100,4190,4420,4560,4700,4900,5000
1680 GOTO 1600
1700 :
1710 REM **************************
1720 REM AUSGANGSSTELLUNG EDITIEREN
1730 REM **************************
1740 :
1750 PRINT"[147]":GOSUB 5300
1760 SYS SS:PRINT"";:REM STELLUNG ANZEIGEN
1770 PRINT:PRINT:PRINT:PRINT
1780 PRINT TAB(25)" _ - ZUR@CK":PRINT:PRINT
1790 PRINT TAB(25)" [204] - LADEN"
1800 PRINT TAB(25)" [211] - SAVEN":PRINT
1810 PRINT TAB(25)"[211][208][195] - TOGGLE"
1820 PRINT TAB(25)"[195][204][210] - L:SCHEN"
1830 PRINT TAB(25)"[201] - INVERT.":PRINT
1840 PRINT TAB(25)" [195][210][211][210] [213][208]"
1850 PRINT TAB(25)" ^"
1860 PRINT TAB(25)"[204][197][198][212] _ > [210][201][199][200][212]"
1870 PRINT TAB(25)" <"
1880 PRINT TAB(25)" [195][210][211][210] [196][207][215][206]":PRINT:PRINT
1890 PRINT TAB(25)"[210][197][212][213][210][206] - [197]NDE"
1900 :
1910 POKE VIC,112:POKE VIC+1,140:REM X/Y-STARTPOSTION DES FADENKREUZ-CURSORS
1920 POKE VIC+39,1:REM SPRITEFARBE
1930 POKE VRAM+1016,45:REM BLOCKPOINTER
1940 POKE VIC+21,1:REM SPRITE AN
1950 :
1960 GET A$:IF A$="" THEN GOTO 1960
1970 IF A$="_"THEN POKE VIC+21,0:GOTO 3240
1980 IF A$="[157]" THEN GOTO 2100
1990 IF A$="" THEN GOTO 2180
2000 IF A$="[145]" THEN GOTO 2240
2010 IF A$="" THEN GOTO 2300
2020 IF A$="[147]" THEN GOTO 2360
2030 IF A$=" " THEN GOTO 2400
2040 IF A$="I" THEN GOTO 2500
2050 IF A$="L" THEN GOTO 2670
2060 IF A$="S" THEN GOTO 2540
2070 IF A$=CHR$(13) THEN GOTO 2800
2080 GOTO 1960
2090 :
2100 REM LEFT
2110 :
2120 X=PEEK(VIC):IF X=16 THEN 2140
2130 X=X-8:POKE VIC,X
2140 GOTO 1960
2150 :
2160 REM RIGHT
2170 :
2180 X=PEEK(VIC):IF X=200 THEN GOTO 2200
2190 X=X+8:POKE VIC,X
2200 GOTO 1960
2210 :
2220 REM UP
2230 :
2240 Y=PEEK(VIC+1):IF Y=68 THEN GOTO 2260
2250 Y=Y-8:POKE VIC+1,Y
2260 GOTO 1960
2270 :
2280 REM DOWN
2290 :
2300 Y=PEEK(VIC+1):IF Y=228 THEN GOTO 2320
2310 Y=Y+8:POKE VIC+1,Y
2320 GOTO 1960
2330 :
2340 REM CLEAR
2350 :
2360 FOR I=S1 TO S1+63:POKE I,0:NEXT I:PRINT"":PRINT:PRINT:SYS SS
2370 GOTO 1960
2380 :
2390 REM TOGGLE
2400 :
2410 X=PEEK(VIC):Y=PEEK(VIC+1)
2420 X%=(X-16)/8:Y%=(Y-68)/8
2430 A%=3*Y%+X%/8:B=2^(7-X%AND7)
2440 P=PEEK(S1+A%):IF (PANDB)=0 THEN POKE S1+A%,P OR B:GOTO 2460
2450 POKE S1+A%,P AND (255-B)
2460 PRINT"":PRINT:PRINT:SYS SS:GOTO 1960
2470 :
2480 REM INVERT
2490 :
2500 SYS IS:PRINT"":PRINT:PRINT:SYS SS:GOTO 1960
2510 :
2520 REM SAVEN
2530 :
2540 POKE VIC+21,0:N$=""
2550 PRINT"[147] [193]USGANGSSTELLUNG SAVEN"
2560 PRINT:INPUT"[198]ILENAME ";N$:IF N$="_" THEN GOTO 2630
2570 IF N$="$" THEN GOSUB 5700:GOTO 2540
2580 IF N$="" THEN GOTO 2630
2590 SYS DEVPRES:IF ST<>0 THEN GOTO 2540
2600 S=S1:E=S1+64:REM START- UND ENDADRESSE
2610 GOSUB 5390:REM BEREICH SPEICHERN
2620 GOSUB 5490:IF FE<>0 THEN GOTO 2540:REM FEHLERKANAL
2630 GOTO 1700
2640 :
2650 REM LADEN
2660 :
2670 POKE VIC+21,0:N$=""
2680 PRINT"[147] [193]USGANGSSTELLUNG LADEN"
2690 PRINT:INPUT"[198]ILENAME ";N$:IF N$="_"THEN GOTO 2760
2700 IF N$="$" THEN GOSUB 5700:GOTO 2670
2710 IF N$=""THEN GOTO 2760
2720 SYS DEVPRES:IF ST<>0 THEN GOTO 2670
2730 S=S1
2740 GOSUB 5600:REM LADEN
2750 GOSUB 5490:IF FE<>0 THEN GOTO 2670:REM FEHLERK.
2760 GOTO 1700
2770 :
2780 REM AUSGANGSSTELLUNG FERTIG, POSITIONIEREN IN DER HIRESGRAFIK
2790 :
2800 POKE VIC+21,0:PRINT"[147]"
2810 POKE VIC,168:POKE VIC+1,138:POKE VIC+16,0
2820 POKE VIC+39,0:POKE VRAM+1016,44
2830 POKE VIC+21,1
2840 GET A$:IF A$="" THEN GOTO 2840
2850 IF A$="[157]" THEN GOTO 2910
2860 IF A$="" THEN GOTO 2950
2870 IF A$="[145]" THEN GOTO 2990
2880 IF A$="" THEN GOTO 3020
2890 IF A$=CHR$(13) THEN GOTO 3080
2900 GOTO 2840
2905 :
2910 X=PEEK(VIC)+256*(PEEK(VIC+16) AND 1):IF X=24 THEN GOTO 2930
2920 X=X-8:POKE VIC,X AND 255:POKE VIC+16,X/256
2930 GOTO 2840
2940 :
2950 X=PEEK(VIC)+256*(PEEK(VIC+16) AND 1):IF X=320 THEN GOTO 2970
2960 X=X+8:POKE VIC,X AND 255:POKE VIC+16,X/256
2970 GOTO 2840
2980 :
2990 Y=PEEK(VIC+1):IF Y=50 THEN GOTO 3010
3000 Y=Y-8:POKE VIC+1,Y
3010 GOTO 2840
3015 :
3020 Y=PEEK(VIC+1):IF Y=226 THEN GOTO 3040
3030 Y=Y+8:POKE VIC+1,Y
3040 GOTO 2840
3050 :
3060 REM SPRITE IN BITMAP KOPIEREN
3070 :
3080 X=PEEK(VIC)+256*(PEEK(VIC+16) AND 1):Y=PEEK(VIC+1)
3090 X%=(X-24)/8:Y%=(Y-50)/8
3100 AD=57344+8*X%+320*Y%:SYS GCL
3110 FOR I=0 TO 7
3120 POKE AD+I,PEEK(S1+3*I)
3130 POKE AD+8+I,PEEK(S1+1+3*I)
3140 POKE AD+16+I,PEEK(S1+2+3*I)
3150 POKE AD+320+I,PEEK(S1+24+3*I)
3160 POKE AD+328+I,PEEK(S1+25+3*I)
3170 POKE AD+336+I,PEEK(S1+26+3*I)
3180 NEXT I
3185 FOR I=0 TO 4
3190 POKE AD+640+I,PEEK(S1+48+3*I)
3200 POKE AD+648+I,PEEK(S1+49+3*I)
3210 POKE AD+656+I,PEEK(S1+50+3*I)
3220 NEXT I
3230 POKE VIC+21,0:SYS COPY
3240 RETURN
3250 :
3260 REM ******************************
3270 REM AKTIVE NACHBARSCHAFT EDITIEREN
3280 REM ******************************
3290 :
3300 PRINT"[147]":GOSUB 5300
3310 PRINT:PRINT:PRINT:PRINT:SYS AS
3320 PRINT"":PRINT:PRINT:PRINT:PRINT
3330 PRINT TAB(21)" _ - [200]AUPTMEN@":PRINT:PRINT
3340 PRINT TAB(21)"[211][208][195] - TOGGLE"
3350 PRINT TAB(21)"[195][204][210] - L:SCHEN"
3360 PRINT TAB(21)" [201] - INVERTIEREN":PRINT
3370 PRINT TAB(21)" [213][208]"
3380 PRINT TAB(21)" ^"
3390 PRINT TAB(21)"[204][197][198][212] _ > [210][201][199][200][212]"
3400 PRINT TAB(21)" <"
3410 PRINT TAB(21)" [196][207][215][206]":PRINT:PRINT
3420 PRINT TAB(21)"[210][197][212][213][210][206] - [197]NDE"
3430 :
3440 POKE VIC,96:POKE VIC+1,123:POKE VIC+16,0
3450 POKE VIC+39,1:POKE VRAM+1016,45
3460 POKE VIC+21,1
3470 :
3480 GET A$:IF A$="" THEN GOTO 3480
3490 IF A$="[157]" THEN GOTO 3600
3500 IF A$="" THEN GOTO 3670
3510 IF A$="[145]" THEN GOTO 3730
3520 IF A$="" THEN GOTO 3790
3530 IF A$="[147]" THEN GOTO 3850
3540 IF A$=" " THEN GOTO 3900
3550 IF A$="I" THEN GOTO 3980
3560 IF A$="_" THEN GOTO 4030
3570 IF A$=CHR$(13) THEN GOTO 4030
3580 :
3590 REM LEFT
3600 :
3610 X=PEEK(VIC):IF X=72 THEN GOTO 3630
3620 X=X-8:POKE VIC,X
3630 GOTO 3480
3640 :
3650 REM RIGHT
3660 :
3670 X=PEEK(VIC):IF X=120 THEN 3690
3680 X=X+8:POKE VIC,X
3690 GOTO 3480
3700 :
3710 REM UP
3720 :
3730 Y=PEEK(VIC+1):IF Y=99 THEN 3750
3740 Y=Y-8:POKE VIC+1,Y
3750 GOTO 3480
3760 :
3770 REM DOWN
3780 :
3790 Y=PEEK(VIC+1):IF Y=147 THEN 3810
3800 Y=Y+8:POKE VIC+1,Y
3810 GOTO 3480
3820 :
3830 REM CLEAR
3840 :
3850 FOR I=0 TO 64:POKE AN+I,0:NEXT I
3860 PRINT"":PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:SYS AS
3865 GOTO 3480
3870 :
3880 REM TOGGLE
3890 :
3900 X=PEEK(VIC):Y=PEEK(VIC+1)
3910 X%=(X-72)/8:Y%=(Y-99)/8
3920 AD=AN+8*Y%+X%:P=PEEK(AD)
3925 IF P<>0 THEN POKE AD,0:GOTO 3940
3930 POKE AD,1
3940 PRINT"":PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:SYS AS
3945 GOTO 3480
3950 :
3960 REM INVERT
3970 :
3980 FOR I=0 TO 63:POKE AN+I,-(PEEK(AN+I)=0):NEXT I
3990 PRINT"":PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:SYS AS
3995 GOTO 3480
4000 :
4010 REM FERTIG
4020 :
4030 POKE VIC+21,0
4040 RETURN
4050 :
4060 REM ************************
4070 REM NAECHSTES BILD BERECHNEN
4080 REM ************************
4090 :
4100 SYS GCL:POKE 780,F1*16+F0:SYS FARBSET:SYS EIN
4105 SYS CALC
4110 POKE 198,0:WAIT 198,1
4120 SYS AUS
4130 RETURN
4140 :
4150 REM *********************
4160 REM BILDERSERIE BERECHNEN
4170 REM *********************
4180 :
4190 PRINT"[147]":GOSUB 5300:PRINT:NA$="":MB$="":S$=""
4200 INPUT"MAXIMALE [194]ILDERZAHL ";MB$:IF MB$="_" THEN GOTO 4360
4210 MB=VAL(MB$):IF (INT(MB)<>MB) OR (MB<1) THEN GOTO 4200
4220 PRINT:PRINT:PRINT"[213]NTER WELCHEM [206]AMEN SOLL DIE [194]ILDERSERIE";
4230 INPUT"ABGESPEICHERT WERDEN ";NA$:IF NA$="_" THEN GOTO 4360
4240 IF NA$="" THEN GOTO 4220
4250 :
4260 Z=1:NR=1
4270 SYS GCL:POKE 780,F1*16+F0:SYS FARBSET:SYS EIN:SYS CALC
4280 N$=NA$+"."+STR$(NR)
4290 SYS AUS:PRINT"[147]":GOSUB 5300:PRINT
4300 SYS DEVPRES:IF ST<>0 THEN GOTO 4290
4310 S=40960:E=S+8192:SF=1
4320 GOSUB 5390:SYS SA:REM BEREICH SPEICHERN
4330 GOSUB 5490:IF FE<>0 THEN GOTO 4190:REM FEHLERKANAL
4340 NR=NR+1:Z=Z+1
4350 IF Z<=MB THEN GOTO 4270
4360 RETURN
4370 :
4380 REM ************
4390 REM GRAFIK LADEN
4400 REM ************
4410 :
4420 PRINT"[147]":GOSUB 5300:N$=""
4430 INPUT"[198]ILENAME ";N$:IF N$="_" THEN GOTO 4505
4440 IF N$="" THEN GOTO 4505
4450 IF N$="$" THEN GOSUB 5720:GOTO 4420
4460 SYS DEVPRES:IF ST<>0 THEN GOTO 4420
4470 S=57344
4480 GOSUB 5600:REM LADEN
4490 GOSUB 5490:IF FE<>0 THEN GOTO 4420:REM FEHLERK.
4500 SYS COPY
4505 RETURN
4510 :
4520 REM ************
4530 REM GRAFIK SAVEN
4540 REM ************
4550 :
4560 PRINT"[147]":GOSUB 5300:N$=""
4570 INPUT"[198]ILENAME ";N$:IF N$="_" THEN GOTO 4650
4580 IF N$="" THEN GOTO 4650
4590 IF N$="$" THEN GOSUB 5720:GOTO 4560
4610 SYS DEVPRES:IF ST<>0 THEN GOTO 4560
4620 S=40960:E=S+8192:SF=1
4630 GOSUB 5390:SYS SA:REM BEREICH SPEICHERN
4640 GOSUB 5490:IF FE<>0 THEN GOTO 4560:REM FEHLERKANAL
4650 RETURN
4660 :
4670 REM ***************************
4680 REM ARBEIT MIT ZWISCHENSPEICHER
4690 REM ***************************
4700 :
4710 PRINT"[147]":GOSUB 5300:PRINT
4720 FOR I=1 TO 9
4730 PRINT TAB(6)I"[157])";SPC(2);MZ$(I):PRINT
4740 NEXT I
4750 PRINT:PRINT TAB(7)"_ - ZUR@CK ZUM [200]AUPTMEN@"
4760 :
4770 POKE 198,0
4775 GET A$:IF A$="" THEN GOTO 4775
4780 IF A$="_" THEN 4850
4790 A=VAL(A$):IF A<1 OR A>9 THEN GOTO 4775
4800 IF A=9 THEN GOSUB 4920:GOTO 4710
4810 POKE 53280,255-PEEK(53280)
4820 POKE 781,A:SYS SPEICHERMAN:SYS COPY
4830 POKE 53280,255-PEEK(53280)
4840 GOTO 4770
4850 RETURN
4860 :
4870 REM *************
4880 REM GRAFIK ZEIGEN
4890 REM *************
4900 :
4920 POKE 780,16*F1+F0:SYS FARBSET:SYS EIN
4940 POKE 198,0:WAIT 198,1
4950 SYS AUS:PRINT"[147]"
4955 RETURN
4960 :
4970 REM **************
4980 REM FARBEN AENDERN
4990 REM **************
5000 :
5010 Z2=ZF:H2=HF:R2=RF:P2=F1:B2=F0
5020 PRINT"[147]":GOSUB 5300:PRINT
5030 PRINT TAB(7)"_ - ZUR@CK ZUM [200]AUPTMEN@":PRINT:PRINT
5040 POKE 646,Z2:PRINT TAB(7)"1) [218]EICHENFARBE":PRINT
5050 POKE 646,ZF:POKE 53281,H2:PRINT TAB(7)"2) [200]INTERGRUNDFARBE":PRINT
5060 POKE 646,P2:PRINT TAB(7)"3) [214]ORDERGRUND [200]IRES":PRINT
5070 POKE 646,B2:PRINT TAB(7)"4) [200]INTERGRUND [200]IRES":PRINT
5080 POKE 646,ZF:POKE 53280,R2:PRINT TAB(7)"5) [210]AHMENFARBE":PRINT:PRINT
5090 POKE 646,ZF:PRINT TAB(4)"[210][197][212][213][210][206] NEUE [198]ARBEN @BERNEHMEN"
5100 GET A$:IF A$="" THEN GOTO 5100
5110 IF A$="_" THEN GOTO 5230
5120 IF A$=CHR$(13) THEN GOTO 5220
5130 A=VAL(A$):IF A<1 OR A>5 THEN GOTO 5100
5140 ON A GOTO 5160,5170,5180,5190,5200
5150 :
5160 Z2=(Z2+1) AND 15:GOTO 5020
5170 H2=(H2+1) AND 15:POKE 53281,H2:GOTO 5020
5180 P2=(P2+1) AND 15:GOTO 5020
5190 B2=(B2+1) AND 15:GOTO 5020
5200 R2=(R2+1) AND 15:POKE 53280,R2:GOTO 5020
5210 :
5220 ZF=Z2:RF=R2:HF=H2:F1=P2:F0=B2
5230 POKE 646,ZF:POKE 53280,RF:POKE 53281,HF
5240 RETURN
5250 :
5260 :
5270 REM ************************
5280 REM UP UEBERSCHRIFT AUSGEBEN
5290 REM ************************
5300 :
5310 PRINT"":TA=(40-LEN(T$))/2
5320 PRINT TAB(TA) T$:PRINT TAB(TA) LEFT$(US$,LEN(T$))
5330 RETURN
5340 :
5350 REM ***************
5360 REM BEREICH ABSAVEN
5370 REM ***************
5380 :
5390 SYS (57812)N$,8
5400 POKE 194,INT(S/256):POKE 193,S-256*PEEK(194)
5410 POKE 175,INT(E/256):POKE 174,E-256*PEEK(175)
5420 IF SF=0 THEN SYS 62957
5430 SF=0
5435 RETURN
5440 :
5450 REM ********************
5460 REM FEHLERKANAL ABFRAGEN
5470 REM ********************
5480 :
5490 FE=0:OPEN 1,8,15
5500 INPUT#1,FE,FE$,F$,F$
5510 CLOSE 1
5520 PRINT:PRINT FE,FE$
5530 IF FE<>0 THEN POKE 198,0:WAIT 198,1
5540 RETURN
5550 :
5560 REM *****
5570 REM LADEN
5580 REM *****
5590 :
5600 POKE 781,8:POKE 782,0:SYS 65466
5610 FOR I=1 TO LEN(N$):POKE NA-1+I,ASC(MID$(N$,I,1)):NEXT I
5620 POKE 782,NA/256:POKE 781,NA-256*PEEK(782)
5630 POKE 780,LEN(N$):SYS 65469
5640 POKE 780,0:POKE 782,S/256:POKE 781,S-256*PEEK(782)
5650 SYS 65493
5660 RETURN
5670 :
5680 REM *********
5690 REM DIRECTORY
5700 REM *********
5710 :
5720 PRINT"":PRINT:PRINT:PRINT:PRINT
5730 SYS DEVPRES:IF ST<>0 THEN GOTO 5760
5740 SYS DIR:GOSUB5490:IF FE<>0 THEN GOTO 5760
5750 POKE 198,0:WAIT 198,1
5760 RETURN