;
; hour.sh
;
; Handling of the hourglass
;
;  1994-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; Sapphire is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Functions provided:
;
;  hour_init
;  hour_on
;  hour_off
;  hour_percent
;  hour_leds
;  hour_suspend
;  hour_save
;  hour_resume
;  hour_restore

		[	:LNOT::DEF:hour__dfn
		GBLL	hour__dfn

; --- hour_init ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Initialises the hour system, so it will display an hourglass
;		when necessary.
;
;		Since this gets called at a random point during the Sapphire
;		initialisation, and we can rely on Hourglass keeping its
;		own count, the suggested way of handling everything properly
;		is as follows:
;
;				SWI	Hourglass_On
;				BL	sapphire_init
;				SWI	Hourglass_Off

		IMPORT	hour_init

; --- hour_on ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Turns the Hourglass on only if it isn't on already.
;		Otherwise its status is left as it was.

		IMPORT	hour_on

; --- hour_off ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Turns the Hourglass off if it's only been turned on once.
;		If the Hourglass gets turned off, all the information about
;		it (percentage and LEDs) get forgotten.

		IMPORT	hour_off

; --- hour_percent ---
;
; On entry:	R0 == percentage value to display, or -1 to remove
;
; On exit:	--
;
; Use:		Attaches a percentage display to the Hourglass.

		IMPORT	hour_percent

; --- hour_leds ---
;
; On entry:	R0 == LED mask EOR value
;		R1 == LED mask AND value
;
; On exit:	--
;
; Use:		Changes the Hourglass LED status.

		IMPORT	hour_leds

; --- hour_suspend ---
;
; On entry:	R0 == pointer to 2 word block to save status in
;
; On exit:	--
;
; Use:		Saves the Hourglass state in a block you've pointed at,
;		and disables the Hourglass.  Useful if you want to do some
;		user interaction without polling (e.g. an error box).

		IMPORT	hour_suspend

; --- hour_save ---
;
; On entry:	R0 == pointer to 2 word block to save status in
;
; On exit:	--
;
; Use:		Saves the current Hourglass status without altering it.

		IMPORT	hour_save

; --- hour_resume, hour_restore ---
;
; On entry:	R0 == pointer to 2 words filled by hour_suspend or hour_save
;
; On exit:	--
;
; Use:		Restores the Hourglass state to that saved away by one
;		of the previous two calls.  This routine has two names.

		IMPORT	hour_resume

; --- hour_resume, hour_restore ---
;
; On entry:	R0 == pointer to 2 words filled by hour_suspend or hour_save
;
; On exit:	--
;
; Use:		Restores the Hourglass state to that saved away by one
;		of the previous two calls.  This routine has two names.

		IMPORT	hour_resume
		IMPORT	hour_restore

		]

;----- That's all, folks ----------------------------------------------------

		END
