home *** CD-ROM | disk | FTP | other *** search
-
- ______________________________________________________________________________
- | | |
- | YY YY 2222 | © Copyright 1993, Ian Palmer. |
- | YY YY 22 22 | |
- | YY YY aaaa sssss sssss 22 | All rights reserved. |
- | YYYY aa ss ss 22 |—————————————————————————————————————|
- | YY aaaaa ssss ssss 22 | "We must have done something wrong."|
- | YY aa aa ss ss 22 | "Oook." |
- | YY aaaaa sssss sssss 222222 | "Maybe He is out." |
- | | "Or busy..." |
- |________________________________________| "Do you think we could give up and |
- | __ _ | go back to bed?" |
- | by / _ _ /_) _ / _ _ _ | WHO ARE WE WAITING FOR EXACTLY? |
- | _/_(_|_| ) / (_|_(_| ) )_|/_|~ | -- "Eric" by Terry Pratchett |
- |________________________________________|_____________________________________|
-
-
- Introduction
- ------------
-
- Yass 2 is 'Yet Another Screen Saver' designed especially for the users of
- Risc-OS 3 (version 3.10 or later). But hold on a mo... Risc-OS 3 users don't
- need another screen saver, they have the wonderful ScreenBlanker module.
-
- Well that's just it, the ScreenBlanker module does it's job, but it is rather
- dull, to put it mildly. Yass 2 has been designed, not to replace the
- ScreenBlanker module, but to augment it.
-
- What Yass 2 offers is an alternative to the ScreenBlanker module whilst using
- the desktop, but allows the module to work normally when you are outside the
- desktop. Yass 2's alternative is a programmable screen saver which not only
- allows you to write your own screen saver displays, but also allows you to have
- a selection of screen savers which it will swap between randomly, making sure
- that your screen saver does not become dull.
-
- Most screen saver programs available for the Arc have one, or more, of the
- following problems :
-
- • They don't allow other tasks to operate whilst the screen is blanked
- (ie. they don't multitask).
-
- • They don't work outside the desktop.
-
- • They have one or two rather dull displays, or even worse just blank the
- screen.
-
- • If programmable, they tend to only allow one selected display at a time,
- meaning that when you want a change, you have to make the change yourself.
-
- • They don't handle ALL keys (inc. shift, ctrl, etc.)
-
- • Some can be fairly large programs.
-
- When using Yass 2 fully, you don't suffer any of the above problems.
-
-
- How to use Yass 2
- -----------------
-
- When you run Yass 2 for the first time you will probably need to set it up for
- your own preferences. With Yass 2 loaded, press SELECT over it's iconbar icon.
- This will bring up the Yass SetUp window.
-
- This window allows you to set the following :
-
- • The Yass 2 (Desk Top) blanking time
-
- • The non desktop (Standard) blanking time
-
- • The 'Sleep' corner
-
- • The 'No Sleep' corner
-
- If you have disabled (killed) the ScreenBlanker module then you will be unable
- to set the second option. The two blanking times can be altered by using the up
- and down arrows, the time can be set in steps of 30 seconds. Either can be
- switched off by setting the time to zero (displayed as 'Off'). Holding down
- SHIFT when altering the saver times makes the time step in 1 second units,
- thus allowing complete control down to the second.
-
- The 'Sleep' corner is a corner of the screen where if the mouse pointer is
- moved the screen saver is started instantly (Desktop only). The 'No Sleep'
- corner is a corner where the screen saver will never start up (Desktop only).
- Either can be set by clicking over the icon for the corner you require (the
- current corner is indicated by the raised icon). Pressing SELECT over a corner
- will make that corner the selected corner, pressing ADJUST over any of the
- corners will make no corner selected).
-
- Once you have selected your blanking times and corner options, you can now
- select which screen savers you want Yass 2 to use. This is done by bringing up
- the main menu, and then the 'Savers' submenu. This menu lists all the screen
- saver modules known to Yass 2. Those with ticks show the currently selected
- modules. Holding down SHIFT and selecting one of the savers will make that
- saver the only selected saver (ie. will tick that saver and un-tick all the
- others).
-
- If only 1 saver module is ticked, that saver will always be used. If none are
- ticked then the default saver is used (blank screen). If more than one is
- selected then one will be picked at random, that saver will run for a certain
- amount of time, and then another one of the selected savers will be picked, and
- so on.
-
- Once you have selected the savers you want to use, go back to the main menu,
- and bring up the 'Status' submenu. Clicking on the 'Save' entry in this menu
- will save you selections.
-
-
- The Screen Saver in action
- --------------------------
-
- When the desired length of keyboard and mouse inactivity has taken place, one
- of the selected screen savers will be started. This will run for a period of
- time (set by the screen saver itself) and then another of the selected savers
- will be started to take over. This ensures that the screen saver doesn't become
- too boring.
-
- During screen saving other desktop applications will still multi-task, and thus
- the speed of the action of the screen saver will depend upon the number of
- applications running.
-
- As soon as you move the mouse, press a mouse button, press any key on the
- keyboard or if a window is opened on the screen, the screen saver will stop and
- return the desktop to normal.
-
- When running non multi-tasking applications the built in screen saver module
- will take over screen saving as normal.
-
- Yass 2 tries to make as little impact on the desktop as it can. When the
- screen saver is not active, Yass 2 checks the keyboard and mouse once a second.
- When running a screen saver, Yass 2 automatically adjusts the amount of
- CPU time it takes according to the general load of the computer, the higher
- the load the lower the demands Yass 2 makes (but your display will tend to
- grind, but you can't have anything).
-
- You can force Yass 2 to always use small chunks of CPU time when running a
- screen saver by selecting the 'Slow' option on the status menu. This will
- force Yass2 to run the saver modules VERY slowly.
-
-
- Creating your own screen saver modules
- --------------------------------------
-
- Creating your own display modules for the screen saver is very simple. Anyone
- with a fairly good grasp of Basic can do it, and no knowlege of Wimp
- programming is required.
-
- All you need to do is create your own Basic program containing three functions.
- These functions will be called by Yass 2 when necessary. The three functions
- handle initialisation, running the saver, and tidying up.
-
- First you need to pick a name for your saver module (the filename). In the
- description below we are creating a saver module called 'Test' which will draw
- random lines on the screen.
-
-
- - Initialisation
-
- During initialization you should do the following :
-
- Clear the screen (calling PROCclearscreen(-1) )
- Initialize your variables, and claim any memory you need.
-
- Try to use as many LOCAL variables as tou can, and prefix your globals with
- your modules name (eg. test_x%).
- The initialization function should be given the name of your module followed by
- '_start', for example 'FNtest_start' (note the 'test' is all in lower case).
-
- Claiming memory should NOT use the DIM command. Instead you should call a
- special function called FNmalloc which takes the number of bytes you require as
- it's parameter, for esample "test_b% = FNmalloc(128)" will make test_b% point
- to a block of memory 128 bytes long. FNmalloc returns zero if memory is not
- available (very unlikely, but you should handle this situation (see below)).
-
- The initialization function should return 0 if it managed to initialize
- correcly. If it could not initialize correctly it should first deallocate any
- memory it was allocated (pass it to a procedure PROCfree, eg.
- PROCfree(test_b%)) and then return TRUE.
-
- If the initialization finction returns the number 1, Yass 2 will ensure that
- the desktop is displayed before calling the poll function (see below).
- This means that you can write savers that use the desktop as a starting point,
- for example melting the desktop, etc.
-
- Please note that your screen saver should be able to run in any mode (it must
- under no circumstances change mode itself). However you may wish to write a
- module that only works in, say, 16 colour modes. If this is the case then the
- initialization code should first check the value of max_c% (which is set up by
- Yass 2) which contains the number of colours in the current mode. If this
- number is no good for the module, the function should just return TRUE (ie.
- signal that initialization has failed).
-
- Now in our example module, initialization is fairly simple :
-
- DEFFNtest_start
- PROCclear_screen(-1)
- =0
-
-
- - Running the saver
-
- The next function is called repeatedly, and it should update the display by a
- small amount each time (in our example we will draw a single line).
-
- The function should be called the name of your module followed by _poll, eg.
- FNtest_poll.
-
- This function should also determin whether or not it ghas run for long enough.
- This may be determined by what the module does (ie. the display may have a
- defined end), or you may simply set a time limit on the module. TO help with
- the latter case, Yass 2 sets a variable now_going% which contains the number of
- 1/100ths of a second the saver has been running.
-
- The function should normally return 0, but when it decides to stop it should
- return TRUE. Ideally each saver should run for somewhere between 2 and 5
- minutes. Returning a value of 1 will force the 'poll' routine to be called
- less frequently, thus slowing it down. This is useful for saver routines
- like the supplied 'time' and 'clock' saver modules, which only act once a
- second.
-
- In our case we will volunteer to stop after 2 minutes.
-
- DEFFNtest_poll
- PROCset_colour(0,RND(16)-1)
- MOVE RND(max_x%)-1,RND(max_y%)-1:DRAW RND(max_x%)-1,RND(max_y%)-1
- IF now_going%>12000 THEN =TRUE
- =0
-
-
- - Tidying up
-
- This function is called when your saver module is being stopped. It should thus
- deallocate any memory it allocated, and perform any other tidying up operations
- necessary.
-
- After tydying the function should return 0.
-
- In our example, the function need do nothing :
-
- DEFFNtest_stop
- =0
-
-
-
- In each of the above there are several procedures and variables available :
-
- FNmalloc(size) - Returns a pointer to a block of memory at least 'size'
- bytes long. If it returns 0 the memory was not available
-
- PROCfree(ptr) - Deallocates the memory pointed to by 'ptr'. 'ptr' must
- be a value returned by FNmalloc.
-
- PROCset_colour(g,c) - Sets the current colour to the given Wimp colour (0-15).
- Parameters as for GCOL.
-
- PROCclearscreen(r) - Clears the screen. 'r' should be -1.
-
- max_x% - Gives the max x coordinate of the screen.
-
- max_y% - Gives the max y coordinate of the screen.
-
- max_c% - Gives the number of colours for the current screen.
- (ie. 1, 3, 15 or 63)
-
- now_going% - Number of centiseconds the current saver has been
- running.
-
-
- A Basic program called 'Shell' is supplied with this application which contains
- a developement environment for testing new modules. Add your functions to the
- and of the program, which supplies simulated versions of all the above
- procedures and variables.
-
- Set the 'module$' variable at the start of this program to contain the name of
- the module (ie. "test" in the above).
-
-
- If your screen saver needs more than one file (for example it has some sprites,
- etc.) then you should place any extra files in the 'Resources' directory
- (<Yass2$Dir>.Resources). If there is one extra file needed this should be
- given the same name as the saver module (to avoid problems later on). If there
- are more files needed you should create a directory (name as saver module)
- in the resources directory, and place the files in that directory.
-
-
- Other Yass functions
- --------------------
-
- Yass2 performs several other useful functions. The first of these is the
- ability to set the state on of the internal speaker, and it's volume. This
- can be done by clicking ADJUST on Yass2's iconbar icon. This brings up a window
- which contains 2 sections, the first informs you a bit about Yass 2's state
- (number of savers, number currently selected and it's internal free memory),
- and to the right of this are the speaker options.
-
- Yass 2 also allows you to have a special window which keeps you informed about
- two useful pieces of information. These are the current time and the amount
- of free memory currently available on your computer. To get this information
- simply bring up Yass2's menu, and then bring up the 'Status' submenu. Finally
- select the 'System' option on this menu. When this option is selected a
- window appears in the top left of the screen giving the two peices of
- information.
-
- This window can contain either a digital clock or an analogue clock, and can
- display hours & minutes or hours, minutes and seconds. The setting for these
- options can be selected in the 'System' submenu on the 'Status' menu. This
- menu also allows you to limit the display to either just a clock, or
- just a free memory indicator.
-
- The status window can be moved anywhere on the screen by simply pressing any
- mouse button (and holding it down) when the mouse pointer is over the window,
- and dragging the window to where you want it. The window is then 'locked' in
- that postion releative to the corner of the screen it is closest to. This
- means that when you change mode, it won't matter if the screen is a different
- size, the window will appear in the same position.
-
- You can also get Yass 2 to keep a check on your RMA size, keeping it as low
- as it can. To do this select the 'Zap RMA' option on the 'Status' menu.
-
- The final thing Yass 2 allows is the changing of your pinboard backdrop.
- There is a menu option of Yass2's main menu called 'Wallpaper'. This leads to
- a submenu which contains a list of available 'wallpapers'. This menu works in
- much the same way as the 'Savers' menu. Selecting any of the listed items
- will simply place (or remove) a tick from beside it, and SHIFT-SELECT will
- select that item whilst resetting all others.
-
- What Yass 2 does is when it starts up it looks at the list of ticked items
- and selects one at random, placing it on the backdrop. This having only one
- selected will make that always the backdrop, whilst having none selected
- will stop Yass 2 placing anything on the backdrop. To place any of the items
- on the backdrop with immediate effect, simply CTRL-SELECT the relevent item.
-
-
-
- Yass 2 startup options
- ----------------------
-
- Yass 2 supports 3 command line options :
-
- -left Makes Yass 2 place it's icon on the left hand side of the iconbar.
-
- -right Makes Yass 2 place it's icon on the right hand side of the iconbar.
-
- -none Makes Yass 2 place no icon on the iconbar.
-
-
-
- If no options are given, then the icon will (by default) be placed on the
- right hand side of the iconbar.
-
- NOTE: If you select the '-none' option then you will not be able to bring up
- the main menu, nor the blanking times window. Thus this option should only be
- used when you do not wish to alter Yass 2's characteristics.
-
- Yass 2 supports the Risc-OS 3 automatic Desktop Boot file creation. Thus if
- it is running it will add it's own start up line into a desktop boot file
- created from the task managers menu.
-
-
- Notes:
-
- Yass 2 will support upto 77 saver modules (as many as you can fit in the saver
- directory). However the currently defined wimpslot (64k) will not allow all
- of these to be selected, as each saver that is run will claim a certain
- amount of memory for variables, etc. Thus for the current wimpslot it is
- advisable to keep to a maximum of about 20 selected saver modules. If you want
- more than this you should increase the wimpslot given to Yass2 in its !Run
- file.
-