From 73b24025385fbb2eb859cc5df0c4de7211ca68c4 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 1 Dec 2013 16:02:31 +0000 Subject: [PATCH] Fixed some runtime config issues - es1370: fixed wave file parameter name - wx cdrom dialog: use the first item of the cdrom runtime parameter list - wx ParamDialog: always pause the simulation thread while setting parameters - wx ParamDialog: call SIM->update_runtime_options() before continuing simulation --- bochs/gui/wxdialog.cc | 9 +++++++++ bochs/gui/wxmain.cc | 24 +++++++++++++++++++++++- bochs/gui/wxmain.h | 1 + bochs/iodev/sound/es1370.cc | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/bochs/gui/wxdialog.cc b/bochs/gui/wxdialog.cc index b76c0c387..5ff949ad8 100644 --- a/bochs/gui/wxdialog.cc +++ b/bochs/gui/wxdialog.cc @@ -851,6 +851,11 @@ void ParamDialog::AddParam ( bool ParamDialog::CopyGuiToParam() { + bx_bool sim_running = 0; + + if (runtime) { + sim_running = theFrame->SimThreadControl(0); + } // loop through all the parameters idHash->BeginFind(); wxNode *node; @@ -860,6 +865,10 @@ bool ParamDialog::CopyGuiToParam() CopyGuiToParam(pstr->param); if (pstr->param->get_type() == BXT_LIST) break; } + if (runtime && sim_running) { + SIM->update_runtime_options(); + theFrame->SimThreadControl(1); + } return true; } diff --git a/bochs/gui/wxmain.cc b/bochs/gui/wxmain.cc index 6041f8790..0dfb3328d 100644 --- a/bochs/gui/wxmain.cc +++ b/bochs/gui/wxmain.cc @@ -926,6 +926,22 @@ void MyFrame::OnPauseResumeSim(wxCommandEvent& WXUNUSED(event)) } } +bx_bool MyFrame::SimThreadControl(bx_bool resume) +{ + bx_bool sim_running = 0; + + wxCriticalSectionLocker lock(sim_thread_lock); + if (sim_thread) { + sim_running = !sim_thread->IsPaused(); + if (resume) { + sim_thread->Resume(); + } else if (sim_running) { + sim_thread->Pause(); + } + } + return sim_running; +} + void MyFrame::OnKillSim(wxCommandEvent& WXUNUSED(event)) { // DON'T use a critical section here. Delete implicitly calls @@ -1130,7 +1146,13 @@ void MyFrame::editFloppyConfig(int drive) void MyFrame::editFirstCdrom() { - bx_param_c *firstcd = SIM->get_first_cdrom(); + bx_param_c *firstcd; + + if (sim_thread != NULL) { + firstcd = ((bx_list_c*)SIM->get_param(BXPN_MENU_RUNTIME_CDROM))->get(0); + } else { + firstcd = SIM->get_first_cdrom(); + } if (!firstcd) { wxMessageBox(wxT("No CDROM drive is enabled. Use Edit:ATA to set one up."), wxT("No CDROM"), wxOK | wxICON_ERROR, this); diff --git a/bochs/gui/wxmain.h b/bochs/gui/wxmain.h index c95022f2d..e5d9deddd 100644 --- a/bochs/gui/wxmain.h +++ b/bochs/gui/wxmain.h @@ -168,6 +168,7 @@ public: void OnAbout(wxCommandEvent& event); void OnStartSim(wxCommandEvent& event); void OnPauseResumeSim(wxCommandEvent& event); + bx_bool SimThreadControl(bx_bool resume); void OnKillSim(wxCommandEvent& event); void OnSim2CIEvent(wxCommandEvent& event); void OnLogMsg(BxEvent *logMsgEvent); diff --git a/bochs/iodev/sound/es1370.cc b/bochs/iodev/sound/es1370.cc index 1cb0065c4..bbb2a87d8 100644 --- a/bochs/iodev/sound/es1370.cc +++ b/bochs/iodev/sound/es1370.cc @@ -937,7 +937,7 @@ const char* bx_es1370_c::es1370_param_string_handler(bx_param_string_c *param, i { if ((set) && (strcmp(val, oldval))) { const char *pname = param->get_name(); - if (!strcmp(pname, "wave")) { + if (!strcmp(pname, "wavefile")) { BX_ES1370_THIS wave_changed = 1; } else { BX_PANIC(("es1370_param_string_handler called with unexpected parameter '%s'", pname));