Merge pull request #198 from darkf/spugui

Add SPU decoder mode selection to GUI/Config
This commit is contained in:
Alexandro Sánchez Bach 2014-04-23 20:38:34 +02:00
commit 8c4fd75c82
4 changed files with 30 additions and 14 deletions

View file

@ -150,9 +150,15 @@ void PPUThread::DoRun()
case 1: case 1:
case 2: case 2:
{
auto ppui = new PPUInterpreter(*this); auto ppui = new PPUInterpreter(*this);
m_dec = new PPUDecoder(ppui); m_dec = new PPUDecoder(ppui);
}
break; break;
default:
ConLog.Error("Invalid CPU decoder mode: %d", Ini.CPUDecoderMode.GetValue());
Emu.Pause();
} }
} }

View file

@ -69,22 +69,19 @@ u64 SPUThread::GetFreeStackSize() const
void SPUThread::DoRun() void SPUThread::DoRun()
{ {
switch(Ini.CPUDecoderMode.GetValue()) switch(Ini.SPUDecoderMode.GetValue())
{ {
case 0:
//m_dec = new SPUDecoder(*new SPUDisAsm());
break;
case 1: case 1:
m_dec = new SPURecompilerCore(*this);
break;
case 2:
m_dec = new SPUDecoder(*new SPUInterpreter(*this)); m_dec = new SPUDecoder(*new SPUInterpreter(*this));
break; break;
} case 2:
m_dec = new SPURecompilerCore(*this);
break;
//Pause(); default:
//Emu.Pause(); ConLog.Error("Invalid SPU decoder mode: %d", Ini.SPUDecoderMode.GetValue());
Emu.Pause();
}
} }
void SPUThread::DoResume() void SPUThread::DoResume()

View file

@ -333,8 +333,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxBoxSizer* s_subpanel_io(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel_io(new wxBoxSizer(wxVERTICAL));
wxBoxSizer* s_subpanel_hle(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel_hle(new wxBoxSizer(wxVERTICAL));
// CPU settings // CPU/SPU settings
wxStaticBoxSizer* s_round_cpu_decoder( new wxStaticBoxSizer( wxVERTICAL, p_cpu, _("Decoder") ) ); wxStaticBoxSizer* s_round_cpu_decoder( new wxStaticBoxSizer( wxVERTICAL, p_cpu, _("CPU") ) );
wxStaticBoxSizer* s_round_spu_decoder( new wxStaticBoxSizer( wxVERTICAL, p_cpu, _("SPU") ) );
// Graphics // Graphics
wxStaticBoxSizer* s_round_gs_render( new wxStaticBoxSizer( wxVERTICAL, p_graphics, _("Render") ) ); wxStaticBoxSizer* s_round_gs_render( new wxStaticBoxSizer( wxVERTICAL, p_graphics, _("Render") ) );
@ -356,6 +357,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
wxStaticBoxSizer* s_round_sys_lang( new wxStaticBoxSizer( wxVERTICAL, p_system, _("Language") ) ); wxStaticBoxSizer* s_round_sys_lang( new wxStaticBoxSizer( wxVERTICAL, p_system, _("Language") ) );
wxComboBox* cbox_cpu_decoder = new wxComboBox(p_cpu, wxID_ANY); wxComboBox* cbox_cpu_decoder = new wxComboBox(p_cpu, wxID_ANY);
wxComboBox* cbox_spu_decoder = new wxComboBox(p_cpu, wxID_ANY);
wxComboBox* cbox_gs_render = new wxComboBox(p_graphics, wxID_ANY); wxComboBox* cbox_gs_render = new wxComboBox(p_graphics, wxID_ANY);
wxComboBox* cbox_gs_resolution = new wxComboBox(p_graphics, wxID_ANY); wxComboBox* cbox_gs_resolution = new wxComboBox(p_graphics, wxID_ANY);
wxComboBox* cbox_gs_aspect = new wxComboBox(p_graphics, wxID_ANY); wxComboBox* cbox_gs_aspect = new wxComboBox(p_graphics, wxID_ANY);
@ -381,6 +383,9 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
cbox_cpu_decoder->Append("Interpreter & DisAsm"); cbox_cpu_decoder->Append("Interpreter & DisAsm");
cbox_cpu_decoder->Append("Interpreter"); cbox_cpu_decoder->Append("Interpreter");
cbox_spu_decoder->Append("Interpreter");
cbox_spu_decoder->Append("Recompiler");
for(int i=1; i<WXSIZEOF(ResolutionTable); ++i) for(int i=1; i<WXSIZEOF(ResolutionTable); ++i)
{ {
cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.ToLE(), ResolutionTable[i].height.ToLE())); cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width.ToLE(), ResolutionTable[i].height.ToLE()));
@ -447,6 +452,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue()); chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue());
cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0); cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0);
cbox_spu_decoder->SetSelection(Ini.SPUDecoderMode.GetValue() ? Ini.SPUDecoderMode.GetValue() - 1 : 0);
cbox_gs_render->SetSelection(Ini.GSRenderMode.GetValue()); cbox_gs_render->SetSelection(Ini.GSRenderMode.GetValue());
cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1); cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1);
cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1); cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1);
@ -465,6 +471,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_spu_decoder->Add(cbox_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_gs_render->Add(cbox_gs_render, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs_render->Add(cbox_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
s_round_gs_res->Add(cbox_gs_resolution, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs_res->Add(cbox_gs_resolution, wxSizerFlags().Border(wxALL, 5).Expand());
@ -482,7 +489,8 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
// Core // Core
s_subpanel_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_cpu->Add(chbox_cpu_ignore_rwerrors, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_cpu_decoder->Add(chbox_cpu_ignore_rwerrors, wxSizerFlags().Border(wxALL, 5).Expand());
s_subpanel_cpu->Add(s_round_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
// Graphics // Graphics
s_subpanel_graphics->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel_graphics->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
@ -532,6 +540,7 @@ void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
{ {
Ini.CPUDecoderMode.SetValue(cbox_cpu_decoder->GetSelection() + 1); Ini.CPUDecoderMode.SetValue(cbox_cpu_decoder->GetSelection() + 1);
Ini.CPUIgnoreRWErrors.SetValue(chbox_cpu_ignore_rwerrors->GetValue()); Ini.CPUIgnoreRWErrors.SetValue(chbox_cpu_ignore_rwerrors->GetValue());
Ini.SPUDecoderMode.SetValue(cbox_spu_decoder->GetSelection() + 1);
Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection()); Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection());
Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1)); Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1));
Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1); Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1);

View file

@ -97,6 +97,7 @@ private:
public: public:
IniEntry<u8> CPUDecoderMode; IniEntry<u8> CPUDecoderMode;
IniEntry<u8> SPUDecoderMode;
IniEntry<bool> CPUIgnoreRWErrors; IniEntry<bool> CPUIgnoreRWErrors;
IniEntry<u8> GSRenderMode; IniEntry<u8> GSRenderMode;
IniEntry<u8> GSResolution; IniEntry<u8> GSResolution;
@ -150,6 +151,7 @@ public:
path = DefPath + "/" + "CPU"; path = DefPath + "/" + "CPU";
CPUDecoderMode.Init("DecoderMode", path); CPUDecoderMode.Init("DecoderMode", path);
CPUIgnoreRWErrors.Init("IgnoreRWErrors", path); CPUIgnoreRWErrors.Init("IgnoreRWErrors", path);
SPUDecoderMode.Init("SPUDecoderMode", path);
path = DefPath + "/" + "GS"; path = DefPath + "/" + "GS";
GSRenderMode.Init("RenderMode", path); GSRenderMode.Init("RenderMode", path);
@ -211,6 +213,7 @@ public:
{ {
CPUDecoderMode.Load(2); CPUDecoderMode.Load(2);
CPUIgnoreRWErrors.Load(false); CPUIgnoreRWErrors.Load(false);
SPUDecoderMode.Load(1);
GSRenderMode.Load(1); GSRenderMode.Load(1);
GSResolution.Load(4); GSResolution.Load(4);
GSAspectRatio.Load(2); GSAspectRatio.Load(2);
@ -260,6 +263,7 @@ public:
{ {
CPUDecoderMode.Save(); CPUDecoderMode.Save();
CPUIgnoreRWErrors.Save(); CPUIgnoreRWErrors.Save();
SPUDecoderMode.Save();
GSRenderMode.Save(); GSRenderMode.Save();
GSResolution.Save(); GSResolution.Save();
GSAspectRatio.Save(); GSAspectRatio.Save();