Minor updates to the mouse code that may help with enable/disable problems.

Also fixed a warning in pc_system.h

 Modified Files:
 	main.cc pc_system.h iodev/keyboard.cc iodev/keyboard.h
This commit is contained in:
Gregory Alexander 2001-09-21 02:46:17 +00:00
parent d1038b9b2f
commit 3ace9e3288
4 changed files with 18 additions and 4 deletions

View File

@ -57,7 +57,7 @@ bx_keyb_c::bx_keyb_c(void)
memset( &s, 0, sizeof(s) );
BX_KEY_THIS put("KBD");
BX_KEY_THIS settype(KBDLOG);
BX_DEBUG(("Init $Id: keyboard.cc,v 1.31 2001-09-11 16:49:54 bdenney Exp $"));
BX_DEBUG(("Init $Id: keyboard.cc,v 1.32 2001-09-21 02:46:17 yakovlev Exp $"));
}
bx_keyb_c::~bx_keyb_c(void)
@ -92,7 +92,7 @@ bx_keyb_c::resetinternals(Boolean powerup)
void
bx_keyb_c::init(bx_devices_c *d, bx_cmos_c *cmos)
{
BX_DEBUG(("Init $Id: keyboard.cc,v 1.31 2001-09-11 16:49:54 bdenney Exp $"));
BX_DEBUG(("Init $Id: keyboard.cc,v 1.32 2001-09-21 02:46:17 yakovlev Exp $"));
Bit32u i;
BX_KEY_THIS devices = d;
@ -1393,6 +1393,17 @@ bx_keyb_c::create_mouse_packet(bool force_enq) {
mouse_enQ_packet(b1, b2, b3);
}
void
bx_keyb_c::mouse_enabled_changed(bool enabled) {
if(BX_KEY_THIS s.mouse.delayed_dx || BX_KEY_THIS s.mouse.delayed_dy) {
create_mouse_packet(1);
}
BX_KEY_THIS s.mouse.delayed_dx=0;
BX_KEY_THIS s.mouse.delayed_dy=0;
BX_DEBUG(("Keyboard mouse disable called."));
}
void
bx_keyb_c::mouse_motion(int delta_x, int delta_y, unsigned button_state)
{

View File

@ -51,6 +51,7 @@ public:
BX_KEY_SMF void gen_scancode(Bit32u scancode);
BX_KEY_SMF Bit8u get_kbd_enable(void);
BX_KEY_SMF void mouse_motion(int delta_x, int delta_y, unsigned button_state);
BX_KEY_SMF void mouse_enabled_changed(bool enabled);
BX_KEY_SMF void create_mouse_packet(bool force_enq);
BX_KEY_SMF void mouse_button(unsigned mouse_state);
BX_KEY_SMF int SaveState( class state_file *fd );

View File

@ -110,8 +110,10 @@ bx_param_handler (bx_param_c *param, int set, Bit32s val)
break;
case BXP_MOUSE_ENABLED:
// if after init, notify the GUI
if (set && SIM->get_init_done ())
if (set && SIM->get_init_done ()) {
bx_gui.mouse_enabled_changed (val!=0);
bx_keyboard.mouse_enabled_changed (val!=0);
}
break;
case BXP_SB16_PRESENT:
if (set) {

View File

@ -41,7 +41,7 @@ extern class bx_pc_system_c bx_pc_system;
extern double m_ips;
#endif
class bx_pc_system_c : logfunctions {
class bx_pc_system_c : private logfunctions {
private:
struct {