home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities3 / _yass2 / !Yass2 / !Help next >
Encoding:
Text File  |  1993-05-15  |  16.0 KB  |  369 lines

  1.  
  2.  ______________________________________________________________________________
  3. |                                        |                                     |
  4. | YY  YY                          2222   |   © Copyright 1993, Ian Palmer.     |
  5. | YY  YY                         22  22  |                                     |
  6. | YY  YY  aaaa    sssss   sssss      22  |   All rights reserved.              |
  7. |  YYYY      aa  ss      ss         22   |—————————————————————————————————————|
  8. |   YY    aaaaa   ssss    ssss     22    | "We must have done something wrong."|
  9. |   YY   aa  aa      ss      ss   22     | "Oook."                             |
  10. |   YY    aaaaa  sssss   sssss   222222  | "Maybe He is out."                  |
  11. |                                        | "Or busy..."                        |
  12. |________________________________________| "Do you think we could give up and  |
  13. |     __          _                      |  go back to bed?"                   |
  14. | by  / _   _    /_) _   / _ _   _       | WHO ARE WE WAITING FOR EXACTLY?     |
  15. |   _/_(_|_| )  /   (_|_(_| ) )_|/_|~    |      -- "Eric" by Terry Pratchett   |
  16. |________________________________________|_____________________________________|
  17.  
  18.  
  19. Introduction
  20. ------------
  21.  
  22. Yass 2 is 'Yet Another Screen Saver' designed especially for the users of
  23. Risc-OS 3 (version 3.10 or later). But hold on a mo... Risc-OS 3 users don't
  24. need another screen saver, they have the wonderful ScreenBlanker module.
  25.  
  26. Well that's just it, the ScreenBlanker module does it's job, but it is rather
  27. dull, to put it mildly. Yass 2 has been designed, not to replace the
  28. ScreenBlanker module, but to augment it.
  29.  
  30. What Yass 2 offers is an alternative to the ScreenBlanker module whilst using
  31. the desktop, but allows the module to work normally when you are outside the
  32. desktop. Yass 2's alternative is a programmable screen saver which not only
  33. allows you to write your own screen saver displays, but also allows you to have
  34. a selection of screen savers which it will swap between randomly, making sure
  35. that your screen saver does not become dull.
  36.  
  37. Most screen saver programs available for the Arc have one, or more, of the
  38. following problems :
  39.  
  40.   • They don't allow other tasks to operate whilst the screen is blanked
  41.     (ie. they don't multitask).
  42.  
  43.   • They don't work outside the desktop.
  44.  
  45.   • They have one or two rather dull displays, or even worse just blank the
  46.     screen.
  47.  
  48.   • If programmable, they tend to only allow one selected display at a time,
  49.     meaning that when you want a change, you have to make the change yourself.
  50.  
  51.   • They don't handle ALL keys (inc. shift, ctrl, etc.)
  52.  
  53.   • Some can be fairly large programs.
  54.  
  55. When using Yass 2 fully, you don't suffer any of the above problems.
  56.  
  57.  
  58. How to use Yass 2
  59. -----------------
  60.  
  61. When you run Yass 2 for the first time you will probably need to set it up for
  62. your own preferences. With Yass 2 loaded, press SELECT over it's iconbar icon.
  63. This will bring up the Yass SetUp window.
  64.  
  65. This window allows you to set the following :
  66.  
  67.   • The Yass 2 (Desk Top) blanking time
  68.  
  69.   • The non desktop (Standard) blanking time
  70.  
  71.   • The 'Sleep' corner
  72.  
  73.   • The 'No Sleep' corner
  74.  
  75. If you have disabled (killed) the ScreenBlanker module then you will be unable
  76. to set the second option. The two blanking times can be altered by using the up
  77. and down arrows, the time can be set in steps of 30 seconds. Either can be
  78. switched off by setting the time to zero (displayed as 'Off'). Holding down
  79. SHIFT when altering the saver times makes the time step in 1 second units,
  80. thus allowing complete control down to the second.
  81.  
  82. The 'Sleep' corner is a corner of the screen where if the mouse pointer is
  83. moved the screen saver is started instantly (Desktop only). The 'No Sleep'
  84. corner is a corner where the screen saver will never start up (Desktop only).
  85. Either can be set by clicking over the icon for the corner you require (the
  86. current corner is indicated by the raised icon). Pressing SELECT over a corner
  87. will make that corner the selected corner, pressing ADJUST over any of the
  88. corners will make no corner selected).
  89.  
  90. Once you have selected your blanking times and corner options, you can now
  91. select which screen savers you want Yass 2 to use. This is done by bringing up
  92. the main menu, and then the 'Savers' submenu. This menu lists all the screen
  93. saver modules known to Yass 2. Those with ticks show the currently selected
  94. modules. Holding down SHIFT and selecting one of the savers will make that
  95. saver the only selected saver (ie. will tick that saver and un-tick all the
  96. others).
  97.  
  98. If only 1 saver module is ticked, that saver will always be used. If none are
  99. ticked then the default saver is used (blank screen). If more than one is
  100. selected then one will be picked at random, that saver will run for a certain
  101. amount of time, and then another one of the selected savers will be picked, and
  102. so on.
  103.  
  104. Once you have selected the savers you want to use, go back to the main menu,
  105. and bring up the 'Status' submenu. Clicking on the 'Save' entry in this menu
  106. will save you selections.
  107.  
  108.  
  109. The Screen Saver in action
  110. --------------------------
  111.  
  112. When the desired length of keyboard and mouse inactivity has taken place, one
  113. of the selected screen savers will be started. This will run for a period of
  114. time (set by the screen saver itself) and then another of the selected savers
  115. will be started to take over. This ensures that the screen saver doesn't become
  116. too boring.
  117.  
  118. During screen saving other desktop applications will still multi-task, and thus
  119. the speed of the action of the screen saver will depend upon the number of
  120. applications running.
  121.  
  122. As soon as you move the mouse, press a mouse button, press any key on the
  123. keyboard or if a window is opened on the screen, the screen saver will stop and
  124. return the desktop to normal.
  125.  
  126. When running non multi-tasking applications the built in screen saver module
  127. will take over screen saving as normal.
  128.  
  129. Yass 2 tries to make as little impact on the desktop as it can. When the
  130. screen saver is not active, Yass 2 checks the keyboard and mouse once a second.
  131. When running a screen saver, Yass 2 automatically adjusts the amount of
  132. CPU time it takes according to the general load of the computer, the higher
  133. the load the lower the demands Yass 2 makes (but your display will tend to
  134. grind, but you can't have anything).
  135.  
  136. You can force Yass 2 to always use small chunks of CPU time when running a
  137. screen saver by selecting the 'Slow' option on the status menu. This will
  138. force Yass2 to run the saver modules VERY slowly.
  139.  
  140.  
  141. Creating your own screen saver modules
  142. --------------------------------------
  143.  
  144. Creating your own display modules for the screen saver is very simple. Anyone
  145. with a fairly good grasp of Basic can do it, and no knowlege of Wimp
  146. programming is required.
  147.  
  148. All you need to do is create your own Basic program containing three functions.
  149. These functions will be called by Yass 2 when necessary. The three functions
  150. handle initialisation, running the saver, and tidying up.
  151.  
  152. First you need to pick a name for your saver module (the filename). In the
  153. description below we are creating a saver module called 'Test' which will draw
  154. random lines on the screen.
  155.  
  156.  
  157. - Initialisation
  158.  
  159. During initialization you should do the following :
  160.  
  161.   Clear the screen (calling PROCclearscreen(-1) )
  162.   Initialize your variables, and claim any memory you need.
  163.  
  164. Try to use as many LOCAL variables as tou can, and prefix your globals with
  165. your modules name (eg. test_x%).
  166. The initialization function should be given the name of your module followed by
  167. '_start', for example 'FNtest_start' (note the 'test' is all in lower case).
  168.  
  169. Claiming memory should NOT use the DIM command. Instead you should call a
  170. special function called FNmalloc which takes the number of bytes you require as
  171. it's parameter, for esample "test_b% = FNmalloc(128)" will make test_b% point
  172. to a block of memory 128 bytes long. FNmalloc returns zero if memory is not
  173. available (very unlikely, but you should handle this situation (see below)).
  174.  
  175. The initialization function should return 0 if it managed to initialize
  176. correcly. If it could not initialize correctly it should first deallocate any
  177. memory it was allocated (pass it to a procedure PROCfree, eg.
  178. PROCfree(test_b%)) and then return TRUE.
  179.  
  180. If the initialization finction returns the number 1, Yass 2 will ensure that
  181. the desktop is displayed before calling the poll function (see below).
  182. This means that you can write savers that use the desktop as a starting point,
  183. for example melting the desktop, etc.
  184.  
  185. Please note that your screen saver should be able to run in any mode (it must
  186. under no circumstances change mode itself). However you may wish to write a
  187. module that only works in, say, 16 colour modes. If this is the case then the
  188. initialization code should first check the value of max_c% (which is set up by
  189. Yass 2) which contains the number of colours in the current mode. If this
  190. number is no good for the module, the function should just return TRUE (ie.
  191. signal that initialization has failed).
  192.  
  193. Now in our example module, initialization is fairly simple :
  194.  
  195. DEFFNtest_start
  196. PROCclear_screen(-1)
  197. =0
  198.  
  199.  
  200. - Running the saver
  201.  
  202. The next function is called repeatedly, and it should update the display by a
  203. small amount each time (in our example we will draw a single line).
  204.  
  205. The function should be called the name of your module followed by _poll, eg.
  206. FNtest_poll.
  207.  
  208. This function should also determin whether or not it ghas run for long enough.
  209. This may be determined by what the module does (ie. the display may have a
  210. defined end), or you may simply set a time limit on the module. TO help with
  211. the latter case, Yass 2 sets a variable now_going% which contains the number of
  212. 1/100ths of a second the saver has been running.
  213.  
  214. The function should normally return 0, but when it decides to stop it should
  215. return TRUE. Ideally each saver should run for somewhere between 2 and 5
  216. minutes. Returning a value of 1 will force the 'poll' routine to be called
  217. less frequently, thus slowing it down. This is useful for saver routines
  218. like the supplied 'time' and 'clock' saver modules, which only act once a
  219. second.
  220.  
  221. In our case we will volunteer to stop after 2 minutes.
  222.  
  223. DEFFNtest_poll
  224. PROCset_colour(0,RND(16)-1)
  225. MOVE RND(max_x%)-1,RND(max_y%)-1:DRAW RND(max_x%)-1,RND(max_y%)-1
  226. IF now_going%>12000 THEN =TRUE
  227. =0
  228.  
  229.  
  230. - Tidying up
  231.  
  232. This function is called when your saver module is being stopped. It should thus
  233. deallocate any memory it allocated, and perform any other tidying up operations
  234. necessary.
  235.  
  236. After tydying the function should return 0.
  237.  
  238. In our example, the function need do nothing :
  239.  
  240. DEFFNtest_stop
  241. =0
  242.  
  243.  
  244.  
  245. In each of the above there are several procedures and variables available :
  246.  
  247.  FNmalloc(size)      -  Returns a pointer to a block of memory at least 'size'
  248.                         bytes long. If it returns 0 the memory was not available
  249.                      
  250.  PROCfree(ptr)       -  Deallocates the memory pointed to by 'ptr'. 'ptr' must
  251.                         be a value returned by FNmalloc.
  252.  
  253.  PROCset_colour(g,c) -  Sets the current colour to the given Wimp colour (0-15).
  254.                         Parameters as for GCOL.
  255.  
  256.  PROCclearscreen(r)  -  Clears the screen. 'r' should be -1.
  257.  
  258.  max_x%              -  Gives the max x coordinate of the screen.
  259.  
  260.  max_y%              -  Gives the max y coordinate of the screen.
  261.  
  262.  max_c%              -  Gives the number of colours for the current screen.
  263.                         (ie. 1, 3, 15 or 63)
  264.  
  265.  now_going%          -  Number of centiseconds the current saver has been
  266.                         running.
  267.  
  268.  
  269. A Basic program called 'Shell' is supplied with this application which contains
  270. a developement environment for testing new modules. Add your functions to the
  271. and of the program, which supplies simulated versions of all the above
  272. procedures and variables.
  273.  
  274. Set the 'module$' variable at the start of this program to contain the name of
  275. the module (ie. "test" in the above).
  276.  
  277.  
  278. If your screen saver needs more than one file (for example it has some sprites,
  279. etc.) then you should place any extra files in the 'Resources' directory
  280. (<Yass2$Dir>.Resources). If there is one extra file needed this should be
  281. given the same name as the saver module (to avoid problems later on). If there
  282. are more files needed you should create a directory (name as saver module)
  283. in the resources directory, and place the files in that directory. 
  284.  
  285.  
  286. Other Yass functions
  287. --------------------
  288.  
  289. Yass2 performs several other useful functions. The first of these is the
  290. ability to set the state on of the internal speaker, and it's volume. This
  291. can be done by clicking ADJUST on Yass2's iconbar icon. This brings up a window
  292. which contains 2 sections, the first informs you a bit about Yass 2's state
  293. (number of savers, number currently selected and it's internal free memory),
  294. and to the right of this are the speaker options.
  295.  
  296. Yass 2 also allows you to have a special window which keeps you informed about
  297. two useful pieces of information. These are the current time and the amount
  298. of free memory currently available on your computer. To get this information
  299. simply bring up Yass2's menu, and then bring up the 'Status' submenu. Finally
  300. select the 'System' option on this menu. When this option is selected a
  301. window appears in the top left of the screen giving the two peices of
  302. information.
  303.  
  304. This window can contain either a digital clock or an analogue clock, and can
  305. display hours & minutes or hours, minutes and seconds. The setting for these
  306. options can be selected in the 'System' submenu on the 'Status' menu. This 
  307. menu also allows you to limit the display to either just a clock, or
  308. just a free memory indicator.
  309.  
  310. The status window can be moved anywhere on the screen by simply pressing any
  311. mouse button (and holding it down) when the mouse pointer is over the window,
  312. and dragging the window to where you want it. The window is then 'locked' in
  313. that postion releative to the corner of the screen it is closest to. This
  314. means that when you change mode, it won't matter if the screen is a different 
  315. size, the window will appear in the same position.
  316.  
  317. You can also get Yass 2 to keep a check on your RMA size, keeping it as low
  318. as it can. To do this select the 'Zap RMA' option on the 'Status' menu.
  319.  
  320. The final thing Yass 2 allows is the changing of your pinboard backdrop.
  321. There is a menu option of Yass2's main menu called 'Wallpaper'. This leads to
  322. a submenu which contains a list of available 'wallpapers'. This menu works in
  323. much the same way as the 'Savers' menu. Selecting any of the listed items
  324. will simply place (or remove) a tick from beside it, and SHIFT-SELECT will
  325. select that item whilst resetting all others.
  326.  
  327. What Yass 2 does is when it starts up it looks at the list of ticked items
  328. and selects one at random, placing it on the backdrop. This having only one
  329. selected will make that always the backdrop, whilst having none selected
  330. will stop Yass 2 placing anything on the backdrop. To place any of the items
  331. on the backdrop with immediate effect, simply CTRL-SELECT the relevent item.
  332.  
  333.  
  334.  
  335. Yass 2 startup options
  336. ----------------------
  337.  
  338. Yass 2 supports 3 command line options :
  339.  
  340.   -left   Makes Yass 2 place it's icon on the left hand side of the iconbar.
  341.  
  342.   -right  Makes Yass 2 place it's icon on the right hand side of the iconbar.
  343.  
  344.   -none   Makes Yass 2 place no icon on the iconbar.
  345.  
  346.  
  347.  
  348. If no options are given, then the icon will (by default) be placed on the
  349. right hand side of the iconbar.
  350.  
  351. NOTE: If you select the '-none' option then you will not be able to bring up
  352. the main menu, nor the blanking times window. Thus this option should only be
  353. used when you do not wish to alter Yass 2's characteristics.
  354.  
  355. Yass 2 supports the Risc-OS 3 automatic Desktop Boot file creation. Thus if
  356. it is running it will add it's own start up line into a desktop boot file
  357. created from the task managers menu.
  358.  
  359.  
  360. Notes:
  361.  
  362. Yass 2 will support upto 77 saver modules (as many as you can fit in the saver
  363. directory). However the currently defined wimpslot (64k) will not allow all
  364. of these to be selected, as each saver that is run will claim a certain
  365. amount of memory for variables, etc. Thus for the current wimpslot it is
  366. advisable to keep to a maximum of about 20 selected saver modules. If you want
  367. more than this you should increase the wimpslot given to Yass2 in its !Run
  368. file.
  369.