/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* > c.visdelay
 *
 * Title: visdelay.c
 * Purpose: Visual indication of some delay
 * Author: W. Stoye, A.Thompson
 * Requires:
 *   h.os
 * History:
 *   07-Oct-87: WRS: started, in AEM-2
 *   23-Nov-87: WRS: moved to C.
 *    5-May-88: APT: filled in the bodies with Hourglass SWIs
 *   13-May-91: ECN: turned off stack checking
*/

#include "h.os"
#include "h.visdelay"

#define Hourglass_On         (0x406C0 + os_X)
#define Hourglass_Off        (0x406C1 + os_X)
#define Hourglass_Smash      (0x406C2 + os_X)
#define Hourglass_Start      (0x406C3 + os_X)
#define Hourglass_Percentage (0x406C4 + os_X)
#define Hourglass_LEDs       (0x406C5 + os_X)

#pragma -s1

void visdelay_begin(void)
{
 os_swi0(Hourglass_On) ;
}
/* Indicate to the user that there will be a short, computation-intensive
delay. The cursor changes to an hourglass. */

void visdelay_percent(int p)
{
 os_swi1(Hourglass_Percentage,p) ;
}
/* Indicate to the user that the delay is p/100 complete */

void visdelay_end(void)
{
 os_swi0(Hourglass_Off) ;
}
/* End the delay indication. */

void visdelay_init(void)
{
}
/* Maybe this should do an Hourglass_Smash, or something ? */

#pragma -s0

/* end */