mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
35 lines
840 B
C++
35 lines
840 B
C++
#include "Common/Data/Encoding/Utf8.h"
|
|
#include "Core/MIPS/MIPSDebugInterface.h"
|
|
|
|
#include "DebuggerShared.h"
|
|
#include "../InputBox.h"
|
|
|
|
bool parseExpression(const char* exp, DebugInterface* cpu, u32& dest)
|
|
{
|
|
PostfixExpression postfix;
|
|
if (initExpression(cpu, exp, postfix) == false)
|
|
return false;
|
|
return parseExpression(cpu, postfix, dest);
|
|
}
|
|
|
|
void displayExpressionError(HWND hwnd)
|
|
{
|
|
MessageBox(hwnd,ConvertUTF8ToWString(getExpressionError()).c_str(),L"Invalid expression",MB_OK);
|
|
}
|
|
|
|
bool executeExpressionWindow(HWND hwnd, DebugInterface* cpu, u32& dest)
|
|
{
|
|
std::string expression;
|
|
if (InputBox_GetString(GetModuleHandle(NULL), hwnd, L"Expression", "", expression) == false)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
if (parseExpression(expression.c_str(), cpu, dest) == false)
|
|
{
|
|
displayExpressionError(hwnd);
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|