2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2007-09-28 23:52:08 +04:00
|
|
|
// $Id: slowdown_timer.h,v 1.13 2007-09-28 19:52:06 sshwarts Exp $
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2006-03-07 01:32:03 +03:00
|
|
|
// Copyright (C) 2002 MandrakeSoft S.A.
|
|
|
|
//
|
|
|
|
// MandrakeSoft S.A.
|
|
|
|
// 43, rue d'Aboukir
|
|
|
|
// 75002 Paris - France
|
|
|
|
// http://www.linux-mandrake.com/
|
|
|
|
// http://www.mandrakesoft.com/
|
|
|
|
//
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library 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 GNU
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
// License along with this library; if not, write to the Free Software
|
|
|
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
//
|
2001-08-18 07:28:23 +04:00
|
|
|
|
2006-03-07 01:32:03 +03:00
|
|
|
#ifndef BX_IODEV_SLOWDOWN_TIMER_H
|
|
|
|
#define BX_IODEV_SLOWDOWN_TIMER_H
|
2001-08-18 07:28:23 +04:00
|
|
|
|
2006-03-07 01:32:03 +03:00
|
|
|
class bx_slowdown_timer_c : public logfunctions {
|
2001-08-18 07:28:23 +04:00
|
|
|
private:
|
|
|
|
struct {
|
|
|
|
Bit64u start_time;
|
|
|
|
Bit64u start_emulated_time;
|
|
|
|
Bit64u lasttime;
|
|
|
|
|
|
|
|
int timer_handle;
|
|
|
|
|
2001-08-22 05:21:30 +04:00
|
|
|
float MAXmultiplier;
|
2005-10-22 21:31:02 +04:00
|
|
|
Bit64u Q; // sleep rate in usec
|
2001-08-18 07:28:23 +04:00
|
|
|
} s;
|
|
|
|
|
|
|
|
public:
|
|
|
|
bx_slowdown_timer_c();
|
|
|
|
|
2002-10-25 01:07:56 +04:00
|
|
|
void init(void);
|
2006-09-16 23:30:56 +04:00
|
|
|
void exit(void);
|
2006-05-27 19:54:49 +04:00
|
|
|
void after_restore_state(void);
|
2001-08-18 07:28:23 +04:00
|
|
|
|
|
|
|
static void timer_handler(void * this_ptr);
|
|
|
|
|
|
|
|
void handle_timer();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
extern bx_slowdown_timer_c bx_slowdown_timer;
|
|
|
|
|
2006-03-07 01:32:03 +03:00
|
|
|
#endif
|