home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 9
/
009.d81
/
spritecat
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
5KB
|
188 lines
100 rem spritecat
110 rem andy gamble sept 1984
130 cu$="[157][157][157][157][157][157][157][157][157][157][157][157][157]"
140 bl$=" "
150 cl$="[204] [205] [216] [217] [206] [196] [211] [195] [209] [197] [208] [200]elp "
160 me$="lmxyndscqhep":mm$="bc01mr":poke53272,23
170 dimsd(63):vc=53248:col=1:bc=0:m0=2:m1=5
180 fori=1to63:poke703+i,0:next
190 pokevc+32,9:pokevc+33,bc:printchr$(129)
200 poke2040,11:pokevc+39,col:pokevc+21,1:pokevc,70:pokevc+1,140
210 printchr$(147)cl$:gosub390
220 rem *** main program ***
230 gosub1900
240 fori=1tolen(me$):ifx$=mid$(me$,i,1)then270
250 ifx$=chr$(asc(mid$(me$,i,1))+128)then270
260 next:goto230
270 onigosub300,480,760,790,820,1070,1210,1340,1370,1390,1540,1790
280 goto230
290 rem *** load sprite ***
300 print"[147]"bl$"[198]ile name";
310 inputfl$
315 iffl$=""thenprint""bl$:gosub390:return
320 fori=len(fl$)to1step-1:ifmid$(fl$,i,1)=" "thenfl$=left$(fl$,i-1):next
330 open15,8,15:open1,8,4,fl$+",s,4"
340 input#15,a$,b$,c$,d$:ifval(a$)=0then380
350 print""bl$""b$": ";:gosub1920
360 gosub1900
370 goto390
380 fori=1to63:input#1,sd(i):poke703+i,sd(i):next
390 pokevc+21,1:print""tab(23)"[196]ata"
400 fori=1to63step3
410 printtab(20);
420 forj=0to1
430 printsd(i+j)",";:next
440 printsd(i+2)
450 next
460 print""cl$:close15:close1:return
470 rem *** multi-color ***
480 print"[147]"bl$"[205]ulticolor:[194] [195] 0 1 [205] [210]"
490 print""tab(15)"[194] = [194]ackground color"
500 print""tab(15)"[195] = [211]prite color"
510 print""tab(15)"0 = [205]ulitcolor #0"
520 print""tab(15)"1 = [205]ulitcolor #1"
530 print""tab(15)"[205] = [205]ulticolor on/off"
540 print""tab(15)"[210] = [210]eturn to main menu"
550 gosub1900
560 fori=1tolen(mm$)
570 ifx$=mid$(mm$,i,1)then600
580 ifx$=chr$(asc(mid$(mm$,i,1))+128)then600
590 next:goto550
600 onigosub640,1340,670,700,730
610 ifi=6thenprint"[147]"bl$:gosub390:return
620 goto550
630 rem ** background color **
640 bc=bc+1:ifbc=16thenbc=0
650 pokevc+33,bc:return
660 rem ** multicolor #0 **
670 m0=m0+1:ifm0=16thenm0=0
680 pokevc+37,m0:return
690 rem ** multicolor #1 **
700 m1=m1+1:ifm1=16thenm1=0
710 pokevc+38,m1:return
720 rem ** multicolor on/off **
730 ifpeek(vc+28)=0thenpokevc+28,1:return
740 pokevc+28,0:return
750 rem ** x-expand **
760 ifpeek(vc+29)=0thenpokevc+29,1:return
770 pokevc+29,0:return
780 rem ** y-expand **
790 ifpeek(vc+23)=0thenpokevc+23,1:return
800 pokevc+23,0:return
810 rem ** enter data **
820 print""bl$"[197]nter digits only, ending with return"
830 print"";
840 fori=1to21:printtab(20)" ":next
850 print""tab(23)"[196]ata":printtab(21);
860 fori=1to63step3
870 forj=0to2
880 sd$=""
890 print"[164][157]";
900 gosub1900:ls=len(sd$)
910 ifx$="*"thenprintleft$(cu$,ls)mid$(bl$,2,ls+1)left$(cu$,ls+1);:goto880
920 ifls=3thengoto950
930 ifx$>="0"andx$<="9"thensd$=sd$+x$:printx$;
940 ifx$=chr$(13)andls=0thenprint"0";
950 ifx$=chr$(13)goto970
960 goto890
970 sd=val(sd$):ifsd<=255then1000
980 ls=len(sd$):printleft$(cu$,ls)mid$(bl$,2,ls+1)left$(cu$,ls+1);
990 goto880
1000 ifj<2thenprint" , ";:goto1020
1010 print" ";
1020 sd(i+j)=sd:poke703+i+j,sd
1030 nextj:print:printtab(21);
1040 nexti
1050 print"[147]"cl$:gosub390:return
1060 rem ** diskif **
1070 print"[147]"bl$:printtab(5);:pokevc+21,0
1080 open1,8,0,"$0"
1090 get#1,a$,a$
1100 get#1,a$,a$
1110 ifa$=""then1170
1120 get#1,a$,b$
1130 printasc(a$+chr$(0))+asc(b$+chr$(0))*256;
1140 get#1,a$
1150 ifa$=""thenprint:printtab(5);:goto1100
1160 printa$;:goto1140
1170 close1:print""bl$"";:gosub1920
1180 gosub1900
1190 print"[147]"cl$:pokevc+21,1:gosub390:return
1200 rem ** save sprite **
1210 print""bl$"[198]ile name";
1220 inputfl$
1230 fori=len(fl$)to1step-1:ifmid$(fl$,i,1)=" "thenfl$=left$(fl$,i-1):next
1240 open15,8,15:open1,8,4,fl$+",s,w"
1250 input#15,a$,b$,c$,d$:ifval(a$)=0then1290
1260 print""bl$""b$": ";:gosub1920
1270 gosub1900
1280 goto1320
1290 fori=1to63
1300 print#1,sd(i)
1310 next
1320 print""cl$:close15:close1::return
1330 rem ** color **
1340 col=col+1:ifcol=16thencol=0
1350 pokevc+39,col:return
1360 rem ** quit **
1370 print"[147]";:pokevc+21,0:poke53272,21:goto63000
1380 rem ** help **
1390 print"[147]"bl$"[200]elp: ";:gosub1920:pokevc+21,0
1400 print"[204][146] = [204]oad sprite from disk"
1410 print"[205][146] = [205]ulti-color mode"
1420 print"[216][146] = [197]xpand in x-direction"
1430 print"[217][146] = [197]xpand in y-direction"
1440 print"[206][146] = [197]nter new sprite data"
1450 print"[196][146] = [196]isk menu"
1460 print"[211][146] = [211]ave sprite to disk"
1470 print"[195][146] = [195]hange sprite color"
1480 print"[197][146] = [197]dit sprite data"
1490 print"[208][146] = [208]rint sprite"
1500 print"[209][146] = [209]uit program"
1510 gosub1900
1520 print"[147]"cl$:pokevc+21,1:gosub390:return
1530 rem ** edit **
1540 print""bl$" space to continue, return to select"
1550 print""tab(20);
1560 fori=1to63step3
1570 forj=0to2
1580 print""sd(i+j)left$(cu$,len(str$(sd(i+j)))+1);
1590 gosub1900:ifx$=" "thenprint"[146]"sd(i+j)"";:goto1750
1600 ifx$<>chr$(13)then1590
1610 print""bl$"[197]nter new data: ";
1620 sd$=""
1630 print"[164][157]";
1640 gosub1900:ls=len(sd$)
1650 ifx$="*"thenprintleft$(cu$,ls)mid$(bl$,2,ls+1)left$(cu$,ls+1);
1655 ifx$="*"goto1620
1660 ifls=3thengoto1680
1670 ifx$>="0"andx$<="9"thensd$=sd$+x$:printx$;
1680 ifx$=chr$(13)andls=0thenprint"0":goto1710
1690 ifx$=chr$(13)then1710
1700 goto1630
1710 sd=val(sd$)
1720 ifsd>255thenprint"[157][157][157][157] [157][157][157][157]";:goto1620
1730 sd(i+j)=sd:poke703+i+j,sd
1740 print"[147]"cl$:gosub390:return
1750 nextj:print:printtab(20);
1760 nexti
1770 print""cl$:return
1780 rem ** print **
1790 print""bl$"[208]rinting...":open4,4
1800 print#4,fl$:print#4
1810 fori=1to61step3
1820 forj=0to2:bi=128:bi$="":sd=sd(i+j)
1830 ifsd<bithenbi$=bi$+" ":bi=bi/2:goto1850
1840 bi$=bi$+"[209]":sd=sd-bi:bi=bi/2
1850 ifbi>=1then1830
1860 print#4,bi$;:next:print#4,sd(i)sd(i+1)sd(i+2)
1870 next
1880 close4:print""cl$:return
1890 rem ** get s/r **
1900 getx$:ifx$=""then1900
1910 return
1920 print"[208]ress space to continue":return
63000 print"[147]load"chr$(34)"c.payload"chr$(34)",8":print"run"
63001 poke832,0
63002 poke631,13:poke632,13:poke198,2:end