home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1988 September
/
1988-09.d64
/
boot.maker
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
2KB
|
61 lines
10 rem copyright 1988 compute! publications, inc. - all rights reserved
20 dimfd$(9),cv$(15,1)
30 poke53280,0:poke53281,0
40 fori=0to15:cv$(i,0)=chr$(48+i):cv$(i,1)=str$(i)
50 ifi>9thencv$(i,0)=chr$(55+i)
60 nexti
70 cf=0:print"[147]"chr$(14)chr$(8)" [195]opyright 1988 [195][207][205][208][213][212][197]! [208]ub., [201]nc."
80 printtab(11)"[193]ll rights reserved"
90 print"[194]uild data file for [205][204]-[194]oot...[146]"
100 input"[194][146]uild or [214][146]iew data filev[157][157][157]";a$
110 ifa$<>"b"then320
120 input"[194]ackground color:[146]0[157][157][157]";bc:bc$=chr$(bc)
130 input"[194]order color:[146]0[157][157][157]";b2:b2$=chr$(b2)
140 input"[212]ext color:[146]6[157][157][157]";t1:t1$=chr$(t1)
150 input"[198]ilename[146]";a$
160 input"[211]tart address[146]";b$:ifleft$(b$,1)="$"thengosub410:goto180
170 ad=val(b$):hb=int(ad/256):lb=ad-hb*256
180 fd$(cf)=chr$(lb):fd$(cf)=fd$(cf)+chr$(hb)
190 iflen(a$)>=16then210
200 fori=len(a$)to16:a$=a$+chr$(160):nexti
210 fd$(cf)=fd$(cf)+left$(a$,16)
220 input"[193]nother file (y/n)n[157][157][157][146]";g$
230 ifg$="y"andcf<9thencf=cf+1:goto150
240 ifcf=9thenprint"[212]oo many files...[146]"
250 goto530:rem verify data
260 open15,8,15,"s0:boot.dat":close15:open2,8,2,"0:boot.dat,s,w"
270 print#2,bc$;:print#2,b2$;:print#2,t1$;
280 print#2,chr$(cf+1);
290 fori=0tocf:print#2,fd$(i);:nexti
300 close2:end
310 print"[196]ata file contents:[146]"
320 open2,8,2,"0:boot.dat,s,r"
330 forfc=1to3:get#2,a$:cf=asc(a$+chr$(0)):printcf,:nextfc:print
340 get#2,a$:cf=asc(a$):printcf
350 fori=1tocf:forj=1to2:get#2,a$:printasc(a$+chr$(0));:nextj:rem load address
360 a$="":for j=0to15:get#2,b$:a$=a$+b$:nextj:printa$:nexti
370 close2
380 input"[196]o you wish to make a changen[157][157][157]";a$
390 ifa$="y"then70
400 end
410 l$=right$(b$,2):h$=mid$(b$,2,len(b$)-3)
420 n$=l$:gosub450:lb=n
430 hb=0:iflen(h$)>0thenn$=h$:gosub450:hb=n
440 return
450 eq=0:rem convert a string to a byte
460 ln$=right$(n$,1)
470 ifln$=cv$(eq,0)thenn=val(cv$(eq,1)):goto490
480 eq=eq+1:goto470
490 hn$=left$(n$,1):eq=0
500 ifhn$=cv$(eq,0)thenn=n+16*val(cv$(eq,1)):goto520
510 eq=eq+1:goto500
520 return
530 print"[196]ata file contents:[146]"
540 printbc,b2,t1
550 printcf+1
560 fori=0tocf:forj=1to2:printasc(mid$(fd$(i),j,1)+chr$(0));:nextj
570 printright$(fd$(i),16):nexti
580 input"[196]o you wish to make a changen[157][157][157]";a$
590 ifa$="y"then70
600 goto260