Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Macros | Functions
TICKER

Ticker Timer System. More...

Macros

#define TICKER_DIVIDER   ((T_word16)(65535.0 / TICKER_SPEED_UP_RATE))
 
#define TICKER_INTERRUPT_NUMBER   0x8
 
#define TICKER_SPEED   70.0
 
#define TICKER_SPEED_UP_RATE   (TICKER_SPEED / 18.2)
 

Functions

T_void ITickerAtExit (T_void)
 
T_void TickerContinue (T_void)
 
T_word32 TickerGet (T_void)
 
T_word32 TickerGetAccurate (T_void)
 
T_void TickerInc (T_void)
 
T_void TickerOff (T_void)
 
T_void TickerOn (T_void)
 
T_void TickerPause (T_void)
 

Detailed Description

Ticker Timer System.

Track the time in the system in 70ths of second since the start of the application.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Macro Definition Documentation

#define TICKER_DIVIDER   ((T_word16)(65535.0 / TICKER_SPEED_UP_RATE))
#define TICKER_INTERRUPT_NUMBER   0x8
#define TICKER_SPEED   70.0
#define TICKER_SPEED_UP_RATE   (TICKER_SPEED / 18.2)

Function Documentation

T_void ITickerAtExit ( T_void  )

ITickerAtExit is the routine called to restore the timer if it has not already done so. This is mainly for when a crash occurs.

T_void TickerContinue ( T_void  )

TickerContinue continues the counter from a previous call to TickerPause. Note that you can call this routine more than once, but if you do, you must call (or have called) TickerPause an equal number of times.

T_word32 TickerGet ( T_void  )

TickerGet returns the number of ticks that have passed since the TickerOn was called.

NOTE: Don't worry about this timer rolling over because it will take about 2 years of the computer being constantly on and nobody reseting the computer.

Returns
Number of ticks
T_word32 TickerGetAccurate ( T_void  )
T_void TickerInc ( T_void  )
T_void TickerOff ( T_void  )

TickerOff will turn off the ticker counter.

NOTE: This routine MUST be called before you end the program. If you do not, DOS will crash at a later point (most likely).

T_void TickerOn ( T_void  )

Before any ticks progress in the system, you need to first turn on the Ticker by using TickerOn. After that, the tick count is increment about 55 times a second. Use TickerGet to get the current count.

NOTE: Don't call this routine twice.

T_void TickerPause ( T_void  )

TickerPause stops the counter from counting so that future actions that depend on the ticker think that it is not updating (although the interrupts will still occur). Note that you can call this routine more than once, but if you do, you must call TickerContinue an equal number of times for it to return to its previous state.