home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 5 / amigaformatcd05.iso / readerstuff / richard_thompson / cool_stars! / commands.doc < prev    next >
Encoding:
Text File  |  1996-08-13  |  23.2 KB  |  604 lines

  1. Cool Stars V1.0 for AMOS Pro - Command Documentation
  2. ----------------------------------------------------
  3.  
  4. © July '96 Richard Thompson
  5.  
  6.     Okay, so when you've installed the extension, you'll be blessed with
  7. these 22 starfield commands...
  8.  
  9.     Cstars Reserve                  =Cstars Y Star
  10.     Cstars Set                      =Cstars X Spd
  11.     Cstars Set X Spd                =Cstars Y Spd
  12.     Cstars Set Y Spd                =Cstars X Dir
  13.     Cstars Set Colour               =Cstars Y Dir
  14.     Cstars X Rev                    =Cstars Colour
  15.     Cstars Y Rev                    Cstars Clear
  16.     Cstars Limit                    Cstars Draw
  17.     Cstars Make Origins             Cstars Bclear
  18.     Cstars Origin Off               Cstars Bdraw
  19.     =Cstars X Star                  Cstars Calc
  20.  
  21.     Note that all commands start with 'Cstars' to avoid tokenization
  22. problems and to make Cool Stars! commands easy to identify in your
  23. programs.
  24.  
  25.     Now follows a detailed description of each command.  I've also included
  26. possible error messages which the commands will produce if you enter
  27. invalid parameters...
  28.  
  29. --------------------------------------------------------------------------
  30. Instruction Name: Cstars Reserve
  31.  
  32. Syntax: Cstars Reserve
  33.         Cstars Reserve N,Multicol
  34.  
  35. Function:
  36.  
  37.     Cstars Reserve reserves memory for N stars.  Stars are reserved in fast
  38. memory if possible.  You may have between 1 right up to 5000 stars in your
  39. starfield.  Around 100-200 stars are usually more than enough for a nice
  40. looking display on a lowres 320*256 screen.
  41.  
  42.     Unlike other starfield extensions, Cool Stars! gives you the choice of
  43. either single coloured or -*MULTICOLOURED*- starfields!  Multicol is simply
  44. a flag, set it if you want a multicoloured starfield.  Single coloured
  45. stars are drawn onto only the 1st bitplane, so the colour of all the stars
  46. will normally be taken from colour register 1 (depending on the state of
  47. the other bitplanes).  Multicoloured stars use the first TWO bitplanes so
  48. each star can be drawn in 1 of 4 colours.  The colours are therefore taken
  49. from colour registers 0-3, although if other bitplanes are set, the stars
  50. may end up being drawn in a different colour.  You can change the colours
  51. of the stars with AMOS Pro's Palette and Colour commands.  Remember that
  52. multicoloured stars are only available in the registered version.  If you
  53. attempt to reserve multicoloured stars in the shareware version, you'll get
  54. an error message. :-)
  55.  
  56.     It's very important to realise that you must call Cstars Reserve when
  57. the screen where you intend to display the stars on is the current screen.
  58. This is because Cstars Reserve precalculates tables of data from the
  59. current screen which gives extra speed when you get round to displaying the
  60. stars.  When you call one of the star clearing or star drawing commands,
  61. Cool Stars! takes data out of these tables to quickly draw the stars onto
  62. the screen you reserved them on.  -*NEVER*- resize, reopen or close the
  63. screen between reserving the stars with Cstars Reserve and clearing and
  64. drawing the stars.  This is because the precalculated data may no longer be
  65. valid for the screen and anything could happen.  A Cool Stars! starfield
  66. can only be displayed on one screen at any one time.
  67.  
  68.     If you have used a starfield on one screen and then at some other point
  69. in a program you wish to display a starfield on a different screen, simply
  70. make the screen you want to display it onto the current screen (using
  71. Screen) then call Cstars Reserve N,Multicol again to re-reserve the stars.
  72.  
  73.     The starfield commands work fine with Double Buffering when Autoback 0
  74. mode is used.  If you intend to display your starfield on a double buffered
  75. screen (which you probably will), you must Double Buffer your screen
  76. -*BEFORE*- calling Cstars Reserve, if not, the star clearing and drawing
  77. commands will get confused.
  78.  
  79.     You can call Cstars Reserve with no parameters to free the starfield.
  80. All memory used by the stars will be released back to the system.  When
  81. you've freed a starfield it can no longer be used.  Normally, you don't
  82. have to worry at all about freeing starfields, since Cool Stars! does this
  83. automatically when you run a program, do a Default or leave AMOS Pro.
  84.  
  85. Possible Errors:
  86.  
  87. SCREEN NOT OPENED
  88. ILLEGAL FUNCTION CALL - If N<1 or N>5000.
  89. MULTICOLOURED STARS ARE ONLY AVAILABLE IN THE REGISTERED VERSION! - If you
  90. attempt to reserve multicoloured stars in the shareware version.
  91. SCREEN MUST HAVE AT LEAST 4 COLOURS! - If you attempt to reserve
  92. multicoloured stars on a 2 colour screen.
  93. --------------------------------------------------------------------------
  94. Instruction Name: Cstars Set
  95.  
  96. Syntax: Cstars Set N,X,Y
  97.         Cstars Set N,X,Y,X Spd,Y Spd
  98.         Cstars Set N,X,Y,X Spd,Y Spd,Col
  99.  
  100. Function:
  101.  
  102.     Cstars Set allows you to set the coordinates, speed (including
  103. direction) and colour for an individual star.
  104.  
  105.     There are 3 versions of this command.  The first enables just the
  106. coordinates to be set.  The second version enables the coordinates and
  107. speed (including direction) to be set.  The third version is the same as
  108. the second except the colour of the star is also set.
  109.  
  110.     N is simply the number of the star.  X,Y are the screen coordinates of
  111. the star.  X Spd and Y Spd denote the speed and direction of the star.
  112. When you update your stars with Cstars Calc, X Spd is added to the X
  113. coordinate and Y Spd is added to the Y coordinate.  Using negative X Spd
  114. values will make stars fly to the left, positive values will make them fly
  115. to the right.  Likewise, using negative Y Spd values will make stars fly
  116. upwards, positive values will make them fly downwards.  If both X Spd and Y
  117. Spd are set to 0, the star coordinates won't change when you call Cstars
  118. Calc.
  119.  
  120.     The colour parameter is only useful for multicoloured stars.  You
  121. should specify a value from 0-3, representing a colour register.  If you
  122. attempt to specify this parameter with a single coloured starfield, it will
  123. simply be ignored.
  124.  
  125.     Note that as yet, it isn't possible to omit parameters from this
  126. command.  eg. Cstars Set 1,,Y to just change the y coordinate doesn't work.
  127.  
  128. Possible Errors:
  129.  
  130. STARS NOT RESERVED
  131. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  132. --------------------------------------------------------------------------
  133. Instruction Name: Cstars X Spd
  134.  
  135. Syntax: Cstars X Spd N,X Spd
  136.  
  137. Function:
  138.  
  139.     Cstars X Spd allows you to quickly set just the x speed for an
  140. individual star.  N is the number of the star, X Spd denotes the speed.
  141. Negative X Spd values will make the star fly to the left when Cstars Calc
  142. is called.  Positive X Spd vales will make the star fly to the right when
  143. Cstars Calc is called.
  144.  
  145. Possible Errors:
  146.  
  147. STARS NOT RESERVED
  148. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  149. --------------------------------------------------------------------------
  150. Instruction Name: Cstars Y Spd
  151.  
  152. Syntax: Cstars Y Spd N,Y Spd
  153.  
  154. Function:
  155.  
  156.     Cstars Y Spd allows you to quickly set just the y speed for an
  157. individual star.  N is the number of the star, Y Spd denotes the speed.
  158. Negative Y Spd values will make the star fly upwards when Cstars Calc is
  159. called.  Positive Y Spd vales will make the star fly downwards when Cstars
  160. Calc is called.
  161.  
  162. Possible Errors:
  163.  
  164. STARS NOT RESERVED
  165. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  166. --------------------------------------------------------------------------
  167. Instruction Name: Cstars Colour
  168.  
  169. Syntax: Cstars Colour N,Col
  170.  
  171. Function:
  172.  
  173.     This command is only useful for multicoloured stars.  If you attempt to
  174. use this command with a single coloured starfield, nothing will happen.
  175. Cstars Colour allows you to quickly set the colour of an individual star.
  176. N is the number of the star, Col is a colour from 0-3 which represents a
  177. colour register.
  178.  
  179. Possible Errors:
  180.  
  181. STARS NOT RESERVED
  182. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  183. --------------------------------------------------------------------------
  184. Instruction Name: Cstars X Rev
  185.  
  186. Syntax: Cstars X Rev
  187.         Cstars X Rev N
  188.         Cstars X Rev N1 To N2
  189.  
  190. Function:
  191.  
  192.     Cstars X Rev allows you to reverse the x direction which stars are
  193. travelling in.  Cstars X Rev achieves this by quickly toggling the sign of
  194. X Spd for the star(s) specified.
  195.  
  196.     There are 3 versions of the command.  The first reverses the x
  197. direction of ALL stars in the starfield.  The second version reverses the x
  198. direction for just star N.  The third version reverses the x direction for
  199. stars N1 to N2 inclusive.
  200.  
  201. Possible Errors:
  202.  
  203. STARS NOT RESERVED
  204. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved or N1<1 or
  205. N1>Number of stars reserved or N2<N1 or N2>Number of stars reserved.
  206. --------------------------------------------------------------------------
  207. Instruction Name: Cstars Y Rev
  208.  
  209. Syntax: Cstars Y Rev
  210.         Cstars Y Rev N
  211.         Cstars Y Rev N1 To N2
  212.  
  213. Function:
  214.  
  215.     Cstars Y Rev allows you to reverse the y direction which stars are
  216. travelling in.  Cstars Y Rev achieves this by quickly toggling the sign of
  217. Y Spd for the star(s) specified.
  218.  
  219.     There are 3 versions of the command.  The first reverses the y
  220. direction of ALL stars in the starfield.  The second version reverses the y
  221. direction for just star N.  The third version reverses the y direction for
  222. stars N1 to N2 inclusive.
  223.  
  224. Possible Errors:
  225.  
  226. STARS NOT RESERVED
  227. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved or N1<1 or
  228. N1>Number of stars reserved or N2<N1 or N2>Number of stars reserved.
  229. --------------------------------------------------------------------------
  230. Instruction Name: Cstars Limit
  231.  
  232. Syntax: Cstars Limit
  233.         Cstars Limit X1,Y1 to X2,Y2
  234.  
  235. Function:
  236.  
  237.     Normally, Cool Stars! will allow your stars to fly around the entire
  238. screen.  However, there may be times in your programs when you want to
  239. limit your starfield to just a rectangular area of the screen.  This is
  240. what Cstars Limit does.  X1,Y1 To X2,Y2 describes the area where your
  241. starfield will be confined to.  Cool Stars! will then ensure that all stars
  242. stay confined to this area at all times.
  243.  
  244.     Calling Cstars Limit with no parameters will confine the stars to the
  245. entire screen again.
  246.  
  247. Possible Errors:
  248.  
  249. STARS NOT RESERVED
  250. ILLEGAL FUNCTION CALL - If X1<0 or X1>=Screen Width or X2<X1 or X2>=Screen
  251. Width or Y1<0 or Y1>=Screen Height or Y2<Y1 or Y2>=Screen Height.
  252. --------------------------------------------------------------------------
  253. Instruction Name: Cstars Make Origins
  254.  
  255. Syntax: Cstars Make Origins
  256.  
  257. Function:
  258.  
  259.     This is one of Cool Stars! most interesting commands which is unique to
  260. Cool Stars!.  It enables you to create special effects which simply
  261. couldn't be done with other starfield extensions.  The origin mode enables
  262. you to change the behaviour of your stars.
  263.  
  264.     Normally, when a star flies off of the edge of the screen, it "wraps
  265. around" and reappears on the opposite edge of the screen.  This is when
  266. origin mode is -*OFF*-.
  267.  
  268.     In origin mode, each star has it's own origin.  Each star will fly from
  269. this origin to the edge of the screen.  When it's reached the edge of the
  270. screen, rather than wrapping around to the opposite edge of the screen, the
  271. star reappears at it's origin.
  272.  
  273.     Okay, but what use is this?  A good application of this command is to
  274. make stars fly from the centre of the screen towards the edge of the
  275. screen.  Useful in your mega demo/game or what ever when you can have your
  276. credits scrolling over stars which appear to be "shooting out of the
  277. screen", as opposed to simply flying from one edge to the opposite edge of
  278. the screen.
  279.  
  280.     When you call Cstars Make Origins, origin mode is automatically turned
  281. on.  Cstars Make Origins looks at the position of every single star and
  282. makes a note of it's position - this is it's origin.  Whenever a star
  283. passes off of the edge of the screen, the star will reappear at it's
  284. origin.
  285.  
  286.     So to clarify things, let's take the example of getting stars to fly
  287. from the centre of the screen - this is what you'd need to do...
  288.  
  289.     1) First reserve your stars with Cstars Reserve.
  290.     2) Position your stars at random around the centre of the screen (use
  291. Cstars Set).
  292.     3) Call Cstars Make Origins - Cool Stars! will look at the position of
  293. each star in turn and makes a note of it's current coordinates.  These
  294. coordinates are the origin of the star.
  295.     4) Now when ever you use Cstars Calc and a star flies off of the edge
  296. of the screen, each star will return back to it's origin - it's that
  297. simple!
  298.  
  299.     Of course, since each star has it's own origin you could have some
  300. stars flying from one area of the screen, some other stars flying from
  301. another area of the screen etc.  Take a look at the examples programs
  302. included in this distribution.
  303.  
  304. Possible Errors:
  305.  
  306. STARS NOT RESERVED
  307. --------------------------------------------------------------------------
  308. Instruction Name: Cstars Origin Off
  309.  
  310. Syntax: Cstars Origin Off
  311.  
  312. Function:
  313.  
  314.     This command turns the origin mode off.  Now when a star reaches the
  315. edge of the screen it "wraps around" and reappears on the opposite edge of
  316. the screen instead of returning to it's origin.
  317.  
  318. Possible Errors:
  319.  
  320. None
  321. --------------------------------------------------------------------------
  322. Function Name: Cstars X Star
  323.  
  324. Syntax: X_Coordinate=Cstars X Star(N)
  325.  
  326. Function:
  327.  
  328.     Cstars X Star is a simple function which returns the x coordinate of an
  329. individual star.  N is the number of the star.
  330.  
  331. Possible Errors:
  332.  
  333. STARS NOT RESERVED
  334. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  335. --------------------------------------------------------------------------
  336. Function Name: Cstars Y Star
  337.  
  338. Syntax: Y_Coordinate=Cstars Y Star(N)
  339.  
  340. Function:
  341.  
  342.     Cstars Y Star is a simple function which returns the y coordinate of an
  343. individual star.  N is the number of the star.
  344.  
  345. Possible Errors:
  346.  
  347. STARS NOT RESERVED
  348. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  349. --------------------------------------------------------------------------
  350. Function Name: Cstars X Spd
  351.  
  352. Syntax: X_Spd=Cstars X Spd(N)
  353.  
  354. Function:
  355.  
  356.     Cstars X Spd is a simple function which returns the x speed of an
  357. individual star.  N is the number of the star.  The value returned may be
  358. negative or positive.  The sign indicates direction.  Negative values means
  359. the star will fly to the left, positive values mean the star will fly to
  360. the right.  0 indicates no movement on the x axis.
  361.  
  362. Possible Errors:
  363.  
  364. STARS NOT RESERVED
  365. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  366. --------------------------------------------------------------------------
  367. Function Name: Cstars Y Spd
  368.  
  369. Syntax: Y_Spd=Cstars Y Spd(N)
  370.  
  371. Function:
  372.  
  373.     Cstars Y Spd is a simple function which returns the y speed of an
  374. individual star.  N is the number of the star.  The value returned may be
  375. negative or positive.  The sign indicates direction.  Negative values means
  376. the star will fly upwards, positive values mean the star will fly
  377. downwards.  0 indicates no movement on the y axis.
  378.  
  379. Possible Errors:
  380.  
  381. STARS NOT RESERVED
  382. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  383. --------------------------------------------------------------------------
  384. Function Name: Cstars X Dir
  385.  
  386. Syntax: X_Dir=Cstars X Dir(N)
  387.  
  388. Function:
  389.  
  390.     Cstars X Dir is a simple function which returns the x direction of an
  391. individual star.  N is the number of the star.  This function returns 3
  392. different values...
  393.  
  394.     -1  ->  Star flying to the left.
  395.     0   ->  No movement on x axis.
  396.     1   ->  Star flying to the right.
  397.  
  398.     Note that X_Dir=Cstars X Dir(N) is the same as X_Dir=Sgn(Cstars X
  399. Spd(N)).
  400.  
  401. Possible Errors:
  402.  
  403. STARS NOT RESERVED
  404. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  405. --------------------------------------------------------------------------
  406. Function Name: Cstars Y Dir
  407.  
  408. Syntax: Y_Dir=Cstars Y Dir(N)
  409.  
  410. Function:
  411.  
  412.     Cstars Y Dir is a simple function which returns the y direction of an
  413. individual star.  N is the number of the star.  This function returns 3
  414. different values...
  415.  
  416.     -1  ->  Star flying upwards.
  417.     0   ->  No movement on y axis.
  418.     1   ->  Star flying downwards.
  419.  
  420.     Note that Y_Dir=Cstars Y Dir(N) is the same as Y_Dir=Sgn(Cstars Y
  421. Spd(N)).
  422.  
  423. Possible Errors:
  424.  
  425. STARS NOT RESERVED
  426. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  427. --------------------------------------------------------------------------
  428. Function Name: Cstars Colour
  429.  
  430. Syntax: Colour=Cstars Colour(N)
  431.  
  432. Function:
  433.  
  434.     Cstars Colour is a simple function which returns the colour of an
  435. individual star.  N is the number of the star.  In the case of
  436. multicoloured stars, this value will be from 0-3.  If you call this
  437. function when using a single coloured starfield, this function always
  438. returns 1.
  439.  
  440. Possible Errors:
  441.  
  442. STARS NOT RESERVED
  443. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved.
  444. --------------------------------------------------------------------------
  445. Instruction Name: Cstars Clear
  446.  
  447. Syntax: Cstars Clear
  448.  
  449. Function:
  450.  
  451.     Cstars Clear is a command to be used in conjunction with Cstars Draw.
  452. Cstars Clear is a fast version of AMOS Pro's Cls command, which only clears
  453. the bitplane(s) the stars are drawn.  This command utilises the blitter.
  454.  
  455.     Cstars Clear is an intelligent command.  If your using single coloured
  456. stars, Cstars Clear will automatically clear just the first bitplane.  If
  457. your using multicoloured stars, Cstars Clear will automatically clear the
  458. first two bitplanes.  Note that Cstars Clear will always clear the
  459. -*ENTIRE*- bitplane(s), even if you have limited your starfield to a
  460. rectangular area of the screen with Cstars Limit.  Therefore, the smaller
  461. the size of the screen, the faster the command will be.
  462.  
  463.     Since if you use the Cstars Clear and Cstars Draw commands to clear and
  464. draw your stars, the first (and second if using multicoloured stars)
  465. bitplane(s) gets corrupted.  These commands would therefore be useless if
  466. you wanted to pass your stars over a graphic (maybe a logo, a scrolltext or
  467. whatever).  Instead, you can use the Cstars Bclear and Cstars Bdraw
  468. commands instead to clear and draw stars in these circumstances.
  469.  
  470. Possible Errors:
  471.  
  472. STARS NOT RESERVED
  473. --------------------------------------------------------------------------
  474. Instruction Name: Cstars Draw
  475.  
  476. Syntax: Cstars Draw
  477.         Cstars Draw N
  478.         Cstars Draw N1 To N2
  479.  
  480. Function:
  481.  
  482.     Cstars Draw is a command to be used in conjunction with Cstars Clear
  483. and is used to actually draw the stars onto the screen.
  484.  
  485.     There are 3 different different versions of this command.  This first
  486. draws ALL stars in the starfield.  The second version only draws star N.
  487. The third version will draw stars N1 To N2 inclusive.
  488.  
  489.     Cstars Draw will draw either single coloured or multicoloured
  490. starfields, depending on the type of starfield you reserved with Cstars
  491. Reserve.  This command is lightening fast, which uses the main processor.
  492. Even with a standard MC68000 processor, the command can plot around 500
  493. single coloured stars per vbl.  Users with faster processors will be able
  494. to display many more per vbl.  Multicoloured stars take slightly longer to
  495. draw, since 2 bitplanes are involved giving the processor more work to do.
  496. However, they are still relatively fast and you can still get a nice
  497. multicoloured starfield moving at 50 frames per second, even with a MC68000
  498. processor!!
  499.  
  500. Possible Errors:
  501.  
  502. STARS NOT RESERVED
  503. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved or N1<1 or
  504. N1>Number of stars reserved or N2<N1 or N2>Number of stars reserved.
  505. --------------------------------------------------------------------------
  506. Instruction Name: Cstars Bclear
  507.  
  508. Syntax: Cstars Bclear
  509.  
  510. Function:
  511.  
  512.     Cstars Bclear is a command to be used in conjunction with Cstars Bdraw.
  513. These commands are an alternative to Cstars Clear and Cstars Draw.
  514.  
  515.     Cstars Bclear is used to remove stars from the screen which have been
  516. drawn with Cstars Bdraw.  However, unlike Cstars Clear which clears entire
  517. bitplane(s) totally corrupting graphics, Cstars Bclear will restore the
  518. background.  This makes it possible to pass stars over graphics such as
  519. logos, scrolltexts etc. without corrupting the graphics.
  520.  
  521. Possible Errors:
  522.  
  523. STARS NOT RESERVED
  524. --------------------------------------------------------------------------
  525. Instruction Name: Cstars Bdraw
  526.  
  527. Syntax: Cstars Bdraw
  528.         Cstars Bdraw N
  529.         Cstars Bdraw N1 To N2
  530.  
  531. Function:
  532.  
  533.     Cstars Bdraw is a command to be used in conjunction with Cstars Bclear.
  534. These commands are an alternative to Cstars Clear and Cstars Draw.
  535.  
  536.     Cstars Bdraw is used to draw stars onto the screen.  However, unlike
  537. Cstars Draw, Cstars Bdraw saves the background of each individual star
  538. before actually drawing it.  This makes it possible to pass stars over
  539. graphics such as logos, scrolltexts etc. without corrupting the graphics.
  540.  
  541.     There are 3 different different versions of this command.  The first
  542. version draws ALL stars in the starfield.  The second version only draws
  543. star N.  The third version will draw stars N1 To N2 inclusive.
  544.  
  545.     Cstars Bdraw will draw either single coloured or multicoloured
  546. starfields, depending on the type of starfields you reserved with Cstars
  547. Reserve.
  548.  
  549.     Cstars Bdraw uses the main processor, not the blitter.  Users with
  550. faster processors will therefore be at an advantage.  Cstars Bdraw is
  551. almost as fast as Cstars Draw but not quite, since Cstars Bdraw has to save
  552. the background of each star before drawing it.  The processor therefore has
  553. slightly more work to do, so use Cstars Draw when possible.
  554.  
  555. Possible Errors:
  556.  
  557. STARS NOT RESERVED
  558. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved or N1<1 or
  559. N1>Number of stars reserved or N2<N1 or N2>Number of stars reserved.
  560. --------------------------------------------------------------------------
  561. Instruction Name: Cstars Calc
  562.  
  563. Syntax: Cstars Calc
  564.         Cstars Calc N
  565.         Cstars Calc N1 To N2
  566.  
  567. Function:
  568.  
  569.     Cstars Calc is called to calculate the new position of stars.  Cstars
  570. Calc achieves this by adding the X Spd to the X coordinate and the Y Spd to
  571. the Y coordinate for each star.  This command also checks to see if the
  572. star has passed off of the edge of the screen (or out of the LIMITED area
  573. if you've used Cstars Limit).  If origin mode is off, the star will "wrap
  574. around" to the opposite edge of the screen.  If origin mode is on, the star
  575. will be positioned back at it's origin.  See Cstars Make Origins for
  576. details or Cool Stars! cool origin mode.
  577.  
  578.     There are 3 different versions of this command.  The first version
  579. calculates the new coordinates for ALL stars in the starfield.  The second
  580. version calculates the new coordinates for just star N.  The third version
  581. calculates the new coordinates for stars N1 to N2 inclusive.
  582.  
  583. Possible Errors:
  584.  
  585. STARS NOT RESERVED
  586. ILLEGAL FUNCTION CALL - If N<1 or N>Number of stars reserved or N1<1 or
  587. N1>Number of stars reserved or N2<N1 or N2>Number of stars reserved.
  588. --------------------------------------------------------------------------
  589.  
  590. -*IMPORTANT*- - Concerns the star clearing and drawing commands!
  591. ----------------------------------------------------------------
  592.  
  593.     Cstars Clear, Cstars Draw, Cstars Bclear and Cstars Bdraw will always
  594. use the bitplane(s) of the screen which you reserved your stars on, it
  595. doesn't matter at all which screen is the current screen when you call
  596. these commands.  These 4 commands are highly optimised for speed.  They use
  597. precalculated data which Cstars Reserve has created.  You must therefore
  598. ensure that you haven't accidentally closed, resized or reopened the screen
  599. the stars were reserved on.  If you have, the addresses may be invalid.
  600. These 4 commands may then end up changing some other parts of your Amiga's
  601. memory and a crash is very likely.  Use these commands with care!
  602.  
  603.     Okay, that's the end of this doc file.
  604.