From 2daf5cb86fb268909a8c5821cdb4aaed87bdd4f1 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Thu, 16 Mar 2017 23:13:18 +0000 Subject: SignatureDB: const correctness and cleanup --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index f271c8a979..c939126827 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -353,7 +353,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Initialize(&g_symbolDB, prefix); + db.Populate(&g_symbolDB, prefix); db.Save(WxStrToStr(path)); db.List(); } @@ -376,7 +376,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!path.IsEmpty()) { SignatureDB db; - db.Initialize(&g_symbolDB, prefix); + db.Populate(&g_symbolDB, prefix); db.List(); db.Load(WxStrToStr(path)); db.Save(WxStrToStr(path)); -- cgit v1.2.3 From a9b52ce91b9ebe5c93aa2e5bd869717d405d9332 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Fri, 24 Mar 2017 00:31:52 +0000 Subject: SignatureDB: Rewrite FormatHandler API --- .../DolphinWX/Debugger/CodeWindowFunctions.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index c939126827..8918ece441 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -352,9 +352,10 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this); if (!path.IsEmpty()) { - SignatureDB db; + std::string save_path = WxStrToStr(path); + SignatureDB db(save_path); db.Populate(&g_symbolDB, prefix); - db.Save(WxStrToStr(path)); + db.Save(save_path); db.List(); } } @@ -375,11 +376,12 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) wxEmptyString, signature_selector, wxFD_SAVE, this); if (!path.IsEmpty()) { - SignatureDB db; + std::string signature_path = WxStrToStr(path); + SignatureDB db(signature_path); db.Populate(&g_symbolDB, prefix); db.List(); - db.Load(WxStrToStr(path)); - db.Save(WxStrToStr(path)); + db.Load(signature_path); + db.Save(signature_path); db.List(); } } @@ -392,8 +394,9 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) wxEmptyString, signature_selector, wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path.IsEmpty()) { - SignatureDB db; - db.Load(WxStrToStr(path)); + std::string load_path = WxStrToStr(path); + SignatureDB db(load_path); + db.Load(load_path); db.Apply(&g_symbolDB); db.List(); NotifyMapLoaded(); @@ -407,14 +410,15 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) wxEmptyString, signature_selector, wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path1.IsEmpty()) { - SignatureDB db; + std::string load_path1 = WxStrToStr(path1); + SignatureDB db(load_path1); wxString path2 = wxFileSelector(_("Choose secondary input file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, signature_selector, wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); if (!path2.IsEmpty()) { + db.Load(load_path1); db.Load(WxStrToStr(path2)); - db.Load(WxStrToStr(path1)); path2 = wxFileSelector(_("Save combined output file as"), File::GetSysDirectory(), wxEmptyString, ".dsy", signature_selector, -- cgit v1.2.3 From 82afda94f4dbc9f90877459f81dab1b35732d068 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Fri, 24 Mar 2017 19:47:41 +0000 Subject: SignatureDB: Use explicit construction --- Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 8918ece441..170027068d 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -190,7 +190,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) case IDM_SCAN_SIGNATURES: { PPCAnalyst::FindFunctions(0x80000000, 0x81800000, &g_symbolDB); - SignatureDB db; + SignatureDB db(SignatureDB::HandlerType::DSY); if (db.Load(File::GetSysDirectory() + TOTALDB)) { db.Apply(&g_symbolDB); @@ -239,7 +239,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { g_symbolDB.Clear(); PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB); - SignatureDB db; + SignatureDB db(SignatureDB::HandlerType::DSY); if (db.Load(File::GetSysDirectory() + TOTALDB)) db.Apply(&g_symbolDB); Parent->StatusBarMessage("'%s' not found, scanning for common functions instead", -- cgit v1.2.3 From 5f81226d8d728c48224d7efed1f743434f1a6d64 Mon Sep 17 00:00:00 2001 From: Sepalani Date: Fri, 31 Mar 2017 13:00:19 +0100 Subject: SignatureDB: MEGA FormatHandler added --- .../Core/DolphinWX/Debugger/CodeWindowFunctions.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp') diff --git a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp index 170027068d..ad37367bb3 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindowFunctions.cpp @@ -166,7 +166,8 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { static const wxString signature_selector = _("Dolphin Signature File (*.dsy)") + "|*.dsy|" + _("Dolphin Signature CSV File (*.csv)") + "|*.csv|" + - wxGetTranslation(wxALL_FILES); + _("WiiTools Signature MEGA File (*.mega)") + + "|*.mega|" + wxGetTranslation(wxALL_FILES); Parent->ClearStatusBar(); if (!Core::IsRunning()) @@ -429,22 +430,6 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) } } break; - case IDM_USE_MEGA_SIGNATURE_FILE: - { - wxString path = wxFileSelector( - _("Apply MEGA signature file"), File::GetSysDirectory(), wxEmptyString, wxEmptyString, - _("MEGA Signature File (*.mega)") + "|*.mega|" + wxGetTranslation(wxALL_FILES), - wxFD_OPEN | wxFD_FILE_MUST_EXIST, this); - if (!path.IsEmpty()) - { - MEGASignatureDB db; - db.Load(WxStrToStr(path)); - db.Apply(&g_symbolDB); - db.List(); - NotifyMapLoaded(); - } - } - break; case IDM_PATCH_HLE_FUNCTIONS: HLE::PatchFunctions(); Repopulate(); -- cgit v1.2.3