home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / uni-lib.zip / MANUAL2.DOC < prev    next >
Text File  |  1987-05-24  |  39KB  |  1,796 lines

  1.  
  2. E
  3.      Unicorn Library Documentation  3.1                         page 48
  4.  
  5.      __________________________________________________________________
  6.  
  7.                                ellipser
  8. F
  9.      Plots an ellipse on the graphics screen.  The ellipse may be
  10.      rotated in 6 degree increments from 0 to 90 degrees.  To obtain
  11.      full 360 degree rotation the major axis may be defined as either
  12.      x or y with rotation.
  13.  
  14.  
  15.  
  16.      Call:   ellipser(xc, yc, rotate, r1, r2, color);
  17.  
  18.              xc      =  column coordinate of center
  19.              yc      =  row coordinate of center
  20.              rotate  =  angle of rotation (0, 6, 12, 18 etc.)
  21.              r1      =  half the distance along the x-axis (columns)
  22.              r2      =  half the distance along the y axis (rows)
  23.              color   =  color of the ellipse
  24.  
  25.  
  26.  
  27.      Example:    main()
  28.                  {
  29.                    sm(4);  /*  set graphics mode  */
  30.  
  31.                    /* draw an ellipse in color 2 rotated 48 degrees */
  32.  
  33.                    ellipser(100,100,48, 50, 80, 2);
  34.                  }
  35.  
  36.  
  37. Unicorn 1 Documentation  3.1                                      page 49
  38.  
  39. __________________________________________________________________________
  40.  
  41.  
  42.                                equipchk
  43.  
  44.  
  45. Returns an integer idicative of the equipment contained on the PC.  The
  46. number may be interpreted as follows:
  47.  
  48. bit 0           -  diskette installed
  49. bit 1           -  not used
  50. bit 2, 3        -  always 11
  51. bit 4, 5        -  initial video mode
  52.                      01  =  40 x 25 BW
  53.                      10  =  80 x 25 BW
  54. bit 6, 7        -  number of diskette drives ( only if bit 0 = 1)
  55.                      00 = 1
  56.                      01 = 2
  57. bit 8           -  0 = dma present
  58.                    1 = no dma on system
  59. bit 9, 10, 11   -  number of RS-232 cards installed
  60. bit 12          -  game I/O attached
  61. bit 13          -  not used
  62. bit 14, 15      -  number of printers
  63.  
  64.  
  65.  
  66. Call:         equipchk();
  67.  
  68.  
  69. Example:      main()
  70.               {
  71.                  equipchk();  /* get current equipment status */
  72.               }
  73.  
  74.  
  75.  
  76. E
  77.      Unicorn Library Documentation  3.1                         page 50
  78.  
  79.      __________________________________________________________________
  80.  
  81.                                flagdec
  82. F
  83.  
  84.     Decrements the mouse cursor flag.  If the flag is greater than or equal
  85.     to zero the cursor is visible, if 0 or less then the cursor is not
  86.     visible.
  87.  
  88.  
  89.    Call:  flagdec();
  90.  
  91.  
  92.    Example:
  93.             main();
  94.             {
  95.               mreset();
  96.               flagdec();
  97.             }
  98.  
  99.  
  100.  
  101.  
  102. E
  103.      Unicorn Library Documentation  3.1                         page 51
  104.  
  105.      ___________________________________________________________________
  106.                                flaginc
  107. F
  108.  
  109.     Increments the mouse cursor flag.  If the flag is greater than or equal
  110.     to zero the cursor is visible, if 0 or less then the cursor is not
  111.     visible.
  112.  
  113.  
  114.    Call:  flaginc();
  115.  
  116.  
  117.    Example:
  118.             main();
  119.             {
  120.               mreset();  /* sets cursor flag to -1 */
  121.               flaginc(); /* now cursor is visible */
  122.             }
  123.  
  124.  
  125.  
  126.  
  127. E
  128.      Unicorn Library Documentation  3.1                         page 52
  129.  
  130.      __________________________________________________________________
  131.  
  132.                                forward
  133. F
  134.      Moves the turtle (turtle graphics) in its current direction by a
  135.      specified distance.  The distance is measured in pixels.
  136.  
  137.  
  138.  
  139.  
  140.      Call:   forward(pixels);
  141.  
  142.              pixels  =  number of pixels to move in current direction
  143.  
  144.  
  145.  
  146.  
  147.      Example:    main()
  148.                  {
  149.                     sm(4);  /* set graphics mode */
  150.                     pendown();  /* set pen down on screen to draw */
  151.                     forward(50);  /* move forward 50 pixels */
  152.                  }
  153.  
  154.  
  155.  
  156. E
  157.      Unicorn Library Documentation  3.1                         page 53
  158.  
  159.      __________________________________________________________________
  160.  
  161.                               GAL_LT
  162. F
  163.     This macro converts gallons to liters.
  164.  
  165.  
  166.     Call:   GAL_LT(gallons);
  167.  
  168.  
  169.  
  170.     Example:
  171.              main()
  172.              {
  173.                 printf("%lf gallons is %lf liters\n", 4.5, GAL_LT(4.5));
  174.              }
  175.  
  176.  
  177. E
  178.      Unicorn 1 Documentation  3.1                               page 54
  179.  
  180.      _____________________________________________________________________
  181.  
  182.  
  183. F                               gcomtype
  184.  
  185.  
  186.     Returns a ROM byte indicating what type of computer is in use.
  187.  
  188.  
  189.     Call:
  190.           gcomtype();
  191.  
  192.  
  193.     Example:
  194.               main()
  195.               {
  196.                  printf("%d", gcomtype());
  197.               }
  198.  
  199. E
  200.      Unicorn 1 Documentation  3.1                                  page 55
  201.  
  202.      _____________________________________________________________________
  203.  
  204.  
  205. F                               gcurpos
  206.  
  207.      A C bios call to get the current cursor position.  This is similar to
  208.      the assembly language call getcurp.  By examining both you will see
  209.      how to implement both types of functions.
  210.  
  211.  
  212.      Call:  gcurpos(row, column, page);
  213.  
  214.      Where:
  215.             row     =  the current cursor row
  216.             column  =  the current cursor column
  217.             page    =  the current cursor page
  218.  
  219.      Example:
  220.               main()
  221.               {
  222.                   int row, column, page;
  223.  
  224.                   gcurpos(row, column, page);
  225.               }
  226.  
  227.       The values are placed into the variables.
  228.  
  229.  
  230.  
  231. E
  232.      Unicorn 1 Documentation  3.1                                  page 56
  233.  
  234.      _____________________________________________________________________
  235.  
  236.  
  237. F                               getbcnt
  238.  
  239.  
  240.      Returns the count of button presses.
  241.  
  242.  
  243.      Call:   getbcnt(which);
  244.  
  245.      Where:
  246.              which = 0 for left button count or
  247.                      1 for right button count
  248.  
  249.  
  250.      Example:
  251.  
  252.          main()
  253.          {
  254.             printf("There haas been a total of %d left presses", getbcnt(0));
  255.          }
  256.  
  257.  
  258.  
  259.  
  260. E
  261.      Unicorn 1 Documentation  3.1                                  page 57
  262.  
  263.      _____________________________________________________________________
  264.  
  265.  
  266. F                               getrbcnt
  267.  
  268.  
  269.      Returns the count of button releases.
  270.  
  271.  
  272.      Call:   getbrcnt(which);
  273.  
  274.      Where:
  275.              which = 0 for left button count or
  276.                      1 for right button count
  277.  
  278.  
  279.      Example:
  280.  
  281.        main()
  282.        {
  283.           printf("There haas been a total of %d left releases", getbrcnt(0));
  284.        }
  285.  
  286.  
  287.  
  288. E
  289. Unicorn 1 Documentation  3.1                                      page 58
  290.  
  291. __________________________________________________________________________
  292.  
  293.  
  294. F                               getbstat
  295.  
  296.      Returns the current mouse button status.  The return is is follows:
  297.      0 - no button is pressed
  298.      1 - left button is pressed
  299.      2 - right button is pressed
  300.      3 - both buttons are pressed
  301.  
  302.  
  303.      Call:  getbstat();
  304.  
  305.      Example:
  306.               main();
  307.               {
  308.                  if (getbstat == 0)
  309.                     printf("No mouse button is pressed");
  310.                  if (getbstat == 1)
  311.                     printf("The left button is pressed");
  312.                  if (getbstat == 2)
  313.                     printf("The right button is pressed");
  314.                  if (getbstat == 3)
  315.                     printf("Both buttons are pressed");
  316.                }
  317.  
  318.  
  319. E
  320. Unicorn 1 Documentation  3.1                                      page 59
  321.  
  322. __________________________________________________________________________
  323.  
  324.  
  325. F                               getchne
  326.  
  327. Get a character from the standard input with no echo.
  328.  
  329.  
  330.  
  331.  
  332.  
  333. Call:         getchne();
  334.  
  335.  
  336.  
  337.  
  338.  
  339.  
  340. Example:      main()
  341.               {
  342.                  int a;
  343.                  a = getchne(); /* return a character in a with no echo */
  344.               }
  345.  
  346.  
  347.  
  348. Unicorn 1 Documentation  3.1                                      page 60
  349.  
  350. __________________________________________________________________________
  351.  
  352.                                getctype
  353.  
  354.  
  355. Returns an integer indicating the type of IBM-PC.
  356.  
  357. return:
  358.        FFh  =  Original IBM-PC
  359.        FEh  =  PC XT, portable PC or PC with revised system board
  360.        FDh  =  PCjr
  361.        FCh  =  PC-AT
  362.  
  363.  
  364.  
  365. Call:         getctype();
  366.  
  367.  
  368.  
  369. Example:      main()
  370.               {
  371.                  int a;
  372.                  a = getctype();  /* find what type of machine it is */
  373.                  if (a==255)
  374.                    printf("This is an original IBM-PC");
  375.               }
  376.  
  377.  
  378.  
  379. E
  380.      Unicorn Library Documentation  3.1                         page 61
  381.  
  382.      __________________________________________________________________
  383.  
  384.                                getcurp
  385.  
  386. F     This returns the current position of the cursor on the screen in
  387.      row, column format.
  388.  
  389.  
  390.  
  391.  
  392.      Call:    getcurp(&row, &column);
  393.  
  394.               row     =  the current cursor row position
  395.               column  =  the current cursor column position
  396.  
  397.  
  398.  
  399.      Example:   main()
  400.                 {
  401.                    getcurp(row, column);
  402.                 }
  403.  
  404.  
  405.  
  406.  
  407. E
  408. Unicorn 1 Documentation  3.1                                      page 62
  409.  
  410. __________________________________________________________________________
  411.  
  412.  
  413. F                               getdmaj
  414.  
  415.  
  416.     Returns the DOS major version.  If using DOS 3.2 this will return 3.
  417.  
  418.     Call:  getdmaj();
  419.  
  420.  
  421.     Example:
  422.             main()
  423.             {
  424.                printf("The DOS major version is %d\n", getdmaj());
  425.              }
  426.  
  427.  
  428.  
  429.  
  430.  
  431. E
  432. Unicorn 1 Documentation  3.1                                      page 63
  433.  
  434. __________________________________________________________________________
  435.  
  436.  
  437. F                               getdmin
  438.  
  439.  
  440.     Returns the DOS minor version.  If using DOS 3.2 this will return 2.
  441.  
  442.     Call:  getdmin();
  443.  
  444.  
  445.     Example:
  446.             main()
  447.             {
  448.                printf("The DOS minor version is %d\n", getdmin());
  449.              }
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456. E
  457. Unicorn 1 Documentation  3.1                                      page 64
  458.  
  459. __________________________________________________________________________
  460.  
  461.  
  462. F                               getdver
  463.  
  464.  
  465.     Returns the DOS version.  If using DOS 3.2 this will return 3.2.
  466.  
  467.     Call:  getdver();
  468.  
  469.  
  470.     Example:
  471.             main()
  472.             {
  473.                printf("The DOS version is %d\n", getdver());
  474.              }
  475.  
  476.  
  477.  
  478.  
  479.  
  480. E
  481. Unicorn 1 Documentation  3.1                                      page 65
  482.  
  483. __________________________________________________________________________
  484.  
  485.  
  486. F                               gethpos
  487.  
  488.     Returns an integer value for the mouse cursor's current horizontal
  489.     position.  It must be within the current virtual screen limits.
  490.  
  491.  
  492.     Call:  gethpos();
  493.  
  494.  
  495.     Example:
  496.              main()
  497.              {
  498.                  printf("The mouse's horizontal position is %d", gethpos());
  499.              }
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507. E
  508. Unicorn 1 Documentation  3.1                                      page 66
  509.  
  510. __________________________________________________________________________
  511.  
  512.  
  513. F                               getkey
  514.  
  515.     Returns the ASCII code for a keypress.  If no key is available it
  516.     will wait until a key is pressed.
  517.  
  518.  
  519.  
  520.     Call:  getkey();
  521.  
  522.  
  523.     Example:
  524.             main()
  525.             {
  526.                printf("The ASCII code is %d", getkey());
  527.             }
  528.  
  529.  
  530. E
  531. Unicorn 1 Documentation  3.1                                      page 67
  532.  
  533. __________________________________________________________________________
  534.  
  535.  
  536. F                               getkeycd
  537.  
  538.     Returns the ASCII code for a keypress.  If no key is available it
  539.     will wait until a key is pressed.
  540.  
  541.  
  542.  
  543.     Call:  getkeycd();
  544.  
  545.  
  546.     Example:
  547.             main()
  548.             {
  549.                printf("The ASCII code is %d", getkeycd());
  550.             }
  551.  
  552.  
  553.  
  554. E
  555. Unicorn 1 Documentation  3.1                                      page 68
  556.  
  557. __________________________________________________________________________
  558.  
  559.  
  560. F                               getscode
  561.  
  562.     Returns the scan code for a keypress.  If no key is available it
  563.     will wait until a key is pressed.
  564.  
  565.  
  566.  
  567.     Call:  getscode();
  568.  
  569.  
  570.     Example:
  571.             main()
  572.             {
  573.                printf("The scan code is %d", getscode());
  574.             }
  575.  
  576.  
  577.  
  578. E
  579. Unicorn 1 Documentation  3.1                                      page 69
  580.  
  581. __________________________________________________________________________
  582.  
  583.  
  584. F                               getstate
  585.  
  586.     Returns the current video mode.
  587.  
  588.  
  589.  
  590.     Call:  getstate();
  591.  
  592.  
  593.     Example:
  594.             main()
  595.             {
  596.                printf("The video mode is %d", getstate());
  597.             }
  598.  
  599.  
  600.  
  601. E
  602. Unicorn 1 Documentation  3.1                                      page 70
  603.  
  604. __________________________________________________________________________
  605.  
  606.  
  607. F                               getvpos
  608.  
  609.     Returns the current mouse cursor vertical position.
  610.  
  611.  
  612.  
  613.     Call:  getvpos();
  614.  
  615.  
  616.     Example:
  617.             main()
  618.             {
  619.                printf("The mouse vertical position is %d", getvpos());
  620.             }
  621.  
  622.  
  623.  
  624. E
  625. Unicorn 1 Documentation  3.1                                      page 71
  626.  
  627. __________________________________________________________________________
  628.  
  629.  
  630. F                               get_page
  631.  
  632.     Returns the current video page.
  633.  
  634.  
  635.  
  636.     Call:  get_page();
  637.  
  638.  
  639.     Example:
  640.             main()
  641.             {
  642.                printf("The video page is %d", get_page());
  643.             }
  644.  
  645.  
  646.  
  647. E
  648. Unicorn 1 Documentation  3.1                                      page 72
  649.  
  650. __________________________________________________________________________
  651.  
  652.                                gliss
  653. F
  654.  
  655. Produces a sliding sound or glissando using the IBM mode of sound
  656. production.
  657.  
  658.  
  659.  
  660.  
  661. Call:         gliss(beg, end, rate);
  662.  
  663.               beg  = starting frequency
  664.               end  = ending frequency
  665.               rate = rate of increase/decrease.  a larger rate slows it down
  666.  
  667.  
  668.  
  669.  
  670. Example:      main()
  671.               {
  672.                  gliss(300, 2000, 1); /* rapid slide from 300 to 2000 cycles*/
  673.                  gliss(2000, 300, 10); /* slower slide down from 2000 to
  674.                                           300 cycles */
  675.               }
  676.  
  677.  
  678.  
  679.  
  680. E
  681. Unicorn 1 Documentation  3.1                                      page 73
  682.  
  683. __________________________________________________________________________
  684.  
  685.  
  686. F                               GM_OZ
  687.  
  688.     Returns the number of ounces in a given numbe of grams.
  689.  
  690.  
  691.  
  692.     Call:  GM_OZ(grams);
  693.  
  694.     Where:
  695.           grams = grams to convert to ounces.
  696.  
  697.     Example:
  698.             main()
  699.             {
  700.                printf("There are %d ounces in %d grams", GM_OZ(56.9), 56.9);
  701.             }
  702.  
  703.  
  704. E
  705.      Unicorn Library Documentation  3.1                         page 74
  706.  
  707.      __________________________________________________________________
  708.  
  709.                                gothic
  710.  
  711. F     Displays Gothic characters on the graphics screen.  All characters
  712.      are displayed in a 16 pixel wide by 20 pixel high matrix.
  713.  
  714.  
  715.  
  716.      Call:   gothic(char, ulc, ulr, color);
  717.  
  718.              char   =  character to print
  719.              ulc    =  upper left corner column
  720.              ulr    =  upper left corner row
  721.              color  =  color of the character
  722.  
  723.  
  724.  
  725.  
  726.  
  727.      Example:   main()
  728.                 {
  729.                   sm(4);   /*  set graphics mode */
  730.  
  731.                   /*  print a gothic W at 20, 30 in color 3 */
  732.  
  733.                   gothic('W', 20, 30, 3);
  734.                 }
  735.  
  736.  
  737.  
  738.  
  739. E
  740.      Unicorn Library Documentation  3.1                         page 75
  741.  
  742.      ___________________________________________________________________
  743.  
  744.                               hollow
  745. F
  746.      This function prints outline characters on the graphics screen.  The
  747.      characters are defined in a 16 column by 30 row pixel matrix.
  748.  
  749.  
  750.  
  751.      Call:    hollow(char, ulc, ulr, color);
  752.  
  753.              char   =  character to print
  754.              ulc    =  upper left corner column
  755.              ulr    =  upper left corner row
  756.              color  =  color of the character
  757.  
  758.  
  759.  
  760.  
  761.  
  762.      Example:   main()
  763.                 {
  764.                   sm(4);   /*  set graphics mode */
  765.  
  766.                   /*  print an outline W at 20, 30 in color 3 */
  767.  
  768.                   hollow('W', 20, 30, 3);
  769.                 }
  770.  
  771.  
  772.  
  773. E
  774.      Unicorn Library Documentation  3.1                         page 76
  775.  
  776.      ___________________________________________________________________
  777.  
  778.                               INCH_CM
  779. F
  780.     Converts inches to centimenters.  Implemented as a macro in UC.H.
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.      Call:   INCH_CM(inches);
  790.  
  791.      Where:
  792.              inches  = number of inches to convert to cm.
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.      Example:
  800.              main()
  801.              {
  802.                 printf("There are %d cm in %d inches", INCH_CM(5.6), 5.6);
  803.              }
  804.  
  805.  
  806.  
  807. E
  808.      Unicorn Library Documentation  3.1                         page 77
  809.  
  810.      __________________________________________________________________
  811.  
  812.                               indexch
  813.  
  814. F     Returns the position of a character withing a string.
  815.  
  816.  
  817.  
  818.  
  819.  
  820.      Call:   indexch(str, ch);
  821.  
  822.              str  =  string to be searched
  823.              ch   =  character to search for
  824.  
  825.  
  826.  
  827.      Example:    main()
  828.                  {
  829.                      /*  find the position of the character 'i' */
  830.                      /*  should return a 2 */
  831.                      indexch("This is a test", 'i');
  832.                  }
  833.  
  834.  
  835.  
  836. E
  837.      Unicorn Library Documentation  3.1                         page 78
  838.  
  839.      __________________________________________________________________
  840.  
  841.                               indexr
  842.  
  843. F     Returns the rightmost position of a character in a given string.
  844.      Returns -1 if the character is not found in the string.
  845.  
  846.  
  847.  
  848.  
  849.  
  850.  
  851.      Call:   indexr(str, ch);
  852.  
  853.              str  =  string to be searched
  854.              ch   =  character to search for
  855.  
  856.  
  857.  
  858.  
  859.      Example:    main()
  860.                  {
  861.                     /* find the rightmost poistion of 'i' in "this is a
  862.                        test".  Should return 5  */
  863.                     indexr("This is a test", 'i');
  864.                  }
  865.  
  866.  
  867.  
  868.  
  869. E
  870.      Unicorn Library Documentation  3.1                         page 79
  871.  
  872.      ___________________________________________________________________
  873.  
  874.                                iskey
  875. F
  876.  
  877.     Returns non-zero if there is a key waiting in the keyboard buffer.
  878.     If there is no key it returns 0.
  879.  
  880.  
  881.  
  882.  
  883.  
  884.  
  885.      Call:   iskey();
  886.  
  887.  
  888.  
  889.      Example:     main()
  890.                   {
  891.                     printf("%d", iskey());
  892.                   }
  893.  
  894.  
  895.  
  896.  
  897. E
  898.      Unicorn Library Documentation  3.1                         page 80
  899.  
  900.      ___________________________________________________________________
  901.  
  902.                                kbstat
  903. F
  904.  
  905.      Returns the keyboard status byte.
  906.  
  907.  
  908.  
  909.  
  910.  
  911.      Call:   kbstat();
  912.  
  913.  
  914.  
  915.      Example:     main()
  916.                   {
  917.                     printf("The keyboard status is%d", kbstat());
  918.                   }
  919.  
  920.  
  921.  
  922.  
  923.  
  924. E
  925.      Unicorn Library Documentation  3.1                         page 81
  926.  
  927.      ___________________________________________________________________
  928.  
  929.                                keystat
  930. F
  931.  
  932.      Returns the keyboard status byte.
  933.  
  934.      bit 0 - right shift
  935.      bit 1 - left shift
  936.      bit 2 - ctrl
  937.      bit 3 - alt
  938.      bit 4 - scroll lock
  939.      bit 5 - num lock
  940.      bit 6 - caps lock
  941.      bit 7 - insert
  942.  
  943.  
  944.      Call:   keystat();
  945.  
  946.  
  947.  
  948.      Example:     main()
  949.                   {
  950.                     printf("The keyboard status is%d", keystat());
  951.                   }
  952.  
  953.  
  954.  
  955. E
  956.      Unicorn Library Documentation  3.1                         page 82
  957.  
  958.      ___________________________________________________________________
  959.  
  960.                                KG_LB
  961. F
  962.  
  963.      Converts kilograms to pounds.
  964.  
  965.      Call:   KG_LB(kilograms);
  966.  
  967.      Where:  kilograms  = the number of kilograms to convert to pounds.
  968.  
  969.  
  970.  
  971.      Example:
  972.            main()
  973.            {
  974.              printf("There are %d pounds in %d kilograms", KG_LB(5.6), 5.6);
  975.            }
  976.  
  977.  
  978.  
  979. E
  980.      Unicorn Library Documentation  3.1                         page 83
  981.  
  982.      ___________________________________________________________________
  983.  
  984.                                LB_KG
  985. F
  986.  
  987.      Converts pounds to kilograms.
  988.  
  989.      Call:   LB_KG(pounds);
  990.  
  991.      Where:  pounds = the number of pounds to convert to kilograms.
  992.  
  993.  
  994.  
  995.      Example:
  996.            main()
  997.            {
  998.              printf("There are %d kilograms in %d pounds", LB_KG(5.6), 5.6);
  999.            }
  1000.  
  1001.  
  1002.  
  1003.  
  1004. E
  1005.      Unicorn Library Documentation  3.1                         page 84
  1006.  
  1007.      ___________________________________________________________________
  1008.  
  1009.                                lhjoystk
  1010. F
  1011.  
  1012.      Returns the current left horixontal position for the joystick.
  1013.  
  1014.      Call:   lhjoystk();
  1015.  
  1016.  
  1017.  
  1018.      Example:
  1019.            main()
  1020.            {
  1021.               printf("The left horizontal position is %d", lhjoystk());
  1022.            }
  1023.  
  1024.  
  1025.  
  1026.  
  1027. E
  1028.      Unicorn Library Documentation  3.1                         page 85
  1029.  
  1030.      ___________________________________________________________________
  1031.  
  1032.                                lightpen
  1033. F
  1034.  
  1035.      Returns the current position of the lightpen.
  1036.  
  1037.      Call:   lightpen(&row, &column, &ras_line, &ras_col);
  1038.  
  1039.      Where:
  1040.           row      =  The current text row
  1041.           column   =  The current text column
  1042.           ras_line =  the current graphics raster line row
  1043.           ras_col  =  the current graphics raster column
  1044.  
  1045.  
  1046.      Example:
  1047.            main()
  1048.            { int row, col, ras_line, ras_col;
  1049.                   /* place lightpen position into the above variables */
  1050.              lightpen(&row, &col, &ras_line, &ras_col);
  1051.            }
  1052.  
  1053.  
  1054.  
  1055. E
  1056.      Unicorn Library Documentation  3.1                         page 86
  1057.  
  1058.      __________________________________________________________________
  1059.  
  1060.                                line
  1061.  
  1062. F     Draws a line on the graphics screen given the two endpoints and
  1063.      the color.
  1064.  
  1065.  
  1066.  
  1067.  
  1068.      Call:    line(x1, y1, x2, y2, color);
  1069.  
  1070.               x1, y1  =  end point coordinates
  1071.               x2, y2  =  second end point coordinates
  1072.               color   =  color of the line
  1073.  
  1074.  
  1075.      Example:   main()
  1076.                 {
  1077.                    sm(4);  /*  set the graphics mode  */
  1078.  
  1079.                    /*  draw a line in color 3 from 30,50 to 180, 140 */
  1080.  
  1081.                    line(30,50,180,140,3);
  1082.                 }
  1083.  
  1084.  
  1085. E
  1086.      Unicorn Library Documentation  3.1                         page 87
  1087.  
  1088.      __________________________________________________________________
  1089.  
  1090.                                locate
  1091.  
  1092. F     Returns the color of a pixel on the graphics screen.
  1093.  
  1094.  
  1095.  
  1096.  
  1097.      Call:  variable = locate(row, column);
  1098.  
  1099.             variable  =  the return variable
  1100.             row       =  the row of the pixel
  1101.             column    =  the column of the pixel
  1102.  
  1103.  
  1104.  
  1105.  
  1106.      Example:   main()
  1107.                 {
  1108.                    int a;
  1109.                    sm(4);  /*  set graphics mode  */
  1110.  
  1111.                    /* find the color of the pixel located at 100, 110 */
  1112.                    a = locate(100,110);
  1113.                    /* print it out */
  1114.                    printf("The color of the pixel at 100, 110 is %d\n", a);
  1115.                 }
  1116.  
  1117.  
  1118. Unicorn 1 Documentation  3.1                                      page 88
  1119.  
  1120. __________________________________________________________________________
  1121.  
  1122.                                lprintf
  1123.  
  1124.  
  1125. Send a string to line printer 1.
  1126.  
  1127.  
  1128.  
  1129.  
  1130.  
  1131. Call:         lprintf(string);
  1132.  
  1133.               string = a pointer to string to be printed on printer
  1134.  
  1135.  
  1136.  
  1137.  
  1138. Example:      main()
  1139.               {
  1140.                  lprintf("This is a test"); /* send string to printer */
  1141.               }
  1142.  
  1143.  
  1144.  
  1145. Unicorn 1 Documentation  3.1                                      page 89
  1146.  
  1147. __________________________________________________________________________
  1148.  
  1149.  
  1150.                               lputch
  1151.  
  1152.  
  1153. This function prints a single character to the printer.  It is limited to
  1154. supporting only line printer #1.
  1155.  
  1156.  
  1157.  
  1158. Call:         lputch(char);
  1159.  
  1160.               char  =  the character to be printed.
  1161.  
  1162. Return:       printer status
  1163.                  bit 0 = timeout occurred
  1164.                  bit 1 = [unused]
  1165.                  bit 2 = [unused]
  1166.                  bit 3 = I/O error
  1167.                  bit 4 = selected
  1168.                  bit 5 = out of paper
  1169.                  bit 6 = acknowledge
  1170.                  bit 7 = not busy
  1171.  
  1172.  
  1173. Example:      main()
  1174.               {
  1175.                  char a;
  1176.  
  1177.                  a = 'x';
  1178.                  lputch(a);      /* print the letter 'x' on the printer */
  1179.                                  /*  at the current print head location */
  1180.               }
  1181.  
  1182.  
  1183.  
  1184. E
  1185.      Unicorn Library Documentation  3.1                         page 90
  1186.  
  1187.      ___________________________________________________________________
  1188.  
  1189.                                lsthpos
  1190. F
  1191.  
  1192.      Returns the last horizontal position when a button was pressed.
  1193.  
  1194.      Call: lsthpos(which);
  1195.  
  1196.      Where:
  1197.             which = 0 for last left button press
  1198.                     1 for last right button press
  1199.  
  1200.      Example:
  1201.  
  1202.   main()
  1203.   {
  1204.     printf("The position was %d on the last left button press", lsthpos(0));
  1205.   }
  1206.  
  1207.  
  1208.  
  1209. E
  1210.      Unicorn Library Documentation  3.1                         page 91
  1211.  
  1212.      ___________________________________________________________________
  1213.  
  1214.                                lsthrpos
  1215. F
  1216.  
  1217.      Returns the last horizontal position when a button was released.
  1218.  
  1219.      Call: lsthrpos(which);
  1220.  
  1221.      Where:
  1222.             which = 0 for last left button press
  1223.                     1 for last right button press
  1224.  
  1225.      Example:
  1226.  
  1227.         main()
  1228.         {
  1229.           printf("The position was %d on the last");
  1230.           printf(" left button release", lsthrpos(0));
  1231.         }
  1232.  
  1233.  
  1234.  
  1235. E
  1236.      Unicorn Library Documentation  3.1                         page 92
  1237.  
  1238.      ___________________________________________________________________
  1239.  
  1240.                                lstvpos
  1241. F
  1242.  
  1243.      Returns the last vertical position when a button was pressed.
  1244.  
  1245.      Call: lstvpos(which);
  1246.  
  1247.      Where:
  1248.             which = 0 for last left button press
  1249.                     1 for last right button press
  1250.  
  1251.      Example:
  1252.  
  1253.         main()
  1254.         {
  1255.           printf("The position was %d on the last");
  1256.           printf(" left button press", lstvpos(0));
  1257.         }
  1258.  
  1259.  
  1260.  
  1261. E
  1262.      Unicorn Library Documentation  3.1                         page 93
  1263.  
  1264.      ___________________________________________________________________
  1265.  
  1266.                                lstvrpos
  1267. F
  1268.  
  1269.      Returns the last vertical position when a button was released.
  1270.  
  1271.      Call: lstvrpos(which);
  1272.  
  1273.      Where:
  1274.             which = 0 for last left button press
  1275.                     1 for last right button press
  1276.  
  1277.      Example:
  1278.  
  1279.         main()
  1280.         {
  1281.           printf("The position was %d on the last");
  1282.           printf(" left button release", lstvrpos(0));
  1283.         }
  1284.  
  1285.  
  1286.  
  1287. E
  1288.      Unicorn Library Documentation  3.1                         page 94
  1289.  
  1290.      ___________________________________________________________________
  1291.  
  1292.                                LT_GAL
  1293. F
  1294.  
  1295.      Converts liters to gallons.  Defined as a macro in UC.H.
  1296.  
  1297.      Call: LT_GAL(liters);
  1298.  
  1299.  
  1300.      Example:
  1301.  
  1302.         main()
  1303.         {
  1304.           printf("There are %lf gallons in %lf liters", LT_GAL(67.8), 67.8);
  1305.         }
  1306.  
  1307.  
  1308.  
  1309. E
  1310.      Unicorn Library Documentation  3.1                         page 95
  1311.  
  1312.      ___________________________________________________________________
  1313.  
  1314.                                lvjoystk
  1315. F
  1316.  
  1317.      Returns the left vertical position of the joystick.
  1318.  
  1319.  
  1320.      Call: lvjoystk();
  1321.  
  1322.  
  1323.      Example:
  1324.  
  1325.         main()
  1326.         {
  1327.           printf("The joystick vertical position is %d", lvjoystk());
  1328.         }
  1329.  
  1330.  
  1331.  
  1332. Unicorn 1 Documentation  3.1                                      page 96
  1333.  
  1334. __________________________________________________________________________
  1335.  
  1336.  
  1337.                               memsize
  1338.  
  1339.  
  1340. Returns an integer containing the number of kilobytes of memory installed.
  1341.  
  1342.  
  1343.  
  1344.  
  1345. Call:         memsize();
  1346.  
  1347.  
  1348.  
  1349.  
  1350.  
  1351.  
  1352. Example:      main()
  1353.               {
  1354.                  int a;
  1355.                  a = memsize(); /* get kilobytes of memory */
  1356.               }
  1357.  
  1358.  
  1359.  
  1360. E
  1361.      Unicorn Library Documentation  3.1                         page 97
  1362.  
  1363.      ___________________________________________________________________
  1364.  
  1365.                                mgun
  1366. F
  1367.  
  1368.      Produces a popping machine gun type sound.
  1369.  
  1370.      Call: mgun();
  1371.  
  1372.  
  1373.      Example:
  1374.  
  1375.         main()
  1376.         {
  1377.           mgun();
  1378.         }
  1379.  
  1380.  
  1381.  
  1382. E
  1383.      Unicorn Library Documentation  3.1                         page 98
  1384.  
  1385.      __________________________________________________________________
  1386.  
  1387.                                moveto
  1388.  
  1389. F     Moves the turtle pen to an absolute pixel location without
  1390.      drawing.
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.      Call:   moveto(col, row);
  1397.  
  1398.              col  =  the new column coordinate
  1399.              row  =  the new row coordinate
  1400.  
  1401.  
  1402.  
  1403.      Example:   main()
  1404.                 {
  1405.                    sm(4);  /* set the graphics mode  */
  1406.  
  1407.                    /*  move the turtle pen to 100, 30 */
  1408.                    moveto(100, 30);
  1409.                  }
  1410.  
  1411.  
  1412.  
  1413. E
  1414.      Unicorn Library Documentation  3.1                         page 99
  1415.  
  1416.      ___________________________________________________________________
  1417.  
  1418.                                mreset
  1419. F
  1420.  
  1421.      Checks to see if the mouse driver is installed.  Returns 0 if NOT
  1422.      installed or -1 if mouse IS installed.
  1423.  
  1424.      Call: mreset();
  1425.  
  1426.  
  1427.      Example:
  1428.  
  1429.         main()
  1430.         {
  1431.            if (mreset() == 0)
  1432.               then printf("There is no mouse installed - Boo-Hoo!");
  1433.            else printf("Hooray, the mouse is present!");
  1434.         }
  1435.  
  1436.  
  1437.  
  1438. E
  1439.      Unicorn Library Documentation  3.1                         page 100
  1440.  
  1441.      __________________________________________________________________
  1442.  
  1443.                               msize
  1444.  
  1445.      Returns the current memory size in kilobytes.
  1446.  
  1447.  
  1448. F
  1449.  
  1450.  
  1451.      Call:   msize();
  1452.  
  1453.  
  1454.  
  1455.      Example:
  1456.               main()
  1457.               {
  1458.                  printf("There are %d KBytes of memory", msize());
  1459.               }
  1460.  
  1461.  
  1462.  
  1463. E
  1464.      Unicorn Library Documentation  3.1                         page 101
  1465.  
  1466.      __________________________________________________________________
  1467.  
  1468.                              OZ_GM
  1469.  
  1470.      Converts ounces to grams.  Defined as a macro in UC.H.
  1471.  
  1472.  
  1473. F
  1474.  
  1475.  
  1476.      Call:   OZ_GM(ounces);
  1477.  
  1478.  
  1479.  
  1480.      Example:
  1481.            main()
  1482.            {
  1483.               printf("There are %lf ounces in %lf grams", OZ_GM(53.8), 53.8);
  1484.            }
  1485.  
  1486.  
  1487.  
  1488. E
  1489.      Unicorn Library Documentation  3.1                         page 102
  1490.  
  1491.      __________________________________________________________________
  1492.  
  1493.                                note
  1494.  
  1495. F                         Tandy 1000 only
  1496.  
  1497.      Plays a musical tone on the internal speaker.  This function
  1498.      includes all sharps and flats and a total of 7 octaves.  The user
  1499.      is given access to all three voices and full control over the
  1500.      volume.
  1501.      Future versions will include duration for added control over the
  1502.      note.
  1503.  
  1504.  
  1505.  
  1506.  
  1507.      Call:   note(voice, octave, note, volume);
  1508.  
  1509.              voice   =  1, 2, or 3 ( selects sound channel)
  1510.              octave  =  1 - 7 with 1 being the lowest
  1511.              note    =  note from below table
  1512.              volume  =  0 (off) to 15 (loudest)
  1513.  
  1514.              A  - 1      octave 3 contains middle C
  1515.              A# - 2
  1516.              B  - 3
  1517.              C  - 4
  1518.              C# - 5
  1519.              D  - 6
  1520.              D# - 7
  1521.              E  - 8
  1522.              F  - 9
  1523.              G  - 10
  1524.              G# - 11
  1525.  
  1526.  
  1527.  
  1528. E
  1529.      Unicorn Library Documentation  3.1                         page 103
  1530.  
  1531.      __________________________________________________________________
  1532.  
  1533.                                paint
  1534.  
  1535. F     Fills an area containing a seed point and bounded by a single color
  1536.      with a specified color.
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.      Call:   paint(column, row, paintc, boundry);
  1543.  
  1544.              column   =  column coordinate of seed point inside boundry
  1545.              row      =  row coordinate of seed point inside boundry
  1546.              paintc   =  color to paint the enclosed region
  1547.              boundry  =  color of the boundry to the region to fill
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.      Example:   main()
  1554.                 {
  1555.                    sm(4);  /* set graphics mode  */
  1556.                    /* draw a circle */
  1557.                    circle(100,100,50,1,1,3);
  1558.                    /* paint the circle (watch the border color! */
  1559.                    paint(100,100,2,3);
  1560.                 }
  1561.  
  1562.  
  1563. E
  1564.      Unicorn Library Documentation  3.1                         page 104
  1565.  
  1566.      __________________________________________________________________
  1567.  
  1568.                                palette
  1569.  
  1570. F                             IBM-PC only
  1571.  
  1572.      Changes the palette or color set to be used on an IBM-PC.
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.      Call:   palette(a, b, c);
  1579.  
  1580.              a  =  the palette number (0 to 3)
  1581.              b  =  mode ( 4-normal,  5- extra or highlighted color sets)
  1582.              c  =  background color
  1583.  
  1584.  
  1585.  
  1586.      Example:  main()
  1587.                {
  1588.                   sm(4);  /* set the graphics mode */
  1589.                   /* set the color set to highlighted palette 2 with a
  1590.                      blue background.                                 */
  1591.                   palette(2, 5, 1);
  1592.                }
  1593.  
  1594.  
  1595.  
  1596. E
  1597.      Unicorn Library Documentation  3.1                         page 105
  1598.  
  1599.      __________________________________________________________________
  1600.  
  1601.                              pcurpos
  1602.  
  1603.      Puts the cursor at a specific screen location.
  1604.  
  1605.  
  1606. F
  1607.  
  1608.  
  1609.      Call:   pcurpos(row, col, page);
  1610.  
  1611.      Where:
  1612.              row  = desired cursor row
  1613.              col  = desired cursor column
  1614.              page = desired cursor page.
  1615.  
  1616.  
  1617.      Example:
  1618.            main()
  1619.            {
  1620.               pcurpos(20, 40, 0); /* place the cursor at row 20, column
  1621.                                      40 on video page 0.  */
  1622.            }
  1623.  
  1624.  
  1625.  
  1626. E
  1627.      Unicorn Library Documentation  3.1                         page 106
  1628.  
  1629.      __________________________________________________________________
  1630.  
  1631.                                pencolor
  1632.  
  1633. F     Sets the turtle graphics pen color.
  1634.  
  1635.  
  1636.  
  1637.  
  1638.  
  1639.  
  1640.  
  1641.      Call:    pencolor(color);
  1642.  
  1643.               color  =  the pen color to use.  may be 0-3 for IBM or
  1644.                         0-16 for Tandy 1000
  1645.  
  1646.  
  1647.  
  1648.      Example:   main()
  1649.                 {
  1650.                    sm(4);  /*  set graphics mode  */
  1651.                    /* change pen color to 3 */
  1652.                    pencolor(3);
  1653.                 }
  1654.  
  1655.  
  1656. E
  1657.      Unicorn Library Documentation  3.1                         page 107
  1658.  
  1659.      __________________________________________________________________
  1660.  
  1661.                                pendown
  1662.  
  1663. F      Places the turtle graphics "pen down" on the screen so that it
  1664.      may draw.
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670.      Call:   pendown();
  1671.  
  1672.  
  1673.  
  1674.  
  1675.  
  1676.      Example:   main()
  1677.                 {
  1678.                    sm(4);  /*  set the graphics mode */
  1679.                    /* place the pen down in preperation for drawing */
  1680.                    pendown();
  1681.                 }
  1682.  
  1683. E
  1684.      Unicorn Library Documentation  3.1                         page 108
  1685.  
  1686.      __________________________________________________________________
  1687.  
  1688.                                penup
  1689.  
  1690. F     Lift the pen up so that it may be moved without drawing.
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.      Call:  penup();
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.      Example:   main()
  1703.                 {
  1704.                    sm(4);  /* set the graphics mode  */
  1705.                    /* lift up the pen */
  1706.                    penup();
  1707.                 }
  1708.  
  1709.  
  1710. Unicorn 1 Documentation  3.1                                     page 109
  1711.  
  1712. __________________________________________________________________________
  1713.  
  1714.  
  1715.                               phasor
  1716.  
  1717.  
  1718. Make a phasor sound.
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724. Call:         phasor();
  1725.  
  1726.  
  1727.  
  1728.  
  1729. Example:      main()
  1730.               {
  1731.                  phasor(); /* make phasor sound */
  1732.               }
  1733.  
  1734.  
  1735.  
  1736.  
  1737. E
  1738.      Unicorn Library Documentation  3.1                         page 110
  1739.  
  1740.      __________________________________________________________________
  1741.  
  1742.                              playibm
  1743.  
  1744. F
  1745.      Plays tones on an IBM or compatible speaker.  It produces only a
  1746.      single tone.  Octave 3 contains middle C.  All octaves are defined
  1747.      for A through G#.
  1748.  
  1749.  
  1750.  
  1751.      Call:   playibm(note, octave, time);
  1752.  
  1753.      Where:
  1754.             note    = the note number from the below table
  1755.                       A,  A#,  B,  C,  C#,  D,  D#,  E,  F,  F#,  G,  G#
  1756.                       1,   2,  3,  4,   5,  6,   7,  8,  9,  10, 11,  12
  1757.             octave  = octave from 1 to 8 starting from the lowest octave
  1758.             time    = the time of the tone in milliseconds
  1759.  
  1760.      Example:
  1761.            main()
  1762.            {
  1763.               play(4,3,500); /* play middle C for .5 seconds */
  1764.            }
  1765.  
  1766.  
  1767.  
  1768. E
  1769.      Unicorn Library Documentation  3.1                         page 111
  1770.  
  1771.      __________________________________________________________________
  1772.  
  1773.                                point
  1774.  
  1775. F     Light up a single pixel in a specified color.
  1776.  
  1777.  
  1778.  
  1779.  
  1780.      Call:  point(column, row, color);
  1781.  
  1782.             column  =  the pixel column
  1783.             row     =  the pixel row
  1784.             color   =  color to light the pixel
  1785.  
  1786.  
  1787.  
  1788.      Example:    main()
  1789.                  {
  1790.                     sm(4);  /*  set the graphics mode  */
  1791.                     /*  light the pixel at 110,110 in color 3 */
  1792.                     point(110, 110, 3);
  1793.                  }
  1794.  
  1795.  
  1796.