/*
 * hour.h
 *
 * [Generated from hour, 25 September 1996]
 */

#if !defined(__CC_NORCROFT) || !defined(__arm)
  #error You must use the Norcroft ARM Compiler for Sapphire programs
#endif

#pragma include_only_once
#pragma force_top_level

#ifndef __hour_h
#define __hour_h

#ifndef __sapphire_h
  #include "sapphire.h"
#endif

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

/* --- 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
 */

extern routine 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.
 */

extern routine 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.
 */

extern routine 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.
 */

extern routine hour_percent;

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

extern routine 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).
 */

extern routine 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.
 */

extern routine 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.
 */

extern routine 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.
 */

extern routine hour_resume;
extern routine hour_restore;

/*----- That's all, folks -------------------------------------------------*/

#endif
