home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Basic / wst!blz1.dms / in.adf / docs / version19.doc < prev   
Encoding:
Text File  |  1994-09-05  |  19.9 KB  |  565 lines

  1. BUM7 MAIN DOC
  2.  
  3. Updates and Fixes to Blitz2 v1.9
  4. --------------------------------
  5.  
  6.  
  7. Stability
  8.  
  9. Several improvements have been made to the stability of Blitz2 programs.
  10. First up all string commands have been fixed to both work properly with
  11. the null-termination system introduced in v.18 (our apologies here) and
  12. error checking has been added. No longer will system crashes be caused
  13. with illegal size parameters in mid$() etc.
  14.  
  15. Also, the ASMEND command has been added. Using assembler in statements
  16. and functions use to require the use of UNLK A4 and RTS. This system
  17. did not work properly when runtime errors were enabled. A fullproof
  18. method is now available, simply use the ASMEND command in place of any
  19. RTS commands. Blitz2 will look after the unlinking of A4, allow for
  20. runtime errors and then do an RTS. Finally my darts demo runs with
  21. runtime errors enabels (yipeeee!).
  22.  
  23. And finally, runtime error checking has been added for square bracket
  24. arrays. Yup, out of range checking has been incorporated for those of
  25. us whose first guess at why our programs were crashing was to go through
  26. and check such usage manually. This with the new string checking and the
  27. sexy new debugger should return a few people to using Blitz2's runtime
  28. debugging features. Thanks to all those and their abuse for helping us
  29. get these problems resolved.
  30.  
  31.  
  32. Debugging
  33.  
  34. The debugger is now a separate program that is launched by Blitz2 when a
  35. prgram is run (runtime errors enabled of course).
  36.  
  37. The gadgets in the window allow the programmer access to the standard
  38. debugging features. CtrlAltC can still be used to halt programs, especially
  39. those using Slices and Displays in Blitz mode.
  40.  
  41. By increasing the size of the window the program listing can be viewed.
  42.  
  43. A PANIC! button has also been introduced once a program is launched from
  44. the editor. Yup, programs are now launched not run so those into weird
  45. system crashes may be able to return to Ted leaving their programs disabled
  46. in memory. A REBOOT button may have been more useful...
  47.  
  48. The source code for the default debugger is included in the acidlibsrc
  49. directory of the libsdev archive. It is extremely well documented by
  50. Mark so those wanting to extend the functionality of the system are
  51. most welcome. Serial port support for using a remote terminal would
  52. be very nice.
  53.  
  54.  
  55. Interupts and BlitzKeys
  56.  
  57. BlitzKeys, BlitzKeys, BlitzKeys. A common profanity used by those of us
  58. use to keyboard lock ups in keyboard based Blitz games (especially
  59. SkidMarks). Well no more!
  60.  
  61. Blitz now leaves Amiga interupts enabled in Blitz mode. This means that
  62. not only is the system keyboard interupt still running (thank the lord)
  63. but any SetInts initiated in Amiga mode will continue.
  64.  
  65. Other advantages are that Blitz mode is now more acceptable to the CD32
  66. environment and RawStatus can be used in Amiga mode for keyboard games
  67. not wanting to run in Windows (yuck).
  68.  
  69. Blitzkeys On now does a bit of a "BlitzkeysInput" for one character inputs
  70. only, any other inputs use the previously defined Input channel.
  71.  
  72. Blitzkeys Off no longer exists. BlitzRepeat has gone (no repeating keys).
  73.  
  74.  
  75. Serial Stuff
  76.  
  77. Peter Tavinor has upgraded the Serial Library. ReadSerial now return a
  78. word (read unsigned byte) so chr$(255) is acceptable. WriteSerialString
  79. includes flags for DoIO and True String (not null terminated). ReadSerial
  80. has a new flag "WaitForChar"
  81.  
  82.  
  83. GadTools
  84.  
  85. The GTPalette has had several default tags removed as they crashed under
  86. 2.0 (yeh, great, just what tags are suppose to avoid). AttachGTList had
  87. a minor problem in some situations (now fixed).
  88.  
  89. Another bug that has been found in GadTools under 2.0 is that GTLists
  90. actually allocate gadget id's for internal use. Besides being completely
  91. unethical (and fixed in 3.0) it means that programmers should use id
  92. values of greater than 50 to avoid this system bug. Adding GTLists last
  93. in your list should also work although their id's should be more than the
  94. number of lines of text they should display (no I am not going to explain
  95. further).
  96.  
  97.  
  98. ScreensLib
  99.  
  100. The Screen command now rounds the width up to the nearest multiple of 16
  101. rather than causing the error "Screen Width Must be a multiple of 16".
  102. Common sense I think.
  103.  
  104.  
  105. ValLib
  106.  
  107. Val() now accepts hex and binary strings (preceeded by "$" and "%" of course.)
  108. Because Val() returns a float it should not be used to evaluate 32 bit integers
  109. (longs).
  110.  
  111.  
  112. Display Library
  113.  
  114. A quick version of the InitCoplist command has been included which calculates
  115. the number of colours, sprites and size depending on just the type parameter.
  116.  
  117. As promised the Display library now sports new commands for palette effects
  118. and so forth. There are two varieties of copper based commands, the first
  119. allows the user to insert a new palette or copperstring at a certain line
  120. of the display, the other allows control of each and every line of the
  121. display.
  122.  
  123. For line based effects a negative value should be used in combination
  124. with the numcustoms parameter of the InitCopList command. Color splits,
  125. bitmap scrolling, scan doubling/trebling/quadrupling and custom copper
  126. strings can now be acheived on a line by line basis.
  127.  
  128.  
  129. Palette Library.
  130.  
  131. A number of commands have been added to the Palette library for use mainly
  132. with the display library. Fades and Colour cycling can now be performed on
  133. palette objects themselves (rather than on screens and slices) and hence
  134. can be used in conjunction with the DisplayPalette command.
  135.  
  136.  
  137. Banks and Decoding.
  138.  
  139. Decode commands have been added to allow programmers to both include shapes,
  140. sounds, palettes, music and ILBM's (IFF bitmaps) in their programs or from
  141. preloaded files (mainly using the LoadBank command or unpacking type commands).
  142.  
  143. To include such files in the program the incbin command is used. Typically
  144. a list of included files will be situated at the bottom of the listing (with
  145. and End statement just above to be safe). Each IncBin will be preceeded by
  146. a label and the ?label syntax would be used to pass the location of each
  147. included file to the appropriate Decode command at the top of the program.
  148.  
  149. Those unhappy with the slow but memory unhungry LoadBitMap command can take
  150. advantage of the fast but memory hungry method of loading iff/ilbm files
  151. with the code listed in the DecodeILBM command description.
  152.  
  153.  
  154. New Commands
  155. ------------
  156.  
  157.    GTStatus(GTList#,Id) ;bbgtlib
  158.    GTArrowSize size       ;bbgtlib
  159.    DecodeILBM BitMap#,MemoryLocation ;ilbmifflib
  160.    DecodeSound Sound#,MemoryLocation ;audiolib
  161.    DecodePalette Palette#,MemoryLocation[,Palette Offset] ;palettelib
  162.    DecodeMedModule MedModule#,MemoryLocation ;medlib
  163.    DecodeShapes Shape#[,Shape#],MemoryLocation ;shapeslib
  164.    InitShape Shape#,Width,Height,Depth ;shapeslib
  165.    SetPeriod Sound#,Period ;audiolib ;audiolib
  166.    Bank(Bank#)
  167.    LoadBank Bank#,FileName$[,MemType]
  168.    AllocMem (size,type) ;banklib
  169.    FreeMem location,size ;banklib
  170.    BlockScroll X1,Y1,Width,Height,X2,Y2[,BitMap#] ;scrolllib
  171.    ClipBlitMode BPLCON0  ;2dlib
  172.    CyclePalette Palette# ;palettelib
  173.    FadePalette SrcPalette#,DestPalette#,Brightness.q ;palettelib
  174.    InitPalette Palette#,NumColors ;palettelib
  175.    PaletteRange Palette#,StartCol,EndCol,r0,g0,b0,r1,g1,b1 ;palettelib
  176.    DuplicatePalette SrcPalette#,DestPalette# ;palettelib
  177.    SavePalette Palette#,FileName$ ;iffmakelib
  178.    CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols ;displaylib
  179.    CustomString CopList#,CCOffset,YPos,Copper$ ;displaylib
  180.    DisplayDblScan CopList#,Mode[,copoffset] ;displaylib
  181.    DisplayRainbow CopList#,Register,Palette[,copoffset] ;displaylib
  182.    DisplayRGB CopList#,Register,line,r,g,b[,copoffset] ;displaylib
  183.    DisplayUser CopList#,Line,String[,Offset] ;displaylib
  184.    DisplayScroll CopList#,&xpos.q(n),&xpos.q(n)[,Offset] ;displaylib
  185.    ReadSerialMem Unit#,Address,Length ;seriallib
  186.    WriteSerialMem Unit#,Address,Length ;seriallib
  187.    PopInput & PopOutput ;inputoutputlib
  188.    GameB(por#) ;gameiolib
  189.    NumPars ;cliargslib
  190.    Par$(parameter#) ;cliargslib
  191.    FromCLI ;cliargslib
  192.    ParPath$ (parameter,type) ;cliargslib
  193.  
  194. Function: GTStatus(GTList#,Id) ;bbgtlib
  195.  
  196. GTStatus returns the status of and gadtools toggle gadgets, a value
  197. of 1 means the the gadget is selected, 0 deselected.
  198.  
  199.  
  200. Statement: GTArrowSize size       ;bbgtlib
  201.  
  202. Allows the size of GTScroller arrows to be preset. Default size is 16.
  203.  
  204.  
  205. Statement: DecodeILBM BitMap#,MemoryLocation ;ilbmifflib
  206.  
  207. A very fast method of unpacking standard iffilbm data to a bitmap. Not
  208. only does this command allow a faster method of loading standard IFF
  209. files but allows the programmer to "incbin" iff pictures in their programs.
  210. See the discussion above for using DecodeILBM on both files and included
  211. memory.
  212.  
  213.  
  214. Statement: DecodeSound Sound#,MemoryLocation ;audiolib
  215.  
  216. DecodeSound similar to the other new Decode commands allows the programmer
  217. to include sound files within their program's object code.
  218.  
  219.  
  220. Statement: DecodePalette Palette#,MemoryLocation[,Palette Offset] ;palettelib
  221.  
  222. DecodePalette allows the programmer to unpack included iff palette information
  223. to Blitz2 palette objects.
  224.  
  225.  
  226. Statement: DecodeMedModule MedModule#,MemoryLocation ;medlib
  227.  
  228. DecodeMedModule replaces the cludgemedmodule, as med modules are not packed
  229. but used raw, DecodeMedModule simply checks to see the memorylocation passed
  230. is in ChipMem (if not it copies the data to chip) and points the Blitz2
  231. MedModule object to that memory.
  232.  
  233.  
  234. Statament: DecodeShapes Shape#[,Shape#],MemoryLocation ;shapeslib
  235.  
  236. DecodeShapes, similar to DecodeMedModule ensures the data is in chip and
  237. then configures the Shape object(s) to point to the data.
  238.  
  239.  
  240. Statement: InitShape Shape#,Width,Height,Depth ;shapeslib
  241.  
  242. InitShape has been added to simple create blank shape objects. Programmers
  243. who make a habit of using ShapesBitMap to render graphics to a shape object
  244. will appreciate this one for sure.
  245.  
  246.  
  247. Statement: SetPeriod Sound#,Period ;audiolib ;audiolib
  248.  
  249. Hmmm, not sure why we never included this command in the original audiolib,
  250.  
  251.  
  252. Function: Bank(Bank#)
  253.  
  254. Returns the memory location of the given memory Bank, replaces the older
  255. and more stupidly named BankLoc command.
  256.  
  257.  
  258. Statement: LoadBank Bank#,FileName$[,MemType]
  259.  
  260. The LoadBank command has been modified, instead of having to initialise
  261. the bank before loading a file, LoadBank will now initialise the bank
  262. to the size of the file if it is not already large enough or has not been
  263. initialised at all.
  264.  
  265.  
  266. Function: Bank(Bank#)
  267.  
  268. Returns the memory location of the given memory Bank, replaces the older
  269. and more stupidly named BankLoc command.
  270.  
  271.  
  272. Statement: LoadBank Bank#,FileName$[,MemType]
  273.  
  274. The LoadBank command has been modified, instead of having to initialise
  275. the bank before loading a file, LoadBank will now initialise the bank
  276. to the size of the file if it is not already large enough or has not been
  277. initialised at all.
  278. SetPeriod simply allows the user to override the frequence information (period)
  279. of the sound object after it has been loaded. To alter a sound's pitch while
  280. playing programmers should hit the audio hardware direct (hardware locations
  281. are listed at the back of the reference manual).
  282.  
  283.  
  284. Function: Bank(Bank#)
  285.  
  286. Returns the memory location of the given memory Bank, replaces the older
  287. and more stupidly named BankLoc command.
  288.  
  289.  
  290. Statement: LoadBank Bank#,FileName$[,MemType]
  291.  
  292. The LoadBank command has been modified, instead of having to initialise
  293. the bank before loading a file, LoadBank will now initialise the bank
  294. to the size of the file if it is not already large enough or has not been
  295. initialised at all.
  296.  
  297.  
  298. Function: AllocMem (size,type) ;banklib
  299.  
  300. Unlike calling Exec's AllocMem_ command directly Blitz2 will automatically
  301. free any allocated memory when the program ends. Programmers are advised
  302. to use the InitBank command.
  303.  
  304. Flags that can be used with the memory type parameter are:
  305.  
  306. 1=public    ;fast is present
  307. 2=chipmem
  308. 65536=clear ;clears all memory allocated with 0's
  309.  
  310.  
  311. Statement: FreeMem location,size ;banklib
  312.  
  313. Used to free any memory allocated with the AllocMem command.
  314.  
  315.  
  316. Statement: BlockScroll X1,Y1,Width,Height,X2,Y2[,BitMap#] ;scrolllib
  317.  
  318. Same as the Scroll command except that BlockScroll is much faster but
  319. only works with 16 bit aligned areas. This means that X1, X2 and Width
  320. must all be multiples of 16. Useful for block scrolling routines that
  321. render the same blocks to both sides of the display, the programmer
  322. can now choose to render just one set and then copy the result to the
  323. other side with the BlockScroll command.
  324.  
  325.  
  326. Statement: ClipBlitMode BPLCON0  ;2dlib
  327.  
  328. Same as BlitMode except applies to the ClipBlit command. Another oversight
  329. now fixed.
  330.  
  331.  
  332. Statement: CyclePalette Palette# ;palettelib
  333.  
  334. CyclePalette uses the standard color cycling parameters in the palette
  335. object to cycle the colors. Unlike the Cycle command which copied the
  336. resulting palette to the current screen the CyclePalette command just
  337. modifies the palette object and can hence be used with the DisplayBitmap
  338. command in the new Display library.
  339.  
  340.  
  341. Statement: FadePalette SrcPalette#,DestPalette#,Brightness.q ;palettelib
  342.  
  343. FadePalette multiplies all colours in a Palette by the Brightness argument
  344. and places the result in the DestPalette.
  345.  
  346.  
  347. Statement: InitPalette Palette#,NumColors ;palettelib
  348.  
  349. InitPalette simply initialises a palette object to hold NumColors. All colors
  350. will be set to black.
  351.  
  352.  
  353. Statement: PaletteRange Palette#,StartCol,EndCol,r0,g0,b0,r1,g1,b1 ;palettelib
  354.  
  355. PaletteRange creates a spread of colors within a palette. Similar to DPaint's
  356. spread function PaletteRange takes a start and end colour and creates the
  357. color tweens between them.
  358.  
  359.  
  360. Statement: DuplicatePalette SrcPalette#,DestPalette# ;palettelib
  361.  
  362. DuplicatePalette simply creates a new Palette which exactly matches the
  363. SrcPalette.
  364.  
  365.  
  366. Statement: SavePalette Palette#,FileName$ ;iffmakelib
  367.  
  368. Creates a standard IFF "CMAP" file using the given Palette's colors.
  369.  
  370.  
  371. Statement: CustomColors CopList#,CCOffset,YPos,Palette,startcol,numcols ;displaylib
  372.  
  373. Using the custom copper space in a display, CustomColors will alter the displays
  374. palette at the given YPos. The number of customcops required is either 2+numcols
  375. for ecs displays and 2+n+n+n/16 for aga displays. In aga, numcols must be a multiple
  376. of 32.
  377.  
  378. Note that large AGA palette changes may take several lines of the display to be
  379. complete.
  380.  
  381.  
  382. Statement: CustomString CopList#,CCOffset,YPos,Copper$ ;displaylib
  383.  
  384. CustomString allows the user to insert their own copper commands (contained
  385. in a string) into the display's copper list at a given vertical position.
  386. The amount of space required is equal to the number of copper instructions
  387. in the Copper$ (length of string divide by 4) plus 2 which of course have
  388. to be allocated with InitCopList before CustomString is used.
  389.  
  390.  
  391. Statement: DisplayDblScan CopList#,Mode[,copoffset] ;displaylib
  392.  
  393. DisplayDblScan is used to divide the vertical resolution of the display by
  394. 2,4,8 or 16 using Modes 1,2,3 and 4. This is most useful for fast bitmap
  395. based zooms. A Mode of 0 will return the display to 100% magnification.
  396.  
  397. As with the DisplayRainbow, DisplayRGB, DisplayUser and DisplayScroll
  398. commands DisplayDblScan uses the new line by line copper control of the
  399. display library. To initialise this mode a negative parameter is used
  400. in the CustomCops parameter of the InitCopList command. DisplayDblScan
  401. requires 2 copper instructions per line (make CustomCops=-2).
  402.  
  403.  
  404. Statement: DisplayRainbow CopList#,Register,Palette[,copoffset] ;displaylib
  405.  
  406. DisplayRainbow is used to alter a certain colour register vertically down
  407. a display. It simple maps each colour in a palette to the coresponding
  408. vertical position of the display. ECS displays require one copper instruction
  409. per line while AGA displays require 4.
  410.  
  411.  
  412. Statement: DisplayRGB CopList#,Register,line,r,g,b[,copoffset] ;displaylib
  413.  
  414. DisplayRGB is a single line version of DisplayRainbow allowing the programmer
  415. to alter any register of any particular line. As with DisplayRainbow ECS
  416. displays require 1 copper instruction while AGA requires 4.
  417.  
  418.  
  419. Statement: DisplayUser CopList#,Line,String[,Offset] ;displaylib
  420.  
  421. DisplayUser allows the programmer to use their own Copper$ at any line of
  422. the display. Of course copper instructions have to be allocated with the
  423. number of copper instructions in the InitCoplist multiplied by -1.
  424.  
  425.  
  426. Statement: DisplayScroll CopList#,&xpos.q(n),&xpos.q(n)[,Offset] ;displaylib
  427.  
  428. DisplayScroll allows the program to dynamically display any part of a bitmap
  429. on any line of the display. DisplayScroll should always follow the DisplayBitMap
  430. command. The parameters are two arrays holding a list of xoffsets that represent
  431. the difference in horizontal position from the line above. AGA machines are able
  432. to use the fractional part of each entry for super hiresolution positioning
  433. of the bitmap. Three instructions per line are required for the DisplayScroll
  434. command.
  435.  
  436.  
  437. Statement: ReadSerialMem Unit#,Address,Length ;seriallib
  438.  
  439. ReadSerialMem will fill the given memory space with data from the
  440. given serial port.
  441.  
  442.  
  443. Statement: WriteSerialMem Unit#,Address,Length ;seriallib
  444.  
  445. WriteSerialMem send the given memory space out the given serial port.
  446.  
  447.  
  448. Statement: PopInput & PopOutput ;inputoutputlib
  449.  
  450. After input or output has been re-directed (eg using windowoutput/fileoutput),
  451. these two commands may be used to return the channel to it's previous condition.
  452.  
  453. Function: GameB(por#) ;gameiolib
  454.  
  455. Returns button state of cd32 style game controllers - values returned are:
  456.  
  457. 1  = play/pause
  458. 2  = reverse
  459. 4  = forward
  460. 8  = green
  461. 16 = yellow
  462. 32 = red
  463. 64 = blue
  464.  
  465. If more than one button is held down, values are added together. For example,
  466. a value of 6 means both the forward (4) and reverse (2) buttons are held down.
  467. Use an 'and' to isolate the status of a single button, like this -
  468.  
  469. ;check RED button on port 1...
  470. ;
  471. if gameb(1) & 32
  472.   ;
  473.   ;RED button is down...
  474.   ;
  475. else
  476.   ;
  477.   ;RED button is NOT down...
  478.   ;
  479. endif
  480.  
  481.  
  482. argslib fixes
  483. -------------
  484.  
  485. This library processes arguments passed to it.  A few fixes have mainly
  486. been made over the old one.
  487.  
  488. 1)  Quoted arguments count as one argument.  EG "One arg"  will give your
  489.   program both words as one argument, not 2.
  490.  
  491. 2)  Mulitple workbench arguments are allowed now.
  492.  
  493.  
  494. If you are to use workbench arg handling, you MUST have WBSTARTUP at the top of
  495. your program!!
  496.  
  497.  
  498. Function: NumPars ;cliargslib
  499.  
  500. Returns the number of parameters passed to your program.
  501.  
  502.  
  503. Function: Par$(parameter#) ;cliargslib
  504.  
  505. Returns the string value of a parameter.  
  506.  
  507. NOTE: If the parameter asked for is a directory/device/volume etc
  508. (IE NOT A FILE) then Par$(#) will return an empty string.  This is a one
  509. way you can check to see if a file was passed or not.
  510.  
  511.  
  512. Function: FromCLI ;cliargslib
  513.  
  514. Returns TRUE (-1) if your program was run from the CLI, or FALSE (0) if run
  515. from the WorkBench.
  516.  
  517.  
  518. Function: ParPath$ (parameter,type) ;cliargslib
  519.  
  520. This returns the path that this parameter resides in.
  521. 'type' specifies how you want the path returned.
  522.  
  523. 0 You want only the directory of the parameter returned.
  524. 1 You want the directory along with the parameter name returned.
  525.  
  526. EG:
  527.  
  528. If you passed the parameter "FRED" to your program from WorkBench, and FRED
  529. resides in the directory "work:mystuff/myprograms" then ParPath$(0,0) will
  530. return "work:mystuff/myprograms", but ParPath$(0,1) will return
  531. "work:mystuff/myprograms/FRED".
  532.  
  533. CAVEAT
  534. The way WB handles argument passing of directories is different to that of
  535. files.  When a directory is passed as an argument, ArgsLib gets an empty
  536. string for the name, and the directory string holds the path to the passed
  537. directory AND the directory name itself.  EG
  538.  
  539. Passing the blitz2 directory to a program will result in:
  540.  
  541. Par$(x)     Being an empty string.
  542. ParPath$(x,0)   Being something like work:Basic/blitz2.
  543. ParPath$(x,1) Being work:Basic/blitz2/
  544.  
  545. YES!  The / is appended!  This is because to keep things simpler, and more
  546. uniform ParPath$(x,1) Is the concatenation of
  547.  
  548. 1)  The directory string passed by Workbench
  549.  
  550. AND
  551.  
  552. 2)  A / followed by the name given by WorkBench.
  553.  
  554. So you can see why the / followed by the empty string occurs.
  555.  
  556. The easy way around this is simply to check Par$(x), if it is empty, then
  557. use ParPath$(x,0), if it isn't (IE a file was passed) use ParPath$(x,1) and
  558. you will have the entire pathname of the file OR directory.
  559.  
  560. See the demo program, which handles both cases.
  561.  
  562. NOTE 2: Is only useable from WorkBench, you will get an error if your program
  563. was run from the CLI and you try to call ParPath$.
  564.  
  565.