mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-05-16 08:02:39 +00:00
Merge pull request #5140 from sepalani/signature_db
SignatureDB: Rewrite FormatHandler API
This commit is contained in:
commit
7c3905a612
15 changed files with 198 additions and 102 deletions
|
@ -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())
|
||||
|
@ -190,7 +191,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 +240,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",
|
||||
|
@ -352,9 +353,10 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|||
wxFD_SAVE | wxFD_OVERWRITE_PROMPT, this);
|
||||
if (!path.IsEmpty())
|
||||
{
|
||||
SignatureDB db;
|
||||
db.Initialize(&g_symbolDB, prefix);
|
||||
db.Save(WxStrToStr(path));
|
||||
std::string save_path = WxStrToStr(path);
|
||||
SignatureDB db(save_path);
|
||||
db.Populate(&g_symbolDB, prefix);
|
||||
db.Save(save_path);
|
||||
db.List();
|
||||
}
|
||||
}
|
||||
|
@ -375,11 +377,12 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|||
wxEmptyString, signature_selector, wxFD_SAVE, this);
|
||||
if (!path.IsEmpty())
|
||||
{
|
||||
SignatureDB db;
|
||||
db.Initialize(&g_symbolDB, prefix);
|
||||
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 +395,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 +411,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,
|
||||
|
@ -425,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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue