- bx_param_c: formerly unused member 'runtime_param' now indicates parameters

available at runtime
- wx: 'runtime' flag added to ParamDialog. If this flag is set, all options
  with the flag 'runtime_param' clear will be disabled.
- only the runtime options for cdrom's are now enabled in the ATA dialogs at runtime
- the options 'keyboard paste delay', 'mouse' and 'vga update interval' are now
  available at runtime
- wxdialog.h: unnecessary comments removed
This commit is contained in:
Volker Ruppert 2003-09-02 19:34:48 +00:00
parent bf2e0a109d
commit e7e5f1b518
5 changed files with 24 additions and 31 deletions

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: siminterface.h,v 1.110 2003-08-30 11:21:56 vruppert Exp $ // $Id: siminterface.h,v 1.111 2003-09-02 19:34:48 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Before I can describe what this file is for, I have to make the // Before I can describe what this file is for, I have to make the
@ -852,6 +852,7 @@ public:
void set_label (char *text) {label = text;} void set_label (char *text) {label = text;}
char *get_label () {return label;} char *get_label () {return label;}
void set_runtime_param (int val) { runtime_param = val; } void set_runtime_param (int val) { runtime_param = val; }
int get_runtime_param () { return runtime_param; }
char *get_name () { return name; } char *get_name () { return name; }
char *get_description () { return description; } char *get_description () { return description; }
int get_enabled () { return enabled; } int get_enabled () { return enabled; }

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// $Id: wxdialog.cc,v 1.63 2003-08-30 17:58:30 vruppert Exp $ // $Id: wxdialog.cc,v 1.64 2003-09-02 19:34:48 vruppert Exp $
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// Define BX_PLUGGABLE in files that can be compiled into plugins. For // Define BX_PLUGGABLE in files that can be compiled into plugins. For
@ -1162,6 +1162,7 @@ ParamDialog::ParamDialog(
idHash = new wxHashTable (wxKEY_INTEGER); idHash = new wxHashTable (wxKEY_INTEGER);
paramHash = new wxHashTable (wxKEY_INTEGER); paramHash = new wxHashTable (wxKEY_INTEGER);
nbuttons = 0; nbuttons = 0;
runtime = 0;
// top level objects // top level objects
mainSizer = new wxBoxSizer (wxVERTICAL); mainSizer = new wxBoxSizer (wxVERTICAL);
@ -1535,6 +1536,10 @@ void ParamDialog::EnableChanged ()
EnableChanged (pstr); EnableChanged (pstr);
if (pstr->param->get_type () == BXT_PARAM_ENUM) if (pstr->param->get_type () == BXT_PARAM_ENUM)
EnumChanged (pstr); EnumChanged (pstr);
if (runtime) {
if ((pstr->param->get_type() != BXT_LIST) && !pstr->param->get_runtime_param ())
EnableParam (pstr->param->get_id (), false);
}
// special cases that can't be handled in the usual way // special cases that can't be handled in the usual way
} }
} }

View File

@ -1,5 +1,5 @@
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// $Id: wxdialog.h,v 1.49 2003-08-25 16:46:18 vruppert Exp $ // $Id: wxdialog.h,v 1.50 2003-09-02 19:34:48 vruppert Exp $
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// //
// wxWindows dialogs for Bochs // wxWindows dialogs for Bochs
@ -489,27 +489,6 @@ DECLARE_EVENT_TABLE()
}; };
#endif #endif
////////////////////////////////////////////////////////////////////////////
// ConfigSoundDialog
////////////////////////////////////////////////////////////////////////////
//
// +--- Configure Sound -------------------------------------------+
// | |
// | Bochs can emulate a Sound Blaster 16. Would you like |
// | to enable it? |
// | |
// | Enable [X] |
// | |
// | DMA timer: [_________] |
// | |
// | Midi mode [ 1 ] Output file [_________________] [Browse] |
// | Wave mode [ 1 ] Output file [_________________] [Browse] |
// | Log mode [ 1 ] Output file [_________________] [Browse] |
// | |
// | [ Help ] [ Cancel ] [ Ok ] |
// +---------------------------------------------------------------+
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
// ParamDialog is a general purpose dialog box that displays and edits // ParamDialog is a general purpose dialog box that displays and edits
// any combination of parameters. It's always made up of a // any combination of parameters. It's always made up of a
@ -573,6 +552,7 @@ private:
bool isGeneratedId (int id); bool isGeneratedId (int id);
bool isShowing; bool isShowing;
int nbuttons; int nbuttons;
bool runtime;
protected: protected:
wxBoxSizer *mainSizer, *buttonSizer; wxBoxSizer *mainSizer, *buttonSizer;
// hash table that maps the ID of a wxWindows control (e.g. wxChoice, // hash table that maps the ID of a wxWindows control (e.g. wxChoice,
@ -607,6 +587,7 @@ public:
void AddParamList (bx_id *idList, wxFlexGridSizer *sizer = NULL, bool plain = false); void AddParamList (bx_id *idList, wxFlexGridSizer *sizer = NULL, bool plain = false);
virtual void CopyParamToGui (); virtual void CopyParamToGui ();
bool IsShowing () { return isShowing; } bool IsShowing () { return isShowing; }
void SetRuntimeFlag(bool val) { runtime = val; }
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// $Id: wxmain.cc,v 1.96 2003-08-30 11:21:29 vruppert Exp $ // $Id: wxmain.cc,v 1.97 2003-09-02 19:34:48 vruppert Exp $
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// //
// wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs. // wxmain.cc implements the wxWindows frame, toolbar, menus, and dialogs.
@ -671,6 +671,7 @@ void MyFrame::OnEditKeyboard(wxCommandEvent& WXUNUSED(event))
bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_MENU_KEYBOARD); bx_list_c *list = (bx_list_c*) SIM->get_param (BXP_MENU_KEYBOARD);
dlg.SetTitle (list->get_name ()); dlg.SetTitle (list->get_name ());
dlg.AddParam (list); dlg.AddParam (list);
dlg.SetRuntimeFlag (sim_thread != NULL);
dlg.ShowModal (); dlg.ShowModal ();
} }
@ -712,6 +713,7 @@ void MyFrame::OnEditOther(wxCommandEvent& WXUNUSED(event))
dlg.AddParam (SIM->get_param (BXP_I440FX_SUPPORT)); dlg.AddParam (SIM->get_param (BXP_I440FX_SUPPORT));
dlg.AddParam (SIM->get_param (BXP_CMOS_IMAGE)); dlg.AddParam (SIM->get_param (BXP_CMOS_IMAGE));
dlg.AddParam (SIM->get_param (BXP_CMOS_PATH)); dlg.AddParam (SIM->get_param (BXP_CMOS_PATH));
dlg.SetRuntimeFlag (sim_thread != NULL);
dlg.ShowModal (); dlg.ShowModal ();
} }
@ -951,9 +953,6 @@ void MyFrame::simStatusChanged (StatusChange change, bx_bool popupNotify) {
bool canConfigure = (change == Stop); bool canConfigure = (change == Stop);
menuConfiguration->Enable (ID_Config_New, canConfigure); menuConfiguration->Enable (ID_Config_New, canConfigure);
menuConfiguration->Enable (ID_Config_Read, canConfigure); menuConfiguration->Enable (ID_Config_Read, canConfigure);
#ifdef __GNUC__
#warning For now, leave ATA devices so that you configure them during runtime. Otherwise you cannot change the CD image at runtime.
#endif
// only enabled ATA channels with a cdrom connected are available at runtime // only enabled ATA channels with a cdrom connected are available at runtime
for (unsigned i=0; i<4; i++) { for (unsigned i=0; i<4; i++) {
if (!SIM->get_param_bool((bx_id)(BXP_ATA0_PRESENT+i))->get ()) { if (!SIM->get_param_bool((bx_id)(BXP_ATA0_PRESENT+i))->get ()) {
@ -970,10 +969,8 @@ void MyFrame::simStatusChanged (StatusChange change, bx_bool popupNotify) {
menuEdit->Enable( ID_Edit_Sound, canConfigure); menuEdit->Enable( ID_Edit_Sound, canConfigure);
menuEdit->Enable( ID_Edit_Timing, canConfigure); menuEdit->Enable( ID_Edit_Timing, canConfigure);
menuEdit->Enable( ID_Edit_Network, canConfigure); menuEdit->Enable( ID_Edit_Network, canConfigure);
menuEdit->Enable( ID_Edit_Keyboard, canConfigure);
menuEdit->Enable( ID_Edit_Serial_Parallel, canConfigure); menuEdit->Enable( ID_Edit_Serial_Parallel, canConfigure);
menuEdit->Enable( ID_Edit_LoadHack, canConfigure); menuEdit->Enable( ID_Edit_LoadHack, canConfigure);
menuEdit->Enable( ID_Edit_Other, canConfigure);
// during simulation, certain menu options like the floppy disk // during simulation, certain menu options like the floppy disk
// can be modified under some circumstances. A floppy drive can // can be modified under some circumstances. A floppy drive can
// only be edited if it was enabled at boot time. // only be edited if it was enabled at boot time.
@ -1367,6 +1364,7 @@ void MyFrame::editFirstCdrom ()
ParamDialog dlg (this, -1); ParamDialog dlg (this, -1);
dlg.SetTitle ("Configure CDROM"); dlg.SetTitle ("Configure CDROM");
dlg.AddParam (firstcd); dlg.AddParam (firstcd);
dlg.SetRuntimeFlag (sim_thread != NULL);
dlg.ShowModal (); dlg.ShowModal ();
} }
@ -1378,6 +1376,7 @@ void MyFrame::OnEditATA (wxCommandEvent& event)
wxString str; wxString str;
str.Printf ("Configure ATA%d", channel); str.Printf ("Configure ATA%d", channel);
dlg.SetTitle (str); dlg.SetTitle (str);
dlg.SetRuntimeFlag (sim_thread != NULL);
dlg.AddParam (SIM->get_param ((bx_id)(BXP_ATA0_MENU+channel))); dlg.AddParam (SIM->get_param ((bx_id)(BXP_ATA0_MENU+channel)));
dlg.ShowModal (); dlg.ShowModal ();
} }

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: main.cc,v 1.246 2003-08-31 10:53:59 vruppert Exp $ // $Id: main.cc,v 1.247 2003-09-02 19:34:48 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002 MandrakeSoft S.A. // Copyright (C) 2002 MandrakeSoft S.A.
@ -234,6 +234,8 @@ bx_param_handler (bx_param_c *param, int set, Bit64s val)
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_MODEL + device))->set_enabled (1); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_MODEL + device))->set_enabled (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_BIOSDETECT + device))->set_enabled (1); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_BIOSDETECT + device))->set_enabled (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_TRANSLATION + device))->set_enabled (1); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_TRANSLATION + device))->set_enabled (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_PATH + device))->set_runtime_param (0);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_STATUS + device))->set_runtime_param (0);
break; break;
case BX_ATA_DEVICE_CDROM: case BX_ATA_DEVICE_CDROM:
SIM->get_param_num ((bx_id)(BXP_ATA0_MASTER_PRESENT + device))->set (1); SIM->get_param_num ((bx_id)(BXP_ATA0_MASTER_PRESENT + device))->set (1);
@ -247,6 +249,8 @@ bx_param_handler (bx_param_c *param, int set, Bit64s val)
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_MODEL + device))->set_enabled (1); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_MODEL + device))->set_enabled (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_BIOSDETECT + device))->set_enabled (1); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_BIOSDETECT + device))->set_enabled (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_TRANSLATION + device))->set_enabled (0); SIM->get_param ((bx_id)(BXP_ATA0_MASTER_TRANSLATION + device))->set_enabled (0);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_PATH + device))->set_runtime_param (1);
SIM->get_param ((bx_id)(BXP_ATA0_MASTER_STATUS + device))->set_runtime_param (1);
break; break;
} }
} }
@ -1059,12 +1063,14 @@ void bx_init_options ()
1, BX_MAX_BIT32U, 1, BX_MAX_BIT32U,
30000); 30000);
bx_options.Ovga_update_interval->set_handler (bx_param_handler); bx_options.Ovga_update_interval->set_handler (bx_param_handler);
bx_options.Ovga_update_interval->set_runtime_param (1);
bx_options.Ovga_update_interval->set_ask_format ("Type a new value for VGA update interval: [%d] "); bx_options.Ovga_update_interval->set_ask_format ("Type a new value for VGA update interval: [%d] ");
bx_options.Omouse_enabled = new bx_param_bool_c (BXP_MOUSE_ENABLED, bx_options.Omouse_enabled = new bx_param_bool_c (BXP_MOUSE_ENABLED,
"Enable the mouse", "Enable the mouse",
"Controls whether the mouse sends events to the guest. The hardware emulation is always enabled.", "Controls whether the mouse sends events to the guest. The hardware emulation is always enabled.",
0); 0);
bx_options.Omouse_enabled->set_handler (bx_param_handler); bx_options.Omouse_enabled->set_handler (bx_param_handler);
bx_options.Omouse_enabled->set_runtime_param (1);
bx_options.Oips = new bx_param_num_c (BXP_IPS, bx_options.Oips = new bx_param_num_c (BXP_IPS,
"Emulated instructions per second (IPS)", "Emulated instructions per second (IPS)",
"Emulated instructions per second, used to calibrate bochs emulated time with wall clock time.", "Emulated instructions per second, used to calibrate bochs emulated time with wall clock time.",
@ -1406,6 +1412,7 @@ void bx_init_options ()
1000, BX_MAX_BIT32U, 1000, BX_MAX_BIT32U,
100000); 100000);
bx_options.Okeyboard_paste_delay->set_handler (bx_param_handler); bx_options.Okeyboard_paste_delay->set_handler (bx_param_handler);
bx_options.Okeyboard_paste_delay->set_runtime_param (1);
bx_options.Ofloppy_command_delay = new bx_param_num_c (BXP_FLOPPY_CMD_DELAY, bx_options.Ofloppy_command_delay = new bx_param_num_c (BXP_FLOPPY_CMD_DELAY,
"Floppy command 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.", "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.",