Merge pull request #9628 from unknownbrackets/headless

Fix headless crash on start and graphics tests
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2017-04-21 09:26:54 +02:00
commit 2c6161c2cf
3 files changed
+8 -4

No files matched your search

+4 -2
View File
@@ -833,6 +833,8 @@ namespace MIPSComp {
ir.Write(IROp::FNeg, tempregs[i], tempregs[i]);
break;
case 28: // d[i] = 1.0f / expf(s[i] * (float)M_LOG2E); break; // vrexp2
DISABLE;
break;
default:
INVALIDOP;
}
@@ -1276,7 +1278,7 @@ namespace MIPSComp {
}
// Otherwise, n should already be ins + 1.
else if (n != ins + 1) {
DISABLE;
INVALIDOP;
}
u8 sregs[16], dregs[4], tregs[4];
@@ -1895,7 +1897,7 @@ namespace MIPSComp {
int n = GetNumVectorElements(sz);
if (n != 2 && n != 4) {
// Bad instructions
DISABLE;
INVALIDOP;
}
u8 sregs[4], dregs[4];
+1 -1
View File
@@ -255,7 +255,7 @@ static std::string NormalizePath(const std::string &path) {
#ifdef _WIN32
wchar_t buf[512] = {0};
std::wstring wpath = ConvertUTF8ToWString(path);
if (GetFullPathName(wpath.c_str(), sizeof(buf) - 1, buf, NULL) == 0)
if (GetFullPathName(wpath.c_str(), (int)ARRAY_SIZE(buf) - 1, buf, NULL) == 0)
return "";
return ConvertWStringToUTF8(buf);
#else
+3 -1
View File
@@ -9,6 +9,7 @@
#include "file/zip_read.h"
#include "profiler/profiler.h"
#include "Common/FileUtil.h"
#include "Common/GraphicsContext.h"
#include "Core/Config.h"
#include "Core/Core.h"
#include "Core/CoreTiming.h"
@@ -292,7 +293,7 @@ int main(int argc, const char* argv[])
host = headlessHost;
std::string error_string;
GraphicsContext *graphicsContext;
GraphicsContext *graphicsContext = nullptr;
bool glWorking = host->InitGraphics(&error_string, &graphicsContext);
LogManager::Init();
@@ -311,6 +312,7 @@ int main(int argc, const char* argv[])
coreParameter.cpuCore = cpuCore;
coreParameter.gpuCore = glWorking ? gpuCore : GPUCORE_NULL;
coreParameter.graphicsContext = graphicsContext;
coreParameter.thin3d = graphicsContext ? graphicsContext->GetDrawContext() : nullptr;
coreParameter.enableSound = false;
coreParameter.mountIso = mountIso ? mountIso : "";
coreParameter.mountRoot = mountRoot ? mountRoot : "";