mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
36 lines
788 B
C++
36 lines
788 B
C++
#include "pch.h"
|
|
#include "Debugger/ScriptHost.h"
|
|
#include "Debugger/ScriptingContext.h"
|
|
#include "Debugger/ScriptingContext.h"
|
|
#include "Shared/EventType.h"
|
|
#include "Shared/MemoryOperationType.h"
|
|
|
|
ScriptHost::ScriptHost(int scriptId)
|
|
{
|
|
_scriptId = scriptId;
|
|
}
|
|
|
|
int ScriptHost::GetScriptId()
|
|
{
|
|
return _scriptId;
|
|
}
|
|
|
|
string ScriptHost::GetLog()
|
|
{
|
|
shared_ptr<ScriptingContext> context = _context.lock();
|
|
return context ? context->GetLog() : "";
|
|
}
|
|
|
|
bool ScriptHost::LoadScript(string scriptName, string scriptContent, Debugger* debugger)
|
|
{
|
|
_context.reset(new ScriptingContext(debugger));
|
|
if(!_context->LoadScript(scriptName, scriptContent, debugger)) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
void ScriptHost::ProcessEvent(EventType eventType)
|
|
{
|
|
_context->CallEventCallback(eventType);
|
|
}
|