home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1988 September / 1988-09.d64 / boot.maker (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  2KB  |  61 lines

  1. 10 rem copyright 1988 compute! publications, inc. - all rights reserved
  2. 20 dimfd$(9),cv$(15,1)
  3. 30 poke53280,0:poke53281,0
  4. 40 fori=0to15:cv$(i,0)=chr$(48+i):cv$(i,1)=str$(i)
  5. 50 ifi>9thencv$(i,0)=chr$(55+i)
  6. 60 nexti
  7. 70 cf=0:print"[147]"chr$(14)chr$(8)"   [195]opyright 1988 [195][207][205][208][213][212][197]! [208]ub., [201]nc."
  8. 80 printtab(11)"[193]ll rights reserved"
  9. 90 print"[194]uild data file for [205][204]-[194]oot...[146]"
  10. 100 input"[194][146]uild or [214][146]iew data filev[157][157][157]";a$
  11. 110 ifa$<>"b"then320
  12. 120 input"[194]ackground color:[146]0[157][157][157]";bc:bc$=chr$(bc)
  13. 130 input"[194]order color:[146]0[157][157][157]";b2:b2$=chr$(b2)
  14. 140 input"[212]ext color:[146]6[157][157][157]";t1:t1$=chr$(t1)
  15. 150 input"[198]ilename[146]";a$
  16. 160 input"[211]tart address[146]";b$:ifleft$(b$,1)="$"thengosub410:goto180
  17. 170 ad=val(b$):hb=int(ad/256):lb=ad-hb*256
  18. 180 fd$(cf)=chr$(lb):fd$(cf)=fd$(cf)+chr$(hb)
  19. 190 iflen(a$)>=16then210
  20. 200 fori=len(a$)to16:a$=a$+chr$(160):nexti
  21. 210 fd$(cf)=fd$(cf)+left$(a$,16)
  22. 220 input"[193]nother file (y/n)n[157][157][157][146]";g$
  23. 230 ifg$="y"andcf<9thencf=cf+1:goto150
  24. 240 ifcf=9thenprint"[212]oo many files...[146]"
  25. 250 goto530:rem verify data
  26. 260 open15,8,15,"s0:boot.dat":close15:open2,8,2,"0:boot.dat,s,w"
  27. 270 print#2,bc$;:print#2,b2$;:print#2,t1$;
  28. 280 print#2,chr$(cf+1);
  29. 290 fori=0tocf:print#2,fd$(i);:nexti
  30. 300 close2:end
  31. 310 print"[196]ata file contents:[146]"
  32. 320 open2,8,2,"0:boot.dat,s,r"
  33. 330 forfc=1to3:get#2,a$:cf=asc(a$+chr$(0)):printcf,:nextfc:print
  34. 340 get#2,a$:cf=asc(a$):printcf
  35. 350 fori=1tocf:forj=1to2:get#2,a$:printasc(a$+chr$(0));:nextj:rem load address
  36. 360 a$="":for j=0to15:get#2,b$:a$=a$+b$:nextj:printa$:nexti
  37. 370 close2
  38. 380 input"[196]o you wish to make a changen[157][157][157]";a$
  39. 390 ifa$="y"then70
  40. 400 end
  41. 410 l$=right$(b$,2):h$=mid$(b$,2,len(b$)-3)
  42. 420 n$=l$:gosub450:lb=n
  43. 430 hb=0:iflen(h$)>0thenn$=h$:gosub450:hb=n
  44. 440 return
  45. 450 eq=0:rem convert a string to a byte
  46. 460 ln$=right$(n$,1)
  47. 470 ifln$=cv$(eq,0)thenn=val(cv$(eq,1)):goto490
  48. 480 eq=eq+1:goto470
  49. 490 hn$=left$(n$,1):eq=0
  50. 500 ifhn$=cv$(eq,0)thenn=n+16*val(cv$(eq,1)):goto520
  51. 510 eq=eq+1:goto500
  52. 520 return
  53. 530 print"[196]ata file contents:[146]"
  54. 540 printbc,b2,t1
  55. 550 printcf+1
  56. 560 fori=0tocf:forj=1to2:printasc(mid$(fd$(i),j,1)+chr$(0));:nextj
  57. 570 printright$(fd$(i),16):nexti
  58. 580 input"[196]o you wish to make a changen[157][157][157]";a$
  59. 590 ifa$="y"then70
  60. 600 goto260
  61.