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
This commit is contained in:
parent
37d6403681
commit
73b2402538
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user