home *** CD-ROM | disk | FTP | other *** search
- /*=============================================================================
-
- The INSTALL program source code, object code, sample script files,
- executable program, and documentation are subject to copyright
- protection under the laws of the United States and other countries.
-
- This software is licensed, not sold, and may only be redistributed
- in executable format and only in accordance with the provisions of
- the INSTALL Source Code License Agreement.
-
- INSTALL is Copyright(C) 1987-1990 by Knowledge Dynamics Corp
- Highway Contract 4 Box 185-H, Canyon Lake, TX (USA) 78133-3508
- 512-964-3994 (Voice) 512-964-3958 (24-hr FAX)
-
- All rights reserved worldwide.
-
- ===============================================================================
-
- FILENAME:
- time.c
-
- AUTHOR:
- eric jon heflin
-
- PUBLIC FUNCTIONS:
- time_delay() - delay specified number of clock ticks
-
- LOCAL FUNCTIONS:
- none
-
- DESCRIPTION:
- The single function in this file time_delay() will wait until a specified
- number of DOS clock ticks occur, or until a key is pressed, whichever
- comes first. Normally, the parameter indicating the number of ticks is
- a #define like _3_SEC_0 indicating to wait 3.0 seconds.
-
- This function is only used in banner().
-
- REVISION HISTORY:
- DATE: AUTHOR: DESCRIPTION OF CHANGES:
- 891230 ejh initial release
-
- ==============================================================================*/
-
- #include <string.h>
- #include "install.h"
-
- int kbhit(void);
-
- #if defined(LATTICE)
- #define getime(tm) peek(0x40, 0x6c, (char *)(tm), 4)
- #else
- #define getime(tm) memmove(((void *)(tm)), (void *)(0x40006clU), 4)
- #endif /* !LATTICE */
-
- /* ticks = 1/18.2 seconds to wait */
-
- void time_delay(word ticks)
- { /* time_delay */
- ulong now; /* quiet lint */
- ulong quit = (ulong) ticks;
- getime(&now);
- quit += now;
- while (now < quit && !kbhit())
- getime(&now);
- if (kbhit() && sgetch() == 0)
- sgetch();
- } /* time_delay */
-
- /* end-of-file */