diff --git a/Source/Core/Core/Src/Boot/Boot.cpp b/Source/Core/Core/Src/Boot/Boot.cpp index fa0369c9d4..55a45ea567 100644 --- a/Source/Core/Core/Src/Boot/Boot.cpp +++ b/Source/Core/Core/Src/Boot/Boot.cpp @@ -294,6 +294,9 @@ bool CBoot::BootUp() // =================================================================================== case SCoreStartupParameter::BOOT_WII_NAND: Boot_WiiWAD(_StartupPara.m_strFilename.c_str()); + + if (LoadMapFromFilename(_StartupPara.m_strFilename)) + HLE::PatchFunctions(); break; diff --git a/Source/Core/Core/Src/HW/WII_IOB.cpp b/Source/Core/Core/Src/HW/WII_IOB.cpp index dbc72d3b21..aae05b533a 100644 --- a/Source/Core/Core/Src/HW/WII_IOB.cpp +++ b/Source/Core/Core/Src/HW/WII_IOB.cpp @@ -103,7 +103,7 @@ void Write32(const u32 _Value, const u32 _Address) { // NANDLoader ... no idea case 0x18: - ERROR_LOG(WII_IOB, 0, "IOP: Write32 0x%08x to 0x%08x (NANDLoader)", _Value, _Address); + ERROR_LOG(WII_IOB, "IOP: Write32 0x%08x to 0x%08x (NANDLoader)", _Value, _Address); break; // WiiMenu... no idea case 0x24: diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp index efe7d6cca4..19c1898393 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -164,8 +164,8 @@ s32 CWII_IPC_HLE_Device_net_kd_request::ExecuteCommand(u32 _Parameter, u32 _Buff case IOCTL_NWC24_STARTUP: return 0; - case IOCTL_SO_GETSOCKOPT: // WiiMenu - case IOCTL_SO_SETSOCKOPT: + case 8: // WiiMenu + case 9: return 0; case 0xf: // NWC24iRequestGenerateUserId (Input: none, Output: 32 bytes) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.cpp b/Source/Core/DebuggerWX/Src/CodeWindow.cpp index d22c0b5f60..0c4f96e029 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindow.cpp @@ -138,6 +138,7 @@ BEGIN_EVENT_TABLE(CCodeWindow, wxFrame) EVT_MENU(IDM_CREATESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_USESIGNATUREFILE, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_PATCHHLEFUNCTIONS, CCodeWindow::OnSymbolsMenu) + EVT_MENU(IDM_RENAME_SYMBOLS, CCodeWindow::OnSymbolsMenu) EVT_MENU(IDM_CLEARCODECACHE, CCodeWindow::OnJitMenu) EVT_MENU(IDM_LOGINSTRUCTIONS, CCodeWindow::OnJitMenu) diff --git a/Source/Core/DebuggerWX/Src/CodeWindow.h b/Source/Core/DebuggerWX/Src/CodeWindow.h index 393c536a75..398df860fa 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindow.h +++ b/Source/Core/DebuggerWX/Src/CodeWindow.h @@ -99,6 +99,7 @@ class CCodeWindow IDM_LOADMAPFILE, IDM_SAVEMAPFILE, IDM_SAVEMAPFILEWITHCODES, IDM_CREATESIGNATUREFILE, + IDM_RENAME_SYMBOLS, IDM_USESIGNATUREFILE, //IDM_USESYMBOLFILE, // not used IDM_PATCHHLEFUNCTIONS, diff --git a/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp b/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp index 1f4959ea14..ec34fce38f 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowSJP.cpp @@ -105,6 +105,7 @@ void CCodeWindow::CreateSymbolsMenu() pSymbolsMenu->Append(IDM_USESIGNATUREFILE, _T("&Use signature file...")); pSymbolsMenu->AppendSeparator(); pSymbolsMenu->Append(IDM_PATCHHLEFUNCTIONS, _T("&Patch HLE functions")); + pSymbolsMenu->Append(IDM_RENAME_SYMBOLS, _T("&Rename symbols from file...")); pMenuBar->Append(pSymbolsMenu, _T("&Symbols")); wxMenu *pJitMenu = new wxMenu; @@ -160,7 +161,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) break; case IDM_SCANFUNCTIONS: { - PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB); + PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB); SignatureDB db; if (db.Load(TOTALDB_FILE)) db.Apply(&g_symbolDB); @@ -173,13 +174,14 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) if (!File::Exists(mapfile.c_str())) { g_symbolDB.Clear(); - PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB); + PPCAnalyst::FindFunctions(0x81300000, 0x81800000, &g_symbolDB); SignatureDB db; if (db.Load(TOTALDB_FILE)) db.Apply(&g_symbolDB); } else { g_symbolDB.LoadMap(mapfile.c_str()); } + HLE::PatchFunctions(); NotifyMapLoaded(); break; case IDM_SAVEMAPFILE: @@ -188,6 +190,42 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) case IDM_SAVEMAPFILEWITHCODES: g_symbolDB.SaveMap(mapfile.c_str(), true); break; + + case IDM_RENAME_SYMBOLS: + { + wxString path = wxFileSelector( + _T("Apply signature file"), wxEmptyString, wxEmptyString, wxEmptyString, + _T("Dolphin Symbole Rename File (*.sym)|*.sym;"), wxFD_OPEN | wxFD_FILE_MUST_EXIST, + this); + if (path) + { + FILE *f = fopen(path, "r"); + if (!f) + return; + + bool started = false; + while (!feof(f)) + { + char line[512], temp[256]; + fgets(line, 511, f); + if (strlen(line) < 4) + continue; + + u32 address, type; + char name[512]; + sscanf(line, "%08x %02i %s", &address, &type, name); + + Symbol *symbol = g_symbolDB.GetSymbolFromAddr(address); + if (symbol) { + symbol->name = line+12; + } + } + fclose(f); + Host_NotifyMapLoaded(); + } + } + break; + case IDM_CREATESIGNATUREFILE: { wxTextEntryDialog input_prefix(this, wxString::FromAscii("Only export symbols with prefix:"), wxGetTextFromUserPromptStr, _T("."));