Skip to content
Permalink
Browse files
JitcEnabled command
  • Loading branch information
ogamespec committed Jun 8, 2021
1 parent 01a49dd commit d4a4bdadcbae9f9c22b07a413843e64869ea143e
@@ -315,6 +315,12 @@

"JitcInvAll": {
"help": "Invalidate all recompiler segments except the current one."
},

"JitcEnabled": {
"internal": true,
"help": "A method for the GUI to find out if JITC is enabled or not.",
"output": "Bool"
}

}
@@ -9,7 +9,7 @@
#endif

#ifndef GEKKOCORE_JITC_HALT_ON_UNIMPLEMENTED_OPCODE
#define GEKKOCORE_JITC_HALT_ON_UNIMPLEMENTED_OPCODE 1 //!< Halt the emulation on an unimplemented opcode, instead of passing control to the interpeter fallback
#define GEKKOCORE_JITC_HALT_ON_UNIMPLEMENTED_OPCODE 0 //!< Halt the emulation on an unimplemented opcode, instead of passing control to the interpeter fallback
#endif

#ifndef GEKKOCORE_SIMPLE_MMU
@@ -1071,6 +1071,20 @@ namespace Gekko
return nullptr;
}

Json::Value* CmdJitcEnabled(std::vector<std::string>& args)
{
Json::Value* output = new Json::Value();
output->type = Json::ValueType::Bool;

#if GEKKOCORE_USE_JITC
output->value.AsBool = true;
#else
output->value.AsBool = false;
#endif

return output;
}

void gekko_init_handlers()
{
JDI::Hub.AddCmd("run", CmdRun);
@@ -1131,5 +1145,6 @@ namespace Gekko
JDI::Hub.AddCmd("JitcDumpSeg", JitCommands::CmdJitcDumpSeg);
JDI::Hub.AddCmd("JitcInvSeg", JitCommands::CmdJitcInvSeg);
JDI::Hub.AddCmd("JitcInvAll", JitCommands::CmdJitcInvAll);
JDI::Hub.AddCmd("JitcEnabled", CmdJitcEnabled);
}
}
@@ -24,6 +24,8 @@ static INT_PTR CALLBACK AboutProc(
auto platform = L"x86";
#endif

auto jitc = UI::Jdi->JitcEnabled() ? L"JITC" : L"";

UNREFERENCED_PARAMETER(lParam);
switch(uMsg)
{
@@ -38,12 +40,12 @@ static INT_PTR CALLBACK AboutProc(
std::string dateStamp = __DATE__;
std::string timeStamp = __TIME__;

auto buffer = fmt::format(L"{:s} - {:s}\n{:s}\n{:s} {:s} {:s} {:s} ({:s} {:s})\n",
auto buffer = fmt::format(L"{:s} - {:s}\n{:s}\n{:s} {:s} {:s} {:s} {:s} ({:s} {:s})\n",
APPNAME, APPDESC,
L"Copyright 2003,2004,2020,2021 Dolwin team",
L"Build version",
Util::StringToWstring(UI::Jdi->GetVersion()),
version, platform,
version, platform, jitc,
Util::StringToWstring(dateStamp),
Util::StringToWstring(timeStamp) );

@@ -307,4 +307,12 @@ namespace UI
return res;
}

bool JdiClient::JitcEnabled()
{
Json::Value* value = CallJdi("JitcEnabled");
bool enabled = value->value.AsBool;
delete value;
return enabled;
}

}
@@ -94,6 +94,10 @@ namespace UI
void ResetPerformanceCounter(int counter);
std::string GetSystemTime();

// Misc

bool JitcEnabled();

};

extern JdiClient * Jdi;

0 comments on commit d4a4bda

Please sign in to comment.