From 8cd6e1d409c70fd2066b29b53c6960a231e1a8d7 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Thu, 3 Sep 2009 09:13:41 +0000 Subject: [PATCH] GUI: Made the symbols menu talk more git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4181 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/PPCSymbolDB.cpp | 17 +++++++++++++++-- .../Core/DebuggerWX/Src/CodeWindowFunctions.cpp | 17 +++++++++++------ Source/Core/DolphinWX/Src/FrameTools.cpp | 2 +- Source/Core/DolphinWX/Src/Main.cpp | 3 +++ 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/PPCSymbolDB.cpp b/Source/Core/Core/Src/PowerPC/PPCSymbolDB.cpp index a198409f89..e080140c5c 100644 --- a/Source/Core/Core/Src/PowerPC/PPCSymbolDB.cpp +++ b/Source/Core/Core/Src/PowerPC/PPCSymbolDB.cpp @@ -23,6 +23,8 @@ #include "../HW/Memmap.h" #include "../PowerPC/PowerPC.h" +#include "../Host.h" +#include "StringUtil.h" #include "PPCSymbolDB.h" #include "SignatureDB.h" #include "PPCAnalyst.h" @@ -274,6 +276,16 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const std::string mapFile = filename; if (WithCodes) mapFile = mapFile.substr(0, mapFile.find_last_of(".")) + "_code.map"; + // Check size + const int wxYES_NO = 0x00000002 | 0x00000008; + if (functions.size() == 0) + { + if(!AskYesNo(StringFromFormat( + "No symbol names are generated. Do you want to replace '%s' with a blank file?", + mapFile.c_str()).c_str(), "Confirm", wxYES_NO)) return false; + } + if (WithCodes) Host_UpdateStatusBar("Saving code, please stand by ..."); + // Make a file FILE *f = fopen(mapFile.c_str(), "w"); if (!f) return false; @@ -330,11 +342,12 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const debugger->disasm(Address, disasm, 256); fprintf(f,"%08x %i %20s %s\n", Address, 0, TempSym.c_str(), disasm); } - fprintf(f, "\n"); // Write a blank line after each block + // Write a blank line after each block + fprintf(f, "\n"); } } // --------------- - SuccessAlert("Saved %s", mapFile.c_str()); + Host_UpdateStatusBar(StringFromFormat("Saved %s", mapFile.c_str()).c_str()); fclose(f); return true; } diff --git a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp index 990e2f4062..c68f75882c 100644 --- a/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp +++ b/Source/Core/DebuggerWX/Src/CodeWindowFunctions.cpp @@ -232,15 +232,13 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) { Parent->ClearStatusBar(); - if (Core::GetState() == Core::CORE_UNINITIALIZED) - { - // TODO: disable menu items instead :P - return; - } + if (Core::GetState() == Core::CORE_UNINITIALIZED) return; + std::string mapfile = CBoot::GenerateMapFilename(); switch (event.GetId()) { case IDM_CLEARSYMBOLS: + if(!AskYesNo("Do you want to clear the list of symbol names?", "Confirm", wxYES_NO)) return; g_symbolDB.Clear(); Host_NotifyMapLoaded(); break; @@ -253,9 +251,16 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event) PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB); SignatureDB db; if (db.Load((File::GetSysDirectory() + TOTALDB).c_str())) + { db.Apply(&g_symbolDB); - + Parent->StatusBarMessage("Generated symbol names from '%s'", TOTALDB); + } + else + { + Parent->StatusBarMessage("'%s' not found, no symbol names generated", TOTALDB); + } // HLE::PatchFunctions(); + // Update GUI NotifyMapLoaded(); break; } diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 3414a64b80..d72397c200 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -629,7 +629,7 @@ void CFrame::DoStop() { // Ask for confirmation in case the user accidently clicked Stop / Escape if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop) - if(!AskYesNo("Are you sure you want to stop the current emulation?", "Confirm", wxYES_NO)) + if(!AskYesNo("Do want to stop the current emulation?", "Confirm", wxYES_NO)) return; // TODO: Show the author/description dialog here diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 2443a44f91..815824ad11 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -518,7 +518,10 @@ void Host_UpdateStatusBar(const char* _pText, int Field) event.SetInt(Field); // Post message // TODO : this has been said to cause hang (??) how is that even possible ? :d + event.StopPropagation(); wxPostEvent(main_frame, event); + // Process the event before continue + wxYieldIfNeeded(); } void Host_SetWiiMoteConnectionState(int _State)