void DisAsmFrame::SetPc(wxCommandEvent& WXUNUSED(event)) { if(!Emu.IsPaused()) return; wxDialog diag(this, wxID_ANY, "Set PC", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); wxTextCtrl* p_pc(new wxTextCtrl(&diag, wxID_ANY)); s_panel->Add(p_pc); s_panel->AddSpacer(8); s_panel->Add(s_b_panel); s_b_panel->Add(new wxButton(&diag, wxID_OK), wxLEFT, 0, 5); s_b_panel->AddSpacer(5); s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxRIGHT, 0, 5); diag.SetSizerAndFit( s_panel ); p_pc->SetLabel(wxString::Format("%llx", CPU.PC)); if(diag.ShowModal() == wxID_OK) { sscanf(p_pc->GetLabel(), "%llx", &CPU.PC); Resume(); } }
void InterpreterDisAsmFrame::Show_Val(wxCommandEvent& WXUNUSED(event)) { wxDialog* diag = new wxDialog(this, wxID_ANY, "Set value", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); wxTextCtrl* p_pc(new wxTextCtrl(diag, wxID_ANY)); s_panel->Add(p_pc); s_panel->AddSpacer(8); s_panel->Add(s_b_panel); s_b_panel->Add(new wxButton(diag, wxID_OK), wxLEFT, 0, 5); s_b_panel->AddSpacer(5); s_b_panel->Add(new wxButton(diag, wxID_CANCEL), wxRIGHT, 0, 5); diag->SetSizerAndFit( s_panel ); if(CPU) p_pc->SetLabel(wxString::Format("%llx", CPU->PC)); if(diag->ShowModal() == wxID_OK) { u64 pc = CPU ? CPU->PC : 0x0; sscanf(p_pc->GetLabel(), "%llx", &pc); remove_markedPC.AddCpy(Emu.GetMarkedPoints().AddCpy(pc)); ShowAddr(CentrePc(pc)); } }
void InterpreterDisAsmFrame::Show_Val(wxCommandEvent& WXUNUSED(event)) { wxDialog* diag = new wxDialog(this, wxID_ANY, "Set value", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); wxTextCtrl* p_pc(new wxTextCtrl(diag, wxID_ANY)); s_panel->Add(p_pc); s_panel->AddSpacer(8); s_panel->Add(s_b_panel); s_b_panel->Add(new wxButton(diag, wxID_OK), wxLEFT, 0, 5); s_b_panel->AddSpacer(5); s_b_panel->Add(new wxButton(diag, wxID_CANCEL), wxRIGHT, 0, 5); diag->SetSizerAndFit(s_panel); if (cpu) p_pc->SetValue(wxString::Format("%x", GetPc())); if (diag->ShowModal() == wxID_OK) { unsigned long pc = cpu ? GetPc() : 0x0; p_pc->GetValue().ToULong(&pc, 16); ShowAddr(CentrePc(pc)); } }
FnIdGenerator::FnIdGenerator(wxWindow* parent) : wxDialog(parent, wxID_ANY, "FunctionID Generator", wxDefaultPosition) , m_list(nullptr) { wxBoxSizer* s_panel(new wxBoxSizer(wxHORIZONTAL)); wxBoxSizer* s_subpanel(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel2(new wxBoxSizer(wxHORIZONTAL)); m_list = new wxListView(this, wxID_ANY, wxDefaultPosition, wxSize(300, 450)); m_list->InsertColumn(0, "Function Name", 0, 200); m_list->InsertColumn(1, "Function ID", 0, 100); wxButton *b_input_name = new wxButton(this, wxID_ANY, "Input Function Name", wxDefaultPosition, wxSize(140, -1)); wxButton *b_clear = new wxButton(this, wxID_ANY, "Clear List", wxDefaultPosition, wxSize(140, -1)); s_subpanel2->Add(b_input_name); s_subpanel2->AddSpacer(10); s_subpanel2->Add(b_clear); s_subpanel->AddSpacer(5); s_subpanel->Add(m_list); s_subpanel->AddSpacer(5); s_subpanel->Add(s_subpanel2); s_panel->AddSpacer(5); s_panel->Add(s_subpanel); s_panel->AddSpacer(5); this->SetSizerAndFit(s_panel); Connect(b_input_name->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FnIdGenerator::OnInput)); Connect(b_clear->GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FnIdGenerator::OnClear)); }
DisAsmFrame::DisAsmFrame(PPCThread& cpu) : wxFrame(NULL, wxID_ANY, "DisAsm") , CPU(cpu) { exit = false; count = 0; wxBoxSizer& s_panel( *new wxBoxSizer(wxVERTICAL) ); wxBoxSizer& s_b_panel( *new wxBoxSizer(wxHORIZONTAL) ); m_disasm_list = new wxListView(this); wxButton& b_fprev = *new wxButton(this, wxID_ANY, L"<<"); wxButton& b_prev = *new wxButton(this, wxID_ANY, L"<"); wxButton& b_next = *new wxButton(this, wxID_ANY, L">"); wxButton& b_fnext = *new wxButton(this, wxID_ANY, L">>"); wxButton& b_dump = *new wxButton(this, wxID_ANY, L"Dump code"); wxButton& b_setpc = *new wxButton(this, wxID_ANY, L"Set PC"); s_b_panel.Add(&b_fprev); s_b_panel.Add(&b_prev); s_b_panel.AddSpacer(5); s_b_panel.Add(&b_next); s_b_panel.Add(&b_fnext); s_b_panel.AddSpacer(8); s_b_panel.Add(&b_dump); s_panel.Add(&s_b_panel); s_panel.Add(&b_setpc); s_panel.Add(m_disasm_list); m_disasm_list->InsertColumn(0, "PC"); m_disasm_list->InsertColumn(1, "ASM"); m_disasm_list->SetColumnWidth( 0, 50 ); for(uint i=0; i<LINES_OPCODES; ++i) m_disasm_list->InsertItem(i, -1); SetSizerAndFit( &s_panel ); SetSize(50, 660); Connect( wxEVT_SIZE, wxSizeEventHandler(DisAsmFrame::OnResize) ); m_app_connector.Connect(m_disasm_list->GetId(), wxEVT_MOUSEWHEEL, wxMouseEventHandler(DisAsmFrame::MouseWheel), (wxObject*)0, this); Connect(b_prev.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Prev)); Connect(b_next.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Next)); Connect(b_fprev.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::fPrev)); Connect(b_fnext.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::fNext)); Connect(b_setpc.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::SetPc)); Connect(b_dump.GetId(), wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DisAsmFrame::Dump)); }
void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) { //TODO bool paused = false; if(Emu.IsRunned()) { Emu.Pause(); paused = true; } wxDialog diag(this, wxID_ANY, "Settings", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL)); wxStaticBoxSizer* s_round_cpu( new wxStaticBoxSizer( wxVERTICAL, &diag, _("CPU") ) ); wxStaticBoxSizer* s_round_cpu_decoder( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Decoder") ) ); wxStaticBoxSizer* s_round_gs( new wxStaticBoxSizer( wxVERTICAL, &diag, _("GS") ) ); wxStaticBoxSizer* s_round_gs_render( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Render") ) ); wxStaticBoxSizer* s_round_gs_res( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default resolution") ) ); wxStaticBoxSizer* s_round_gs_aspect( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default aspect ratio") ) ); wxStaticBoxSizer* s_round_pad( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Pad") ) ); wxStaticBoxSizer* s_round_pad_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Handler") ) ); wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_resolution = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_aspect = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_handler = new wxComboBox(&diag, wxID_ANY); wxCheckBox* chbox_gs_vsync = new wxCheckBox(&diag, wxID_ANY, "VSync"); //cbox_cpu_decoder->Append("DisAsm"); cbox_cpu_decoder->Append("Interpreter & DisAsm"); cbox_cpu_decoder->Append("Interpreter"); for(int i=1; i<WXSIZEOF(ResolutionTable); ++i) { cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width, ResolutionTable[i].height)); } cbox_gs_aspect->Append("4:3"); cbox_gs_aspect->Append("16:9"); cbox_gs_render->Append("Null"); cbox_gs_render->Append("OpenGL"); //cbox_gs_render->Append("Software"); cbox_pad_handler->Append("Null"); cbox_pad_handler->Append("Windows"); //cbox_pad_handler->Append("DirectInput"); chbox_gs_vsync->SetValue(Ini.GSVSyncEnable.GetValue()); cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0); cbox_gs_render->SetSelection(Ini.GSRenderMode.GetValue()); cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1); cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1); cbox_pad_handler->SetSelection(Ini.PadHandlerMode.GetValue()); s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_cpu->Add(s_round_cpu_decoder, 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_aspect->Add(cbox_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_res, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5)); s_round_pad_handler->Add(cbox_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad->Add(s_round_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand()); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); s_b_panel->Add(new wxButton(&diag, wxID_OK), wxSizerFlags().Border(wxALL, 5).Center()); s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Center()); //wxBoxSizer* s_conf_panel(new wxBoxSizer(wxHORIZONTAL)); s_panel->Add(s_round_cpu, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_round_gs, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_round_pad, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_b_panel, wxSizerFlags().Border(wxALL, 8).Expand()); diag.SetSizerAndFit( s_panel ); if(diag.ShowModal() == wxID_OK) { Ini.CPUDecoderMode.SetValue(cbox_cpu_decoder->GetSelection() + 1); Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection()); Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1)); Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1); Ini.GSVSyncEnable.SetValue(chbox_gs_vsync->GetValue()); Ini.PadHandlerMode.SetValue(cbox_pad_handler->GetSelection()); Ini.Save(); } if(paused) Emu.Resume(); }
void MainFrame::ConfigPad(wxCommandEvent& WXUNUSED(event)) { bool paused = false; if(Emu.IsRunning()) { Emu.Pause(); paused = true; } wxDialog diag(this, wxID_ANY, "PAD Settings", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxHORIZONTAL)); wxBoxSizer* s_subpanel1(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel2(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel3(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel4(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel5(new wxBoxSizer(wxVERTICAL)); wxStaticBoxSizer* s_round_pad_controls( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Controls") ) ); wxStaticBoxSizer* s_round_pad_left( new wxStaticBoxSizer( wxVERTICAL, &diag, _("LEFT") ) ); wxStaticBoxSizer* s_round_pad_down( new wxStaticBoxSizer( wxVERTICAL, &diag, _("DOWN") ) ); wxStaticBoxSizer* s_round_pad_right( new wxStaticBoxSizer( wxVERTICAL, &diag, _("RIGHT") ) ); wxStaticBoxSizer* s_round_pad_up( new wxStaticBoxSizer( wxVERTICAL, &diag, _("UP") ) ); wxStaticBoxSizer* s_round_pad_shifts_l( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Shifts") ) ); wxStaticBoxSizer* s_round_pad_l1( new wxStaticBoxSizer( wxVERTICAL, &diag, _("L1") ) ); wxStaticBoxSizer* s_round_pad_l2( new wxStaticBoxSizer( wxVERTICAL, &diag, _("L2") ) ); wxStaticBoxSizer* s_round_pad_l3( new wxStaticBoxSizer( wxVERTICAL, &diag, _("L3") ) ); wxStaticBoxSizer* s_round_pad_system( new wxStaticBoxSizer( wxVERTICAL, &diag, _("System") ) ); wxStaticBoxSizer* s_round_pad_select( new wxStaticBoxSizer( wxVERTICAL, &diag, _("SELECT") ) ); wxStaticBoxSizer* s_round_pad_start( new wxStaticBoxSizer( wxVERTICAL, &diag, _("START") ) ); wxStaticBoxSizer* s_round_pad_shifts_r( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Shifts") ) ); wxStaticBoxSizer* s_round_pad_r1( new wxStaticBoxSizer( wxVERTICAL, &diag, _("R1") ) ); wxStaticBoxSizer* s_round_pad_r2( new wxStaticBoxSizer( wxVERTICAL, &diag, _("R2") ) ); wxStaticBoxSizer* s_round_pad_r3( new wxStaticBoxSizer( wxVERTICAL, &diag, _("R3") ) ); wxStaticBoxSizer* s_round_pad_buttons( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Buttons") ) ); wxStaticBoxSizer* s_round_pad_square( new wxStaticBoxSizer( wxVERTICAL, &diag, _("SQUARE") ) ); wxStaticBoxSizer* s_round_pad_cross( new wxStaticBoxSizer( wxVERTICAL, &diag, _("CROSS") ) ); wxStaticBoxSizer* s_round_pad_circle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("CIRCLE") ) ); wxStaticBoxSizer* s_round_pad_triangle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("TRIANGLE") ) ); wxComboBox* cbox_pad_left = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_down = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_right = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_up = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_start = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_r3 = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_l3 = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_select = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_square = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_cross = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_circle = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_triangle = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_r1 = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_l1 = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_r2 = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_l2 = new wxComboBox(&diag, wxID_ANY); for(int i=0; i<128; i++) { cbox_pad_left->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_down->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_right->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_up->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_r3->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_l3->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_square->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_cross->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_circle->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_triangle->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_r1->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_l1->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_r2->Append (wxString::Format("%c", static_cast<char>(i) ) ); cbox_pad_l2->Append (wxString::Format("%c", static_cast<char>(i) ) ); } cbox_pad_start->Append("Enter"); cbox_pad_select->Append("Space"); cbox_pad_left->SetSelection (Ini.PadHandlerLeft.GetValue()); cbox_pad_down->SetSelection (Ini.PadHandlerDown.GetValue()); cbox_pad_right->SetSelection (Ini.PadHandlerRight.GetValue()); cbox_pad_up->SetSelection (Ini.PadHandlerUp.GetValue()); cbox_pad_start->SetSelection (Ini.PadHandlerStart.GetValue()); cbox_pad_r3->SetSelection (Ini.PadHandlerR3.GetValue()); cbox_pad_l3->SetSelection (Ini.PadHandlerL3.GetValue()); cbox_pad_select->SetSelection (Ini.PadHandlerSelect.GetValue()); cbox_pad_square->SetSelection (Ini.PadHandlerSquare.GetValue()); cbox_pad_cross->SetSelection (Ini.PadHandlerCross.GetValue()); cbox_pad_circle->SetSelection (Ini.PadHandlerCircle.GetValue()); cbox_pad_triangle->SetSelection (Ini.PadHandlerTriangle.GetValue()); cbox_pad_r1->SetSelection (Ini.PadHandlerR1.GetValue()); cbox_pad_l1->SetSelection (Ini.PadHandlerL1.GetValue()); cbox_pad_r2->SetSelection (Ini.PadHandlerR2.GetValue()); cbox_pad_l2->SetSelection (Ini.PadHandlerL2.GetValue()); s_round_pad_left->Add(cbox_pad_left, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_down->Add(cbox_pad_down, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_right->Add(cbox_pad_right, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_up->Add(cbox_pad_up, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_start->Add(cbox_pad_start, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_r3->Add(cbox_pad_r3, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_l3->Add(cbox_pad_l3, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_select->Add(cbox_pad_select, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_square->Add(cbox_pad_square, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_cross->Add(cbox_pad_cross, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_circle->Add(cbox_pad_circle, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_triangle->Add(cbox_pad_triangle, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_r1->Add(cbox_pad_r1, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_l1->Add(cbox_pad_l1, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_r2->Add(cbox_pad_r2, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_l2->Add(cbox_pad_l2, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_controls->Add(s_round_pad_left, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_controls->Add(s_round_pad_down, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_controls->Add(s_round_pad_right, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_controls->Add(s_round_pad_up, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_l->Add(s_round_pad_l1, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_l->Add(s_round_pad_l2, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_l->Add(s_round_pad_l3, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_system->Add(s_round_pad_start, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_system->Add(s_round_pad_select, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_r->Add(s_round_pad_r1, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_r->Add(s_round_pad_r2, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_shifts_r->Add(s_round_pad_r3, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_buttons->Add(s_round_pad_square, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_buttons->Add(s_round_pad_cross, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_buttons->Add(s_round_pad_circle, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_pad_buttons->Add(s_round_pad_triangle, wxSizerFlags().Border(wxALL, 5).Expand()); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); s_b_panel->Add(new wxButton(&diag, wxID_OK), wxSizerFlags().Border(wxALL, 5).Center()); s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Center()); s_subpanel1->Add(s_round_pad_controls, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel2->Add(s_round_pad_shifts_l, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel3->Add(s_round_pad_system, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel3->Add(s_b_panel, wxSizerFlags().Border(wxALL, 8).Expand()); s_subpanel4->Add(s_round_pad_shifts_r, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel5->Add(s_round_pad_buttons, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel1, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel2, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel3, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel4, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel5, wxSizerFlags().Border(wxALL, 5).Expand()); diag.SetSizerAndFit( s_panel ); if(diag.ShowModal() == wxID_OK) { Ini.PadHandlerLeft.SetValue(cbox_pad_left->GetSelection()); Ini.PadHandlerDown.SetValue(cbox_pad_down->GetSelection()); Ini.PadHandlerRight.SetValue(cbox_pad_right->GetSelection()); Ini.PadHandlerUp.SetValue(cbox_pad_up->GetSelection()); Ini.PadHandlerStart.SetValue(cbox_pad_start->GetSelection()); Ini.PadHandlerR3.SetValue(cbox_pad_r3->GetSelection()); Ini.PadHandlerL3.SetValue(cbox_pad_l3->GetSelection()); Ini.PadHandlerSelect.SetValue(cbox_pad_select->GetSelection()); Ini.PadHandlerSquare.SetValue(cbox_pad_square->GetSelection()); Ini.PadHandlerCross.SetValue(cbox_pad_cross->GetSelection()); Ini.PadHandlerCircle.SetValue(cbox_pad_circle->GetSelection()); Ini.PadHandlerTriangle.SetValue(cbox_pad_triangle->GetSelection()); Ini.PadHandlerR1.SetValue(cbox_pad_r1->GetSelection()); Ini.PadHandlerL1.SetValue(cbox_pad_l1->GetSelection()); Ini.PadHandlerR2.SetValue(cbox_pad_r2->GetSelection()); Ini.PadHandlerL2.SetValue(cbox_pad_l2->GetSelection()); Ini.Save(); } if(paused) Emu.Resume(); }
void MainFrame::Config(wxCommandEvent& WXUNUSED(event)) { //TODO bool paused = false; if(Emu.IsRunning()) { Emu.Pause(); paused = true; } wxDialog diag(this, wxID_ANY, "Settings", wxDefaultPosition); wxBoxSizer* s_panel(new wxBoxSizer(wxHORIZONTAL)); wxBoxSizer* s_subpanel1(new wxBoxSizer(wxVERTICAL)); wxBoxSizer* s_subpanel2(new wxBoxSizer(wxVERTICAL)); wxStaticBoxSizer* s_round_cpu( new wxStaticBoxSizer( wxVERTICAL, &diag, _("CPU") ) ); wxStaticBoxSizer* s_round_cpu_decoder( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Decoder") ) ); wxStaticBoxSizer* s_round_gs( new wxStaticBoxSizer( wxVERTICAL, &diag, _("GS") ) ); wxStaticBoxSizer* s_round_gs_render( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Render") ) ); wxStaticBoxSizer* s_round_gs_res( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default resolution") ) ); wxStaticBoxSizer* s_round_gs_aspect( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Default aspect ratio") ) ); wxStaticBoxSizer* s_round_io( new wxStaticBoxSizer( wxVERTICAL, &diag, _("IO") ) ); wxStaticBoxSizer* s_round_io_pad_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Pad Handler") ) ); wxStaticBoxSizer* s_round_io_keyboard_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Keyboard Handler") ) ); wxStaticBoxSizer* s_round_io_mouse_handler( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Mouse Handler") ) ); wxStaticBoxSizer* s_round_audio( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio") ) ); wxStaticBoxSizer* s_round_audio_out( new wxStaticBoxSizer( wxVERTICAL, &diag, _("Audio Out") ) ); wxStaticBoxSizer* s_round_hle( new wxStaticBoxSizer( wxVERTICAL, &diag, _("HLE / Misc.") ) ); wxComboBox* cbox_cpu_decoder = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_render = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_resolution = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_gs_aspect = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_pad_handler = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_keyboard_handler = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_mouse_handler = new wxComboBox(&diag, wxID_ANY); wxComboBox* cbox_audio_out = new wxComboBox(&diag, wxID_ANY); wxCheckBox* chbox_cpu_ignore_rwerrors = new wxCheckBox(&diag, wxID_ANY, "Ignore Read/Write errors"); wxCheckBox* chbox_gs_log_prog = new wxCheckBox(&diag, wxID_ANY, "Log vertex/fragment programs"); wxCheckBox* chbox_gs_dump_depth = new wxCheckBox(&diag, wxID_ANY, "Dump Depth Buffer"); wxCheckBox* chbox_gs_dump_color = new wxCheckBox(&diag, wxID_ANY, "Dump Color Buffers"); wxCheckBox* chbox_gs_vsync = new wxCheckBox(&diag, wxID_ANY, "VSync"); wxCheckBox* chbox_audio_dump = new wxCheckBox(&diag, wxID_ANY, "Dump to file"); wxCheckBox* chbox_hle_logging = new wxCheckBox(&diag, wxID_ANY, "Log all SysCalls"); wxCheckBox* chbox_hle_savetty = new wxCheckBox(&diag, wxID_ANY, "Save TTY output to file"); wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(&diag, wxID_ANY, "Exit RPCS3 when process finishes"); //cbox_cpu_decoder->Append("DisAsm"); cbox_cpu_decoder->Append("Interpreter & DisAsm"); cbox_cpu_decoder->Append("Interpreter"); for(int i=1; i<WXSIZEOF(ResolutionTable); ++i) { cbox_gs_resolution->Append(wxString::Format("%dx%d", ResolutionTable[i].width, ResolutionTable[i].height)); } cbox_gs_aspect->Append("4:3"); cbox_gs_aspect->Append("16:9"); cbox_gs_render->Append("Null"); cbox_gs_render->Append("OpenGL"); //cbox_gs_render->Append("Software"); cbox_pad_handler->Append("Null"); cbox_pad_handler->Append("Windows"); //cbox_pad_handler->Append("DirectInput"); cbox_keyboard_handler->Append("Null"); cbox_keyboard_handler->Append("Windows"); //cbox_keyboard_handler->Append("DirectInput"); cbox_mouse_handler->Append("Null"); cbox_mouse_handler->Append("Windows"); //cbox_mouse_handler->Append("DirectInput"); cbox_audio_out->Append("Null"); chbox_cpu_ignore_rwerrors->SetValue(Ini.CPUIgnoreRWErrors.GetValue()); chbox_gs_log_prog->SetValue(Ini.GSLogPrograms.GetValue()); chbox_gs_dump_depth->SetValue(Ini.GSDumpDepthBuffer.GetValue()); chbox_gs_dump_color->SetValue(Ini.GSDumpColorBuffers.GetValue()); chbox_gs_vsync->SetValue(Ini.GSVSyncEnable.GetValue()); chbox_audio_dump->SetValue(Ini.AudioDumpToFile.GetValue()); chbox_hle_logging->SetValue(Ini.HLELogging.GetValue()); chbox_hle_savetty->SetValue(Ini.HLESaveTTY.GetValue()); chbox_hle_exitonstop->SetValue(Ini.HLEExitOnStop.GetValue()); chbox_audio_dump->Enable(Emu.IsStopped()); chbox_hle_logging->Enable(Emu.IsStopped()); cbox_cpu_decoder->SetSelection(Ini.CPUDecoderMode.GetValue() ? Ini.CPUDecoderMode.GetValue() - 1 : 0); cbox_gs_render->SetSelection(Ini.GSRenderMode.GetValue()); cbox_gs_resolution->SetSelection(ResolutionIdToNum(Ini.GSResolution.GetValue()) - 1); cbox_gs_aspect->SetSelection(Ini.GSAspectRatio.GetValue() - 1); cbox_pad_handler->SetSelection(Ini.PadHandlerMode.GetValue()); cbox_keyboard_handler->SetSelection(Ini.KeyboardHandlerMode.GetValue()); cbox_mouse_handler->SetSelection(Ini.MouseHandlerMode.GetValue()); cbox_audio_out->SetSelection(Ini.AudioOutMode.GetValue()); s_round_cpu_decoder->Add(cbox_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_cpu->Add(s_round_cpu_decoder, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_cpu->Add(chbox_cpu_ignore_rwerrors, 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_aspect->Add(cbox_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_res, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(s_round_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_gs->Add(chbox_gs_log_prog, wxSizerFlags().Border(wxALL, 5)); s_round_gs->Add(chbox_gs_dump_depth, wxSizerFlags().Border(wxALL, 5)); s_round_gs->Add(chbox_gs_dump_color, wxSizerFlags().Border(wxALL, 5)); s_round_gs->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5)); s_round_io_pad_handler->Add(cbox_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_io_keyboard_handler->Add(cbox_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_io_mouse_handler->Add(cbox_mouse_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_io->Add(s_round_io_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_io->Add(s_round_io_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_io->Add(s_round_io_mouse_handler, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_audio_out->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_audio->Add(s_round_audio_out, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_hle->Add(chbox_hle_logging, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_hle->Add(chbox_hle_savetty, wxSizerFlags().Border(wxALL, 5).Expand()); s_round_hle->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand()); wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL)); s_b_panel->Add(new wxButton(&diag, wxID_OK), wxSizerFlags().Border(wxALL, 5).Center()); s_b_panel->Add(new wxButton(&diag, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Center()); //wxBoxSizer* s_conf_panel(new wxBoxSizer(wxHORIZONTAL)); s_subpanel1->Add(s_round_cpu, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel1->Add(s_round_gs, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel1->Add(s_b_panel, wxSizerFlags().Border(wxALL, 8).Expand()); s_subpanel2->Add(s_round_io, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel2->Add(s_round_audio, wxSizerFlags().Border(wxALL, 5).Expand()); s_subpanel2->Add(s_round_hle, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel1, wxSizerFlags().Border(wxALL, 5).Expand()); s_panel->Add(s_subpanel2, wxSizerFlags().Border(wxALL, 5).Expand()); diag.SetSizerAndFit( s_panel ); if(diag.ShowModal() == wxID_OK) { Ini.CPUDecoderMode.SetValue(cbox_cpu_decoder->GetSelection() + 1); Ini.CPUIgnoreRWErrors.SetValue(chbox_cpu_ignore_rwerrors->GetValue()); Ini.GSRenderMode.SetValue(cbox_gs_render->GetSelection()); Ini.GSResolution.SetValue(ResolutionNumToId(cbox_gs_resolution->GetSelection() + 1)); Ini.GSAspectRatio.SetValue(cbox_gs_aspect->GetSelection() + 1); Ini.GSVSyncEnable.SetValue(chbox_gs_vsync->GetValue()); Ini.GSLogPrograms.SetValue(chbox_gs_log_prog->GetValue()); Ini.GSDumpDepthBuffer.SetValue(chbox_gs_dump_depth->GetValue()); Ini.GSDumpColorBuffers.SetValue(chbox_gs_dump_color->GetValue()); Ini.PadHandlerMode.SetValue(cbox_pad_handler->GetSelection()); Ini.KeyboardHandlerMode.SetValue(cbox_keyboard_handler->GetSelection()); Ini.MouseHandlerMode.SetValue(cbox_mouse_handler->GetSelection()); Ini.AudioOutMode.SetValue(cbox_audio_out->GetSelection()); Ini.AudioDumpToFile.SetValue(chbox_audio_dump->GetValue()); Ini.HLELogging.SetValue(chbox_hle_logging->GetValue()); Ini.HLESaveTTY.SetValue(chbox_hle_savetty->GetValue()); Ini.HLEExitOnStop.SetValue(chbox_hle_exitonstop->GetValue()); Ini.Save(); } if(paused) Emu.Resume(); }