CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/Debugger/DebuggerShared.cpp
Views: 1401
1
#include "Common/Data/Encoding/Utf8.h"
2
3
#include "DebuggerShared.h"
4
#include "../InputBox.h"
5
6
bool parseExpression(const char* exp, DebugInterface* cpu, u32& dest)
7
{
8
PostfixExpression postfix;
9
if (cpu->initExpression(exp,postfix) == false) return false;
10
return cpu->parseExpression(postfix,dest);
11
}
12
13
void displayExpressionError(HWND hwnd)
14
{
15
MessageBox(hwnd,ConvertUTF8ToWString(getExpressionError()).c_str(),L"Invalid expression",MB_OK);
16
}
17
18
bool executeExpressionWindow(HWND hwnd, DebugInterface* cpu, u32& dest)
19
{
20
std::string expression;
21
if (InputBox_GetString(GetModuleHandle(NULL), hwnd, L"Expression", "", expression) == false)
22
{
23
return false;
24
}
25
26
if (parseExpression(expression.c_str(), cpu, dest) == false)
27
{
28
displayExpressionError(hwnd);
29
return false;
30
}
31
32
return true;
33
}
34
35