2004-12-11 11:35:33 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
2011-02-25 01:05:47 +03:00
|
|
|
// $Id$
|
2004-12-11 11:35:33 +03:00
|
|
|
/////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2013-12-27 21:47:44 +04:00
|
|
|
// Copyright (C) 2004-2013 The Bochs Project
|
2004-12-11 11:35:33 +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
|
2004-12-11 11:35:33 +03:00
|
|
|
|
|
|
|
|
|
|
|
#ifndef _PCBUSM_H
|
|
|
|
#define _PCBUSM_H
|
|
|
|
|
2013-12-27 21:47:44 +04:00
|
|
|
#if BX_SUPPORT_BUSMOUSE
|
|
|
|
|
2004-12-11 11:35:33 +03:00
|
|
|
// these keywords should only be used in busmouse.cc
|
|
|
|
#if BX_USE_BUSM_SMF
|
|
|
|
# define BX_BUSM_SMF static
|
|
|
|
# define BX_BUSM_THIS theBusMouse->
|
|
|
|
#else
|
|
|
|
# define BX_BUSM_SMF
|
2008-01-27 01:24:03 +03:00
|
|
|
# define BX_BUSM_THIS
|
2004-12-11 11:35:33 +03:00
|
|
|
#endif
|
|
|
|
|
2009-03-03 23:34:50 +03:00
|
|
|
class bx_busm_c : public bx_devmodel_c {
|
2004-12-11 11:35:33 +03:00
|
|
|
public:
|
2006-03-08 00:11:20 +03:00
|
|
|
bx_busm_c();
|
|
|
|
virtual ~bx_busm_c();
|
2004-12-11 11:35:33 +03:00
|
|
|
|
2006-03-08 00:11:20 +03:00
|
|
|
virtual void init(void);
|
2006-09-10 21:18:44 +04:00
|
|
|
virtual void reset(unsigned type) {}
|
2006-05-27 19:54:49 +04:00
|
|
|
virtual void register_state(void);
|
2004-12-11 11:35:33 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
static void timer_handler(void *);
|
|
|
|
void busm_timer(void);
|
2013-12-27 21:47:44 +04:00
|
|
|
|
|
|
|
static void mouse_enq_static(void *dev, int delta_x, int delta_y, int delta_z, unsigned button_state, bx_bool absxy);
|
2009-03-03 23:34:50 +03:00
|
|
|
void mouse_enq(int delta_x, int delta_y, int delta_z, unsigned button_state);
|
2013-12-27 21:47:44 +04:00
|
|
|
void update_mouse_data(void);
|
|
|
|
|
2004-12-11 11:35:33 +03:00
|
|
|
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
|
|
|
static void write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
|
|
|
|
#if !BX_USE_BUSM_SMF
|
2008-12-29 23:16:08 +03:00
|
|
|
void write(Bit32u address, Bit32u value, unsigned io_len);
|
|
|
|
Bit32u read(Bit32u address, unsigned io_len);
|
2004-12-11 11:35:33 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
int timer_index; // our timer index
|
|
|
|
|
|
|
|
int mouse_delayed_dx;
|
|
|
|
int mouse_delayed_dy;
|
2013-12-27 21:47:44 +04:00
|
|
|
Bit8u mouse_buttons;
|
2004-12-11 11:35:33 +03:00
|
|
|
Bit8u current_x, current_y, current_b;
|
|
|
|
|
|
|
|
Bit8u control_val;
|
2013-12-27 21:47:44 +04:00
|
|
|
Bit8u command_val; // current command val
|
2004-12-11 11:35:33 +03:00
|
|
|
bx_bool interrupts; // 0 or 1. interrupts off or on.
|
2013-12-27 21:47:44 +04:00
|
|
|
bx_bool sig_port_sequ; // A register read rotates between two values? 0xDE and Hardware ID?
|
|
|
|
bx_bool needs_update; // update of mouse data register required
|
2004-12-11 11:35:33 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // BX_SUPPORT_BUSMOUSE
|
2013-12-27 21:47:44 +04:00
|
|
|
|
|
|
|
#endif // #ifndef _PCBUSM_H
|