DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
include/timer.h
00001 /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef DOSBOX_TIMER_H
00020 #define DOSBOX_TIMER_H
00021 
00022 /* underlying clock rate in HZ */
00023 #include <SDL.h>
00024 
00025 #define PIT_TICK_RATE_IBM 1193182
00026 
00027 #define PIT_TICK_RATE_PC98_8MHZ 1996800
00028 
00029 #define PIT_TICK_RATE_PC98_10MHZ 2457600
00030 
00031 extern unsigned long PIT_TICK_RATE;
00032 
00033 #define GetTicks() SDL_GetTicks()
00034 
00035 typedef void (*TIMER_TickHandler)(void);
00036 
00037 /* Register a function that gets called everytime if 1 or more ticks pass */
00038 void TIMER_AddTickHandler(TIMER_TickHandler handler);
00039 void TIMER_DelTickHandler(TIMER_TickHandler handler);
00040 
00041 /* This will add 1 milliscond to all timers */
00042 void TIMER_AddTick(void);
00043 
00044 /* Functions for the system control port 61h */
00045 bool TIMER_GetOutput2();
00046 void TIMER_SetGate2(bool in);
00047 
00048 #endif