- made keyboard_paste_delay a runtime configurable option
- clean up comments & debug msgs in paste code
This commit is contained in:
parent
3b56c90f2e
commit
b394a44157
@ -1,10 +1,10 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: control.cc,v 1.43 2002-03-10 10:19:32 vruppert Exp $
|
||||
// $Id: control.cc,v 1.44 2002-03-26 14:46:02 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
/*
|
||||
* gui/control.cc
|
||||
* $Id: control.cc,v 1.43 2002-03-10 10:19:32 vruppert Exp $
|
||||
* $Id: control.cc,v 1.44 2002-03-26 14:46:02 bdenney Exp $
|
||||
*
|
||||
* This is code for a text-mode control panel. Note that this file
|
||||
* does NOT include bochs.h. Instead, it does all of its contact with
|
||||
@ -340,9 +340,10 @@ static char *runtime_menu_prompt =
|
||||
"6. Log options for individual devices\n"
|
||||
"7. VGA Update Interval: %d\n"
|
||||
"8. Mouse: %s\n"
|
||||
"9. Instruction tracing: off (doesn't exist yet)\n"
|
||||
"10. Continue simulation\n"
|
||||
"11. Quit now\n"
|
||||
"9. Keyboard paste delay: %d\n"
|
||||
"10. Instruction tracing: off (doesn't exist yet)\n"
|
||||
"11. Continue simulation\n"
|
||||
"12. Quit now\n"
|
||||
"\n"
|
||||
"Please choose one: [10] ";
|
||||
|
||||
@ -385,7 +386,8 @@ void build_runtime_options_prompt (char *format, char *buf, int size)
|
||||
snprintf (buf, size, format, buffer[0], buffer[1], buffer[2],
|
||||
/* ips->get (), */
|
||||
SIM->get_param_num (BXP_VGA_UPDATE_INTERVAL)->get (),
|
||||
SIM->get_param_num (BXP_MOUSE_ENABLED)->get () ? "enabled" : "disabled");
|
||||
SIM->get_param_num (BXP_MOUSE_ENABLED)->get () ? "enabled" : "disabled",
|
||||
SIM->get_param_num (BXP_KBD_PASTE_DELAY)->get ());
|
||||
}
|
||||
|
||||
int do_menu (bx_id id) {
|
||||
@ -464,7 +466,7 @@ int bx_control_panel (int menu)
|
||||
case BX_CPANEL_RUNTIME:
|
||||
char prompt[1024];
|
||||
build_runtime_options_prompt (runtime_menu_prompt, prompt, 1024);
|
||||
if (ask_uint (prompt, 1, 11, 10, &choice, 10) < 0) return -1;
|
||||
if (ask_uint (prompt, 1, 12, 11, &choice, 10) < 0) return -1;
|
||||
switch (choice) {
|
||||
case 1: do_menu (BXP_FLOPPYA); break;
|
||||
case 2: do_menu (BXP_FLOPPYB); break;
|
||||
@ -477,9 +479,10 @@ int bx_control_panel (int menu)
|
||||
case 6: bx_log_options (1); break;
|
||||
case 7: askparam (BXP_VGA_UPDATE_INTERVAL); break;
|
||||
case 8: askparam (BXP_MOUSE_ENABLED); break;
|
||||
case 9: NOT_IMPLEMENTED (choice); break;
|
||||
case 10: fprintf (stderr, "Continuing simulation\n"); return 0;
|
||||
case 11:
|
||||
case 9: askparam (BXP_KBD_PASTE_DELAY); break;
|
||||
case 10: NOT_IMPLEMENTED (choice); break;
|
||||
case 11: fprintf (stderr, "Continuing simulation\n"); return 0;
|
||||
case 12:
|
||||
fprintf (stderr, "You chose quit on the control panel.\n");
|
||||
SIM->quit_sim (1);
|
||||
return -1;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: keyboard.cc,v 1.50 2002-03-26 13:59:35 bdenney Exp $
|
||||
// $Id: keyboard.cc,v 1.51 2002-03-26 14:46:03 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002 MandrakeSoft S.A.
|
||||
@ -70,7 +70,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.50 2002-03-26 13:59:35 bdenney Exp $"));
|
||||
BX_DEBUG(("Init $Id: keyboard.cc,v 1.51 2002-03-26 14:46:03 bdenney Exp $"));
|
||||
}
|
||||
|
||||
bx_keyb_c::~bx_keyb_c(void)
|
||||
@ -110,7 +110,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.50 2002-03-26 13:59:35 bdenney Exp $"));
|
||||
BX_DEBUG(("Init $Id: keyboard.cc,v 1.51 2002-03-26 14:46:03 bdenney Exp $"));
|
||||
Bit32u i;
|
||||
|
||||
BX_KEY_THIS devices = d;
|
||||
@ -179,12 +179,18 @@ bx_keyb_c::init(bx_devices_c *d, bx_cmos_c *cmos)
|
||||
BX_KEY_THIS pastebuf = NULL;
|
||||
BX_KEY_THIS pastebuf_len = 0;
|
||||
BX_KEY_THIS pastebuf_ptr = 0;
|
||||
BX_KEY_THIS pastedelay = bx_options.Okeyboard_paste_delay->get()/BX_IODEV_HANDLER_PERIOD;
|
||||
BX_INFO(("will paste characters every %d keyboard ticks",BX_KEY_THIS pastedelay));
|
||||
BX_KEY_THIS paste_delay_changed ();
|
||||
|
||||
// mouse port installed on system board
|
||||
cmos->s.reg[0x14] |= 0x04;
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
bx_keyb_c::paste_delay_changed()
|
||||
{
|
||||
BX_KEY_THIS pastedelay = bx_options.Okeyboard_paste_delay->get()/BX_IODEV_HANDLER_PERIOD;
|
||||
BX_INFO(("will paste characters every %d keyboard ticks",BX_KEY_THIS pastedelay));
|
||||
}
|
||||
|
||||
// static IO port read callback handler
|
||||
@ -598,8 +604,8 @@ BX_PANIC(("kbd: OUTB set and command 0x%02x encountered", value));
|
||||
void
|
||||
bx_keyb_c::service_paste_buf ()
|
||||
{
|
||||
BX_DEBUG (("service_paste_buf: ptr at %d out of %d", BX_KEY_THIS pastebuf_ptr, BX_KEY_THIS pastebuf_len));
|
||||
if (!BX_KEY_THIS pastebuf) return;
|
||||
BX_DEBUG (("service_paste_buf: ptr at %d out of %d", BX_KEY_THIS pastebuf_ptr, BX_KEY_THIS pastebuf_len));
|
||||
int fill_threshold = BX_KBD_ELEMENTS - 8;
|
||||
while (BX_KEY_THIS pastebuf_ptr < BX_KEY_THIS pastebuf_len) {
|
||||
if (BX_KEY_THIS s.kbd_internal_buffer.num_elements >= fill_threshold)
|
||||
@ -1085,8 +1091,9 @@ bx_keyb_c::periodic( Bit32u usec_delta )
|
||||
}
|
||||
|
||||
if (BX_KEY_THIS s.kbd_controller.kbd_clock_enabled ) {
|
||||
// if queue is empty, add more data from the paste buffer, if it exists.
|
||||
if(++count_before_paste>=BX_KEY_THIS pastedelay) {
|
||||
// after the paste delay, consider adding moving more chars
|
||||
// from the paste buffer to the keyboard buffer.
|
||||
BX_KEY_THIS service_paste_buf ();
|
||||
count_before_paste=0;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: keyboard.h,v 1.13 2002-03-26 13:51:48 bdenney Exp $
|
||||
// $Id: keyboard.h,v 1.14 2002-03-26 14:46:03 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -65,6 +65,9 @@ public:
|
||||
BX_KEY_SMF unsigned periodic( Bit32u usec_delta );
|
||||
BX_KEY_SMF void put_scancode( unsigned char *code, int count );
|
||||
|
||||
// update the paste delay based on bx_options.Okeyboard_paste_delay
|
||||
BX_KEY_SMF void paste_delay_changed ();
|
||||
|
||||
private:
|
||||
|
||||
static Bit32u read_handler(void *this_ptr, Bit32u address, unsigned io_len);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id: main.cc,v 1.93 2002-03-26 14:28:31 bdenney Exp $
|
||||
// $Id: main.cc,v 1.94 2002-03-26 14:46:01 bdenney Exp $
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001 MandrakeSoft S.A.
|
||||
@ -196,6 +196,9 @@ bx_param_handler (bx_param_c *param, int set, Bit32s val)
|
||||
bx_gui.update_drive_status_buttons ();
|
||||
}
|
||||
break;
|
||||
case BXP_KBD_PASTE_DELAY:
|
||||
if (set) bx_keyboard.paste_delay_changed ();
|
||||
break;
|
||||
default:
|
||||
BX_PANIC (("bx_param_handler called with unknown id %d", id));
|
||||
return -1;
|
||||
@ -853,6 +856,7 @@ void bx_init_options ()
|
||||
"Approximate time in microseconds between attemps to paste characters to the keyboard controller.",
|
||||
1000, BX_MAX_INT,
|
||||
100000);
|
||||
bx_options.Okeyboard_paste_delay->set_handler (bx_param_handler);
|
||||
bx_options.Ofloppy_command_delay = new bx_param_num_c (BXP_FLOPPY_CMD_DELAY,
|
||||
"floppy_command_delay",
|
||||
"Time in microseconds to wait before completing some floppy commands such as read/write/seek/etc, which normally have a delay associated. This used to be hardwired to 50,000 before.",
|
||||
|
Loading…
x
Reference in New Issue
Block a user