2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2009-12-04 22:50:29 +03:00
|
|
|
// $Id: slowdown_timer.h,v 1.16 2009-12-04 19:50:29 sshwarts Exp $
|
2001-10-03 17:10:38 +04:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2009-12-04 22:50:29 +03:00
|
|
|
// Copyright (C) 2002-2009 The Bochs Project
|
2006-03-07 01:32:03 +03:00
|
|
|
//
|
|
|
|
// 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
|
2009-02-08 12:05:52 +03:00
|
|
|
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
2006-03-07 01:32:03 +03:00
|
|
|
//
|
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
|