home *** CD-ROM | disk | FTP | other *** search
/ A.C.E. 1 / ACE CD 1.iso / files / docs / blitzbad.lha / BlitzBasic2V1.3Part2.doc < prev    next >
Encoding:
Text File  |  1994-12-14  |  112.9 KB  |  3,443 lines

  1.  
  2.  
  3. Part Two
  4.  
  5. See Also:  RESETTIMER 
  6.  
  7.  
  8. Statement: RESETTIMER 
  9. --------------------------------------------------------------------------
  10. Syntax: ResetTimer  
  11. Modes: Amiga or Blitz
  12.  
  13. Resets the Amiga's hardware timer to zero "ticks." Read the description 
  14. for  TICKS  for more information.
  15.  
  16.  
  17. Function: JOYC 
  18. --------------------------------------------------------------------------
  19. Syntax: JoyC (Port)  
  20. Modes: Amiga or Blitz
  21.  
  22. This function works similarly to the JoyB() function, however it allows 
  23. you to read the second fire button on two-button joysticks.  It will 
  24. return a 1 if the normal fire button is pressed, a 2 if the second 
  25. button is pressed, or 3 if both buttons are pressed.  Otherwise, it will
  26. return a zero (no buttons pressed.)
  27.  
  28.  
  29. Statement: VWAITPOS 
  30. --------------------------------------------------------------------------
  31. Syntax: VWaitPos RasterLine
  32. Modes: Amiga or Blitz
  33.  
  34. This command is similar to VWAIT, except it allows you to wait for any 
  35. raster position, not just the top of the display.  This is useful for 
  36. interesting graphics effects.
  37.  
  38.  
  39. Function: CHECKAGA
  40. --------------------------------------------------------------------------
  41. Syntax: CheckAGA  
  42. Modes: Amiga or Blitz
  43.  
  44. Returns 'TRUE' for AGA machines, otherwise returns 'FALSE.' Using 
  45. ExecVersion alone will not detect an AGA machine.  Kickstart version 39
  46. can and does run on pre-AGA machines, such as the A3000, etc.  
  47. Therefore, this function is provided to allow you to accurately 
  48. determine if the AGA chipset is present.
  49.  
  50.  
  51. Function: PEEKTO$ 
  52. --------------------------------------------------------------------------
  53. Syntax: PeekTo$ (Address,byte)  
  54. Modes: Amiga or Blitz
  55.  
  56. PeekTo$() is similar to the Peek$() function, except you can specify
  57. what terminator byte to use.  With Peek$() the terminator will always
  58. be zero, but PeekTo$() will accept any byte value as a terminator.
  59.  
  60.  
  61. Statement: FORCEPAL 
  62. --------------------------------------------------------------------------
  63. Syntax: ForcePAL  
  64. Modes: Amiga or Blitz
  65.  
  66. This command switches the current screen from NTSC to PAL.
  67.  
  68.  
  69. Statement: FORCENTSC 
  70. --------------------------------------------------------------------------
  71. Syntax: ForceNTSC  
  72. Modes: Amiga or Blitz
  73.  
  74. This command switches the current screen from PAL to NTSC.
  75.  
  76.  
  77. Function: DEPTH 
  78. --------------------------------------------------------------------------
  79. Syntax: Depth (Bitmap#) 
  80. Modes: Amiga or Blitz
  81.  
  82. This function returns the depth of the specified Blitz2 bitmap object.
  83.  
  84.  
  85. Statement: CLICKMOUSE 
  86. --------------------------------------------------------------------------
  87. Syntax: ClickMouse  
  88. Modes: Amiga or Blitz
  89.  
  90. Similar to Mousewait, this command halts program execution until the 
  91. user clicks the mouse.  There must must be a separate mouseclick for 
  92. each CLICKMOUSE command, unlike Mousewait, which will continue through 
  93. without pausing if the left mouse button was already being pressed.    
  94.  
  95. NOTE:  Avoid using this command in Amiga mode, as it seriously degrades 
  96.        multitasking.
  97.  
  98.  
  99.  
  100. Function: CHIPFREE
  101. --------------------------------------------------------------------------
  102. Syntax: ChipFree 
  103. Modes: Amiga or Blitz
  104.  
  105. This function will return the size, in bytes, of the largest block of
  106. free CHIP memory in your system.
  107.  
  108. See Also:  FASTFREE , LARGESTFREE 
  109.  
  110.  
  111. Function: FASTFREE 
  112. --------------------------------------------------------------------------
  113. Syntax: FastFree 
  114. Modes: Amiga or Blitz
  115.  
  116. This function returns the size of the largest block of FAST memory.
  117.  
  118.  
  119. Function: LARGESTFREE 
  120. --------------------------------------------------------------------------
  121. Syntax: LargestFree 
  122. Modes: Amiga or Blitz
  123.  
  124. This function will return the size of the largest chunk of memory 
  125. available. This memory may be FAST or CHIP, depending on your system.
  126.  
  127.  
  128. Function: XOR
  129. --------------------------------------------------------------------------
  130. Syntax: Xor (expression,expression) 
  131. Modes: Amiga or Blitz
  132.  
  133. Returns Exclusive OR of two expressions This function returns the 
  134. "exclusive-OR" or the two supplied arguments. For example, Xor(255,170)
  135. will return 85, and Xor(-1) will return 0.
  136.  
  137.  
  138. Function: LARGEST.L 
  139. --------------------------------------------------------------------------
  140. Syntax: Largest.l (Long Integer1,Long Integer2)
  141. Modes: Amiga or Blitz
  142.  
  143. This function will return the larger of the two supplied long integers.
  144. For example, Largest.l(255,20045) would return 20045.
  145.  
  146.  
  147. Function: SMALLEST.L 
  148. --------------------------------------------------------------------------
  149. Syntax: Smallest.l (Long Integer1,Long Integer2)
  150. Modes: Amiga or Blitz
  151.  
  152. This function will return the smaller of two supplied long integers.
  153. For example, Smallest.l(-999,5) would return -999.
  154.  
  155.  
  156. Function: LARGEST.Q 
  157. --------------------------------------------------------------------------
  158. Syntax: Largest.q (Quick1,Quick2)
  159. Modes: Amiga or Blitz
  160.  
  161. Identical to the function  LARGEST.L  except that
  162. it accepts quick-type variables or expressions.
  163.  
  164.  
  165. Function: SMALLEST.Q 
  166. --------------------------------------------------------------------------
  167. Syntax: Smallest.q (Quick1,Quick2)
  168. Modes: Amiga or Blitz
  169.  
  170. Identical to  SMALLEST  but uses quick-types.
  171.  
  172.  
  173. Function: LARGEST 
  174. --------------------------------------------------------------------------
  175. Syntax: Largest (Integer1,Integer2)
  176. Modes: Amiga or Blitz
  177.  
  178. This is the fastest "Largest()" function.  Note that if passed floats
  179. or quick-types, the fraction will be cut off.  See description for
  180.  LARGEST.L  and  LARGEST.Q LARGESTQ}.
  181.  
  182.  
  183. Function: SMALLEST 
  184. --------------------------------------------------------------------------
  185. Syntax: Smallest (Integer1,Integer2)
  186. Modes: Amiga or Blitz
  187.  
  188. Like  SMALLEST.L  and  SMALLEST.Q SMALLESTQ}, with less accuracy, but faster than the long-integer and 
  189. quick-type versions.
  190.  
  191.  
  192. Function: AVG.L 
  193. --------------------------------------------------------------------------
  194. Syntax: Avg.l (Long Integer 1,Long Integer 2)
  195. Modes: Amiga or Blitz
  196.  
  197. This function will return the average of two long-integers (although
  198. the fraction is cut off.)  Thus, Avg.l(5,15)=10, and Avg.l(1,2)=1.
  199. (Since fractions will be cut off with this function, you may wish to
  200. use the quick-type version of this function for more accuracy.)
  201.  
  202.  
  203. Function: AVG.Q 
  204. --------------------------------------------------------------------------
  205. Syntax: Avg.q (Quick1,Quick2)
  206. Modes: Amiga or Blitz
  207.  
  208. See the description for  AVG.L .
  209.  
  210.  
  211. Function: AVG 
  212. --------------------------------------------------------------------------
  213. Syntax: Avg (Integer1,Integer2)
  214. Modes: Amiga or Blitz
  215.  
  216. See the description for  AVG.L .
  217. This version is the fastest Avg() function available.
  218.  
  219.  
  220. Statement: RRANDOMIZE 
  221. --------------------------------------------------------------------------
  222. Syntax: RRandomize Seed
  223. Modes: Amiga or Blitz
  224.  
  225. Given a float-type expression or variable, RRandomize will "seed" the
  226. reproducible random number generator.  The sequence of pseudo-random
  227. numbers produced by  RRND  will be the same for each 
  228. seed given it. If you require trully random numbers, try "RRandomize 
  229. Ticks."
  230.  
  231.  
  232. Function: RRND 
  233. --------------------------------------------------------------------------
  234. Syntax: RRnd (Low,High)
  235. Modes: Amiga or Blitz
  236.  
  237. Given a range such as (1,6) this function will return a random number
  238. based on the seed given it by  RRANDOMIZE   
  239. These sets of "random" numbers can be repeated if you provide the same
  240. seed.  This can be useful in games, etc. so that using "RRandomize 
  241. Level#" and then using the RRnd() function to randomly draw the screen,
  242. each time the player returns to that particular level, it will be the 
  243. same.
  244.  
  245.  
  246.  
  247.                               ELMORE ARRAY LIBRARY
  248.  
  249.  
  250. Function: INDEX
  251. --------------------------------------------------------------------------
  252. Syntax: Index List() 
  253. Modes: Amiga or Blitz
  254.  
  255. Returns index from top of LIST This function will return the current 
  256. index number of the supplied List() array passed to it.  For example, 
  257. if the list pointer is currently at item 10 in the list, Index would 
  258. return 10.
  259.  
  260.  
  261. Statement or Function: REQUEST 
  262. --------------------------------------------------------------------------
  263. Syntax: Request (Title$,Text$,GadgetText$)
  264. Modes: Amiga
  265.  
  266.  
  267. This command is 2.0-specific.  If you're still using 1.3, 
  268. this command will be unavailable to you.
  269.  
  270. "Request" can be used as both a command or a function.  You may
  271. provide an optional title (or "" for default window title) a string
  272. of text (separated by pipes "|" for each line) and a string containing
  273. text for gadgets within the requester.  (Separate with "|" if you
  274. need more than one.)
  275. Used as a command, it merely displays the requester on the current
  276. screen and waits for the user to click a gadget.  As a function, it
  277. will also return a number corresponding to the gadget selected.
  278. The gadget on the right should be reserved for negative responses
  279. such as "CANCEL" or "NO" and will always return zero.  Other gadgets
  280. will return values in the order that they appear, beginning with
  281. 1 for the first gadget, 2 for the next, etc.
  282.  
  283.  
  284. Function: ACTIVESCREEN 
  285. --------------------------------------------------------------------------
  286. Syntax: ActiveScreen
  287. Modes: Amiga
  288.  
  289. This function returns ADDRESS of current Intuition screen.  This is
  290. useful with many Intuition library commands, or to find out information
  291. about the currently active screen.
  292.  
  293.  
  294. Function: SCREENWIDTH 
  295. --------------------------------------------------------------------------
  296. Syntax: ScreenWidth  
  297. Modes: Amiga
  298.  
  299. This function returns the pixelwidth of the currently active screen.
  300.  
  301.  
  302. Function: SCREENHEIGHT 
  303. --------------------------------------------------------------------------
  304. Syntax: ScreenHeight  
  305. Modes: Amiga
  306.  
  307. This function returns the pixelheight of the active screen
  308.  
  309.  
  310. Function: ACTIVEWINDOW 
  311. --------------------------------------------------------------------------
  312. Syntax: ActiveWindow  
  313. Modes: Amiga
  314.  
  315. This function returns the address of the current window.
  316. This address is mainly used in conjunction with Intuition library
  317. commands.
  318.  
  319.  
  320. Statement or Function: WAITFOR 
  321. --------------------------------------------------------------------------
  322. Syntax: WaitFor (IDCMP Code)  
  323. Modes: Amiga
  324.  
  325. Similar to WaitEvent, WAITFOR puts the Amiga to "sleep" until a 
  326. specified IDCMP code wakes it up.  For example, WaitFor $400 would wait
  327. until the user strikes a key, and WaitFor $8 would wait until the 
  328. "close" gadget of the current window was clicked on.  These IDCMP codes 
  329. are additive, so WaitFor $408 would wait until either the "close" gadget
  330. was selected, or a key was pressed.  Refer to the section on "windows" 
  331. in the Blitz2 Reference Manual for more information on IDCMP codes.
  332.  
  333.  
  334. Statement: SHOWREQUESTERS 
  335. --------------------------------------------------------------------------
  336. Syntax: ShowRequesters OPTION>
  337. Modes: Amiga or Blitz
  338.  
  339. OPTIONS:  0=Cancel all requesters
  340.           1=Show requesters on Workbench Screen
  341.           2=Direct requesters to current window
  342.  
  343. This command allows you to force system requesters like "Please insert
  344. volume Foo in any drive" etc. to either be turned off, directed to the
  345. workbench, or directed to the current window.  When requesters are 
  346. turned off, the system will behave as if the "CANCEL" gadget was 
  347. selected for each requester that would otherwise have been displayed.  
  348. Be sure to re-activate requesters before exiting your program!
  349.  
  350.  
  351.  
  352. Function: CHECKSUM 
  353. --------------------------------------------------------------------------
  354. Syntax: Checksum (String$) 
  355. Modes: Amiga or Blitz
  356.  
  357. Given a string, Checksum() will return a unique 32-bit integer as
  358. a checksum, useful in situations such as serial transfers, etc. to
  359. ensure both parties have the same data.
  360.  
  361.  
  362. Function: CHARCOUNT 
  363. --------------------------------------------------------------------------
  364. Syntax: CharCount (String$,byte) 
  365. Modes: Amiga or Blitz
  366.  
  367. This function will return the number of occurances of a given byte
  368. within a string.  For example, CharCount(text$,32) will count the
  369. number of spaces in text$.
  370.  
  371.  
  372. Function: SEARCHBEGIN 
  373. --------------------------------------------------------------------------
  374. Syntax: SearchBegin (String$,byte,# from Begin) 
  375. Modes: Amiga or Blitz
  376.  
  377. Similar to Instr(), SearchBegin will search the given string
  378. for the specified byte.  For example, SearchBegin(a$,32,1)
  379. will return the character position of the first space in a$,
  380. while SearchBegin(a$,32,3) will return the position of the
  381. third space.  If the byte is not found in the string, SearchBegin
  382. will return a zero.
  383.  
  384.  
  385. Function: SEARCHEND
  386. --------------------------------------------------------------------------
  387. Syntax: SearchEnd (String$,byte,# from End) 
  388. Modes: Amiga or Blitz
  389.  
  390. Like SearchBegin() (above) except it searches from the end of
  391. the string to the front.  For example, SearchBegin(a$,asc("A"),2)
  392. will return the character position of the second-from-last letter
  393. "A" in the string 'a$.'
  394.  
  395.  
  396. Function: CIPHER$ 
  397. --------------------------------------------------------------------------
  398. Syntax: Cipher$ (String$) 
  399. Modes: Amiga or Blitz
  400.  
  401. The Cipher$() function will encrypt or decrypt a string passed to it.
  402. This is especially handy if you don't want users "zapping" your 
  403. executeable or data files to read it's contents.  Note that Cipher$() 
  404. can only decrypt strings previously created with Cipher$().
  405.  
  406.  
  407. Function: NULL
  408. --------------------------------------------------------------------------
  409. Syntax: Null (String$)
  410. Modes: Amiga or Blitz
  411.  
  412. Many Amiga shared libraries (like the DOS library) require addresses
  413. of null-terminated strings as arguments.  This function will return
  414. a long-integer address of a null-terminated string in memory for such
  415. commands.
  416.  
  417.  
  418. Function: REPEATS 
  419. --------------------------------------------------------------------------
  420. Syntax: Repeats (String$) 
  421. Modes: Amiga or Blitz
  422.  
  423. This function will return the number of repeated bytes at the
  424. beginning of your string.  Thus, Repeats("...Test") would return 3,
  425. while Repeats("Example") would return 1.  If the string is null,
  426. Repeats() will return zero.
  427.  
  428.  
  429. Function: SPACE$
  430. --------------------------------------------------------------------------
  431. Syntax: SPACE$ (number of spaces)
  432. Modes: Amiga or Blitz
  433.  
  434. This function is identical to the Space$ function in many other dialects
  435. of BASIC.  It will return a string containing the desired number of
  436. spaces, making it easier to align tables etc. to the screen or printer.
  437.  
  438.  
  439. Function: BIN#
  440. --------------------------------------------------------------------------
  441. Syntax: Bin# (BinString$)
  442. Modes: Amiga or Blitz
  443.  
  444. This function accepts binary value stored in a string and returns the
  445. decimal value.
  446.  
  447.  
  448. Function: HEX#
  449. --------------------------------------------------------------------------
  450. Syntax: Hex# (HexString$)
  451. Modes: Amiga or Blitz
  452.  
  453. This function accepts hexadecimal value stored in a string and returns 
  454. the decimal value.
  455.  
  456.  
  457. Function: INTUITIONBASE 
  458. --------------------------------------------------------------------------
  459. Syntax: IntuitionBase  
  460. Modes: Amiga or Blitz
  461.  
  462. Returns Intuition Library base
  463.  
  464.  
  465. Function: DOSBASE 
  466. --------------------------------------------------------------------------
  467. Syntax: DosBase  
  468. Modes: Amiga or Blitz
  469.  
  470. Returns DOS Library base
  471.  
  472.  
  473. Function: GRAPHICSBASE 
  474. --------------------------------------------------------------------------
  475. Syntax: GraphicsBase  
  476. Modes: Amiga or Blitz
  477.  
  478. Returns Graphics Library base
  479.  
  480.  
  481. Function: FFPBASE 
  482. --------------------------------------------------------------------------
  483. Syntax: FFPBase  
  484. Modes: Amiga or Blitz
  485.  
  486. Returns FFP Math Library base
  487.  
  488.  
  489. Function: DISKFONTBASE 
  490. --------------------------------------------------------------------------
  491. Syntax: DiskFontBase  
  492. Modes: Amiga or Blitz
  493.  
  494. Returns DiskFont Library base
  495.  
  496.  
  497. Function: COMMODITIESBASE 
  498. --------------------------------------------------------------------------
  499. Syntax: CommoditiesBase  
  500. Modes: Amiga or Blitz
  501.  
  502. Returns Commodities Library base
  503.  
  504.  
  505. Function: ICONBASE 
  506. --------------------------------------------------------------------------
  507. Syntax: IconBase  
  508. Modes: Amiga or Blitz
  509.  
  510. Returns Icon Library base
  511.  
  512.  
  513. Function: REXXSYSBASE 
  514. --------------------------------------------------------------------------
  515. Syntax: RexxSysBase  
  516. Modes: Amiga or Blitz
  517.  
  518. Returns RexxSys Library base
  519.  
  520.  
  521.                              Blitz2 Guidefile Info
  522. -------------------------------------------------------------------------
  523.  
  524.                    BlitzBasic is copyrighted to Acid Software
  525.                    ==========================================
  526.  
  527. I created this file because I was sick of loading everytime the doc 
  528. files in the background. So I started to do some typing and block 
  529. cutting with the original doc files delivered with the libs.
  530.  
  531. I'm glad that these library's are created because they make Blitz2 a lot
  532. better and more usefull.
  533.  
  534.            You can contact me on internet if needed: j.valks@sbos.nl
  535.  
  536. Special thanks are going to Simon Armstrong of Acid Software for giving
  537. me the BUM ascii files. Thanks!
  538.  
  539.                                   Written by:
  540.  
  541.                           Jurgen Valks (BlitzUser 418)
  542.                                   Kerkeind 8a
  543.                              5293 AB  Gemonde (NB) 
  544.                                 The Netherlands
  545.  
  546. This file is to big now! I gonna make a other file with commands and
  547. syntax only...
  548.  
  549.  
  550.                                  Choose a item:
  551.  
  552.  AMIGA SUPPORT LIBRARY     (BUM 6)      PALETTE LIBRARY ADDITIONS (BUM 5) 
  553.  ANIM LIBRARY              (BUM 2)      SCREEN  LIBRARY ADDITIONS (BUM 5) 
  554.  AREXX LIBRARY             (BUM 2)      WINDOW  LIBRARY ADDITIONS (BUM 5) 
  555.  CONSOLE LIBRARY           (BUM 6)      NEW SCREEN FLAGS          (BUM 4) 
  556.  CRUNCH LIBRARY            (BUM 6)      
  557.  ELMORE LIBRARY            (BUM 6)      AGA PALETTE HANDLING      (BUM 4) 
  558.  LOCALE LIBRARY            (BUM 6)      3.0 BITMAP  HANDLING      (BUM 4) 
  559.  MED LIBRARY               (BUM 2)      NEW GADGET  HANDLING      (BUM 4) 
  560.  PRINTER LIBARY            (BUM 6)      
  561.  SERIALPORT LIBRARY        (BUM 2)      DATE & TIME COMMANDS      (BUM 4) 
  562.  THE NEW DISPLAY LIBRARY   (BUM 5)      ENVIRONMENT COMMANDS      (BUM 4) 
  563.  THE NEW ASL LIBRARY       (BUM 5)      NEW DRAWING COMMANDS      (BUM 4) 
  564.  THE GADTOOLS LIBRARY      (BUM 5)       
  565.  
  566.  MISC ADDITIONS            (BUM X) 
  567.  
  568.  
  569.                                 MISC ADDITIONS
  570.  
  571.             These are misc commands added in several BUM magazines:
  572.  
  573.                                    BLITCOLL     
  574.                                    BLOCK        
  575.                                    EXISTS       
  576.                                    ILBMVIEWMODE 
  577.                                    LOADFONT     
  578.                                    LOADSHAPE    
  579.                                    REMAP        
  580.                                    RUNERRSOFF   
  581.                                    RUNERRSON    
  582.                                    SETBPLCON0   
  583.                                    SHAPEGADGET  
  584.                                    SHOWBITMAP   
  585.                                    SORTLIST     
  586.                                    SPRITEMODE   
  587.                                    VPOS         
  588.  
  589.  
  590. Statement: SortList
  591. --------------------------------------------------------------------------
  592. Syntax: SortList Arrayname()
  593.  
  594. The SortList command is used to rearrange the order of elements in a 
  595. Blitz2 linked list. The order in which the items are sorted depends on 
  596. the first field of the linked list type which must be a single integer 
  597. word. Sorting criteria will be extended in future releases.
  598.  
  599.  
  600. Statement: LoadFont
  601. --------------------------------------------------------------------------
  602. Syntax: LoadFont IntuiFont#,Fontname.font$,Y size [,style]
  603.  
  604. The LoadFont command has been extended with an optional style
  605. parameter. The following constants may be combined:
  606.  
  607. #underlined=1
  608. #bold=2
  609. #italic=4
  610. #extended=8 ;wider than normal
  611. #colour=64  ;hmm use colour version I suppose
  612.  
  613.  
  614. Statement: SpriteMode
  615. --------------------------------------------------------------------------
  616. Syntax: SpriteMode mode
  617.  
  618. For use with the capabilities of the new Display library SpriteMode is 
  619. used to define the width of sprites to be used in the program. The mode
  620. values 0, 1 and 2 correspong to the widths 16, 32 and 64.
  621.  
  622.  
  623. Function: Exists
  624. --------------------------------------------------------------------------
  625. Syntax: Exists (FileName$)
  626.  
  627. Exists actually returns the length of the file, if 0 the file either 
  628. does not exist or is empty or is perhaps not a file at all! Hmmm, 
  629. anyway the following poke turns off the "Please Insert Volume Blah:" 
  630. requester so you can use Exists to wait for disk changes:
  631.  
  632.      Poke.l Peek.l(Peek.l(4)+276)+184,-1
  633.  
  634.  
  635. Statements: Runerrson & Runerrsoff
  636. --------------------------------------------------------------------------
  637. Syntax: Runerrson & Runerrsoff
  638.  
  639. These two new compiler directives are for enabling and disabling error
  640. checking in different parts of the program, they override the settings 
  641. in Compiler Options.
  642.  
  643.  
  644. Statement: Block
  645. --------------------------------------------------------------------------
  646. Syntax: Block Shape#,X,Y
  647. Modes: Amiga/Blitz
  648.  
  649. Description:
  650. Block is an extremely fast version of the Blit command with some 
  651. restrictions. Block should only be used with shapes that are 16,32,48,
  652. 64... pixels wide and that are being blitted to an x position of 0,16,
  653. 32,48,64... 
  654.  
  655. Note that the height and y destination of the shape are not limited by
  656. the Block command. Block is intended for use with map type displays.
  657.  
  658.  
  659. Statement: LoadFont  
  660. --------------------------------------------------------------------------
  661. Syntax: LoadFont IntuiFont#,Fontname.font$,Y Size
  662. Modes: Amiga
  663.  
  664. Description:
  665. LoadFont is used to load a font from the fonts: directory. Unlike 
  666. BlitzFonts any size IntuiFont can be used. The command WindowFont is 
  667. used to set text output to a certain IntuiFont in a particular Window.
  668.  
  669.  
  670. Function: VPos     (add to chapter 5)
  671. --------------------------------------------------------------------------
  672. Syntax: VPos
  673. Modes: Amiga/Blitz
  674.  
  675. Description:
  676. VPos returns the video's beam vertical position. Useful in both high-
  677. speed animation where screen update may need to be synced to a certain 
  678. video beam position (not just the top of frame as with VWait) and for a
  679. fast random nember generator in non frame-synced applications.
  680.  
  681.  
  682. The Anim.lib
  683.  
  684. The following 4 commands allow the display of Animations in Blitz BASIC. 
  685. The Animation must be compatible with the DPaint 3 format, this method 
  686. uses long delta (type 2) compression and does not include any palette 
  687. changes.
  688.                                The Anim Commands:
  689.  
  690.                                     LOADANIM   
  691.                                     INITANIM   
  692.                                     NEXTFRAME 
  693.                                     FRAMES    
  694.  
  695. Anims in nature use a double buffered display, with the addition of the 
  696. ShowBitMap command to Blitz we can now display (play) Anims in both 
  697. Blitz and Amiga modes. An Anim consists of an initial frame which needs
  698. to be displayed (rendered) using the InitAnim command, subsequent frames
  699. are then played by using the NextFrame command. The Frames() function 
  700. returns the number of frames of an Anim. We have also extended the 
  701. LoadShape command to support Anim brushes. The following example loads 
  702. and plays an Anim on a standard Amiga (Intuition) Screen.
  703.  
  704. ;play anim example
  705. ;anim file name could use f$=par$(1) to play anim from cli
  706. f$="test.anim"
  707. ;open screen same resolution as animation 
  708.  
  709. ILBMInfo f$ 
  710. Screen 0,0,0,ILBMWidth,ILBMHeight,ILBMDepth,ILBMViewMode,"",1,2 
  711. ScreensBitMap 0,0 
  712.  
  713. ;an extra bitmap same size as screensbitmap for double buffering
  714.  
  715. BitMap 1,ILBMWidth,ILBMHeight,ILBMDepth 
  716.  
  717. ;load anim and set screen colours to same as animation
  718.  
  719. LoadAnim 0,f$,0:Use Palette 0 
  720.  
  721. ;draws first frame to current bitmap (1) and bitmap #0
  722.  
  723. InitAnim 0,0
  724. While Joyb(0)=0 
  725.       ShowBitMap db        ;tell intuition which bitmap to display
  726.       VWait                ;wait for top of frame 
  727.       db=1-db              ;swap current bitmap 
  728.       Use BitMap db 
  729.       NextFrame 0          ;and draw next frame 
  730. Wend
  731.  
  732.  
  733. Statement: LoadAnim
  734. --------------------------------------------------------------------------
  735. Syntax: LoadAnim Anim#,FileName$[,Palette#]
  736. Modes: Amiga
  737.  
  738. Description:
  739. The LoadAnim command will create an Anim object and load a DPaint 
  740. compatible animation. The ILBMInfo command can be used to find the 
  741. correct screensize and resolution for the anim file. The optional 
  742. Palette# parameter can be used to load a palette with the anims correct
  743. colours. 
  744.  
  745. Notes:
  746. unlike more advanced anim formats DPaint anims use a single static 
  747. palette for the entire animation. Like all other Blitz commands that
  748. access files the command must be executed in Amiga mode.
  749.  
  750.  
  751. Statement: InitAnim
  752. --------------------------------------------------------------------------
  753. Syntax: InitAnim Anim#[,Bitmap#]
  754. Modes: Amiga/Blitz
  755.  
  756. Description:
  757. InitAnim renders the first two frames of the Anim onto the current 
  758. BitMap and the BitMap specified by the second parameter. The second 
  759. BitMap# parameter is optional, this is to support Anims that are not in
  760. a double-buffered format (each frame is a delta of the last frame not 
  761. from two frames ago). However, the two parameter double buffered form of
  762. InitAnim should always be used. (hmmm don't ask me O.K.!)
  763.  
  764.  
  765. Statement: NextFrame
  766. --------------------------------------------------------------------------
  767. Syntax: NextFrame Anim#
  768. Modes: Amiga/Blitz
  769.  
  770. Description:
  771. NextFrame renders the nextframe of an Anim to the current BitMap. If 
  772. the last frame of an Anim has been rendered NextFrame will loop back to 
  773. the start of the Animation.
  774.  
  775.  
  776. Function: Frames
  777. --------------------------------------------------------------------------
  778. Syntax: Frames (Anim#)
  779.  
  780. Description:
  781. The Frames() function returns the number of frames in the specified 
  782. Anim.
  783.  
  784.  
  785. Statement: ShowBitMap
  786. --------------------------------------------------------------------------
  787. Syntax: ShowBitMap [BitMap#]
  788. Modes: Amiga
  789. Library: ScreensLib
  790.  
  791. Description:
  792. The ShowBitMap command is the Amiga-mode version of the Show command. It
  793. enables you to change a Screens bitmap allowing double buffered (flicker 
  794. free) animation to happen on a standard Intuition Screen.
  795.  
  796. Unlike Blitz mode it is better to do ShowBitMap then VWait to sync up 
  797. with the Amiga's display, this will make sure the new bitmap is being 
  798. displayed before modifying the previous BitMap.
  799.  
  800.  
  801. Function: BlitColl
  802. --------------------------------------------------------------------------
  803. Syntax: BlitColl (Shape#,x,y)
  804. Modes: Amiga/Blitz
  805.  
  806. Description:
  807. BlitColl is a fast way of collision detection when blitting shapes. 
  808. BlitColl returns -1 if a collision occurs, 0 if no collision. A 
  809. collision occurs if any pixel on the current BitMap is non zero where 
  810. your shape would have been blitted.
  811.  
  812. ShapesHit is faster but less accurate as it checks only the rectangular 
  813. area of each shape, where as BlitColl takes into account the shape of 
  814. the shape and of course1bcan not tell you what shapeyou have collided 
  815. with.
  816.  
  817. Note: make sure only things that you want to 
  818. collide with have been drawn on the BitMap e.g. don't Blit your ship and
  819. then try BlitColl!
  820.  
  821.  
  822. Statement: ILBMViewMode
  823. --------------------------------------------------------------------------
  824. Syntax: ILBMViewMode
  825. Modes: Amiga/Blitz
  826. Library: ILBMIFFLib
  827.  
  828. Description:
  829. ILBMViewMode returns the viewmode of the file that was processed by 
  830. ILBMInfo. This is useful for opening a screen in the right mode before 
  831. using LoadScreen etc. The different values of ViewMode are as follows 
  832. (add/or them for different combinations):
  833.  
  834. 32768 ($8000) hires  
  835. 2048  ($0800) ham   
  836. 128   ($0080) halfbright     
  837. 4     ($0004) interlace     
  838. 0     ($0000) lores
  839.  
  840. See Also:  ILBMINFO 
  841.  
  842. Example:
  843.  
  844. ;
  845. ;ilbminfo example 
  846. ;
  847. ;iff file name could use f$=par$(1) to use cli argument 
  848. f$="test.iff" 
  849. ;get ilbm information 
  850. ILBMInfo f$ 
  851. ;open screen with correct parameters
  852. Screen 0,0,0,ILBMWidth,ILBMHeight,ILBMDepth,ILBMViewMode,"",1,2 
  853. ;load the iff onto the screens
  854. LoadScreen 0,f$,0 
  855. ;set the palette
  856. Use Palette 0 
  857. MouseWait 
  858.  
  859.  
  860. Statement: LoadShape
  861. --------------------------------------------------------------------------
  862. Syntax: LoadShape Shape#,Filename$[,Palette#]
  863. Modes: Amiga
  864.  
  865. Description:
  866. The LoadShape command has now been extended to support anim brushes, if 
  867. the file is an anim brush the shapes are loaded into consecutive shapes 
  868. starting with the Shape# provided.
  869.  
  870.  
  871. Statement: ReMap
  872. --------------------------------------------------------------------------
  873. Syntax: ReMap colour#0,colour#1[,Bitmap]
  874. Modes: Amiga/Blitz
  875. Library: Sis2dLib
  876.  
  877. Description:
  878. ReMap is used to change all the pixels on a BitMap in one colour to 
  879. another colour. The optional BitMap parameter will copy all the pixels 
  880. in Colour#0 to their new colour on the new bitmap.
  881.  
  882.  
  883. Statement: ShapeGadget
  884. --------------------------------------------------------------------------
  885. Syntax: ShapeGadget GadgetList#,X,Y,Flags,Id,Shape#[,Shape#]
  886. Mode: Amiga
  887.  
  888. Description:
  889. The ShapeGadget command allows you to create gadgets with graphic 
  890. imagery. The Shape# parameter refers to a shape object containing the 
  891. graphics you wish the gadget to contain.
  892.  
  893. The ShapeGadget command has been extended to allow an alternative image 
  894. to be displayed when the gadget is selected. All other parameters are 
  895. identical to those in TextGadget.
  896.  
  897. Example:
  898.  
  899. ;ShapeGadget example
  900. Screen 0,3
  901. ScreensBitMap 0,0 
  902. ;generate 2 shapes for our shape gadget 
  903. Cls:Circlef 15,15,15,2:Circlef 8,8,9,5,3:Circlef 24,8,9,2,3 
  904. GetaShape 1,0,0,32,32:Circlef 24,8,9,5,3:GetaShape 0,0,0,32,32
  905. ;
  906. ShapeGadget 0,148,50,0,1,0,1
  907. TextGadget 0,140,180,0,2,"EXIT" 
  908. Window 0,0,0,320,200,$100f,"ClickMe",1,2,0
  909.  
  910. Repeat
  911. Until WaitEvent=64 AND GadgetHit=2
  912.  
  913.  
  914. Statement: SetBPLCON0
  915. --------------------------------------------------------------------------
  916. Syntax: SetBPLCON0 Default
  917. Modes: Amiga/Blitz
  918.  
  919. Description:
  920. The SetBPLCON0 command has been added for advanced control of Slice 
  921. display modes. The BPLCON0 hardware register is on page A4-1 of the 
  922. reference manual (appendix 4). The bits of interest are as follows:
  923.  
  924. bit#1-ERSY external sync (for genlock enabling)
  925. bit#2-LACE interlace mode
  926. bit#3-LPEN light pen enable
  927.  
  928. Example:
  929.  
  930. ; Blitz Interlaced Slice Example using BPLCON0
  931. BitMap 0,640,512,4
  932. ; use SetBPLCON0 4 to set the lace bit on when slice is created 
  933. SetBPLCON0 4                               ;set lace bit
  934.  
  935. BLITZ 
  936. ;bitmap width=1280 so slice's bitmap modulos miss each 2nd line 
  937. Slice 0,44,640,256,$fffb,4,8,8,1280,1280   ;cludge the modulo 
  938. ;every vertical blank either show odd lines or even lines 
  939. ;depending on the long frame bit of VPOSR hardware register 
  940. SetInt 5
  941.     If Peek($dff004)<0 Show 0,0,0 Else Show 0,0,1 
  942. End SetInt
  943. ;draw lines to prove it 
  944. For i=1 To 1000 
  945.     Line Rnd(640),Rnd(512),Rnd(640),Rnd(512),Rnd(16)
  946. Next
  947. ;
  948. MouseWait 
  949.  
  950.  
  951. Speak Commands
  952.  
  953.  
  954. The Amiga speech synthesiser can be activated using the following 
  955. commands. The narrator.device has been upgraded in Workbench2.0 
  956. increasing the quality of the speech. With a bit of messing around you 
  957. can have a lot of fun with the Amiga's 'voice', Also note that these are
  958. compatible with the commands used in BlitzUser1's speech program.
  959.  
  960. Speak Commands:
  961.  
  962.                               SPEAK         
  963.                               SETVOICE      
  964.                               TRANSLATE$    
  965.                               PHONETICSPEAK 
  966.                               VOICELOC      
  967.  
  968.  
  969. Statement: Speak
  970. --------------------------------------------------------------------------
  971. Syntax: Speak string$
  972. Modes: Amiga
  973.  
  974. Description:
  975. The Speak command will first convert the given string to phonetics and 
  976. then pass it to the Narrator.Device. Depending on the settings of the 
  977. Narrator device (see  SETVOICE ) the Amiga will 
  978. "speak" the string you have sent in the familiar Amiga synthetic voice.
  979.  
  980. Example:
  981.  
  982. NPrint "Type something and hit return..." 
  983. NPrint "(just return to exit)"
  984. Repeat
  985.   a$=Edit$(80)
  986.   Speak a$
  987. Until a$="" 
  988.  
  989.  
  990. Statement: SetVoice
  991. --------------------------------------------------------------------------
  992. Syntax: SetVoice rate,pitch,expression,sex,volume,frequency
  993. Modes: Amiga
  994.  
  995. Description:
  996. SetVoice alters the sound of the Amiga's speech synthsiser by changing:
  997.  
  998. Rate:       measured in words per minute. Default 150, range 40-400.
  999. Pitch:      the BaseLine pitch in Hz. Default 110, range 65-320
  1000. Expression: 0=robot 1=natural 2=manual        
  1001. Sex:        0=male 1=female     
  1002. Volume:     0 to 64       
  1003. Frequency:  samples per second (22200)
  1004.  
  1005. As the following example shows you could very well rename the Speak 
  1006. command the Sing command!
  1007. ;
  1008. ; sing the praises of Blitz BASIC!
  1009. ;
  1010. While Joyb(0)=0 
  1011.   Pitch=65+Rnd(255) 
  1012.   rate=100+Rnd(200) 
  1013.   SetVoice rate,pitch,1,1,64,22200
  1014.   Speak "BLITZ BASIC" 
  1015. Wend
  1016.  
  1017.  
  1018. Function: Translate$
  1019. --------------------------------------------------------------------------
  1020. Syntax: Translate$(string$)
  1021. Modes: Amiga
  1022.  
  1023. Description:
  1024. Translate$() returns the phonetic equivalent of the string for use with
  1025. the Translate
  1026.  
  1027. Example:
  1028.  
  1029. Print "Enter a Sentence ":a$=Edit$(80)
  1030. NPrint "Phonetic=",Translate$(a$) 
  1031. MouseWait 
  1032.  
  1033.  
  1034. Statement: PhoneticSpeak
  1035. --------------------------------------------------------------------------
  1036. Syntax: PhoneticSpeak phonetic$
  1037. Modes: Amiga
  1038.  
  1039. Description:
  1040. PhoneticSpeak is similar to the Speak command but should only be passed 
  1041. strings containing legal phonemes such as that produced by the 
  1042. Translate$() function.
  1043.  
  1044.  
  1045. Function: VoiceLoc
  1046. --------------------------------------------------------------------------
  1047. Syntax: VoiceLoc
  1048. Modes: Amiga
  1049.  
  1050. Description:
  1051. VoiceLoc returns a pointer to the internal variables in the speech 
  1052. synthesiser that enable the user to access new parameters added to the 
  1053. V37 Narrator Device. Formants as referred to in the descriptions are the
  1054. major vocal tracts and are separated into the parts of speech that 
  1055. produce the bass, medium and trebly sounds.
  1056.  
  1057. The new paramters are as listed
  1058.                
  1059. \flags                : set to 1 if using extended commands
  1060. \f0enthusiasm         : amount of pitch difference on accents default=32
  1061. \f0perturb            : amount of "wurble" ie random shake default=0
  1062. \f1adj,\f2adj,\f3adj  : pitch adjust for low medium and high frequency
  1063.                         formants. 0=default
  1064. \a1adj,\a2adj,\a3adj  : amplitude adjust for low medium and high
  1065.                         frequency formants 0=default
  1066. \articulate           : speed of articulation 100=default
  1067. \centralize           : amount of the centphon vowel in other vowels
  1068.                         0=default
  1069. \centphon             : a vowel to which all others are adjusted by the
  1070. \centralize           : variable,
  1071.                         (limited to IY,IH,EH,AE,AA,AH,AO,OW,UH,ER and 
  1072.                          UW) 
  1073. \AVbias,\AFbias       : amount of bias added to voiced and unvoiced 
  1074.                         speech sounds, (y,r,w,m vs st,sh,f). 
  1075. \priority             : task priority when speaking 100=default
  1076.  
  1077. Example:
  1078.  
  1079. ; voiceloc() example
  1080.  
  1081. NEWTYPE .voicepars          ;new V37 parameters available 
  1082.       flags.b 
  1083.       f0enthusiasm:f0perturb
  1084.       f1adj:f2adj:f3adj 
  1085.       a1adj:a2adj:a3adj 
  1086.       articulate:centralize:centphon$ 
  1087.       avbias.b:afbias:priority:pad1 
  1088. End NEWTYPE 
  1089.  
  1090. *v.voicepars=VoiceLoc 
  1091.  
  1092. *v\flags=1
  1093. *v\f0enthusiasm=82,90 ;old aged highly excited voice
  1094. *v\f1adj=0,0,0    ;these are fun to mess with 
  1095. *v\a1adj=0,0,0
  1096. *v\centralize=50,"AO" ;no effect
  1097. *v\articulate=90
  1098. *v\avbias=20,20 
  1099.  
  1100. Speak "COME ON EVERYBODY, DANCE? boom boom !" 
  1101. End
  1102.  
  1103.  
  1104.                                The MED commands:
  1105.  
  1106.                        LOADMEDMODULE            SETMEDVOLUME 
  1107.                        STARTMEDMODULE           GETMEDVOLUME 
  1108.                        PLAYMED                  GETMEDNOTE   
  1109.                        STOPMED                  GETMEDINSTR  
  1110.                        JUMPMED                  SETMEDMASK   
  1111.  
  1112.  
  1113. Statement: LoadMedModule
  1114. --------------------------------------------------------------------------
  1115. Syntax: LoadMedModule MedModule# Name
  1116. Modes: Amiga
  1117.  
  1118. Description:
  1119. The LoadMedModule command loads any version 4 channel Octamed module. 
  1120. The following routines support upto and including version 3 of the 
  1121. Amiganut's Med standard.
  1122.  
  1123. The number of MedModules loaded in memory at one time is only limited 
  1124. by the MedModules maximum set in the Blitz2 Options requester. Like any 
  1125. Blitz commands that access files LoadMedModule can only be used in 
  1126. AmigaMode.
  1127.  
  1128.  
  1129. Statement: StartMedModule
  1130. --------------------------------------------------------------------------
  1131. Syntax: StartMedModule MedModule#
  1132. Modes: Amiga/Blitz
  1133.  
  1134. Description:
  1135. StartMedModule is responsible for initialising the module including 
  1136. linking after it is loaded from disk using the LoadMedModule command. It
  1137. can also be used to restart a module from the beginning.
  1138.  
  1139.  
  1140. Statement: PlayMed
  1141. ---------------------------------------------------------------------------
  1142. Modes: Amiga/Blitz
  1143.  
  1144. Description:
  1145. PlayMed is responsible for playing the current MedModule, it must be 
  1146. called every 50th of a second either on an interupt (#5) or after a 
  1147. VWait in a program loop.
  1148.  
  1149.  
  1150. Statement: StopMed
  1151. --------------------------------------------------------------------------
  1152. Syntax: StopMed
  1153. Modes: Amiga/Blitz
  1154.  
  1155. Description:
  1156. StopMed will cause any med module to stop playing. This not only means 
  1157. that PlayMed will have no affect until the next StartMedModule but 
  1158. silences the audio channels so they are not left ringing as is the 
  1159. effect when PlayMed is not called every vertical blank.
  1160.  
  1161.  
  1162. Statement: JumpMed
  1163. --------------------------------------------------------------------------
  1164. Syntax: JumpMed Pattern#
  1165. Modes: Amiga/Blitz
  1166.  
  1167. Description:
  1168. JumpMed will change the pattern being played in the current module.
  1169.  
  1170.  
  1171. Statement: SetMedVolume
  1172. --------------------------------------------------------------------------
  1173. Syntax: SetMedVolume Volume
  1174. Modes: Amiga/Blitz
  1175.  
  1176. Description:
  1177. SetMedVolume changes the overall volume that the Med Library plays the 
  1178. module, all the audio channels are affected. This is most useful for 
  1179. fading out music by slowly decreasing the volume from 64 to 0.
  1180.  
  1181.  
  1182. Function: GetMedVolume
  1183. --------------------------------------------------------------------------
  1184. Syntax: GetMedVolume Channel#
  1185. Modes: Amiga/Blitz
  1186.  
  1187. Description:
  1188. GetMedVolume returns the current volume setting of the specified audio 
  1189. channel. This is useful for graphic effects that you may wish to sync 
  1190. to certain channels of the music playing.
  1191.  
  1192.  
  1193. Function: GetMedNote
  1194. --------------------------------------------------------------------------
  1195. Syntax: GetMedNote Channel#
  1196. Modes: Amiga/Blitz
  1197.  
  1198. Description:
  1199. GetMedNote returns the current note playing from the specified channel.
  1200. As with GetMedVolume this is useful for producing graphics effects 
  1201. synced to the music the Med Library is playing.
  1202.  
  1203.  
  1204. Function: GetMedInstr
  1205. --------------------------------------------------------------------------
  1206. Syntax: GetMedInstr Channel
  1207. Modes: Amiga/Blitz
  1208.  
  1209. Description:
  1210. GetMedInstr returns the current instrument playing through the specified
  1211. audio channel.
  1212.  
  1213.  
  1214. Statement: SetMedMask
  1215. --------------------------------------------------------------------------
  1216. Syntax: SetMedMask Channel Mask
  1217. Modes: Amiga/Blitz
  1218.  
  1219. Description:
  1220. SetMedMask allows the user to mask out audio channels needed by sound 
  1221. effects stopping the Med Library using them.
  1222.  
  1223.  
  1224. Serial Port Commands
  1225.  
  1226. The following are a set of commands to drive both the single RS232 
  1227. serial port on an Amiga as well as supporting multiserial port cards 
  1228. such as the A2232 card. The unit# in the following commands should be 
  1229. set to 0 for the standard RS232 port, unit 1 refers to the default 
  1230. serial port set by the advanced serial preferences program and unit 2 
  1231. on refer to any extra serial ports available.
  1232.  
  1233.                              Serial Port Commands:
  1234.  
  1235.                             OPENSERIAL        
  1236.                             WRITESERIAL       
  1237.                             WRITESERIALSTRING 
  1238.                             READSERIAL        
  1239.                             READSERIALSTRING  
  1240.                             CLOSESERIAL       
  1241.                             SETSERIALBUFFER   
  1242.                             SETSERIALLENS     
  1243.                             SETSERIALPARAMS   
  1244.                             SERIALEVENT       
  1245.  
  1246.  
  1247. Function: OpenSerial
  1248. --------------------------------------------------------------------------
  1249. Syntax: OpenSerial device$,unit#,baud,io_serflags
  1250. Modes: Amiga
  1251.  
  1252. Description:
  1253. OpenSerial is used to configure a Serial Port for use. As with OpenFile, 
  1254. OpenSerial is a function and returns zero if it fails. If it succeeds 
  1255. advanced users may note the return result is the location of the IOExtSer 
  1256. structure. 
  1257.  
  1258. Use "serial.device" for device$. 
  1259.  
  1260. The baud rate should be in the range of 110-292,000. The io_serflags 
  1261. parameter includes the following flags:
  1262.  
  1263. bit7: #serf_xdisabled=128 ; disable xon/xoff 
  1264. bit6: #serf_eofmode=64    ; enable eof checking 
  1265. bit5: #serf_shared=32     ; set if you don't need exclusive use of port
  1266. bit4: #serf_rad_boogie=16 ; high speed mode 
  1267. bit3: #serf_queuedbrk=8   ; if set, a break command waits for buffer
  1268.                             empty
  1269. bit2: #serf_7wire=4       ; if set, use 7 wire RS232
  1270. bit1: #serf_parity_odd=2  ; select odd parity (even if not set) 
  1271. bit0: #serf_parity_on=1   ; enable parity checking
  1272.  
  1273.  
  1274. Statement: WriteSerial
  1275. --------------------------------------------------------------------------
  1276. Syntax: WriteSerial unit#,byte
  1277. Modes: Amiga
  1278.   
  1279. Description:
  1280. WriteSerial sends one byte to the serial port. Unit# defines which 
  1281. serial port is used. If you are sending characters use the Asc() 
  1282. function to convert the character to a byte e.g. WriteSerial 0,asc("b").
  1283.  
  1284.  
  1285. Statement WriteSerialString
  1286. --------------------------------------------------------------------------
  1287. Syntax: WriteSerialString unit#,string
  1288. Modes: Amiga
  1289.  
  1290. Description:
  1291. WriteSerialString is similar to WriteSerial but sends a complete string
  1292. to the serial port.
  1293.  
  1294.  
  1295. Function: ReadSerial
  1296. --------------------------------------------------------------------------
  1297. Syntax: ReadSerial (unit#)  returns -1 if nothing waiting
  1298. Modes: Amiga
  1299.  
  1300. Description:
  1301. ReadSerial returns the next byte waiting in the serial port's read 
  1302. buffer. If the buffer is empty it returns a -1. It is best to use a word
  1303. type (var.w=ReadSerial(0)) as a byte will not be able to differentiate 
  1304. between -1 and 255.
  1305.  
  1306.  
  1307. Function: ReadSerialString
  1308. --------------------------------------------------------------------------
  1309. Syntax: ReadSerialString (unit#)
  1310. Modes: Amiga
  1311.  
  1312. Description:
  1313. ReadSerialString puts the serial port's read buffer into a string, if 
  1314. the buffer is empty the function will return a null string (length=0).
  1315.  
  1316.  
  1317. Statement: CloseSerial
  1318. --------------------------------------------------------------------------
  1319. Syntax: CloseSerial unit#
  1320. Modes: Amiga
  1321.  
  1322. Description:
  1323. The CloseSerial command will close the port, enabling other programs to
  1324. use it. 
  1325.  
  1326. Note: Blitz will automatically close all ports that are opened when a program 
  1327. ends.
  1328.  
  1329.  
  1330. Statement SetSerialBuffer
  1331. --------------------------------------------------------------------------
  1332. Modes: Amiga
  1333.  
  1334. Description:
  1335. SetSerialBuffer changes the size of the ports read buffer. This may be 
  1336. useful if your program is not always handling serial port data or is 
  1337. receiving and processing large chunks of data. The smallest size for 
  1338. the internal serial port (unit#0) is 64 bytes. The bufferlength variable
  1339. is in bytes.
  1340.  
  1341.  
  1342. Statement: SetSerialLens
  1343. --------------------------------------------------------------------------
  1344. Syntax: SetSerialLens unit#,readlen,writelen,stopbits
  1345. Modes: Amiga
  1346.  
  1347. Description:
  1348. SetSerialLens allows you to change the size of characters read and 
  1349. written by the serial device. Generally readlen=writelen and should be
  1350. set to either 7 or 8, stopbits should be set to 1 or 2. 
  1351.  
  1352. Default values are 8,8,1.
  1353.  
  1354.  
  1355. Statement: SetSerialParams
  1356. --------------------------------------------------------------------------
  1357. Syntax: SetSerialParams unit#
  1358. Modes: Amiga
  1359.   
  1360. Description:
  1361. For advanced users, SetSerialParams tells the serial port when 
  1362. parameters are changed. This would only be necesary if they were changed
  1363. by poking offsets from IOExtSer which is returned by the OpenSerial 
  1364. command.
  1365.  
  1366.  
  1367. Function: SerialEvent
  1368. --------------------------------------------------------------------------
  1369. Syntax: SerialEvent (unit#)
  1370. Modes: Amiga
  1371.  
  1372. Description:
  1373. SerialEvent is used when your program is handling events from more than
  1374. 1 source, Windows, ARexx etc. 
  1375.  
  1376. This command is currently not implemented
  1377.  
  1378.  
  1379.                     Here's a overview of the Arexx Commands:
  1380.  
  1381.                      CREATEMSGPORT              REPLYREXXMSG       
  1382.                      DELETEMSGPORT              GETREXXRESULT     
  1383.                      CREATEREXXMSG              GETREXXCOMMAND   
  1384.                      DELETEREXXMSG              GETRESULTSTRING 
  1385.                      CLEARREXXMSG               WAIT            
  1386.                      FILLREXXMSG                REXXEVENT       
  1387.                      CREATEARGSTRING            ISREXXMSG       
  1388.                      DELETEARGSTRING            REXXERROR       
  1389.                      SENDREXXCOMMAND 
  1390.  
  1391.  
  1392. Function: CreateMsgPort()
  1393. --------------------------------------------------------------------------
  1394. Syntax: PortAddress.l = CreateMsgPort("Name")
  1395. MODES: Amiga
  1396.  
  1397. Description:
  1398. CreateMsgPort is a general Function and not specific to ARexx.
  1399.  
  1400. CreateMsgPort opens an intuition PUBLIC message port of the name 
  1401. supplied as the only argument. If all is well the address of the port
  1402. created will be returned to you as a LONGWORD so the variable that you 
  1403. assign it to should be of type long.
  1404.  
  1405. If you do not supply a name then a private MsgPort will be opened for 
  1406. you.
  1407.  
  1408.     Port.l=CreateMsgPort("PortName")
  1409.  
  1410. It is important that you check you actually succeeded in opening a port
  1411. in your program. The following code or something similar will suffice.
  1412.  
  1413.     Port.l=CreateMsgPort("Name")
  1414.     IF Port=0 THEN Error_Routine{}
  1415.  
  1416. The name you give your port will be the name that Arexx looks for as the
  1417. HOST address,(and is case sensitive) so take this into consideration 
  1418. when you open your port.  NOTE IT MUST BE A UNIQUE NAME AND SHOULD NOT
  1419. INCLUDE SPACES.
  1420.  
  1421.  
  1422. Statement: DeleteMsgPort()
  1423. --------------------------------------------------------------------------
  1424. Syntax: DeleteMsgPort Port
  1425. Modes: Amiga
  1426.  
  1427. Desription:
  1428. DeleteMsgPort deletes a MessagePort previously allocated with 
  1429. CreateMsgPort(). The only argument taken by DeleteMsgPort is the address
  1430. returned by CreateMsgPort(). If the Port was a public port then it will 
  1431. be removed from the public port list.
  1432.  
  1433.     Port.l=CreateMsgPort("Name")
  1434.     IF Port=0 Then End
  1435.     DeleteMsgPort Port
  1436.  
  1437. Error checking is not critical as if this fails we have SERIOUS PROBLEMS.
  1438.  
  1439. YOU MUST WAIT FOR ALL MESSAGES FROM AREXX TO BE RECEIVED BEFORE YOU 
  1440. DELETE THE MSGPORT. IF YOU NEGLECT TO DELETE A MSGPORT BLITZ2 WILL 
  1441. DO IT FOR YOU AUTOMATICALLY ON PROGRAM EXIT.
  1442.  
  1443.  
  1444. Function: CreateRexxMsg()
  1445. --------------------------------------------------------------------------
  1446. Syntax: msg.l=CreateRexxMsg(ReplyPort,"exten","HOST")
  1447. Modes: Amiga
  1448.  
  1449. Description:
  1450. CreateRexxMsg() allocates a special Message structure used to 
  1451. communicate with Arexx.  If all is successful it returns the LONGWORD 
  1452. address of this rexxmsg structure.
  1453.  
  1454. The arguments are ReplyPort which is the long address returned by 
  1455. CreateMsgPort(). This is the Port that ARexx will reply to after it has 
  1456. finished with the message.
  1457.  
  1458. EXTEN which is the exten name used by any ARexx script you are wishing 
  1459. to run. i.e. if you are attempting to run the ARexx script test.rexx you
  1460. would use an EXTEN of "rexx".
  1461.  
  1462. HOST is the name string of the HOST port.  Your program is usually the 
  1463. HOST and so this equates to the name you gave your port in 
  1464. CreateMsgPort(). REMEMBER IT IS CASE SENSITIVE.
  1465.  
  1466. As we are allocating resources error checking is important and can be 
  1467. achieved with the following code:
  1468.  
  1469.     msg.l=CreateRexxMsg(Port,"rexx","HostName")
  1470.     IF msg=0 THEN Error_Routine{}
  1471.  
  1472.  
  1473. Statement: DeleteRexxMsg
  1474. --------------------------------------------------------------------------
  1475. Syntax: DeleteRexxMsg rexxmsg
  1476. Modes: Amiga
  1477.  
  1478. Description:
  1479. DeleteRexxMsg simply deletes a RexxMsg Structure previously allocated by 
  1480. CreateRexxMsg().  It takes a single argument which is the long address 
  1481. of a RexxMsg structure such as returned by CreateRexxMsg().
  1482.  
  1483.     msg.l=CreateRexxMsg(Port,"rexx","HostName")
  1484.     IF msg=0 THEN Error_Routine{}
  1485.     DeleteRexxMsg msg
  1486.  
  1487. Again if you neglect to delete the RexxMsg structure Blitz2 will do this
  1488. for you on exit of the program.
  1489.  
  1490.  
  1491. Statement: ClearRexxMsg
  1492. --------------------------------------------------------------------------
  1493. Syntax: ClearRexxMsg1k
  1494. Modes: Amiga
  1495.  
  1496. Description:
  1497. ClearRexxMsg is used to delete and clear an ArgString from one ormore of
  1498. the Argument slots in a RexxMsg Structure.  This is most useful for the 
  1499. more advanced programmer wishing to take advantage of the Arexx #RXFUNC 
  1500. abilities.
  1501.  
  1502. The arguments are a LONGWORD address of a RexxMsg structure. 
  1503. ClearRexxMsg will always work from slot number 1 forward to 16.
  1504.  
  1505.     Port.l=CreateMsgPort("TestPort")
  1506.     If Port = NULL Then End
  1507.     msg.l=CreateRexxMsg(Port,"vc","TestPort")
  1508.     If msg=NULL Then End
  1509.     SendRexxCommand msg,"open",#RXCOMM|#RXFF_RESULT
  1510.     wait:WHILE GetMsg_(Port) <> msg:Wend ;Wait for reply to come
  1511.     ClearRexxMsg msg                     ;Delete the Command string
  1512.                                               we sent
  1513.  
  1514. NOTE: ClearRexxMsg() is called automatically by RexxEvent() 
  1515. so the need to call this yourself is removed unless you have not sent 
  1516. the RexxMsg to Arexx.
  1517.  
  1518.  
  1519. Statement: FillRexxMsg()
  1520. --------------------------------------------------------------------------
  1521. Syntax: FillRexxMsg rexxmsg,&FillStruct
  1522. Modes: Amiga
  1523.  
  1524. Description:
  1525. FillRexxMsg allows you to fill all 16 ARGSlots if necessary with either 
  1526. ArgStrings or numerical values depending on your requirement.
  1527.  
  1528. FillRexxMsg will only be used by those programmers wishing to do more 
  1529. advanced things with Arexx, including adding libraries to the ARexx 
  1530. library list, adding Hosts,Value Tokens etc.  It is also needed to 
  1531. access Arexx using the #RXFUNC flag.
  1532.  
  1533. The arguments are a LONG Pointer to a rexxmsg.
  1534.  
  1535. The LONG address of a FillStruct NEWTYPE structure. This structure is 
  1536. defined in the Arexx.res and has the following form.
  1537.  
  1538. NEWTYPE.FillStruct
  1539.    Flags.w             ;Flag block
  1540.    Args0.l             ; argument block (ARG0-ARG15)
  1541.    Args1.l             ; argument block (ARG0-ARG15)
  1542.    Args2.l             ; argument block (ARG0-ARG15)
  1543.    Args3.l             ; argument block (ARG0-ARG15)
  1544.    Args4.l             ; argument block (ARG0-ARG15)
  1545.    Args5.l             ; argument block (ARG0-ARG15)
  1546.    Args6.l             ; argument block (ARG0-ARG15)
  1547.    Args7.l             ; argument block (ARG0-ARG15)
  1548.    Args8.l             ; argument block (ARG0-ARG15)
  1549.    Args9.l             ; argument block (ARG0-ARG15)
  1550.    Args10.l            ; argument block (ARG0-ARG15)
  1551.    Args11.l            ; argument block (ARG0-ARG15)
  1552.    Args12.l            ; argument block (ARG0-ARG15)
  1553.    Args13.l            ; argument block (ARG0-ARG15)
  1554.    Args14.l            ; argument block (ARG0-ARG15)
  1555.    Args15.l            ; argument block (ARG0-ARG15)
  1556.    EndMark.l           ;End of the FillStruct
  1557. End NEWTYPE
  1558.  
  1559. The Args?.l are the 16 slots that can possibly be filled ready for 
  1560. converting into the RexxMsg structure.  The Flags.w is a WORD value 
  1561. representing the type of LONG word you are supplying for each ARGSLOT 
  1562. (Arg?.l).
  1563.  
  1564. Each bit in the Flags WORD is representative of a single Args?.l, where
  1565. a set bit represents a numerical value to be passed and a clear bit 
  1566. represents a  string argument to be converted into a ArgString before 
  1567. installing in the RexxMsg.  The Flags Value is easiest to supply as a 
  1568. binary number to make the bits visible and would look like this.
  1569.  
  1570. %0000000000000000  ;This represents that all Arguments are Strings.
  1571.  
  1572. %0110000000000000  ;This represent the second and third as being 
  1573.                     integers.
  1574.  
  1575. FillRexxMsg expects to find the address of any strings in the Args?.l 
  1576. slots so it is important to remember when filling a FillStruct that you 
  1577. must pass the string address and not the name of the string.  This is 
  1578. acomplished using the '&' address of operand.
  1579.  
  1580. So to use FillRexxMsg we must do the following things in our program:
  1581.  
  1582. 1. Allocate a FillStruct
  1583. 2. Set the flags in the FillStruct\Flags.w
  1584. 3. Fill the FillStruct with either integer values or the
  1585.    addresses of our string arguments.
  1586. 4. Call FillRexxMsg with the LONG address of our rexxmsg and the
  1587.    LONG address of our FillStruct.
  1588.  
  1589. To accomplish this takes the following code:
  1590.  
  1591.     ;Allocate our FillStruct (called F)
  1592.  
  1593.     DEFTYPE.FillStruct F   
  1594.  
  1595.     ;assign some string arguments
  1596.  
  1597.     T$="open":T1$="0123456789"   
  1598.  
  1599.     ;Fill in our FillStruct with flags and (&) addresses of our 
  1600.          strings
  1601.  
  1602.     F\Flags= %0010000000000000,&T$,&T1$,4
  1603.  
  1604.     ;Third argument here is an integer (4).
  1605.  
  1606.     Port.l=CreateMsgPort("host")
  1607.     msg.l=CreateRexxMsg(Port,"vc","host")
  1608.  
  1609.     FillRexxMsg msg,&F
  1610.  
  1611.      ;<-3 args see #RXFUNC
  1612.  
  1613.     SendRexxCommand msg,"",#RXFUNC|#RXFF_RESULT|3
  1614.  
  1615.  
  1616.  
  1617. Function: CreateArgString()
  1618. ---------------------------------------------------------------------------
  1619. Syntax: ArgString.l=CreateArgString("this is a string")
  1620. Modes: Amiga
  1621.  
  1622. Description:
  1623. CreateArgString() builds an ARexx compatible ArgString structure around
  1624. the provided string.  All strings sent to, or received from Arexx are in
  1625. the form of ArgStrings. See the TYPE RexxARG.
  1626.  
  1627. If all is well the return will be a LONG address of the ArgString 
  1628. structure. The pointer will actually point to the NULL terminated String
  1629. with the remainder of the structure available at negative offsets.
  1630.  
  1631.     arg.l=CreateArgString("this is a string")
  1632.       IF arg=0 THEN Error_Routine{}:ENDIF
  1633.     DeleteArgString arg
  1634.  
  1635. NOTE: An ArgString maybe used as a normal BB2 string variable
  1636. by simple conversion using PEEK$ 
  1637.  
  1638. i.e. msg$=PEEK$(arg) or perhaps NPRINT PEEK$(arg)
  1639.  
  1640. NOTE: Most of the BB2 Arexx Functions call this themselves and 
  1641. there will be only limited need for you to access this function.
  1642.  
  1643.  
  1644. Statement: DeleteArgString
  1645. --------------------------------------------------------------------------
  1646. Syntax:DeleteArgString ArgString
  1647. Modes: Amiga
  1648.  
  1649. Description:
  1650. DeleteArgString is designed to Delete ArgStrings allocated by either 
  1651. Blitz2 or ARexx in a system friendly way. It takes only one argument the
  1652. LONGWORD address of an ArgString as returned by CreateArgString().
  1653.  
  1654.     arg.l=CreateArgString("this is a string")
  1655.       IF arg=0 THEN Error_Routine{}:ENDIF
  1656.     DeleteArgString arg
  1657.  
  1658. NOTE: This function is also called automatically by most of 
  1659. the BB2 Arexx Functions that need it so you should only need to call this on 
  1660. rare occations.
  1661.  
  1662.  
  1663. Statement: SendRexxCommand
  1664. --------------------------------------------------------------------------
  1665. SendRexxCommand rexxmsg,"commandstring",#RXCOMM|#RXFF_RESULT
  1666. Modes: Amiga
  1667.  
  1668. Description:
  1669. SendRexxCommand is designed to fill and send a RexxMsg structure to 
  1670. ARexx inorder to get ARexx to do something on your behalf.
  1671.  
  1672. The arguments are as follows;
  1673.  
  1674. Rexxmsg is the LONGWORD address of a RexxMsg structure as returned by 
  1675. CreateRexxMsg().
  1676.  
  1677. Commandstring is the command string you wish to send to ARexx. This is a
  1678. string as in "this is a string" and will vary depending on what you wish
  1679. to do with ARexx. Normally this will be the name of an ARexx script file
  1680. you wish to execute. ARexx will then look for the script by the name as 
  1681. well as the name with the exten added.(this is the exten you used when 
  1682. you created the RexxMsg structure using CreateRexxMsg()). This could 
  1683. also be a string file. That is a complete ARexx script in a single line.
  1684.  
  1685. ActionCodes are the flag values you use to tell ARexx what you want it 
  1686. to do with the commandstring you have supplied. The possible flags are 
  1687. as follows;
  1688.  
  1689. COMMAND (ACTION) CODES
  1690.  
  1691. The command codes that are currently implemented in the resident process
  1692. are described below. Commands are listed by their mnemonic codes,
  1693. followed by the valid modifier flags. The final code value is always the
  1694. logical OR of the code value and all of the modifier flags selected. The
  1695. command code is installed in the rm_Action field of the message packet.
  1696.  
  1697. USAGE: RXADDCON
  1698.  
  1699. This code specifies an entry to be added to the Clip List. Parameter 
  1700. slot ARGO points to the name string,slot ARG1 points to the value 
  1701. string,and slot ARG2 contains the length of the value string.
  1702.  
  1703. The name and value arguments do not need to be argstrings,but can be 
  1704. just pointers to storage areas. The name should be a null-terminated 
  1705. string,but the value can contain arbitrary data including nulls.
  1706.  
  1707. USAGE: RXADDFH
  1708.  
  1709. This action code specifies a function host to be added to the Library 
  1710. List. Parameter slot ARGO points to the (null-terminated) host name 
  1711. string,and slot ARG1 holds the search priority for the node. The search
  1712.  priority should be an integer between 100 and -100 inclusive;the 
  1713. remaining priority ranges are reserved for future extensions. If a node
  1714. already exists with the same name,the packet is returned with a warning
  1715. level error code.
  1716.  
  1717. Note that no test is made at this time as to whether the host port 
  1718. exists.
  1719.  
  1720. USAGE:RXADDLIB
  1721.  
  1722. This code specifies an entry to be added to the Library List. Parameter
  1723. slot ARGO points to a null-terminated name string referring either to a
  1724. function library or a function host. Slot ARG1 is the priority for the 
  1725. node and should be an integer between 100 and -100 inclusive;the 
  1726. remaining priority ranges are reserved for future extensions. Slot ARG2
  1727. contains the entry Point offset and slot ARG3 is the library version 
  1728. number. If a node already exists with the same name,the packet is 
  1729. returned with a warning level error code. Otherwise,a new entry is added
  1730. and the library or host becomes available to ARexx programs. Note that 
  1731. no test is made at this time as to whether the library exists and can be
  1732. opened.
  1733.  
  1734. USAGE:RXCOMM [RXFF_TOKEN] [RXFF_STRING] [RXFF_RESULT] [RXFF_NOIO]
  1735.  
  1736. Specifies a command-mode invocation of an ARexx program. Parameter slot
  1737. ARGO must contain an argstring Pointer to the command string. The 
  1738. RXFB_TOKEN flag specifies that the command line is to be tokenized 
  1739. before being passed to the invoked program. The RXFB_STRING flag bit 
  1740. indicates that the command string is a "string file." Command 
  1741. invocations do not normally return result strings,but the RXFB_RESULT
  1742. flag can be set if the caller is prepared to handle the cleanup 
  1743. associated with a returned string. The RXFB_NOIO modifier suppresses the
  1744. inheritance of the host's input and output streams.
  1745.  
  1746. USAGE:RXFUNC [RXFF_RESULT] [RXFF_STRING] [RXFF_NOIO] argcount
  1747.  
  1748. This command code specifies a function invoction. Parameter slot ARGO
  1749. contains a pointer to the function name string,and slots ARG1 through 
  1750. ARG15 point to the argument strings,all of which must be passed as 
  1751. argstrings. The lower byte of the command code is the argument count;
  1752. this count excludes the function name string itself. Function calls 
  1753. normally set the RXFB_RESULT flag,but this is not mandatory. The 
  1754. RXFB_STRING modifier indicates that the function name string is actually
  1755. a "string file". The RXFB_NOIO modifier suppresses the inheritance of 
  1756. the host's input and output streams.
  1757.  
  1758. USAGE:RXREMCON
  1759.  
  1760. This code requests that an entry be removed from the Clip List. 
  1761. Parameter slot ARGO points to the null-terminated name to be removed. 
  1762. The Clip List is searched for a node matching the supplied name,and if a
  1763. match is found the list node is removed and recycled. If no match is 
  1764. found the packet is returned with a warning error code.
  1765.  
  1766. USAGE:RXREMLIB
  1767.  
  1768. This command removes a Library List entry. Parameter slot ARGO points to
  1769. the null terminated string specifying the library to be removed. The 
  1770. Library List is searched for a node matching the library name,and if a
  1771. match is found the node is removed and released. If no match is found 
  1772. the packet is returned with a warning error code. The libary node will 
  1773. not be removed if the library is currently being used by an ARexx 
  1774. program.
  1775.  
  1776. USAGE:RXTCCLS
  1777.  
  1778. This code requests that the global tracing console be closed. The 
  1779. console window will be closed immediately unless one or more ARexx 
  1780. programs are waiting for input from the console. In this event,the 
  1781. window will be closed as soon as the active programs are no longer 
  1782. using it.
  1783.  
  1784. USAGE:RXTCOPN
  1785.  
  1786. This command requests that the global tracing console be opened. Once
  1787. the console is open,all active ARexx programs will divert their tracing
  1788. output to the console. Tracing input(for interactive debugging)will also
  1789. be diverted to the new console. Only one console can be opened;
  1790. subsequent RXTCOPN requests will be returned with a warning error 
  1791. message.
  1792.  
  1793. MODIFIER FLAGS
  1794.  
  1795. Command codes may include modifier flags to select various processing 
  1796. options. Modifier flags are specific to certain commands,and are 
  1797. ignored otherwise.
  1798.  
  1799. RXFF_NOIO.
  1800.  
  1801. This modifier is used with the RXCOMM and RXFUNC command codes to 
  1802. suppress the automatic inheritance of the host's input and output 
  1803. streams.
  1804.  
  1805. RXFF_NONRET.
  1806.  
  1807. Specifies that the message packet is to be recycled by the resident 
  1808. process rather than being returned to the sender. This implies tht 
  1809. the sender doesn't care about whether the requested action succeeded,
  1810. since the returned packet provides the only means of acknowledgement. 
  1811.  
  1812. (RXFF_NONRET MUST NOT BE USED AT ANY TIME)
  1813.  
  1814. RXFF_RESULT.
  1815.  
  1816. This modifer is valid with the RXCOMM and RXFUNC commands,and requests 
  1817. that the called program return a result string. If the program EXITs(or
  1818. RETURNs)with an expression,the expression result is returned to the 
  1819. caller as an argstring. This ArgString then becomes the callers 
  1820. responsibility to release. This is automatically accomplished by using
  1821. GetResultString(). It is therefore imperitive that if you use 
  1822. RXFF_RESULT then you must use GetResultString() when the message packet
  1823. is returned to you or you will incure a memory loss equal to the size of
  1824. the ArgString Structure.
  1825.  
  1826. RXFF_STRING.
  1827.  
  1828. This modifer is valid with the RXCOMM and RXFUNC command codes. It 
  1829. indicates that the command or function argument(in slot ARGO)is a 
  1830. "string file" rather than a file name.
  1831.  
  1832. RXFF_TOKEN.
  1833.  
  1834. This flag is used with the RXCOMM code to request that the command 
  1835. string be completely tokenized before being passed to the invoked 
  1836. program. Programs invoked as commands normally have only a single 
  1837. argument string. The tokenization process uses "white space" to 
  1838. separate the tokens,except within quoted strings. Quoted strings can use
  1839. either single or double quotes,and the end of the command string(a null 
  1840. character) is considered as an implicit closing quote.
  1841.  
  1842. EXAMPLES:
  1843.  
  1844.     Port.l=OpenRexxPort("TestPort")
  1845.         If Port = NULL End:EndIf
  1846.     msg.l=CreateRexxMsg(Port,"vc","TestPort")
  1847.         If msg=NULL End:EndIf
  1848.     SendRexxCommand msg,"open",#RXCOMM|#RXFF_RESULT
  1849.  
  1850.  
  1851. Statement: ReplyRexxMsg
  1852. --------------------------------------------------------------------------
  1853. Syntax: ReplyRexxMsg rexxmsg,Result1,Result2,"ResultString"
  1854. Modes: Amiga
  1855.  
  1856. Description:
  1857. When ARexx sends you a RexxMsg (Other than a reply to yours i.e. 
  1858. sending yours back to you with results) you must repl to the message
  1859. before ARexx will continue or free that memory associated with that 
  1860. RexxMsg.  ReplyRexxMsg accomplishes this for you. ReplyRexxMsg also will
  1861. only reply to message that requires a reply so you do not have to 
  1862. include message checking routines in your source simply call 
  1863. ReplyRexxMsg on every message you receive wether it is a command or not.
  1864.  
  1865. The arguments are;
  1866.  
  1867. rexxmsg is the LONGWORD address of the RexxMsg Arexx sent you as 
  1868. returned by GetMsg_(Port).
  1869.  
  1870. Result1 is 0 or a severity value if there was an error.
  1871.  
  1872. Result2 is 0 or an Arexx error number if there was an error processing 
  1873. the command that was contained in the message.
  1874.  
  1875. ResultString is the result string to be sent back to Arexx. This will 
  1876. only be sent if Arexx requested one and Result1 and 2 are 0.
  1877.  
  1878. ReplyRexxMsg rexxmsg,0,0,"THE RETURNED MESSAGE"
  1879.  
  1880.  
  1881. Function: GetRexxResult()
  1882. --------------------------------------------------------------------------
  1883. Syntax: Result.l=GetRexxResult(rexxmsg,ResultNum)
  1884. Modes: Amiga
  1885.  
  1886. Description:
  1887. GetRexxResult extracts either of the two result numbers from the RexxMsg
  1888. structure.  Care must be taken with this Function to ascertain wether 
  1889. you are dealing with error codes or a ResultString address.  Basically 
  1890. if result 1 is zero then result 2 will either be zero or contain a 
  1891. ArgString pointer to the ResultString. This should then be obtained 
  1892. using GetResultString().
  1893.  
  1894. The arguments to GetRexxResult are;
  1895.  
  1896. rexxmsg is the LONGWORD address of a RexxMsg structure returned from 
  1897. ARexx.
  1898.  
  1899. ResultNum is either 1 or 2 depending on wether you wish to check result 
  1900. 1 or result 2.
  1901.  
  1902.     ;print the severity code if there was an error
  1903.  
  1904.     NPrint GetRexxResult(msg,1)
  1905.  
  1906.     ;check for ResultString and get it if there is one
  1907.  
  1908.     IF GetRexxResult(msg,1)=0
  1909.     IF GetRexxResult(msg,2) THEN GetResultString(msg)    
  1910.     ENDIF
  1911.  
  1912.  
  1913. Function: GetRexxCommand()
  1914. --------------------------------------------------------------------------
  1915. Syntax: String$=GetRexxCommand(msg,1)
  1916. Modes: Amiga
  1917.  
  1918. Description:
  1919. GetRexxCommand allows you access to all 16 ArgString slots in the given 
  1920. RexxMsg. Slot 1 contains the command string sent by ARexx in a command
  1921. message so this allows you to extract the Command.
  1922.  
  1923. Arguments are:
  1924.  
  1925. rexxmsg is a LONGWORD address of the RexxMsg structure as returned by 
  1926.  RexxEvent()
  1927.  
  1928. ARGNum is an integer from 1 to 16 specifying the ArgString Slot you wish
  1929. to get an ArgString from.
  1930.  
  1931. BEWARE YOU MUST KNOW THAT THERE IS AN ARGSTRING THERE.
  1932.  
  1933.  
  1934. Function: GetResultString()
  1935. --------------------------------------------------------------------------
  1936. Syntax: String$=GetResultString(rexxmsg)
  1937. Modes: Amiga
  1938.  
  1939. Description:
  1940. GetResultString allows you to extract the result string returned to you
  1941. by ARexx after it has completed the action you requested. ARexx will 
  1942. only send back a result string if you asked for one (using the 
  1943. ActionCodes) and the requested action was successful.
  1944.  
  1945.     ;check for ResultString and get it if there is one
  1946.  
  1947.     IF GetRexxResult(msg,1)=0
  1948.       IF GetRexxResult(msg,2) THEN GetResultString(msg)
  1949.     ENDIF
  1950.  
  1951. NOTE: Do not attempt to DeleteArgString the result
  1952. string returned by this function as the return is a string and not an 
  1953. ArgString pointer. BB2 will automatically delete this argstring for you.
  1954.  
  1955.  
  1956. Statement: Wait
  1957. --------------------------------------------------------------------------
  1958. Syntax: Wait
  1959. Modes: Amiga
  1960.  
  1961. Description:
  1962. Wait halts all program execution until an event occurs that the program
  1963. is interested in.  Any intuition event such as clicking on a gadget in 
  1964. a window will start program execution again.
  1965.  
  1966. A message arriving at a MsgPort will also start program execution again.
  1967. So you may use Wait to wait for input from any source including messages
  1968. from ARexx to your program.
  1969.  
  1970. Wait should always be paired with EVENT if you need to consider 
  1971. intuition events in your event handler loop.
  1972.  
  1973.     Repeat
  1974.           Wait:rmsg.l=REXXEVENT(Port):ev.l=EVENT
  1975.           IF IsRexxMsg(Rmsg) Process_Rexx_Messages{}:ENDIF
  1976.           ;
  1977.           ;
  1978.           ;Rest of normal intuition event loop statements case etc
  1979.           ;
  1980.     Until ev =$200
  1981.  
  1982.  
  1983. Function: RexxEvent()
  1984. --------------------------------------------------------------------------
  1985. Syntax: Rmsg.l=RexxEvent(Port)
  1986. Modes: Amiga
  1987.  
  1988. Description:
  1989. RexxEvent is our Arexx Equivalent of EVENT().  It's purpose is to check
  1990. the given Port to see if there is a message waiting there for us.
  1991.  
  1992. It should be called after a WAIT and will either return a NULL to us if
  1993. there was no message or the LONG address of a RexxMsg Structure if 
  1994. there was a message waiting.
  1995.  
  1996. Multiple Arexx MsgPorts can be handled using separate calls to 
  1997. RexxEvent():
  1998.  
  1999. Wait:Rmsg1.l=RexxEvent(Port1):Rmsg2.l=RexxEvent(Port2):etc
  2000.  
  2001. RexxEvent also takes care of automatically clearing the rexxmsg if it is
  2002. our message being returned to us.
  2003.  
  2004. The argument is the LONG address of a MsgPort as returned by 
  2005. CreateMsgPort().
  2006.  
  2007. EXAMPLES:
  2008.  
  2009.     Repeat
  2010.           Wait:Rmsg.l=REXXEVENT(Port):ev.l=EVENT
  2011.           IF IsRexxMsg(Rmsg) Process_Rexx_Messages{}:ENDIF
  2012.           ;
  2013.           ;
  2014.           ;Rest of normal intuition event loop statements case etc
  2015.     Until ev =$200
  2016.  
  2017. SEE ALSO:  WAIT() , CREATEMSGPORT() 
  2018.  
  2019.  
  2020. Function: IsRexxMsg()
  2021. --------------------------------------------------------------------------
  2022. Syntax: IsRexxMsg(rexxmsg)
  2023. Modes: Amiga
  2024.  
  2025. Description:
  2026. IsRexxMsg tests the argument (a LONGWORD pointer hopefully to a message
  2027. packet) to see if it is a RexxMsg Packet. If it is TRUE is returned (1)
  2028. or FALSE if it is not (0).
  2029.  
  2030.     Repeat
  2031.           Wait:Rmsg.l=REXXEVENT:ev.l=EVENT
  2032.           IF IsRexxMsg(Rmsg) Process_Rexx_Messages{}:ENDIF
  2033.           ;
  2034.           ;
  2035.         ;Rest of normal intuition event loop statements case etc
  2036.     Until ev =$200
  2037.  
  2038. As the test is non destructive and extensive passing a NULL value or a 
  2039. LONGWORD that does not point to a Message structure (Intuition or Arexx)
  2040. will safely return as FALSE.
  2041.  
  2042. SEE ALSO:   CREATEREXXMSG() , GETMSG_() 
  2043.  
  2044.  
  2045. Function: RexxError()
  2046. --------------------------------------------------------------------------
  2047. Syntax: ErrorString$=RexxError(ErrorCode)
  2048. Modes: Amiga
  2049.  
  2050. Description:
  2051. RexxError converts a numerical error code such as you would get from 
  2052. GetRexxResult(msg,2) into an understandable string error message.  If 
  2053. the ErrorCode is not known to ARexx a string stating so is returned  
  2054. this ensures that this function will always succeed.
  2055.  
  2056.     NPRINT RexxError(5)
  2057.  
  2058. SEE ALSO:  GETREXXRESULT() 
  2059.  
  2060.  
  2061.  
  2062.                              AGA PALETTE HANDLING
  2063.  
  2064. Blitz 2's palette object has (again) changed. Palette objects are now 
  2065. capable of containing AGA compatible 24 bit colours. 
  2066.  
  2067.                                  AGA Commands:
  2068.  
  2069.                              AGARGB           AGAGREEN 
  2070.                              AGAPALRGB        AGABLUE  
  2071.                              AGARED          
  2072.  
  2073.                              NEW SCREENFLAGS     
  2074.                              3.0 BITMAP HANDLING 
  2075.                              NEW GADGET HANDLING 
  2076.  
  2077. The new palette objects look like this:
  2078.  
  2079. NEWTYPE.rgbcomp
  2080.   _red.l   ;left justified red component.
  2081.   _green.l ;left justified green component.
  2082.   _blue.l  ;left justified blue component.
  2083. End NEWTYPE
  2084.  
  2085. NEWTYPE.palettedata
  2086.   _numcols.w          ; same as palette/_numcols.
  2087.   _zero.w             ; for compatibility with graphics lib         
  2088.                       ; LoadRGB32.
  2089.   _rgbs.rgbcomp[256]  ;256 is the max the amount will actually
  2090.                       ;depend upon the highest palette entry.
  2091.   _zero2.l            ;for graphics lib too.
  2092. End NEWTYPE
  2093.  
  2094. This is the actual object return by Addr Palette(n):
  2095.  
  2096. NEWTYPE.palette
  2097.   _*data.palettedata ; 00: NULL if no palette present
  2098.                      ;     else a pointer to  palettedata.
  2099.   _numcols.w         ; 04: num cols present in palettedata.
  2100.                      ;     below is colour cycling info.
  2101.   _lowcol.w          ; 06: low colour for cycle range.
  2102.   _hicol.w           ; 08: high colour for cycle range.
  2103.   _speed.w           ; 10: speed of cycle : 16384 = max speed
  2104.                      ;     sign indicates cycling direction.
  2105.   _var.w             ; 12: cvariable speed is added to.
  2106.                      ;
  2107.                      ; more possible cycling entries....
  2108.                      ;
  2109.                      ; 128: sizeof.
  2110. End NEWTYPE
  2111.  
  2112. Now for the new AGA functions added to Blitz 2...these will all generate
  2113. a runtime error if used on a non-AGA Amiga....
  2114.  
  2115.  
  2116. Statement: AGARGB
  2117. --------------------------------------------------------------------------
  2118. Syntax: AGARGB Colour Register,Red,Green,Blue
  2119. Modes: Amiga
  2120.  
  2121. Description:
  2122. The AGARGB command is the AGA equivalent of the RGB command. The 'Red',
  2123. 'Green' and 'Blue' parameters must be in the range 0 through 255, while
  2124. 'Colour Register' is limited to the number of colours available on the 
  2125. currently used screen.
  2126.  
  2127. Example:
  2128.  
  2129.     ;
  2130.     ; AGA test
  2131.     ;
  2132.  
  2133.     Screen 0,0,0,1280,512,8,$8024,"SUPER HIRES 256 COLORS",1,2
  2134.  
  2135.     ScreensBitMap 0,0
  2136.  
  2137.     For i=0 To 255
  2138.         AGARGB i,i/2,i/3,i       ;shades of purple
  2139.           Circle 640,256,i*2,i,i   ;big SMOOTH circles
  2140.     Next
  2141.  
  2142.     MouseWait
  2143.     
  2144.  
  2145. Statement: AGAPalRGB
  2146. --------------------------------------------------------------------------
  2147. Syntax: AGAPalRGB Palette#,Colour Register,Red,Green,Blue
  2148. Modes: Amiga
  2149.  
  2150. Description:
  2151. The AGAPalRGB command is the AGA equivalent of the PalRGB command. 
  2152. AGAPalRGB allows you to set an individual colour register within a 
  2153. palette object. This command only sets up an entry in a palette object,
  2154. and will not alter the actual screen palette until a 'Use Palette' is 
  2155. executed.
  2156.  
  2157.  
  2158. Function: AGARed
  2159. --------------------------------------------------------------------------
  2160. Syntax: AGARed(colour register)
  2161. Modes: Amiga
  2162.  
  2163. Description:
  2164. The AGARed function returns the red component of the specified colour 
  2165. register within the currently used screen. The returned value will be 
  2166. within the range 0 (being no red) through 255 (being full red).
  2167.  
  2168.  
  2169. Function: AGAGreen
  2170. --------------------------------------------------------------------------
  2171. Syntax: AGAGreen(colour register)
  2172. Modes: Amiga
  2173.  
  2174. Description:
  2175. The AGAGreen function returns the green component of the specified 
  2176. colour register within the currently used screen. The returned value 
  2177. will be within the range 0 (being no green) through 255 (being full 
  2178. green).
  2179.  
  2180.  
  2181. Function: AGABlue
  2182. --------------------------------------------------------------------------
  2183. Syntax: AGABlue(colour register)
  2184. Modes: Amiga
  2185.  
  2186. Description:
  2187. The AGABlue function returns the blue component of the specified colour
  2188. register within the currently used screen. The returned value will be 
  2189. within the range 0 (being no blue) through 255 (being full blue).
  2190.  
  2191.  
  2192.                                 NEW SCREEN FLAGS
  2193.  
  2194. The superhires viewmode flag $20 is now acceptable, but should always be
  2195. used in conjunction with the standard hires flag of $8000. 
  2196.  
  2197. The depth of a screen may now be specified up to 8 bitplanes (256 
  2198. colours) deep (if you've got an AGA machine!). Here's how you would go
  2199. about opening a super-hires, 256 colour screen:
  2200.  
  2201. Screen 0,0,0,1280,256,8,$8020,"MyScreen",1,0
  2202.  
  2203.  
  2204. 3.0 BITMAP HANDLING
  2205.  
  2206. Blitz 2's Bitmap object has been upgraded to allow for interleaved 
  2207. bitmaps:
  2208.  
  2209. NewType.Bitmap
  2210. _   ebwidth[0]     ;00: for compatability.
  2211. _   linemod.w      ;00: value to get from one scanline to next.
  2212. _   height.w       ;02: currently pixel height - but open to commodore
  2213.                    ;    'enhancement'.
  2214. _   depth.w        ;04: number of bitplanes.
  2215. _   pad.b[2]       ;06: nothing.
  2216. _   data.l[8]      ;08: actual bitplane pointers.
  2217. _   pad2.b[12]     ;40: zilch.
  2218. _   flags.w        ;0=normal bitmap, <0=interleaved.
  2219. _   bitplanemod.w  ;value to get from one bitplane to next. MAY BE 0!
  2220. _   xclip.w        ;pixel width for render clipping
  2221. _   yclip.w        ;pixel height for render clipping
  2222. _   cclip.w        ;number of colours available on bitmap ( = 2^_depth)
  2223. _   isreal.w       ;0=no bitmap here, <0=blitz created bitmap, 
  2224.                     >0=borrowed
  2225.                ;64: sizeof
  2226. End NEWTYPE
  2227.  
  2228. Also, many Blitz2 bitmap related commands have been altered to take this
  2229. new object into account.
  2230.  
  2231.  
  2232. NEW GADGET HANDLING
  2233.  
  2234. A new bit, bit 9, in the 'Flags' parameter of the 'TextGadget' and 
  2235. 'ShapeGadget' commands allow you to create mutually exclusive radio 
  2236. button type gadgets. These gadgets DO NOT require Kickstart 2.0 to 
  2237. operate!
  2238.  
  2239. Here is an example of setting up some radio button style text gadgets:
  2240.  
  2241. TextGadget 0,16,16,512,1,"OPTION 1":Toggle 0,1,On
  2242. TextGadget 0,16,32,512,2,"OPTION 2"
  2243. TextGadget 0,16,48,512,3,"OPTION 3"
  2244.  
  2245. The new 'ButtonGroup' command allows you to specify which 'group' a 
  2246. series of button gadgets belong to. See 'ButtonGadget' below.
  2247.  
  2248. Note that if you are using button gadgets, you SHOULD really toggle ONE
  2249. of the gadgets 'On' before giving the gadgetlist to a window - as in the
  2250. example above.
  2251.  
  2252. Text Gadgets may now be used to create 'cycling' gadgets. Again, these 
  2253. gadgets DO NOT require kickstart 2.0 to work.
  2254.   
  2255. If you create a text gadget which contains the '|' character in the 
  2256. gadget's text, Blitz 2 will recognize this as a 'cycling' gadget, using 
  2257. the '|' character to separate the options - like this:
  2258.  
  2259.     TextGadget 0,16,16,0,1," HELLO |GOODBYE| SEEYA |"
  2260.  
  2261. Now, each time this gadget is clicked on, the gadgets text will cycle
  2262. through 'Hello', 'GOODBYE' and 'SEEYA'. Note that each option is spaced 
  2263. out to be of equal length. This feature should not be used with a 
  2264. GadgetJam mode of 0.
  2265.  
  2266.  NEW GADGETS EXAMPLE 
  2267.  
  2268. NEW GADGET COMMANDS:
  2269.  
  2270.                              GAGETSTATUS     
  2271.                              BUTTONGROUP     
  2272.                              BUTTONID        
  2273.                              ENABLE          
  2274.                              DISABLE         
  2275.                              SETGADGETSTATUS 
  2276.  
  2277.  
  2278. Function: GadgetStatus
  2279. --------------------------------------------------------------------------
  2280. Syntax: GadgetStatus(GadgetList#,Id)
  2281. Modes: Amiga
  2282.  
  2283. Description:
  2284. GadgetStatus may be used to determine the status of the specified 
  2285. gadget. In the case of 'toggle' type gadget, GadgetStatus will return 
  2286. true (-1) if the gadget is currently on, or false (0) if the gadget is 
  2287. currently off.
  2288.  
  2289. In the case of a cycling text gadget, GadgetStatus will return a value 
  2290. of 1 or greater representing the currently displayed text within the 
  2291. gadget.
  2292.  
  2293.  
  2294. Statement: ButtonGroup
  2295. --------------------------------------------------------------------------
  2296. Syntax: ButtonGroup Group
  2297. Modes: Amiga
  2298.  
  2299. Description:
  2300. ButtonGroup allows you to determine which 'group' a number of button 
  2301. type gadgets belong to. Following the execution of ButtonGroup, any 
  2302. button gadgets created will be identified as belonging to the specified
  2303. group. The upshot of all this is that button gadgets are only mutually 
  2304. exclusive to other button gadgets within the same group.
  2305.  
  2306. 'Group' must be a positive number greater than 0. Any button gadgets 
  2307. created before a 'ButtonGroup' command is executed will belong to group
  2308. 1.
  2309.  
  2310.  
  2311. Function: ButtonId
  2312. --------------------------------------------------------------------------
  2313. Syntax: ButtonId(GadgetList#,ButtonGroup)
  2314. Modes: Amiga
  2315.  
  2316. Description:
  2317. ButtonId may be used to determine which gadget within a group of button
  2318. type gadgets is currently selected. The value returned will be the 
  2319. GadgetId of the button gadget currently selected.
  2320.  
  2321.  
  2322. Statements: Enable & Disable
  2323. --------------------------------------------------------------------------
  2324. Syntax: Enable GadgetList#,Id  & Disable GadgetList#,Id
  2325. Modes: Amiga
  2326.  
  2327. Description:
  2328. A gadget when disabled is covered by a "mesh" and can not be accessed 
  2329. by the user. The commands Enable and Disable allow the programmer to 
  2330. access this feature of Intuition.
  2331.  
  2332.  
  2333. Statement: SetGadgetStatus
  2334. --------------------------------------------------------------------------
  2335. Syntax: SetGadgetStatus GadgetList#,Id,Value  
  2336. Modes: Amiga
  2337.  
  2338. Description:
  2339. SetGadgetStatus is used to set a cycling text gadget to a particular 
  2340. value, once set ReDraw should be used to refresh the gadget to reflect 
  2341. it's new value.
  2342.  
  2343.  
  2344. NEW GADGETS EXAMPLE:
  2345.  
  2346.     ;
  2347.     ; new gadget types
  2348.     ;
  2349.     WBStartup:FindScreen 0     ;open on workbench
  2350.     TextGadget 0,32,14,0,0,"CYCLE 1|CYCLE 2|CYCLE 3" 
  2351.  
  2352.     ButtonGroup 1  ;first group of radio buttons follows
  2353.     For i=1 To 5
  2354.         TextGadget 0,32,14+i*14,512,i,"CHANNEL #"+Str$(i)
  2355.     Next
  2356.  
  2357.     ButtonGroup 2  ;second group of radio buttons follows
  2358.     For i=6 To 10
  2359.         TextGadget 0,32,14+i*14,512,i,"BAND #"+Str$(i)
  2360.     Next
  2361.     Window 0,20,20,160,180,$1008,"GADGET TEST",1,2,0  
  2362.     
  2363.     Repeat               ;wait until close window gadget hit
  2364.         ev.l=WaitEvent
  2365.     Until ev=$200
  2366.  
  2367.  
  2368.                               Available commands:
  2369.  
  2370.                                     SYSTEMDATE 
  2371.                                     DATE$      
  2372.                                     NUMDAYS    
  2373.                                     DATEFORMAT 
  2374.                                     DAYS       
  2375.                                     MONTHS     
  2376.                                     YEARS      
  2377.                                     WEEKDAY    
  2378.                                     HOURS      
  2379.                                     MINS       
  2380.                                     SECS       
  2381.  
  2382.  
  2383.  
  2384. Function: SystemDate
  2385. --------------------------------------------------------------------------
  2386. Syntax: SystemDate  
  2387. Modes: Amiga
  2388.  
  2389. Description:
  2390. SystemDate returns the system date as the number of days passed since 
  2391. 1/1/1978.
  2392.  
  2393. Example:
  2394.  
  2395. ;
  2396. ; date/time test
  2397. ;
  2398.  
  2399. Dim d$(6):Restore daynames:For i=0 To 6:Read d$(i):Next
  2400. Dim m$(12):Restore monthnames:For i=1 To 12:Read m$(i):Next
  2401.  
  2402. NPrint Date$(SystemDate)
  2403. NPrint d$(WeekDay)," ",Days," ",m$(Months)," ",Years
  2404. NPrint Hours,":",Mins,":",Secs
  2405. NPrint "press mouse to quit"
  2406. MouseWait
  2407.  
  2408. daynames:
  2409.     Data$ SUNDAY,MONDAY,TUESDAY,WEDNESDAY
  2410.     Data$ THURSDAY,FRIDAY,SATURDAY
  2411. monthnames:
  2412.     Data$ JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC
  2413.  
  2414.  
  2415. Function: Date$
  2416. --------------------------------------------------------------------------
  2417. Syntax: Date$ (days)
  2418. Modes: Amiga
  2419.  
  2420. Description:
  2421. Date$ converts the format returned by SystemDate (days passed since 
  2422. 1/1/1978) into a string format of dd/mm/yyyy or mm/dd/yyyy depending on
  2423. the dateformat (defaults to 0).
  2424.  
  2425.  
  2426. Function: NumDays
  2427. --------------------------------------------------------------------------
  2428. Syntax: NumDays (date$)
  2429. Modes: Amiga
  2430.  
  2431. Description:
  2432. Numdays converts a Date$ in the above format to the day count format, 
  2433. where numdays is the number of days since 1/1/1978.
  2434.  
  2435.  
  2436. Statement: DateFormat
  2437. --------------------------------------------------------------------------
  2438. Syntax: DateFormat format# ; 0 or 1
  2439. Modes: Amiga
  2440.  
  2441. Description:
  2442. DateFormat configures the way both date$ and numdays treat a string 
  2443. representation of the date: 0=dd/mm/yyyy and 1=mm/dd/yyyy
  2444.  
  2445.  
  2446. Functions: Days Months Years & WeekDay
  2447. --------------------------------------------------------------------------
  2448. Syntax: Days Months Years & WeekDay  
  2449. Modes: Amiga
  2450.  
  2451. Description:
  2452. Days Months and Years each return the particular value relevant to the 
  2453. last call to SystemDate. They are most useful for when the program needs
  2454. to format the output of the date other than that produced by date$. 
  2455. WeekDay returns which day of the week it is with Sunday=0 through to 
  2456. Saturday=6.
  2457.  
  2458.  
  2459. Functions: Hours  Mins & Secs
  2460. --------------------------------------------------------------------------
  2461. Syntax: Hours Mins & Secs
  2462. Modes: Amiga
  2463.  
  2464. Description:
  2465. Hours, Mins and Secs return the time of day when SystemDate was last 
  2466. called.
  2467.  
  2468.  
  2469.                            New Environment commands:
  2470.  
  2471.                                    WBWIDTH     
  2472.                                    WBHEIGHT    
  2473.                                    WBDEPTH     
  2474.                                    WBVIEWMODE  
  2475.                                    PROCESSOR   
  2476.                                    EXECVERSION 
  2477.  
  2478.                                 Added in BUM #4
  2479.  
  2480.  
  2481. Functions: WBWidth Height Depth & ViewMode
  2482. --------------------------------------------------------------------------
  2483. Syntax: WBWidth, WBHeight, WBDepth & WBViewMode
  2484. Modes: Amiga
  2485.  
  2486. Description:
  2487. The functions WBWidth, WBHeight, WBDepth & WBViewMode return the width, 
  2488. height,depth & viewmode of the current WorkBench screen as configured 
  2489. by preferences.
  2490.  
  2491.  
  2492. Functions: Processor & ExecVersion
  2493. --------------------------------------------------------------------------
  2494. Syntax: Processor & ExecVersion
  2495. Modes: Amiga
  2496.  
  2497. Description:
  2498. The two functions Processor & ExecVersion return the relevant 
  2499. information about the system the program is running on. The values 
  2500. returned are as follows:
  2501.  
  2502.     ExecVersion   OS Release    Processor   Part#
  2503.         ------------+------------   -----------+---------------    
  2504.         33          |  1.2          0          | 68000
  2505.         34?         |  1.3          1          | 68010
  2506.         36          |  2.0          2          | 68020        
  2507.         39          |  3.0          3          | 68030
  2508.                 |               4          | 68040
  2509.  
  2510.  
  2511.                     New drawing commands included in BUM #4:
  2512.  
  2513.                                  POLY            
  2514.                                  POLYF           
  2515.                                  BITPLANESBITMAP 
  2516.                                  CLIPBLIT        
  2517.  
  2518.  
  2519. Statement: Poly & Polyf
  2520. --------------------------------------------------------------------------
  2521. Syntax: Poly  numpoints,*coords.w,color
  2522.         Polyf numpoints,*coords.w,color[,color2]
  2523. Modes: Amiga/Blitz
  2524.  
  2525. Description:
  2526. Poly & Polyf are bitmap based commands such as Box and Line. They draw
  2527. polygons (unfilled and filled respectively) using coordinates from an 
  2528. array or newtype of words. Polyf has an optional parameter color2, if 
  2529. used this colour will be used if the coordinates are listed in anti-
  2530. clockwise order, useful for 3D type applications. If color2= -1 then the
  2531. polygon is not drawn if the verticies are listed in anti-clockwise 
  2532. order.
  2533.  
  2534. Example:
  2535.  
  2536.     NEWTYPE .tri:x0.w:y0:x1:y1:x2:y2:End NEWTYPE
  2537.     BLITZ
  2538.     BitMap 0,320,256,3
  2539.     Slice 0,44,3:Show 0
  2540.     While Joyb(0)=0
  2541.           a.tri\x0=Rnd(320),Rnd(256),Rnd(320),Rnd(256),Rnd(320),Rnd(256)
  2542.       Polyf 3,a,1+Rnd(7)
  2543.     Wend
  2544.  
  2545.  
  2546. Statement: BitPlanesBitMap
  2547. --------------------------------------------------------------------------
  2548. Syntax: BitPlanesBitMap SrcBitMap, DestBitMap, PlanePick
  2549. Modes: Amiga/Blitz
  2550.  
  2551. Description:
  2552. BitPlanesBitMap creates a `dummy' bitmap from the SrcBitMap with only 
  2553. the bitplanes specified by the PlanePick mask. This is useful for shadow
  2554. effects etc. where blitting speed can be speed up because of the fewer 
  2555. bitplanes involved
  2556.  
  2557.  
  2558. Statement: ClipBlit
  2559. --------------------------------------------------------------------------
  2560. Syntax: ClipBlit Shape#,X,Y
  2561. Modes: Amiga/Blitz
  2562.  
  2563. Description:
  2564. ClipBlit is the same as the Blit command except ClipBlit will clip the 
  2565. shape to the inside of the used bitmap, all blit commands in Blitz2 are
  2566. due to be expanded with this feature. 
  2567.  
  2568.  
  2569.                             Window Library Additions
  2570.  
  2571.                                  The Commands:
  2572.  
  2573.                                WINDOW              
  2574.                                POSITIONSUPERBITMAP 
  2575.                                GETSUPERBITMAP      
  2576.                                PUTSUPERBITMAP      
  2577.                                WTITLE              
  2578.                                CLOSEWINDOW         
  2579.                                WPRINTSCROLL        
  2580.                                WBLIT               
  2581.                                BITMAPTOWINDOW      
  2582.                                EVENTCODE           
  2583.                                EVENTQUALIFIER      
  2584.  
  2585.  
  2586. Statement: Window
  2587. --------------------------------------------------------------------------
  2588. Syntax: Window Window#,x,y,width,height,flags,title$,dpen,bpen[,gadgetlist#
  2589.         [,bitmap#]]
  2590.  
  2591. The Window library has been extended to handle super bitmap windows. 
  2592. Super-BitMap windows allow the window to have it's own bitmap which can
  2593. actually be larger than the window. The two main benefits of this 
  2594. feature are the window's ability to refresh itself and the ability to 
  2595. scroll around a large area "inside" the bitmap.
  2596.  
  2597. To attach a BitMap to a Window set the SuperBitMap flag in the flags 
  2598. field and include the BitMap# to be attached.
  2599.  
  2600.  
  2601. Statement: PositionSuperBitMap
  2602. --------------------------------------------------------------------------
  2603. Syntax: PositionSuperBitMap x,y
  2604.  
  2605. PositionSuperBitMap is used to display a certain area of the bitmap in a
  2606. super bitmap window.
  2607.  
  2608. Example:
  2609.  
  2610.      ; 
  2611.      ; super bitmap example 
  2612.      ; 
  2613.  
  2614.      ;create large bimtap for our superbitmap window
  2615.  
  2616.      width=320:height=200 
  2617.      BitMap 0,width,height,2
  2618.      Circlef 160,100,160,100,1 : Box 0,0,width-1,height-1,3 
  2619.  
  2620.      FindScreen 0
  2621.      
  2622.      ;two sliders for the borders (see new gadget flags next page)
  2623.  
  2624.      PropGadget 0,3,-8,$18000+4+8+64,1,-20,8 
  2625.      PropGadget 0,-14,10,$11000+2+16+128,2,12,-20 
  2626.  
  2627.      ;reporting of mousemoves means we can track the propgadget as it is
  2628.       moved
  2629.  
  2630.      AddIDCMP $10 
  2631.      SizeLimits 32,32,width+22,height+20 
  2632.      Window 0,0,0,100,100,$1489,"HELLO",1,2,0,0 
  2633.      Gosub drawsuper 
  2634.      Repeat 
  2635.        ev.l=WaitEvent 
  2636.        If ev=2 Then Gosub dosize 
  2637.        If ev=$20 Then Gosub domove 
  2638.      Until ev=$200 
  2639.      End 
  2640.  
  2641.      dosize: 
  2642.        SetHProp 0,1,posx/width,InnerWidth/width 
  2643.        SetVProp 0,2,posy/height,InnerHeight/height 
  2644.        Redraw 0,1:Redraw 0,2:Goto drawsuper 
  2645.  
  2646.      domove: 
  2647.        Repeat:Gosub drawsuper:Until WaitEvent<>$10:Return 
  2648.  
  2649.      drawsuper: 
  2650.        ww=width-InnerWidth:hh=height-InnerHeight 
  2651.        posx=QLimit(HPropPot(0,1)*(ww+1),0,ww) 
  2652.        posy=QLimit(VPropPot(0,2)*(hh+1),0,hh) 
  2653.        PositionSuperBitMap posx,posy 
  2654.      Return 
  2655.  
  2656.  
  2657. Statement: GetSuperBitMap & PutSuperBitMap
  2658. --------------------------------------------------------------------------
  2659. Syntax: GetSuperBitMap & PutSuperBitMap
  2660.  
  2661. After rendering changes to a superbitmap window thebitmap attached can 
  2662. also be updated with the GetSuperBitMap. After rendering changes to a 
  2663. bitmap the superbitmap window can be refreshed with the PutSuperBitMap 
  2664. command. Both commands work with the currently used window.
  2665.  
  2666.  
  2667. Statement: WTitle
  2668. --------------------------------------------------------------------------
  2669. Syntax: WTitle windowtitle$,screentitle$
  2670.  
  2671. WTitle is used to alter both the current window's title bar and it's 
  2672. screens title bar. Useful for displaying important stats such as program
  2673. status etc. 
  2674.  
  2675.  
  2676. Statement: CloseWindow
  2677. --------------------------------------------------------------------------
  2678. Syntax: CloseWindow Window#
  2679.  
  2680. CloseWindow has been added for convenience. Same as Free Window but a 
  2681. little more intuitive (added for those that have complained about such
  2682. matters).
  2683.  
  2684.  
  2685. Statement: WPrintScroll
  2686. --------------------------------------------------------------------------
  2687. Syntax: WPrintScroll
  2688.  
  2689.  
  2690. WPrintScroll will scroll the current window upwards if the text cursor 
  2691. is below the bottom of the window and adjust the cursor accordingly. 
  2692. Presently WPrintScroll only works with windows opened with the gimme00
  2693. flag set (#gimmezerozero=$400).
  2694.  
  2695.  
  2696. Statement: WBlit
  2697. --------------------------------------------------------------------------
  2698. Syntax: WBlit Shape#,x,y
  2699.  
  2700. WBlit can be used to blit any shape to the current window. Completely 
  2701. system friendly this command will completely clip the shape to fit 
  2702. inside the visible part of the window. Use GimmeZeroZero windows for 
  2703. clean clipping when the window has title/sizing gadgets.
  2704.  
  2705.  
  2706. Statement: BitMaptoWindow
  2707. --------------------------------------------------------------------------
  2708. Syntax: BitMaptoWindow Bitmap#,Window#[,srcx,srcy,destx,desty,wid,height]
  2709.  
  2710. BitMaptoWindow will copy a bitmap to a window in an operating system 
  2711. friendly manner (what do you expect). The main use of such a command is 
  2712. for programs which use the raw bitmap commands such as the 2D and Blit 
  2713. libraries for rendering bitmaps quickly but require a windowing 
  2714. environment for the user inyerface.
  2715.  
  2716.  
  2717. Functions: EventCode & EventQualifier
  2718. --------------------------------------------------------------------------
  2719. Syntax: EventCode & EventQualifier
  2720.  
  2721. EventCode returns the actual code of the last Event received by your 
  2722. program, EventQualifier returns the contents of the Qualifier field. Of 
  2723. use with the new GadTools library and some other low level event 
  2724. handling requirements. 
  2725.  
  2726.  
  2727. Gadget Library Additions
  2728. --------------------------------------------------------------------------
  2729. Five new flags have been added when defining gadgets in Blitz2. The
  2730. first four are for attaching the gadget to one of the windows borders, 
  2731. the GZZGADGET flag is for attaching the gadget to the "outer" rastport/
  2732. layer of a gimme zero zero window.
  2733.  
  2734. #RIGHTBORDER    $1000   
  2735. #LEFTBORDER     $2000
  2736. #TOPBORDER      $4000
  2737. #BOTTOMBORDER   $8000
  2738. #GZZGADGET      $10000 
  2739.  
  2740. PropGadgets have been upgraded to take advantage of the 2.0 "newlook" 
  2741. when/if available.
  2742.  
  2743.  
  2744. Statement: Toggle
  2745. --------------------------------------------------------------------------
  2746. Syntax: Toggle GadgetList#,Id [,On|Off]
  2747.  
  2748. The Togggle command in the gadget library has been extended so it will
  2749. actually toggle a gadgets status if the no On|Off parameter is missing.
  2750.  
  2751.  
  2752.                             Screen Library Additions
  2753.  
  2754.                                  New commands:
  2755.  
  2756.                                    CLOSESCREEN 
  2757.                                    HIDESCREEN  
  2758.                                    BEEPSCREEN  
  2759.                                    MOVESCREEN  
  2760.                                    SCREENTAGS  
  2761.  
  2762.  
  2763. Statement: CloseScreen
  2764. --------------------------------------------------------------------------
  2765. Syntax: CloseScreen Screen#
  2766.  
  2767. CloseScreen has been added for convenience. Same as Free Screen but a 
  2768. little more intuitive (especially for those that have complained about
  2769. such matters (yes we care)).
  2770.  
  2771.  
  2772. Statement: HideScreen
  2773. --------------------------------------------------------------------------
  2774. Syntax: HideScreen Screen#
  2775.  
  2776. Move Screen to back of all Screens open in the system.
  2777.  
  2778.  
  2779. Statement: BeepScreen
  2780. --------------------------------------------------------------------------
  2781. Syntax: BeepScreen Screen#
  2782.  
  2783. Flash specified screen.
  2784.  
  2785.  
  2786. Statement: MoveScreen
  2787. --------------------------------------------------------------------------
  2788. Syntax: MoveScreen Screen#,deltax,deltay
  2789.  
  2790. Move specified screen by specified amount. Good for system friendly 
  2791. special effects.
  2792.  
  2793.  
  2794. Statement: ScreenTags
  2795. --------------------------------------------------------------------------
  2796. Syntax: ScreenTags Screen#,Title$ [&TagList] or [[,Tag,Data]...]
  2797.  
  2798. Full access to all the Amiga's new display resoutions is now available 
  2799. in Amiga mode by use of the Screen Tags command. The following tags are
  2800. of most interest to Blitz2 programmers: (see autodocs)
  2801.  
  2802. #Left=$80000021  
  2803. #Top=$80000022
  2804. #Width=$80000023
  2805. #Height=$80000024
  2806. #Depth=$80000025
  2807. #DetailPen=$80000026
  2808. #_BlockPen=$80000027
  2809. #Title=$80000028
  2810. #Colors=$80000029
  2811. #ErrorCode=$8000002A
  2812. #Font=$8000002B
  2813. #SysFont=$8000002C
  2814. #Type=$8000002D
  2815. #BitMap=$8000002E
  2816. #PubName=$8000002F
  2817. #PubSig=$80000030
  2818. #PubTask=$80000031
  2819. #DisplayID=$80000032
  2820. #DClip=$80000033
  2821. #Overscan=$80000034
  2822. #Obsolete1=$80000035
  2823.  
  2824. #ShowTitle=$80000036
  2825. #Behind=$80000037
  2826. #_Quiet=$80000038
  2827. #AutoScroll=$80000039
  2828. #Pens=$8000003A
  2829. #FullPalette=$8000003B
  2830. #ColorMapEntries=$8000003C
  2831. #Parent=$8000003D
  2832. #Draggable=$8000003E
  2833. #Exclusive=$8000003F
  2834.  
  2835. #SharePens=$80000040
  2836. #BackFill=$80000041
  2837. #_Interleaved=$80000042
  2838. #Colors32=$80000043
  2839. #VideoControl=$80000044
  2840. #FrontChild=$80000045
  2841. #BackChild=$80000046
  2842. #LikeWorkbench=$80000047
  2843. #Reserved=$80000048
  2844.  
  2845. ; open super wide screen with overscan set for smooth horizontal scroll 
  2846. ; for 2.0 and above with amigalibs.res in resident
  2847. ;
  2848.  
  2849. #_BitMap=$8000002E:#_Overscan=$80000034:#_Width=$80000023:
  2850. #_Height=$80000024 
  2851.  
  2852. BitMap 0,1280,512,2:Circlef 320,256,256,1 
  2853.  
  2854. ScreenTags 0,"TEST",#_BitMap,Addr BitMap(0),#_Overscan,1,#_Width,640,
  2855.                     #_Height,512 
  2856.  
  2857. *vp.ViewPort=ViewPort(0) 
  2858.  
  2859. While Joyb(0)=0 
  2860.      VWait 
  2861.      *vp\DxOffset=-SMouseX,-SMouseY 
  2862.      ScrollVPort_ *vp 
  2863. Wend 
  2864.  
  2865.  
  2866.                             PALETTE LIBRARY ADDITIONS@{FG TEXT
  2867.  
  2868. The Palette library has been modified in BUM5 for two reasons. Firstly,
  2869. it was impossible to perform custom fades using two palettes as the Use
  2870. Palette command affected the current Slice or Screen. Also with the 
  2871. advent of the Display library the extra properties of the Use Palette
  2872. command (copy colors to current Slice or Screen) became unwanted.
  2873.  
  2874.                                  New commands:
  2875.  
  2876.                                   SHOWPALETTE    
  2877.                                   NEWPALETTEMODE 
  2878.  
  2879. The ShowPalette command has been added to replace the above 
  2880. functionality removed from the Use Palette command. Also, for 
  2881. compatability reasons NewPaletteMode On is used for enabling the above
  2882. modifications (default is off).
  2883.  
  2884.  
  2885. Statement: ShowPalette
  2886. --------------------------------------------------------------------------
  2887. Syntax: ShowPalette Palette#
  2888.  
  2889. ShowPalette replaces Use Palette for copying a palette's colours to the
  2890. current Screen or Slice.
  2891.  
  2892.  
  2893. Statement: NewPaletteMode
  2894. --------------------------------------------------------------------------
  2895. Syntax: NewPaletteMode On|Off
  2896.  
  2897. The NewPaletteMode flag has been added for compatibility with older 
  2898. Blitz2 programs. By setting NewPaletteMode to On the Use Palette command
  2899. merely makes the specified palette the current object and does not try 
  2900. to copy the colour information to the current Screen or Slice.
  2901.  
  2902.  
  2903.  
  2904.  
  2905.                    The New Display Library (#displaylib=143)
  2906.  
  2907. The new display library is an alternative to the slice library. 
  2908. Instead of extending the slice library for AGA support a completely new
  2909. display library has been developed.
  2910.  
  2911. Besides support for extended sprites, super hires scrolling and 8 
  2912. bitplane displays a more modular method of creating displays has been 
  2913. implemented with the use of CopLists. CopLists need only be initialised 
  2914. once at the start of the program. Displays can then be created using any
  2915. combination of CopLists and most importantly the CreateDisplay command
  2916. does not allocate any memory avoiding any memory fragmenting problems. 
  2917. The new display library is for non-AGA displays also.
  2918.  
  2919.                            Display Library Commands:
  2920.  
  2921.                       INITCOPLIST              DISPLAYPALETTE  
  2922.                       CREATEDISPLAY            DISPLAYCONTROLS 
  2923.                       DISPLAYBITMAP            DISPLAYADJUST   
  2924.                       DISPLAYSPRITE           
  2925.  
  2926.  
  2927.  
  2928. Statement: InitCopList
  2929. --------------------------------------------------------------------------
  2930. Syntax: InitCopList CopList#,ypos,height,type,sprites,colors,
  2931.         customs[,widthadjust]
  2932.  
  2933. InitCopList is used to create a CopList for use with the CreateDisplay
  2934. command. The ypos, height parameters define the section of screen. 
  2935. Sprites, colors and customs will allocate instructions for that many 
  2936. sprites (always=8!) colors (yes, as many as 256!) and custom copper 
  2937. instructions (to be used by the new DisplayFX library currently in 
  2938. devlopment).
  2939.  
  2940. The widthadjust parameter is currently not implemented, for display 
  2941. widths other than standard see the DisplayAdjust command. The following
  2942. constants make up the type parameter, add the number of bitplanes to the
  2943. total to make up the type parameter.
  2944.  
  2945. #smoothscroll=$10  #dualplayfield=$20 #extrahalfbrite=$40  #ham=$80
  2946. #lores=$000        #hires=$100        #super=$200
  2947. #loressprites=$400 #hiressprites=$800 #supersprites=$c00
  2948. #fmode0=$0000      #fmode1=$1000      #fmode2=$2000         #fmode3=$3000
  2949.  
  2950. For displays on non-AGA machines only #fmode0 and #loressprites are 
  2951. allowed. More documentation, examples and fixes will be published soon 
  2952. for creating displays. 
  2953.  
  2954.  
  2955. Statement: CreateDisplay
  2956. --------------------------------------------------------------------------
  2957. Syntax: CreateDisplay CopList#[,CopList#..]
  2958.  
  2959. CreateDisplay is used to setup a new screen display with the new display
  2960. library. Any number of CopLists can be passed to CreateDisplay although
  2961. at present they must be in order of vertical position and not overlap. 
  2962. CreateDisplay then links the CopLists together using internal pointers, 
  2963. bitmaps, colours and sprites attached to coplists are not affected.
  2964.  
  2965.  
  2966. Statement: DisplayBitMap
  2967. --------------------------------------------------------------------------
  2968. Syntax: DisplayBitMap CopList#,bmap[,x,y] [,bmap[,x,y]]
  2969.  
  2970. The DisplayBitMap command is similar in  usage to the slice libraries' 
  2971. show commands. Instead of different commands for front and back 
  2972. playfields and smooth scroll options there is only the one DisplayBitMap
  2973. command with various parameter options. With AGA machines, the x 
  2974. positioning of lores and hires coplists uses the fractional part of the
  2975. x parameter for super smooth scrolling.The CopList must be initialised 
  2976. with the smooth scrolling flag set if the x,y parameters are used, same
  2977. goes for dualplayfield.
  2978.  
  2979.  
  2980. Statement: DisplaySprite
  2981. --------------------------------------------------------------------------
  2982. Syntax: DisplaySprite CopList#,Sprite#,X,Y,Sprite Channel
  2983.  
  2984. DisplaySprite is similar to the slice libraries ShowSprite command with
  2985. the added advantage of super hires positioning and extra wide sprite 
  2986. handling. 
  2987.  
  2988. See also  SPRITEMODE .
  2989.  
  2990.  
  2991. Statement: DisplayPalette
  2992. --------------------------------------------------------------------------
  2993. Syntax: DisplayPalette CopList#,Palette# [,coloroffset]
  2994.  
  2995. DisplayPalette copies colour information from a Palette to the CopList
  2996. specified.
  2997.  
  2998.  
  2999. Statement: DisplayControls
  3000. --------------------------------------------------------------------------
  3001. Syntax: DisplayControls CopList#,BPLCON2,BPLCON3,BPLCON4
  3002.  
  3003. DisplayControls allows access to the more remote options available in 
  3004. the Amiga's display system. The following are the most important bits 
  3005. from these registers (still unpublished by Commodore!*()@YU&^)
  3006.  
  3007. Bit| BPLCON2                    | BPLCON3                | BPLCON4
  3008. ---+----------------------------+------------------------+------------------
  3009. 15 | *                          | BANK2 * active colour  | BPLAM7 xor with
  3010.    |                            |         bank           |        bitplans
  3011. ---+----------------------------+------------------------+------------------
  3012. 14 | ZDBPSEL2  which bitplane   | BANK1 *                | BPLAM6 DMA for
  3013.    |           for ZD           |                        |        altering
  3014. ---+----------------------------+------------------------+------------------
  3015. 13 | ZDBPSEL1                   | BANK0 *                | BPLAM5 effective
  3016.    |                            |                        |        colour
  3017. ---+----------------------------+------------------------+------------------
  3018. 12 | ZDBPSEL0                   | PF2OF2  col-offset for | BPLAM4 look up
  3019.    |                            |         playfield 2    |
  3020. ---+----------------------------+------------------------+------------------
  3021. 11 | ZDBPEN    makes above bp   | PF2OF1                 | BPLAM3
  3022.    |           hit ZD           |                        |
  3023. ---+----------------------------+------------------------+------------------
  3024. 10 | ZDCTEN    ZD is bit#15 of  | PF2OF0                 | BPLAM2
  3025.    |           colour           |                        |
  3026. ---+----------------------------+------------------------+------------------
  3027. 09 | KILLEHB   *                | LOCT * palette hi/lo   | BPLAM1
  3028.    |                            |        nibble mode     |
  3029. ---+----------------------------+------------------------+------------------
  3030. 08 | RDRAM=0   *                |                        | BPLAM0
  3031. ---+----------------------------+------------------------+------------------
  3032. 07 | SOGEN     ! sync on green  + SPRES1 * sprites-      | ESPRM7 high order
  3033.    |                            |          resolution    |        color
  3034. ---+----------------------------+------------------------+------------------
  3035. 06 | PF2PRI    H playfield 1/2  | SPRES0 *               | ESPRM6 offset for
  3036.    |           priority         |                        |        even
  3037. ---+----------------------------+------------------------+------------------ 
  3038. 05 | PF2P2     H playfield/     | BRDRBLANK border is    | ESPRM5 sprites
  3039.    |           sprite priority  |           black        |
  3040. ---+----------------------------+------------------------+------------------
  3041. 04 | PF2P1                      | BRDNTRAN  border       | ESPRM4
  3042.    |                            |           hits ZD      |
  3043. ---+----------------------------+------------------------+------------------
  3044. 03 | PF1P0                      |                        | OSPRM7 high order
  3045.    |                            |                        |        color
  3046. ---+----------------------------+------------------------+------------------
  3047. 02 | PF1P2                      | ZDCLCKEN  ZD=14Mhz     | OSPRM6 offset for
  3048.    |                            |           clock        |        odd
  3049. ---+----------------------------+------------------------+------------------
  3050. 01 | PF1P1                      | BRDSPRT   sprites in   | OSPRM5 sprites
  3051.    |                            |           borders!     |
  3052. ---+----------------------------+------------------------+------------------
  3053. 00 | PF1P0                      | EXTBLKEN  wo blank     | OSPRM4
  3054.    |                            |           outputl      |
  3055. ---+----------------------------+------------------------+------------------
  3056.  
  3057. !  - Don't touch
  3058. H  - See standard hardware reference manual
  3059. *  - controlled by display library
  3060. ZD - any reference to ZD is only a guess (just sold my genlock)
  3061.  
  3062.  
  3063. Statement: DisplayAdjust
  3064. --------------------------------------------------------------------------
  3065. Syntax: DisplayAdjust CopList#,fetchwid,ddfstrt,ddfstop,diwstrt,diwstop
  3066.  
  3067. Temporary control of display registers until I get the widthadjust 
  3068. parameter working with InitCopList. Currently only standard width 
  3069. displays are available but you can modify the width manually (just stick
  3070. a screwdriver in the back of your 1084) or with some knowledge of 
  3071. Commodores AGA circuitry.
  3072.  
  3073. Anyway, before I start going on about why they couldn't just give us 
  3074. byte per pixel instead of 8 darn bitplanes (CD32 to the rescue!) see 
  3075. the cover disk for more information...
  3076.  
  3077.  
  3078.                               The New ASL Library (#myasllib=80)
  3079.  
  3080. Our policy until now has been that we would only place emphasis on 1.3
  3081. compatible commands unless of course they had to do with AGA. Then again
  3082. I don't even have a LoadWB in my startup-sequence! So instead of 
  3083. complaining I spent an uncomfortable week adding the following 2.0 above
  3084. specific commands to Blitz2.
  3085.  
  3086. And as for those with 1.3 and want new ROMS? BURN BABY BURN...
  3087.  
  3088.                                  The commands:
  3089.  
  3090.                                   ASLFILEREQUEST    
  3091.                                   ASLFONTREQUEST    
  3092.                                   ASLSCREENREQUEST$ 
  3093.  
  3094.  
  3095. Function: ASLFileRequest$
  3096. --------------------------------------------------------------------------
  3097. Syntax: ASLFileRequest$ (Title$,Pathname$,Filename$ [,Pattern$] 
  3098.                          [,x,y,w,h] )
  3099.  
  3100. The ASL File Requester is nice. Except for the highlight bar being 
  3101. invisible on directories you get to use keyboard for everything, stick 
  3102. in a pattern$ to hide certain files and of course you get what ever size
  3103. you want. I made it call the Blitz2 file requester if the program is 
  3104. running under 1.3 (isn't that nice!). There is a fix that patches the 
  3105. ReqTools file requester but that doesn't have the date field.
  3106.  
  3107. I couldn't get the Save-Only tag or the "Create Directory" option 
  3108. working maybe next upgrade.
  3109.  
  3110. EXAMPLE:
  3111.  
  3112. MaxLen pa$=192 
  3113. MaxLen fi$=192 
  3114.  
  3115. FindScreen 0 
  3116.  
  3117. f$=ASLFileRequest$("test",pa$,fi$,"#?.bb",0,0,640,256) 
  3118.  
  3119. If f$ 
  3120.      NPrint f$ 
  3121. Else 
  3122.      NPrint "failed" 
  3123. EndIf 
  3124.  
  3125. MouseWait  
  3126.  
  3127.  
  3128. Function: ASLFontRequest
  3129. --------------------------------------------------------------------------
  3130. Syntax: ASLFontRequest (enable_flags)
  3131.  
  3132. The ASL Font Requester is also pretty useful. The flags parameter 
  3133. enables the user to modify the following options:
  3134.  
  3135. #pen=1:#bckgrnd=2:#style=4:#drawmode=8:#fixsize=16
  3136.  
  3137. It doesn't seem to handle colour fonts, no keyboard shortcuts so perhaps
  3138. patching ReqTools is an option for this one. The following code 
  3139. illustrates how a .fontinfo structure is created by a call to 
  3140. ASLFontRequest (just like programming in a high level language man!).
  3141.  
  3142. EXAMPLE:
  3143.  
  3144. NEWTYPE .fontinfo 
  3145.      name.s 
  3146.      ysize.w 
  3147.      style.b:flags.b 
  3148.      pen1.b:pen2:drawmode:pad 
  3149. End NEWTYPE 
  3150.  
  3151. FindScreen 0 
  3152.  
  3153. *f.fontinfo=ASLFontRequest(15) 
  3154.  
  3155. If *f 
  3156.      NPrint *f\name 
  3157.      NPrint *f\ysize 
  3158.      NPrint *f\pen1 
  3159.      NPrint *f\pen2 
  3160.      NPrint *f\drawmode 
  3161. Else 
  3162.      NPrint "cancelled" 
  3163. EndIf 
  3164.  
  3165. MouseWait 
  3166.  
  3167.  
  3168. Function: ASLScreenRequest
  3169. --------------------------------------------------------------------------
  3170. Syntax: ASLScreenRequest (enable_flags)
  3171.  
  3172. Those who are just getting to grips with 2.0 and above will find this 
  3173. command makes your programs look really good, however I haven't got time
  3174. to explain the difficulties of developing programs that work in all 
  3175. screen resolutions (what are ya?).
  3176.  
  3177. EXAMPLE:
  3178.  
  3179. #width=1:#height=2:#depth=4:#overscan=8:#scroll=16
  3180.  
  3181. NEWTYPE .screeninfo 
  3182.      id.l 
  3183.      width.l 
  3184.      height.l 
  3185.      depth.w 
  3186.      overscan.w 
  3187.      autoscroll.w 
  3188.      bmapwidth.l 
  3189.      bmapheight.l 
  3190. End NEWTYPE 
  3191.  
  3192. FindScreen 0 
  3193.  
  3194. *sc.screeninfo=ASLScreenRequest(31) 
  3195.  
  3196. If *sc 
  3197.      NPrint *sc\width," ",*sc\height," ",*sc\depth 
  3198. Else 
  3199.      NPrint "cancelled" 
  3200. EndIf 
  3201. MouseWait 
  3202.  
  3203.  
  3204.                             The New GadTools Library (#mygadtoolslib=141)
  3205.  
  3206. GadTools is a 2.0 and greater extension to the operating system that 
  3207. gives the Amiga programmer a few extra enhancements to create juicy user
  3208. interfaces with. Instead of listing each as a separate command this 
  3209. issue I'll just add a brief description and a relevant taglist to each
  3210. of the 12 gadgets.
  3211.  
  3212.                                  The Commands:
  3213.  
  3214.                        ATTACHGTLIST             GTBEVELBOX   
  3215.                        GTTAGS                   GTCHANGELIST 
  3216.                        GTGADPTR                 GTSETATTRS   
  3217.  
  3218. You are allowed both standard gadgets and GadTools ones in the same 
  3219. window, of course id clashes must be avoided and unlike standard 
  3220. gadgets, gadtools gadgets are attached to the Window after it is open 
  3221. with the AttachGTList command.
  3222.  
  3223. GTButton GTList#,id,x,y,w,h,Text$,flags
  3224.  
  3225. Same as Blitz2's TextGadget but with the added flexibility of placing 
  3226. the label Text$ above, below to the left or right of the button 
  3227. (see flags).
  3228.  
  3229. GTCheckBox GTList#,id,x,y,w,h,Text$,flags
  3230.  
  3231. A box with a check mark that toggles on and off, best used for options 
  3232. that are either enabled or disabled. 
  3233.  
  3234. GTCycle GTList#,id,x,y,w,h,Text$,flags,Options$
  3235.  
  3236. Used for offering the user a range of options, the options string 
  3237. should be a list of options separated by the | character eg. "HIRES }
  3238. LORES } SUPERHIRES"
  3239.  
  3240. GTInteger GTList#,id,x,y,w,h,Text$,flags,default
  3241.  
  3242. A string gadget that allows only numbers to be entered by the user.
  3243.  
  3244. GTListView GTList#,id,x,y,w,h,Text$,flags,list()
  3245.  
  3246. The ListView gadget enaables the user to scroll through a list of 
  3247. options. These options must be contained in a string field of a Blitz2
  3248. linked list. Currently this string field must be the second field, the 
  3249. first being a word type.
  3250.  
  3251. GTMX GTList#,id,x,y,w,h,Text$,flags,Options$
  3252.  
  3253. GTMX is an exclusive selection gadget , the Options$ is the same as 
  3254. GTCycle in format, GadTools then displays all the options in a vertical
  3255. list each with a hi-light beside them.
  3256.  
  3257. GTNumber GTList#,id,x,y,w,h,Text$,flags,value
  3258.  
  3259. This is a readonly gadget (user cannot interact with it) used to display
  3260. numbers.
  3261.  
  3262. GTPalette GTList#,id,x,y,w,h,Text$,flags,depth
  3263.  
  3264. Creates a number of coloured boxes relating to a colour palette, 
  3265.  
  3266. GTScroller GTList#,id,x,y,w,h,Text$,flags,Visible,Total
  3267.  
  3268. A prop type gadget for the user to control an amount or level, is 
  3269. accompanied by a set of arrow gadgets.
  3270.  
  3271. GTSlider GTList#,id,x,y,w,h,Text$,flags,Min,Max
  3272.  
  3273. Same as Scroller but for controlling the position of display inside a 
  3274. larger view.
  3275.  
  3276. GTString GTList#,id,x,y,w,h,Text$,flags,MaxChars
  3277.  
  3278. A standard string type gadget
  3279.  
  3280. GTText GTList#,id,x,y,w,h,Text$,flags,Display$
  3281.  
  3282. A read only gadget (see GTNumber) for displaying text messages.
  3283.  
  3284. The parameters x,y,w,h refer to the gadgets position and size, the Text$
  3285. is the label as referred to above. The flags field is made up of the 
  3286. following fields:
  3287.  
  3288. #_LEFT=1  ;positioning of the optional gadget label Text$ 
  3289. #_RIGHT=2 
  3290. #_ABOVE=4 
  3291. #_BELOW=8 
  3292. #_IN=$10
  3293. #_High=$20       ;highlight 
  3294. #_Disable=$40    ;turned off 
  3295. #_Immediate=$80  ;activate on gadgetdown 
  3296. #_BoolValue=$100 ;checkbox on 
  3297. #_Scaled=$200    ;scale arrows for slider 
  3298. #_Vertical=$400  ;make slider/scroller vertical
  3299.  
  3300.  
  3301.  
  3302. Statement: AttachGTList
  3303. --------------------------------------------------------------------------
  3304. Syntax: AttachGTList GTList#,Window#
  3305.  
  3306. The AttchGTList command is used to attach a set of GadTools gadgets to a
  3307. Window after it has been opened.
  3308.  
  3309.  
  3310. Statement: GTTags
  3311. --------------------------------------------------------------------------
  3312. Syntax: GTTags Tag,Value [,Tag,Value...]
  3313.  
  3314. The GTTags command can be used prior to initialisation of any of the 12
  3315. gadtools gadgets to preset any relevant Tag fields. The following are 
  3316. some useful Tags that can be used with GTTags:
  3317.  
  3318. #tag=$80080000
  3319. #GTCB_Checked=#tag+4      ; State of checkbox
  3320. #GTLV_Top=#tag+5          ; Top visible item in listview
  3321. #GTLV_ReadOnly=#tag+7     ; Set TRUE if listview is to be ReadOnly
  3322. #GTMX_Active=#tag+10      ; Active one in mx gadget
  3323. #GTTX_Text=#tag+11        ; Text to display
  3324. #GTNM_Number=#tag+13      ; Number to display
  3325. #GTCY_Active=#tag+15      ; The active one in the cycle gad
  3326. #GTPA_Color=#tag+17       ; Palette color
  3327. #GTPA_ColorOffset=#tag+18 ; First color to use in palette
  3328. #GTSC_Top=#tag+21         ; Top visible in scroller
  3329. #GTSC_Total=#tag+22       ; Total in scroller area
  3330. #GTSC_Visible=#tag+23     ; Number visible in scroller
  3331. #GTSL_Level=#tag+40       ; Slider level
  3332. #GTSL_MaxLevelLen=#tag+41 ; Max length of printed level
  3333. #GTSL_LevelFormat=#tag+42 ;* Format string for level
  3334. #GTSL_LevelPlace=#tag+43  ;* Where level should be placed
  3335. #GTLV_Selected=#tag+54    ; Set ordinal number of selected
  3336. #GTMX_Spacing=#tag+61     ;* Added to font height to
  3337.  
  3338. All of the above except for those marked * can be set after 
  3339. initialisation of the Gadget using the GTSetAttrs command. The following 
  3340. is an example of creating a slider gadget with a numeric display:
  3341.  
  3342. f$="%2ld" : GTTags #GTSLLevelFormat, &f$, #GTSLMaxLevelLen, 4
  3343. GTSlider 2,10,320,120,200,20,"GTSLIDER",2,0,10
  3344.  
  3345.  
  3346. Function: GTGadPtr
  3347. --------------------------------------------------------------------------
  3348. Syntax: GTGadPtr (GTList#,id)
  3349.  
  3350. GTGadPtr returns the actual location of the specified GadTools gadget in
  3351. memory.
  3352.  
  3353.  
  3354. Statement: GTBevelBox
  3355. --------------------------------------------------------------------------
  3356. Syntax: GTBevelBox GTList#,x,y,w,h,flags
  3357.  
  3358. GTBevelBox is the GadTools library equivalent of the Borders command and
  3359. can be used to render frames and boxes in the currently used Window.
  3360.  
  3361.  
  3362. Statement: GTChangeList
  3363. ---------------------------------------------------------------------------
  3364. Syntax: GTChangeList GTList#,id [ ,List() ]
  3365.  
  3366. GTChangeList must be used whenever a List attached to a GTListView needs
  3367. to be modified. Call GTChangeList without the List() parameter to free 
  3368. the List, modify it then reattache it with another call to GTChangeList
  3369. this time using the List() parameter.
  3370.  
  3371.  
  3372. Statement: GTSetAttrs
  3373. --------------------------------------------------------------------------
  3374. Syntax: GTSetAttrs GTList#,id [,Tag,Value...]
  3375.  
  3376. GTSetAttrs can be used to modify the status of certain GadTools gadgets 
  3377. with the relevant Tags. See GTTags for more information on the use of 
  3378. Tags with the GadTools library.
  3379.  
  3380.  
  3381.                                 PRINTER LIBRARY
  3382.  
  3383. This is a library for using the printer.device!!! There are only four 
  3384. commands included, but I think these are the most wanted ones...
  3385.  
  3386.                                  The Commands:
  3387.  
  3388.                                     CHECKPRT   
  3389.                                     PRTCOMMAND 
  3390.                                     PRTTEXT    
  3391.                                     HARDCOPY   
  3392.  
  3393.  
  3394. Statement: CheckPrt
  3395. --------------------------------------------------------------------------
  3396. Syntax: status.b=CheckPrt
  3397.  
  3398. Modes : AMIGA/BLITZ
  3399.  
  3400. Description:
  3401. Checks the state of the Printer and return it.
  3402.  
  3403. status: -1 = Printer Off
  3404.         -3 = Printer Offline
  3405.         -4 = Printer On
  3406. Bugs:
  3407.  
  3408. I had exculded this Routine, because it doesn' t worked 100%...I have 
  3409. now reincluded it and compiled with the newest version of the BB2 
  3410. compiler...It seems that it now works 100%...
  3411.  
  3412.  
  3413. Statement: PrtCommand
  3414. --------------------------------------------------------------------------
  3415. Syntax: PrtCommand Command,Para1,Para2,Para3,Para4
  3416.  
  3417. Modes : AMIGA
  3418.  
  3419. Description:
  3420. Send a ESC-Sequence to the printer.
  3421.  
  3422. Command: Escape-Sequence
  3423.  
  3424. Para1 - Para 4: Parameters for ESC-Sequence
  3425.  
  3426. Beispiel: PrtCommand 6,0,0,0,0 ;Kursiv on
  3427.           PrtCommand 7,0,0,0,0 ;Kursiv off
  3428.  
  3429.  
  3430. End Of Part Two
  3431.  
  3432.  
  3433.  
  3434.