From fc50860f55fbc3f5cd26f6d09c25f9e39385505f Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 3 Sep 2022 21:05:58 -0700 Subject: [PATCH] headless: Fix startup on latest Android versions. Otherwise it tries to use deprecated ashmem and chokes. --- Core/System.cpp | 1 + headless/Headless.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Core/System.cpp b/Core/System.cpp index dc0764f86e..29b1765fb0 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -295,6 +295,7 @@ bool CPU_Init(std::string *errorString) { HLEPlugins::Init(); if (!Memory::Init()) { // We're screwed. + *errorString = "Memory init failed"; return false; } mipsr4k.Reset(); diff --git a/headless/Headless.cpp b/headless/Headless.cpp index cad0c9fb20..0be0518e8b 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -95,7 +95,11 @@ void NativeResized() { } std::string System_GetProperty(SystemProperty prop) { return ""; } std::vector System_GetPropertyStringVec(SystemProperty prop) { return std::vector(); } -int System_GetPropertyInt(SystemProperty prop) { return -1; } +int System_GetPropertyInt(SystemProperty prop) { + if (prop == SYSPROP_SYSTEMVERSION) + return 31; + return -1; +} float System_GetPropertyFloat(SystemProperty prop) { return -1.0f; } bool System_GetPropertyBool(SystemProperty prop) { switch (prop) {