home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 2 / crawlyvol2.bin / apps / desktops / hazel_4 / hazel_4.lst < prev    next >
File List  |  1994-09-04  |  23KB  |  909 lines

  1. ' ******************************************************************************
  2. ' *                                                                            *
  3. ' *                     Greg "Paranoid Jellyfish" Knauss's                     *
  4. ' *                                                                            *
  5. ' *                             H . A . Z . E . L.                             *
  6. ' *                                                                            *
  7. ' *                           A Selective Loader for                           *
  8. ' *      DESKTOP.INF, AUTO, ASSIGN.SYS, DA and GENEVA configuration files      *
  9. ' *                                                                            *
  10. ' *                      modified with much trepididation                      *
  11. ' *           and the Retention of the Master's Original Commentary            *
  12. ' *  for readers of "Current Notes" and other worthies in the Atari Community  *
  13. ' *                    by Henry K van Eyken, September 1994                    *
  14. ' *                                                                            *
  15. ' *                              (Modification 3)                              *
  16. ' *                                                                            *
  17. ' ******************************************************************************
  18. '
  19. ' H.A.Z.E.L. is in the public domain and may be freely distributed.  She always
  20. ' was sort of a tramp...
  21. '
  22. ' Only do the program if they're holding down the left SHIFT key...
  23. '
  24. IF (BIOS(11,-1) AND 2)=2 THEN
  25.   '
  26.   ' Get the resolution
  27.   '
  28.   old_res%=XBIOS(4)
  29.   res%=old_res%
  30.   '
  31.   ' If they're in low, move it to medium
  32.   '
  33.   IF res%=0 THEN
  34.     VOID XBIOS(5,L:-1,L:-1,1)
  35.     res%=1
  36.     '
  37.     ' And set color 3 to black
  38.     '
  39.     SETCOLOR 3,0
  40.   ENDIF
  41.   '
  42.   ' Define escape
  43.   '
  44.   esc$=CHR$(27)
  45.   '
  46.   ' Print credits
  47.   '
  48.   IF res%=1 THEN
  49.     '
  50.     ' Medium res
  51.     '
  52.     PRINT esc$;"b1            H.A.Z.E.L.";esc$;"b3 AUTO, ASSIGN.SYS, DA and DESKTOP.INF Chooser!"
  53.   ELSE
  54.     '
  55.     ' High res
  56.     '
  57.     PRINT "            ";esc$;"c1";esc$;"b0H.A.Z.E.L.";esc$;"c0";esc$;"b1 AUTO, ASSIGN.SYS, DA and DESKTOP.INF Chooser!"
  58.   ENDIF
  59.   PRINT "                            By Greg ";CHR$(34);"Maddog";CHR$(34);" Knauss"
  60.   PRINT "                          Copyright 1989  Magnum Opus"
  61.   PRINT
  62.   '
  63.   ' Dims and defines
  64.   '
  65.   DIM filename$(80)
  66.   DIM file_len%(80)
  67.   DIM short_name$(80)
  68.   DIM ext$(4)
  69.   DIM type%(80)
  70.   DIM orig_stat!(80)
  71.   DIM stat!(80)
  72.   '
  73.   DIM jf_prg$(80)
  74.   DIM jf_prgstat!(80)
  75.   DIM jf_acc$(80)
  76.   DIM jf_accstat!(80)
  77.   '
  78.   ' Some stuff
  79.   '
  80.   north$=CHR$(0)+"H"
  81.   south$=CHR$(0)+"P"
  82.   east$=CHR$(0)+"M"
  83.   west$=CHR$(0)+"K"
  84.   '
  85.   ' Legal AUTO extensions
  86.   '
  87.   ext$(1)="PRG"
  88.   ext$(2)="APP"
  89.   ext$(3)="TOS"
  90.   ext$(4)="TTP"
  91.   '
  92.   ' Assume that nothing's there
  93.   '
  94.   infos!=FALSE
  95.   autos!=FALSE
  96.   gdos!=FALSE
  97.   accs!=FALSE
  98.   cnfs!=FALSE
  99.   rootdir!=FALSE
  100.   jf_alert!=FALSE
  101.   '
  102.   ' ****************************************************************************
  103.   ' Do selects for DESKTOP.INF file
  104.   ' ****************************************************************************
  105.   '
  106. desktop_choose:
  107.   '
  108.   ' Any DESKTOPs?
  109.   '
  110.   IF EXIST("\AUTO\HAZEL\*.INF") THEN
  111.     '
  112.     ' Get a directory
  113.     '
  114.     GOSUB get_dir("\AUTO\HAZEL\*.INF")
  115.     '
  116.     ' Do the select
  117.     '
  118.     infos!=TRUE
  119.     pass%=1
  120.     GOSUB assign_desktop("\DESKTOP.INF")
  121.     jf_inf$=jellyfish$
  122.   ELSE
  123.     '
  124.     ' No DESKTOP files...
  125.     '
  126.     PRINT "No DESKTOP.INF files..."
  127.     PAUSE (50)
  128.   ENDIF
  129.   '
  130.   ' Is there an AUTO folder?
  131.   '
  132.   IF EXIST("\AUTO\*.*") THEN
  133.     '
  134.     ' **************************************************************************
  135.     ' Do selects for AUTO programs
  136.     ' **************************************************************************
  137.     '
  138.   auto_choose:
  139.     '
  140.     ' Load directory into Filename$
  141.     '
  142.     GOSUB get_dir("\AUTO\*.*")
  143.     '
  144.     ' Sort out all non-PR?, non-AP?, non-TO?, non-TT? files
  145.     '
  146.     j%=0
  147.     CLR prgstring$
  148.     REPEAT
  149.       temp%=INSTR(filename$(j%),".")
  150.       temp$=MID$(filename$(j%),temp%+1,2)
  151.       '
  152.       ' It's not an executable file, so remove it from the list
  153.       '
  154.       IF temp$<>"PR" AND temp$<>"AP" AND temp$<>"TO" AND temp$<>"TT" THEN
  155.         FOR i%=j% TO num_of_files%
  156.           filename$(i%)=filename$(i%+1)
  157.         NEXT i%
  158.         DEC num_of_files%
  159.       ELSE
  160.         '
  161.         ' We save it
  162.         '
  163.         short_name$(j%)=LEFT$(filename$(j%),temp%-1)
  164.         type%(j%)=-(temp$="PR")-2*(temp$="AP")-3*(temp$="TO")-4*(temp$="TT")
  165.         prgstring$=prgstring$+short_name$(j%)
  166.         '
  167.         ' It's alive!  (Or "active" if you wanna get picky.)
  168.         '
  169.         IF ext$(type%(j%))=RIGHT$(filename$(j%),3) THEN
  170.           stat!(j%)=TRUE
  171.           orig_stat!(j%)=TRUE
  172.         ELSE
  173.           '
  174.           ' It's dead...  He was such a good file...
  175.           '
  176.           stat!(j%)=FALSE
  177.           orig_stat!(j%)=FALSE
  178.         ENDIF
  179.         INC j%
  180.       ENDIF
  181.       '
  182.       ' Done yet?
  183.       '
  184.     UNTIL j%=num_of_files%+1
  185.     '
  186.     ' Get Jellyfish script
  187.     '
  188.     CLR jf_prgstring$,jf_accstring$
  189.     IF rootdir!=FALSE
  190.       IF EXIST("\AUTO\HAZEL\"+jf_inf$+".RSC")
  191.         OPEN "I",#1,"\AUTO\HAZEL\"+jf_inf$+".RSC"
  192.         INPUT #1,jf_inf$
  193.         INPUT #1,jf_sys$
  194.         INPUT #1,jf_cnf$
  195.         INPUT #1,ram$
  196.         INPUT #1,jf_noprgf$
  197.         INPUT #1,jf_noaccf$
  198.         FOR i%=0 TO num_of_files%
  199.           INPUT #1,jf_prg$(i%)
  200.           jf_prgstring$=jf_prgstring$+jf_prg$(i%)
  201.         NEXT i%
  202.         IF prgstring$=jf_prgstring$
  203.           FOR i%=0 TO num_of_files%
  204.             INPUT #1,jf_prgstat!(i%)
  205.             stat!(i%)=jf_prgstat!(i%)
  206.           NEXT i%
  207.           FOR i%=0 TO VAL(jf_noaccf$)
  208.             INPUT #1,jf_acc$(i%)
  209.             jf_accstring$=jf_accstring$+jf_acc$(i%)
  210.           NEXT i%
  211.           FOR i%=0 TO VAL(jf_noaccf$)
  212.             INPUT #1,jf_accstat!(i%)
  213.           NEXT i%
  214.         ELSE
  215.           jf_alert!=TRUE
  216.           RENAME "\AUTO\HAZEL\"+jf_inf$+".RSC" AS "\AUTO\HAZEL\"+jf_inf$+".BAK"
  217.           PRINT AT(5,10);"List of programs in autofolder has been changed and, hence,"
  218.           PRINT AT(5,11);"the ";jf_inf$;" .RSC file has been made a .BAK file."
  219.           PRINT AT(5,12);"Make manual selections for a new ";jf_inf$;".RSC file."
  220.           FOR i%=0 TO num_of_files%
  221.             jf_prg$(i%)=short_name$(i%)
  222.           NEXT i%
  223.           PRINT AT(5,13);"Press any key."
  224.           ~INP(2)
  225.         ENDIF
  226.         CLOSE #1
  227.       ELSE
  228.         '
  229.         ' Hello, there!  How about you making a nice alert box for this stuff?
  230.         '
  231.         PRINT AT(5,10);"There is no ";jf_inf$;".RSC file on hand for this desktop!"
  232.         PRINT AT(5,11);"Make manual selections of what programs should run."
  233.         PRINT AT(5,12);"Press any key."
  234.         ~INP(2)
  235.         FOR i%=0 TO num_of_files%
  236.           jf_prg$(i%)=short_name$(i%)
  237.         NEXT i%
  238.       ENDIF
  239.     ENDIF
  240.     '
  241.     ' Are there any files for us to fiddle with?
  242.     '
  243.     IF num_of_files%>-1 THEN
  244.       '
  245.       ' Yep!  Do choosing for AUTO programs
  246.       '
  247.       autos!=TRUE
  248.       pass%=2
  249.       CLS
  250.       GOSUB select
  251.       '
  252.       ' Set and record the capacity of the RAM disk.  Minimum set at 50K.
  253.       '
  254.       IF ram$=""
  255.         OPEN "I",#1,"\RAMDISK.INF"
  256.         INPUT #1,ram$
  257.         CLOSE #1
  258.       ENDIF
  259.       drive$=LEFT$(ram$)
  260.       ramsize$=MID$(ram$,2)
  261.       PRINT AT(7,21);"RAM disk: ";drive$;
  262.       FORM INPUT 40 AS ramsize$
  263.       IF VAL(ramsize$)<50
  264.         ramsize$="50"
  265.       ENDIF
  266.       ram$=drive$+ramsize$
  267.       OPEN "O",#1,"\RAMDISK.INF"
  268.       PRINT #1,ram$
  269.       CLOSE #1
  270.       CLS
  271.       '
  272.       ' Run through all the files for AUTO selection
  273.       '
  274.       FOR i%=0 TO num_of_files%
  275.         '
  276.         ' Only change the name if it's status has been changed
  277.         '
  278.         IF stat!(i%)<>orig_stat!(i%) THEN
  279.           temp$="\AUTO\"+short_name$(i%)+"."+LEFT$(ext$(type%(i%)),2-stat!(i%))
  280.           NAME "\AUTO\"+filename$(i%) AS temp$
  281.         ENDIF
  282.         jf_prgstat!(i%)=stat!(i%)
  283.       NEXT i%
  284.       jf_noprgf%=num_of_files%
  285.       '
  286.       ' Back up
  287.       '
  288.       IF pass%=-1 THEN
  289.         '
  290.         ' ...to DESKTOP choose
  291.         '
  292.         IF infos!=TRUE
  293.           GOTO desktop_choose
  294.         ENDIF
  295.       ENDIF
  296.       '
  297.     ELSE
  298.       '
  299.       ' No AUTO folder...
  300.       '
  301.       PRINT "No AUTO files..."
  302.       PAUSE (50)
  303.     ENDIF
  304.     '
  305.     ' **********************************************************************
  306.     ' Do selects for ASSIGN.SYS file
  307.     ' **********************************************************************
  308.     '
  309.   assign_choose:
  310.     '
  311.     ' Yep, any SYSs in HAZEL?
  312.     '
  313.     IF autos! AND EXIST("\AUTO\HAZEL\*.SYS") THEN
  314.       '
  315.       ' Get the directory
  316.       '
  317.       GOSUB get_dir("\AUTO\HAZEL\*.SYS")
  318.       '
  319.       ' Do the choosing for ASSIGN.SYS
  320.       '
  321.       gdos!=TRUE
  322.       pass%=3
  323.       GOSUB assign_desktop("\ASSIGN.SYS")
  324.       IF jellyfish$<>""
  325.         jf_sys$=jellyfish$
  326.       ENDIF
  327.       '
  328.       ' Back up
  329.       '
  330.       IF pass%=-1
  331.         GOTO auto_choose
  332.       ENDIF
  333.     ELSE
  334.       '
  335.       ' No files in ASSIGNS directory...
  336.       '
  337.       PRINT "No ASSIGN.SYS files..."
  338.       PAUSE (50)
  339.     ENDIF
  340.   ELSE
  341.     '
  342.     ' No executable AUTO files...
  343.     '
  344.     PRINT "No executable AUTO files..."
  345.     PAUSE (50)
  346.   ENDIF
  347.   '
  348.   ' ****************************************************************************
  349.   ' Do selects for DAs
  350.   ' ****************************************************************************
  351.   '
  352. da_choose:
  353.   '
  354.   IF EXIST("\*.AC?") THEN
  355.     '
  356.     ' Load in main boot drive directory *.AC? files
  357.     '
  358.     GOSUB get_dir("\*.AC?")
  359.     '
  360.     ' Loop through all filenames
  361.     '
  362.     CLR accstring$
  363.     FOR i%=0 TO num_of_files%
  364.       temp%=INSTR(filename$(i%),".")
  365.       short_name$(i%)=LEFT$(filename$(i%),temp%-1)
  366.       accstring$=accstring$+short_name$(i%)
  367.       '
  368.       ' It lives!  It lives!
  369.       '
  370.       IF RIGHT$(filename$(i%),3)="ACC" THEN
  371.         stat!(i%)=TRUE
  372.         orig_stat!(i%)=TRUE
  373.       ELSE
  374.         '
  375.         ' No, it doesn't!  No, it doesn't!
  376.         '
  377.         stat!(i%)=FALSE
  378.         orig_stat!(i%)=FALSE
  379.       ENDIF
  380.       '
  381.       ' Move to next one
  382.       '
  383.     NEXT i%
  384.     '
  385.     ' Checking with the Jellyfish script
  386.     '
  387.     IF rootdir!=FALSE
  388.       IF accstring$=jf_accstring$
  389.         FOR i%=0 TO num_of_files%
  390.           stat!(i%)=jf_accstat!(i%)
  391.         NEXT i%
  392.       ELSE
  393.         jf_alert!=TRUE
  394.         FOR i%=0 TO num_of_files%
  395.           jf_acc$(i%)=short_name$(i%)
  396.         NEXT i%
  397.         PRINT AT(5,10);"A new ";jf_inf$;".RSC file is being created. Therefore you"
  398.         PRINT AT(5,11);"must make manual selections of what accessories should run."
  399.         PRINT AT(5,12);"Press any key."
  400.         ~INP(2)
  401.       ENDIF
  402.     ENDIF
  403.     '
  404.     ' Do choosing for DAs
  405.     '
  406.     accs!=TRUE
  407.     pass%=4
  408.     CLS
  409.     GOSUB select
  410.     CLS
  411.     '
  412.     ' Back up!
  413.     '
  414.     IF pass%=-1 THEN
  415.       '
  416.       ' ... to ASSIGN.SYS choose
  417.       '
  418.       IF gdos!
  419.         GOTO assign_choose
  420.       ELSE
  421.         '
  422.         ' ...to AUTO choose
  423.         '
  424.         IF autos!=TRUE THEN
  425.           GOTO auto_choose
  426.         ELSE
  427.           '
  428.           ' ...to DESKTOP choose
  429.           '
  430.           IF infos!
  431.             GOTO desktop_choose
  432.           ELSE
  433.             '
  434.             ' ... to DA 'cause there ain't a previous ...
  435.             '
  436.             GOTO da_choose
  437.           ENDIF
  438.         ENDIF
  439.       ENDIF
  440.     ENDIF
  441.     '
  442.     ' Make mods
  443.     '
  444.     FOR i%=0 TO num_of_files%
  445.       '
  446.       ' Only change the name if it's status has been changed
  447.       '
  448.       IF stat!(i%)<>orig_stat!(i%) THEN
  449.         temp$="\"+short_name$(i%)+"."+LEFT$("ACC",2-stat!(i%))
  450.         NAME "\"+filename$(i%) AS temp$
  451.       ENDIF
  452.       jf_accstat!(i%)=stat!(i%)
  453.     NEXT i%
  454.     jf_noaccf%=num_of_files%
  455.   ELSE
  456.     '
  457.     ' No desk accessories...
  458.     '
  459.     PRINT "No desk accessories..."
  460.     PAUSE (50)
  461.   ENDIF
  462.   '
  463.   ' ****************************************************************************
  464.   ' Do selects for Geneva GEM.CNF files
  465.   ' ****************************************************************************
  466.   '
  467.   ' Any Geneva GEM.CNF files?
  468.   '
  469.   IF jf_inf$="GENEVA"
  470.     ' IF EXIST("\AUTO\GENEVA.PRG")
  471.     IF EXIST("\GENEVA\GEM.CNF")
  472.       '
  473.       ' Get a directory
  474.       '
  475.       GOSUB get_dir("\GENEVA\GEM.CNF")
  476.       '
  477.       ' Do the select
  478.       '
  479.       cnfs!=TRUE
  480.       pass%=5
  481.       GOSUB assign_desktop("\GENEVA\GEM.CNF")
  482.       IF jellyfish$<>""
  483.         jf_cnf$=jellyfish$
  484.       ENDIF
  485.       '
  486.       ' back-up
  487.       '
  488.       IF pass%=-1
  489.         '
  490.         ' ... to DA choose
  491.         '
  492.         IF accs!
  493.           GOTO da_choose
  494.         ELSE
  495.           '
  496.           ' ... to ASSIGN.SYS choose
  497.           '
  498.           IF gdos!
  499.             GOTO assign_choose
  500.           ELSE
  501.             '
  502.             ' ... to AUTO choose
  503.             '
  504.             IF autos!
  505.               GOTO auto_choose
  506.             ENDIF
  507.           ENDIF
  508.         ENDIF
  509.       ENDIF
  510.     ELSE
  511.       '
  512.       ' No GEM.CNF files...
  513.       '
  514.       PRINT "No Geneva GEM.CNF files..."
  515.       PAUSE (50)
  516.     ENDIF
  517.   ENDIF
  518.   '
  519.   ' ****************************************************************************
  520.   ' And now for the finals...
  521.   ' ****************************************************************************
  522.   '
  523.   ' Making a new jellyfish file
  524.   '
  525.   IF rootdir!=FALSE
  526.     OPEN "O",#1,"\AUTO\HAZEL\"+jf_inf$+".RSC"
  527.     PRINT #1,jf_inf$
  528.     PRINT #1,jf_sys$
  529.     PRINT #1,jf_cnf$
  530.     PRINT #1,ram$
  531.     PRINT #1,STR$(jf_noprgf%)
  532.     PRINT #1,STR$(jf_noaccf%)
  533.     FOR i%=0 TO jf_noprgf%
  534.       PRINT #1,jf_prg$(i%)
  535.     NEXT i%
  536.     FOR i%=0 TO jf_noprgf%
  537.       PRINT #1,jf_prgstat!(i%)
  538.     NEXT i%
  539.     FOR i%=0 TO jf_noaccf%
  540.       PRINT #1,jf_acc$(i%)                     !check this
  541.     NEXT i%
  542.     FOR i%=0 TO jf_noaccf%
  543.       PRINT #1,jf_accstat!(i%)
  544.     NEXT i%
  545.     CLOSE #1
  546.   ENDIF
  547.   '
  548.   ' If they started in low res...
  549.   '
  550.   IF old_res%=0 THEN
  551.     '
  552.     ' Restore stuff
  553.     '
  554.     VOID XBIOS(5,L:-1,L:-1,old_res%)
  555.     '
  556.     ' And other stuff
  557.     '
  558.     SETCOLOR 3,5,0,0
  559.   ENDIF
  560. ELSE
  561.   '
  562.   ' Let 'em know what they missed
  563.   '
  564.   PRINT "HAZEL bypassed. Left SHIFT on boot runs."
  565. ENDIF
  566. '
  567. ' We're outta here!  Back to the boot-up! **************************************
  568. '
  569. EDIT
  570. '
  571. ' ******************************************************************************
  572. ' Let's user select files he wants active
  573. ' ******************************************************************************
  574. '
  575. PROCEDURE select
  576.   '
  577.   ' Show the title
  578.   '
  579.   GOSUB title
  580.   '
  581.   ' Set up program selections screen
  582.   '
  583.   IF pass%=1
  584.     dy%=0
  585.   ELSE
  586.     dy%=2
  587.     IF rootdir!
  588.       PRINT AT(1,7);"The settings you make will not be saved after this session!."
  589.     ELSE IF jf_alert!
  590.       PRINT AT(1,7);"Creating a "+jf_inf$+".RSC file"
  591.       jf_alert!=FALSE
  592.     ELSE
  593.       PRINT AT(1,7);"Running "+jf_inf$+".INF, "+jf_sys$+".SYS, "+jf_cnf$+".CNF"
  594.     ENDIF
  595.   ENDIF
  596.   '
  597.   x%=-1
  598.   y%=7+dy%
  599.   '
  600.   ' Go through all files
  601.   '
  602.   FOR i%=0 TO num_of_files%
  603.     '
  604.     ' Position on screen
  605.     '
  606.     IF x%>6 THEN
  607.       INC y%
  608.       x%=-1
  609.     ENDIF
  610.     INC x%
  611.     '
  612.     ' If they're selecting AUTO files or DAs, show them highlighted or not
  613.     '
  614.     IF pass% MOD 2=0 THEN
  615.       '
  616.       ' Color monitor?
  617.       '
  618.       IF res%=1 THEN
  619.         '
  620.         ' Yep!  Green if activated, red if not
  621.         '
  622.         PRINT esc$;"b";CHR$(49-stat!(i%));
  623.       ELSE
  624.         '
  625.         ' Nope...  Highlighted if activated, not if not
  626.         '
  627.         PRINT esc$;"b";CHR$(49+stat!(i%));esc$;"c";CHR$(48-stat!(i%));
  628.       ENDIF
  629.     ENDIF
  630.     '
  631.     ' Otherwise, just...
  632.     '
  633.     ' Print the filename
  634.     '
  635.     PRINT AT(x%*10+2,y%);short_name$(i%);
  636.   NEXT i%
  637.   '
  638.   ' Set-ups
  639.   '
  640.   cy%=7+dy%
  641.   cx%=0
  642.   PRINT AT(1,7+dy%);esc$;"b?";esc$;"c0";CHR$(175)
  643.   '
  644.   ' Do cursor movement
  645.   '
  646.   REPEAT
  647.     '
  648.     ' Get a key...
  649.     '
  650.     key$=INKEY$
  651.     '
  652.     ' They hit a key...
  653.     '
  654.     IF key$<>"" THEN
  655.       '
  656.       ' Erase old cursor
  657.       '
  658.       PRINT AT(cx%*10+1,cy%);esc$;"b?";esc$;"c0 "
  659.       '
  660.       ' Move up
  661.       '
  662.       IF key$=north$ AND cy%-1>6 THEN
  663.         DEC cy%
  664.       ELSE
  665.         '
  666.         ' Move down
  667.         '
  668.         IF key$=south$ AND cy%<y% THEN
  669.           INC cy%
  670.           IF cy%=y% AND cx%>x% THEN
  671.             cx%=x%
  672.           ENDIF
  673.         ELSE
  674.           '
  675.           ' Move right
  676.           '
  677.           IF key$=east$ AND cx%+1<8 THEN
  678.             INC cx%
  679.             IF cy%=y% AND cx%+1>x% THEN
  680.               cx%=x%
  681.             ENDIF
  682.           ELSE
  683.             '
  684.             ' Move left
  685.             '
  686.             IF key$=west$ AND cx%>0 THEN
  687.               DEC cx%
  688.             ENDIF
  689.           ENDIF
  690.         ENDIF
  691.       ENDIF
  692.       '
  693.       ' Print cursor
  694.       '
  695.       PRINT AT(cx%*10+1,cy%);CHR$(175)
  696.       '
  697.       ' SPACE to toggle, if it's selection of AUTOs or DAs
  698.       '
  699.       IF key$=" " AND pass% MOD 2=0 THEN
  700.         temp%=cx%+(cy%-(7+dy%))*8
  701.         stat!(temp%)=-1-stat!(temp%)
  702.         PRINT AT(cx%*10+2,cy%);
  703.         '
  704.         ' Color monitor?
  705.         '
  706.         IF res%=1 THEN
  707.           '
  708.           ' Yep!  Green if activated, red if not
  709.           '
  710.           PRINT esc$;"b";CHR$(49-stat!(temp%));
  711.         ELSE
  712.           '
  713.           ' Nope...  Highlighted if activated, not if not
  714.           '
  715.           PRINT esc$;"b";CHR$(49+stat!(temp%));esc$;"c";CHR$(48-stat!(temp%));
  716.         ENDIF
  717.         PRINT short_name$(temp%)
  718.       ENDIF
  719.       '
  720.       ' Backup?
  721.       '
  722.       IF key$=CHR$(8) AND pass%>1 THEN
  723.         pass%=-1
  724.       ENDIF
  725.     ENDIF
  726.     '
  727.     ' Out?
  728.     '
  729.   UNTIL key$=CHR$(13) OR pass%=-1
  730.   '
  731.   ' Out! Erase the cursor
  732.   '
  733.   PRINT AT(cx%*10+1,cy%);" "
  734. RETURN
  735. '
  736. ' ******************************************************************************
  737. ' Print the title and instructions for each res and pass
  738. ' ******************************************************************************
  739. '
  740. > PROCEDURE title
  741.   '
  742.   ' Title for medium and high res
  743.   '
  744.   PRINT esc$;"c3";esc$;"b0";
  745.   PRINT AT(1,1);SPACE$(80)
  746.   PRINT AT(1,2);SPACE$(35);"H.A.Z.E.L.";SPACE$(35)
  747.   PRINT AT(1,3);SPACE$(80)
  748.   PRINT AT(1,4);
  749.   SELECT pass%
  750.   CASE 1
  751.     PRINT "                    Select which DESKTOP.INF file you want:                     "
  752.   CASE 2
  753.     PRINT "                    Select which AUTO programs you want:                        "
  754.   CASE 3
  755.     PRINT "                    Select which ASSIGN.SYS file you want:                      "
  756.   CASE 4
  757.     PRINT "                    Select which Desk Accessories you want:                     "
  758.   CASE 5
  759.     PRINT "                    Select which Geneva CNF files you want:                     "
  760.   ENDSELECT
  761.   PRINT AT(1,5);SPACE$(80)
  762.   '
  763.   ' Print instructions for high and med res
  764.   '
  765.   IF pass% MOD 2=0 THEN
  766.     '
  767.     ' For AUTO and DA select
  768.     '
  769.     PRINT AT(2,25);"     Use the arrow keys to move cursor, SPACE to toggle, RETURN to exit.      ";
  770.   ELSE
  771.     '
  772.     ' For ASSIGN.SYS and DESKTOP.INF selection
  773.     '
  774.     PRINT AT(2,25);"              Use the arrow keys to move cursor, RETURN to choose.            ";
  775.   ENDIF
  776.   '
  777.   ' Restore screen colors
  778.   '
  779.   PRINT esc$;"b?";esc$;"c0";
  780. RETURN
  781. '
  782. ' ******************************************************************************
  783. ' Choosing and copying for ASSING.SYS and DESKTOP.INF
  784. ' ******************************************************************************
  785. '
  786. PROCEDURE assign_desktop(file$)
  787.   '
  788.   ' And put 'em into Short_name$ and add "Keep old" as default
  789.   '
  790.   short_name$(0)="Root Dir"
  791.   FOR i%=0 TO num_of_files%
  792.     temp%=INSTR(filename$(i%),".")
  793.     '
  794.     ' If there's a file extension, cut it off
  795.     '
  796.     IF temp%>0 THEN
  797.       short_name$(i%+1)=LEFT$(filename$(i%),temp%-1)
  798.     ELSE
  799.       '
  800.       ' If not, don't bother
  801.       '
  802.       short_name$(i%+1)=filename$(i%)
  803.     ENDIF
  804.   NEXT i%
  805.   '
  806.   ' Inc number of files 'cause of "Keep old"
  807.   '
  808.   INC num_of_files%
  809.   '
  810.   ' Find out which one they want
  811.   '
  812.   CLS
  813.   GOSUB select
  814.   CLS
  815.   '
  816.   ' Find which one they were on when they RETURNed
  817.   '
  818.   temp%=cx%+(cy%-(7+dy%))*8-1
  819.   '
  820.   ' Keeping old?
  821.   '
  822.   SELECT pass%
  823.   CASE 1
  824.     rootdir!=TRUE
  825.     ' jellyfish$="Root Dir"
  826.   CASE 3
  827.     jellyfish$=jf_sys$
  828.   CASE 5
  829.     jellyfish$=jf_cnf$
  830.   ENDSELECT
  831.   ' jellyfish$="Existing"
  832.   IF temp%>-1 AND pass%>-1 THEN
  833.     '
  834.     ' Here we decide on making a new jellyfish file and what its name will be
  835.     '
  836.     rootdir!=FALSE
  837.     jellyfish$=short_name$(temp%+1)
  838.     '
  839.     ' Nope, copy file
  840.     '
  841.     dumb$=SPACE$(file_len%(temp%))
  842.     BLOAD "\AUTO\HAZEL\"+filename$(temp%),VARPTR(dumb$)
  843.     BSAVE file$,VARPTR(dumb$),LEN(dumb$)
  844.   ENDIF
  845. RETURN
  846. '
  847. ' ******************************************************************************
  848. ' Gets directory from disk to where we can use it
  849. ' ******************************************************************************
  850. '
  851. PROCEDURE get_dir(a$)
  852.   '
  853.   ' Set number of files
  854.   '
  855.   num_of_files%=-1
  856.   '
  857.   ' Point to the Disk Transfer Address (Where filename comes back) and get
  858.   ' File Not Found/End of Data status
  859.   '
  860.   dta%=GEMDOS(47)
  861.   temp%=GEMDOS(78,L:VARPTR(a$),-1)
  862.   '
  863.   ' Loop to get filenames
  864.   '
  865.   DO
  866.     '
  867.     ' Out if no more data
  868.     '
  869.     EXIT IF temp%=-49
  870.     '
  871.     ' We've got another file
  872.     '
  873.     INC num_of_files%
  874.     filename$(num_of_files%)=""
  875.     '
  876.     ' And get filename from memory
  877.     '
  878.     FOR i%=dta%+30 TO dta%+41
  879.       '
  880.       ' Out if this is the end of filename
  881.       '
  882.       EXIT IF PEEK(i%)=0
  883.       '
  884.       ' Add it in
  885.       '
  886.       filename$(num_of_files%)=filename$(num_of_files%)+CHR$(PEEK(i%))
  887.     NEXT i%
  888.     '
  889.     ' And the file length
  890.     '
  891.     file_len%(num_of_files%)=DPEEK(dta%+28)
  892.     '
  893.     ' Get the status for the next file
  894.     '
  895.     temp%=GEMDOS(79)
  896.     '
  897.     ' 'Round again
  898.     '
  899.   LOOP
  900.   '
  901.   ' Make sure they're being reasonable...
  902.   '
  903.   IF num_of_files%>135 THEN
  904.     PRINT "HAZEL can only handle 136 of each type of file!"
  905.     PAUSE (50)
  906.     num_of_files%=135
  907.   ENDIF
  908. RETURN
  909.