ScummVM API documentation
smush_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 GRIM_MOVIE_SMUSH_TIMER_H
23#define GRIM_MOVIE_SMUSH_TIMER_H
24
25#include "common/scummsys.h"
26
27namespace Grim {
28
29#define SYS_MAX_TIMERS 19
30
31// Ticks per second of the system timer (the 8253 clock frequency)
32#define SMUSH_TIMER_FREQUENCY 1193180
33
34#define SYS_TIMER_ONE_SHOT 2
35#define SYS_TIMER_EXT_SYNC 8
36
37typedef void (*SmushTimerCallback)(int timer, void *context);
38
40 SmushTimerCallback callback;
41 int period;
42 int flags;
43 void *context;
44 int reentrant;
45 int accumulator;
46 int extSync;
47};
48
50
51private:
52 SmushTimerSlot _timers[SYS_MAX_TIMERS + 1];
53 int _sysGlobalTimer;
54 int _sysTickIncrement;
55 uint32 _timerThreadLastTime;
56 int _sysInitCount;
57
58 void timerTick();
59
60public:
61 SmushTimer();
63
64 int moduleStartup();
65 void moduleShutdown();
66 void timerThread();
67
68 int sysAlloc(SmushTimerCallback callback, int period, int flags, void *context);
69 void sysFree(int timer);
70 void sysReset(int timer, int period);
71 int sysGetTime();
72 void sysExtSync(int value);
73
74};
75
76} // End of namespace Grim
77#endif
Definition: smush_timer.h:49
Definition: smush_timer.h:39