dosbox-wii/include/timer.h

39 lines
1.2 KiB
C
Raw Normal View History

2009-05-02 23:03:37 +02:00
/*
2009-05-02 23:53:27 +02:00
* Copyright (C) 2002-2004 The DOSBox Team
2009-05-02 23:03:37 +02:00
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2009-05-03 00:02:15 +02:00
* GNU General Public License for more details.
2009-05-02 23:03:37 +02:00
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef _TIMER_H_
#define _TIMER_H_
/* underlying clock rate in HZ */
2009-05-02 23:20:05 +02:00
#include <SDL.h>
2009-05-02 23:03:37 +02:00
2009-05-02 23:20:05 +02:00
#define PIT_TICK_RATE 1193182
2009-05-02 23:03:37 +02:00
#define GetTicks() SDL_GetTicks()
2009-05-03 00:02:15 +02:00
typedef void (*TIMER_TickHandler)(void);
2009-05-02 23:03:37 +02:00
/* Register a function that gets called everytime if 1 or more ticks pass */
2009-05-03 00:02:15 +02:00
void TIMER_AddTickHandler(TIMER_TickHandler handler);
void TIMER_DelTickHandler(TIMER_TickHandler handler);
2009-05-02 23:03:37 +02:00
2009-05-02 23:27:47 +02:00
/* This will add 1 milliscond to all timers */
void TIMER_AddTick(void);
2009-05-02 23:03:37 +02:00
#endif