mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-28 22:13:24 +00:00
wxFuneral
This commit is contained in:
parent
79a3b308d1
commit
fcefbf26c6
@ -1333,9 +1333,6 @@ fs::file SELFDecrypter::MakeElf(bool isElf32)
|
||||
// Decompress if necessary.
|
||||
if (meta_shdr[i].compressed == 2)
|
||||
{
|
||||
/// Removed all wxWidget dependent code. Replaced with zlib functions.
|
||||
/// Also changed local mallocs to unique_ptrs.
|
||||
|
||||
// Store the length in writeable memory space.
|
||||
std::unique_ptr<uLongf> decomp_buf_length(new uLongf);
|
||||
memcpy(decomp_buf_length.get(), &phdr64_arr[meta_shdr[i].program_idx].p_filesz, sizeof(uLongf));
|
||||
|
@ -1,99 +0,0 @@
|
||||
#pragma once
|
||||
#include "rpcs3_version.h"
|
||||
|
||||
class AboutDialog : public wxDialog
|
||||
{
|
||||
enum
|
||||
{
|
||||
b_id_github,
|
||||
b_id_website,
|
||||
b_id_forum,
|
||||
b_id_patreon,
|
||||
};
|
||||
|
||||
public:
|
||||
AboutDialog(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "About RPCS3", wxDefaultPosition)
|
||||
{
|
||||
wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL));
|
||||
|
||||
//Logo
|
||||
wxPanel* s_panel_logo(new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(552, 92)));
|
||||
s_panel_logo->SetBackgroundColour(wxColor(100, 100, 100));
|
||||
|
||||
wxStaticText* t_name = new wxStaticText(this, wxID_ANY, "RPCS3");
|
||||
t_name->SetFont(wxFont(28, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
|
||||
t_name->SetBackgroundColour(wxColor(100, 100, 100));
|
||||
t_name->SetForegroundColour(wxColor(255, 255, 255));
|
||||
t_name->SetPosition(wxPoint(10, 6));
|
||||
|
||||
wxStaticText* t_descr = new wxStaticText(this, wxID_ANY, "A PlayStation 3 emulator and debugger.");
|
||||
t_descr->SetBackgroundColour(wxColor(100, 100, 100));
|
||||
t_descr->SetForegroundColour(wxColor(255, 255, 255));
|
||||
t_descr->SetPosition(wxPoint(12, 50));
|
||||
|
||||
wxStaticText* t_version = new wxStaticText(this, wxID_ANY, "RPCS3 Version: " + rpcs3::version.to_string());
|
||||
t_version->SetBackgroundColour(wxColor(100, 100, 100));
|
||||
t_version->SetForegroundColour(wxColor(200, 200, 200));
|
||||
t_version->SetPosition(wxPoint(12, 66));
|
||||
|
||||
//Credits
|
||||
wxBoxSizer* s_panel_credits(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxStaticText* t_section1 = new wxStaticText(this, wxID_ANY,
|
||||
fmt::FromUTF8(u8"\nDevelopers:\n\n¬DH\n¬AlexAltea\n¬Hykem\nOil\nNekotekina\nBigpet\n¬gopalsr83\n¬tambry\nvlj\nkd-11\njarveson\nraven02\nAniLeo\ncornytrace\nssshadow\nNuman\n"));
|
||||
wxStaticText* t_section2 = new wxStaticText(this, wxID_ANY,
|
||||
fmt::FromUTF8(u8"\nContributors:\n\nBlackDaemon\nelisha464\nAishou\nkrofna\nxsacha\ndanilaml\nunknownbrackets\nZangetsu38\nlioncash\nachurch\ndarkf\nSyphurith\nBlaypeg\nSurvanium90\ngeorgemoralis\nikki84\nhcorion\n"));
|
||||
wxStaticText* t_section3 = new wxStaticText(this, wxID_ANY,
|
||||
fmt::FromUTF8(u8"\nSupporters:\n\nHoward Garrison\nEXPotemkin\nMarko V.\ndanhp\nJake (5315825)\nIan Reid\nTad Sherlock\nTyler Friesen\nFolzar\nPayton Williams\nRedPill Australia\nyanghong\nMohammed El-Serougi\nДима ~Ximer13~ Кулин\nJames Reed\nBaroqueSonata\n"));
|
||||
|
||||
s_panel_credits->AddSpacer(12);
|
||||
s_panel_credits->Add(t_section1, 5);
|
||||
s_panel_credits->AddStretchSpacer();
|
||||
s_panel_credits->Add(t_section2, 5);
|
||||
s_panel_credits->AddStretchSpacer();
|
||||
s_panel_credits->Add(t_section3, 5);
|
||||
s_panel_credits->AddSpacer(12);
|
||||
|
||||
//Buttons
|
||||
wxBoxSizer* s_panel_buttons(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxButton* b_github = new wxButton(this, b_id_github, "GitHub");
|
||||
wxButton* b_website = new wxButton(this, b_id_website, "Website");
|
||||
wxButton* b_forum = new wxButton(this, b_id_forum, "Forum");
|
||||
wxButton* b_patreon = new wxButton(this, b_id_patreon, "Patreon");
|
||||
Connect(b_id_github, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AboutDialog::OpenWebsite));
|
||||
Connect(b_id_website, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AboutDialog::OpenWebsite));
|
||||
Connect(b_id_forum, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AboutDialog::OpenWebsite));
|
||||
Connect(b_id_patreon, wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(AboutDialog::OpenWebsite));
|
||||
|
||||
s_panel_buttons->AddSpacer(10);
|
||||
s_panel_buttons->Add(b_github, 18, 0, 5);
|
||||
s_panel_buttons->AddStretchSpacer();
|
||||
s_panel_buttons->Add(b_website, 18, 0, 5);
|
||||
s_panel_buttons->AddStretchSpacer();
|
||||
s_panel_buttons->Add(b_forum, 18, 0, 5);
|
||||
s_panel_buttons->AddStretchSpacer();
|
||||
s_panel_buttons->Add(b_patreon, 18, 0, 5);
|
||||
s_panel_buttons->AddStretchSpacer(14);
|
||||
s_panel_buttons->Add(new wxButton(this, wxID_OK, "Close") , 18, 0, 5);
|
||||
s_panel_buttons->AddSpacer(10);
|
||||
|
||||
//Panels
|
||||
s_panel->Add(s_panel_logo);
|
||||
s_panel->Add(s_panel_credits, 0, wxEXPAND);
|
||||
s_panel->Add(s_panel_buttons, 0, wxEXPAND);
|
||||
s_panel->AddSpacer(12);
|
||||
|
||||
SetSizerAndFit(s_panel);
|
||||
}
|
||||
|
||||
void OpenWebsite(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case b_id_github: wxLaunchDefaultBrowser("https://github.com/RPCS3"); break;
|
||||
case b_id_website: wxLaunchDefaultBrowser("https://rpcs3.net/"); break;
|
||||
case b_id_forum: wxLaunchDefaultBrowser("http://www.emunewz.net/forum/forumdisplay.php?fid=172"); break;
|
||||
case b_id_patreon: wxLaunchDefaultBrowser("https://www.patreon.com/Nekotekina"); break;
|
||||
}
|
||||
}
|
||||
};
|
@ -1,255 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/System.h"
|
||||
#include "AutoPauseManager.h"
|
||||
|
||||
//TODO::Get the enable configuration from ini.
|
||||
AutoPauseManagerDialog::AutoPauseManagerDialog(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "Auto Pause Manager")
|
||||
{
|
||||
SetMinSize(wxSize(400, 360));
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxStaticText* s_description = new wxStaticText(this, wxID_ANY, "To use auto pause: enter the ID(s) of a function or a system call. Restart of the game is required to apply. You can enable/disable this in the settings.", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_description->Wrap(400);
|
||||
s_main->Add(s_description, 0, wxALL, 5);
|
||||
|
||||
m_list = new wxListView(this);
|
||||
m_list->InsertColumn(0, "Call ID");
|
||||
m_list->InsertColumn(1, "Type");
|
||||
|
||||
m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &AutoPauseManagerDialog::OnEntryConfig, this);
|
||||
m_list->Bind(wxEVT_RIGHT_DOWN, &AutoPauseManagerDialog::OnRightClick, this);
|
||||
|
||||
s_main->Add(m_list, 1, wxALL | wxEXPAND, 5);
|
||||
|
||||
wxBoxSizer* s_action = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
s_action->Add(new wxButton(this, wxID_CLEAR, "Cl&ear", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
s_action->Add(new wxButton(this, wxID_REFRESH, "&Reload", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
s_action->Add(new wxButton(this, wxID_SAVE, "&Save", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
s_action->Add(new wxButton(this, wxID_CANCEL, "&Close", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
|
||||
s_main->Add(s_action, 0, wxALL, 5);
|
||||
|
||||
Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnAdd, this, id_add);
|
||||
Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnRemove, this, id_remove);
|
||||
Bind(wxEVT_MENU, &AutoPauseManagerDialog::OnEntryConfig, this, id_config);
|
||||
|
||||
Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnClear, this, wxID_CLEAR);
|
||||
Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnReload, this, wxID_REFRESH);
|
||||
Bind(wxEVT_BUTTON, &AutoPauseManagerDialog::OnSave, this, wxID_SAVE);
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
LoadEntries();
|
||||
UpdateList();
|
||||
|
||||
SetSizerAndFit(s_main);
|
||||
Layout();
|
||||
Centre(wxBOTH);
|
||||
}
|
||||
|
||||
//Copied some from AutoPause.
|
||||
void AutoPauseManagerDialog::LoadEntries(void)
|
||||
{
|
||||
m_entries.clear();
|
||||
m_entries.reserve(16);
|
||||
|
||||
fs::file list(fs::get_config_dir() + "pause.bin");
|
||||
|
||||
if (list)
|
||||
{
|
||||
//System calls ID and Function calls ID are all u32 iirc.
|
||||
u32 num;
|
||||
size_t fmax = list.size();
|
||||
size_t fcur = 0;
|
||||
list.seek(0);
|
||||
while (fcur <= fmax - sizeof(u32))
|
||||
{
|
||||
list.read(&num, sizeof(u32));
|
||||
fcur += sizeof(u32);
|
||||
if (num == 0xFFFFFFFF) break;
|
||||
|
||||
m_entries.emplace_back(num);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Copied some from AutoPause.
|
||||
//Tip: This one doesn't check for the file is being read or not.
|
||||
//This would always use a 0xFFFFFFFF as end of the pause.bin
|
||||
void AutoPauseManagerDialog::SaveEntries(void)
|
||||
{
|
||||
fs::file list(fs::get_config_dir() + "pause.bin", fs::rewrite);
|
||||
//System calls ID and Function calls ID are all u32 iirc.
|
||||
u32 num = 0;
|
||||
list.seek(0);
|
||||
for (size_t i = 0; i < m_entries.size(); ++i)
|
||||
{
|
||||
if (num == 0xFFFFFFFF) continue;
|
||||
num = m_entries[i];
|
||||
list.write(&num, sizeof(u32));
|
||||
}
|
||||
num = 0xFFFFFFFF;
|
||||
list.write(&num, sizeof(u32));
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::UpdateList(void)
|
||||
{
|
||||
m_list->Freeze();
|
||||
m_list->DeleteAllItems();
|
||||
for (size_t i = 0; i < m_entries.size(); ++i)
|
||||
{
|
||||
m_list->InsertItem(i, i);
|
||||
if (m_entries[i] != 0xFFFFFFFF)
|
||||
{
|
||||
m_list->SetItem(i, 0, fmt::format("%08x", m_entries[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_list->SetItem(i, 0, "Unset");
|
||||
}
|
||||
|
||||
if (m_entries[i] < 1024)
|
||||
{
|
||||
m_list->SetItem(i, 1, "System Call");
|
||||
}
|
||||
else
|
||||
{
|
||||
m_list->SetItem(i, 1, "Function Call");
|
||||
}
|
||||
}
|
||||
m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->Thaw();
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnEntryConfig(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
AutoPauseSettingsDialog(this, &m_entries[idx]).ShowModal();
|
||||
UpdateList();
|
||||
}
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnRightClick(wxMouseEvent& event)
|
||||
{
|
||||
wxMenu* menu = new wxMenu();
|
||||
int idx = m_list->GetFirstSelected();
|
||||
|
||||
menu->Append(id_add, "&Add");
|
||||
menu->Append(id_remove, "&Remove")->Enable(idx != wxNOT_FOUND);
|
||||
menu->AppendSeparator();
|
||||
menu->Append(id_config, "&Config")->Enable(idx != wxNOT_FOUND);
|
||||
|
||||
PopupMenu(menu);
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnAdd(wxCommandEvent& event)
|
||||
{
|
||||
m_entries.emplace_back(0xFFFFFFFF);
|
||||
UpdateList();
|
||||
|
||||
u32 idx = m_entries.size() - 1;
|
||||
for (int i = 0; i < m_list->GetItemCount(); ++i)
|
||||
{
|
||||
m_list->SetItemState(i, i == idx ? wxLIST_STATE_SELECTED : ~wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED);
|
||||
}
|
||||
|
||||
wxCommandEvent ce;
|
||||
OnEntryConfig(ce);
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnRemove(wxCommandEvent& event)
|
||||
{
|
||||
for (int sel = m_list->GetNextSelected(-1), offs = 0; sel != wxNOT_FOUND; sel = m_list->GetNextSelected(sel), --offs)
|
||||
{
|
||||
m_entries.erase(m_entries.begin() + (sel + offs));
|
||||
}
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnSave(wxCommandEvent& event)
|
||||
{
|
||||
SaveEntries();
|
||||
LOG_SUCCESS(HLE,"Auto Pause: File pause.bin was updated.");
|
||||
//event.Skip();
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnClear(wxCommandEvent& event)
|
||||
{
|
||||
m_entries.clear();
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
void AutoPauseManagerDialog::OnReload(wxCommandEvent& event)
|
||||
{
|
||||
LoadEntries();
|
||||
UpdateList();
|
||||
}
|
||||
|
||||
AutoPauseSettingsDialog::AutoPauseSettingsDialog(wxWindow* parent, u32 *entry)
|
||||
: wxDialog(parent, wxID_ANY, "Auto Pause Setting")
|
||||
, m_presult(entry)
|
||||
{
|
||||
m_entry = *m_presult;
|
||||
//SetSizeHints(wxSize(400, -1), wxDefaultSize);
|
||||
SetMinSize(wxSize(400, -1));
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxStaticText* s_description = new wxStaticText(this, wxID_ANY, "Specify ID of System Call or Function Call below. You need to use a Hexadecimal ID.", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_description->Wrap(400);
|
||||
s_main->Add(s_description, 0, wxALL, 5);
|
||||
|
||||
wxBoxSizer* s_config = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_id = new wxTextCtrl(this, wxID_STATIC, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_config->Add(m_id, 1, wxALL | wxEXPAND, 5);
|
||||
s_config->Add(new wxButton(this, wxID_OK, "&OK", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
s_config->Add(new wxButton(this, wxID_CANCEL, "&Cancel", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
|
||||
s_main->Add(s_config, 0, wxEXPAND, 5);
|
||||
|
||||
m_current_converted = new wxStaticText(this, wxID_ANY, "Currently it gets an id of \"Unset\".", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_main->Add(m_current_converted, 0, wxALL, 5);
|
||||
|
||||
m_id->SetValue(fmt::format("%08x", m_entry));
|
||||
|
||||
SetTitle("Auto Pause Setting: " + m_id->GetValue());
|
||||
|
||||
Bind(wxEVT_BUTTON, &AutoPauseSettingsDialog::OnOk, this, wxID_OK);
|
||||
Bind(wxEVT_TEXT, &AutoPauseSettingsDialog::OnUpdateValue, this, wxID_STATIC);
|
||||
|
||||
SetSizerAndFit(s_main);
|
||||
//SetSize(wxSize(400, -1));
|
||||
Layout();
|
||||
Centre(wxBOTH);
|
||||
|
||||
wxCommandEvent ce;
|
||||
OnUpdateValue(ce);
|
||||
}
|
||||
|
||||
void AutoPauseSettingsDialog::OnOk(wxCommandEvent& event)
|
||||
{
|
||||
ullong value = 0;
|
||||
m_id->GetValue().ToULongLong(&value, 16);
|
||||
|
||||
m_entry = value;
|
||||
*m_presult = m_entry;
|
||||
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
|
||||
void AutoPauseSettingsDialog::OnUpdateValue(wxCommandEvent& event)
|
||||
{
|
||||
ullong value;
|
||||
const bool is_ok = m_id->GetValue().ToULongLong(&value, 16) && value <= UINT32_MAX;
|
||||
|
||||
m_current_converted->SetLabelText(fmt::format("Current value: %08x (%s)", u32(value), is_ok ? "OK" : "conversion failed"));
|
||||
event.Skip();
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class AutoPauseManagerDialog : public wxDialog
|
||||
{
|
||||
enum
|
||||
{
|
||||
id_add,
|
||||
id_remove,
|
||||
id_config,
|
||||
};
|
||||
|
||||
wxListView* m_list;
|
||||
std::vector<u32> m_entries;
|
||||
|
||||
public:
|
||||
AutoPauseManagerDialog(wxWindow* parent);
|
||||
|
||||
void UpdateList(void);
|
||||
|
||||
void OnEntryConfig(wxCommandEvent& event);
|
||||
void OnRightClick(wxMouseEvent& event);
|
||||
void OnAdd(wxCommandEvent& event);
|
||||
void OnRemove(wxCommandEvent& event);
|
||||
|
||||
void OnClear(wxCommandEvent& event);
|
||||
void OnReload(wxCommandEvent& event);
|
||||
void OnSave(wxCommandEvent& event);
|
||||
|
||||
void LoadEntries(void);
|
||||
void SaveEntries(void);
|
||||
};
|
||||
|
||||
class AutoPauseSettingsDialog : public wxDialog
|
||||
{
|
||||
u32 m_entry;
|
||||
u32* m_presult;
|
||||
wxTextCtrl* m_id;
|
||||
wxStaticText* m_current_converted;
|
||||
|
||||
public:
|
||||
AutoPauseSettingsDialog(wxWindow* parent, u32* entry);
|
||||
void OnOk(wxCommandEvent& event);
|
||||
void OnUpdateValue(wxCommandEvent& event);
|
||||
};
|
@ -1,83 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
|
||||
#include "CgDisasm.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/RSX/CgBinaryProgram.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(CgDisasm, wxFrame)
|
||||
EVT_SIZE(CgDisasm::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
CgDisasm::CgDisasm(wxWindow* parent)
|
||||
: wxFrame(parent, wxID_ANY, "Cg Disasm", wxDefaultPosition, wxSize(640, 480))
|
||||
{
|
||||
wxMenuBar* menubar = new wxMenuBar();
|
||||
|
||||
wxMenu* menu_general = new wxMenu();
|
||||
menubar->Append(menu_general, "&Open");
|
||||
menu_general->Append(id_open_file, "Open &Cg binary program");
|
||||
|
||||
wxNotebook* nb_cg = new wxNotebook(this, wxID_ANY);
|
||||
wxPanel* p_cg_disasm = new wxPanel(nb_cg, wxID_ANY);
|
||||
wxPanel* p_glsl_shader = new wxPanel(nb_cg, wxID_ANY);
|
||||
|
||||
nb_cg->AddPage(p_cg_disasm, "ASM");
|
||||
nb_cg->AddPage(p_glsl_shader, "GLSL");
|
||||
|
||||
m_disasm_text = new wxTextCtrl(p_cg_disasm, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(620, 395), wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY | wxTE_RICH2);
|
||||
m_glsl_text = new wxTextCtrl(p_glsl_shader, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(620, 395), wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY | wxTE_RICH2);
|
||||
|
||||
SetMenuBar(menubar);
|
||||
|
||||
m_disasm_text->Bind(wxEVT_RIGHT_DOWN, &CgDisasm::OnRightClick, this);
|
||||
m_glsl_text->Bind(wxEVT_RIGHT_DOWN, &CgDisasm::OnRightClick, this);
|
||||
|
||||
Bind(wxEVT_MENU, &CgDisasm::OpenCg, this, id_open_file);
|
||||
Bind(wxEVT_MENU, &CgDisasm::OnContextMenu, this, id_clear);
|
||||
}
|
||||
|
||||
void CgDisasm::OpenCg(wxCommandEvent& event)
|
||||
{
|
||||
wxFileDialog ctrl(this, L"Select Cg program object", wxEmptyString, wxEmptyString,
|
||||
"Cg program objects (*.fpo;*.vpo)|*.fpo;*.vpo"
|
||||
"|All files (*.*)|*.*",
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
if (ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CgBinaryDisasm disasm(fmt::ToUTF8(ctrl.GetPath()));
|
||||
disasm.BuildShaderBody();
|
||||
*m_disasm_text << disasm.GetArbShader();
|
||||
*m_glsl_text << disasm.GetGlslShader();
|
||||
}
|
||||
|
||||
void CgDisasm::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
m_disasm_text->SetSize(GetSize().x - 20, GetSize().y - 85);
|
||||
m_glsl_text->SetSize(GetSize().x - 20, GetSize().y - 85);
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void CgDisasm::OnRightClick(wxMouseEvent& event)
|
||||
{
|
||||
wxMenu* menu = new wxMenu();
|
||||
menu->Append(id_clear, "&Clear");
|
||||
PopupMenu(menu);
|
||||
}
|
||||
|
||||
void CgDisasm::OnContextMenu(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case id_clear:
|
||||
m_disasm_text->Clear();
|
||||
m_glsl_text->Clear();
|
||||
break;
|
||||
default:
|
||||
event.Skip();
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
enum CgDisasmIds
|
||||
{
|
||||
id_open_file,
|
||||
id_clear
|
||||
};
|
||||
|
||||
class CgDisasm : public wxFrame
|
||||
{
|
||||
private:
|
||||
wxTextCtrl* m_disasm_text;
|
||||
wxTextCtrl* m_glsl_text;
|
||||
DECLARE_EVENT_TABLE();
|
||||
|
||||
public:
|
||||
CgDisasm(wxWindow* parent);
|
||||
|
||||
void OpenCg(wxCommandEvent& event);
|
||||
virtual void OnSize(wxSizeEvent& event);
|
||||
void OnRightClick(wxMouseEvent& event);
|
||||
void OnContextMenu(wxCommandEvent& event);
|
||||
};
|
@ -1,302 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Gui/ConLogFrame.h"
|
||||
|
||||
#include "rpcs3_version.h"
|
||||
#include <chrono>
|
||||
|
||||
struct gui_listener : logs::listener
|
||||
{
|
||||
atomic_t<logs::level> enabled{};
|
||||
|
||||
struct packet
|
||||
{
|
||||
atomic_t<packet*> next{};
|
||||
|
||||
logs::level sev{};
|
||||
std::string msg;
|
||||
|
||||
~packet()
|
||||
{
|
||||
for (auto ptr = next.raw(); UNLIKELY(ptr);)
|
||||
{
|
||||
delete std::exchange(ptr, std::exchange(ptr->next.raw(), nullptr));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
atomic_t<packet*> last; // Packet for writing another packet
|
||||
atomic_t<packet*> read; // Packet for reading
|
||||
|
||||
gui_listener()
|
||||
: logs::listener()
|
||||
{
|
||||
// Initialize packets
|
||||
read = new packet;
|
||||
last = new packet;
|
||||
read->next = last.load();
|
||||
last->msg = fmt::format("RPCS3 v%s\n", rpcs3::version.to_string());
|
||||
|
||||
// Self-registration
|
||||
logs::listener::add(this);
|
||||
}
|
||||
|
||||
~gui_listener()
|
||||
{
|
||||
delete read;
|
||||
}
|
||||
|
||||
void log(u64 stamp, const logs::message& msg, const std::string& prefix, const std::string& text)
|
||||
{
|
||||
if (msg.sev <= enabled)
|
||||
{
|
||||
const auto _new = new packet;
|
||||
_new->sev = msg.sev;
|
||||
|
||||
if (prefix.size() > 0)
|
||||
{
|
||||
_new->msg += "{";
|
||||
_new->msg += prefix;
|
||||
_new->msg += "} ";
|
||||
}
|
||||
|
||||
if ('\0' != *msg.ch->name)
|
||||
{
|
||||
_new->msg += msg.ch->name;
|
||||
_new->msg += msg.sev == logs::level::todo ? " TODO: " : ": ";
|
||||
}
|
||||
else if (msg.sev == logs::level::todo)
|
||||
{
|
||||
_new->msg += "TODO: ";
|
||||
}
|
||||
|
||||
_new->msg += text;
|
||||
_new->msg += '\n';
|
||||
|
||||
last.exchange(_new)->next = _new;
|
||||
}
|
||||
}
|
||||
|
||||
void pop()
|
||||
{
|
||||
if (const auto head = read->next.exchange(nullptr))
|
||||
{
|
||||
delete read.exchange(head);
|
||||
}
|
||||
}
|
||||
|
||||
void clear()
|
||||
{
|
||||
while (read->next)
|
||||
{
|
||||
pop();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// GUI Listener instance
|
||||
static gui_listener s_gui_listener;
|
||||
|
||||
enum
|
||||
{
|
||||
id_log_copy, // Copy log to ClipBoard
|
||||
id_log_clear, // Clear log
|
||||
id_log_level,
|
||||
id_log_level7 = id_log_level + 7,
|
||||
id_log_tty,
|
||||
id_timer,
|
||||
};
|
||||
|
||||
LogFrame::LogFrame(wxWindow* parent)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(600, 500))
|
||||
, m_tabs(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_NB_TOP | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS)
|
||||
, m_log(new wxTextCtrl(&m_tabs, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2))
|
||||
, m_tty(new wxTextCtrl(&m_tabs, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH2))
|
||||
, m_cfg_level(g_gui_cfg["Log Level"])
|
||||
, m_cfg_tty(g_gui_cfg["Log TTY"])
|
||||
{
|
||||
// Open or create TTY.log
|
||||
m_tty_file.open(fs::get_config_dir() + "TTY.log", fs::read + fs::create);
|
||||
|
||||
m_tty->SetBackgroundColour(wxColour("Black"));
|
||||
m_log->SetBackgroundColour(wxColour("Black"));
|
||||
m_tty->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
m_tty->SetDefaultStyle(wxColour(255, 255, 255));
|
||||
m_tabs.AddPage(m_log, "Log");
|
||||
m_tabs.AddPage(m_tty, "TTY");
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
s_main->Add(&m_tabs, 1, wxEXPAND);
|
||||
SetSizer(s_main);
|
||||
Layout();
|
||||
|
||||
m_log->Bind(wxEVT_RIGHT_DOWN, &LogFrame::OnRightClick, this);
|
||||
Bind(wxEVT_MENU, &LogFrame::OnContextMenu, this, id_log_clear);
|
||||
Bind(wxEVT_MENU, &LogFrame::OnContextMenu, this, id_log_copy);
|
||||
Bind(wxEVT_MENU, &LogFrame::OnContextMenu, this, id_log_level, id_log_level + 7);
|
||||
Bind(wxEVT_MENU, &LogFrame::OnContextMenu, this, id_log_tty);
|
||||
|
||||
Bind(wxEVT_CLOSE_WINDOW, [](wxCloseEvent& event) { event.Skip(); });
|
||||
|
||||
Show();
|
||||
|
||||
// Update listener info
|
||||
s_gui_listener.enabled = get_cfg_level();
|
||||
}
|
||||
|
||||
LogFrame::~LogFrame()
|
||||
{
|
||||
}
|
||||
|
||||
bool LogFrame::Close(bool force)
|
||||
{
|
||||
return wxWindowBase::Close(force);
|
||||
}
|
||||
|
||||
// Deals with the RightClick on Log Console, shows up the Context Menu.
|
||||
void LogFrame::OnRightClick(wxMouseEvent& event)
|
||||
{
|
||||
wxMenu* menu = new wxMenu();
|
||||
|
||||
menu->Append(id_log_copy, "&Copy");
|
||||
menu->Append(id_log_clear, "C&lear");
|
||||
menu->AppendSeparator();
|
||||
menu->AppendRadioItem(id_log_level + 0, "Nothing");
|
||||
menu->AppendRadioItem(id_log_level + 1, "Fatal");
|
||||
menu->AppendRadioItem(id_log_level + 2, "Error");
|
||||
menu->AppendRadioItem(id_log_level + 3, "Todo");
|
||||
menu->AppendRadioItem(id_log_level + 4, "Success");
|
||||
menu->AppendRadioItem(id_log_level + 5, "Warning");
|
||||
menu->AppendRadioItem(id_log_level + 6, "Notice");
|
||||
menu->AppendRadioItem(id_log_level + 7, "Trace");
|
||||
menu->AppendSeparator();
|
||||
menu->AppendCheckItem(id_log_tty, "TTY");
|
||||
|
||||
menu->Check(id_log_level + static_cast<uint>(get_cfg_level()), true);
|
||||
menu->Check(id_log_tty, get_cfg_tty());
|
||||
|
||||
PopupMenu(menu);
|
||||
}
|
||||
|
||||
// Well you can bind more than one control to a single handler.
|
||||
void LogFrame::OnContextMenu(wxCommandEvent& event)
|
||||
{
|
||||
switch (auto id = event.GetId())
|
||||
{
|
||||
case id_log_clear:
|
||||
{
|
||||
m_log->Clear();
|
||||
s_gui_listener.clear();
|
||||
break;
|
||||
}
|
||||
|
||||
case id_log_copy:
|
||||
{
|
||||
if (wxTheClipboard->Open())
|
||||
{
|
||||
m_tdo = new wxTextDataObject(m_log->GetStringSelection());
|
||||
if (m_tdo->GetTextLength() > 0)
|
||||
{
|
||||
wxTheClipboard->SetData(new wxTextDataObject(m_log->GetStringSelection()));
|
||||
}
|
||||
wxTheClipboard->Close();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case id_log_tty:
|
||||
{
|
||||
m_cfg_tty = !get_cfg_tty();
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
if (id >= id_log_level && id < id_log_level + 8)
|
||||
{
|
||||
m_cfg_level = id - id_log_level;
|
||||
s_gui_listener.enabled = static_cast<logs::level>(id - id_log_level);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
save_gui_cfg();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void LogFrame::UpdateUI()
|
||||
{
|
||||
std::vector<char> buf(4096);
|
||||
|
||||
// Get UTF-8 string from file
|
||||
auto get_utf8 = [&](const fs::file& file, u64 size) -> wxString
|
||||
{
|
||||
size = file.read(buf.data(), size);
|
||||
|
||||
for (u64 i = 0; i < size; i++)
|
||||
{
|
||||
// Get UTF-8 sequence length (no real validation performed)
|
||||
const u64 tail =
|
||||
(buf[i] & 0xF0) == 0xF0 ? 3 :
|
||||
(buf[i] & 0xE0) == 0xE0 ? 2 :
|
||||
(buf[i] & 0xC0) == 0xC0 ? 1 : 0;
|
||||
|
||||
if (i + tail >= size)
|
||||
{
|
||||
file.seek(i - size, fs::seek_cur);
|
||||
return wxString::FromUTF8(buf.data(), i);
|
||||
}
|
||||
}
|
||||
|
||||
return wxString::FromUTF8(buf.data(), size);
|
||||
};
|
||||
|
||||
const auto start = steady_clock::now();
|
||||
|
||||
// Check TTY logs
|
||||
while (const u64 size = std::min<u64>(buf.size(), m_tty_file.size() - m_tty_file.pos()))
|
||||
{
|
||||
const wxString& text = get_utf8(m_tty_file, size);
|
||||
|
||||
if (get_cfg_tty()) m_tty->AppendText(text);
|
||||
|
||||
// Limit processing time
|
||||
if (steady_clock::now() >= start + 4ms || text.empty()) break;
|
||||
}
|
||||
|
||||
// Check main logs
|
||||
while (const auto packet = s_gui_listener.read->next.load())
|
||||
{
|
||||
// Confirm log level
|
||||
if (packet->sev <= s_gui_listener.enabled)
|
||||
{
|
||||
// Get text color
|
||||
wxColour color;
|
||||
wxString text;
|
||||
switch (packet->sev)
|
||||
{
|
||||
case logs::level::always: color.Set(0x00, 0xFF, 0xFF); break; // Cyan
|
||||
case logs::level::fatal: text = "F "; color.Set(0xFF, 0x00, 0xFF); break; // Fuchsia
|
||||
case logs::level::error: text = "E "; color.Set(0xFF, 0x00, 0x00); break; // Red
|
||||
case logs::level::todo: text = "U "; color.Set(0xFF, 0x60, 0x00); break; // Orange
|
||||
case logs::level::success: text = "S "; color.Set(0x00, 0xFF, 0x00); break; // Green
|
||||
case logs::level::warning: text = "W "; color.Set(0xFF, 0xFF, 0x00); break; // Yellow
|
||||
case logs::level::notice: text = "! "; color.Set(0xFF, 0xFF, 0xFF); break; // White
|
||||
case logs::level::trace: text = "T "; color.Set(0x80, 0x80, 0x80); break; // Gray
|
||||
default: continue;
|
||||
}
|
||||
|
||||
// Print UTF-8 text
|
||||
text += wxString::FromUTF8(packet->msg.data(), packet->msg.size());
|
||||
m_log->SetDefaultStyle(color);
|
||||
m_log->AppendText(text);
|
||||
}
|
||||
|
||||
// Drop packet
|
||||
s_gui_listener.pop();
|
||||
|
||||
// Limit processing time
|
||||
if (steady_clock::now() >= start + 7ms) break;
|
||||
}
|
||||
}
|
@ -1,38 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class LogFrame : public wxPanel
|
||||
{
|
||||
fs::file m_tty_file;
|
||||
|
||||
wxAuiNotebook m_tabs;
|
||||
wxTextCtrl *m_log;
|
||||
wxTextCtrl *m_tty;
|
||||
|
||||
//Copy Action in Context Menu
|
||||
wxTextDataObject* m_tdo;
|
||||
|
||||
YAML::Node m_cfg_level;
|
||||
YAML::Node m_cfg_tty;
|
||||
|
||||
logs::level get_cfg_level() const
|
||||
{
|
||||
return static_cast<logs::level>(m_cfg_level.as<uint>(4));
|
||||
}
|
||||
|
||||
bool get_cfg_tty() const
|
||||
{
|
||||
return m_cfg_tty.as<bool>(true);
|
||||
}
|
||||
|
||||
public:
|
||||
LogFrame(wxWindow* parent);
|
||||
LogFrame(LogFrame &other) = delete;
|
||||
~LogFrame();
|
||||
|
||||
bool Close(bool force = false);
|
||||
void UpdateUI();
|
||||
|
||||
private:
|
||||
void OnRightClick(wxMouseEvent& event); // Show context menu
|
||||
void OnContextMenu(wxCommandEvent& event); // After select
|
||||
};
|
@ -1,117 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "rpcs3.h"
|
||||
#include "Debugger.h"
|
||||
#include "InterpreterDisAsm.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
|
||||
extern bool user_asked_for_frame_capture;
|
||||
|
||||
class DbgEmuPanel : public wxPanel
|
||||
{
|
||||
wxButton* m_btn_run;
|
||||
wxButton* m_btn_stop;
|
||||
wxButton* m_btn_restart;
|
||||
wxButton* m_btn_capture_frame;
|
||||
system_state m_last_status = system_state::ready;
|
||||
|
||||
public:
|
||||
DbgEmuPanel(wxWindow* parent) : wxPanel(parent)
|
||||
{
|
||||
m_btn_run = new wxButton(this, wxID_ANY, "Run");
|
||||
m_btn_run->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnRun, this);
|
||||
|
||||
m_btn_stop = new wxButton(this, wxID_ANY, "Stop");
|
||||
m_btn_stop->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnStop, this);
|
||||
|
||||
m_btn_restart = new wxButton(this, wxID_ANY, "Restart");
|
||||
m_btn_restart->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnRestart, this);
|
||||
|
||||
m_btn_capture_frame = new wxButton(this, wxID_ANY, "Capture frame");
|
||||
m_btn_capture_frame->Bind(wxEVT_BUTTON, &DbgEmuPanel::OnCaptureFrame, this);
|
||||
|
||||
wxBoxSizer* s_b_main = new wxBoxSizer(wxHORIZONTAL);
|
||||
s_b_main->Add(m_btn_run, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_btn_stop, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL), 0, wxEXPAND);
|
||||
s_b_main->Add(m_btn_restart, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_btn_capture_frame, wxSizerFlags().Border(wxALL, 5));
|
||||
|
||||
SetSizerAndFit(s_b_main);
|
||||
Layout();
|
||||
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
void UpdateUI()
|
||||
{
|
||||
const auto status = Emu.GetStatus();
|
||||
|
||||
if (m_last_status != status)
|
||||
{
|
||||
m_last_status = status;
|
||||
|
||||
m_btn_run->Enable(status != system_state::stopped);
|
||||
m_btn_stop->Enable(status != system_state::stopped);
|
||||
m_btn_restart->Enable(!Emu.GetPath().empty());
|
||||
m_btn_run->SetLabel(status == system_state::paused ? "Resume" : status == system_state::running ? "Pause" : "Run");
|
||||
}
|
||||
}
|
||||
|
||||
void OnRun(wxCommandEvent& event)
|
||||
{
|
||||
if (Emu.IsReady())
|
||||
{
|
||||
Emu.Run();
|
||||
}
|
||||
else if (Emu.IsRunning())
|
||||
{
|
||||
Emu.Pause();
|
||||
}
|
||||
else if (Emu.IsPaused())
|
||||
{
|
||||
Emu.Resume();
|
||||
}
|
||||
}
|
||||
|
||||
void OnStop(wxCommandEvent& event)
|
||||
{
|
||||
Emu.Stop();
|
||||
}
|
||||
|
||||
void OnRestart(wxCommandEvent& event)
|
||||
{
|
||||
Emu.Stop();
|
||||
Emu.Load();
|
||||
}
|
||||
|
||||
void OnCaptureFrame(wxCommandEvent& event)
|
||||
{
|
||||
user_asked_for_frame_capture = true;
|
||||
}
|
||||
};
|
||||
|
||||
DebuggerPanel::DebuggerPanel(wxWindow* parent) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(400, 600), wxTAB_TRAVERSAL)
|
||||
{
|
||||
m_aui_mgr.SetManagedWindow(this);
|
||||
|
||||
m_dbg_panel = new DbgEmuPanel(this);
|
||||
m_disasm_frame = new InterpreterDisAsmFrame(this);
|
||||
m_aui_mgr.AddPane(m_dbg_panel, wxAuiPaneInfo().Top());
|
||||
m_aui_mgr.AddPane(m_disasm_frame, wxAuiPaneInfo().Center().CaptionVisible(false).CloseButton().MaximizeButton());
|
||||
m_aui_mgr.Update();
|
||||
}
|
||||
|
||||
DebuggerPanel::~DebuggerPanel()
|
||||
{
|
||||
m_aui_mgr.UnInit();
|
||||
}
|
||||
|
||||
void DebuggerPanel::UpdateUI()
|
||||
{
|
||||
m_dbg_panel->UpdateUI();
|
||||
m_disasm_frame->UpdateUI();
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/aui/aui.h>
|
||||
|
||||
class DbgEmuPanel;
|
||||
class InterpreterDisAsmFrame;
|
||||
|
||||
class DebuggerPanel : public wxPanel
|
||||
{
|
||||
wxAuiManager m_aui_mgr;
|
||||
|
||||
DbgEmuPanel* m_dbg_panel;
|
||||
InterpreterDisAsmFrame* m_disasm_frame;
|
||||
|
||||
public:
|
||||
DebuggerPanel(wxWindow* parent);
|
||||
~DebuggerPanel();
|
||||
|
||||
void UpdateUI();
|
||||
};
|
@ -1,60 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "FrameBase.h"
|
||||
|
||||
FrameBase::FrameBase(wxWindow* parent, wxWindowID id, const wxString& frame_name, const std::string& ini_name, wxSize defsize, wxPoint defposition, long style)
|
||||
: wxFrame(parent, id, frame_name, defposition, defsize, style)
|
||||
, ini_name(ini_name.empty() ? fmt::ToUTF8(frame_name) : ini_name)
|
||||
{
|
||||
LoadInfo();
|
||||
|
||||
Bind(wxEVT_CLOSE_WINDOW, &FrameBase::OnClose, this);
|
||||
Bind(wxEVT_MOVE, &FrameBase::OnMove, this);
|
||||
Bind(wxEVT_SIZE, &FrameBase::OnResize, this);
|
||||
}
|
||||
|
||||
void FrameBase::SetSizerAndFit(wxSizer* sizer, bool deleteOld, bool loadinfo)
|
||||
{
|
||||
wxFrame::SetSizerAndFit(sizer, deleteOld);
|
||||
if (loadinfo) LoadInfo();
|
||||
}
|
||||
|
||||
void FrameBase::LoadInfo()
|
||||
{
|
||||
auto&& cfg = g_gui_cfg[ini_name];
|
||||
|
||||
auto&& size = GetSize();
|
||||
std::tie(size.x, size.y) = cfg["size"].as<std::pair<int, int>>(std::make_pair(size.x, size.y));
|
||||
SetSize(size);
|
||||
|
||||
auto&& pos = GetPosition();
|
||||
std::tie(pos.x, pos.y) = cfg["pos"].as<std::pair<int, int>>(std::make_pair(pos.x, pos.y));
|
||||
SetPosition(pos);
|
||||
}
|
||||
|
||||
void FrameBase::OnMove(wxMoveEvent& event)
|
||||
{
|
||||
auto&& cfg = g_gui_cfg[ini_name];
|
||||
|
||||
const auto& pos = GetPosition();
|
||||
cfg["pos"] = std::make_pair(pos.x, pos.y);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void FrameBase::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
auto&& cfg = g_gui_cfg[ini_name];
|
||||
|
||||
const auto& size = GetSize();
|
||||
cfg["size"] = std::make_pair(size.x, size.y);
|
||||
|
||||
const auto& pos = GetPosition();
|
||||
cfg["pos"] = std::make_pair(pos.x, pos.y);
|
||||
}
|
||||
|
||||
void FrameBase::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
save_gui_cfg();
|
||||
event.Skip();
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
struct FrameBase : public wxFrame
|
||||
{
|
||||
const std::string ini_name;
|
||||
|
||||
protected:
|
||||
FrameBase(
|
||||
wxWindow* parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& frame_name = "UnknownFrame",
|
||||
const std::string& ini_name = {},
|
||||
wxSize defsize = wxDefaultSize,
|
||||
wxPoint defposition = wxDefaultPosition,
|
||||
long style = wxDEFAULT_FRAME_STYLE);
|
||||
|
||||
~FrameBase()
|
||||
{
|
||||
}
|
||||
|
||||
void SetSizerAndFit(wxSizer* sizer, bool deleteOld = true, bool loadinfo = true);
|
||||
void LoadInfo();
|
||||
void OnMove(wxMoveEvent& event);
|
||||
void OnResize(wxSizeEvent& event);
|
||||
void OnClose(wxCloseEvent& event);
|
||||
};
|
@ -1,61 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/System.h"
|
||||
#include "GLGSFrame.h"
|
||||
#include <wx/version.h>
|
||||
|
||||
GLGSFrame::GLGSFrame(int w, int h)
|
||||
: GSFrame("OpenGL", w, h)
|
||||
{
|
||||
const int context_attrs[] =
|
||||
{
|
||||
WX_GL_RGBA,
|
||||
WX_GL_DEPTH_SIZE, 16,
|
||||
WX_GL_DOUBLEBUFFER,
|
||||
#if wxCHECK_VERSION(3, 1, 0)
|
||||
WX_GL_MAJOR_VERSION, 3,
|
||||
WX_GL_MINOR_VERSION, 3,
|
||||
WX_GL_CORE_PROFILE,
|
||||
#if !defined(CMAKE_BUILD)
|
||||
g_cfg.video.debug_output ? WX_GL_DEBUG : 0,
|
||||
#endif
|
||||
#endif
|
||||
0
|
||||
};
|
||||
|
||||
m_canvas = new wxGLCanvas(this, wxID_ANY, context_attrs, wxDefaultPosition, { w, h });
|
||||
m_canvas->Bind(wxEVT_LEFT_DCLICK, &GSFrame::OnLeftDclick, this);
|
||||
}
|
||||
|
||||
void* GLGSFrame::make_context()
|
||||
{
|
||||
return new wxGLContext(m_canvas);
|
||||
}
|
||||
|
||||
void GLGSFrame::set_current(draw_context_t ctx)
|
||||
{
|
||||
m_canvas->SetCurrent(*(wxGLContext*)ctx.get());
|
||||
}
|
||||
|
||||
void GLGSFrame::delete_context(void* ctx)
|
||||
{
|
||||
delete (wxGLContext*)ctx;
|
||||
}
|
||||
|
||||
void GLGSFrame::flip(draw_context_t context)
|
||||
{
|
||||
GSFrame::flip(context);
|
||||
|
||||
if (!m_canvas) return;
|
||||
|
||||
m_canvas->SetCurrent(*(wxGLContext*)context.get());
|
||||
m_canvas->SwapBuffers();
|
||||
}
|
||||
|
||||
void GLGSFrame::OnSize(wxSizeEvent& event)
|
||||
{
|
||||
if (m_canvas)
|
||||
m_canvas->SetSize(GetClientSize());
|
||||
|
||||
event.Skip();
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Gui/GSFrame.h"
|
||||
#include "wx/glcanvas.h"
|
||||
|
||||
class GLGSFrame : public GSFrame
|
||||
{
|
||||
wxGLCanvas* m_canvas;
|
||||
|
||||
public:
|
||||
GLGSFrame(int w, int h);
|
||||
|
||||
void* make_context() override;
|
||||
void set_current(draw_context_t context) override;
|
||||
void delete_context(void* context) override;
|
||||
void flip(draw_context_t context) override;
|
||||
|
||||
private:
|
||||
virtual void OnSize(wxSizeEvent& event);
|
||||
};
|
@ -1,128 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
|
||||
#include "Utilities/Timer.h"
|
||||
#include "Emu/System.h"
|
||||
#include "rpcs3.h"
|
||||
|
||||
#include "GSFrame.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(GSFrame, wxFrame)
|
||||
EVT_PAINT(GSFrame::OnPaint)
|
||||
EVT_SIZE(GSFrame::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
GSFrame::GSFrame(const wxString& title, int w, int h)
|
||||
: wxFrame(nullptr, wxID_ANY, "GSFrame[" + title + "]")
|
||||
{
|
||||
m_render = title;
|
||||
SetIcon(wxGetApp().m_MainFrame->GetIcon());
|
||||
SetCursor(wxCursor(wxImage(1, 1)));
|
||||
|
||||
SetClientSize(w, h);
|
||||
wxGetApp().Bind(wxEVT_KEY_DOWN, &GSFrame::OnKeyDown, this);
|
||||
Bind(wxEVT_CLOSE_WINDOW, &GSFrame::OnClose, this);
|
||||
Bind(wxEVT_LEFT_DCLICK, &GSFrame::OnLeftDclick, this);
|
||||
}
|
||||
|
||||
void GSFrame::OnPaint(wxPaintEvent& event)
|
||||
{
|
||||
wxPaintDC(this);
|
||||
}
|
||||
|
||||
void GSFrame::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
Emu.Stop();
|
||||
}
|
||||
|
||||
void GSFrame::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case WXK_RETURN: if (event.AltDown()) { OnFullScreen(); return; } break;
|
||||
case WXK_ESCAPE: if (IsFullScreen()) { ShowFullScreen(false); return; } break;
|
||||
}
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void GSFrame::OnFullScreen()
|
||||
{
|
||||
ShowFullScreen(!IsFullScreen());
|
||||
}
|
||||
|
||||
void GSFrame::close()
|
||||
{
|
||||
wxFrame::Close();
|
||||
}
|
||||
|
||||
bool GSFrame::shown()
|
||||
{
|
||||
return wxFrame::IsShown();
|
||||
}
|
||||
|
||||
void GSFrame::hide()
|
||||
{
|
||||
wxFrame::Hide();
|
||||
}
|
||||
|
||||
void GSFrame::show()
|
||||
{
|
||||
wxFrame::Show();
|
||||
}
|
||||
|
||||
void* GSFrame::handle() const
|
||||
{
|
||||
return GetHandle();
|
||||
}
|
||||
|
||||
void* GSFrame::make_context()
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void GSFrame::set_current(draw_context_t ctx)
|
||||
{
|
||||
}
|
||||
|
||||
void GSFrame::delete_context(void* ctx)
|
||||
{
|
||||
}
|
||||
|
||||
int GSFrame::client_width()
|
||||
{
|
||||
return GetClientSize().GetWidth();
|
||||
}
|
||||
|
||||
int GSFrame::client_height()
|
||||
{
|
||||
return GetClientSize().GetHeight();
|
||||
}
|
||||
|
||||
void GSFrame::flip(draw_context_t)
|
||||
{
|
||||
++m_frames;
|
||||
|
||||
static Timer fps_t;
|
||||
|
||||
if (fps_t.GetElapsedTimeInSec() >= 0.5)
|
||||
{
|
||||
std::string title = fmt::format("FPS: %.2f", (double)m_frames / fps_t.GetElapsedTimeInSec());
|
||||
|
||||
if (!m_render.empty())
|
||||
title += " | " + m_render;
|
||||
|
||||
if (!Emu.GetTitle().empty())
|
||||
title += " | " + Emu.GetTitle();
|
||||
|
||||
if (!Emu.GetTitleID().empty())
|
||||
title += " | [" + Emu.GetTitleID() + ']';
|
||||
|
||||
wxGetApp().CallAfter([this, title = std::move(title)]
|
||||
{
|
||||
SetTitle(wxString(title.c_str(), wxConvUTF8));
|
||||
});
|
||||
|
||||
m_frames = 0;
|
||||
fps_t.Start();
|
||||
}
|
||||
}
|
@ -1,45 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/RSX/GSRender.h"
|
||||
|
||||
class GSFrame : public wxFrame, public GSFrameBase
|
||||
{
|
||||
u64 m_frames = 0;
|
||||
std::string m_render;
|
||||
|
||||
public:
|
||||
GSFrame(const wxString& title, int w, int h);
|
||||
|
||||
protected:
|
||||
virtual void OnPaint(wxPaintEvent& event);
|
||||
virtual void OnClose(wxCloseEvent& event);
|
||||
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnFullScreen();
|
||||
|
||||
void close() override;
|
||||
|
||||
bool shown() override;
|
||||
void hide() override;
|
||||
void show() override;
|
||||
|
||||
void* handle() const override;
|
||||
|
||||
void* make_context() override;
|
||||
void set_current(draw_context_t context) override;
|
||||
void delete_context(void* context) override;
|
||||
void flip(draw_context_t context) override;
|
||||
int client_width() override;
|
||||
int client_height() override;
|
||||
|
||||
public:
|
||||
void OnLeftDclick(wxMouseEvent&)
|
||||
{
|
||||
OnFullScreen();
|
||||
}
|
||||
|
||||
//void SetSize(int width, int height);
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
@ -1,527 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "GameViewer.h"
|
||||
#include "Loader/PSF.h"
|
||||
#include "SettingsDialog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
static const std::string m_class_name = "GameViewer";
|
||||
|
||||
// Auxiliary classes
|
||||
class sortGameData
|
||||
{
|
||||
int sortColumn;
|
||||
bool sortAscending;
|
||||
|
||||
public:
|
||||
sortGameData(u32 column, bool ascending) : sortColumn(column), sortAscending(ascending) {}
|
||||
bool operator()(const GameInfo& game1, const GameInfo& game2) const
|
||||
{
|
||||
// Note that the column index has to match the appropriate GameInfo member
|
||||
switch (sortColumn - 1) // skip *icon* column
|
||||
{
|
||||
case 0: return sortAscending ? (game1.name < game2.name) : (game1.name > game2.name);
|
||||
case 1: return sortAscending ? (game1.serial < game2.serial) : (game1.serial > game2.serial);
|
||||
case 2: return sortAscending ? (game1.fw < game2.fw) : (game1.fw > game2.fw);
|
||||
case 3: return sortAscending ? (game1.app_ver < game2.app_ver) : (game1.app_ver > game2.app_ver);
|
||||
case 4: return sortAscending ? (game1.category < game2.category) : (game1.category > game2.category);
|
||||
case 5: return sortAscending ? (game1.root < game2.root) : (game1.root > game2.root);
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// GameViewer functions
|
||||
GameViewer::GameViewer(wxWindow* parent) : wxListView(parent)
|
||||
{
|
||||
LoadSettings();
|
||||
m_columns.Show(this);
|
||||
|
||||
m_sortColumn = 1;
|
||||
m_sortAscending = true;
|
||||
m_popup = new wxMenu();
|
||||
InitPopupMenu();
|
||||
|
||||
Bind(wxEVT_LIST_ITEM_ACTIVATED, &GameViewer::DClick, this);
|
||||
Bind(wxEVT_LIST_COL_CLICK, &GameViewer::OnColClick, this);
|
||||
Bind(wxEVT_LIST_ITEM_RIGHT_CLICK, &GameViewer::RightClick, this);
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
GameViewer::~GameViewer()
|
||||
{
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
void GameViewer::InitPopupMenu()
|
||||
{
|
||||
wxMenuItem* boot_item = new wxMenuItem(m_popup, 0, "Boot");
|
||||
#if defined (_WIN32)
|
||||
// wxMenuItem::Set(Get)Font only available for the wxMSW port
|
||||
wxFont font = GetFont();
|
||||
font.SetWeight(wxFONTWEIGHT_BOLD);
|
||||
boot_item->SetFont(font);
|
||||
#endif
|
||||
m_popup->Append(boot_item);
|
||||
m_popup->Append(1, "Configure");
|
||||
m_popup->AppendSeparator();
|
||||
m_popup->Append(2, "Remove Game");
|
||||
m_popup->Append(3, "Remove Custom Configuration");
|
||||
m_popup->AppendSeparator();
|
||||
m_popup->Append(4, "Open Game Folder");
|
||||
m_popup->Append(5, "Open Config Folder");
|
||||
Bind(wxEVT_MENU, &GameViewer::BootGame, this, 0);
|
||||
Bind(wxEVT_MENU, &GameViewer::ConfigureGame, this, 1);
|
||||
Bind(wxEVT_MENU, &GameViewer::RemoveGame, this, 2);
|
||||
Bind(wxEVT_MENU, &GameViewer::RemoveGameConfig, this, 3);
|
||||
Bind(wxEVT_MENU, &GameViewer::OpenGameFolder, this, 4);
|
||||
Bind(wxEVT_MENU, &GameViewer::OpenConfigFolder, this, 5);
|
||||
}
|
||||
|
||||
void GameViewer::DoResize(wxSize size)
|
||||
{
|
||||
SetSize(size);
|
||||
}
|
||||
|
||||
void GameViewer::OnColClick(wxListEvent& event)
|
||||
{
|
||||
if (event.GetColumn() == m_sortColumn)
|
||||
m_sortAscending ^= true;
|
||||
else
|
||||
m_sortAscending = true;
|
||||
m_sortColumn = event.GetColumn();
|
||||
|
||||
// Sort entries, update columns and refresh the panel
|
||||
std::sort(m_game_data.begin(), m_game_data.end(), sortGameData(m_sortColumn, m_sortAscending));
|
||||
m_columns.Update(m_game_data);
|
||||
ShowData();
|
||||
}
|
||||
|
||||
void GameViewer::LoadGames()
|
||||
{
|
||||
m_games.clear();
|
||||
|
||||
for (const auto& entry : fs::dir(Emu.GetGameDir()))
|
||||
{
|
||||
if (entry.is_directory)
|
||||
{
|
||||
m_games.push_back(entry.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GameViewer::LoadPSF()
|
||||
{
|
||||
m_game_data.clear();
|
||||
|
||||
const std::string& game_path = Emu.GetGameDir();
|
||||
|
||||
for (u32 i = 0; i < m_games.size(); ++i)
|
||||
{
|
||||
const std::string& dir = game_path + m_games[i];
|
||||
const std::string& sfb = dir + "/PS3_DISC.SFB";
|
||||
const std::string& sfo = dir + (fs::is_file(sfb) ? "/PS3_GAME/PARAM.SFO" : "/PARAM.SFO");
|
||||
|
||||
const fs::file sfo_file(sfo);
|
||||
if (!sfo_file)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const auto& psf = psf::load_object(sfo_file);
|
||||
|
||||
GameInfo game;
|
||||
game.root = m_games[i];
|
||||
game.serial = psf::get_string(psf, "TITLE_ID", "");
|
||||
game.name = psf::get_string(psf, "TITLE", "unknown");
|
||||
game.app_ver = psf::get_string(psf, "APP_VER", "unknown");
|
||||
game.category = psf::get_string(psf, "CATEGORY", "unknown");
|
||||
game.fw = psf::get_string(psf, "PS3_SYSTEM_VER", "unknown");
|
||||
game.parental_lvl = psf::get_integer(psf, "PARENTAL_LEVEL");
|
||||
game.resolution = psf::get_integer(psf, "RESOLUTION");
|
||||
game.sound_format = psf::get_integer(psf, "SOUND_FORMAT");
|
||||
|
||||
if (game.category == "HG")
|
||||
{
|
||||
game.category = "HDD Game";
|
||||
game.icon_path = dir + "/ICON0.PNG";
|
||||
}
|
||||
else if (game.category == "DG")
|
||||
{
|
||||
game.category = "Disc Game";
|
||||
game.icon_path = dir + "/PS3_GAME/ICON0.PNG";
|
||||
}
|
||||
else if (game.category == "HM")
|
||||
{
|
||||
game.category = "Home";
|
||||
game.icon_path = dir + "/ICON0.PNG";
|
||||
}
|
||||
else if (game.category == "AV")
|
||||
{
|
||||
game.category = "Audio/Video";
|
||||
game.icon_path = dir + "/ICON0.PNG";
|
||||
}
|
||||
else if (game.category == "GD")
|
||||
{
|
||||
game.category = "Game Data";
|
||||
game.icon_path = dir + "/ICON0.PNG";
|
||||
}
|
||||
|
||||
m_game_data.push_back(game);
|
||||
}
|
||||
|
||||
// Sort entries and update columns
|
||||
std::sort(m_game_data.begin(), m_game_data.end(), sortGameData(m_sortColumn, m_sortAscending));
|
||||
m_columns.Update(m_game_data);
|
||||
}
|
||||
|
||||
void GameViewer::ShowData()
|
||||
{
|
||||
m_columns.ShowData(this);
|
||||
}
|
||||
|
||||
void GameViewer::Refresh()
|
||||
{
|
||||
LoadGames();
|
||||
LoadPSF();
|
||||
ShowData();
|
||||
}
|
||||
|
||||
void GameViewer::SaveSettings()
|
||||
{
|
||||
m_columns.LoadSave(false, m_class_name, this);
|
||||
}
|
||||
|
||||
void GameViewer::LoadSettings()
|
||||
{
|
||||
m_columns.LoadSave(true, m_class_name);
|
||||
}
|
||||
|
||||
void GameViewer::DClick(wxListEvent& event)
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
const std::string& path = Emu.GetGameDir() + m_game_data[i].root;
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
if (!Emu.BootGame(path))
|
||||
{
|
||||
LOG_ERROR(LOADER, "Failed to boot /dev_hdd0/game/%s", m_game_data[i].root);
|
||||
}
|
||||
}
|
||||
|
||||
void GameViewer::RightClick(wxListEvent& event)
|
||||
{
|
||||
PopupMenu(m_popup, event.GetPoint());
|
||||
}
|
||||
|
||||
void GameViewer::BootGame(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxListEvent unused_event;
|
||||
DClick(unused_event);
|
||||
}
|
||||
|
||||
void GameViewer::ConfigureGame(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
SettingsDialog(this, "data/" + m_game_data[i].serial);
|
||||
}
|
||||
|
||||
void GameViewer::RemoveGame(wxCommandEvent& event)
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
if (wxMessageBox("Permanently delete game files?", "Confirm Delete", wxYES_NO | wxNO_DEFAULT) == wxYES)
|
||||
{
|
||||
fs::remove_all(Emu.GetGameDir() + fmt::ToUTF8(this->GetItemText(i, 6)));
|
||||
}
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void GameViewer::RemoveGameConfig(wxCommandEvent& event)
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
const std::string config_path = fs::get_config_dir() + "data/" + m_game_data[i].serial + "/config.yml";
|
||||
|
||||
if (fs::is_file(config_path))
|
||||
{
|
||||
if (wxMessageBox("Delete custom game configuration?", "Confirm Delete", wxYES_NO | wxNO_DEFAULT) == wxYES)
|
||||
{
|
||||
if (fs::remove_file(config_path))
|
||||
{
|
||||
LOG_SUCCESS(GENERAL, "Removed configuration file: %s", config_path);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_FATAL(GENERAL, "Failed to delete configuration file: %s\nError: %s", config_path, fs::g_tls_error);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Configuration file not found: %s", config_path);
|
||||
}
|
||||
}
|
||||
|
||||
static void open_dir(const std::string& spath)
|
||||
{
|
||||
fs::create_dir(spath);
|
||||
|
||||
#ifdef _WIN32
|
||||
std::string command = "explorer " + spath;
|
||||
std::replace(command.begin(), command.end(), '/', '\\');
|
||||
#elif __APPLE__
|
||||
std::string command = "open " + spath;
|
||||
#else
|
||||
std::string command = "xdg-open " + spath;
|
||||
#endif
|
||||
wxExecute(fmt::FromUTF8(command));
|
||||
}
|
||||
|
||||
void GameViewer::OpenGameFolder(wxCommandEvent& event)
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
open_dir(Emu.GetGameDir() + m_game_data[i].root);
|
||||
}
|
||||
|
||||
void GameViewer::OpenConfigFolder(wxCommandEvent& event)
|
||||
{
|
||||
long i = GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
open_dir(fs::get_config_dir() + "data/" + m_game_data[i].serial);
|
||||
}
|
||||
|
||||
ColumnsArr::ColumnsArr()
|
||||
{
|
||||
Init();
|
||||
}
|
||||
|
||||
std::vector<Column*> ColumnsArr::GetSortedColumnsByPos()
|
||||
{
|
||||
std::vector<Column*> arr;
|
||||
for (u32 pos = 0; pos<m_columns.size(); pos++)
|
||||
{
|
||||
for (u32 c = 0; c<m_columns.size(); ++c)
|
||||
{
|
||||
if (m_columns[c].pos != pos) continue;
|
||||
arr.push_back(&m_columns[c]);
|
||||
}
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
Column* ColumnsArr::GetColumnByPos(u32 pos)
|
||||
{
|
||||
std::vector<Column *> columns = GetSortedColumnsByPos();
|
||||
for (u32 c = 0; c<columns.size(); ++c)
|
||||
{
|
||||
if (!columns[c]->shown)
|
||||
{
|
||||
pos++;
|
||||
continue;
|
||||
}
|
||||
if (columns[c]->pos != pos) continue;
|
||||
return columns[c];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void ColumnsArr::Init()
|
||||
{
|
||||
m_img_list = new wxImageList(80, 44);
|
||||
|
||||
m_columns.clear();
|
||||
m_columns.emplace_back(0, 90, "Icon");
|
||||
m_columns.emplace_back(1, 160, "Name");
|
||||
m_columns.emplace_back(2, 85, "Serial");
|
||||
m_columns.emplace_back(3, 55, "FW");
|
||||
m_columns.emplace_back(4, 55, "App version");
|
||||
m_columns.emplace_back(5, 75, "Category");
|
||||
m_columns.emplace_back(6, 160, "Path");
|
||||
m_col_icon = &m_columns[0];
|
||||
m_col_name = &m_columns[1];
|
||||
m_col_serial = &m_columns[2];
|
||||
m_col_fw = &m_columns[3];
|
||||
m_col_app_ver = &m_columns[4];
|
||||
m_col_category = &m_columns[5];
|
||||
m_col_path = &m_columns[6];
|
||||
}
|
||||
|
||||
void ColumnsArr::Update(const std::vector<GameInfo>& game_data)
|
||||
{
|
||||
m_col_icon->data.clear();
|
||||
m_col_name->data.clear();
|
||||
m_col_serial->data.clear();
|
||||
m_col_fw->data.clear();
|
||||
m_col_app_ver->data.clear();
|
||||
m_col_category->data.clear();
|
||||
m_col_path->data.clear();
|
||||
m_icon_indexes.clear();
|
||||
|
||||
if (m_columns.size() == 0) return;
|
||||
|
||||
for (const auto& game : game_data)
|
||||
{
|
||||
m_col_icon->data.push_back(game.icon_path);
|
||||
m_col_name->data.push_back(game.name);
|
||||
m_col_serial->data.push_back(game.serial);
|
||||
m_col_fw->data.push_back(game.fw);
|
||||
m_col_app_ver->data.push_back(game.app_ver);
|
||||
m_col_category->data.push_back(game.category);
|
||||
m_col_path->data.push_back(game.root);
|
||||
}
|
||||
|
||||
// load icons
|
||||
for (const auto& path : m_col_icon->data)
|
||||
{
|
||||
wxImage game_icon(80, 44);
|
||||
if (!path.empty())
|
||||
{
|
||||
wxLogNull logNo; // temporary disable wx warnings ("iCCP: known incorrect sRGB profile" spamming)
|
||||
if (game_icon.LoadFile(fmt::FromUTF8(path), wxBITMAP_TYPE_PNG))
|
||||
{
|
||||
game_icon.Rescale(80, 44, wxIMAGE_QUALITY_HIGH);
|
||||
m_icon_indexes.push_back(m_img_list->Add(game_icon));
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error loading image %s", path);
|
||||
}
|
||||
}
|
||||
|
||||
m_icon_indexes.push_back(-1);
|
||||
}
|
||||
}
|
||||
|
||||
void ColumnsArr::Show(wxListView* list)
|
||||
{
|
||||
list->DeleteAllColumns();
|
||||
list->SetImageList(m_img_list, wxIMAGE_LIST_SMALL);
|
||||
std::vector<Column *> c_col = GetSortedColumnsByPos();
|
||||
for (u32 i = 0, c = 0; i<c_col.size(); ++i)
|
||||
{
|
||||
if (!c_col[i]->shown) continue;
|
||||
list->InsertColumn(c++, fmt::FromUTF8(c_col[i]->name), 0, c_col[i]->width);
|
||||
}
|
||||
}
|
||||
|
||||
void ColumnsArr::ShowData(wxListView* list)
|
||||
{
|
||||
list->DeleteAllItems();
|
||||
list->SetImageList(m_img_list, wxIMAGE_LIST_SMALL);
|
||||
for (int c = 1; c<list->GetColumnCount(); ++c)
|
||||
{
|
||||
Column* col = GetColumnByPos(c);
|
||||
|
||||
if (!col)
|
||||
{
|
||||
LOG_ERROR(HLE, "Columns loaded with error!");
|
||||
return;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i<col->data.size(); ++i)
|
||||
{
|
||||
if (list->GetItemCount() <= (int)i)
|
||||
{
|
||||
list->InsertItem(i, wxEmptyString);
|
||||
list->SetItemData(i, i);
|
||||
}
|
||||
list->SetItem(i, c, fmt::FromUTF8(col->data[i]));
|
||||
if (m_icon_indexes[i] >= 0)
|
||||
list->SetItemColumnImage(i, 0, m_icon_indexes[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ColumnsArr::LoadSave(bool isLoad, const std::string& path, wxListView* list)
|
||||
{
|
||||
if (isLoad)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
else if (list)
|
||||
{
|
||||
for (int c = 0; c < list->GetColumnCount(); ++c)
|
||||
{
|
||||
Column* col = GetColumnByPos(c);
|
||||
if (col)
|
||||
col->width = list->GetColumnWidth(c);
|
||||
}
|
||||
}
|
||||
|
||||
auto&& cfg = g_gui_cfg["GameViewer"];
|
||||
|
||||
for (auto& column : m_columns)
|
||||
{
|
||||
auto&& c_cfg = cfg[column.name];
|
||||
|
||||
if (isLoad)
|
||||
{
|
||||
std::tie(column.pos, column.width) = c_cfg.as<std::pair<u32, u32>>(std::make_pair(column.def_pos, column.def_width));
|
||||
|
||||
column.shown = true;
|
||||
}
|
||||
else //if (column.shown)
|
||||
{
|
||||
c_cfg = std::make_pair(column.pos, column.width);
|
||||
}
|
||||
}
|
||||
|
||||
if (isLoad)
|
||||
{
|
||||
//check for errors
|
||||
for (u32 c1 = 0; c1 < m_columns.size(); ++c1)
|
||||
{
|
||||
for (u32 c2 = c1 + 1; c2 < m_columns.size(); ++c2)
|
||||
{
|
||||
if (m_columns[c1].pos == m_columns[c2].pos)
|
||||
{
|
||||
LOG_ERROR(HLE, "Columns loaded with error!");
|
||||
Init();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (u32 p = 0; p < m_columns.size(); ++p)
|
||||
{
|
||||
bool ishas = false;
|
||||
for (u32 c = 0; c < m_columns.size(); ++c)
|
||||
{
|
||||
if (m_columns[c].pos != p)
|
||||
continue;
|
||||
|
||||
ishas = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!ishas)
|
||||
{
|
||||
LOG_ERROR(HLE, "Columns loaded with error!");
|
||||
Init();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
save_gui_cfg();
|
||||
}
|
||||
}
|
@ -1,98 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/GameInfo.h"
|
||||
|
||||
struct Column
|
||||
{
|
||||
u32 pos;
|
||||
u32 width;
|
||||
bool shown;
|
||||
std::vector<std::string> data;
|
||||
|
||||
const std::string name;
|
||||
const u32 def_pos;
|
||||
const u32 def_width;
|
||||
|
||||
Column(const u32 _def_pos, const u32 _def_width, const std::string& _name)
|
||||
: def_pos(_def_pos)
|
||||
, def_width(_def_width)
|
||||
, pos(_def_pos)
|
||||
, width(_def_width)
|
||||
, shown(true)
|
||||
, name(_name)
|
||||
{
|
||||
data.clear();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct ColumnsArr
|
||||
{
|
||||
std::vector<Column> m_columns;
|
||||
|
||||
ColumnsArr();
|
||||
|
||||
std::vector<Column*> GetSortedColumnsByPos();
|
||||
|
||||
Column* GetColumnByPos(u32 pos);
|
||||
|
||||
public:
|
||||
Column* m_col_icon;
|
||||
Column* m_col_name;
|
||||
Column* m_col_serial;
|
||||
Column* m_col_fw;
|
||||
Column* m_col_app_ver;
|
||||
Column* m_col_category;
|
||||
Column* m_col_path;
|
||||
|
||||
wxImageList* m_img_list;
|
||||
std::vector<int> m_icon_indexes;
|
||||
|
||||
void Init();
|
||||
|
||||
void Update(const std::vector<GameInfo>& game_data);
|
||||
|
||||
void Show(wxListView* list);
|
||||
|
||||
void ShowData(wxListView* list);
|
||||
|
||||
void LoadSave(bool isLoad, const std::string& path, wxListView* list = NULL);
|
||||
};
|
||||
|
||||
class GameViewer : public wxListView
|
||||
{
|
||||
int m_sortColumn;
|
||||
bool m_sortAscending;
|
||||
std::vector<std::string> m_games;
|
||||
std::vector<GameInfo> m_game_data;
|
||||
ColumnsArr m_columns;
|
||||
wxMenu* m_popup;
|
||||
|
||||
public:
|
||||
GameViewer(wxWindow* parent);
|
||||
~GameViewer();
|
||||
|
||||
void InitPopupMenu();
|
||||
|
||||
void DoResize(wxSize size);
|
||||
|
||||
void LoadGames();
|
||||
void LoadPSF();
|
||||
void ShowData();
|
||||
|
||||
void SaveSettings();
|
||||
void LoadSettings();
|
||||
|
||||
void Refresh();
|
||||
void BootGame(wxCommandEvent& event);
|
||||
void ConfigureGame(wxCommandEvent& event);
|
||||
void RemoveGame(wxCommandEvent& event);
|
||||
void RemoveGameConfig(wxCommandEvent& event);
|
||||
void OpenGameFolder(wxCommandEvent& event);
|
||||
void OpenConfigFolder(wxCommandEvent& event);
|
||||
|
||||
private:
|
||||
virtual void DClick(wxListEvent& event);
|
||||
virtual void OnColClick(wxListEvent& event);
|
||||
virtual void RightClick(wxListEvent& event);
|
||||
};
|
@ -1,101 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/CPU/CPUDisAsm.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
#include "InstructionEditor.h"
|
||||
|
||||
InstructionEditorDialog::InstructionEditorDialog(wxPanel *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm)
|
||||
: wxDialog(parent, wxID_ANY, "Edit instruction", wxDefaultPosition)
|
||||
, pc(_pc)
|
||||
, cpu(_cpu)
|
||||
, disasm(_disasm)
|
||||
{
|
||||
wxBoxSizer* s_panel_margin_x(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxBoxSizer* s_panel_margin_y(new wxBoxSizer(wxVERTICAL));
|
||||
|
||||
wxBoxSizer* s_panel(new wxBoxSizer(wxVERTICAL));
|
||||
wxBoxSizer* s_t1_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxBoxSizer* s_t2_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxBoxSizer* s_t3_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
|
||||
wxStaticText* t1_text = new wxStaticText(this, wxID_ANY, "Address: ");
|
||||
wxStaticText* t1_addr = new wxStaticText(this, wxID_ANY, wxString::Format("%08x", pc));
|
||||
wxStaticText* t2_text = new wxStaticText(this, wxID_ANY, "Instruction:");
|
||||
t2_instr = new wxTextCtrl(this, wxID_ANY);
|
||||
wxStaticText* t3_text = new wxStaticText(this, wxID_ANY, "Preview: ");
|
||||
t3_preview = new wxStaticText(this, wxID_ANY, "");
|
||||
|
||||
s_t1_panel->Add(t1_text);
|
||||
s_t1_panel->AddSpacer(8);
|
||||
s_t1_panel->Add(t1_addr);
|
||||
|
||||
s_t2_panel->Add(t2_text);
|
||||
s_t2_panel->AddSpacer(8);
|
||||
s_t2_panel->Add(t2_instr);
|
||||
|
||||
s_t3_panel->Add(t3_text);
|
||||
s_t3_panel->AddSpacer(8);
|
||||
s_t3_panel->Add(t3_preview);
|
||||
|
||||
s_b_panel->Add(new wxButton(this, wxID_OK), wxLEFT, 0, 5);
|
||||
s_b_panel->AddSpacer(5);
|
||||
s_b_panel->Add(new wxButton(this, wxID_CANCEL), wxRIGHT, 0, 5);
|
||||
|
||||
s_panel->Add(s_t1_panel);
|
||||
s_panel->AddSpacer(8);
|
||||
s_panel->Add(s_t3_panel);
|
||||
s_panel->AddSpacer(8);
|
||||
s_panel->Add(s_t2_panel);
|
||||
s_panel->AddSpacer(16);
|
||||
s_panel->Add(s_b_panel);
|
||||
|
||||
s_panel_margin_y->AddSpacer(12);
|
||||
s_panel_margin_y->Add(s_panel);
|
||||
s_panel_margin_y->AddSpacer(12);
|
||||
s_panel_margin_x->AddSpacer(12);
|
||||
s_panel_margin_x->Add(s_panel_margin_y);
|
||||
s_panel_margin_x->AddSpacer(12);
|
||||
|
||||
const auto cpu = _cpu.get();
|
||||
|
||||
const u32 cpu_offset = g_system == system_type::ps3 && cpu->id_type() != 1 ? static_cast<SPUThread&>(*cpu).offset : 0;
|
||||
|
||||
this->Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(InstructionEditorDialog::updatePreview));
|
||||
t2_instr->SetValue(wxString::Format("%08x", vm::ps3::read32(cpu_offset + pc).value()));
|
||||
|
||||
this->SetSizerAndFit(s_panel_margin_x);
|
||||
|
||||
if (this->ShowModal() == wxID_OK)
|
||||
{
|
||||
ulong opcode;
|
||||
if (!t2_instr->GetValue().ToULong(&opcode, 16))
|
||||
wxMessageBox("This instruction could not be parsed.\nNo changes were made.", "Error");
|
||||
else
|
||||
vm::ps3::write32(cpu_offset + pc, (u32)opcode);
|
||||
}
|
||||
}
|
||||
|
||||
void InstructionEditorDialog::updatePreview(wxCommandEvent& event)
|
||||
{
|
||||
ulong opcode;
|
||||
if (t2_instr->GetValue().ToULong(&opcode, 16))
|
||||
{
|
||||
if (g_system == system_type::psv)
|
||||
{
|
||||
t3_preview->SetLabel("Preview for ARMv7Thread not implemented yet.");
|
||||
}
|
||||
else
|
||||
{
|
||||
t3_preview->SetLabel("Preview disabled.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
t3_preview->SetLabel("Could not parse instruction.");
|
||||
}
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class InstructionEditorDialog : public wxDialog
|
||||
{
|
||||
u32 pc;
|
||||
CPUDisAsm* disasm;
|
||||
wxTextCtrl* t2_instr;
|
||||
wxStaticText* t3_preview;
|
||||
|
||||
public:
|
||||
std::weak_ptr<cpu_thread> cpu;
|
||||
|
||||
public:
|
||||
InstructionEditorDialog(wxPanel *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm);
|
||||
|
||||
void updatePreview(wxCommandEvent& event);
|
||||
};
|
@ -1,535 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/IdManager.h"
|
||||
#include "rpcs3.h"
|
||||
#include "InterpreterDisAsm.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
#include "Emu/Cell/RawSPUThread.h"
|
||||
#include "Emu/PSP2/ARMv7Thread.h"
|
||||
#include "Emu/Cell/PPUDisAsm.h"
|
||||
#include "Emu/Cell/SPUDisAsm.h"
|
||||
#include "Emu/PSP2/ARMv7DisAsm.h"
|
||||
#include "Emu/Cell/PPUInterpreter.h"
|
||||
|
||||
#include "InstructionEditor.h"
|
||||
#include "RegisterEditor.h"
|
||||
|
||||
//static const int show_lines = 30;
|
||||
#include <map>
|
||||
|
||||
std::map<u32, bool> g_breakpoints;
|
||||
|
||||
extern void ppu_breakpoint(u32 addr);
|
||||
|
||||
u32 InterpreterDisAsmFrame::GetPc() const
|
||||
{
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
if (!cpu)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (g_system)
|
||||
{
|
||||
case system_type::ps3: return cpu->id_type() == 1 ? static_cast<ppu_thread*>(cpu.get())->cia : static_cast<SPUThread*>(cpu.get())->pc;
|
||||
case system_type::psv: return static_cast<ARMv7Thread*>(cpu.get())->PC;
|
||||
}
|
||||
|
||||
return 0xabadcafe;
|
||||
}
|
||||
|
||||
u32 InterpreterDisAsmFrame::CentrePc(u32 pc) const
|
||||
{
|
||||
return pc/* - ((m_item_count / 2) * 4)*/;
|
||||
}
|
||||
|
||||
InterpreterDisAsmFrame::InterpreterDisAsmFrame(wxWindow* parent)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(500, 700), wxTAB_TRAVERSAL)
|
||||
, m_pc(0)
|
||||
, m_item_count(30)
|
||||
{
|
||||
wxBoxSizer* s_p_main = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_b_main = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
m_list = new wxListView(this);
|
||||
m_choice_units = new wxChoice(this, wxID_ANY);
|
||||
|
||||
wxButton* b_go_to_addr = new wxButton(this, wxID_ANY, "Go To Address");
|
||||
wxButton* b_go_to_pc = new wxButton(this, wxID_ANY, "Go To PC");
|
||||
|
||||
m_btn_step = new wxButton(this, wxID_ANY, "Step");
|
||||
m_btn_run = new wxButton(this, wxID_ANY, "Run");
|
||||
m_btn_pause = new wxButton(this, wxID_ANY, "Pause");
|
||||
|
||||
s_b_main->Add(b_go_to_addr, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(b_go_to_pc, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_btn_step, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_btn_run, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_btn_pause, wxSizerFlags().Border(wxALL, 5));
|
||||
s_b_main->Add(m_choice_units, wxSizerFlags().Border(wxALL, 5));
|
||||
|
||||
//Registers
|
||||
m_regs = new wxTextCtrl(this, wxID_ANY, wxEmptyString,
|
||||
wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_DONTWRAP | wxNO_BORDER | wxTE_RICH2);
|
||||
m_regs->SetEditable(false);
|
||||
|
||||
m_list->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
m_regs->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
|
||||
wxBoxSizer* s_w_list = new wxBoxSizer(wxHORIZONTAL);
|
||||
s_w_list->Add(m_list, 2, wxEXPAND | wxLEFT | wxDOWN, 5);
|
||||
s_w_list->Add(m_regs, 1, wxEXPAND | wxRIGHT | wxDOWN, 5);
|
||||
|
||||
s_p_main->Add(s_b_main, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
s_p_main->Add(s_w_list, 1, wxEXPAND | wxDOWN, 5);
|
||||
|
||||
SetSizer(s_p_main);
|
||||
Layout();
|
||||
|
||||
m_list->InsertColumn(0, "ASM");
|
||||
for (uint i = 0; i<m_item_count; ++i)
|
||||
{
|
||||
m_list->InsertItem(m_list->GetItemCount(), wxEmptyString);
|
||||
}
|
||||
|
||||
m_regs->Bind(wxEVT_TEXT, &InterpreterDisAsmFrame::OnUpdate, this);
|
||||
b_go_to_addr->Bind(wxEVT_BUTTON, &InterpreterDisAsmFrame::Show_Val, this);
|
||||
b_go_to_pc->Bind(wxEVT_BUTTON, &InterpreterDisAsmFrame::Show_PC, this);
|
||||
m_btn_step->Bind(wxEVT_BUTTON, &InterpreterDisAsmFrame::DoStep, this);
|
||||
m_btn_run->Bind(wxEVT_BUTTON, &InterpreterDisAsmFrame::DoRun, this);
|
||||
m_btn_pause->Bind(wxEVT_BUTTON, &InterpreterDisAsmFrame::DoPause, this);
|
||||
m_list->Bind(wxEVT_LIST_KEY_DOWN, &InterpreterDisAsmFrame::InstrKey, this);
|
||||
m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &InterpreterDisAsmFrame::DClick, this);
|
||||
m_list->Bind(wxEVT_MOUSEWHEEL, &InterpreterDisAsmFrame::MouseWheel, this);
|
||||
m_choice_units->Bind(wxEVT_CHOICE, &InterpreterDisAsmFrame::OnSelectUnit, this);
|
||||
|
||||
Bind(wxEVT_SIZE, &InterpreterDisAsmFrame::OnResize, this);
|
||||
Bind(wxEVT_KEY_DOWN, &InterpreterDisAsmFrame::OnKeyDown, this);
|
||||
|
||||
ShowAddr(CentrePc(m_pc));
|
||||
UpdateUnitList();
|
||||
}
|
||||
|
||||
InterpreterDisAsmFrame::~InterpreterDisAsmFrame()
|
||||
{
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::UpdateUI()
|
||||
{
|
||||
UpdateUnitList();
|
||||
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
if (!cpu)
|
||||
{
|
||||
if (m_last_pc != -1 || m_last_stat)
|
||||
{
|
||||
m_last_pc = -1;
|
||||
m_last_stat = 0;
|
||||
DoUpdate();
|
||||
|
||||
m_btn_run->Disable();
|
||||
m_btn_step->Disable();
|
||||
m_btn_pause->Disable();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const auto cia = GetPc();
|
||||
const auto state = cpu->state.load();
|
||||
|
||||
if (m_last_pc != cia || m_last_stat != static_cast<u32>(state))
|
||||
{
|
||||
m_last_pc = cia;
|
||||
m_last_stat = static_cast<u32>(state);
|
||||
DoUpdate();
|
||||
|
||||
if (test(state & cpu_flag::dbg_pause))
|
||||
{
|
||||
m_btn_run->Enable();
|
||||
m_btn_step->Enable();
|
||||
m_btn_pause->Disable();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_btn_run->Disable();
|
||||
m_btn_step->Disable();
|
||||
m_btn_pause->Enable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (Emu.IsStopped())
|
||||
{
|
||||
g_breakpoints.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::UpdateUnitList()
|
||||
{
|
||||
const u64 threads_created = cpu_thread::g_threads_created;
|
||||
const u64 threads_deleted = cpu_thread::g_threads_deleted;
|
||||
|
||||
if (threads_created != m_threads_created || threads_deleted != m_threads_deleted)
|
||||
{
|
||||
m_threads_created = threads_created;
|
||||
m_threads_deleted = threads_deleted;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Nothing to do
|
||||
return;
|
||||
}
|
||||
|
||||
m_choice_units->Freeze();
|
||||
m_choice_units->Clear();
|
||||
|
||||
const auto on_select = [&](u32, cpu_thread& cpu)
|
||||
{
|
||||
m_choice_units->Append(cpu.get_name(), &cpu);
|
||||
};
|
||||
|
||||
idm::select<ppu_thread>(on_select);
|
||||
idm::select<ARMv7Thread>(on_select);
|
||||
idm::select<RawSPUThread>(on_select);
|
||||
idm::select<SPUThread>(on_select);
|
||||
|
||||
m_choice_units->Thaw();
|
||||
m_choice_units->Update();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::OnSelectUnit(wxCommandEvent& event)
|
||||
{
|
||||
m_disasm.reset();
|
||||
|
||||
const auto on_select = [&](u32, cpu_thread& cpu)
|
||||
{
|
||||
return event.GetClientData() == &cpu;
|
||||
};
|
||||
|
||||
if (event.GetClientData() == nullptr)
|
||||
{
|
||||
// Nothing selected
|
||||
}
|
||||
else if (auto ppu = idm::select<ppu_thread>(on_select))
|
||||
{
|
||||
m_disasm = std::make_unique<PPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||
cpu = ppu.ptr;
|
||||
}
|
||||
else if (auto spu1 = idm::select<SPUThread>(on_select))
|
||||
{
|
||||
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||
cpu = spu1.ptr;
|
||||
}
|
||||
else if (auto rspu = idm::select<RawSPUThread>(on_select))
|
||||
{
|
||||
m_disasm = std::make_unique<SPUDisAsm>(CPUDisAsm_InterpreterMode);
|
||||
cpu = rspu.ptr;
|
||||
}
|
||||
else if (auto arm = idm::select<ARMv7Thread>(on_select))
|
||||
{
|
||||
m_disasm = std::make_unique<ARMv7DisAsm>(CPUDisAsm_InterpreterMode);
|
||||
cpu = arm.ptr;
|
||||
}
|
||||
|
||||
DoUpdate();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if (wxGetActiveWindow() != wxGetTopLevelParent(this))
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.ControlDown())
|
||||
{
|
||||
if (event.GetKeyCode() == WXK_SPACE)
|
||||
{
|
||||
wxCommandEvent ce;
|
||||
DoStep(ce);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case WXK_PAGEUP: ShowAddr(m_pc - (m_item_count * 2) * 4); return;
|
||||
case WXK_PAGEDOWN: ShowAddr(m_pc); return;
|
||||
case WXK_UP: ShowAddr(m_pc - (m_item_count + 1) * 4); return;
|
||||
case WXK_DOWN: ShowAddr(m_pc - (m_item_count - 1) * 4); return;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::OnResize(wxSizeEvent& event)
|
||||
{
|
||||
event.Skip();
|
||||
|
||||
if (0)
|
||||
{
|
||||
if (!m_list->GetItemCount())
|
||||
{
|
||||
m_list->InsertItem(m_list->GetItemCount(), wxEmptyString);
|
||||
}
|
||||
|
||||
int size = 0;
|
||||
m_list->DeleteAllItems();
|
||||
int item = 0;
|
||||
while (size < m_list->GetSize().GetHeight())
|
||||
{
|
||||
item = m_list->GetItemCount();
|
||||
m_list->InsertItem(item, wxEmptyString);
|
||||
wxRect rect;
|
||||
m_list->GetItemRect(item, rect);
|
||||
|
||||
size = rect.GetBottom();
|
||||
}
|
||||
|
||||
if (item)
|
||||
{
|
||||
m_list->DeleteItem(--item);
|
||||
}
|
||||
|
||||
m_item_count = item;
|
||||
ShowAddr(m_pc);
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::DoUpdate()
|
||||
{
|
||||
wxCommandEvent ce;
|
||||
Show_PC(ce);
|
||||
WriteRegs();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::ShowAddr(u32 addr)
|
||||
{
|
||||
m_pc = addr;
|
||||
m_list->Freeze();
|
||||
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
if (!cpu)
|
||||
{
|
||||
for (uint i = 0; i<m_item_count; ++i, m_pc += 4)
|
||||
{
|
||||
m_list->SetItem(i, 0, wxString::Format("[%08x] illegal address", m_pc));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
const u32 cpu_offset = g_system == system_type::ps3 && cpu->id_type() != 1 ? static_cast<SPUThread&>(*cpu).offset : 0;
|
||||
m_disasm->offset = (u8*)vm::base(cpu_offset);
|
||||
for (uint i = 0, count = 4; i<m_item_count; ++i, m_pc += count)
|
||||
{
|
||||
if (!vm::check_addr(cpu_offset + m_pc, 4))
|
||||
{
|
||||
m_list->SetItem(i, 0, wxString(IsBreakPoint(m_pc) ? ">>> " : " ") + wxString::Format("[%08x] illegal address", m_pc));
|
||||
count = 4;
|
||||
continue;
|
||||
}
|
||||
|
||||
count = m_disasm->disasm(m_disasm->dump_pc = m_pc);
|
||||
|
||||
m_list->SetItem(i, 0, wxString(IsBreakPoint(m_pc) ? ">>> " : " ") + fmt::FromUTF8(m_disasm->last_opcode));
|
||||
|
||||
wxColour colour;
|
||||
|
||||
if (test(cpu->state & cpu_state_pause) && m_pc == GetPc())
|
||||
{
|
||||
colour = wxColour("Green");
|
||||
}
|
||||
else
|
||||
{
|
||||
colour = wxColour(IsBreakPoint(m_pc) ? "Wheat" : "White");
|
||||
}
|
||||
|
||||
m_list->SetItemBackgroundColour(i, colour);
|
||||
}
|
||||
}
|
||||
|
||||
m_list->SetColumnWidth(0, -1);
|
||||
m_list->Thaw();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::WriteRegs()
|
||||
{
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
if (!cpu)
|
||||
{
|
||||
m_regs->Clear();
|
||||
return;
|
||||
}
|
||||
|
||||
m_regs->Freeze();
|
||||
m_regs->Clear();
|
||||
m_regs->WriteText(fmt::FromUTF8(cpu->dump()));
|
||||
m_regs->Thaw();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::OnUpdate(wxCommandEvent& event)
|
||||
{
|
||||
//WriteRegs();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::Show_PC(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (const auto cpu = this->cpu.lock()) ShowAddr(CentrePc(GetPc()));
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::DoRun(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
if (cpu && cpu->state.test_and_reset(cpu_flag::dbg_pause))
|
||||
{
|
||||
if (!test(cpu->state, cpu_flag::dbg_pause + cpu_flag::dbg_global_pause))
|
||||
{
|
||||
cpu->notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::DoPause(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (const auto cpu = this->cpu.lock())
|
||||
{
|
||||
cpu->state += cpu_flag::dbg_pause;
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::DoStep(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (const auto cpu = this->cpu.lock())
|
||||
{
|
||||
if (test(cpu_flag::dbg_pause, cpu->state.fetch_op([](bs_t<cpu_flag>& state)
|
||||
{
|
||||
state += cpu_flag::dbg_step;
|
||||
state -= cpu_flag::dbg_pause;
|
||||
})))
|
||||
{
|
||||
cpu->notify();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::InstrKey(wxListEvent& event)
|
||||
{
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
long i = m_list->GetFirstSelected();
|
||||
if (i < 0 || !cpu)
|
||||
{
|
||||
event.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const u32 start_pc = m_pc - m_item_count * 4;
|
||||
const u32 pc = start_pc + i * 4;
|
||||
|
||||
switch (event.GetKeyCode())
|
||||
{
|
||||
case 'E':
|
||||
{
|
||||
InstructionEditorDialog dlg(this, pc, cpu, m_disasm.get());
|
||||
DoUpdate();
|
||||
return;
|
||||
}
|
||||
case 'R':
|
||||
{
|
||||
RegisterEditorDialog dlg(this, pc, cpu, m_disasm.get());
|
||||
DoUpdate();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::DClick(wxListEvent& event)
|
||||
{
|
||||
long i = m_list->GetFirstSelected();
|
||||
if (i < 0) return;
|
||||
|
||||
const u32 start_pc = m_pc - m_item_count * 4;
|
||||
const u32 pc = start_pc + i * 4;
|
||||
//ConLog.Write("pc=0x%llx", pc);
|
||||
|
||||
if (IsBreakPoint(pc))
|
||||
{
|
||||
RemoveBreakPoint(pc);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBreakPoint(pc);
|
||||
}
|
||||
|
||||
ShowAddr(start_pc);
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::MouseWheel(wxMouseEvent& event)
|
||||
{
|
||||
const int value = (event.m_wheelRotation / event.m_wheelDelta);
|
||||
|
||||
ShowAddr(m_pc - (event.ControlDown() ? m_item_count * (value + 1) : m_item_count + value) * 4);
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
bool InterpreterDisAsmFrame::IsBreakPoint(u32 pc)
|
||||
{
|
||||
return g_breakpoints.count(pc) != 0;
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::AddBreakPoint(u32 pc)
|
||||
{
|
||||
g_breakpoints.emplace(pc, false);
|
||||
ppu_breakpoint(pc);
|
||||
}
|
||||
|
||||
void InterpreterDisAsmFrame::RemoveBreakPoint(u32 pc)
|
||||
{
|
||||
g_breakpoints.erase(pc);
|
||||
ppu_breakpoint(pc);
|
||||
}
|
@ -1,55 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/CPU/CPUDisAsm.h"
|
||||
|
||||
class InterpreterDisAsmFrame : public wxPanel
|
||||
{
|
||||
wxListView* m_list;
|
||||
std::unique_ptr<CPUDisAsm> m_disasm;
|
||||
u32 m_pc;
|
||||
wxTextCtrl* m_regs;
|
||||
wxButton* m_btn_step;
|
||||
wxButton* m_btn_run;
|
||||
wxButton* m_btn_pause;
|
||||
u32 m_item_count;
|
||||
wxChoice* m_choice_units;
|
||||
|
||||
u64 m_threads_created = 0;
|
||||
u64 m_threads_deleted = 0;
|
||||
u32 m_last_pc = -1;
|
||||
u32 m_last_stat = 0;
|
||||
|
||||
public:
|
||||
std::weak_ptr<cpu_thread> cpu;
|
||||
|
||||
public:
|
||||
InterpreterDisAsmFrame(wxWindow* parent);
|
||||
~InterpreterDisAsmFrame();
|
||||
|
||||
void UpdateUI();
|
||||
void UpdateUnitList();
|
||||
|
||||
u32 GetPc() const;
|
||||
u32 CentrePc(u32 pc) const;
|
||||
void OnSelectUnit(wxCommandEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnResize(wxSizeEvent& event);
|
||||
void DoUpdate();
|
||||
void ShowAddr(u32 addr);
|
||||
void WriteRegs();
|
||||
|
||||
void OnUpdate(wxCommandEvent& event);
|
||||
void Show_Val(wxCommandEvent& event);
|
||||
void Show_PC(wxCommandEvent& event);
|
||||
void DoRun(wxCommandEvent& event);
|
||||
void DoPause(wxCommandEvent& event);
|
||||
void DoStep(wxCommandEvent& event);
|
||||
void InstrKey(wxListEvent& event);
|
||||
void DClick(wxListEvent& event);
|
||||
|
||||
void MouseWheel(wxMouseEvent& event);
|
||||
bool IsBreakPoint(u32 pc);
|
||||
void AddBreakPoint(u32 pc);
|
||||
void RemoveBreakPoint(u32 pc);
|
||||
};
|
@ -1,305 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "Emu/IdManager.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
#include "Emu/Cell/RawSPUThread.h"
|
||||
#include "Emu/Cell/lv2/sys_lwmutex.h"
|
||||
#include "Emu/Cell/lv2/sys_lwcond.h"
|
||||
#include "Emu/Cell/lv2/sys_mutex.h"
|
||||
#include "Emu/Cell/lv2/sys_cond.h"
|
||||
#include "Emu/Cell/lv2/sys_semaphore.h"
|
||||
#include "Emu/Cell/lv2/sys_event.h"
|
||||
#include "Emu/Cell/lv2/sys_event_flag.h"
|
||||
#include "Emu/Cell/lv2/sys_rwlock.h"
|
||||
#include "Emu/Cell/lv2/sys_prx.h"
|
||||
#include "Emu/Cell/lv2/sys_memory.h"
|
||||
#include "Emu/Cell/lv2/sys_mmapper.h"
|
||||
#include "Emu/Cell/lv2/sys_spu.h"
|
||||
#include "Emu/Cell/lv2/sys_interrupt.h"
|
||||
#include "Emu/Cell/lv2/sys_timer.h"
|
||||
#include "Emu/Cell/lv2/sys_process.h"
|
||||
#include "Emu/Cell/lv2/sys_fs.h"
|
||||
|
||||
#include "KernelExplorer.h"
|
||||
|
||||
KernelExplorer::KernelExplorer(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "Kernel Explorer", wxDefaultPosition, wxSize(700, 450))
|
||||
{
|
||||
this->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
|
||||
wxBoxSizer* s_panel = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Buttons
|
||||
wxBoxSizer* box_buttons = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxButton* b_refresh = new wxButton(this, wxID_ANY, "Refresh");
|
||||
box_buttons->AddSpacer(10);
|
||||
box_buttons->Add(b_refresh);
|
||||
box_buttons->AddSpacer(10);
|
||||
|
||||
wxStaticBoxSizer* box_tree = new wxStaticBoxSizer(wxHORIZONTAL, this, "Kernel");
|
||||
m_tree = new wxTreeCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(600,300));
|
||||
box_tree->Add(m_tree);
|
||||
|
||||
// Merge and display everything
|
||||
s_panel->AddSpacer(10);
|
||||
s_panel->Add(box_buttons);
|
||||
s_panel->AddSpacer(10);
|
||||
s_panel->Add(box_tree, 0, 0, 100);
|
||||
s_panel->AddSpacer(10);
|
||||
SetSizerAndFit(s_panel);
|
||||
|
||||
// Events
|
||||
b_refresh->Bind(wxEVT_BUTTON, &KernelExplorer::OnRefresh, this);
|
||||
|
||||
// Fill the wxTreeCtrl
|
||||
Update();
|
||||
};
|
||||
|
||||
void KernelExplorer::Update()
|
||||
{
|
||||
m_tree->DeleteAllItems();
|
||||
|
||||
const auto vm_block = vm::get(vm::user_space);
|
||||
|
||||
if (!vm_block)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const u32 total_memory_usage = vm_block->used();
|
||||
|
||||
const auto& root = m_tree->AddRoot(fmt::format("Process, ID = 0x00000001, Total Memory Usage = 0x%x (%0.2f MB)", total_memory_usage, (float)total_memory_usage / (1024 * 1024)));
|
||||
|
||||
union name64
|
||||
{
|
||||
u64 u64_data;
|
||||
char string[8];
|
||||
|
||||
name64(u64 data)
|
||||
: u64_data(data & 0x00ffffffffffffffull)
|
||||
{
|
||||
}
|
||||
|
||||
const char* operator+() const
|
||||
{
|
||||
return string;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: FileSystem
|
||||
|
||||
struct lv2_obj_rec
|
||||
{
|
||||
wxTreeItemId node;
|
||||
u32 count{0};
|
||||
|
||||
lv2_obj_rec() = default;
|
||||
lv2_obj_rec(wxTreeItemId node)
|
||||
: node(node)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
std::vector<lv2_obj_rec> lv2_types(256);
|
||||
lv2_types[SYS_MEM_OBJECT] = m_tree->AppendItem(root, "Memory");
|
||||
lv2_types[SYS_MUTEX_OBJECT] = m_tree->AppendItem(root, "Mutexes");
|
||||
lv2_types[SYS_COND_OBJECT] = m_tree->AppendItem(root, "Condition Variables");
|
||||
lv2_types[SYS_RWLOCK_OBJECT] = m_tree->AppendItem(root, "Reader Writer Locks");
|
||||
lv2_types[SYS_INTR_TAG_OBJECT] = m_tree->AppendItem(root, "Interrupt Tags");
|
||||
lv2_types[SYS_INTR_SERVICE_HANDLE_OBJECT] = m_tree->AppendItem(root, "Interrupt Service Handles");
|
||||
lv2_types[SYS_EVENT_QUEUE_OBJECT] = m_tree->AppendItem(root, "Event Queues");
|
||||
lv2_types[SYS_EVENT_PORT_OBJECT] = m_tree->AppendItem(root, "Event Ports");
|
||||
lv2_types[SYS_TRACE_OBJECT] = m_tree->AppendItem(root, "Traces");
|
||||
lv2_types[SYS_SPUIMAGE_OBJECT] = m_tree->AppendItem(root, "SPU Images");
|
||||
lv2_types[SYS_PRX_OBJECT] = m_tree->AppendItem(root, "Modules");
|
||||
lv2_types[SYS_SPUPORT_OBJECT] = m_tree->AppendItem(root, "SPU Ports");
|
||||
lv2_types[SYS_LWMUTEX_OBJECT] = m_tree->AppendItem(root, "Light Weight Mutexes");
|
||||
lv2_types[SYS_TIMER_OBJECT] = m_tree->AppendItem(root, "Timers");
|
||||
lv2_types[SYS_SEMAPHORE_OBJECT] = m_tree->AppendItem(root, "Semaphores");
|
||||
lv2_types[SYS_LWCOND_OBJECT] = m_tree->AppendItem(root, "Light Weight Condition Variables");
|
||||
lv2_types[SYS_EVENT_FLAG_OBJECT] = m_tree->AppendItem(root, "Event Flags");
|
||||
|
||||
idm::select<lv2_obj>([&](u32 id, lv2_obj& obj)
|
||||
{
|
||||
lv2_types[id >> 24].count++;
|
||||
|
||||
if (auto& node = lv2_types[id >> 24].node) switch (id >> 24)
|
||||
{
|
||||
case SYS_MEM_OBJECT:
|
||||
{
|
||||
auto& mem = static_cast<lv2_memory&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Memory: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_MUTEX_OBJECT:
|
||||
{
|
||||
auto& mutex = static_cast<lv2_mutex&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Mutex: ID = 0x%08x \"%s\",%s Owner = 0x%x, Locks = %u, Conds = %u, Wq = %zu", id, +name64(mutex.name),
|
||||
mutex.recursive == SYS_SYNC_RECURSIVE ? " Recursive," : "", mutex.owner >> 1, +mutex.lock_count, +mutex.cond_count, mutex.sq.size()));
|
||||
break;
|
||||
}
|
||||
case SYS_COND_OBJECT:
|
||||
{
|
||||
auto& cond = static_cast<lv2_cond&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Cond: ID = 0x%08x \"%s\", Waiters = %u", id, +name64(cond.name), +cond.waiters));
|
||||
break;
|
||||
}
|
||||
case SYS_RWLOCK_OBJECT:
|
||||
{
|
||||
auto& rw = static_cast<lv2_rwlock&>(obj);
|
||||
const s64 val = rw.owner;
|
||||
m_tree->AppendItem(node, fmt::format("RW Lock: ID = 0x%08x \"%s\", Owner = 0x%x(%d), Rq = %zu, Wq = %zu", id, +name64(rw.name),
|
||||
std::max<s64>(0, val >> 1), -std::min<s64>(0, val >> 1), rw.rq.size(), rw.wq.size()));
|
||||
break;
|
||||
}
|
||||
case SYS_INTR_TAG_OBJECT:
|
||||
{
|
||||
auto& tag = static_cast<lv2_int_tag&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Intr Tag: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_INTR_SERVICE_HANDLE_OBJECT:
|
||||
{
|
||||
auto& serv = static_cast<lv2_int_serv&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Intr Svc: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_EVENT_QUEUE_OBJECT:
|
||||
{
|
||||
auto& eq = static_cast<lv2_event_queue&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Event Queue: ID = 0x%08x \"%s\", %s, Key = %#llx, Events = %zu/%d, Waiters = %zu", id, +name64(eq.name),
|
||||
eq.type == SYS_SPU_QUEUE ? "SPU" : "PPU", eq.key, eq.events.size(), eq.size, eq.sq.size()));
|
||||
break;
|
||||
}
|
||||
case SYS_EVENT_PORT_OBJECT:
|
||||
{
|
||||
auto& ep = static_cast<lv2_event_port&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Event Port: ID = 0x%08x, Name = %#llx", id, ep.name));
|
||||
break;
|
||||
}
|
||||
case SYS_TRACE_OBJECT:
|
||||
{
|
||||
m_tree->AppendItem(node, fmt::format("Trace: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_SPUIMAGE_OBJECT:
|
||||
{
|
||||
m_tree->AppendItem(node, fmt::format("SPU Image: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_PRX_OBJECT:
|
||||
{
|
||||
auto& prx = static_cast<lv2_prx&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("PRX: ID = 0x%08x '%s'", id, prx.name));
|
||||
break;
|
||||
}
|
||||
case SYS_SPUPORT_OBJECT:
|
||||
{
|
||||
m_tree->AppendItem(node, fmt::format("SPU Port: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_LWMUTEX_OBJECT:
|
||||
{
|
||||
auto& lwm = static_cast<lv2_lwmutex&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("LWMutex: ID = 0x%08x \"%s\", Wq = %zu", id, +name64(lwm.name), lwm.sq.size()));
|
||||
break;
|
||||
}
|
||||
case SYS_TIMER_OBJECT:
|
||||
{
|
||||
auto& timer = static_cast<lv2_timer&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Timer: ID = 0x%08x", id));
|
||||
break;
|
||||
}
|
||||
case SYS_SEMAPHORE_OBJECT:
|
||||
{
|
||||
auto& sema = static_cast<lv2_sema&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Semaphore: ID = 0x%08x \"%s\", Count = %d, Max Count = %d, Waiters = %#zu", id, +name64(sema.name),
|
||||
sema.val.load(), sema.max, sema.sq.size()));
|
||||
break;
|
||||
}
|
||||
case SYS_LWCOND_OBJECT:
|
||||
{
|
||||
auto& lwc = static_cast<lv2_cond&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("LWCond: ID = 0x%08x \"%s\", Waiters = %zu", id, +name64(lwc.name), +lwc.waiters));
|
||||
break;
|
||||
}
|
||||
case SYS_EVENT_FLAG_OBJECT:
|
||||
{
|
||||
auto& ef = static_cast<lv2_event_flag&>(obj);
|
||||
m_tree->AppendItem(node, fmt::format("Event Flag: ID = 0x%08x \"%s\", Type = 0x%x, Pattern = 0x%llx, Wq = %zu", id, +name64(ef.name),
|
||||
ef.type, ef.pattern.load(), +ef.waiters));
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
m_tree->AppendItem(node, fmt::format("Unknown object: ID = 0x%08x", id));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
lv2_types.emplace_back(m_tree->AppendItem(root, "Memory Containers"));
|
||||
|
||||
idm::select<lv2_memory_container>([&](u32 id, lv2_memory_container&)
|
||||
{
|
||||
lv2_types.back().count++;
|
||||
m_tree->AppendItem(lv2_types.back().node, fmt::format("Memory Container: ID = 0x%08x", id));
|
||||
});
|
||||
|
||||
lv2_types.emplace_back(m_tree->AppendItem(root, "PPU Threads"));
|
||||
|
||||
idm::select<ppu_thread>([&](u32 id, ppu_thread& ppu)
|
||||
{
|
||||
lv2_types.back().count++;
|
||||
m_tree->AppendItem(lv2_types.back().node, fmt::format("PPU Thread: ID = 0x%08x '%s'", id, ppu.get_name()));
|
||||
});
|
||||
|
||||
lv2_types.emplace_back(m_tree->AppendItem(root, "SPU Threads"));
|
||||
|
||||
idm::select<SPUThread>([&](u32 id, SPUThread& spu)
|
||||
{
|
||||
lv2_types.back().count++;
|
||||
m_tree->AppendItem(lv2_types.back().node, fmt::format("SPU Thread: ID = 0x%08x '%s'", id, spu.get_name()));
|
||||
});
|
||||
|
||||
lv2_types.emplace_back(m_tree->AppendItem(root, "SPU Thread Groups"));
|
||||
|
||||
idm::select<lv2_spu_group>([&](u32 id, lv2_spu_group& tg)
|
||||
{
|
||||
lv2_types.back().count++;
|
||||
m_tree->AppendItem(lv2_types.back().node, fmt::format("SPU Thread Group: ID = 0x%08x '%s'", id, tg.name.c_str()));
|
||||
});
|
||||
|
||||
lv2_types.emplace_back(m_tree->AppendItem(root, "File Descriptors"));
|
||||
|
||||
idm::select<lv2_fs_object>([&](u32 id, lv2_fs_object& fo)
|
||||
{
|
||||
lv2_types.back().count++;
|
||||
m_tree->AppendItem(lv2_types.back().node, fmt::format("FD: ID = 0x%08x '%s'", id, fo.name.data()));
|
||||
});
|
||||
|
||||
for (auto&& entry : lv2_types)
|
||||
{
|
||||
if (entry.node && entry.count)
|
||||
{
|
||||
// Append object count
|
||||
m_tree->SetItemText(entry.node, m_tree->GetItemText(entry.node) + fmt::format(" (%zu)", entry.count));
|
||||
}
|
||||
else if (entry.node)
|
||||
{
|
||||
// Delete node otherwise
|
||||
m_tree->Delete(entry.node);
|
||||
}
|
||||
}
|
||||
|
||||
// RawSPU Threads (TODO)
|
||||
|
||||
m_tree->Expand(root);
|
||||
}
|
||||
|
||||
void KernelExplorer::OnRefresh(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Update();
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class KernelExplorer : public wxDialog
|
||||
{
|
||||
wxTreeCtrl* m_tree;
|
||||
|
||||
public:
|
||||
KernelExplorer(wxWindow* parent);
|
||||
void Update();
|
||||
|
||||
void OnRefresh(wxCommandEvent& WXUNUSED(event));
|
||||
};
|
@ -1,680 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "rpcs3.h"
|
||||
#include "MainFrame.h"
|
||||
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "Gui/PADManager.h"
|
||||
#include "Gui/AboutDialog.h"
|
||||
#include "Gui/GameViewer.h"
|
||||
#include "Gui/AutoPauseManager.h"
|
||||
#include "Gui/SaveDataUtility.h"
|
||||
#include "Gui/KernelExplorer.h"
|
||||
#include "Gui/MemoryViewer.h"
|
||||
#include "Gui/RSXDebugger.h"
|
||||
#include "Gui/SettingsDialog.h"
|
||||
#include "Gui/MemoryStringSearcher.h"
|
||||
#include "Gui/CgDisasm.h"
|
||||
|
||||
#include "Crypto/unpkg.h"
|
||||
#include "Crypto/unself.h"
|
||||
|
||||
#include "Loader/PUP.h"
|
||||
#include "Loader/TAR.h"
|
||||
|
||||
#include "Utilities/Thread.h"
|
||||
#include "Utilities/StrUtil.h"
|
||||
|
||||
#include <thread>
|
||||
|
||||
#ifndef _WIN32
|
||||
#include "frame_icon.xpm"
|
||||
#endif
|
||||
|
||||
enum IDs
|
||||
{
|
||||
id_boot_elf = 0x555,
|
||||
id_boot_game,
|
||||
id_boot_install_pkg,
|
||||
id_boot_exit,
|
||||
id_sys_pause,
|
||||
id_sys_stop,
|
||||
id_sys_send_open_menu,
|
||||
id_sys_send_exit,
|
||||
id_config_emu,
|
||||
id_config_pad,
|
||||
id_config_vfs_manager,
|
||||
id_config_vhdd_manager,
|
||||
id_config_autopause_manager,
|
||||
id_config_savedata_manager,
|
||||
id_tools_compiler,
|
||||
id_tools_kernel_explorer,
|
||||
id_tools_memory_viewer,
|
||||
id_tools_rsx_debugger,
|
||||
id_tools_string_search,
|
||||
id_tools_decrypt_sprx_libraries,
|
||||
id_tools_install_firmware,
|
||||
id_tools_cg_disasm,
|
||||
id_help_about,
|
||||
id_update_dbg
|
||||
};
|
||||
|
||||
wxString GetPaneName()
|
||||
{
|
||||
static int pane_num = 0;
|
||||
return wxString::Format("Pane_%d", pane_num++);
|
||||
}
|
||||
|
||||
MainFrame::MainFrame()
|
||||
: FrameBase(nullptr, wxID_ANY, "", "MainFrame", wxSize(900, 600))
|
||||
, m_timer(this, id_update_dbg)
|
||||
, m_aui_mgr(this)
|
||||
, m_sys_menu_opened(false)
|
||||
{
|
||||
|
||||
SetLabel("RPCS3 v" + rpcs3::version.to_string());
|
||||
|
||||
wxMenuBar* menubar = new wxMenuBar();
|
||||
|
||||
wxMenu* menu_boot = new wxMenu();
|
||||
menubar->Append(menu_boot, "&Boot");
|
||||
menu_boot->Append(id_boot_elf, "Boot &ELF / SELF file");
|
||||
menu_boot->Append(id_boot_game, "Boot &game");
|
||||
menu_boot->AppendSeparator();
|
||||
menu_boot->Append(id_boot_install_pkg, "&Install PKG");
|
||||
menu_boot->AppendSeparator();
|
||||
menu_boot->Append(id_boot_exit, "&Exit");
|
||||
|
||||
wxMenu* menu_sys = new wxMenu();
|
||||
menubar->Append(menu_sys, "&System");
|
||||
menu_sys->Append(id_sys_pause, "&Pause")->Enable(false);
|
||||
menu_sys->Append(id_sys_stop, "&Stop\tCtrl + S")->Enable(false);
|
||||
menu_sys->AppendSeparator();
|
||||
menu_sys->Append(id_sys_send_open_menu, "Send &open system menu cmd")->Enable(false);
|
||||
menu_sys->Append(id_sys_send_exit, "Send &exit cmd")->Enable(false);
|
||||
|
||||
wxMenu* menu_conf = new wxMenu();
|
||||
menubar->Append(menu_conf, "&Config");
|
||||
menu_conf->Append(id_config_emu, "&Settings");
|
||||
menu_conf->Append(id_config_pad, "&Keyboard Settings");
|
||||
menu_conf->AppendSeparator();
|
||||
menu_conf->Append(id_config_autopause_manager, "&Auto Pause Settings")->Enable(false);
|
||||
//menu_conf->AppendSeparator();
|
||||
//menu_conf->Append(id_config_vfs_manager, "Virtual &File System Manager");
|
||||
//menu_conf->Append(id_config_vhdd_manager, "Virtual &HDD Manager");
|
||||
//menu_conf->Append(id_config_savedata_manager, "Save &Data Utility");
|
||||
|
||||
wxMenu* menu_tools = new wxMenu();
|
||||
menubar->Append(menu_tools, "&Tools");
|
||||
//menu_tools->Append(id_tools_compiler, "&ELF Compiler");
|
||||
menu_tools->Append(id_tools_cg_disasm, "&Cg Disasm")->Enable();
|
||||
menu_tools->Append(id_tools_kernel_explorer, "&Kernel Explorer")->Enable(false);
|
||||
menu_tools->Append(id_tools_memory_viewer, "&Memory Viewer")->Enable(false);
|
||||
menu_tools->Append(id_tools_rsx_debugger, "&RSX Debugger")->Enable(false);
|
||||
menu_tools->Append(id_tools_string_search, "&String Search")->Enable(false);
|
||||
menu_tools->AppendSeparator();
|
||||
menu_tools->Append(id_tools_decrypt_sprx_libraries, "&Decrypt SPRX libraries");
|
||||
menu_tools->Append(id_tools_install_firmware, "&Install Firmware");
|
||||
|
||||
wxMenu* menu_help = new wxMenu();
|
||||
menubar->Append(menu_help, "&Help");
|
||||
menu_help->Append(id_help_about, "&About...");
|
||||
|
||||
SetMenuBar(menubar);
|
||||
SetIcon(wxICON(frame_icon));
|
||||
|
||||
// Panels
|
||||
m_log_frame = new LogFrame(this);
|
||||
m_game_viewer = new GameViewer(this);
|
||||
m_debugger_frame = new DebuggerPanel(this);
|
||||
|
||||
AddPane(m_game_viewer, "Game List", wxAUI_DOCK_CENTRE);
|
||||
AddPane(m_log_frame, "Log", wxAUI_DOCK_BOTTOM);
|
||||
AddPane(m_debugger_frame, "Debugger", wxAUI_DOCK_RIGHT);
|
||||
|
||||
// Events
|
||||
Bind(wxEVT_MENU, &MainFrame::BootElf, this, id_boot_elf);
|
||||
Bind(wxEVT_MENU, &MainFrame::BootGame, this, id_boot_game);
|
||||
Bind(wxEVT_MENU, &MainFrame::InstallPkg, this, id_boot_install_pkg);
|
||||
Bind(wxEVT_MENU, [](wxCommandEvent&){ wxGetApp().Exit(); }, id_boot_exit);
|
||||
|
||||
Bind(wxEVT_MENU, &MainFrame::Pause, this, id_sys_pause);
|
||||
Bind(wxEVT_MENU, &MainFrame::Stop, this, id_sys_stop);
|
||||
Bind(wxEVT_MENU, &MainFrame::SendOpenCloseSysMenu, this, id_sys_send_open_menu);
|
||||
Bind(wxEVT_MENU, &MainFrame::SendExit, this, id_sys_send_exit);
|
||||
|
||||
Bind(wxEVT_MENU, &MainFrame::Config, this, id_config_emu);
|
||||
Bind(wxEVT_MENU, &MainFrame::ConfigPad, this, id_config_pad);
|
||||
Bind(wxEVT_MENU, &MainFrame::ConfigAutoPause, this, id_config_autopause_manager);
|
||||
Bind(wxEVT_MENU, &MainFrame::ConfigVFS, this, id_config_vfs_manager);
|
||||
Bind(wxEVT_MENU, &MainFrame::ConfigVHDD, this, id_config_vhdd_manager);
|
||||
Bind(wxEVT_MENU, &MainFrame::ConfigSaveData, this, id_config_savedata_manager);
|
||||
Bind(wxEVT_MENU, &MainFrame::DecryptSPRXLibraries, this, id_tools_decrypt_sprx_libraries);
|
||||
Bind(wxEVT_MENU, &MainFrame::InstallFirmware, this, id_tools_install_firmware);
|
||||
|
||||
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenELFCompiler, this, id_tools_compiler);
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenKernelExplorer, this, id_tools_kernel_explorer);
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenMemoryViewer, this, id_tools_memory_viewer);
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenRSXDebugger, this, id_tools_rsx_debugger);
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenStringSearch, this, id_tools_string_search);
|
||||
Bind(wxEVT_MENU, &MainFrame::OpenCgDisasm, this, id_tools_cg_disasm);
|
||||
|
||||
Bind(wxEVT_MENU, &MainFrame::AboutDialogHandler, this, id_help_about);
|
||||
|
||||
Bind(wxEVT_MENU, &MainFrame::UpdateUI, this, id_update_dbg);
|
||||
Bind(wxEVT_TIMER, &MainFrame::UpdateUI, this, id_update_dbg);
|
||||
Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent&)
|
||||
{
|
||||
DoSettings(false);
|
||||
TheApp->Exit();
|
||||
});
|
||||
|
||||
wxGetApp().Bind(wxEVT_KEY_DOWN, &MainFrame::OnKeyDown, this);
|
||||
|
||||
// Check for updates every ~10 ms
|
||||
m_timer.Start(10);
|
||||
}
|
||||
|
||||
MainFrame::~MainFrame()
|
||||
{
|
||||
m_aui_mgr.UnInit();
|
||||
}
|
||||
|
||||
void MainFrame::AddPane(wxWindow* wind, const wxString& caption, int flags)
|
||||
{
|
||||
wind->SetSize(-1, 300);
|
||||
m_aui_mgr.AddPane(wind, wxAuiPaneInfo().Name(GetPaneName()).Caption(caption).Direction(flags).CloseButton(false).MaximizeButton());
|
||||
}
|
||||
|
||||
void MainFrame::DoSettings(bool load)
|
||||
{
|
||||
auto&& cfg = g_gui_cfg[ini_name]["aui"];
|
||||
|
||||
if (load)
|
||||
{
|
||||
const auto& perspective = fmt::FromUTF8(cfg.Scalar());
|
||||
|
||||
m_aui_mgr.LoadPerspective(perspective.empty() ? m_aui_mgr.SavePerspective() : perspective);
|
||||
}
|
||||
else
|
||||
{
|
||||
cfg = fmt::ToUTF8(m_aui_mgr.SavePerspective());
|
||||
save_gui_cfg();
|
||||
}
|
||||
}
|
||||
|
||||
void MainFrame::BootGame(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
bool stopped = false;
|
||||
|
||||
if (Emu.IsRunning())
|
||||
{
|
||||
Emu.Pause();
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
wxDirDialog ctrl(this, L"Select game folder", wxEmptyString);
|
||||
|
||||
if (ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
if (stopped) Emu.Resume();
|
||||
return;
|
||||
}
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
const std::string path = fmt::ToUTF8(ctrl.GetPath());
|
||||
|
||||
if (!Emu.BootGame(path))
|
||||
{
|
||||
LOG_ERROR(GENERAL, "PS3 executable not found in selected folder (%s)", path);
|
||||
}
|
||||
}
|
||||
|
||||
void MainFrame::InstallPkg(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog ctrl(this, L"Select PKG", wxEmptyString, wxEmptyString, "PKG files (*.pkg)|*.pkg|All files (*.*)|*.*", wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
if (ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
const std::string path = fmt::ToUTF8(ctrl.GetPath());
|
||||
|
||||
// Open PKG file
|
||||
fs::file pkg_f(path);
|
||||
|
||||
if (!pkg_f || pkg_f.size() < 64)
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG: Failed to open %s", path);
|
||||
return;
|
||||
}
|
||||
|
||||
// Get title ID
|
||||
std::vector<char> title_id(9);
|
||||
pkg_f.seek(55);
|
||||
pkg_f.read(title_id);
|
||||
pkg_f.seek(0);
|
||||
|
||||
// Get full path
|
||||
const auto& local_path = Emu.GetGameDir() + std::string(std::begin(title_id), std::end(title_id));
|
||||
|
||||
if (!fs::create_dir(local_path))
|
||||
{
|
||||
if (fs::is_dir(local_path))
|
||||
{
|
||||
if (wxMessageDialog(this, "Another installation found. Do you want to overwrite it?", "PKG Decrypter / Installer", wxYES_NO | wxCENTRE).ShowModal() != wxID_YES)
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG: Cancelled installation to existing directory %s", local_path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(LOADER, "PKG: Could not create the installation directory %s", local_path);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
wxProgressDialog pdlg("PKG Installer", "Please wait, unpacking...", 1000, this, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
|
||||
|
||||
// Synchronization variable
|
||||
atomic_t<double> progress(0.);
|
||||
{
|
||||
// Run PKG unpacking asynchronously
|
||||
scope_thread worker("PKG Installer", [&]
|
||||
{
|
||||
if (pkg_install(pkg_f, local_path + '/', progress))
|
||||
{
|
||||
progress = 1.;
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: Ask user to delete files on cancellation/failure?
|
||||
progress = -1.;
|
||||
});
|
||||
|
||||
// Wait for the completion
|
||||
while (std::this_thread::sleep_for(5ms), std::abs(progress) < 1.)
|
||||
{
|
||||
// Update progress window
|
||||
if (!pdlg.Update(static_cast<int>(progress * pdlg.GetRange())))
|
||||
{
|
||||
// Installation cancelled (signal with negative value)
|
||||
progress -= 1.;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (progress > 0.)
|
||||
{
|
||||
pdlg.Update(pdlg.GetRange());
|
||||
std::this_thread::sleep_for(100ms);
|
||||
}
|
||||
}
|
||||
|
||||
pdlg.Close();
|
||||
|
||||
if (progress >= 1.)
|
||||
{
|
||||
// Refresh game list
|
||||
m_game_viewer->Refresh();
|
||||
}
|
||||
}
|
||||
|
||||
void MainFrame::BootElf(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
bool stopped = false;
|
||||
|
||||
if(Emu.IsRunning())
|
||||
{
|
||||
Emu.Pause();
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
wxFileDialog ctrl(this, L"Select (S)ELF", wxEmptyString, wxEmptyString,
|
||||
"(S)ELF files (*BOOT.BIN;*.elf;*.self)|*BOOT.BIN;*.elf;*.self"
|
||||
"|ELF files (BOOT.BIN;*.elf)|BOOT.BIN;*.elf"
|
||||
"|SELF files (EBOOT.BIN;*.self)|EBOOT.BIN;*.self"
|
||||
"|BOOT files (*BOOT.BIN)|*BOOT.BIN"
|
||||
"|BIN files (*.bin)|*.bin"
|
||||
"|All files (*.*)|*.*",
|
||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
|
||||
|
||||
if(ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
if(stopped) Emu.Resume();
|
||||
return;
|
||||
}
|
||||
|
||||
LOG_NOTICE(LOADER, "(S)ELF: booting...");
|
||||
|
||||
Emu.Stop();
|
||||
Emu.SetPath(fmt::ToUTF8(ctrl.GetPath()));
|
||||
Emu.Load();
|
||||
|
||||
if (Emu.IsReady()) LOG_SUCCESS(LOADER, "(S)ELF: boot done.");
|
||||
}
|
||||
|
||||
void MainFrame::DecryptSPRXLibraries(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog ctrl(this, L"Select SPRX files", wxEmptyString, wxEmptyString,
|
||||
"SPRX files (*.sprx)|*sprx",
|
||||
wxFD_OPEN | wxFD_MULTIPLE);
|
||||
|
||||
if (ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
wxArrayString modules;
|
||||
ctrl.GetPaths(modules);
|
||||
|
||||
LOG_NOTICE(GENERAL, "Decrypting SPRX libraries...");
|
||||
|
||||
for (const wxString& module : modules)
|
||||
{
|
||||
std::string prx_path = fmt::ToUTF8(module);
|
||||
const std::string& prx_dir = fs::get_parent_dir(prx_path);
|
||||
|
||||
fs::file elf_file(prx_path);
|
||||
|
||||
if (elf_file && elf_file.size() >= 4 && elf_file.read<u32>() == "SCE\0"_u32)
|
||||
{
|
||||
const std::size_t prx_ext_pos = prx_path.find_last_of('.');
|
||||
const std::string& prx_ext = fmt::to_upper(prx_path.substr(prx_ext_pos != -1 ? prx_ext_pos : prx_path.size()));
|
||||
const std::string& prx_name = prx_path.substr(prx_dir.size());
|
||||
|
||||
elf_file = decrypt_self(std::move(elf_file));
|
||||
|
||||
prx_path.erase(prx_path.size() - 4, 1); // change *.sprx to *.prx
|
||||
|
||||
if (elf_file)
|
||||
{
|
||||
if (fs::file new_file{prx_path, fs::rewrite})
|
||||
{
|
||||
new_file.write(elf_file.to_string());
|
||||
LOG_SUCCESS(GENERAL, "Decrypted %s", prx_dir + prx_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Failed to create %s", prx_path);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Failed to decrypt %s", prx_dir + prx_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_NOTICE(GENERAL, "Finished decrypting all SPRX libraries.");
|
||||
}
|
||||
|
||||
void MainFrame::InstallFirmware(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxFileDialog ctrl(this, L"Select PS3UPDAT.PUP file", wxEmptyString, wxEmptyString,
|
||||
"PS3 update file (PS3UPDAT.PUP)|PS3UPDAT.PUP",
|
||||
wxFD_OPEN);
|
||||
|
||||
if (ctrl.ShowModal() == wxID_CANCEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Emu.Stop();
|
||||
|
||||
const std::string path = fmt::ToUTF8(ctrl.GetPath());
|
||||
|
||||
fs::file pup_f(path);
|
||||
pup_object pup(pup_f);
|
||||
if (!pup)
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error while installing firmware: PUP file is invalid.");
|
||||
wxMessageBox("Error while installing firmware: PUP file is invalid.", "Failure!", wxOK | wxICON_ERROR, this);
|
||||
return;
|
||||
}
|
||||
|
||||
fs::file update_files_f = pup.get_file(0x300);
|
||||
tar_object update_files(update_files_f);
|
||||
auto updatefilenames = update_files.get_filenames();
|
||||
|
||||
updatefilenames.erase(std::remove_if(
|
||||
updatefilenames.begin(), updatefilenames.end(), [](std::string s) { return s.find("dev_flash_") == std::string::npos; }),
|
||||
updatefilenames.end());
|
||||
|
||||
wxProgressDialog pdlg("Firmware Installer", "Please wait, unpacking...", updatefilenames.size(), this, wxPD_AUTO_HIDE | wxPD_APP_MODAL | wxPD_CAN_ABORT);
|
||||
|
||||
// Synchronization variable
|
||||
atomic_t<int> progress(0);
|
||||
{
|
||||
// Run asynchronously
|
||||
scope_thread worker("Firmware Installer", [&]
|
||||
{
|
||||
for (auto updatefilename : updatefilenames)
|
||||
{
|
||||
if (progress == -1) break;
|
||||
|
||||
fs::file updatefile = update_files.get_file(updatefilename);
|
||||
|
||||
SCEDecrypter self_dec(updatefile);
|
||||
self_dec.LoadHeaders();
|
||||
self_dec.LoadMetadata(SCEPKG_ERK, SCEPKG_RIV);
|
||||
self_dec.DecryptData();
|
||||
|
||||
auto dev_flash_tar_f = self_dec.MakeFile();
|
||||
if (dev_flash_tar_f.size() < 3) {
|
||||
LOG_ERROR(GENERAL, "Error while installing firmware: PUP contents are invalid.");
|
||||
wxMessageBox("Error while installing firmware: PUP contents are invalid.", "Failure!", wxOK | wxICON_ERROR, this);
|
||||
progress = -1;
|
||||
}
|
||||
|
||||
tar_object dev_flash_tar(dev_flash_tar_f[2]);
|
||||
if (!dev_flash_tar.extract(fs::get_config_dir()))
|
||||
{
|
||||
LOG_ERROR(GENERAL, "Error while installing firmware: TAR contents are invalid.");
|
||||
wxMessageBox("Error while installing firmware: TAR contents are invalid.", "Failure!", wxOK | wxICON_ERROR, this);
|
||||
progress = -1;
|
||||
}
|
||||
|
||||
if(progress >= 0)
|
||||
progress += 1;
|
||||
}
|
||||
});
|
||||
|
||||
// Wait for the completion
|
||||
while (std::this_thread::sleep_for(5ms), std::abs(progress) < pdlg.GetRange())
|
||||
{
|
||||
// Update progress window
|
||||
if (!pdlg.Update(static_cast<int>(progress)))
|
||||
{
|
||||
// Installation cancelled (signal with negative value)
|
||||
progress = -1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
update_files_f.close();
|
||||
pup_f.close();
|
||||
|
||||
if (progress > 0)
|
||||
{
|
||||
pdlg.Update(pdlg.GetRange());
|
||||
std::this_thread::sleep_for(100ms);
|
||||
}
|
||||
}
|
||||
pdlg.Close();
|
||||
|
||||
if (progress > 0)
|
||||
{
|
||||
LOG_SUCCESS(GENERAL, "Successfully installed PS3 firmware.");
|
||||
wxMessageBox("Successfully installed PS3 firmware and LLE Modules!", "Success!", wxOK, this);
|
||||
}
|
||||
}
|
||||
|
||||
void MainFrame::Pause(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if(Emu.IsReady())
|
||||
{
|
||||
Emu.Run();
|
||||
}
|
||||
else if(Emu.IsPaused())
|
||||
{
|
||||
Emu.Resume();
|
||||
}
|
||||
else if(Emu.IsRunning())
|
||||
{
|
||||
Emu.Pause();
|
||||
}
|
||||
}
|
||||
|
||||
void MainFrame::Stop(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Emu.Stop();
|
||||
}
|
||||
|
||||
// This is ugly, but PS3 headers shall not be included there.
|
||||
extern void sysutil_send_system_cmd(u64 status, u64 param);
|
||||
|
||||
void MainFrame::SendExit(wxCommandEvent& event)
|
||||
{
|
||||
sysutil_send_system_cmd(0x0101 /* CELL_SYSUTIL_REQUEST_EXITGAME */, 0);
|
||||
}
|
||||
|
||||
void MainFrame::SendOpenCloseSysMenu(wxCommandEvent& event)
|
||||
{
|
||||
sysutil_send_system_cmd(m_sys_menu_opened ? 0x0132 /* CELL_SYSUTIL_SYSTEM_MENU_CLOSE */ : 0x0131 /* CELL_SYSUTIL_SYSTEM_MENU_OPEN */, 0);
|
||||
m_sys_menu_opened = !m_sys_menu_opened;
|
||||
wxCommandEvent ce;
|
||||
UpdateUI(ce);
|
||||
}
|
||||
|
||||
void MainFrame::Config(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
SettingsDialog(this, "");
|
||||
}
|
||||
|
||||
void MainFrame::ConfigPad(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
PADManager(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigVFS(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
//VFSManagerDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigVHDD(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
//VHDDManagerDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigAutoPause(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
AutoPauseManagerDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::ConfigSaveData(wxCommandEvent& event)
|
||||
{
|
||||
SaveDataListDialog(this, true).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::OpenELFCompiler(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
//(new CompilerELF(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::OpenKernelExplorer(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(new KernelExplorer(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::OpenMemoryViewer(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(new MemoryViewerPanel(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::OpenRSXDebugger(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(new RSXDebugger(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::OpenStringSearch(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(new MemoryStringSearcher(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::OpenCgDisasm(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(new CgDisasm(this))->Show();
|
||||
}
|
||||
|
||||
void MainFrame::AboutDialogHandler(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
AboutDialog(this).ShowModal();
|
||||
}
|
||||
|
||||
void MainFrame::UpdateUI(wxEvent& event)
|
||||
{
|
||||
const bool is_running = Emu.IsRunning();
|
||||
const bool is_stopped = Emu.IsStopped();
|
||||
const bool is_ready = Emu.IsReady();
|
||||
|
||||
// Update menu items based on the state of the emulator
|
||||
wxMenuBar& menubar( *GetMenuBar() );
|
||||
|
||||
// Emulation
|
||||
wxMenuItem& pause = *menubar.FindItem(id_sys_pause);
|
||||
wxMenuItem& stop = *menubar.FindItem(id_sys_stop);
|
||||
pause.SetItemLabel(is_running ? "&Pause\tCtrl + P" : is_ready ? "&Start\tCtrl + E" : "&Resume\tCtrl + E");
|
||||
pause.Enable(!is_stopped);
|
||||
stop.Enable(!is_stopped);
|
||||
|
||||
// PS3 Commands
|
||||
wxMenuItem& send_exit = *menubar.FindItem(id_sys_send_exit);
|
||||
wxMenuItem& send_open_menu = *menubar.FindItem(id_sys_send_open_menu);
|
||||
bool enable_commands = !is_stopped;
|
||||
send_open_menu.SetItemLabel(wxString::Format("Send &%s system menu cmd", (m_sys_menu_opened ? "close" : "open")));
|
||||
send_open_menu.Enable(enable_commands);
|
||||
send_exit.Enable(enable_commands);
|
||||
|
||||
// Tools
|
||||
wxMenuItem& kernel_explorer = *menubar.FindItem(id_tools_kernel_explorer);
|
||||
wxMenuItem& memory_viewer = *menubar.FindItem(id_tools_memory_viewer);
|
||||
wxMenuItem& rsx_debugger = *menubar.FindItem(id_tools_rsx_debugger);
|
||||
wxMenuItem& string_search = *menubar.FindItem(id_tools_string_search);
|
||||
kernel_explorer.Enable(!is_stopped);
|
||||
memory_viewer.Enable(!is_stopped);
|
||||
rsx_debugger.Enable(!is_stopped);
|
||||
string_search.Enable(!is_stopped);
|
||||
|
||||
// Debugger
|
||||
m_debugger_frame->UpdateUI();
|
||||
|
||||
// Logs
|
||||
m_log_frame->UpdateUI();
|
||||
}
|
||||
|
||||
void MainFrame::OnKeyDown(wxKeyEvent& event)
|
||||
{
|
||||
if(wxGetActiveWindow() /*== this*/ && event.ControlDown())
|
||||
{
|
||||
switch(event.GetKeyCode())
|
||||
{
|
||||
case 'E': case 'e': if(Emu.IsPaused()) Emu.Resume(); else if(Emu.IsReady()) Emu.Run(); return;
|
||||
case 'P': case 'p': if(Emu.IsRunning()) Emu.Pause(); return;
|
||||
case 'S': case 's': if(!Emu.IsStopped()) Emu.Stop(); return;
|
||||
case 'R': case 'r': if(!Emu.GetPath().empty()) {Emu.Stop(); Emu.Run();} return;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
@ -1,50 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Gui/Debugger.h"
|
||||
#include "Gui/ConLogFrame.h"
|
||||
#include "Gui/FrameBase.h"
|
||||
|
||||
class GameViewer;
|
||||
|
||||
class MainFrame : public FrameBase
|
||||
{
|
||||
wxTimer m_timer;
|
||||
DebuggerPanel* m_debugger_frame;
|
||||
GameViewer* m_game_viewer;
|
||||
LogFrame* m_log_frame;
|
||||
wxAuiManager m_aui_mgr;
|
||||
bool m_sys_menu_opened;
|
||||
|
||||
public:
|
||||
MainFrame();
|
||||
~MainFrame();
|
||||
|
||||
void AddPane(wxWindow* wind, const wxString& caption, int flags);
|
||||
void DoSettings(bool load);
|
||||
|
||||
private:
|
||||
void BootGame(wxCommandEvent& event);
|
||||
void InstallPkg(wxCommandEvent& event);
|
||||
void BootElf(wxCommandEvent& event);
|
||||
void Pause(wxCommandEvent& event);
|
||||
void Stop(wxCommandEvent& event);
|
||||
void SendExit(wxCommandEvent& event);
|
||||
void SendOpenCloseSysMenu(wxCommandEvent& event);
|
||||
void Config(wxCommandEvent& event);
|
||||
void ConfigPad(wxCommandEvent& event);
|
||||
void ConfigVFS(wxCommandEvent& event);
|
||||
void ConfigVHDD(wxCommandEvent& event);
|
||||
void ConfigAutoPause(wxCommandEvent& event);
|
||||
void ConfigSaveData(wxCommandEvent& event);
|
||||
void OpenELFCompiler(wxCommandEvent& evt);
|
||||
void OpenKernelExplorer(wxCommandEvent& evt);
|
||||
void OpenMemoryViewer(wxCommandEvent& evt);
|
||||
void OpenRSXDebugger(wxCommandEvent& evt);
|
||||
void OpenStringSearch(wxCommandEvent& evt);
|
||||
void OpenCgDisasm(wxCommandEvent& evt);
|
||||
void DecryptSPRXLibraries(wxCommandEvent& event);
|
||||
void InstallFirmware(wxCommandEvent& event);
|
||||
void AboutDialogHandler(wxCommandEvent& event);
|
||||
void UpdateUI(wxEvent& event);
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
};
|
@ -1,68 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#include "MemoryStringSearcher.h"
|
||||
|
||||
MemoryStringSearcher::MemoryStringSearcher(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "String Searcher", wxDefaultPosition, wxSize(545, 64))
|
||||
, exit(false)
|
||||
{
|
||||
this->SetBackgroundColour(wxColour(240,240,240));
|
||||
//wxBoxSizer* s_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
//Tools
|
||||
//wxBoxSizer* s_tools = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
//Tabs
|
||||
//wxNotebook* nb_rsx = new wxNotebook(this, wxID_ANY, wxDefaultPosition, wxSize(482,475));
|
||||
|
||||
s_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
t_addr = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(482, -1));
|
||||
b_search = new wxButton(this, wxID_ANY, "Search", wxPoint(482, 0), wxSize(40, -1));
|
||||
b_search->Bind(wxEVT_BUTTON, &MemoryStringSearcher::Search, this);
|
||||
s_panel->Add(t_addr);
|
||||
s_panel->Add(b_search);
|
||||
};
|
||||
|
||||
void MemoryStringSearcher::Search(wxCommandEvent& event)
|
||||
{
|
||||
const wxString wstr = t_addr->GetValue();
|
||||
const char *str = wstr.c_str();
|
||||
const u32 len = wstr.length();
|
||||
|
||||
LOG_NOTICE(GENERAL, "Searching for string %s", str);
|
||||
|
||||
// Search the address space for the string
|
||||
u32 strIndex = 0;
|
||||
u32 numFound = 0;
|
||||
const auto area = vm::get(vm::main);
|
||||
for (u32 addr = area->addr; addr < area->addr + area->size; addr++) {
|
||||
if (!vm::check_addr(addr)) {
|
||||
strIndex = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
u8 byte = vm::read8(addr);
|
||||
if (byte == str[strIndex]) {
|
||||
if (strIndex == len) {
|
||||
// Found it
|
||||
LOG_NOTICE(GENERAL, "Found @ %04x", addr - len);
|
||||
numFound++;
|
||||
strIndex = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
strIndex++;
|
||||
}
|
||||
else
|
||||
strIndex = 0;
|
||||
|
||||
if (addr % (1024 * 1024 * 64) == 0) { // Log every 64mb
|
||||
LOG_NOTICE(GENERAL, "Searching %04x ...", addr);
|
||||
}
|
||||
}
|
||||
|
||||
LOG_NOTICE(GENERAL, "Search completed (found %d matches)", numFound);
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class MemoryStringSearcher : public wxDialog
|
||||
{
|
||||
wxTextCtrl* t_addr;
|
||||
wxBoxSizer* s_panel;
|
||||
wxButton* b_search;
|
||||
|
||||
public:
|
||||
bool exit;
|
||||
MemoryStringSearcher(wxWindow* parent);
|
||||
~MemoryStringSearcher()
|
||||
{
|
||||
exit = true;
|
||||
}
|
||||
|
||||
void Search(wxCommandEvent& event);
|
||||
};
|
@ -1,292 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
#include "MemoryViewer.h"
|
||||
|
||||
MemoryViewerPanel::MemoryViewerPanel(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "Memory Viewer", wxDefaultPosition, wxSize(700, 450))
|
||||
{
|
||||
exit = false;
|
||||
m_addr = 0;
|
||||
m_colcount = 16;
|
||||
m_rowcount = 16;
|
||||
|
||||
this->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
|
||||
wxBoxSizer* s_panel = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
//Tools
|
||||
wxBoxSizer* s_tools = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
//Tools: Memory Viewer Options
|
||||
wxStaticBoxSizer* s_tools_mem = new wxStaticBoxSizer(wxHORIZONTAL, this, "Memory Viewer Options");
|
||||
|
||||
wxStaticBoxSizer* s_tools_mem_addr = new wxStaticBoxSizer(wxHORIZONTAL, this, "Address");
|
||||
t_addr = new wxTextCtrl(this, wxID_ANY, "00000000", wxDefaultPosition, wxSize(60, -1), wxTE_PROCESS_ENTER);
|
||||
t_addr->SetMaxLength(8);
|
||||
s_tools_mem_addr->Add(t_addr);
|
||||
|
||||
wxStaticBoxSizer* s_tools_mem_bytes = new wxStaticBoxSizer(wxHORIZONTAL, this, "Bytes");
|
||||
sc_bytes = new wxSpinCtrl(this, wxID_ANY, "16", wxDefaultPosition, wxSize(44, -1));
|
||||
sc_bytes->SetRange(1, 16);
|
||||
s_tools_mem_bytes->Add(sc_bytes);
|
||||
|
||||
wxStaticBoxSizer* s_tools_mem_buttons = new wxStaticBoxSizer(wxHORIZONTAL, this, "Control");
|
||||
wxButton* b_fprev = new wxButton(this, wxID_ANY, "<<", wxDefaultPosition, wxSize(21, 21));
|
||||
wxButton* b_prev = new wxButton(this, wxID_ANY, "<", wxDefaultPosition, wxSize(21, 21));
|
||||
wxButton* b_next = new wxButton(this, wxID_ANY, ">", wxDefaultPosition, wxSize(21, 21));
|
||||
wxButton* b_fnext = new wxButton(this, wxID_ANY, ">>", wxDefaultPosition, wxSize(21, 21));
|
||||
s_tools_mem_buttons->Add(b_fprev);
|
||||
s_tools_mem_buttons->Add(b_prev);
|
||||
s_tools_mem_buttons->Add(b_next);
|
||||
s_tools_mem_buttons->Add(b_fnext);
|
||||
|
||||
s_tools_mem->Add(s_tools_mem_addr);
|
||||
s_tools_mem->Add(s_tools_mem_bytes);
|
||||
s_tools_mem->Add(s_tools_mem_buttons);
|
||||
|
||||
//Tools: Raw Image Preview Options
|
||||
wxStaticBoxSizer* s_tools_img = new wxStaticBoxSizer(wxHORIZONTAL, this, "Raw Image Preview");
|
||||
|
||||
wxStaticBoxSizer* s_tools_img_size = new wxStaticBoxSizer(wxHORIZONTAL, this, "Size");
|
||||
sc_img_size_x = new wxSpinCtrl(this, wxID_ANY, "256", wxDefaultPosition, wxSize(60, -1));
|
||||
sc_img_size_y = new wxSpinCtrl(this, wxID_ANY, "256", wxDefaultPosition, wxSize(60, -1));
|
||||
s_tools_img_size->Add(sc_img_size_x);
|
||||
s_tools_img_size->Add(new wxStaticText(this, wxID_ANY, " x "));
|
||||
s_tools_img_size->Add(sc_img_size_y);
|
||||
|
||||
sc_img_size_x->SetRange(1, 8192);
|
||||
sc_img_size_y->SetRange(1, 8192);
|
||||
|
||||
wxStaticBoxSizer* s_tools_img_mode = new wxStaticBoxSizer(wxHORIZONTAL, this, "Mode");
|
||||
cbox_img_mode = new wxComboBox(this, wxID_ANY);
|
||||
cbox_img_mode->Append("RGB");
|
||||
cbox_img_mode->Append("ARGB");
|
||||
cbox_img_mode->Append("RGBA");
|
||||
cbox_img_mode->Append("ABGR");
|
||||
cbox_img_mode->Select(1); //ARGB
|
||||
s_tools_img_mode->Add(cbox_img_mode);
|
||||
|
||||
s_tools_img->Add(s_tools_img_size);
|
||||
s_tools_img->Add(s_tools_img_mode);
|
||||
|
||||
//Tools: Run tools
|
||||
wxStaticBoxSizer* s_tools_buttons = new wxStaticBoxSizer(wxVERTICAL, this, "Tools");
|
||||
wxButton* b_img = new wxButton(this, wxID_ANY, "View\nimage", wxDefaultPosition, wxSize(52, -1));
|
||||
s_tools_buttons->Add(b_img);
|
||||
|
||||
//Tools: Tools = Memory Viewer Options + Raw Image Preview Options + Buttons
|
||||
s_tools->AddSpacer(10);
|
||||
s_tools->Add(s_tools_mem);
|
||||
s_tools->AddSpacer(10);
|
||||
s_tools->Add(s_tools_img);
|
||||
s_tools->AddSpacer(10);
|
||||
s_tools->Add(s_tools_buttons);
|
||||
s_tools->AddSpacer(10);
|
||||
|
||||
//Memory Panel
|
||||
wxBoxSizer* s_mem_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
t_mem_addr = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
|
||||
t_mem_hex = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
|
||||
t_mem_ascii = new wxTextCtrl(this, -1, "", wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxNO_BORDER|wxTE_READONLY);
|
||||
t_mem_addr->SetMinSize(wxSize(68, 228));
|
||||
t_mem_addr->SetForegroundColour(wxColour(75, 135, 150));
|
||||
|
||||
t_mem_addr->SetScrollbar(wxVERTICAL, 0, 0, 0);
|
||||
t_mem_hex ->SetScrollbar(wxVERTICAL, 0, 0, 0);
|
||||
t_mem_ascii->SetScrollbar(wxVERTICAL, 0, 0, 0);
|
||||
t_mem_addr ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
t_mem_hex ->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
t_mem_ascii->SetFont(wxFont(8, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||
|
||||
s_mem_panel->AddSpacer(10);
|
||||
s_mem_panel->Add(t_mem_addr);
|
||||
s_mem_panel->Add(t_mem_hex);
|
||||
s_mem_panel->Add(t_mem_ascii);
|
||||
s_mem_panel->AddSpacer(10);
|
||||
|
||||
//Memory Panel: Set size of the wxTextCtrl's
|
||||
int x, y;
|
||||
t_mem_hex->GetTextExtent("T", &x, &y);
|
||||
t_mem_hex->SetMinSize(wxSize(x * 3 * m_colcount + 6, 228));
|
||||
t_mem_hex->SetMaxSize(wxSize(x * 3 * m_colcount + 6, 228));
|
||||
t_mem_ascii->SetMinSize(wxSize(x * m_colcount + 6, 228));
|
||||
t_mem_ascii->SetMaxSize(wxSize(x * m_colcount + 6, 228));
|
||||
|
||||
//Merge and display everything
|
||||
s_panel->AddSpacer(10);
|
||||
s_panel->Add(s_tools);
|
||||
s_panel->AddSpacer(10);
|
||||
s_panel->Add(s_mem_panel, 0, 0, 100);
|
||||
s_panel->AddSpacer(10);
|
||||
SetSizerAndFit(s_panel);
|
||||
|
||||
//Events
|
||||
t_addr ->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsAddr, this);
|
||||
sc_bytes->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsBytes, this);
|
||||
//t_addr ->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsAddr, this);
|
||||
//sc_bytes->Bind(wxEVT_TEXT_ENTER, &MemoryViewerPanel::OnChangeToolsBytes, this);
|
||||
sc_bytes->Bind(wxEVT_SPINCTRL, &MemoryViewerPanel::OnChangeToolsBytes, this);
|
||||
|
||||
b_prev ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::Prev, this);
|
||||
b_next ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::Next, this);
|
||||
b_fprev->Bind(wxEVT_BUTTON, &MemoryViewerPanel::fPrev, this);
|
||||
b_fnext->Bind(wxEVT_BUTTON, &MemoryViewerPanel::fNext, this);
|
||||
b_img ->Bind(wxEVT_BUTTON, &MemoryViewerPanel::OnShowImage, this);
|
||||
|
||||
t_mem_addr ->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
|
||||
t_mem_hex ->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
|
||||
t_mem_ascii->Bind(wxEVT_MOUSEWHEEL, &MemoryViewerPanel::OnScrollMemory, this);
|
||||
|
||||
//Fill the wxTextCtrl's
|
||||
ShowMemory();
|
||||
};
|
||||
|
||||
void MemoryViewerPanel::OnChangeToolsAddr(wxCommandEvent& event)
|
||||
{
|
||||
t_addr->GetValue().ToULong((unsigned long *)&m_addr, 16);
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
ShowMemory();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::OnChangeToolsBytes(wxCommandEvent& event)
|
||||
{
|
||||
m_colcount = sc_bytes->GetValue();
|
||||
|
||||
int x, y;
|
||||
t_mem_hex->GetTextExtent("T", &x, &y);
|
||||
t_mem_hex->SetMinSize(wxSize(x * 3 * m_colcount + 6, 228));
|
||||
t_mem_hex->SetMaxSize(wxSize(x * 3 * m_colcount + 6, 228));
|
||||
t_mem_ascii->SetMinSize(wxSize(x * m_colcount + 6, 228));
|
||||
t_mem_ascii->SetMaxSize(wxSize(x * m_colcount + 6, 228));
|
||||
this->Layout();
|
||||
ShowMemory();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::OnScrollMemory(wxMouseEvent& event)
|
||||
{
|
||||
m_addr -= (event.ControlDown() ? m_rowcount : 1) * m_colcount * (event.GetWheelRotation() / event.GetWheelDelta());
|
||||
|
||||
t_addr->SetValue(wxString::Format("%08x", m_addr));
|
||||
ShowMemory();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::OnShowImage(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
u32 addr = m_addr;
|
||||
int mode = cbox_img_mode->GetSelection();
|
||||
int sizex = sc_img_size_x->GetValue();
|
||||
int sizey = sc_img_size_y->GetValue();
|
||||
ShowImage(this, m_addr, mode, sizex, sizey, false);
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::ShowMemory()
|
||||
{
|
||||
wxString t_mem_addr_str;
|
||||
wxString t_mem_hex_str;
|
||||
wxString t_mem_ascii_str;
|
||||
|
||||
for(u32 addr = m_addr; addr != m_addr + m_rowcount * m_colcount; addr += m_colcount)
|
||||
{
|
||||
t_mem_addr_str += wxString::Format("%08x ", addr);
|
||||
}
|
||||
|
||||
for (u32 row = 0; row < m_rowcount; row++)
|
||||
{
|
||||
for (u32 col = 0; col < m_colcount; col++)
|
||||
{
|
||||
u32 addr = m_addr + row * m_colcount + col;
|
||||
|
||||
if (vm::check_addr(addr))
|
||||
{
|
||||
const u8 rmem = vm::read8(addr);
|
||||
t_mem_hex_str += wxString::Format("%02x ", rmem);
|
||||
const bool isPrintable = rmem >= 32 && rmem <= 126;
|
||||
t_mem_ascii_str += isPrintable ? std::string(1, rmem) : ".";
|
||||
}
|
||||
else
|
||||
{
|
||||
t_mem_hex_str += "?? ";
|
||||
t_mem_ascii_str += "?";
|
||||
}
|
||||
}
|
||||
t_mem_ascii_str += "\r\n";
|
||||
}
|
||||
|
||||
t_mem_addr->SetValue(t_mem_addr_str);
|
||||
t_mem_hex->SetValue(t_mem_hex_str);
|
||||
t_mem_ascii->SetValue(t_mem_ascii_str);
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::ShowImage(wxWindow* parent, u32 addr, int mode, u32 width, u32 height, bool flipv)
|
||||
{
|
||||
wxString title = wxString::Format("Raw Image @ 0x%x", addr);
|
||||
|
||||
wxDialog* f_image_viewer = new wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxMINIMIZE_BOX | wxCLOSE_BOX | wxCAPTION | wxCLIP_CHILDREN);
|
||||
f_image_viewer->SetBackgroundColour(wxColour(240,240,240)); //This fix the ugly background color under Windows
|
||||
f_image_viewer->SetAutoLayout(true);
|
||||
f_image_viewer->SetClientSize(wxSize(width, height));
|
||||
f_image_viewer->Show();
|
||||
wxClientDC dc_canvas(f_image_viewer);
|
||||
|
||||
unsigned char* originalBuffer = (unsigned char*)vm::base(addr);
|
||||
unsigned char* convertedBuffer = (unsigned char*)malloc(width * height * 3);
|
||||
switch(mode)
|
||||
{
|
||||
case(0): // RGB
|
||||
memcpy(convertedBuffer, originalBuffer, width * height * 3);
|
||||
break;
|
||||
|
||||
case(1): // ARGB
|
||||
for (u32 y = 0; y < height; y++) {
|
||||
for (u32 i = 0, j = 0; j < width * 4; i += 3, j += 4) {
|
||||
convertedBuffer[i + 0 + y * width * 3] = originalBuffer[j + 1 + y * width * 4];
|
||||
convertedBuffer[i + 1 + y * width * 3] = originalBuffer[j + 2 + y * width * 4];
|
||||
convertedBuffer[i + 2 + y * width * 3] = originalBuffer[j + 3 + y * width * 4];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case(2): // RGBA
|
||||
for (u32 y = 0; y < height; y++) {
|
||||
for (u32 i = 0, j = 0; j < width * 4; i += 3, j += 4) {
|
||||
convertedBuffer[i + 0 + y * width * 3] = originalBuffer[j + 0 + y * width * 4];
|
||||
convertedBuffer[i + 1 + y * width * 3] = originalBuffer[j + 1 + y * width * 4];
|
||||
convertedBuffer[i + 2 + y * width * 3] = originalBuffer[j + 2 + y * width * 4];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case(3): // ABGR
|
||||
for (u32 y = 0; y < height; y++) {
|
||||
for (u32 i = 0, j = 0; j < width * 4; i += 3, j += 4) {
|
||||
convertedBuffer[i + 0 + y * width * 3] = originalBuffer[j + 3 + y * width * 4];
|
||||
convertedBuffer[i + 1 + y * width * 3] = originalBuffer[j + 2 + y * width * 4];
|
||||
convertedBuffer[i + 2 + y * width * 3] = originalBuffer[j + 1 + y * width * 4];
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Flip vertically
|
||||
if (flipv) {
|
||||
for (u32 y = 0; y < height / 2; y++) {
|
||||
for (u32 x = 0; x < width * 3; x++) {
|
||||
const u8 t = convertedBuffer[x + y * width * 3];
|
||||
convertedBuffer[x + y * width * 3] = convertedBuffer[x + (height - y - 1) * width * 3];
|
||||
convertedBuffer[x + (height - y - 1) * width * 3] = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wxImage img(width, height, convertedBuffer);
|
||||
dc_canvas.DrawBitmap(img, 0, 0, false);
|
||||
}
|
||||
|
||||
void MemoryViewerPanel::Next (wxCommandEvent& WXUNUSED(event)) { m_addr += m_colcount; ShowMemory(); }
|
||||
void MemoryViewerPanel::Prev (wxCommandEvent& WXUNUSED(event)) { m_addr -= m_colcount; ShowMemory(); }
|
||||
void MemoryViewerPanel::fNext(wxCommandEvent& WXUNUSED(event)) { m_addr += m_rowcount * m_colcount; ShowMemory(); }
|
||||
void MemoryViewerPanel::fPrev(wxCommandEvent& WXUNUSED(event)) { m_addr -= m_rowcount * m_colcount; ShowMemory(); }
|
@ -1,43 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class MemoryViewerPanel : public wxDialog
|
||||
{
|
||||
u32 m_addr;
|
||||
u32 m_colcount;
|
||||
u32 m_rowcount;
|
||||
|
||||
wxTextCtrl* t_addr;
|
||||
wxSpinCtrl* sc_bytes;
|
||||
|
||||
wxSpinCtrl* sc_img_size_x;
|
||||
wxSpinCtrl* sc_img_size_y;
|
||||
wxComboBox* cbox_img_mode;
|
||||
|
||||
wxTextCtrl* t_mem_addr;
|
||||
wxTextCtrl* t_mem_hex;
|
||||
wxTextCtrl* t_mem_ascii;
|
||||
|
||||
public:
|
||||
bool exit;
|
||||
MemoryViewerPanel(wxWindow* parent);
|
||||
~MemoryViewerPanel()
|
||||
{
|
||||
exit = true;
|
||||
}
|
||||
|
||||
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
||||
virtual void OnChangeToolsBytes(wxCommandEvent& event);
|
||||
virtual void OnScrollMemory(wxMouseEvent& event);
|
||||
virtual void OnShowImage(wxCommandEvent& WXUNUSED(event));
|
||||
|
||||
virtual void Next(wxCommandEvent& event);
|
||||
virtual void Prev(wxCommandEvent& event);
|
||||
virtual void fNext(wxCommandEvent& event);
|
||||
virtual void fPrev(wxCommandEvent& event);
|
||||
|
||||
virtual void ShowMemory();
|
||||
void SetPC(const uint pc) { m_addr = pc; }
|
||||
|
||||
//Static methods
|
||||
static void ShowImage(wxWindow* parent, u32 addr, int mode, u32 sizex, u32 sizey, bool flipv);
|
||||
};
|
@ -1,152 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "rpcs3.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
#include "Emu/Cell/lv2/sys_time.h"
|
||||
#include "MsgDialog.h"
|
||||
|
||||
MsgDialogFrame::~MsgDialogFrame()
|
||||
{
|
||||
if (m_dialog) wxGetApp().CallAfter([dialog = m_dialog]
|
||||
{
|
||||
dialog->Destroy();
|
||||
});
|
||||
}
|
||||
|
||||
void MsgDialogFrame::Create(const std::string& msg)
|
||||
{
|
||||
if (m_dialog) m_dialog->Destroy();
|
||||
|
||||
wxWindow* parent = wxGetApp().m_MainFrame; // TODO
|
||||
|
||||
m_gauge1 = nullptr;
|
||||
m_gauge2 = nullptr;
|
||||
m_text1 = nullptr;
|
||||
m_text2 = nullptr;
|
||||
m_button_ok = nullptr;
|
||||
m_button_yes = nullptr;
|
||||
m_button_no = nullptr;
|
||||
|
||||
m_dialog = new wxDialog(nullptr, wxID_ANY, type.se_normal ? "Normal dialog" : "Error dialog", wxDefaultPosition, wxDefaultSize);
|
||||
|
||||
m_dialog->SetExtraStyle(m_dialog->GetExtraStyle() | wxWS_EX_TRANSIENT);
|
||||
m_dialog->SetTransparent(type.bg_invisible ? 255 : 192);
|
||||
|
||||
m_sizer1 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_text = new wxStaticText(m_dialog, wxID_ANY, wxString(msg.c_str(), wxConvUTF8));
|
||||
m_sizer1->Add(m_text, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxTOP, 16);
|
||||
|
||||
if (type.progress_bar_count >= 2)
|
||||
{
|
||||
m_gauge2 = new wxGauge(m_dialog, wxID_ANY, 100, wxDefaultPosition, wxSize(300, -1), wxGA_HORIZONTAL | wxGA_SMOOTH);
|
||||
m_text2 = new wxStaticText(m_dialog, wxID_ANY, "");
|
||||
m_text2->SetAutoLayout(true);
|
||||
}
|
||||
|
||||
if (type.progress_bar_count >= 1)
|
||||
{
|
||||
m_gauge1 = new wxGauge(m_dialog, wxID_ANY, 100, wxDefaultPosition, wxSize(300, -1), wxGA_HORIZONTAL | wxGA_SMOOTH);
|
||||
m_text1 = new wxStaticText(m_dialog, wxID_ANY, "");
|
||||
m_text1->SetAutoLayout(true);
|
||||
}
|
||||
|
||||
if (m_gauge1)
|
||||
{
|
||||
m_sizer1->Add(m_text1, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxTOP, 8);
|
||||
m_sizer1->Add(m_gauge1, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, 16);
|
||||
m_gauge1->SetValue(0);
|
||||
}
|
||||
|
||||
if (m_gauge2)
|
||||
{
|
||||
m_sizer1->Add(m_text2, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxTOP, 8);
|
||||
m_sizer1->Add(m_gauge2, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, 16);
|
||||
m_gauge2->SetValue(0);
|
||||
}
|
||||
|
||||
m_buttons = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
if (type.button_type.unshifted() == CELL_MSGDIALOG_TYPE_BUTTON_TYPE_YESNO)
|
||||
{
|
||||
m_button_yes = new wxButton(m_dialog, wxID_YES);
|
||||
m_buttons->Add(m_button_yes, 0, wxRIGHT, 8);
|
||||
m_button_no = new wxButton(m_dialog, wxID_NO);
|
||||
m_buttons->Add(m_button_no, 0, 0, 16);
|
||||
|
||||
if (type.default_cursor == 1)
|
||||
{
|
||||
m_button_no->SetFocus();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_button_yes->SetFocus();
|
||||
}
|
||||
|
||||
m_sizer1->Add(m_buttons, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxTOP, 16);
|
||||
}
|
||||
|
||||
if (type.button_type.unshifted() == CELL_MSGDIALOG_TYPE_BUTTON_TYPE_OK)
|
||||
{
|
||||
m_button_ok = new wxButton(m_dialog, wxID_OK);
|
||||
m_buttons->Add(m_button_ok, 0, 0, 16);
|
||||
|
||||
if (type.default_cursor == 0)
|
||||
{
|
||||
m_button_ok->SetFocus();
|
||||
}
|
||||
|
||||
m_sizer1->Add(m_buttons, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT | wxTOP, 16);
|
||||
}
|
||||
|
||||
m_sizer1->AddSpacer(16);
|
||||
|
||||
m_dialog->SetSizerAndFit(m_sizer1);
|
||||
m_dialog->Centre(wxBOTH);
|
||||
m_dialog->Show();
|
||||
m_dialog->Enable();
|
||||
|
||||
m_dialog->Bind(wxEVT_BUTTON, [on_close = on_close](wxCommandEvent& event)
|
||||
{
|
||||
on_close(event.GetId() == wxID_NO ? CELL_MSGDIALOG_BUTTON_NO : CELL_MSGDIALOG_BUTTON_YES);
|
||||
});
|
||||
|
||||
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [on_close = on_close, type = type](wxCloseEvent& event)
|
||||
{
|
||||
if (!type.disable_cancel)
|
||||
{
|
||||
on_close(CELL_MSGDIALOG_BUTTON_ESCAPE);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void MsgDialogFrame::ProgressBarSetMsg(u32 index, const std::string& msg)
|
||||
{
|
||||
if (m_dialog)
|
||||
{
|
||||
if (index == 0 && m_text1) m_text1->SetLabelText(wxString(msg.c_str(), wxConvUTF8));
|
||||
if (index == 1 && m_text2) m_text2->SetLabelText(wxString(msg.c_str(), wxConvUTF8));
|
||||
m_dialog->Layout();
|
||||
m_dialog->Fit();
|
||||
}
|
||||
}
|
||||
|
||||
void MsgDialogFrame::ProgressBarReset(u32 index)
|
||||
{
|
||||
if (m_dialog)
|
||||
{
|
||||
if (index == 0 && m_gauge1) m_gauge1->SetValue(0);
|
||||
if (index == 1 && m_gauge2) m_gauge2->SetValue(0);
|
||||
}
|
||||
}
|
||||
|
||||
void MsgDialogFrame::ProgressBarInc(u32 index, u32 delta)
|
||||
{
|
||||
if (m_dialog)
|
||||
{
|
||||
if (index == 0 && m_gauge1) m_gauge1->SetValue(m_gauge1->GetValue() + delta);
|
||||
if (index == 1 && m_gauge2) m_gauge2->SetValue(m_gauge2->GetValue() + delta);
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Cell/Modules/cellMsgDialog.h"
|
||||
|
||||
class MsgDialogFrame : public MsgDialogBase
|
||||
{
|
||||
wxDialog* m_dialog = nullptr;
|
||||
wxGauge* m_gauge1;
|
||||
wxGauge* m_gauge2;
|
||||
wxStaticText* m_text1;
|
||||
wxStaticText* m_text2;
|
||||
wxButton* m_button_ok;
|
||||
wxButton* m_button_yes;
|
||||
wxButton* m_button_no;
|
||||
wxStaticText* m_text;
|
||||
wxSizer* m_sizer1;
|
||||
wxSizer* m_buttons;
|
||||
wxButton* osk_button_ok;
|
||||
wxTextCtrl* osk_text_input;
|
||||
char16_t* osk_text_return;
|
||||
|
||||
public:
|
||||
virtual ~MsgDialogFrame() override;
|
||||
virtual void Create(const std::string& msg) override;
|
||||
virtual void CreateOsk(const std::string& msg, char16_t* osk_text) override;
|
||||
virtual void ProgressBarSetMsg(u32 progressBarIndex, const std::string& msg) override;
|
||||
virtual void ProgressBarReset(u32 progressBarIndex) override;
|
||||
virtual void ProgressBarInc(u32 progressBarIndex, u32 delta) override;
|
||||
};
|
@ -1,56 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "rpcs3.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
#include "wx/ustring.h"
|
||||
#include "Emu/Cell/lv2/sys_time.h"
|
||||
#include "MsgDialog.h"
|
||||
|
||||
void MsgDialogFrame::CreateOsk(const std::string& msg, char16_t* osk_text)
|
||||
{
|
||||
if (m_dialog) m_dialog->Destroy();
|
||||
osk_button_ok = nullptr;
|
||||
osk_text_input = nullptr;
|
||||
osk_text_return = osk_text;
|
||||
|
||||
m_dialog = new wxDialog(nullptr, wxID_ANY, msg, wxDefaultPosition, wxDefaultSize);
|
||||
wxSizer* osk_dialog_sizer = new wxBoxSizer(wxVERTICAL);
|
||||
wxSizer* osk_text_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxSizer* osk_button_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
osk_text_input = new wxTextCtrl(m_dialog, wxID_OK, wxEmptyString, wxDefaultPosition, wxSize(200, -1));
|
||||
osk_text_sizer->Add(osk_text_input, 0, wxALL, 4);
|
||||
if (type.default_cursor == 0)
|
||||
{
|
||||
osk_text_input->SetFocus();
|
||||
}
|
||||
|
||||
osk_text_input->Bind(wxEVT_TEXT, [&](wxCommandEvent& event)
|
||||
{
|
||||
wxUString wx_osk_string = osk_text_input->GetValue();
|
||||
std::memcpy(osk_text_return, wx_osk_string.utf16_str(), wx_osk_string.size() * 2);
|
||||
on_osk_input_entered();
|
||||
});
|
||||
|
||||
osk_button_ok = new wxButton(m_dialog, wxID_OK);
|
||||
osk_button_sizer->Add(osk_button_ok, 0, wxLEFT | wxRIGHT | wxBOTTOM, 4);
|
||||
|
||||
osk_dialog_sizer->Add(osk_text_sizer, 0, wxCENTER);
|
||||
osk_dialog_sizer->Add(osk_button_sizer, 0, wxCENTER);
|
||||
|
||||
m_dialog->SetSizerAndFit(osk_dialog_sizer);
|
||||
m_dialog->Centre(wxBOTH);
|
||||
m_dialog->Show();
|
||||
m_dialog->Enable();
|
||||
|
||||
m_dialog->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||
{
|
||||
on_close(CELL_MSGDIALOG_BUTTON_OK);
|
||||
});
|
||||
|
||||
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [on_close = on_close](wxCloseEvent& event)
|
||||
{
|
||||
on_close(CELL_MSGDIALOG_BUTTON_ESCAPE);
|
||||
});
|
||||
}
|
@ -1,547 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "rpcs3.h"
|
||||
|
||||
#include "KeyboardPadHandler.h"
|
||||
#include "PADManager.h"
|
||||
|
||||
extern KeyboardPadConfig g_kbpad_config;
|
||||
|
||||
PADManager::PADManager(wxWindow* parent)
|
||||
: wxDialog(parent, wxID_ANY, "Keyboard Settings")
|
||||
, m_button_id(0)
|
||||
, m_key_pressed(false)
|
||||
{
|
||||
g_kbpad_config.load();
|
||||
|
||||
wxBoxSizer* s_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel2 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Left Analog Stick
|
||||
wxStaticBoxSizer* s_round_stick_l = new wxStaticBoxSizer(wxVERTICAL, this, "Left Analog Stick");
|
||||
wxBoxSizer* s_subpanel_lstick_1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_lstick_2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_lstick_3 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// D-Pad
|
||||
wxStaticBoxSizer* s_round_pad_controls = new wxStaticBoxSizer(wxVERTICAL, this, "D-Pad");
|
||||
wxBoxSizer* s_subpanel_pad_1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_pad_2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_pad_3 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Left shifts
|
||||
wxStaticBoxSizer* s_round_pad_shifts_l = new wxStaticBoxSizer(wxVERTICAL, this, "Left Shifts");
|
||||
wxStaticBoxSizer* s_round_pad_l1 = new wxStaticBoxSizer(wxVERTICAL, this, "L1");
|
||||
wxStaticBoxSizer* s_round_pad_l2 = new wxStaticBoxSizer(wxVERTICAL, this, "L2");
|
||||
wxStaticBoxSizer* s_round_pad_l3 = new wxStaticBoxSizer(wxVERTICAL, this, "L3");
|
||||
|
||||
// Start / Select
|
||||
wxStaticBoxSizer* s_round_pad_system = new wxStaticBoxSizer(wxVERTICAL, this, "System");
|
||||
wxStaticBoxSizer* s_round_pad_select = new wxStaticBoxSizer(wxVERTICAL, this, "Select");
|
||||
wxStaticBoxSizer* s_round_pad_start = new wxStaticBoxSizer(wxVERTICAL, this, "Start");
|
||||
|
||||
// Right shifts
|
||||
wxStaticBoxSizer* s_round_pad_shifts_r = new wxStaticBoxSizer(wxVERTICAL, this, "Right Shifts");
|
||||
wxStaticBoxSizer* s_round_pad_r1 = new wxStaticBoxSizer(wxVERTICAL, this, "R1");
|
||||
wxStaticBoxSizer* s_round_pad_r2 = new wxStaticBoxSizer(wxVERTICAL, this, "R2");
|
||||
wxStaticBoxSizer* s_round_pad_r3 = new wxStaticBoxSizer(wxVERTICAL, this, "R3");
|
||||
|
||||
// Action buttons
|
||||
wxStaticBoxSizer* s_round_pad_buttons = new wxStaticBoxSizer(wxVERTICAL, this, "Buttons");
|
||||
wxStaticBoxSizer* s_round_pad_square = new wxStaticBoxSizer(wxVERTICAL, this, "Square");
|
||||
wxStaticBoxSizer* s_round_pad_cross = new wxStaticBoxSizer(wxVERTICAL, this, "Cross");
|
||||
wxStaticBoxSizer* s_round_pad_circle = new wxStaticBoxSizer(wxVERTICAL, this, "Circle");
|
||||
wxStaticBoxSizer* s_round_pad_triangle = new wxStaticBoxSizer(wxVERTICAL, this, "Triangle");
|
||||
wxBoxSizer* s_subpanel_buttons_1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_buttons_2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_buttons_3 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Right Analog Stick
|
||||
wxStaticBoxSizer* s_round_stick_r = new wxStaticBoxSizer(wxVERTICAL, this, "Right Analog Stick");
|
||||
wxBoxSizer* s_subpanel_rstick_1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_rstick_2 = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_rstick_3 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Ok / Cancel
|
||||
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
|
||||
wxBoxSizer* s_reset_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
|
||||
#define ButtonParameters wxEmptyString, wxDefaultPosition, wxSize(60,-1)
|
||||
#define SizerFlags wxSizerFlags().Border(wxALL, 3).Center()
|
||||
|
||||
|
||||
// Buttons
|
||||
b_up_lstick = new wxButton(this, id_pad_lstick_up, ButtonParameters);
|
||||
b_down_lstick = new wxButton(this, id_pad_lstick_down, ButtonParameters);
|
||||
b_left_lstick = new wxButton(this, id_pad_lstick_left, ButtonParameters);
|
||||
b_right_lstick = new wxButton(this, id_pad_lstick_right, ButtonParameters);
|
||||
|
||||
b_up = new wxButton(this, id_pad_up, ButtonParameters);
|
||||
b_down = new wxButton(this, id_pad_down, ButtonParameters);
|
||||
b_left = new wxButton(this, id_pad_left, ButtonParameters);
|
||||
b_right = new wxButton(this, id_pad_right, ButtonParameters);
|
||||
|
||||
b_shift_l1 = new wxButton(this, id_pad_l1, ButtonParameters);
|
||||
b_shift_l2 = new wxButton(this, id_pad_l2, ButtonParameters);
|
||||
b_shift_l3 = new wxButton(this, id_pad_l3, ButtonParameters);
|
||||
|
||||
b_start = new wxButton(this, id_pad_start, ButtonParameters);
|
||||
b_select = new wxButton(this, id_pad_select, ButtonParameters);
|
||||
|
||||
b_shift_r1 = new wxButton(this, id_pad_r1, ButtonParameters);
|
||||
b_shift_r2 = new wxButton(this, id_pad_r2, ButtonParameters);
|
||||
b_shift_r3 = new wxButton(this, id_pad_r3, ButtonParameters);
|
||||
|
||||
b_square = new wxButton(this, id_pad_square, ButtonParameters);
|
||||
b_cross = new wxButton(this, id_pad_cross, ButtonParameters);
|
||||
b_circle = new wxButton(this, id_pad_circle, ButtonParameters);
|
||||
b_triangle = new wxButton(this, id_pad_triangle, ButtonParameters);
|
||||
|
||||
b_up_rstick = new wxButton(this, id_pad_rstick_up, ButtonParameters);
|
||||
b_down_rstick = new wxButton(this, id_pad_rstick_down, ButtonParameters);
|
||||
b_left_rstick = new wxButton(this, id_pad_rstick_left, ButtonParameters);
|
||||
b_right_rstick = new wxButton(this, id_pad_rstick_right, ButtonParameters);
|
||||
|
||||
b_ok = new wxButton(this, wxID_OK, "OK", wxDefaultPosition, wxSize(60,-1));
|
||||
b_cancel = new wxButton(this, wxID_CANCEL, "Cancel", wxDefaultPosition, wxSize(60,-1));
|
||||
b_reset = new wxButton(this, id_reset_parameters, "By default");
|
||||
|
||||
|
||||
// Get button labels from .ini
|
||||
UpdateLabel();
|
||||
|
||||
// Add buttons in subpanels
|
||||
// LStick
|
||||
s_subpanel_lstick_1->Add(b_up_lstick);
|
||||
s_subpanel_lstick_2->Add(b_left_lstick);
|
||||
s_subpanel_lstick_2->Add(b_right_lstick);
|
||||
s_subpanel_lstick_3->Add(b_down_lstick);
|
||||
|
||||
// D-Pad
|
||||
s_subpanel_pad_1->Add(b_up);
|
||||
s_subpanel_pad_2->Add(b_left);
|
||||
s_subpanel_pad_2->Add(b_right);
|
||||
s_subpanel_pad_3->Add(b_down);
|
||||
|
||||
// Left shifts
|
||||
s_round_pad_l1->Add(b_shift_l1);
|
||||
s_round_pad_l2->Add(b_shift_l2);
|
||||
s_round_pad_l3->Add(b_shift_l3);
|
||||
|
||||
// Start / Select
|
||||
s_round_pad_select->Add(b_select);
|
||||
s_round_pad_start->Add(b_start);
|
||||
|
||||
// Right shifts
|
||||
s_round_pad_r1->Add(b_shift_r1);
|
||||
s_round_pad_r2->Add(b_shift_r2);
|
||||
s_round_pad_r3->Add(b_shift_r3);
|
||||
|
||||
// Action buttons
|
||||
s_round_pad_square->Add(b_square);
|
||||
s_round_pad_cross->Add(b_cross);
|
||||
s_round_pad_circle->Add(b_circle);
|
||||
s_round_pad_triangle->Add(b_triangle);
|
||||
s_subpanel_buttons_1->Add(s_round_pad_triangle);
|
||||
s_subpanel_buttons_2->Add(s_round_pad_square);
|
||||
s_subpanel_buttons_2->Add(s_round_pad_circle);
|
||||
s_subpanel_buttons_3->Add(s_round_pad_cross);
|
||||
|
||||
// RStick
|
||||
s_subpanel_rstick_1->Add(b_up_rstick);
|
||||
s_subpanel_rstick_2->Add(b_left_rstick);
|
||||
s_subpanel_rstick_2->Add(b_right_rstick);
|
||||
s_subpanel_rstick_3->Add(b_down_rstick);
|
||||
|
||||
// Ok / Cancel
|
||||
s_b_panel->Add(b_ok);
|
||||
s_b_panel->Add(b_cancel);
|
||||
|
||||
// Reset parameters
|
||||
s_reset_panel->Add(b_reset);
|
||||
|
||||
s_round_stick_l->Add(s_subpanel_lstick_1, SizerFlags);
|
||||
s_round_stick_l->Add(s_subpanel_lstick_2, SizerFlags);
|
||||
s_round_stick_l->Add(s_subpanel_lstick_3, SizerFlags);
|
||||
|
||||
s_round_pad_controls->Add(s_subpanel_pad_1, SizerFlags);
|
||||
s_round_pad_controls->Add(s_subpanel_pad_2, SizerFlags);
|
||||
s_round_pad_controls->Add(s_subpanel_pad_3, SizerFlags);
|
||||
|
||||
s_round_pad_shifts_l->Add(s_round_pad_l1, SizerFlags);
|
||||
s_round_pad_shifts_l->Add(s_round_pad_l2, SizerFlags);
|
||||
s_round_pad_shifts_l->Add(s_round_pad_l3, SizerFlags);
|
||||
|
||||
s_round_pad_system->Add(s_round_pad_select, SizerFlags);
|
||||
s_round_pad_system->Add(s_round_pad_start, SizerFlags);
|
||||
|
||||
s_round_pad_shifts_r->Add(s_round_pad_r1, SizerFlags);
|
||||
s_round_pad_shifts_r->Add(s_round_pad_r2, SizerFlags);
|
||||
s_round_pad_shifts_r->Add(s_round_pad_r3, SizerFlags);
|
||||
|
||||
s_round_pad_buttons->Add(s_subpanel_buttons_1, SizerFlags);
|
||||
s_round_pad_buttons->Add(s_subpanel_buttons_2, SizerFlags);
|
||||
s_round_pad_buttons->Add(s_subpanel_buttons_3, SizerFlags);
|
||||
|
||||
s_round_stick_r->Add(s_subpanel_rstick_1, SizerFlags);
|
||||
s_round_stick_r->Add(s_subpanel_rstick_2, SizerFlags);
|
||||
s_round_stick_r->Add(s_subpanel_rstick_3, SizerFlags);
|
||||
|
||||
|
||||
s_subpanel->Add(s_round_stick_l);
|
||||
s_subpanel->AddSpacer(50);
|
||||
s_subpanel->Add(s_b_panel, SizerFlags);
|
||||
|
||||
s_subpanel2->Add(s_round_pad_controls);
|
||||
s_subpanel2->AddSpacer(50);
|
||||
s_subpanel2->Add(s_reset_panel, SizerFlags);
|
||||
|
||||
// Add subpanels in general panel
|
||||
s_panel->Add(s_subpanel);
|
||||
s_panel->Add(s_subpanel2);
|
||||
s_panel->Add(s_round_pad_shifts_l);
|
||||
s_panel->Add(s_round_pad_system);
|
||||
s_panel->Add(s_round_pad_shifts_r);
|
||||
s_panel->Add(s_round_pad_buttons);
|
||||
s_panel->Add(s_round_stick_r);
|
||||
|
||||
SetSizerAndFit(s_panel);
|
||||
|
||||
// Bind buttons
|
||||
wxGetApp().Bind(wxEVT_KEY_UP, &PADManager::OnKeyUp, this);
|
||||
wxGetApp().Bind(wxEVT_KEY_DOWN, &PADManager::OnKeyDown, this);
|
||||
b_up_lstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_down_lstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_left_lstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_right_lstick->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_up ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_down ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_left ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_right->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_shift_l1->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_shift_l2->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_shift_l3->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_start ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_select->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_shift_r1->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_shift_r2->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_shift_r3->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_square ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_cross ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_circle ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_triangle->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_up_rstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_down_rstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_left_rstick ->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_right_rstick->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
|
||||
b_ok->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_reset->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
b_cancel->Bind(wxEVT_BUTTON, &PADManager::OnButtonClicked, this);
|
||||
}
|
||||
|
||||
void PADManager::OnKeyDown(wxKeyEvent &keyEvent)
|
||||
{
|
||||
m_key_pressed = true;
|
||||
|
||||
cfg::int32* entry = nullptr;
|
||||
switch (m_button_id)
|
||||
{
|
||||
case id_pad_lstick_left: entry = &g_kbpad_config.left_stick_left; break;
|
||||
case id_pad_lstick_down: entry = &g_kbpad_config.left_stick_down; break;
|
||||
case id_pad_lstick_right: entry = &g_kbpad_config.left_stick_right; break;
|
||||
case id_pad_lstick_up: entry = &g_kbpad_config.left_stick_up; break;
|
||||
|
||||
case id_pad_left: entry = &g_kbpad_config.left; break;
|
||||
case id_pad_down: entry = &g_kbpad_config.down; break;
|
||||
case id_pad_right: entry = &g_kbpad_config.right; break;
|
||||
case id_pad_up: entry = &g_kbpad_config.up; break;
|
||||
|
||||
case id_pad_l1: entry = &g_kbpad_config.l1; break;
|
||||
case id_pad_l2: entry = &g_kbpad_config.l2; break;
|
||||
case id_pad_l3: entry = &g_kbpad_config.l3; break;
|
||||
|
||||
case id_pad_start: entry = &g_kbpad_config.start; break;
|
||||
case id_pad_select: entry = &g_kbpad_config.select; break;
|
||||
|
||||
case id_pad_r1: entry = &g_kbpad_config.r1; break;
|
||||
case id_pad_r2: entry = &g_kbpad_config.r2; break;
|
||||
case id_pad_r3: entry = &g_kbpad_config.r3; break;
|
||||
|
||||
case id_pad_square: entry = &g_kbpad_config.square; break;
|
||||
case id_pad_cross: entry = &g_kbpad_config.cross; break;
|
||||
case id_pad_circle: entry = &g_kbpad_config.circle; break;
|
||||
case id_pad_triangle: entry = &g_kbpad_config.triangle; break;
|
||||
|
||||
case id_pad_rstick_left: entry = &g_kbpad_config.right_stick_left; break;
|
||||
case id_pad_rstick_down: entry = &g_kbpad_config.right_stick_down; break;
|
||||
case id_pad_rstick_right: entry = &g_kbpad_config.right_stick_right; break;
|
||||
case id_pad_rstick_up: entry = &g_kbpad_config.right_stick_up; break;
|
||||
|
||||
case 0: break;
|
||||
default: LOG_ERROR(HLE, "Unknown button ID: %d", m_button_id); break;
|
||||
}
|
||||
|
||||
if (entry)
|
||||
{
|
||||
// TODO: do not modify config
|
||||
entry->from_string(std::to_string(keyEvent.GetKeyCode()));
|
||||
}
|
||||
|
||||
UpdateLabel();
|
||||
keyEvent.Skip();
|
||||
}
|
||||
|
||||
void PADManager::OnKeyUp(wxKeyEvent &keyEvent)
|
||||
{
|
||||
SwitchButtons(true); // enable all buttons
|
||||
m_button_id = 0; // reset current button id
|
||||
m_key_pressed = false;
|
||||
keyEvent.Skip();
|
||||
}
|
||||
|
||||
void PADManager::OnButtonClicked(wxCommandEvent &event)
|
||||
{
|
||||
if (event.GetId() != wxID_OK && event.GetId() != wxID_CANCEL && event.GetId() != id_reset_parameters)
|
||||
{
|
||||
m_button_id = event.GetId();
|
||||
SwitchButtons(false); // disable all buttons, needed for using Space, Enter and other specific buttons
|
||||
//RunTimer(3, event.GetId()); // TODO: Currently, timer disabled. Use by later, have some strange problems
|
||||
//SwitchButtons(true); // needed, if timer enabled
|
||||
UpdateLabel();
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
switch (event.GetId())
|
||||
{
|
||||
case id_reset_parameters: g_kbpad_config.from_default(); UpdateLabel(); break;
|
||||
case wxID_OK: g_kbpad_config.save(); break;
|
||||
case wxID_CANCEL: break;
|
||||
|
||||
default: LOG_ERROR(HLE, "Unknown button ID: %d", event.GetId()); break;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
const wxString PADManager::GetKeyName(const u32 keyCode)
|
||||
{
|
||||
wxString keyName;
|
||||
|
||||
switch(keyCode)
|
||||
{
|
||||
case WXK_NONE: LOG_ERROR(HLE, "Invalid key code"); keyName = "ERROR!"; break;
|
||||
case WXK_BACK: keyName = "BackSpace"; break;
|
||||
case WXK_TAB: keyName = "Tab"; break;
|
||||
case WXK_RETURN: keyName = "Enter"; break;
|
||||
case WXK_ESCAPE: keyName = "Esc"; break;
|
||||
case WXK_SPACE: keyName = "Space"; break;
|
||||
case WXK_DELETE: keyName = "Delete"; break;
|
||||
case WXK_SHIFT: keyName = "Shift"; break;
|
||||
case WXK_ALT: keyName = "ALT"; break;
|
||||
case WXK_CONTROL: keyName = "CTRL"; break;
|
||||
case WXK_PAUSE: keyName = "Pause"; break;
|
||||
case WXK_CAPITAL: keyName = "CapsLock"; break;
|
||||
case WXK_END: keyName = "End"; break;
|
||||
case WXK_HOME: keyName = "Home"; break;
|
||||
case WXK_LEFT: keyName = "Left"; break;
|
||||
case WXK_UP: keyName = "Up"; break;
|
||||
case WXK_RIGHT: keyName = "Right"; break;
|
||||
case WXK_DOWN: keyName = "Down"; break;
|
||||
case WXK_SELECT: keyName = "Select"; break;
|
||||
case WXK_PRINT: keyName = "Print"; break;
|
||||
case WXK_SNAPSHOT: keyName = "Snapshot"; break;
|
||||
case WXK_INSERT: keyName = "Insert"; break;
|
||||
case WXK_NUMPAD0: keyName = "Num0"; break;
|
||||
case WXK_NUMPAD1: keyName = "Num1"; break;
|
||||
case WXK_NUMPAD2: keyName = "Num2"; break;
|
||||
case WXK_NUMPAD3: keyName = "Num3"; break;
|
||||
case WXK_NUMPAD4: keyName = "Num4"; break;
|
||||
case WXK_NUMPAD5: keyName = "Num5"; break;
|
||||
case WXK_NUMPAD6: keyName = "Num6"; break;
|
||||
case WXK_NUMPAD7: keyName = "Num7"; break;
|
||||
case WXK_NUMPAD8: keyName = "Num8"; break;
|
||||
case WXK_NUMPAD9: keyName = "Num9"; break;
|
||||
case WXK_F1: keyName = "F1"; break;
|
||||
case WXK_F2: keyName = "F2"; break;
|
||||
case WXK_F3: keyName = "F3"; break;
|
||||
case WXK_F4: keyName = "F4"; break;
|
||||
case WXK_F5: keyName = "F5"; break;
|
||||
case WXK_F6: keyName = "F6"; break;
|
||||
case WXK_F7: keyName = "F7"; break;
|
||||
case WXK_F8: keyName = "F8"; break;
|
||||
case WXK_F9: keyName = "F9"; break;
|
||||
case WXK_F10: keyName = "F10"; break;
|
||||
case WXK_F11: keyName = "F11"; break;
|
||||
case WXK_F12: keyName = "F12"; break;
|
||||
case WXK_NUMLOCK: keyName = "NumLock"; break;
|
||||
case WXK_SCROLL: keyName = "ScrollLock"; break;
|
||||
case WXK_PAGEUP: keyName = "PgUp"; break;
|
||||
case WXK_PAGEDOWN: keyName = "PgDn"; break;
|
||||
case WXK_NUMPAD_SPACE: keyName = "NumSpace"; break;
|
||||
case WXK_NUMPAD_TAB: keyName = "NumTab"; break;
|
||||
case WXK_NUMPAD_ENTER: keyName = "NumEnter"; break;
|
||||
case WXK_NUMPAD_HOME: keyName = "NumHome"; break;
|
||||
case WXK_NUMPAD_LEFT: keyName = "NumLeft"; break;
|
||||
case WXK_NUMPAD_UP: keyName = "NumUp"; break;
|
||||
case WXK_NUMPAD_RIGHT: keyName = "NumRight"; break;
|
||||
case WXK_NUMPAD_DOWN: keyName = "NumDown"; break;
|
||||
case WXK_NUMPAD_PAGEUP: keyName = "NumPgUp"; break;
|
||||
case WXK_NUMPAD_PAGEDOWN: keyName = "NumPgDn"; break;
|
||||
case WXK_NUMPAD_END: keyName = "NumEnd"; break;
|
||||
case WXK_NUMPAD_BEGIN: keyName = "NumHome"; break;
|
||||
case WXK_NUMPAD_INSERT: keyName = "NumIns"; break;
|
||||
case WXK_NUMPAD_DELETE: keyName = "NumDel"; break;
|
||||
|
||||
default: keyName = static_cast<char>(keyCode); break;
|
||||
}
|
||||
|
||||
return keyName;
|
||||
}
|
||||
|
||||
void PADManager::UpdateLabel()
|
||||
{
|
||||
// Get button labels from .ini
|
||||
b_up_lstick->SetLabel(GetKeyName(g_kbpad_config.left_stick_up));
|
||||
b_down_lstick->SetLabel(GetKeyName(g_kbpad_config.left_stick_down));
|
||||
b_left_lstick->SetLabel(GetKeyName(g_kbpad_config.left_stick_left));
|
||||
b_right_lstick->SetLabel(GetKeyName(g_kbpad_config.left_stick_right));
|
||||
|
||||
b_up->SetLabel(GetKeyName(g_kbpad_config.up));
|
||||
b_down->SetLabel(GetKeyName(g_kbpad_config.down));
|
||||
b_left->SetLabel(GetKeyName(g_kbpad_config.left));
|
||||
b_right->SetLabel(GetKeyName(g_kbpad_config.right));
|
||||
|
||||
b_shift_l1->SetLabel(GetKeyName(g_kbpad_config.l1));
|
||||
b_shift_l2->SetLabel(GetKeyName(g_kbpad_config.l2));
|
||||
b_shift_l3->SetLabel(GetKeyName(g_kbpad_config.l3));
|
||||
|
||||
b_start->SetLabel(GetKeyName(g_kbpad_config.start));
|
||||
b_select->SetLabel(GetKeyName(g_kbpad_config.select));
|
||||
|
||||
b_shift_r1->SetLabel(GetKeyName(g_kbpad_config.r1));
|
||||
b_shift_r2->SetLabel(GetKeyName(g_kbpad_config.r2));
|
||||
b_shift_r3->SetLabel(GetKeyName(g_kbpad_config.r3));
|
||||
|
||||
b_square->SetLabel(GetKeyName(g_kbpad_config.square));
|
||||
b_cross->SetLabel(GetKeyName(g_kbpad_config.cross));
|
||||
b_circle->SetLabel(GetKeyName(g_kbpad_config.circle));
|
||||
b_triangle->SetLabel(GetKeyName(g_kbpad_config.triangle));
|
||||
|
||||
b_up_rstick->SetLabel(GetKeyName(g_kbpad_config.right_stick_up));
|
||||
b_down_rstick->SetLabel(GetKeyName(g_kbpad_config.right_stick_down));
|
||||
b_left_rstick->SetLabel(GetKeyName(g_kbpad_config.right_stick_left));
|
||||
b_right_rstick->SetLabel(GetKeyName(g_kbpad_config.right_stick_right));
|
||||
}
|
||||
|
||||
void PADManager::UpdateTimerLabel(const u32 id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case id_pad_lstick_left: b_left_lstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_lstick_down: b_down_lstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_lstick_right: b_right_lstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_lstick_up: b_up_lstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_left: b_left->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_down: b_down->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_right: b_right->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_up: b_up->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_l1: b_shift_l1->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_l2: b_shift_l2->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_l3: b_shift_l3->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_start: b_start->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_select: b_select->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_r1: b_shift_r1->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_r2: b_shift_r2->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_r3: b_shift_r3->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_square: b_square->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_cross: b_cross->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_circle: b_circle->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_triangle: b_triangle->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
case id_pad_rstick_left: b_left_rstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_rstick_down: b_down_rstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_rstick_right: b_right_rstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
case id_pad_rstick_up: b_up_rstick->SetLabel(static_cast<char>(m_seconds + 47)); break;
|
||||
|
||||
default: LOG_ERROR(HLE, "Unknown button ID: %d", id); break;
|
||||
}
|
||||
}
|
||||
|
||||
void PADManager::SwitchButtons(const bool IsEnabled)
|
||||
{
|
||||
b_up_lstick->Enable(IsEnabled);
|
||||
b_down_lstick->Enable(IsEnabled);
|
||||
b_left_lstick->Enable(IsEnabled);
|
||||
b_right_lstick->Enable(IsEnabled);
|
||||
|
||||
b_up->Enable(IsEnabled);
|
||||
b_down->Enable(IsEnabled);
|
||||
b_left->Enable(IsEnabled);
|
||||
b_right->Enable(IsEnabled);
|
||||
|
||||
b_shift_l1->Enable(IsEnabled);
|
||||
b_shift_l2->Enable(IsEnabled);
|
||||
b_shift_l3->Enable(IsEnabled);
|
||||
|
||||
b_start->Enable(IsEnabled);
|
||||
b_select->Enable(IsEnabled);
|
||||
|
||||
b_shift_r1->Enable(IsEnabled);
|
||||
b_shift_r2->Enable(IsEnabled);
|
||||
b_shift_r3->Enable(IsEnabled);
|
||||
|
||||
b_square->Enable(IsEnabled);
|
||||
b_cross->Enable(IsEnabled);
|
||||
b_circle->Enable(IsEnabled);
|
||||
b_triangle->Enable(IsEnabled);
|
||||
|
||||
b_up_rstick->Enable(IsEnabled);
|
||||
b_down_rstick->Enable(IsEnabled);
|
||||
b_left_rstick->Enable(IsEnabled);
|
||||
b_right_rstick->Enable(IsEnabled);
|
||||
|
||||
b_ok->Enable(IsEnabled);
|
||||
b_cancel->Enable(IsEnabled);
|
||||
b_reset->Enable(IsEnabled);
|
||||
}
|
||||
|
||||
// TODO: rewrite with std::chrono or wxTimer
|
||||
#include <time.h>
|
||||
|
||||
void PADManager::RunTimer(const u32 seconds, const u32 id)
|
||||
{
|
||||
m_seconds = seconds;
|
||||
clock_t t1, t2;
|
||||
t1 = t2 = clock() / CLOCKS_PER_SEC;
|
||||
while (m_seconds)
|
||||
{
|
||||
if (t1 / CLOCKS_PER_SEC + 1 <= (t2 = clock()) / CLOCKS_PER_SEC)
|
||||
{
|
||||
UpdateTimerLabel(id);
|
||||
m_seconds--;
|
||||
t1 = t2;
|
||||
}
|
||||
|
||||
if(m_key_pressed)
|
||||
{
|
||||
m_seconds = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
enum ButtonIDs
|
||||
{
|
||||
id_pad_lstick_left = 0x777,
|
||||
id_pad_lstick_down,
|
||||
id_pad_lstick_right,
|
||||
id_pad_lstick_up,
|
||||
|
||||
id_pad_left,
|
||||
id_pad_down,
|
||||
id_pad_right,
|
||||
id_pad_up,
|
||||
|
||||
id_pad_l1,
|
||||
id_pad_l2,
|
||||
id_pad_l3,
|
||||
|
||||
id_pad_start,
|
||||
id_pad_select,
|
||||
|
||||
id_pad_r1,
|
||||
id_pad_r2,
|
||||
id_pad_r3,
|
||||
|
||||
id_pad_square,
|
||||
id_pad_cross,
|
||||
id_pad_circle,
|
||||
id_pad_triangle,
|
||||
|
||||
id_pad_rstick_left,
|
||||
id_pad_rstick_down,
|
||||
id_pad_rstick_right,
|
||||
id_pad_rstick_up,
|
||||
|
||||
id_reset_parameters,
|
||||
};
|
||||
|
||||
struct PadButtons
|
||||
{
|
||||
wxButton* b_up_lstick;
|
||||
wxButton* b_down_lstick;
|
||||
wxButton* b_left_lstick;
|
||||
wxButton* b_right_lstick;
|
||||
|
||||
wxButton* b_up;
|
||||
wxButton* b_down;
|
||||
wxButton* b_left;
|
||||
wxButton* b_right;
|
||||
|
||||
wxButton* b_shift_l1;
|
||||
wxButton* b_shift_l2;
|
||||
wxButton* b_shift_l3;
|
||||
|
||||
wxButton* b_start;
|
||||
wxButton* b_select;
|
||||
|
||||
wxButton* b_shift_r1;
|
||||
wxButton* b_shift_r2;
|
||||
wxButton* b_shift_r3;
|
||||
|
||||
|
||||
wxButton* b_square;
|
||||
wxButton* b_cross;
|
||||
wxButton* b_circle;
|
||||
wxButton* b_triangle;
|
||||
|
||||
wxButton* b_up_rstick;
|
||||
wxButton* b_down_rstick;
|
||||
wxButton* b_left_rstick;
|
||||
wxButton* b_right_rstick;
|
||||
|
||||
wxButton* b_ok;
|
||||
wxButton* b_cancel;
|
||||
wxButton* b_reset;
|
||||
};
|
||||
|
||||
class PADManager : public wxDialog, PadButtons
|
||||
{
|
||||
private:
|
||||
u32 m_seconds;
|
||||
u32 m_button_id;
|
||||
bool m_key_pressed;
|
||||
|
||||
public:
|
||||
PADManager(wxWindow* parent);
|
||||
|
||||
void OnKeyDown(wxKeyEvent &keyEvent);
|
||||
void OnKeyUp(wxKeyEvent &keyEvent);
|
||||
void OnButtonClicked(wxCommandEvent &event);
|
||||
void UpdateLabel();
|
||||
void UpdateTimerLabel(const u32 id);
|
||||
void SwitchButtons(const bool IsEnabled);
|
||||
const wxString GetKeyName(const u32 keyCode);
|
||||
void RunTimer(const u32 seconds, const u32 id);
|
||||
};
|
File diff suppressed because it is too large
Load Diff
@ -1,74 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class RSXDebugger : public wxDialog
|
||||
{
|
||||
u32 m_addr;
|
||||
|
||||
u32 m_panel_width;
|
||||
u32 m_panel_height;
|
||||
u32 m_text_width;
|
||||
u32 m_text_height;
|
||||
|
||||
wxTextCtrl* t_addr;
|
||||
|
||||
u32 m_item_count;
|
||||
wxListView* m_list_commands;
|
||||
wxListView* m_list_captured_frame;
|
||||
wxListView* m_list_captured_draw_calls;
|
||||
wxListView* m_list_flags;
|
||||
wxListView* m_list_lightning;
|
||||
wxListView* m_list_texture;
|
||||
wxListView* m_list_settings;
|
||||
wxListView* m_list_index_buffer;
|
||||
|
||||
wxPanel* p_buffer_colorA;
|
||||
wxPanel* p_buffer_colorB;
|
||||
wxPanel* p_buffer_colorC;
|
||||
wxPanel* p_buffer_colorD;
|
||||
wxPanel* p_buffer_depth;
|
||||
wxPanel* p_buffer_stencil;
|
||||
wxPanel* p_buffer_tex;
|
||||
|
||||
wxImage buffer_img[4];
|
||||
wxImage depth_img;
|
||||
wxImage stencil_img;
|
||||
|
||||
wxTextCtrl* m_text_transform_program;
|
||||
wxTextCtrl *m_text_shader_program;
|
||||
|
||||
uint m_cur_texture;
|
||||
|
||||
public:
|
||||
bool exit;
|
||||
RSXDebugger(wxWindow* parent);
|
||||
~RSXDebugger()
|
||||
{
|
||||
exit = true;
|
||||
}
|
||||
|
||||
virtual void OnKeyDown(wxKeyEvent& event);
|
||||
virtual void OnChangeToolsAddr(wxCommandEvent& event);
|
||||
virtual void OnScrollMemory(wxMouseEvent& event);
|
||||
virtual void OnClickBuffer(wxMouseEvent& event);
|
||||
virtual void OnClickDrawCalls(wxMouseEvent &event);
|
||||
|
||||
virtual void GoToGet(wxCommandEvent& event);
|
||||
virtual void GoToPut(wxCommandEvent& event);
|
||||
|
||||
virtual void UpdateInformation();
|
||||
virtual void GetMemory();
|
||||
virtual void GetBuffers();
|
||||
virtual void GetFlags();
|
||||
virtual void GetLightning();
|
||||
virtual void GetTexture();
|
||||
virtual void GetSettings();
|
||||
|
||||
virtual void SetFlags(wxListEvent& event);
|
||||
virtual void SetPrograms(wxListEvent& event);
|
||||
virtual void OnSelectTexture(wxListEvent& event);
|
||||
|
||||
const char* ParseGCMEnum(u32 value, u32 type);
|
||||
wxString DisAsmCommand(u32 cmd, u32 count, u32 currentAddr, u32 ioAddr);
|
||||
|
||||
void SetPC(const uint pc) { m_addr = pc; }
|
||||
};
|
@ -1,206 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/CPU/CPUThread.h"
|
||||
#include "Emu/CPU/CPUDisAsm.h"
|
||||
#include "Emu/Cell/PPUThread.h"
|
||||
#include "Emu/Cell/SPUThread.h"
|
||||
#include "RegisterEditor.h"
|
||||
|
||||
RegisterEditorDialog::RegisterEditorDialog(wxPanel *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm)
|
||||
: wxDialog(parent, wxID_ANY, "Edit registers")
|
||||
, pc(_pc)
|
||||
, cpu(_cpu)
|
||||
, disasm(_disasm)
|
||||
{
|
||||
wxBoxSizer* s_panel_margin_x = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_panel_margin_y = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxBoxSizer* s_panel = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_t1_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_t2_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_t3_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_b_panel = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
wxStaticText* t1_text = new wxStaticText(this, wxID_ANY, "Register: ");
|
||||
t1_register = new wxComboBox(this, wxID_ANY);
|
||||
wxStaticText* t2_text = new wxStaticText(this, wxID_ANY, "Value (Hex):");
|
||||
t2_value = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(200, -1));
|
||||
|
||||
s_t1_panel->Add(t1_text);
|
||||
s_t1_panel->AddSpacer(8);
|
||||
s_t1_panel->Add(t1_register);
|
||||
|
||||
s_t2_panel->Add(t2_text);
|
||||
s_t2_panel->AddSpacer(8);
|
||||
s_t2_panel->Add(t2_value);
|
||||
|
||||
s_b_panel->Add(new wxButton(this, wxID_OK), wxLEFT, 0, 5);
|
||||
s_b_panel->AddSpacer(5);
|
||||
s_b_panel->Add(new wxButton(this, wxID_CANCEL), wxLEFT, 0, 5);
|
||||
|
||||
s_panel->Add(s_t1_panel);
|
||||
s_panel->AddSpacer(8);
|
||||
s_panel->Add(s_t2_panel);
|
||||
s_panel->AddSpacer(16);
|
||||
s_panel->Add(s_b_panel);
|
||||
|
||||
s_panel_margin_y->AddSpacer(12);
|
||||
s_panel_margin_y->Add(s_panel);
|
||||
s_panel_margin_y->AddSpacer(12);
|
||||
s_panel_margin_x->AddSpacer(12);
|
||||
s_panel_margin_x->Add(s_panel_margin_y);
|
||||
s_panel_margin_x->AddSpacer(12);
|
||||
|
||||
Bind(wxEVT_COMBOBOX, &RegisterEditorDialog::updateRegister, this);
|
||||
|
||||
switch (g_system)
|
||||
{
|
||||
case system_type::ps3:
|
||||
{
|
||||
if (_cpu->id_type() == 1)
|
||||
{
|
||||
for (int i = 0; i < 32; i++) t1_register->Append(wxString::Format("GPR[%d]", i));
|
||||
for (int i = 0; i < 32; i++) t1_register->Append(wxString::Format("FPR[%d]", i));
|
||||
for (int i = 0; i < 32; i++) t1_register->Append(wxString::Format("VR[%d]", i));
|
||||
t1_register->Append("CR");
|
||||
t1_register->Append("LR");
|
||||
t1_register->Append("CTR");
|
||||
//t1_register->Append("XER");
|
||||
//t1_register->Append("FPSCR");
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < 128; i++) t1_register->Append(wxString::Format("GPR[%d]", i));
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
wxMessageBox("Not supported thread.", "Error");
|
||||
return;
|
||||
}
|
||||
|
||||
SetSizerAndFit(s_panel_margin_x);
|
||||
|
||||
if (ShowModal() == wxID_OK)
|
||||
{
|
||||
const auto cpu = _cpu.get();
|
||||
|
||||
std::string reg = fmt::ToUTF8(t1_register->GetStringSelection());
|
||||
std::string value = fmt::ToUTF8(t2_value->GetValue());
|
||||
|
||||
if (g_system == system_type::ps3 && cpu->id_type() == 1)
|
||||
{
|
||||
auto& ppu = *static_cast<ppu_thread*>(cpu);
|
||||
|
||||
while (value.length() < 32) value = "0" + value;
|
||||
const auto first_brk = reg.find('[');
|
||||
try
|
||||
{
|
||||
if (first_brk != -1)
|
||||
{
|
||||
const long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - first_brk - 2).c_str());
|
||||
if (reg.find("GPR") == 0 || reg.find("FPR") == 0)
|
||||
{
|
||||
const ullong reg_value = std::stoull(value.substr(16, 31), 0, 16);
|
||||
if (reg.find("GPR") == 0) ppu.gpr[reg_index] = (u64)reg_value;
|
||||
if (reg.find("FPR") == 0) (u64&)ppu.fpr[reg_index] = (u64)reg_value;
|
||||
return;
|
||||
}
|
||||
if (reg.find("VR") == 0)
|
||||
{
|
||||
const ullong reg_value0 = std::stoull(value.substr(16, 31), 0, 16);
|
||||
const ullong reg_value1 = std::stoull(value.substr(0, 15), 0, 16);
|
||||
ppu.vr[reg_index]._u64[0] = (u64)reg_value0;
|
||||
ppu.vr[reg_index]._u64[1] = (u64)reg_value1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (reg == "LR" || reg == "CTR")
|
||||
{
|
||||
const ullong reg_value = std::stoull(value.substr(16, 31), 0, 16);
|
||||
if (reg == "LR") ppu.lr = (u64)reg_value;
|
||||
if (reg == "CTR") ppu.ctr = (u64)reg_value;
|
||||
return;
|
||||
}
|
||||
if (reg == "CR")
|
||||
{
|
||||
const ullong reg_value = std::stoull(value.substr(24, 31), 0, 16);
|
||||
if (reg == "CR") ppu.cr_unpack((u32)reg_value);
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (std::invalid_argument&) //if any of the stoull conversion fail
|
||||
{
|
||||
}
|
||||
}
|
||||
else if (g_system == system_type::ps3 && cpu->id_type() != 1)
|
||||
{
|
||||
auto& spu = *static_cast<SPUThread*>(cpu);
|
||||
|
||||
while (value.length() < 32) value = "0" + value;
|
||||
const auto first_brk = reg.find('[');
|
||||
try
|
||||
{
|
||||
if (first_brk != -1)
|
||||
{
|
||||
const long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - 2).c_str());
|
||||
if (reg.find("GPR") == 0)
|
||||
{
|
||||
const ullong reg_value0 = std::stoull(value.substr(16, 31), 0, 16);
|
||||
const ullong reg_value1 = std::stoull(value.substr(0, 15), 0, 16);
|
||||
spu.gpr[reg_index]._u64[0] = (u64)reg_value0;
|
||||
spu.gpr[reg_index]._u64[1] = (u64)reg_value1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (std::invalid_argument&)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
wxMessageBox("This value could not be converted.\nNo changes were made.", "Error");
|
||||
}
|
||||
}
|
||||
|
||||
void RegisterEditorDialog::updateRegister(wxCommandEvent& event)
|
||||
{
|
||||
const auto cpu = this->cpu.lock();
|
||||
|
||||
std::string reg = fmt::ToUTF8(t1_register->GetStringSelection());
|
||||
std::string str;
|
||||
|
||||
if (g_system == system_type::ps3 && cpu->id_type() == 1)
|
||||
{
|
||||
auto& ppu = *static_cast<ppu_thread*>(cpu.get());
|
||||
|
||||
std::size_t first_brk = reg.find('[');
|
||||
if (first_brk != -1)
|
||||
{
|
||||
long reg_index = std::atol(reg.substr(first_brk + 1, reg.length() - first_brk - 2).c_str());
|
||||
if (reg.find("GPR") == 0) str = fmt::format("%016llx", ppu.gpr[reg_index]);
|
||||
if (reg.find("FPR") == 0) str = fmt::format("%016llx", ppu.fpr[reg_index]);
|
||||
if (reg.find("VR") == 0) str = fmt::format("%016llx%016llx", ppu.vr[reg_index]._u64[1], ppu.vr[reg_index]._u64[0]);
|
||||
}
|
||||
if (reg == "CR") str = fmt::format("%08x", ppu.cr_pack());
|
||||
if (reg == "LR") str = fmt::format("%016llx", ppu.lr);
|
||||
if (reg == "CTR") str = fmt::format("%016llx", ppu.ctr);
|
||||
}
|
||||
else if (g_system == system_type::ps3 && cpu->id_type() != 1)
|
||||
{
|
||||
auto& spu = *static_cast<SPUThread*>(cpu.get());
|
||||
|
||||
std::string::size_type first_brk = reg.find('[');
|
||||
if (first_brk != std::string::npos)
|
||||
{
|
||||
long reg_index;
|
||||
reg_index = atol(reg.substr(first_brk + 1, reg.length() - 2).c_str());
|
||||
if (reg.find("GPR") == 0) str = fmt::format("%016llx%016llx", spu.gpr[reg_index]._u64[1], spu.gpr[reg_index]._u64[0]);
|
||||
}
|
||||
}
|
||||
|
||||
t2_value->SetValue(fmt::FromUTF8(str));
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class RegisterEditorDialog : public wxDialog
|
||||
{
|
||||
u32 pc;
|
||||
CPUDisAsm* disasm;
|
||||
wxComboBox* t1_register;
|
||||
wxTextCtrl* t2_value;
|
||||
wxStaticText* t3_preview;
|
||||
|
||||
public:
|
||||
std::weak_ptr<cpu_thread> cpu;
|
||||
|
||||
public:
|
||||
RegisterEditorDialog(wxPanel *parent, u32 _pc, const std::shared_ptr<cpu_thread>& _cpu, CPUDisAsm* _disasm);
|
||||
|
||||
void updateRegister(wxCommandEvent& event);
|
||||
};
|
@ -1,10 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Emu/Memory/Memory.h"
|
||||
|
||||
#include "SaveDataDialog.h"
|
||||
|
||||
s32 SaveDialogFrame::ShowSaveDataList(std::vector<SaveDataEntry>& save_entries, s32 focused, vm::ptr<CellSaveDataListSet> listSet)
|
||||
{
|
||||
return focused;
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Emu/Cell/Modules/cellSaveData.h"
|
||||
|
||||
class SaveDialogFrame : public SaveDialogBase
|
||||
{
|
||||
public:
|
||||
virtual s32 ShowSaveDataList(std::vector<SaveDataEntry>& save_entries, s32 focused, vm::ptr<CellSaveDataListSet> listSet) override;
|
||||
};
|
@ -1,337 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "SaveDataUtility.h"
|
||||
|
||||
//Cause i can not decide what struct to be used to fill those. Just use no real data now.
|
||||
//Currently variable info isn't used. it supposed to be a container for the information passed by other.
|
||||
SaveDataInfoDialog::SaveDataInfoDialog(wxWindow* parent, const SaveDataInformation& info)
|
||||
: wxDialog(parent, wxID_ANY, "Save Data Information")
|
||||
{
|
||||
SetMinSize(wxSize(400, 300));
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
m_list = new wxListView(this);
|
||||
m_list->InsertColumn(0, "Name");
|
||||
m_list->InsertColumn(1, "Detail");
|
||||
s_main->Add(m_list, 1, wxALL | wxEXPAND, 5);
|
||||
|
||||
wxBoxSizer* s_actions = new wxBoxSizer(wxHORIZONTAL);
|
||||
s_actions->Add(0, 0, 1, wxEXPAND, 5); //Add a spacer to make Close on the Right-Down corner of this dialog.
|
||||
s_actions->Add(new wxButton(this, wxID_CANCEL, "&Close", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
s_main->Add(s_actions, 0, wxEXPAND, 5);
|
||||
|
||||
SetSizerAndFit(s_main);
|
||||
Layout();
|
||||
Centre(wxBOTH);
|
||||
|
||||
SetSize(wxSize(400, 300));
|
||||
|
||||
UpdateData();
|
||||
}
|
||||
//This is intended to write the information of save data to wxListView.
|
||||
//However been not able to decide which data struct i should use, i use static content for this to make it stub.
|
||||
void SaveDataInfoDialog::UpdateData()
|
||||
{
|
||||
m_list->Freeze();
|
||||
m_list->DeleteAllItems();
|
||||
|
||||
m_list->InsertItem(0, 0);
|
||||
m_list->SetItem(0, 0, "User ID");
|
||||
m_list->SetItem(0, 1, "00000000 (None)");
|
||||
|
||||
m_list->InsertItem(1, 1);
|
||||
m_list->SetItem(1, 0, "Game Title");
|
||||
m_list->SetItem(1, 1, "Happy with rpcs3 (free)");
|
||||
|
||||
m_list->InsertItem(2, 2);
|
||||
m_list->SetItem(2, 0, "Subtitle");
|
||||
m_list->SetItem(2, 1, "You devs are great");
|
||||
|
||||
m_list->InsertItem(3, 3);
|
||||
m_list->SetItem(3, 0, "Detail");
|
||||
m_list->SetItem(3, 1, "Stub it first");
|
||||
|
||||
m_list->InsertItem(4, 4);
|
||||
m_list->SetItem(4, 0, "Copyable");
|
||||
m_list->SetItem(4, 1, "1 (Not allowed)");
|
||||
|
||||
m_list->InsertItem(5, 5);
|
||||
m_list->SetItem(5, 0, "Play Time");
|
||||
m_list->SetItem(5, 1, "00:00:00");
|
||||
//Maybe there should be more details of save data.
|
||||
//But i'm getting bored for assign it one by one.
|
||||
|
||||
m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->Thaw();
|
||||
}
|
||||
|
||||
//This dialog represents the Menu of Save Data Utility - which pop up after when you roll to a save and press triangle.
|
||||
//I've ever thought of make it a right-click menu or a show-hide panel of the main dialog.
|
||||
//Well only when those function calls related get implemented we can tell what this GUI should be, seriously.
|
||||
SaveDataManageDialog::SaveDataManageDialog(wxWindow* parent, unsigned int* sort_type, SaveDataEntry& save)
|
||||
: wxDialog(parent, wxID_ANY, "Save Data Pop-up Menu")
|
||||
{
|
||||
SetMinSize(wxSize(400, 110));
|
||||
|
||||
wxBoxSizer* s_manage = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxBoxSizer* s_sort = new wxBoxSizer(wxHORIZONTAL);
|
||||
s_sort->Add(new wxStaticText(this, wxID_ANY, "Sort By", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL | wxEXPAND, 5);
|
||||
|
||||
m_sort_options = new wxComboBox(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_DROPDOWN | wxCB_READONLY);
|
||||
//You might change this - of corse we should know what to been set - maybe after functions related been implemented.
|
||||
m_sort_options->Append("User Id");
|
||||
m_sort_options->Append("Game Title");
|
||||
m_sort_options->Append("Game Subtitle");
|
||||
m_sort_options->Append("Play Time");
|
||||
m_sort_options->Append("Data Size");
|
||||
m_sort_options->Append("Last Modified");
|
||||
m_sort_options->Append("Created Time");
|
||||
m_sort_options->Append("Accessed Time");
|
||||
m_sort_options->Append("Modified Time");
|
||||
m_sort_options->Append("Modify Time");
|
||||
|
||||
m_sort_type = sort_type;
|
||||
if (m_sort_type != nullptr)
|
||||
{
|
||||
//Check sort type and set it to combo box
|
||||
if (*m_sort_type >= m_sort_options->GetCount())
|
||||
{
|
||||
*m_sort_type = 0;
|
||||
}
|
||||
}
|
||||
|
||||
m_sort_options->SetSelection(*m_sort_type);
|
||||
s_sort->Add(m_sort_options, 1, wxALL | wxEXPAND, 5);
|
||||
|
||||
wxButton* s_sort_action = new wxButton(this, wxID_ANY, "&Apply", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_sort_action->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnApplySort, this);
|
||||
s_sort->Add(s_sort_action, 0, wxALL, 5);
|
||||
|
||||
s_manage->Add(s_sort, 1, wxEXPAND, 5);
|
||||
|
||||
wxBoxSizer* s_actions = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
wxButton* s_copy = new wxButton(this, wxID_ANY, "&Copy", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_copy->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnCopy, this);
|
||||
s_actions->Add(s_copy, 0, wxALL, 5);
|
||||
|
||||
wxButton* s_delete = new wxButton(this, wxID_ANY, "&Delete", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_delete->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnDelete, this);
|
||||
s_actions->Add(s_delete, 0, wxALL, 5);
|
||||
|
||||
wxButton* s_info = new wxButton(this, wxID_ANY, "&Info", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_info->Bind(wxEVT_BUTTON, &SaveDataManageDialog::OnInfo, this);
|
||||
s_actions->Add(s_info, 0, wxALL, 5);
|
||||
|
||||
s_actions->Add(new wxButton(this, wxID_CANCEL, "&Close", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
|
||||
s_manage->Add(s_actions, 1, wxEXPAND, 5);
|
||||
|
||||
SetSizerAndFit(s_manage);
|
||||
Layout();
|
||||
Center(wxBOTH);
|
||||
}
|
||||
//Display information about the current selected save data.
|
||||
//If selected is "New Save Data" or other invalid, this dialog would be initialized with "Info" disabled or not visible.
|
||||
void SaveDataManageDialog::OnInfo(wxCommandEvent& event)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnInfo called.");
|
||||
SaveDataInformation info; //It should get a real one for information.. finally
|
||||
SaveDataInfoDialog(this, info).ShowModal();
|
||||
}
|
||||
//Copy selected save data to another. Might need a dialog but i just leave it as this. Or Modal Dialog.
|
||||
void SaveDataManageDialog::OnCopy(wxCommandEvent& event)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnCopy called.");
|
||||
event.Skip();
|
||||
}
|
||||
//Delete selected save data, need confirm. just a stub now.
|
||||
void SaveDataManageDialog::OnDelete(wxCommandEvent& event)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnDelete called.");
|
||||
event.Skip();
|
||||
}
|
||||
//This should return the sort setting of the save data list. Also not implemented really.
|
||||
void SaveDataManageDialog::OnApplySort(wxCommandEvent& event)
|
||||
{
|
||||
*m_sort_type = m_sort_options->GetSelection();
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataManageDialog: OnApplySort called. NAME=%s",
|
||||
m_sort_options->GetStringSelection().ToStdString().c_str());
|
||||
//event.Skip();
|
||||
}
|
||||
|
||||
//Show up the savedata list, either to choose one to save/load or to manage saves.
|
||||
//I suggest to use function callbacks to give save data list or get save data entry. (Not implemented or stubbed)
|
||||
SaveDataListDialog::SaveDataListDialog(wxWindow* parent, bool enable_manage)
|
||||
: wxDialog(parent, wxID_ANY, "Save Data Utility")
|
||||
{
|
||||
SetMinSize(wxSize(400, 400));
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxStaticText* s_description = new wxStaticText(this, wxID_ANY, "This is only a stub for now. This doesn't work yet due to related functions not being implemented.", wxDefaultPosition, wxDefaultSize, 0);
|
||||
s_description->Wrap(400);
|
||||
s_main->Add(s_description, 0, wxALL, 5);
|
||||
|
||||
m_list = new wxListView(this);
|
||||
m_list->InsertColumn(0, "Game ID");
|
||||
m_list->InsertColumn(1, "Save ID");
|
||||
m_list->InsertColumn(2, "Detail");
|
||||
|
||||
m_list->Bind(wxEVT_LIST_ITEM_ACTIVATED, &SaveDataListDialog::OnEntryInfo, this);
|
||||
m_list->Bind(wxEVT_RIGHT_DOWN, &SaveDataListDialog::OnRightClick, this);
|
||||
|
||||
s_main->Add(m_list, 1, wxALL | wxEXPAND, 5);
|
||||
|
||||
wxBoxSizer* s_action = new wxBoxSizer(wxHORIZONTAL);
|
||||
|
||||
//If do not need manage, hide it, like just a save data picker.
|
||||
if (!enable_manage)
|
||||
{
|
||||
wxButton *m_select = new wxButton(this, wxID_OK, "&Select", wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_select->Bind(wxEVT_BUTTON, &SaveDataListDialog::OnSelect, this);
|
||||
s_action->Add(m_select, 0, wxALL, 5);
|
||||
SetTitle("Save Data Chooser");
|
||||
}
|
||||
else {
|
||||
wxButton *m_manage = new wxButton(this, wxID_ANY, "&Manage", wxDefaultPosition, wxDefaultSize, 0);
|
||||
m_manage->Bind(wxEVT_BUTTON, &SaveDataListDialog::OnManage, this);
|
||||
s_action->Add(m_manage, 0, wxALL, 5);
|
||||
}
|
||||
|
||||
s_action->Add(0, 0, 1, wxEXPAND, 5);
|
||||
|
||||
s_action->Add(new wxButton(this, wxID_CANCEL, "&Close", wxDefaultPosition, wxDefaultSize, 0), 0, wxALL, 5);
|
||||
|
||||
s_main->Add(s_action, 0, wxEXPAND, 5);
|
||||
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryCopy, this, id_copy);
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryRemove, this, id_remove);
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnEntryInfo, this, id_info);
|
||||
|
||||
//Looks stupid, isn't it. I can't find Bind for range use..
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 0);
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 1);
|
||||
Bind(wxEVT_MENU, &SaveDataListDialog::OnSort, this, 2);
|
||||
|
||||
SetSizerAndFit(s_main);
|
||||
Layout();
|
||||
Centre(wxBOTH);
|
||||
|
||||
LoadEntries();
|
||||
UpdateList();
|
||||
}
|
||||
//After you pick a menu item from the sort sub-menu
|
||||
void SaveDataListDialog::OnSort(wxCommandEvent& event)
|
||||
{
|
||||
int idx = event.GetId();
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnSort called. Type Value:%d", idx);
|
||||
if ((idx < m_sort_options->GetMenuItemCount())
|
||||
&& (idx >= 0))
|
||||
{
|
||||
m_sort_type = idx;
|
||||
}
|
||||
}
|
||||
//Copy a existing save, need to get more arguments. maybe a new dialog.
|
||||
void SaveDataListDialog::OnEntryCopy(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryCopy called.");
|
||||
//Some Operations?
|
||||
UpdateList();
|
||||
}
|
||||
}
|
||||
//Remove a save file, need to be confirmed.
|
||||
void SaveDataListDialog::OnEntryRemove(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryRemove called.");
|
||||
//Some Operations?
|
||||
UpdateList();
|
||||
}
|
||||
}
|
||||
//Display info dialog directly.
|
||||
void SaveDataListDialog::OnEntryInfo(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnEntryInfo called.");
|
||||
SaveDataInformation info; //Only a stub now.
|
||||
SaveDataInfoDialog(this, info).ShowModal();
|
||||
}
|
||||
}
|
||||
//Display info dialog directly.
|
||||
void SaveDataListDialog::OnManage(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnManage called.");
|
||||
SaveDataEntry save; //Only a stub now.
|
||||
SaveDataManageDialog(this, &m_sort_type, save).ShowModal();
|
||||
}
|
||||
}
|
||||
//When you press that select button in the Chooser mode.
|
||||
void SaveDataListDialog::OnSelect(wxCommandEvent& event)
|
||||
{
|
||||
int idx = m_list->GetFirstSelected();
|
||||
if (idx != wxNOT_FOUND)
|
||||
{
|
||||
LOG_WARNING(HLE, "Stub - SaveDataUtility: SaveDataListDialog: OnSelect called.");
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
}
|
||||
//Pop-up a small context-menu, being a replacement for SaveDataManageDialog
|
||||
void SaveDataListDialog::OnRightClick(wxMouseEvent& event)
|
||||
{
|
||||
wxMenu* menu = new wxMenu();
|
||||
int idx = m_list->GetFirstSelected();
|
||||
|
||||
//This is also a stub for the sort setting. Ids is set according to their sort-type integer.
|
||||
m_sort_options = new wxMenu();
|
||||
m_sort_options->Append(0, "UserID");
|
||||
m_sort_options->Append(1, "Title");
|
||||
m_sort_options->Append(2, "Subtitle");
|
||||
|
||||
menu->AppendSubMenu(m_sort_options, "&Sort");
|
||||
menu->AppendSeparator();
|
||||
menu->Append(id_copy, "&Copy")->Enable(idx != wxNOT_FOUND);
|
||||
menu->Append(id_remove, "&Remove")->Enable(idx != wxNOT_FOUND);
|
||||
menu->AppendSeparator();
|
||||
menu->Append(id_info, "&Info");
|
||||
|
||||
PopupMenu(menu);
|
||||
}
|
||||
//This is intended to load the save data list from a way. However that is not certain for a stub. Does nothing now.
|
||||
void SaveDataListDialog::LoadEntries(void)
|
||||
{
|
||||
|
||||
}
|
||||
//Setup some static items just for display.
|
||||
void SaveDataListDialog::UpdateList(void)
|
||||
{
|
||||
m_list->Freeze();
|
||||
m_list->DeleteAllItems();
|
||||
|
||||
m_list->InsertItem(0, 0);
|
||||
m_list->SetItem(0, 0, "TEST00000");
|
||||
m_list->SetItem(0, 1, "00");
|
||||
m_list->SetItem(0, 2, "Final battle");
|
||||
|
||||
m_list->InsertItem(0, 0);
|
||||
m_list->SetItem(0, 0, "XXXX99876");
|
||||
m_list->SetItem(0, 1, "30");
|
||||
m_list->SetItem(0, 2, "This is a fake game");
|
||||
|
||||
m_list->SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
|
||||
m_list->Thaw();
|
||||
}
|
@ -1,78 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
//TODO: Implement function calls related to Save Data List.
|
||||
//Those function calls may be needed to use this GUI.
|
||||
//Currently this is only a stub.
|
||||
|
||||
//A stub for the struct sent to SaveDataInfoDialog.
|
||||
struct SaveDataInformation
|
||||
{
|
||||
|
||||
};
|
||||
//A stub for the sorting.
|
||||
enum
|
||||
{
|
||||
SAVE_DATA_LIST_SORT_BY_USERID
|
||||
};
|
||||
//A stub for a single entry of save data. used to make a save data list or do management.
|
||||
struct SaveDataEntry
|
||||
{
|
||||
|
||||
};
|
||||
|
||||
//Used to display the information of a savedata.
|
||||
//Not sure about what information should be displayed.
|
||||
class SaveDataInfoDialog :public wxDialog
|
||||
{
|
||||
wxListView* m_list;
|
||||
|
||||
void UpdateData();
|
||||
public:
|
||||
SaveDataInfoDialog(wxWindow* parent, const SaveDataInformation& info);
|
||||
};
|
||||
|
||||
//Simple way to show up the sort menu and other operations
|
||||
//Like what you get when press Triangle on SaveData.
|
||||
class SaveDataManageDialog :public wxDialog
|
||||
{
|
||||
wxComboBox* m_sort_options;
|
||||
unsigned int* m_sort_type;
|
||||
|
||||
void OnInfo(wxCommandEvent& event);
|
||||
void OnCopy(wxCommandEvent& event);
|
||||
void OnDelete(wxCommandEvent& event);
|
||||
void OnApplySort(wxCommandEvent& event);
|
||||
public:
|
||||
SaveDataManageDialog(wxWindow* parent, unsigned int* sort_type, SaveDataEntry& save);
|
||||
};
|
||||
|
||||
//Display a list of SaveData. Would need to be initialized.
|
||||
//Can also be used as a Save Data Chooser.
|
||||
class SaveDataListDialog : public wxDialog
|
||||
{
|
||||
enum
|
||||
{
|
||||
//Reserved some Ids for Sort-By Submenu.
|
||||
id_copy = 64,
|
||||
id_remove,
|
||||
id_info,
|
||||
};
|
||||
|
||||
wxListView* m_list;
|
||||
wxMenu* m_sort_options;
|
||||
unsigned int m_sort_type;
|
||||
|
||||
void OnSelect(wxCommandEvent& event);
|
||||
void OnManage(wxCommandEvent& event);
|
||||
|
||||
void OnRightClick(wxMouseEvent& event);
|
||||
void OnSort(wxCommandEvent& event);
|
||||
void OnEntryCopy(wxCommandEvent& event);
|
||||
void OnEntryRemove(wxCommandEvent& event);
|
||||
void OnEntryInfo(wxCommandEvent& event);
|
||||
|
||||
void LoadEntries(void);
|
||||
void UpdateList(void);
|
||||
public:
|
||||
SaveDataListDialog(wxWindow* parent, bool enable_manage);
|
||||
};
|
@ -1,717 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "Utilities/Config.h"
|
||||
#include "Crypto/unself.h"
|
||||
#include "Loader/ELF.h"
|
||||
#include "Emu/System.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <Windows.h>
|
||||
#undef GetHwnd
|
||||
#include <d3d12.h>
|
||||
#include <wrl/client.h>
|
||||
#include <dxgi1_4.h>
|
||||
#endif
|
||||
|
||||
#include "Emu/RSX/VK/VKHelpers.h"
|
||||
#include "SettingsDialog.h"
|
||||
|
||||
#include <set>
|
||||
#include <unordered_set>
|
||||
#include <algorithm>
|
||||
|
||||
// Node location
|
||||
using cfg_location = std::vector<const char*>;
|
||||
|
||||
extern std::string g_cfg_defaults;
|
||||
|
||||
static YAML::Node loaded;
|
||||
static YAML::Node saved;
|
||||
|
||||
// Emit sorted YAML
|
||||
static NEVER_INLINE void emit(YAML::Emitter& out, const YAML::Node& node)
|
||||
{
|
||||
// TODO
|
||||
out << node;
|
||||
}
|
||||
|
||||
// Incrementally load YAML
|
||||
static NEVER_INLINE void operator +=(YAML::Node& left, const YAML::Node& node)
|
||||
{
|
||||
if (node && !node.IsNull())
|
||||
{
|
||||
if (node.IsMap())
|
||||
{
|
||||
for (const auto& pair : node)
|
||||
{
|
||||
if (pair.first.IsScalar())
|
||||
{
|
||||
auto&& lhs = left[pair.first.Scalar()];
|
||||
lhs += pair.second;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exotic case (TODO: probably doesn't work)
|
||||
auto&& lhs = left[YAML::Clone(pair.first)];
|
||||
lhs += pair.second;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (node.IsScalar() || node.IsSequence())
|
||||
{
|
||||
// Scalars and sequences are replaced completely, but this may change in future.
|
||||
// This logic may be overwritten by custom demands of every specific cfg:: node.
|
||||
left = node;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Connects wx gui element to the config node; abstract base class
|
||||
struct cfg_adapter
|
||||
{
|
||||
cfg_location location;
|
||||
|
||||
cfg_adapter(cfg_location&& _loc)
|
||||
: location(std::move(_loc))
|
||||
{
|
||||
}
|
||||
|
||||
static cfg::_base& get_cfg(cfg::_base& root, const std::string& name)
|
||||
{
|
||||
if (root.get_type() == cfg::type::node)
|
||||
{
|
||||
for (const auto& pair : static_cast<cfg::node&>(root).get_nodes())
|
||||
{
|
||||
if (pair.first == name)
|
||||
{
|
||||
return *pair.second;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fmt::throw_exception("Node not found: %s", name);
|
||||
}
|
||||
|
||||
static cfg::_base& get_cfg(cfg::_base& root, cfg_location::const_iterator begin, cfg_location::const_iterator end)
|
||||
{
|
||||
return begin == end ? root : get_cfg(get_cfg(root, *begin), begin + 1, end);
|
||||
}
|
||||
|
||||
static YAML::Node get_node(YAML::Node node, cfg_location::const_iterator begin, cfg_location::const_iterator end)
|
||||
{
|
||||
return begin == end ? node : get_node(node[*begin], begin + 1, end); // TODO
|
||||
}
|
||||
|
||||
cfg::_base& get_cfg() const
|
||||
{
|
||||
return get_cfg(g_cfg, location.cbegin(), location.cend());
|
||||
}
|
||||
|
||||
YAML::Node get_node(YAML::Node root) const
|
||||
{
|
||||
return get_node(root, location.cbegin(), location.cend());
|
||||
}
|
||||
|
||||
virtual void save() = 0;
|
||||
};
|
||||
|
||||
struct radiobox_pad_helper
|
||||
{
|
||||
cfg_location location;
|
||||
wxArrayString values;
|
||||
|
||||
radiobox_pad_helper(cfg_location&& _loc)
|
||||
: location(std::move(_loc))
|
||||
{
|
||||
for (const auto& v : cfg_adapter::get_cfg(g_cfg, location.cbegin(), location.cend()).to_list())
|
||||
{
|
||||
values.Add(fmt::FromUTF8(v));
|
||||
}
|
||||
}
|
||||
|
||||
operator const wxArrayString&() const
|
||||
{
|
||||
return values;
|
||||
}
|
||||
};
|
||||
|
||||
struct radiobox_pad : cfg_adapter
|
||||
{
|
||||
wxRadioBox*& ptr;
|
||||
|
||||
radiobox_pad(radiobox_pad_helper&& helper, wxRadioBox*& ptr)
|
||||
: cfg_adapter(std::move(helper.location))
|
||||
, ptr(ptr)
|
||||
{
|
||||
const auto& value = get_node(loaded).Scalar();
|
||||
const auto& values = get_cfg().to_list();
|
||||
|
||||
for (int i = 0; i < values.size(); i++)
|
||||
{
|
||||
if (value == values[i])
|
||||
{
|
||||
ptr->SetSelection(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void save() override
|
||||
{
|
||||
get_node(saved) = get_cfg().to_list()[ptr->GetSelection()];
|
||||
}
|
||||
};
|
||||
|
||||
struct combobox_pad : cfg_adapter
|
||||
{
|
||||
wxComboBox*& ptr;
|
||||
|
||||
combobox_pad(cfg_location&& _loc, wxComboBox*& ptr)
|
||||
: cfg_adapter(std::move(_loc))
|
||||
, ptr(ptr)
|
||||
{
|
||||
for (const auto& v : get_cfg().to_list())
|
||||
{
|
||||
ptr->Append(fmt::FromUTF8(v));
|
||||
}
|
||||
|
||||
ptr->SetValue(fmt::FromUTF8(get_node(loaded).Scalar()));
|
||||
}
|
||||
|
||||
void save() override
|
||||
{
|
||||
get_node(saved) = fmt::ToUTF8(ptr->GetValue());
|
||||
}
|
||||
};
|
||||
|
||||
struct checkbox_pad : cfg_adapter
|
||||
{
|
||||
wxCheckBox*& ptr;
|
||||
|
||||
checkbox_pad(cfg_location&& _loc, wxCheckBox*& ptr)
|
||||
: cfg_adapter(std::move(_loc))
|
||||
, ptr(ptr)
|
||||
{
|
||||
ptr->SetValue(get_node(loaded).as<bool>(false));
|
||||
}
|
||||
|
||||
void save() override
|
||||
{
|
||||
get_node(saved) = ptr->GetValue() ? "true" : "false";
|
||||
}
|
||||
};
|
||||
|
||||
struct textctrl_pad : cfg_adapter
|
||||
{
|
||||
wxTextCtrl*& ptr;
|
||||
|
||||
textctrl_pad(cfg_location&& _loc, wxTextCtrl*& ptr)
|
||||
: cfg_adapter(std::move(_loc))
|
||||
, ptr(ptr)
|
||||
{
|
||||
ptr->SetValue(fmt::FromUTF8(get_node(loaded).Scalar()));
|
||||
}
|
||||
|
||||
void save() override
|
||||
{
|
||||
get_node(saved) = fmt::ToUTF8(ptr->GetValue());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
SettingsDialog::SettingsDialog(wxWindow* parent, const std::string& path)
|
||||
: wxDialog(parent, wxID_ANY, "Settings", wxDefaultPosition)
|
||||
{
|
||||
// Load default config
|
||||
loaded = YAML::Load(g_cfg_defaults);
|
||||
|
||||
// Create config path if necessary
|
||||
fs::create_path(fs::get_config_dir() + path);
|
||||
|
||||
// Incrementally load config.yml
|
||||
const fs::file config(fs::get_config_dir() + path + "/config.yml", fs::read + fs::write + fs::create);
|
||||
|
||||
if (config.size() == 0 && !path.empty()) // First time
|
||||
{
|
||||
const fs::file configexisted(fs::get_config_dir() + "/config.yml", fs::read + fs::write + fs::create);
|
||||
loaded += YAML::Load(configexisted.to_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
loaded += YAML::Load(config.to_string());
|
||||
}
|
||||
|
||||
std::vector<std::unique_ptr<cfg_adapter>> pads;
|
||||
|
||||
static const u32 width = 512;
|
||||
static const u32 height = 400;
|
||||
|
||||
// Settings panels
|
||||
wxNotebook* nb_config = new wxNotebook(this, wxID_ANY, wxPoint(6, 6), wxSize(width, height));
|
||||
wxPanel* p_system = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_core = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_graphics = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_audio = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_io = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_misc = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_networking = new wxPanel(nb_config, wxID_ANY);
|
||||
|
||||
nb_config->AddPage(p_core, "Core");
|
||||
nb_config->AddPage(p_graphics, "Graphics");
|
||||
nb_config->AddPage(p_audio, "Audio");
|
||||
nb_config->AddPage(p_io, "Input / Output");
|
||||
nb_config->AddPage(p_misc, "Misc");
|
||||
nb_config->AddPage(p_networking, "Networking");
|
||||
nb_config->AddPage(p_system, "System");
|
||||
|
||||
wxBoxSizer* s_subpanel_core = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_core1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_core2 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_graphics = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_graphics1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_graphics2 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_audio = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_io = new wxBoxSizer(wxHORIZONTAL);
|
||||
wxBoxSizer* s_subpanel_io1 = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_io2 = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxBoxSizer* s_subpanel_system = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_misc = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_networking = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
// Core
|
||||
wxStaticBoxSizer* s_round_core_lle = new wxStaticBoxSizer(wxVERTICAL, p_core, "Load libraries");
|
||||
chbox_list_core_lle = new wxCheckListBox(p_core, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), {}, wxLB_EXTENDED);
|
||||
chbox_list_core_lle->Bind(wxEVT_CHECKLISTBOX, &SettingsDialog::OnModuleListItemToggled, this);
|
||||
s_module_search_box = new wxTextCtrl(p_core, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, {});
|
||||
s_module_search_box->Bind(wxEVT_TEXT, &SettingsDialog::OnSearchBoxTextChanged, this);
|
||||
|
||||
// Graphics
|
||||
wxStaticBoxSizer* s_round_gs_render = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "Render");
|
||||
wxStaticBoxSizer* s_round_gs_d3d_adapter = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "D3D Adapter (DirectX 12 Only)");
|
||||
wxStaticBoxSizer* s_round_gs_vk_adapter = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "Vulkan Adapter");
|
||||
wxStaticBoxSizer* s_round_gs_res = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "Resolution");
|
||||
wxStaticBoxSizer* s_round_gs_aspect = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "Aspect ratio");
|
||||
wxStaticBoxSizer* s_round_gs_frame_limit = new wxStaticBoxSizer(wxVERTICAL, p_graphics, "Frame limit");
|
||||
|
||||
// Input / Output
|
||||
wxStaticBoxSizer* s_round_io_pad_handler = new wxStaticBoxSizer(wxVERTICAL, p_io, "Pad Handler");
|
||||
wxStaticBoxSizer* s_round_io_keyboard_handler = new wxStaticBoxSizer(wxVERTICAL, p_io, "Keyboard Handler");
|
||||
wxStaticBoxSizer* s_round_io_mouse_handler = new wxStaticBoxSizer(wxVERTICAL, p_io, "Mouse Handler");
|
||||
wxStaticBoxSizer* s_round_io_camera = new wxStaticBoxSizer(wxVERTICAL, p_io, "Camera");
|
||||
wxStaticBoxSizer* s_round_io_camera_type = new wxStaticBoxSizer(wxVERTICAL, p_io, "Camera type");
|
||||
|
||||
// Audio
|
||||
wxStaticBoxSizer* s_round_audio_out = new wxStaticBoxSizer(wxVERTICAL, p_audio, "Audio Out");
|
||||
|
||||
// Networking
|
||||
wxStaticBoxSizer* s_round_net_status = new wxStaticBoxSizer(wxVERTICAL, p_networking, "Connection status");
|
||||
|
||||
// System
|
||||
wxStaticBoxSizer* s_round_sys_lang = new wxStaticBoxSizer(wxVERTICAL, p_system, "Language");
|
||||
|
||||
|
||||
wxRadioBox* rbox_ppu_decoder;
|
||||
wxRadioBox* rbox_spu_decoder;
|
||||
wxComboBox* cbox_gs_render = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_gs_d3d_adapter = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_gs_vk_adapter = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_gs_resolution = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_gs_aspect = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_gs_frame_limit = new wxComboBox(p_graphics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_pad_handler = new wxComboBox(p_io, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);;
|
||||
wxComboBox* cbox_keyboard_handler = new wxComboBox(p_io, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_mouse_handler = new wxComboBox(p_io, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_camera = new wxComboBox(p_io, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_camera_type = new wxComboBox(p_io, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_audio_out = new wxComboBox(p_audio, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_net_status = new wxComboBox(p_networking, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
|
||||
wxComboBox* cbox_sys_lang = new wxComboBox(p_system, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY);
|
||||
|
||||
wxCheckBox* chbox_core_hook_stfunc = new wxCheckBox(p_core, wxID_ANY, "Hook static functions");
|
||||
wxCheckBox* chbox_core_bind_spu_threads = new wxCheckBox(p_core, wxID_ANY, "Bind SPU threads to secondary cores");
|
||||
wxCheckBox* chbox_core_lower_spu_priority = new wxCheckBox(p_core, wxID_ANY, "Lower SPU thread priority");
|
||||
wxCheckBox* chbox_vfs_enable_host_root = new wxCheckBox(p_system, wxID_ANY, "Enable /host_root/");
|
||||
wxCheckBox* chbox_gs_log_prog = new wxCheckBox(p_graphics, wxID_ANY, "Log Shader Programs");
|
||||
wxCheckBox* chbox_gs_dump_depth = new wxCheckBox(p_graphics, wxID_ANY, "Write Depth Buffer");
|
||||
wxCheckBox* chbox_gs_dump_color = new wxCheckBox(p_graphics, wxID_ANY, "Write Color Buffers");
|
||||
wxCheckBox* chbox_gs_read_color = new wxCheckBox(p_graphics, wxID_ANY, "Read Color Buffers");
|
||||
wxCheckBox* chbox_gs_read_depth = new wxCheckBox(p_graphics, wxID_ANY, "Read Depth Buffer");
|
||||
wxCheckBox* chbox_gs_vsync = new wxCheckBox(p_graphics, wxID_ANY, "VSync");
|
||||
wxCheckBox* chbox_gs_debug_output = new wxCheckBox(p_graphics, wxID_ANY, "Debug Output");
|
||||
wxCheckBox* chbox_gs_overlay = new wxCheckBox(p_graphics, wxID_ANY, "Debug Overlay");
|
||||
wxCheckBox* chbox_gs_gl_legacy_buffers = new wxCheckBox(p_graphics, wxID_ANY, "Use Legacy OpenGL Buffers");
|
||||
wxCheckBox* chbox_gs_gpu_texture_scaling = new wxCheckBox(p_graphics, wxID_ANY, "Use GPU texture scaling");
|
||||
wxCheckBox* chbox_audio_dump = new wxCheckBox(p_audio, wxID_ANY, "Dump to file");
|
||||
wxCheckBox* chbox_audio_conv = new wxCheckBox(p_audio, wxID_ANY, "Convert to 16 bit");
|
||||
wxCheckBox* chbox_audio_dnmx = new wxCheckBox(p_audio, wxID_ANY, "Downmix to Stereo");
|
||||
wxCheckBox* chbox_hle_exitonstop = new wxCheckBox(p_misc, wxID_ANY, "Exit RPCS3 when process finishes");
|
||||
wxCheckBox* chbox_hle_always_start = new wxCheckBox(p_misc, wxID_ANY, "Always start after boot");
|
||||
wxCheckBox* chbox_dbg_ap_systemcall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at System Call");
|
||||
wxCheckBox* chbox_dbg_ap_functioncall = new wxCheckBox(p_misc, wxID_ANY, "Auto Pause at Function Call");
|
||||
|
||||
{
|
||||
// Sort string vector alphabetically
|
||||
static const auto sort_string_vector = [](std::vector<std::string>& vec)
|
||||
{
|
||||
std::sort(vec.begin(), vec.end(), [](const std::string &str1, const std::string &str2) { return str1 < str2; });
|
||||
};
|
||||
|
||||
auto&& data = loaded["Core"]["Load libraries"].as<std::vector<std::string>, std::initializer_list<std::string>>({});
|
||||
sort_string_vector(data);
|
||||
|
||||
// List selected modules first
|
||||
for (const auto& unk : data)
|
||||
{
|
||||
lle_module_list.insert(lle_module_list.end(), std::pair<std::string, bool>(unk, true));
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Append(unk));
|
||||
}
|
||||
|
||||
const std::string& lle_dir = Emu.GetLibDir(); // TODO
|
||||
|
||||
std::unordered_set<std::string> set(data.begin(), data.end());
|
||||
std::vector<std::string> lle_module_list_unselected;
|
||||
|
||||
for (const auto& prxf : fs::dir(lle_dir))
|
||||
{
|
||||
// List found unselected modules
|
||||
if (prxf.is_directory || (prxf.name.substr(std::max(size_t(3), prxf.name.length()) - 3)) != "prx")
|
||||
continue;
|
||||
if (verify_npdrm_self_headers(fs::file(lle_dir + prxf.name)) && !set.count(prxf.name))
|
||||
{
|
||||
lle_module_list_unselected.push_back(prxf.name);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sort_string_vector(lle_module_list_unselected);
|
||||
|
||||
for (const auto& prxf : lle_module_list_unselected)
|
||||
{
|
||||
lle_module_list.insert(lle_module_list.end(), std::pair<std::string, bool>(prxf, false));
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Append(prxf), false);
|
||||
}
|
||||
|
||||
lle_module_list_unselected.clear();
|
||||
}
|
||||
|
||||
radiobox_pad_helper ppu_decoder_modes({ "Core", "PPU Decoder" });
|
||||
rbox_ppu_decoder = new wxRadioBox(p_core, wxID_ANY, "PPU Decoder", wxDefaultPosition, wxSize(-1, -1), ppu_decoder_modes, 1);
|
||||
pads.emplace_back(std::make_unique<radiobox_pad>(std::move(ppu_decoder_modes), rbox_ppu_decoder));
|
||||
rbox_ppu_decoder->Enable(0, false); // TODO
|
||||
|
||||
radiobox_pad_helper spu_decoder_modes({ "Core", "SPU Decoder" });
|
||||
rbox_spu_decoder = new wxRadioBox(p_core, wxID_ANY, "SPU Decoder", wxDefaultPosition, wxSize(-1, -1), spu_decoder_modes, 1);
|
||||
pads.emplace_back(std::make_unique<radiobox_pad>(std::move(spu_decoder_modes), rbox_spu_decoder));
|
||||
rbox_spu_decoder->Enable(3, false); // TODO
|
||||
|
||||
radiobox_pad_helper lib_loader_modes({ "Core", "Lib Loader" });
|
||||
rbox_lib_loader = new wxRadioBox(p_core, wxID_ANY, "Library Loading Mode", wxDefaultPosition, wxSize(-1, -1), lib_loader_modes, 1);
|
||||
pads.emplace_back(std::make_unique<radiobox_pad>(std::move(lib_loader_modes), rbox_lib_loader));
|
||||
rbox_lib_loader->Bind(wxEVT_COMMAND_RADIOBOX_SELECTED, &SettingsDialog::OnLibLoaderToggled, this);
|
||||
EnableModuleList(rbox_lib_loader->GetSelection());
|
||||
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Core", "Hook static functions" }, chbox_core_hook_stfunc));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Core", "Bind SPU threads to secondary cores" }, chbox_core_bind_spu_threads));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Core", "Lower SPU thread priority" }, chbox_core_lower_spu_priority));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "VFS", "Enable /host_root/" }, chbox_vfs_enable_host_root));
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "Renderer" }, cbox_gs_render));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "Resolution" }, cbox_gs_resolution));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "Aspect ratio" }, cbox_gs_aspect));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "Frame limit" }, cbox_gs_frame_limit));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Log shader programs" }, chbox_gs_log_prog));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Write Depth Buffer" }, chbox_gs_dump_depth));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Write Color Buffers" }, chbox_gs_dump_color));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Read Color Buffers" }, chbox_gs_read_color));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Read Depth Buffer" }, chbox_gs_read_depth));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "VSync" }, chbox_gs_vsync));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Debug output" }, chbox_gs_debug_output));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Debug overlay" }, chbox_gs_overlay));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Use Legacy OpenGL Buffers (Debug)" }, chbox_gs_gl_legacy_buffers));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Video", "Use GPU texture scaling" }, chbox_gs_gpu_texture_scaling));
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Audio", "Renderer" }, cbox_audio_out));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Audio", "Dump to file" }, chbox_audio_dump));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Audio", "Convert to 16 bit" }, chbox_audio_conv));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Audio", "Downmix to Stereo" }, chbox_audio_dnmx));
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Pad" }, cbox_pad_handler));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Keyboard" }, cbox_keyboard_handler));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Mouse" }, cbox_mouse_handler));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Camera" }, cbox_camera));
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Input/Output", "Camera type" }, cbox_camera_type));
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Net", "Connection status" }, cbox_net_status));
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "System", "Language" }, cbox_sys_lang));
|
||||
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Exit RPCS3 when process finishes" }, chbox_hle_exitonstop));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Always start after boot" }, chbox_hle_always_start));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Auto Pause at System Call" }, chbox_dbg_ap_systemcall));
|
||||
pads.emplace_back(std::make_unique<checkbox_pad>(cfg_location{ "Miscellaneous", "Auto Pause at Function Call" }, chbox_dbg_ap_functioncall));
|
||||
|
||||
#ifdef _MSC_VER
|
||||
Microsoft::WRL::ComPtr<IDXGIFactory4> dxgi_factory;
|
||||
|
||||
if (SUCCEEDED(CreateDXGIFactory(IID_PPV_ARGS(&dxgi_factory))))
|
||||
{
|
||||
Microsoft::WRL::ComPtr<IDXGIAdapter> adapter;
|
||||
|
||||
for (UINT id = 0; dxgi_factory->EnumAdapters(id, adapter.ReleaseAndGetAddressOf()) != DXGI_ERROR_NOT_FOUND; id++)
|
||||
{
|
||||
DXGI_ADAPTER_DESC desc;
|
||||
adapter->GetDesc(&desc);
|
||||
cbox_gs_d3d_adapter->Append(desc.Description);
|
||||
}
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "D3D12", "Adapter" }, cbox_gs_d3d_adapter));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Removes D3D12 from Render list when the system doesn't support it
|
||||
cbox_gs_render->Delete(cbox_gs_render->FindString("D3D12"));
|
||||
cbox_gs_d3d_adapter->Enable(false);
|
||||
}
|
||||
#else
|
||||
cbox_gs_d3d_adapter->Enable(false);
|
||||
#endif
|
||||
|
||||
//TODO: This is very slow. Only init once
|
||||
bool vulkan_supported = false;
|
||||
|
||||
vk::context device_enum_context;
|
||||
u32 instance_handle = device_enum_context.createInstance("RPCS3", true);
|
||||
|
||||
if (instance_handle > 0)
|
||||
{
|
||||
device_enum_context.makeCurrentInstance(instance_handle);
|
||||
std::vector<vk::physical_device>& gpus = device_enum_context.enumerateDevices();
|
||||
|
||||
if (gpus.size() > 0)
|
||||
{
|
||||
//A device with vulkan support found. Init data
|
||||
vulkan_supported = true;
|
||||
|
||||
for (auto& gpu : gpus)
|
||||
{
|
||||
cbox_gs_vk_adapter->Append(gpu.name());
|
||||
}
|
||||
|
||||
pads.emplace_back(std::make_unique<combobox_pad>(cfg_location{ "Video", "Vulkan", "Adapter" }, cbox_gs_vk_adapter));
|
||||
}
|
||||
}
|
||||
|
||||
if (!vulkan_supported)
|
||||
{
|
||||
// Removes Vulkan from Render list when the system doesn't support it
|
||||
cbox_gs_render->Delete(cbox_gs_render->FindString("Vulkan"));
|
||||
cbox_gs_vk_adapter->Enable(false);
|
||||
}
|
||||
|
||||
device_enum_context.close();
|
||||
|
||||
// Rendering
|
||||
s_round_gs_render->Add(cbox_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_round_gs_d3d_adapter->Add(cbox_gs_d3d_adapter, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_round_gs_vk_adapter->Add(cbox_gs_vk_adapter, 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_frame_limit->Add(cbox_gs_frame_limit, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Input/Output
|
||||
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_camera->Add(cbox_camera, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_round_io_camera_type->Add(cbox_camera_type, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
s_round_audio_out->Add(cbox_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Networking
|
||||
s_round_net_status->Add(cbox_net_status, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// System
|
||||
s_round_sys_lang->Add(cbox_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Core
|
||||
s_round_core_lle->Add(chbox_list_core_lle, wxSizerFlags().Border(wxALL, 4).Expand());
|
||||
s_round_core_lle->Add(s_module_search_box, wxSizerFlags().Border(wxALL, 4).Expand());
|
||||
s_subpanel_core1->Add(rbox_ppu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core1->Add(rbox_spu_decoder, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core1->Add(chbox_core_hook_stfunc, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core1->Add(chbox_core_bind_spu_threads, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core1->Add(chbox_core_lower_spu_priority, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core2->Add(rbox_lib_loader, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core2->Add(s_round_core_lle, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_core->Add(s_subpanel_core1);
|
||||
s_subpanel_core->Add(s_subpanel_core2);
|
||||
|
||||
// Graphics
|
||||
s_subpanel_graphics1->Add(s_round_gs_render, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(s_round_gs_res, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(s_round_gs_d3d_adapter, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(chbox_gs_dump_color, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(chbox_gs_read_color, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(chbox_gs_dump_depth, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(chbox_gs_read_depth, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics1->Add(chbox_gs_gl_legacy_buffers, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(s_round_gs_aspect, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(s_round_gs_frame_limit, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(s_round_gs_vk_adapter, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(chbox_gs_debug_output, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(chbox_gs_overlay, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(chbox_gs_log_prog, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(chbox_gs_vsync, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics2->Add(chbox_gs_gpu_texture_scaling, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_graphics->Add(s_subpanel_graphics1);
|
||||
s_subpanel_graphics->Add(s_subpanel_graphics2);
|
||||
|
||||
// Input - Output
|
||||
s_subpanel_io1->Add(s_round_io_pad_handler, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_io1->Add(s_round_io_keyboard_handler, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_io1->Add(s_round_io_mouse_handler, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_io2->Add(s_round_io_camera, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_io2->Add(s_round_io_camera_type, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_io->Add(s_subpanel_io1);
|
||||
s_subpanel_io->Add(s_subpanel_io2);
|
||||
|
||||
// Audio
|
||||
s_subpanel_audio->Add(s_round_audio_out, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_audio->Add(chbox_audio_dump, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_audio->Add(chbox_audio_conv, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_audio->Add(chbox_audio_dnmx, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Miscellaneous
|
||||
s_subpanel_misc->Add(chbox_hle_exitonstop, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_misc->Add(chbox_hle_always_start, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Auto Pause
|
||||
s_subpanel_misc->Add(chbox_dbg_ap_systemcall, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_misc->Add(chbox_dbg_ap_functioncall, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Networking
|
||||
s_subpanel_networking->Add(s_round_net_status, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// System
|
||||
s_subpanel_system->Add(chbox_vfs_enable_host_root, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
s_subpanel_system->Add(s_round_sys_lang, wxSizerFlags().Border(wxALL, 5).Expand());
|
||||
|
||||
// Buttons
|
||||
wxBoxSizer* s_b_panel(new wxBoxSizer(wxHORIZONTAL));
|
||||
s_b_panel->Add(new wxButton(this, wxID_OK), wxSizerFlags().Border(wxALL, 5).Bottom());
|
||||
s_b_panel->Add(new wxButton(this, wxID_CANCEL), wxSizerFlags().Border(wxALL, 5).Bottom());
|
||||
|
||||
// Resize panels
|
||||
SetSizerAndFit(s_subpanel_core, false);
|
||||
SetSizerAndFit(s_subpanel_graphics, false);
|
||||
SetSizerAndFit(s_subpanel_io, false);
|
||||
SetSizerAndFit(s_subpanel_audio, false);
|
||||
SetSizerAndFit(s_subpanel_misc, false);
|
||||
SetSizerAndFit(s_subpanel_networking, false);
|
||||
SetSizerAndFit(s_subpanel_system, false);
|
||||
SetSizerAndFit(s_b_panel, false);
|
||||
|
||||
SetSize(width + 26, height + 80);
|
||||
|
||||
if (ShowModal() == wxID_OK)
|
||||
{
|
||||
std::set<std::string> lle_selected;
|
||||
|
||||
for (auto& i : lle_module_list)
|
||||
{
|
||||
if (i.second) // selected
|
||||
{
|
||||
lle_selected.emplace(i.first);
|
||||
}
|
||||
}
|
||||
|
||||
saved.reset();
|
||||
saved["Core"]["Load libraries"] = std::vector<std::string>(lle_selected.begin(), lle_selected.end());
|
||||
|
||||
for (auto& pad : pads)
|
||||
{
|
||||
pad->save();
|
||||
}
|
||||
|
||||
loaded += saved;
|
||||
YAML::Emitter out;
|
||||
emit(out, loaded);
|
||||
|
||||
// Save config
|
||||
config.seek(0);
|
||||
config.trunc(0);
|
||||
config.write(out.c_str(), out.size());
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::OnModuleListItemToggled(wxCommandEvent &event)
|
||||
{
|
||||
lle_module_list[fmt::ToUTF8(event.GetString())] = chbox_list_core_lle->IsChecked(event.GetSelection());
|
||||
}
|
||||
|
||||
void SettingsDialog::OnSearchBoxTextChanged(wxCommandEvent &event)
|
||||
{
|
||||
// helper to preserve alphabetically order while inserting items
|
||||
unsigned int item_index = 0;
|
||||
|
||||
if (event.GetString().IsEmpty())
|
||||
{
|
||||
for (auto& i : lle_module_list)
|
||||
{
|
||||
if (i.second)
|
||||
{
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Insert(i.first, item_index));
|
||||
item_index++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Insert(i.first, chbox_list_core_lle->GetCount()), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
chbox_list_core_lle->Clear();
|
||||
|
||||
wxString search_term = event.GetString().Lower();
|
||||
item_index = 0;
|
||||
|
||||
for (auto& i : lle_module_list)
|
||||
{
|
||||
if (fmt::FromUTF8(i.first).Find(search_term) != wxString::npos)
|
||||
{
|
||||
if (i.second)
|
||||
{
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Insert(i.first, item_index));
|
||||
item_index++;
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
chbox_list_core_lle->Check(chbox_list_core_lle->Insert(i.first, chbox_list_core_lle->GetCount()), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SettingsDialog::OnLibLoaderToggled(wxCommandEvent& event)
|
||||
{
|
||||
EnableModuleList(event.GetSelection());
|
||||
}
|
||||
|
||||
// Enables or disables the modul list interaction
|
||||
void SettingsDialog::EnableModuleList(int selection)
|
||||
{
|
||||
if (selection == 1 || selection == 2)
|
||||
{
|
||||
chbox_list_core_lle->Enable();
|
||||
s_module_search_box->Enable();
|
||||
}
|
||||
else
|
||||
{
|
||||
chbox_list_core_lle->Disable();
|
||||
s_module_search_box->Disable();
|
||||
}
|
||||
}
|
||||
|
@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class SettingsDialog : public wxDialog
|
||||
{
|
||||
public:
|
||||
SettingsDialog(wxWindow* parent, const std::string& path);
|
||||
|
||||
private:
|
||||
wxTextCtrl* s_module_search_box;
|
||||
wxCheckListBox* chbox_list_core_lle;
|
||||
wxRadioBox* rbox_lib_loader;
|
||||
|
||||
void OnModuleListItemToggled(wxCommandEvent& event);
|
||||
void OnSearchBoxTextChanged(wxCommandEvent& event);
|
||||
void OnLibLoaderToggled(wxCommandEvent& event);
|
||||
void EnableModuleList(int selection);
|
||||
std::map<std::string, bool> lle_module_list;
|
||||
};
|
@ -1,77 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
|
||||
#include "SignInDialog.h"
|
||||
|
||||
// TODO: Make this look and work more reasonably
|
||||
void SignInDialogFrame::Create()
|
||||
{
|
||||
wxWindow* parent = nullptr; // TODO: align the window better
|
||||
|
||||
m_dialog = std::make_unique<wxDialog>(parent, wxID_ANY, "Sign in", wxDefaultPosition, wxDefaultSize);
|
||||
static const u32 width = 300;
|
||||
static const u32 height = 98;
|
||||
|
||||
wxNotebook* nb_config = new wxNotebook(m_dialog.get(), wxID_ANY, wxPoint(2, 2), wxSize(width, height));
|
||||
wxPanel* p_esn = new wxPanel(nb_config, wxID_ANY);
|
||||
wxPanel* p_psn = new wxPanel(nb_config, wxID_ANY);
|
||||
|
||||
wxButton* b_signin = new wxButton(p_esn, wxID_OK, "Fake sign in");
|
||||
wxButton* b_cancel = new wxButton(p_esn, wxID_CANCEL, "Cancel");
|
||||
|
||||
nb_config->AddPage(p_esn, "ESN");
|
||||
nb_config->AddPage(p_psn, "PSN");
|
||||
|
||||
wxBoxSizer* s_subpanel_esn = new wxBoxSizer(wxVERTICAL);
|
||||
wxBoxSizer* s_subpanel_psn = new wxBoxSizer(wxVERTICAL);
|
||||
|
||||
wxStaticText* esn_unimplemented = new wxStaticText(p_esn, wxID_ANY, "ESN support is not ready yet.");
|
||||
wxStaticText* psn_unimplemented = new wxStaticText(p_psn, wxID_ANY, "PSN support is not yet implemented.");
|
||||
|
||||
// ESN
|
||||
s_subpanel_esn->Add(esn_unimplemented, wxSizerFlags().Centre());
|
||||
s_subpanel_esn->Add(b_signin, wxSizerFlags().Left().Border(5).Expand());
|
||||
s_subpanel_esn->Add(b_cancel, wxSizerFlags().Right().Border(5).Expand());
|
||||
|
||||
// PSN
|
||||
s_subpanel_psn->Add(psn_unimplemented, wxSizerFlags().Centre());
|
||||
|
||||
m_dialog->SetSizerAndFit(s_subpanel_esn, false);
|
||||
m_dialog->SetSizerAndFit(s_subpanel_psn, false);
|
||||
|
||||
m_dialog->SetSize(width + 18, height + 42);
|
||||
|
||||
m_dialog->Centre(wxBOTH);
|
||||
m_dialog->Show();
|
||||
m_dialog->Enable();
|
||||
//m_dialog->ShowModal();
|
||||
|
||||
b_signin->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||
{
|
||||
//this->status = CELL_OK;
|
||||
this->m_dialog->Hide();
|
||||
//this->Close();
|
||||
//sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||
});
|
||||
|
||||
b_cancel->Bind(wxEVT_BUTTON, [&](wxCommandEvent& event)
|
||||
{
|
||||
//this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
|
||||
this->m_dialog->Hide();
|
||||
//this->Close();
|
||||
//sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||
});
|
||||
|
||||
m_dialog->Bind(wxEVT_CLOSE_WINDOW, [&](wxCloseEvent& event)
|
||||
{
|
||||
//this->status = CELL_NET_CTL_ERROR_DIALOG_CANCELED;
|
||||
this->m_dialog->Hide();
|
||||
//this->Close();
|
||||
//sysutilSendSystemCommand(CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED, 0);
|
||||
});
|
||||
}
|
||||
|
||||
void SignInDialogFrame::Destroy()
|
||||
{
|
||||
m_dialog.reset();
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class SignInDialogFrame
|
||||
{
|
||||
std::unique_ptr<wxDialog> m_dialog;
|
||||
|
||||
public:
|
||||
virtual void Create();
|
||||
virtual void Destroy();
|
||||
};
|
@ -1,38 +0,0 @@
|
||||
#include "stdafx.h"
|
||||
#include "stdafx_gui.h"
|
||||
#include "TextInputDialog.h"
|
||||
|
||||
TextInputDialog::TextInputDialog(wxWindow* parent, const std::string& defvalue, const std::string& label)
|
||||
: wxDialog(parent, wxID_ANY, label)
|
||||
{
|
||||
m_tctrl_text = new wxTextCtrl(this, wxID_ANY, fmt::ToUTF8(defvalue));
|
||||
|
||||
wxBoxSizer* s_text = new wxBoxSizer(wxVERTICAL);
|
||||
s_text->Add(m_tctrl_text, 1, wxEXPAND);
|
||||
|
||||
wxBoxSizer* s_btns = new wxBoxSizer(wxHORIZONTAL);
|
||||
s_btns->Add(new wxButton(this, wxID_OK));
|
||||
s_btns->AddSpacer(30);
|
||||
s_btns->Add(new wxButton(this, wxID_CANCEL));
|
||||
|
||||
wxBoxSizer* s_main = new wxBoxSizer(wxVERTICAL);
|
||||
s_main->Add(s_text, 1, wxEXPAND | wxUP | wxLEFT | wxRIGHT, 5);
|
||||
s_main->AddSpacer(30);
|
||||
s_main->Add(s_btns, 0, wxCENTER | wxDOWN | wxLEFT | wxRIGHT, 5);
|
||||
|
||||
SetSizerAndFit(s_main);
|
||||
SetSize(250, -1);
|
||||
|
||||
Bind(wxEVT_BUTTON, &TextInputDialog::OnOk, this);
|
||||
}
|
||||
|
||||
void TextInputDialog::OnOk(wxCommandEvent& event)
|
||||
{
|
||||
m_result = fmt::ToUTF8(m_tctrl_text->GetValue());
|
||||
EndModal(wxID_OK);
|
||||
}
|
||||
|
||||
std::string TextInputDialog::GetResult()
|
||||
{
|
||||
return m_result;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class TextInputDialog : public wxDialog
|
||||
{
|
||||
wxTextCtrl* m_tctrl_text;
|
||||
std::string m_result;
|
||||
|
||||
public:
|
||||
TextInputDialog(wxWindow* parent, const std::string& defvalue = "", const std::string& label = "Input text");
|
||||
void OnOk(wxCommandEvent& event);
|
||||
|
||||
std::string GetResult();
|
||||
};
|
@ -1,76 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DLL Debug|x64">
|
||||
<Configuration>DLL Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="DLL Release|x64">
|
||||
<Configuration>DLL Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{00D36322-6188-4A66-B514-3B3F183E998D}</ProjectGuid>
|
||||
<RootNamespace>copy_setup_h</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<Import Project="..\wxWidgets\build\msw\wx_config.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DLL Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DLL Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Utility</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="..\wxWidgets\build\msw\wx_setup.props" />
|
||||
<Import Project="..\wxWidgets\build\msw\wx_local.props" Condition="Exists('wx_local.props')" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="!Exists('..\wxWidgets\include\wx\msw\setup.h') And '$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\Utilities\wxWidgets\setup.h ..\wxWidgets\include\wx\msw\setup.h /Y</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="!Exists('..\wxWidgets\include\wx\msw\setup.h') And '$(Configuration)|$(Platform)'=='DLL Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\Utilities\wxWidgets\setup.h ..\wxWidgets\include\wx\msw\setup.h /Y</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="!Exists('..\wxWidgets\include\wx\msw\setup.h') And '$(Configuration)|$(Platform)'=='DLL Debug|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\Utilities\wxWidgets\setup.h ..\wxWidgets\include\wx\msw\setup.h /Y</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="!Exists('..\wxWidgets\include\wx\msw\setup.h') And '$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<PreBuildEvent>
|
||||
<Command>copy ..\Utilities\wxWidgets\setup.h ..\wxWidgets\include\wx\msw\setup.h /Y</Command>
|
||||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
@ -1,219 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug - LLVM|x64">
|
||||
<Configuration>Debug - LLVM</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug - MemLeak|x64">
|
||||
<Configuration>Debug - MemLeak</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release - LLVM|x64">
|
||||
<Configuration>Release - LLVM</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{70CD65B0-91D6-4FAE-9A7B-4AF55D0D1B12}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>rpcs3</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v140</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\rpcs3_default.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="..\rpcs3_debug.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'" Label="PropertySheets">
|
||||
<Import Project="..\rpcs3_debug.props" />
|
||||
<Import Project="..\rpcs3_memleak.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'" Label="PropertySheets">
|
||||
<Import Project="..\rpcs3_debug.props" />
|
||||
<Import Project="..\rpcs3_llvm.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="..\rpcs3_release.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'" Label="PropertySheets">
|
||||
<Import Project="..\rpcs3_release.props" />
|
||||
<Import Project="..\rpcs3_llvm.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<TargetName>$(ProjectName)-dbg</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<TargetName>$(ProjectName)-dbg</TargetName>
|
||||
<LibraryPath>$(SolutionDir)lib\Debug-$(Platform)\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<TargetName>$(ProjectName)-dbg</TargetName>
|
||||
<LibraryPath>$(SolutionDir)lib\Debug-$(Platform)\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
|
||||
<OutDir>$(SolutionDir)bin\</OutDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<RunCodeAnalysis>false</RunCodeAnalysis>
|
||||
<LibraryPath>$(SolutionDir)lib\Release-$(Platform)\;$(LibraryPath)</LibraryPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
<PreBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
<Message>
|
||||
</Message>
|
||||
</PreBuildEvent>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\wxWidgets\include\msvc;..\wxWidgets\include;..\3rdparty\XAudio2_7;..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">..\Vulkan\glslang-build\hlsl\Debug;..\Vulkan\glslang-build\SPIRV\Debug;..\Vulkan\glslang-build\OGLCompilersDLL\Debug;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Debug;..\Vulkan\Vulkan-build\loader\Debug;..\Vulkan\glslang-build\glslang\Debug;..\3rdparty\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\Vulkan\glslang-build\hlsl\Debug;..\Vulkan\glslang-build\SPIRV\Debug;..\Vulkan\glslang-build\OGLCompilersDLL\Debug;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Debug;..\Vulkan\Vulkan-build\loader\Debug;..\Vulkan\glslang-build\glslang\Debug;..\3rdparty\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">..\Vulkan\glslang-build\hlsl\Debug;..\Vulkan\glslang-build\SPIRV\Debug;..\Vulkan\glslang-build\OGLCompilersDLL\Debug;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Debug;..\Vulkan\Vulkan-build\loader\Debug;..\Vulkan\glslang-build\glslang\Debug;..\3rdparty\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\Vulkan\glslang-build\hlsl\Release;..\Vulkan\glslang-build\SPIRV\Release;..\Vulkan\glslang-build\OGLCompilersDLL\Release;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Release;..\Vulkan\Vulkan-build\loader\Release;..\Vulkan\glslang-build\glslang\Release;..\3rdparty\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">..\Vulkan\glslang-build\hlsl\Release;..\Vulkan\glslang-build\SPIRV\Release;..\Vulkan\glslang-build\OGLCompilersDLL\Release;..\Vulkan\glslang-build\glslang\OSDependent\Windows\Release;..\Vulkan\Vulkan-build\loader\Release;..\Vulkan\glslang-build\glslang\Release;..\3rdparty\OpenAL\libs\Win64;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalLibraryDirectories>..\wxWidgets\lib\vc_x64_lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">wxmsw31ud_adv.lib;wxbase31ud.lib;wxmsw31ud_core.lib;wxmsw31ud_aui.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">wxmsw31ud_adv.lib;wxbase31ud.lib;wxmsw31ud_core.lib;wxmsw31ud_aui.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">wxmsw31ud_adv.lib;wxbase31ud.lib;wxmsw31ud_core.lib;wxmsw31ud_aui.lib;wxtiffd.lib;wxjpegd.lib;wxpngd.lib;wxzlibd.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">wxmsw31u_adv.lib;wxbase31u.lib;wxmsw31u_core.lib;wxmsw31u_aui.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">wxmsw31u_adv.lib;wxbase31u.lib;wxmsw31u_core.lib;wxmsw31u_aui.lib;wxtiff.lib;wxjpeg.lib;wxpng.lib;wxzlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalDependencies>VKstatic.1.lib;glslang.lib;OSDependent.lib;OGLCompiler.lib;SPIRV.lib;HLSL.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<BaseAddress>0x10000</BaseAddress>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>true</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BasicKeyboardHandler.cpp" />
|
||||
<ClCompile Include="BasicMouseHandler.cpp" />
|
||||
<ClCompile Include="DS4PadHandler.cpp" />
|
||||
<ClCompile Include="Gui\AutoPauseManager.cpp" />
|
||||
<ClCompile Include="Gui\CgDisasm.cpp" />
|
||||
<ClCompile Include="Gui\ConLogFrame.cpp" />
|
||||
<ClCompile Include="Gui\Debugger.cpp" />
|
||||
<ClCompile Include="Gui\FrameBase.cpp" />
|
||||
<ClCompile Include="Gui\GameViewer.cpp" />
|
||||
<ClCompile Include="Gui\GLGSFrame.cpp" />
|
||||
<ClCompile Include="Gui\GSFrame.cpp" />
|
||||
<ClCompile Include="Gui\InstructionEditor.cpp" />
|
||||
<ClCompile Include="Gui\InterpreterDisAsm.cpp" />
|
||||
<ClCompile Include="Gui\KernelExplorer.cpp" />
|
||||
<ClCompile Include="Gui\MainFrame.cpp" />
|
||||
<ClCompile Include="Gui\MemoryStringSearcher.cpp" />
|
||||
<ClCompile Include="Gui\MemoryViewer.cpp" />
|
||||
<ClCompile Include="Gui\MsgDialog.cpp" />
|
||||
<ClCompile Include="Gui\OskDialog.cpp" />
|
||||
<ClCompile Include="Gui\PADManager.cpp" />
|
||||
<ClCompile Include="Gui\RegisterEditor.cpp" />
|
||||
<ClCompile Include="Gui\RSXDebugger.cpp" />
|
||||
<ClCompile Include="Gui\SaveDataDialog.cpp" />
|
||||
<ClCompile Include="Gui\SaveDataUtility.cpp" />
|
||||
<ClCompile Include="Gui\SettingsDialog.cpp" />
|
||||
<ClCompile Include="Gui\SignInDialog.cpp" />
|
||||
<ClCompile Include="Gui\TextInputDialog.cpp" />
|
||||
<ClCompile Include="KeyboardPadHandler.cpp" />
|
||||
<ClCompile Include="MMJoystickHandler.cpp" />
|
||||
<ClCompile Include="rpcs3.cpp" />
|
||||
<ClCompile Include="XInputPadHandler.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="rpcs3_.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Utilities\MTProgressDialog.h" />
|
||||
<ClInclude Include="DS4PadHandler.h" />
|
||||
<ClInclude Include="Gui\AboutDialog.h" />
|
||||
<ClInclude Include="Gui\AutoPauseManager.h" />
|
||||
<ClInclude Include="Gui\CgDisasm.h" />
|
||||
<ClInclude Include="Gui\ConLogFrame.h" />
|
||||
<ClInclude Include="Gui\Debugger.h" />
|
||||
<ClInclude Include="Gui\FrameBase.h" />
|
||||
<ClInclude Include="Gui\GameViewer.h" />
|
||||
<ClInclude Include="Gui\GLGSFrame.h" />
|
||||
<ClInclude Include="Gui\GSFrame.h" />
|
||||
<ClInclude Include="Gui\InstructionEditor.h" />
|
||||
<ClInclude Include="Gui\InterpreterDisAsm.h" />
|
||||
<ClInclude Include="Gui\KernelExplorer.h" />
|
||||
<ClInclude Include="Gui\MainFrame.h" />
|
||||
<ClInclude Include="Gui\MemoryStringSearcher.h" />
|
||||
<ClInclude Include="Gui\MemoryViewer.h" />
|
||||
<ClInclude Include="Gui\MsgDialog.h" />
|
||||
<ClInclude Include="Gui\PADManager.h" />
|
||||
<ClInclude Include="Gui\RegisterEditor.h" />
|
||||
<ClInclude Include="Gui\RSXDebugger.h" />
|
||||
<ClInclude Include="Gui\SaveDataDialog.h" />
|
||||
<ClInclude Include="Gui\SaveDataUtility.h" />
|
||||
<ClInclude Include="Gui\SettingsDialog.h" />
|
||||
<ClInclude Include="Gui\SignInDialog.h" />
|
||||
<ClInclude Include="Gui\TextInputDialog.h" />
|
||||
<ClInclude Include="KeyboardPadHandler.h" />
|
||||
<ClInclude Include="MMJoystickHandler.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="rpcs3.h" />
|
||||
<ClInclude Include="stdafx_gui.h" />
|
||||
<ClInclude Include="BasicKeyboardHandler.h" />
|
||||
<ClInclude Include="BasicMouseHandler.h" />
|
||||
<ClInclude Include="XInputPadHandler.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\3rdparty\hidapi\windows\hidapi.vcxproj">
|
||||
<Project>{a107c21c-418a-4697-bb10-20c3aa60e2e4}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="D3D12GSRender.vcxproj">
|
||||
<Project>{fac9b17b-f4b8-4b75-8aeb-c8c7cb92b078}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="emucore.vcxproj">
|
||||
<Project>{c4a10229-4712-4bd2-b63e-50d93c67a038}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="GLGSRender.vcxproj">
|
||||
<Project>{3384223a-6d97-4799-9862-359f85312892}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="OpenAL.vcxproj">
|
||||
<Project>{30a05c4d-f5fd-421c-a864-17a64bdeaa75}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="VKGSRender.vcxproj">
|
||||
<Project>{3ee5f075-b546-42c4-b6a8-e3ccef38b78d}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="XAudio.vcxproj">
|
||||
<Project>{78cb2f39-b809-4a06-8329-8c0a19119d3d}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="rpcs3.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
Loading…
x
Reference in New Issue
Block a user