home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / OTL-BBU2.DMS / in.adf / Elmore / ElmoreLibs.DOC < prev    next >
Encoding:
Text File  |  1994-04-04  |  17.4 KB  |  645 lines

  1.   Library names: FUNCTIONS.ElmoreLib
  2.                  HARDWARE.Elmorelib
  3.                  MATH.ElmoreLib
  4.                  SYS.ElmoreLib
  5.  
  6. Library Numbers: 101, 103, 105 and 107, respectively
  7.      Written by: Richard T. Elmore
  8.       Copyright: 1994 HeadSoft Software
  9.  
  10.  
  11.  
  12.  
  13. ******************************************************************************
  14. ***************************** HARDWARE PROGRAMMING ***************************
  15. ******************************************************************************
  16.  
  17.  
  18.  
  19.  
  20.  
  21. Statement: QUIET 
  22. ****************
  23.      Syntax: Quiet ChannelMask 
  24.       Modes: Amiga or Blitz
  25. Description: 
  26. This command will silence the sound channels specified by ChannelMask.
  27. See the description for "Envelope" for more information on channelmasks.
  28.  
  29.  
  30. Statement: FREQ
  31. ***************
  32.      Syntax: Freq Channelmask,period
  33.       Modes: Amiga or Blitz
  34. Description:
  35. This command allows you to change the period, or pitch, of the
  36. currently playing sound effect.  Note that the lower the period,
  37. the higher the frequency; Thus, a period of 100 would be very
  38. high-pitched, whereas a period of 30000 would be low-pitched.
  39.  
  40.  
  41.  
  42.  
  43. Function: TICKS 
  44. ***************
  45.      Syntax: n=Ticks
  46.       Modes: Amiga or Blitz
  47. Description: 
  48. This function returns the number of "ticks" since the Amiga was switched
  49. on, or since the last "RESETTIMER" command.  The unit of measurement is
  50. 1/60 of a second for NTSC machines, and 1/50 of a second for PAL machines.
  51.  See Also:
  52.  ResetTimer
  53.  
  54.  
  55.  
  56.  
  57. Statement: RESETTIMER 
  58. *********************
  59.      Syntax: ResetTimer  
  60.       Modes: Amiga or Blitz
  61. Description: 
  62. Resets the Amiga's hardware timer to zero "ticks."  Read the description
  63. for "TICKS" for more information.
  64.  
  65.  
  66. Function: JOYC 
  67. **************
  68.      Syntax: n=JoyC (Port)
  69.       Modes: Amiga or Blitz
  70. Description: 
  71. This function works similarly to the JoyB() function, however it allows
  72. you to read the second fire button on two-button joysticks.  It will
  73. return a 1 if the normal fire button is pressed, a 2 if the second button
  74. is pressed, or 3 if both buttons are pressed.  Otherwise, it will return
  75. a zero (no buttons pressed.)
  76.  
  77.  
  78.  
  79. Statement: VWAITPOS 
  80. *******************
  81.      Syntax: VWaitPos RasterLine
  82.       Modes: Amiga or Blitz
  83. Description:
  84. This command is similar to VWAIT, except it allows you to wait for
  85. any raster position, not just the top of the display.  This is useful
  86. for interesting graphics effects.
  87.  
  88.  
  89.  
  90. Function: CHECKAGA
  91. ******************
  92.      Syntax: n=CheckAGA
  93.       Modes: Amiga or Blitz
  94. Description: 
  95. Returns 'TRUE' for AGA machines, otherwise returns 'FALSE.'
  96. Using ExecVersion alone will not detect an AGA machine.  Kickstart version
  97. 39 can and does run on pre-AGA machines, such as the A3000, etc.  Therefore,
  98. this function is provided to allow you to accurately determine if the
  99. AGA chipset is present.
  100.  
  101.  
  102.  
  103.  
  104. Function: PEEKTO$ 
  105. *****************
  106.      Syntax: n$=PeekTo$ (Address,byte)
  107.       Modes: Amiga or Blitz
  108. Description: 
  109. PeekTo$() is similar to the Peek$() function, except you can specify
  110. what terminator byte to use.  With Peek$() the terminator will always
  111. be zero, but PeekTo$() will accept any byte value as a terminator.
  112.  
  113.  
  114.  
  115. Statement: FORCEPAL 
  116. *******************
  117.      Syntax: ForcePAL  
  118.       Modes: Amiga or Blitz
  119. Description: 
  120. This command switches the current screen from NTSC to PAL.
  121.  
  122.  
  123.  
  124. Statement: FORCENTSC 
  125. ********************
  126.      Syntax: ForceNTSC  
  127.       Modes: Amiga or Blitz
  128. Description: 
  129. This command switches the current screen from PAL to NTSC.
  130.  
  131.  
  132.  
  133. Function: DEPTH 
  134. ***************
  135.      Syntax: n=Depth (Bitmap#)
  136.       Modes: Amiga or Blitz
  137. Description: 
  138. This function returns the depth of the specified Blitz2 bitmap object.
  139.  
  140.  
  141.  
  142. Statement: CLICKMOUSE 
  143. *********************
  144.      Syntax: ClickMouse  
  145.       Modes: Amiga or Blitz
  146. Description: 
  147. Similar to Mousewait, this command halts program execution until
  148. the user clicks the mouse.  There must must be a separate mouseclick
  149. for each CLICKMOUSE command, unlike Mousewait, which will continue
  150. through without pausing if the left mouse button was already being
  151. pressed.    NOTE:  Avoid using this command in Amiga mode, as it
  152. seriously degrades multitasking.
  153.  
  154.  
  155.  
  156. Function: CHIPFREE
  157. ******************
  158.      Syntax: n=ChipFree
  159.       Modes: Amiga or Blitz
  160. Description: 
  161. This function will return the size, in bytes, of the largest block
  162. of free CHIP memory in your system.
  163.  See Also:
  164.  FastFree
  165.  LargestFree
  166.  
  167.  
  168.  
  169. Function: FASTFREE 
  170. ******************
  171.      Syntax: n=FastFree
  172.       Modes: Amiga or Blitz
  173. Description: 
  174. This function returns the size of the largest block of FAST memory.
  175.  
  176.  
  177.  
  178. Function: LARGESTFREE 
  179. *********************
  180.      Syntax: n=LargestFree
  181.       Modes: Amiga or Blitz
  182. Description: 
  183. This function will return the size of the largest chunk of memory
  184. available.  This memory may be FAST or CHIP, depending on your system.
  185.  
  186.  
  187.  
  188.  
  189.  
  190. ******************************************************************************
  191. ***************************** MATH/NUMERIC FUNCTIONS *************************
  192. ******************************************************************************
  193.  
  194.  
  195.  
  196. Function: XOR
  197. *************
  198.      Syntax: n=Xor (expression,expression)
  199.       Modes: Amiga or Blitz
  200. Description: 
  201. Returns Exclusive OR of two expressions
  202. This function returns the "exclusive-OR" or the two supplied arguments.
  203. For example, Xor(255,170) will return 85, and Xor(-1) will return 0.
  204.  
  205.  
  206.  
  207. Function: LARGEST.L 
  208. *******************
  209.      Syntax: n=Largest.l (Long Integer1,Long Integer2)
  210.       Modes: Amiga or Blitz
  211. Description:
  212. This function will return the larger of the two supplied long integers.
  213. For example, Largest.l(255,20045) would return 20045.
  214.  
  215.  
  216. Function: SMALLEST.L 
  217. ********************
  218.      Syntax: n=Smallest.l (Long Integer1,Long Integer2)
  219.       Modes: Amiga or Blitz
  220. Description:
  221. This function will return the smaller of two supplied long integers.
  222. For example, Smallest.l(-999,5) would return -999.
  223.  
  224.  
  225. Function: LARGEST.Q 
  226. *******************
  227.      Syntax: n=Largest.q (Quick1,Quick2)
  228.       Modes: Amiga or Blitz
  229. Description:
  230. Identical to the function "Largest.l" (above) except that it accepts
  231. quick-type variables or expressions.
  232.  
  233.  
  234. Function: SMALLEST.Q 
  235. ********************
  236.      Syntax: n=Smallest.q (Quick1,Quick2)
  237.       Modes: Amiga or Blitz
  238. Description:
  239. Identical to "Smallest.q" but uses quick-types.
  240.  
  241.  
  242. Function: LARGEST 
  243. *****************
  244.      Syntax: n=Largest (Integer1,Integer2)
  245.       Modes: Amiga or Blitz
  246. Description:
  247. This is the fastest "Largest()" function.  Note that if passed floats
  248. or quick-types, the fraction will be cut off.  See description for
  249. Largest.l() and Largest.q().
  250.  
  251.  
  252. Function: SMALLEST 
  253. ******************
  254.      Syntax: n=Smallest (Integer1,Integer2)
  255.       Modes: Amiga or Blitz
  256. Description:
  257. Like Smallest.l() and Smallest.q(), above, with less accuracy, but
  258. faster than the long-integer and quick-type versions.
  259.  
  260.  
  261.  
  262. Function: AVG.L 
  263. ***************
  264.      Syntax: n=Avg.l (Long Integer 1,Long Integer 2)
  265.       Modes: Amiga or Blitz
  266. Description:
  267. This function will return the average of two long-integers (although
  268. the fraction is cut off.)  Thus, Avg.l(5,15)=10, and Avg.l(1,2)=1.
  269. (Since fractions will be cut off with this function, you may wish to
  270. use the quick-type version of this function for more accuracy.)
  271.  
  272.  
  273. Function: AVG.Q 
  274. ***************
  275.      Syntax: n=Avg.q (Quick1,Quick2)
  276.       Modes: Amiga or Blitz
  277. Description:
  278. See the description for "Avg.l()" (above)
  279.  
  280.  
  281. Function: AVG 
  282. *************
  283.      Syntax: n=Avg (Integer1,Integer2)
  284.       Modes: Amiga or Blitz
  285. Description:
  286. See the description for "Avg.l()" (above)
  287. This version is the fastest Avg() function available.
  288.  
  289.  
  290.  
  291. Statement: RRANDOMIZE 
  292. *********************
  293.      Syntax: RRandomize Seed
  294.       Modes: Amiga or Blitz
  295. Description:
  296. Given a float-type expression or variable, RRandomize will "seed" the
  297. reproducible random number generator.  The sequence of pseudo-random
  298. numbers produced by "RRND" will be the same for each seed given it.
  299. If you require trully random numbers, try "RRandomize Ticks."
  300.  
  301.  
  302. Function: RRND 
  303. **************
  304.      Syntax: n=RRnd (Low,High)
  305.       Modes: Amiga or Blitz
  306. Description:
  307. Given a range such as (1,6) this function will return a random number
  308. based on the seed given it by "RRandomize."  These sets of "random"
  309. numbers can be repeated if you provide the same seed.  This can be
  310. useful in games, etc. so that using "RRandomize Level#" and then using
  311. the RRnd() function to randomly draw the screen, each time the player
  312. returns to that particular level, it will be the same.
  313.  
  314.  
  315.  
  316. *****************************************************************************
  317. ********************************* ARRAY FUNCTIONS ****************************
  318. *****************************************************************************
  319.  
  320.  
  321.  
  322. Function: INDEX
  323. ***************
  324.      Syntax: n=Index List()
  325.       Modes: Amiga or Blitz
  326. Description: 
  327. Returns index from top of LIST
  328. This function will return the current index number of the supplied
  329. List() array passed to it.  For example, if the list pointer is currently
  330. at item 10 in the list, Index would return 10.
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337. ******************************************************************************
  338. ***************************** INTUITION PROGRAMMING **************************
  339. ******************************************************************************
  340.  
  341.  
  342.  
  343.  
  344. Statement or Function: REQUEST 
  345. ******************************
  346.      Syntax: Request "Title","Text Line|Text Line","Gadget1|Gadget2..."
  347.              n=Request "Title","Text Line|Text Line","Gadget1|Gadget2..."
  348.  
  349.       Modes: Amiga
  350.  
  351. ***************************************************************************
  352. *  This command is 2.0-specific.  If you're still using 1.3, this command *
  353. *  will be unavailable to you.                                            *
  354. ***************************************************************************
  355.  
  356. Description:
  357. "Request" can be used as both a command or a function.  You may
  358. provide an optional title (or "" for default window title) a string
  359. of text (separated by pipes "|" for each line) and a string containing
  360. text for gadgets within the requester.  (Separate with "|" if you
  361. need more than one.)
  362. Used as a command, it merely displays the requester on the current
  363. screen and waits for the user to click a gadget.  As a function, it
  364. will also return a number corresponding to the gadget selected.
  365. The gadget on the right should be reserved for negative responses
  366. such as "CANCEL" or "NO" and will always return zero.  Other gadgets
  367. will return values in the order that they appear, beginning with
  368. 1 for the first gadget, 2 for the next, etc.
  369.  
  370.  
  371.  
  372. Function: ACTIVESCREEN 
  373. **********************
  374.      Syntax: n=ActiveScreen
  375.       Modes: Amiga
  376. Description: 
  377. This function returns ADDRESS of current Intuition screen.  This is
  378. useful with many Intuition library commands, or to find out information
  379. about the currently active screen.
  380.  
  381.  
  382.  
  383. Function: SCREENWIDTH 
  384. *********************
  385.      Syntax: n=ScreenWidth
  386.       Modes: Amiga
  387. Description: 
  388. This function returns the pixelwidth of the currently active screen.
  389.  
  390.  
  391. Function: SCREENHEIGHT 
  392. **********************
  393.      Syntax: n=ScreenHeight
  394.       Modes: Amiga
  395. Description: 
  396. This function returns the pixelheight of the active screen
  397.  
  398.  
  399. Function: ACTIVEWINDOW 
  400. **********************
  401.      Syntax: n=ActiveWindow
  402.       Modes: Amiga
  403. Description: 
  404. This function returns the address of the current window.
  405. This address is mainly used in conjunction with Intuition library
  406. commands.
  407.  
  408.  
  409.  
  410. Statement or Function: WAITFOR 
  411. ******************************
  412.      Syntax: WaitFor IDCMP Code
  413.              n=WaitFor (IDCMP Code)
  414.  
  415.       Modes: Amiga
  416. Description: 
  417. Similar to WaitEvent, WAITFOR puts the Amiga to "sleep" until a specified
  418. IDCMP code wakes it up.  For example, WaitFor $400 would wait until the
  419. user strikes a key, and WaitFor $8 would wait until the "close" gadget
  420. of the current window was clicked on.  These IDCMP codes are additive,
  421. so WaitFor $408 would wait until either the "close" gadget was selected,
  422. or a key was pressed.  Refer to the section on "windows" in the Blitz2
  423. Reference Manual for more information on IDCMP codes.
  424.  
  425.  
  426.  
  427. Statement: SHOWREQUESTERS 
  428. *************************
  429.      Syntax: ShowRequesters OPTION
  430.       Modes: Amiga or Blitz
  431. Description:
  432.  
  433. OPTIONS:  0=Cancel all requesters
  434.           1=Show requesters on Workbench Screen
  435.           2=Direct requesters to current window
  436.  
  437. This command allows you to force system requesters like "Please insert
  438. volume Foo in any drive" etc. to either be turned off, directed to the
  439. workbench, or directed to the current window.  When requesters are turned
  440. off, the system will behave as if the "CANCEL" gadget was selected for
  441. each requester that would otherwise have been displayed.  Be sure to
  442. re-activate requesters before exiting your program!
  443.  
  444.  
  445.  
  446. ******************************************************************************
  447. ********************************** STRING HANDLING ***************************
  448. ******************************************************************************
  449.  
  450.  
  451.  
  452.  
  453.  
  454. Function: CHECKSUM 
  455. ******************
  456.      Syntax: n=Checksum (String$)
  457.       Modes: Amiga or Blitz
  458. Description: 
  459. Given a string, Checksum() will return a unique 32-bit integer as
  460. a checksum, useful in situations such as serial transfers, etc. to
  461. ensure both parties have the same data.
  462.  
  463.  
  464.  
  465.  
  466.  
  467. Function: CHARCOUNT 
  468. *******************
  469.      Syntax: n=CharCount (String$,byte)
  470.       Modes: Amiga or Blitz
  471. Description: 
  472. This function will return the number of occurances of a given byte
  473. within a string.  For example, CharCount(text$,32) will count the
  474. number of spaces in text$.
  475.  
  476.  
  477.  
  478. Function: SEARCHBEGIN 
  479. *********************
  480.      Syntax: n=SearchBegin (String$,byte,# from Begin)
  481.       Modes: Amiga or Blitz
  482. Description: 
  483. Similar to Instr(), SearchBegin will search the given string
  484. for the specified byte.  For example, SearchBegin(a$,32,1)
  485. will return the character position of the first space in a$,
  486. while SearchBegin(a$,32,3) will return the position of the
  487. third space.  If the byte is not found in the string, SearchBegin
  488. will return a zero.
  489.  
  490.  
  491.  
  492. Function: SEARCHEND
  493. *******************
  494.      Syntax: n=SearchEnd (String$,byte,# from End)
  495.       Modes: Amiga or Blitz
  496. Description:
  497. Like SearchBegin() (above) except it searches from the end of
  498. the string to the front.  For example, SearchBegin(a$,asc("A"),2)
  499. will return the character position of the second-from-last letter
  500. "A" in the string 'a$.'
  501.  
  502.  
  503. Function: CIPHER$ 
  504. *****************
  505.      Syntax: n=Cipher$ (String$)
  506.       Modes: Amiga or Blitz
  507. Description: 
  508. The Cipher$() function will encrypt or decrypt a string passed to it.
  509. This is especially handy if you don't want users "zapping" your executeable
  510. or data files to read it's contents.  Note that Cipher$() can only
  511. decrypt strings previously created with Cipher$().
  512.  
  513.  
  514.  
  515. Function: NULL
  516. ******************
  517.      Syntax: n=Null (String$)
  518.       Modes: Amiga or Blitz
  519. Description: 
  520. Many Amiga shared libraries (like the DOS library) require addresses
  521. of null-terminated strings as arguments.  This function will return
  522. a long-integer address of a null-terminated string in memory for such
  523. commands.
  524.  
  525.  
  526.  
  527. Function: REPEATS 
  528. *****************
  529.      Syntax: n=Repeats (String$)
  530.       Modes: Amiga or Blitz
  531. Description: 
  532. This function will return the number of repeated bytes at the
  533. beginning of your string.  Thus, Repeats("...Test") would return 3,
  534. while Repeats("Example") would return 1.  If the string is null,
  535. Repeats() will return zero.
  536.  
  537.  
  538. Function: SPACE$
  539. ****************
  540.      Syntax: n$=SPACE$ (number of spaces)
  541.       Modes: Amiga or Blitz
  542. Description:
  543. This function is identical to the Space$ function in many other dialects
  544. of BASIC.  It will return a string containing the desired number of
  545. spaces, making it easier to align tables etc. to the screen or printer.
  546.  
  547.  
  548. Function: Hex#
  549. **************
  550.      Syntax: n=Hex#(HexString$)
  551.       Modes: Amiga or Blitz
  552. Description:
  553. This function accepts a hexadecimal value stored in a string and returns
  554. the decimal value.
  555.  
  556.  
  557.  
  558. Function: Bin#
  559. **************
  560.      Syntax: n=Bin#(BinString$)
  561.       Modes: Amiga or Blitz
  562. Description:
  563. This function accepts a binary value stored in a string and returns
  564. the decimal value.
  565.  
  566.  
  567.  
  568.  
  569.  
  570. ******************************************************************************
  571. ***************************** LIBRARY PROGRAMMING ****************************
  572. ******************************************************************************
  573.  
  574.  
  575. These functions will return the base address of their respective libraries,
  576. for advanced system programming.  Note that register A6 will also be
  577. loaded with this address, to make programming a bit easier for assembly
  578. routines.
  579.  
  580.  
  581.  
  582. Function: INTUITIONBASE 
  583. ***********************
  584.      Syntax: n=IntuitionBase
  585.       Modes: Amiga or Blitz
  586. Description: 
  587. Returns Intuition Library base
  588.  
  589.  
  590. Function: DOSBASE 
  591. *****************
  592.      Syntax: n=DosBase
  593.       Modes: Amiga or Blitz
  594. Description: 
  595. Returns DOS Library base
  596.  
  597.  
  598. Function: GRAPHICSBASE 
  599. **********************
  600.      Syntax: n=GraphicsBase
  601.       Modes: Amiga or Blitz
  602. Description: 
  603. Returns Graphics Library base
  604.  
  605.  
  606. Function: FFPBASE 
  607. *****************
  608.      Syntax: n=FFPBase
  609.       Modes: Amiga or Blitz
  610. Description: 
  611. Returns FFP Math Library base
  612.  
  613.  
  614. Function: DISKFONTBASE 
  615. **********************
  616.      Syntax: n=DiskFontBase
  617.       Modes: Amiga or Blitz
  618. Description: 
  619. Returns DiskFont Library base
  620.  
  621.  
  622. Function: COMMODITIESBASE 
  623. *************************
  624.      Syntax: n=CommoditiesBase
  625.       Modes: Amiga or Blitz
  626. Description: 
  627. Returns Commodities Library base
  628.  
  629.  
  630. Function: ICONBASE 
  631. ******************
  632.      Syntax: n=IconBase
  633.       Modes: Amiga or Blitz
  634. Description: 
  635. Returns Icon Library base
  636.  
  637.  
  638. Function: REXXSYSBASE 
  639. *********************
  640.      Syntax: n=RexxSysBase
  641.       Modes: Amiga or Blitz
  642. Description: 
  643. Returns RexxSys Library base
  644.  
  645.