ScummVM API documentation
timer.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef MADS_CORE_TIMER_H
23#define MADS_CORE_TIMER_H
24
25#include "common/scummsys.h"
26
27namespace MADS {
28
29static const int TIMER_TICKS_PER_SECOND = 60;
30
31extern long *timer_address; /* "Default" timer count address */
32extern word timer_rate; /* Current timer ticks/sec */
33extern int timer_service_active; /* Flag if timer service active */
34
35extern word timer_sound_on; /* Flag if sound service active */
36extern word timer_noise_on; /* Flag if sound in noise mode */
37
38extern word timer_low_priority; /* Flag if low priority routine active */
39extern word timer_low_semaphore; /* Low priority activity semaphore */
40extern word timer_low_stacking; /* Low priority stacking count */
41extern word timer_low_deferred; /* Low priority deferred DOS flag */
42extern void *timer_low_routine; /* Low priority function pointer */
43
44extern long timer_600_low; /* 600/s timer count */
45extern long timer_60_low; /* 60/s timer_count */
46extern long timer_dos_low;
47
48
52extern long timer_read();
53inline long timer_read_dos() {
54 return timer_read();
55}
56
57extern long timer_read_600();
58extern long timer_read_60();
59
63extern void timer_install();
64
68extern void timer_remove();
69
73extern void timer_set_sound_flag(int sound_flag);
74
78extern void timer_activate_low_priority(void (*(routine))());
79
80extern byte *timer_get_interrupt_stack();
81
82extern int timer_set_copy_protect(int protect);
83extern int timer_get_copy_protect();
84
85extern void init_timer();
86
87} // namespace MADS
88
89#endif