mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 00:09:24 +01:00
GUI: Made the symbols menu talk more
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4181 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
486798c580
commit
8cd6e1d409
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
#include "../HW/Memmap.h"
|
#include "../HW/Memmap.h"
|
||||||
#include "../PowerPC/PowerPC.h"
|
#include "../PowerPC/PowerPC.h"
|
||||||
|
#include "../Host.h"
|
||||||
|
#include "StringUtil.h"
|
||||||
#include "PPCSymbolDB.h"
|
#include "PPCSymbolDB.h"
|
||||||
#include "SignatureDB.h"
|
#include "SignatureDB.h"
|
||||||
#include "PPCAnalyst.h"
|
#include "PPCAnalyst.h"
|
||||||
@ -274,6 +276,16 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const
|
|||||||
std::string mapFile = filename;
|
std::string mapFile = filename;
|
||||||
if (WithCodes) mapFile = mapFile.substr(0, mapFile.find_last_of(".")) + "_code.map";
|
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
|
// Make a file
|
||||||
FILE *f = fopen(mapFile.c_str(), "w");
|
FILE *f = fopen(mapFile.c_str(), "w");
|
||||||
if (!f) return false;
|
if (!f) return false;
|
||||||
@ -330,11 +342,12 @@ bool PPCSymbolDB::SaveMap(const char *filename, bool WithCodes) const
|
|||||||
debugger->disasm(Address, disasm, 256);
|
debugger->disasm(Address, disasm, 256);
|
||||||
fprintf(f,"%08x %i %20s %s\n", Address, 0, TempSym.c_str(), disasm);
|
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);
|
fclose(f);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -232,15 +232,13 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|||||||
{
|
{
|
||||||
Parent->ClearStatusBar();
|
Parent->ClearStatusBar();
|
||||||
|
|
||||||
if (Core::GetState() == Core::CORE_UNINITIALIZED)
|
if (Core::GetState() == Core::CORE_UNINITIALIZED) return;
|
||||||
{
|
|
||||||
// TODO: disable menu items instead :P
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
std::string mapfile = CBoot::GenerateMapFilename();
|
std::string mapfile = CBoot::GenerateMapFilename();
|
||||||
switch (event.GetId())
|
switch (event.GetId())
|
||||||
{
|
{
|
||||||
case IDM_CLEARSYMBOLS:
|
case IDM_CLEARSYMBOLS:
|
||||||
|
if(!AskYesNo("Do you want to clear the list of symbol names?", "Confirm", wxYES_NO)) return;
|
||||||
g_symbolDB.Clear();
|
g_symbolDB.Clear();
|
||||||
Host_NotifyMapLoaded();
|
Host_NotifyMapLoaded();
|
||||||
break;
|
break;
|
||||||
@ -253,9 +251,16 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
|
|||||||
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
|
PPCAnalyst::FindFunctions(0x80000000, 0x80400000, &g_symbolDB);
|
||||||
SignatureDB db;
|
SignatureDB db;
|
||||||
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
|
if (db.Load((File::GetSysDirectory() + TOTALDB).c_str()))
|
||||||
|
{
|
||||||
db.Apply(&g_symbolDB);
|
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();
|
// HLE::PatchFunctions();
|
||||||
|
// Update GUI
|
||||||
NotifyMapLoaded();
|
NotifyMapLoaded();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -629,7 +629,7 @@ void CFrame::DoStop()
|
|||||||
{
|
{
|
||||||
// Ask for confirmation in case the user accidently clicked Stop / Escape
|
// Ask for confirmation in case the user accidently clicked Stop / Escape
|
||||||
if(SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
|
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;
|
return;
|
||||||
|
|
||||||
// TODO: Show the author/description dialog here
|
// TODO: Show the author/description dialog here
|
||||||
|
@ -518,7 +518,10 @@ void Host_UpdateStatusBar(const char* _pText, int Field)
|
|||||||
event.SetInt(Field);
|
event.SetInt(Field);
|
||||||
// Post message
|
// Post message
|
||||||
// TODO : this has been said to cause hang (??) how is that even possible ? :d
|
// TODO : this has been said to cause hang (??) how is that even possible ? :d
|
||||||
|
event.StopPropagation();
|
||||||
wxPostEvent(main_frame, event);
|
wxPostEvent(main_frame, event);
|
||||||
|
// Process the event before continue
|
||||||
|
wxYieldIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Host_SetWiiMoteConnectionState(int _State)
|
void Host_SetWiiMoteConnectionState(int _State)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user