diff --git a/Common/CPUDetect.h b/Common/CPUDetect.h index 20bb523415fa..e2241e8df133 100644 --- a/Common/CPUDetect.h +++ b/Common/CPUDetect.h @@ -149,17 +149,17 @@ struct CPUInfo { } sQuirks; // Call Detect() - explicit CPUInfo(); + explicit CPUInfo(){}; // Turn the cpu info into a string we can show - std::vector Features(); - std::string Summarize(); + std::vector Features() { return {}; }; + std::string Summarize() { return ""; } ; private: // Detects the various cpu features void Detect(); }; -extern CPUInfo cpu_info; +static CPUInfo cpu_info; -const char *GetCompilerABI(); +inline const char *GetCompilerABI() { return ""; } diff --git a/Common/Crypto/md5.cpp b/Common/Crypto/_md5.cpp similarity index 100% rename from Common/Crypto/md5.cpp rename to Common/Crypto/_md5.cpp diff --git a/Common/Crypto/sha1.cpp b/Common/Crypto/_sha1.cpp similarity index 100% rename from Common/Crypto/sha1.cpp rename to Common/Crypto/_sha1.cpp diff --git a/Common/Data/Format/ZIMLoad.cpp b/Common/Data/Format/ZIMLoad.cpp index d61559e9eb49..752b122f84b3 100644 --- a/Common/Data/Format/ZIMLoad.cpp +++ b/Common/Data/Format/ZIMLoad.cpp @@ -124,9 +124,29 @@ int LoadZIMPtr(const uint8_t *zim, size_t datasize, int *width, int *height, int return num_levels; } +extern std::string _atlasFontZimFileData; +extern std::string _ppgeAtlasFontZimFileData; int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t **image) { size_t size; uint8_t *buffer = g_VFS.ReadFile(filename, &size); + bool deleteBuffer = true; + + // If couldn't find the file natively, check the pre-loaded file data + if (!buffer && std::string(filename).find("ppge_atlas.zim") != std::string::npos) + { + size = _ppgeAtlasFontZimFileData.size(); + buffer = (uint8_t*)_ppgeAtlasFontZimFileData.data(); + deleteBuffer = false; + } + + // If couldn't find the file natively, check the pre-loaded file data + if (!buffer && std::string(filename).find("font_atlas.zim") != std::string::npos) + { + size = _atlasFontZimFileData.size(); + buffer = (uint8_t*)_atlasFontZimFileData.data(); + deleteBuffer = false; + } + if (!buffer) { ERROR_LOG(Log::IO, "Couldn't read data for '%s'", filename); return 0; @@ -136,6 +156,6 @@ int LoadZIM(const char *filename, int *width, int *height, int *format, uint8_t if (!retval) { ERROR_LOG(Log::IO, "Not a valid ZIM file: %s (size: %lld bytes)", filename, (long long)size); } - delete [] buffer; + if (deleteBuffer) delete [] buffer; return retval; } diff --git a/Common/Data/Hash/Hash.cpp b/Common/Data/Hash/_Hash.cpp similarity index 100% rename from Common/Data/Hash/Hash.cpp rename to Common/Data/Hash/_Hash.cpp diff --git a/Common/GPU/OpenGL/GLFeatures.h b/Common/GPU/OpenGL/GLFeatures.h index e8849f681d33..de76f8d57d73 100644 --- a/Common/GPU/OpenGL/GLFeatures.h +++ b/Common/GPU/OpenGL/GLFeatures.h @@ -135,7 +135,7 @@ struct GLExtensions { int GLSLVersion(); }; -extern GLExtensions gl_extensions; +static GLExtensions gl_extensions; // Call this after filling out vendor etc to lookup the bugs etc. // Only needs to be called once. Currently called by CheckGLExtensions(). @@ -150,4 +150,4 @@ bool CheckGLExtensions(); void SetGLCoreContext(bool flag); void ResetGLExtensions(); -std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage); +std::string ApplyGLSLPrelude(const std::string &source, uint32_t stage); \ No newline at end of file diff --git a/Common/Log/LogManager.cpp b/Common/Log/LogManager.cpp index e6cc564299ae..7d1238224f49 100644 --- a/Common/Log/LogManager.cpp +++ b/Common/Log/LogManager.cpp @@ -117,6 +117,7 @@ const char *LogManager::GetLogTypeName(Log type) { void PrintfLog(const LogMessage &message); void LogManager::Init(bool *enabledSetting, bool headless) { + return; g_bLogEnabledSetting = enabledSetting; if (initialized_) { // Just update the pointer, already done above. @@ -134,6 +135,7 @@ void LogManager::Init(bool *enabledSetting, bool headless) { } void LogManager::Shutdown() { + return; if (!initialized_) { // already done return; @@ -160,6 +162,7 @@ void LogManager::Shutdown() { } LogManager::LogManager() { + return; #if PPSSPP_PLATFORM(IOS) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(SWITCH) stdioUseColor_ = false; #elif defined(_MSC_VER) @@ -185,6 +188,7 @@ LogManager::LogManager() { } LogManager::~LogManager() { + return; Shutdown(); #if PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP) @@ -194,6 +198,7 @@ LogManager::~LogManager() { } void LogManager::ChangeFileLog(const Path &filename) { + return; if (fp_ && filename == logFilename_) { // All good return; @@ -214,6 +219,7 @@ void LogManager::ChangeFileLog(const Path &filename) { } void LogManager::SaveConfig(Section *section) { + return; for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; i++) { section->Set((std::string(g_logTypeNames[i]) + "Enabled"), g_log[i].enabled); section->Set((std::string(g_logTypeNames[i]) + "Level"), (int)g_log[i].level); @@ -221,6 +227,7 @@ void LogManager::SaveConfig(Section *section) { } void LogManager::LoadConfig(const Section *section, bool debugDefaults) { + return; for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; i++) { bool enabled = false; int level = 0; @@ -232,6 +239,7 @@ void LogManager::LoadConfig(const Section *section, bool debugDefaults) { } void LogManager::SetOutputsEnabled(LogOutput outputs) { + return; outputs_ = outputs; if (outputs & LogOutput::File) { ChangeFileLog(logFilename_); @@ -239,6 +247,7 @@ void LogManager::SetOutputsEnabled(LogOutput outputs) { } void LogManager::LogLine(LogLevel level, Log type, const char *file, int line, const char *format, va_list args) { + return; char msgBuf[1024]; const LogChannel &log = g_log[(size_t)type]; diff --git a/Common/Log/LogManager.h b/Common/Log/LogManager.h index 21ea872da8f9..b3d87cde6061 100644 --- a/Common/Log/LogManager.h +++ b/Common/Log/LogManager.h @@ -111,6 +111,7 @@ class LogManager { } void SetAllLogLevels(LogLevel level) { + return; for (int i = 0; i < (int)Log::NUMBER_OF_LOGS; ++i) { g_log[i].level = level; } diff --git a/Common/Net/URL.cpp b/Common/Net/_URL.cpp similarity index 100% rename from Common/Net/URL.cpp rename to Common/Net/_URL.cpp diff --git a/Common/Render/Text/draw_text_sdl.cpp b/Common/Render/Text/draw_text_sdl.cpp index f3612ad965d4..a1715c9ea3e3 100644 --- a/Common/Render/Text/draw_text_sdl.cpp +++ b/Common/Render/Text/draw_text_sdl.cpp @@ -15,8 +15,8 @@ #if defined(USE_SDL2_TTF) -#include "SDL2/SDL.h" -#include "SDL2/SDL_ttf.h" +#include "SDL.h" +#include "SDL_ttf.h" static std::string getlocale() { // setlocale is not an intuitive function... @@ -245,6 +245,7 @@ int TextDrawerSDL::FindFallbackFonts(uint32_t missingGlyph, int ptSize) { return -1; } +extern std::string _ppgeFontFileData; uint32_t TextDrawerSDL::SetFont(const char *fontName, int size, int flags) { uint32_t fontHash = fontName && strlen(fontName) ? hash::Adler32((const uint8_t *)fontName, strlen(fontName)) : 0; fontHash ^= size; @@ -256,10 +257,21 @@ uint32_t TextDrawerSDL::SetFont(const char *fontName, int size, int flags) { return fontHash; } - const char *useFont = fontName ? fontName : "Roboto-Condensed.ttf"; + const char *useFont = std::string(fontName) != "" ? fontName : "Roboto-Condensed.ttf"; const int ptSize = (int)((size + 6) / dpiScale_); + TTF_Font *font = nullptr; - TTF_Font *font = TTF_OpenFont(useFont, ptSize); + // If it's the default font, take it from memory + if (_ppgeFontFileData != "") + { + SDL_RWops *rw = SDL_RWFromConstMem(_ppgeFontFileData.data(), _ppgeFontFileData.size()); + if ( rw != NULL ) font = TTF_OpenFontRW(rw, 0, ptSize); + } + else // otherwise from a file + { + font = TTF_OpenFont(useFont, ptSize); + } + if (!font) { File::FileInfo fileInfo; diff --git a/Common/Render/Text/draw_text_sdl.h b/Common/Render/Text/draw_text_sdl.h index 7c073a8290f7..8215f9e2210c 100644 --- a/Common/Render/Text/draw_text_sdl.h +++ b/Common/Render/Text/draw_text_sdl.h @@ -7,8 +7,8 @@ #if defined(USE_SDL2_TTF) -#include "SDL2/SDL.h" -#include "SDL2/SDL_ttf.h" +#include "SDL.h" +#include "SDL_ttf.h" #if defined(USE_SDL2_TTF_FONTCONFIG) #include diff --git a/Common/Thread/ThreadManager.cpp b/Common/Thread/ThreadManager.cpp index aea8b7558e14..52fba31c18a5 100644 --- a/Common/Thread/ThreadManager.cpp +++ b/Common/Thread/ThreadManager.cpp @@ -60,6 +60,7 @@ ThreadManager::~ThreadManager() { } void ThreadManager::Teardown() { + return; for (TaskThreadContext *&threadCtx : global_->threads_) { std::unique_lock lock(threadCtx->mutex); threadCtx->cancelled = true; @@ -106,6 +107,7 @@ void ThreadManager::Teardown() { } bool ThreadManager::TeardownTask(Task *task, bool enqueue) { + return true; if (!task) return true; @@ -131,6 +133,7 @@ bool ThreadManager::TeardownTask(Task *task, bool enqueue) { } static void WorkerThreadFunc(GlobalThreadContext *global, TaskThreadContext *thread) { + return; if (thread->type == TaskType::CPU_COMPUTE) { snprintf(thread->name, sizeof(thread->name), "PoolW %d", thread->index); } else { @@ -216,6 +219,7 @@ static void WorkerThreadFunc(GlobalThreadContext *global, TaskThreadContext *thr } void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) { + return; if (IsInitialized()) { Teardown(); } @@ -238,6 +242,9 @@ void ThreadManager::Init(int numRealCores, int numLogicalCoresPerCpu) { } void ThreadManager::EnqueueTask(Task *task) { + task->Run(); + task->Release(); + return; if (task->Type() == TaskType::DEDICATED_THREAD) { std::thread th([=](Task *task) { SetCurrentThreadName("DedicatedThreadTask"); @@ -302,6 +309,9 @@ void ThreadManager::EnqueueTask(Task *task) { } void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task) { + task->Run(); + task->Release(); + return; _assert_msg_(task->Type() != TaskType::DEDICATED_THREAD, "Dedicated thread tasks can't be put on specific threads"); _assert_msg_(threadNum >= 0 && threadNum < (int)global_->threads_.size(), "Bad threadnum or not initialized"); @@ -316,6 +326,7 @@ void ThreadManager::EnqueueTaskOnThread(int threadNum, Task *task) { } int ThreadManager::GetNumLooperThreads() const { + return 1; return numComputeThreads_; } @@ -324,5 +335,6 @@ void ThreadManager::TryCancelTask(uint64_t taskID) { } bool ThreadManager::IsInitialized() const { + return true; return !global_->threads_.empty(); -} +} \ No newline at end of file diff --git a/Common/VR/OpenXRLoader.h b/Common/VR/OpenXRLoader.h index 1cc6cf67baaa..0d709849ac7c 100644 --- a/Common/VR/OpenXRLoader.h +++ b/Common/VR/OpenXRLoader.h @@ -20,7 +20,7 @@ #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP #if defined(_M_IX86) || defined(_M_X64) #include "Common/GPU/OpenGL/GLCommon.h" -#define XR_USE_GRAPHICS_API_OPENGL 1 +//#define XR_USE_GRAPHICS_API_OPENGL 1 #endif #define XR_USE_PLATFORM_WIN32 1 #endif diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 62eb3c115899..bf4e617d05d5 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -27,6 +27,10 @@ #include "Core/Config.h" #include "Core/System.h" +#include +extern std::string _compatibilityFileData; +extern std::string _compatibilityVRFileData; + void Compatibility::Load(const std::string &gameID) { Clear(); @@ -38,10 +42,13 @@ void Compatibility::Load(const std::string &gameID) { if (ignored_.find("ALL") != ignored_.end()) return; + std::istringstream compatIString (_compatibilityFileData); + std::istringstream compatVRIString (_compatibilityVRFileData); + { IniFile compat; // This loads from assets. - if (compat.LoadFromVFS(g_VFS, "compat.ini")) { + if (compat.Load(compatIString)) { CheckSettings(compat, gameID); } else { auto e = GetI18NCategory(I18NCat::ERRORS); @@ -62,7 +69,7 @@ void Compatibility::Load(const std::string &gameID) { { IniFile compat; // This loads from assets. - if (compat.LoadFromVFS(g_VFS, "compatvr.ini")) { + if (compat.Load(compatVRIString)) { CheckVRSettings(compat, gameID); } } diff --git a/Core/Config.cpp b/Core/Config.cpp index 3b0c17be8a20..d4ba3c26062a 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -60,6 +60,9 @@ #include "GPU/Common/FramebufferManagerCommon.h" +const char *PPSSPP_GIT_VERSION = "unknown"; +inline bool VulkanMayBeAvailable() { return false; } + // TODO: Find a better place for this. http::RequestManager g_DownloadManager; diff --git a/Core/Dialog/PSPSaveDialog.cpp b/Core/Dialog/PSPSaveDialog.cpp index 6d11ef93bec4..23a8ff03b729 100755 --- a/Core/Dialog/PSPSaveDialog.cpp +++ b/Core/Dialog/PSPSaveDialog.cpp @@ -1206,6 +1206,7 @@ void PSPSaveDialog::ExecuteNotVisibleIOAction() { } void PSPSaveDialog::JoinIOThread() { + return; // Disabling multithreading if (ioThread) { ioThread->join(); delete ioThread; @@ -1221,6 +1222,8 @@ static void DoExecuteIOAction(PSPSaveDialog *dialog) { } void PSPSaveDialog::StartIOThread() { + ExecuteIOAction(); // Exeute the action directly + return; // Disabling multithreading if (ioThread) { WARN_LOG_REPORT(Log::sceUtility, "Starting a save io thread when one already pending, uh oh."); JoinIOThread(); diff --git a/Core/FileLoaders/CachingFileLoader.cpp b/Core/FileLoaders/CachingFileLoader.cpp index 5a419502e672..12abd47ec722 100644 --- a/Core/FileLoaders/CachingFileLoader.cpp +++ b/Core/FileLoaders/CachingFileLoader.cpp @@ -266,6 +266,8 @@ void CachingFileLoader::StartReadAhead(s64 pos) { aheadThreadRunning_ = true; if (aheadThread_.joinable()) aheadThread_.join(); + + fprintf(stderr, "Unexpected thread creation found in CachingFileLoader.cpp\n"); std::abort(); aheadThread_ = std::thread([this, pos] { SetCurrentThreadName("FileLoaderReadAhead"); diff --git a/Core/FileLoaders/LocalFileLoader.cpp b/Core/FileLoaders/LocalFileLoader.cpp index 89b0fe4ce949..6d47bd43fd90 100644 --- a/Core/FileLoaders/LocalFileLoader.cpp +++ b/Core/FileLoaders/LocalFileLoader.cpp @@ -40,9 +40,16 @@ #include #endif +extern std::string _cdImageFilePath; +extern uint32_t cd_get_size(void); +extern size_t readSegmentFromCD(void* buf_, const uint64_t address, const size_t size); + #if !defined(_WIN32) && !defined(HAVE_LIBRETRO_VFS) void LocalFileLoader::DetectSizeFd() { + + if (_cdImageFilePath == filename_.c_str()) { filesize_ = cd_get_size(); return; } + #if PPSSPP_PLATFORM(ANDROID) || (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64) off64_t off = lseek64(fd_, 0, SEEK_END); filesize_ = off; @@ -57,6 +64,12 @@ void LocalFileLoader::DetectSizeFd() { LocalFileLoader::LocalFileLoader(const Path &filename) : filesize_(0), filename_(filename) { + + if (_cdImageFilePath == filename_.c_str()) + { + filesize_ = cd_get_size(); + } + if (filename.empty()) { ERROR_LOG(Log::FileSystem, "LocalFileLoader can't load empty filenames"); return; @@ -122,6 +135,8 @@ LocalFileLoader::LocalFileLoader(const Path &filename) } LocalFileLoader::~LocalFileLoader() { + if (_cdImageFilePath == filename_.c_str()) return; + #if defined(HAVE_LIBRETRO_VFS) filestream_close(handle_); #elif !defined(_WIN32) @@ -136,6 +151,8 @@ LocalFileLoader::~LocalFileLoader() { } bool LocalFileLoader::Exists() { + if (_cdImageFilePath == filename_.c_str()) return true; + // If we opened it for reading, it must exist. Done. #if defined(HAVE_LIBRETRO_VFS) return handle_ != 0; @@ -157,6 +174,8 @@ bool LocalFileLoader::Exists() { } bool LocalFileLoader::IsDirectory() { + if (_cdImageFilePath == filename_.c_str()) return false; + File::FileInfo info; if (File::GetFileInfo(filename_, &info)) { return info.exists && info.isDirectory; @@ -169,6 +188,9 @@ s64 LocalFileLoader::FileSize() { } size_t LocalFileLoader::ReadAt(s64 absolutePos, size_t bytes, size_t count, void *data, Flags flags) { + + if (_cdImageFilePath == filename_.c_str()) return readSegmentFromCD(data, absolutePos, bytes * count); + if (bytes == 0) return 0; diff --git a/Core/FileLoaders/RamCachingFileLoader.cpp b/Core/FileLoaders/RamCachingFileLoader.cpp index 8e4808c771eb..c6e69d5f2ba5 100644 --- a/Core/FileLoaders/RamCachingFileLoader.cpp +++ b/Core/FileLoaders/RamCachingFileLoader.cpp @@ -224,6 +224,8 @@ void RamCachingFileLoader::StartReadAhead(s64 pos) { aheadCancel_ = false; if (aheadThread_.joinable()) aheadThread_.join(); + + fprintf(stderr, "Unexpected thread creation found in RamCachingFileLoader.cpp\n"); std::abort(); aheadThread_ = std::thread([this] { SetCurrentThreadName("FileLoaderReadAhead"); diff --git a/Core/FileSystems/BlockDevices.cpp b/Core/FileSystems/BlockDevices.cpp index 733a6af1f9bb..0a2c651369a3 100644 --- a/Core/FileSystems/BlockDevices.cpp +++ b/Core/FileSystems/BlockDevices.cpp @@ -647,7 +647,7 @@ CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader) memcpy(childHeader.parentsha1, parentHeader.parentsha1, sizeof(childHeader.parentsha1)); } while (memcmp(nullsha1, childHeader.parentsha1, sizeof(childHeader.sha1)) != 0); } - */ + chd_file *file = nullptr; chd_error err = chd_open_core_file(&core_file_->core, CHD_OPEN_READ, NULL, &file); @@ -664,16 +664,18 @@ CHDFileBlockDevice::CHDFileBlockDevice(FileLoader *fileLoader) currentHunk = -1; blocksPerHunk = impl_->header->hunkbytes / impl_->header->unitbytes; numBlocks = impl_->header->unitcount; + */ } CHDFileBlockDevice::~CHDFileBlockDevice() { if (impl_->chd) { - chd_close(impl_->chd); + // chd_close(impl_->chd); delete[] readBuffer; } } bool CHDFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr, bool uncached) { + return false; // Bizhawk manages its own CD, removing LibCHDR dependency if (!impl_->chd) { ERROR_LOG(Log::Loader, "ReadBlock: CHD not open. %s", fileLoader_->GetPath().c_str()); return false; @@ -686,11 +688,11 @@ bool CHDFileBlockDevice::ReadBlock(int blockNumber, u8 *outPtr, bool uncached) { u32 blockInHunk = blockNumber % blocksPerHunk; if (currentHunk != hunk) { - chd_error err = chd_read(impl_->chd, hunk, readBuffer); - if (err != CHDERR_NONE) { - ERROR_LOG(Log::Loader, "CHD read failed: %d %d %s", blockNumber, hunk, chd_error_string(err)); - NotifyReadError(); - } + //chd_error err = chd_read(impl_->chd, hunk, readBuffer); + // if (err != CHDERR_NONE) { + //ERROR_LOG(Log::Loader, "CHD read failed: %d %d %s", blockNumber, hunk, chd_error_string(err)); + //NotifyReadError(); + //} currentHunk = hunk; } memcpy(outPtr, readBuffer + blockInHunk * impl_->header->unitbytes, GetBlockSize()); diff --git a/Core/HLE/sceCtrl.cpp b/Core/HLE/sceCtrl.cpp index 634e3c0e9138..b61770767ae3 100644 --- a/Core/HLE/sceCtrl.cpp +++ b/Core/HLE/sceCtrl.cpp @@ -268,6 +268,7 @@ static int __CtrlReadSingleBuffer(PSPPointer data, bool negative) return 0; } +extern bool _readInputs; static int __CtrlReadBuffer(u32 ctrlDataPtr, u32 nBufs, bool negative, bool peek) { if (nBufs > NUM_CTRL_BUFFERS) @@ -300,6 +301,9 @@ static int __CtrlReadBuffer(u32 ctrlDataPtr, u32 nBufs, bool negative, bool peek if (peek) ctrlBufRead = resetRead; + // Now the controls have been read + _readInputs = true; + return done; } diff --git a/Core/HLE/sceIo.cpp b/Core/HLE/sceIo.cpp index a2ee30502e77..4d245ebe67cc 100644 --- a/Core/HLE/sceIo.cpp +++ b/Core/HLE/sceIo.cpp @@ -689,10 +689,10 @@ void __IoInit() { memset(fds, 0, sizeof(fds)); - ioManagerThreadEnabled = true; - ioManager.SetThreadEnabled(true); - Core_ListenLifecycle(&__IoWakeManager); - ioManagerThread = new std::thread(&__IoManagerThread); + ioManagerThreadEnabled = false; + // ioManager.SetThreadEnabled(true); + // Core_ListenLifecycle(&__IoWakeManager); + // ioManagerThread = new std::thread(&__IoManagerThread); __KernelRegisterWaitTypeFuncs(WAITTYPE_ASYNCIO, __IoAsyncBeginCallback, __IoAsyncEndCallback); diff --git a/Core/HLE/sceKernelMemory.cpp b/Core/HLE/sceKernelMemory.cpp index fc8a6b9b3dc2..49e34eb8d333 100644 --- a/Core/HLE/sceKernelMemory.cpp +++ b/Core/HLE/sceKernelMemory.cpp @@ -306,7 +306,7 @@ void __KernelFplEndCallback(SceUID threadID, SceUID prevCallbackId); void __KernelMemoryInit() { - MemBlockInfoInit(); + //MemBlockInfoInit(); // Removing since it starts a thread and it's only for debugging purposes kernelMemory.Init(PSP_GetKernelMemoryBase(), PSP_GetKernelMemoryEnd() - PSP_GetKernelMemoryBase(), false); userMemory.Init(PSP_GetUserMemoryBase(), PSP_GetUserMemoryEnd() - PSP_GetUserMemoryBase(), false); volatileMemory.Init(PSP_GetVolatileMemoryStart(), PSP_GetVolatileMemoryEnd() - PSP_GetVolatileMemoryStart(), false); @@ -382,7 +382,7 @@ void __KernelMemoryShutdown() #endif kernelMemory.Shutdown(); tlsplThreadEndChecks.clear(); - MemBlockInfoShutdown(); + // MemBlockInfoShutdown(); } BlockAllocator *BlockAllocatorFromID(int id) { diff --git a/Core/HLE/sceNetAdhoc.cpp b/Core/HLE/sceNetAdhoc.cpp index 0f14709efd83..e8bcb50ec092 100644 --- a/Core/HLE/sceNetAdhoc.cpp +++ b/Core/HLE/sceNetAdhoc.cpp @@ -1243,6 +1243,7 @@ void __NetAdhocInit() { // Create built-in AdhocServer Thread adhocServerRunning = false; if (g_Config.bEnableWlan && g_Config.bEnableAdhocServer) { + fprintf(stderr, "Unexpected thread creation found in sceNetAdhoc.cpp\n"); std::abort(); adhocServerThread = std::thread(proAdhocServerThread, SERVER_PORT); } } diff --git a/Core/HLE/sceNetAdhocMatching.cpp b/Core/HLE/sceNetAdhocMatching.cpp index 9351b8d76176..a5d28ffee88e 100644 --- a/Core/HLE/sceNetAdhocMatching.cpp +++ b/Core/HLE/sceNetAdhocMatching.cpp @@ -1890,6 +1890,8 @@ int NetAdhocMatching_Start(int matchingId, int evthPri, int evthPartitionId, int //item->matchingThread->Start(matchingId, 0); } + fprintf(stderr, "Unexpected thread creation found in sceNetAdhocMatching.cpp\n"); std::abort(); + //Create the threads if (!item->eventRunning) { item->eventRunning = true; diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index ef1449ed67ff..a1b5a833148f 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -173,12 +173,12 @@ void __SasInit() { sasMixEvent = CoreTiming::RegisterEvent("SasMix", sasMixFinish); - if (g_Config.bSeparateSASThread) { - sasThreadState = SasThreadState::READY; - sasThread = new std::thread(__SasThread); - } else { + // if (g_Config.bSeparateSASThread) { + // sasThreadState = SasThreadState::READY; + // sasThread = new std::thread(__SasThread); + // } else { sasThreadState = SasThreadState::DISABLED; - } + // } } void __SasDoState(PointerWrap &p) { diff --git a/Core/HLE/sceUsbCam.cpp b/Core/HLE/sceUsbCam.cpp index 0046b82023b9..dd3982cfbe03 100644 --- a/Core/HLE/sceUsbCam.cpp +++ b/Core/HLE/sceUsbCam.cpp @@ -31,7 +31,7 @@ #include "Core/MemMapHelpers.h" #if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__) -#define HAVE_WIN32_CAMERA +//#define HAVE_WIN32_CAMERA #endif #ifdef HAVE_WIN32_CAMERA diff --git a/Core/HLE/sceUsbMic.cpp b/Core/HLE/sceUsbMic.cpp index 07075d1e43b9..8fb3a4d4a858 100644 --- a/Core/HLE/sceUsbMic.cpp +++ b/Core/HLE/sceUsbMic.cpp @@ -32,7 +32,7 @@ #include "Core/MemMapHelpers.h" #if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) && !defined(__LIBRETRO__) -#define HAVE_WIN32_MICROPHONE +//#define HAVE_WIN32_MICROPHONE #endif #ifdef HAVE_WIN32_MICROPHONE diff --git a/Core/MIPS/IR/IRNativeCommon.cpp b/Core/MIPS/IR/IRNativeCommon.cpp index 229bd8810644..7132551bd878 100644 --- a/Core/MIPS/IR/IRNativeCommon.cpp +++ b/Core/MIPS/IR/IRNativeCommon.cpp @@ -494,6 +494,8 @@ void IRNativeJit::Init(IRNativeBackend &backend) { if (enableDebugProfiler && hooks_.profilerPC) { debugProfilerThreadStatus = true; + + fprintf(stderr, "Unexpected thread creation found in IRNativeCommon.cpp\n"); std::abort(); debugProfilerThread = std::thread([&] { // Spin, spin spin... maybe could at least hook into sleeps. while (debugProfilerThreadStatus) { diff --git a/Core/Reporting.cpp b/Core/Reporting.cpp index 8a0c5fee24cf..4721cc00896e 100644 --- a/Core/Reporting.cpp +++ b/Core/Reporting.cpp @@ -171,6 +171,8 @@ namespace Reporting crcFilename = gamePath; crcPending = true; crcCancel = false; + + fprintf(stderr, "Unexpected thread creation found in Reporting.cpp\n"); std::abort(); crcThread = std::thread(CalculateCRCThread); } diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index f553a598133a..e0ecfb0a931d 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -114,9 +114,9 @@ double g_lastSaveTime = -1.0; } ~StateRingbuffer() { - if (compressThread_.joinable()) { - compressThread_.join(); - } + // if (compressThread_.joinable()) { + // compressThread_.join(); + // } } CChunkFileReader::Error Save() @@ -125,8 +125,8 @@ double g_lastSaveTime = -1.0; // Make sure we're not processing a previous save. That'll cause a hitch though, but at least won't // crash due to contention over buffer_. - if (compressThread_.joinable()) - compressThread_.join(); + // if (compressThread_.joinable()) + // compressThread_.join(); std::lock_guard guard(lock_); @@ -178,6 +178,9 @@ double g_lastSaveTime = -1.0; void ScheduleCompress(std::vector *result, const std::vector *state, const std::vector *base) { + Compress(*result, *state, *base); + return; + if (compressThread_.joinable()) compressThread_.join(); compressThread_ = std::thread([=]{ @@ -245,8 +248,8 @@ double g_lastSaveTime = -1.0; void Clear() { - if (compressThread_.joinable()) - compressThread_.join(); + // if (compressThread_.joinable()) + // compressThread_.join(); // This lock is mainly for shutdown. std::lock_guard guard(lock_); diff --git a/Core/System.cpp b/Core/System.cpp index 3d142aa9b9ed..fb3d5fe07b09 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -530,9 +530,9 @@ bool PSP_InitStart(const CoreParameter &coreParam) { INFO_LOG(Log::Loader, "Starting loader thread..."); - _dbg_assert_(!g_loadingThread.joinable()); + // _dbg_assert_(!g_loadingThread.joinable()); - g_loadingThread = std::thread([error_string]() { + //g_loadingThread = std::thread([error_string]() { SetCurrentThreadName("ExecLoader"); AndroidJNIThreadContext jniContext; @@ -571,11 +571,10 @@ bool PSP_InitStart(const CoreParameter &coreParam) { *error_string = "Failed initializing CPU/Memory"; } g_bootState = BootState::Failed; - return; + return false; } g_bootState = BootState::Complete; - }); return true; } @@ -589,8 +588,8 @@ BootState PSP_InitUpdate(std::string *error_string) { _dbg_assert_(g_bootState == BootState::Complete || g_bootState == BootState::Failed); // Since we load on a background thread, wait for startup to complete. - _dbg_assert_(g_loadingThread.joinable()); - g_loadingThread.join(); + // _dbg_assert_(g_loadingThread.joinable()); + // g_loadingThread.join(); if (g_bootState == BootState::Failed) { // Failed! (Note: PSP_Shutdown was already called on the loader thread). diff --git a/Core/Util/PPGeDraw.cpp b/Core/Util/PPGeDraw.cpp index a442202f432c..a184c6e7e7f7 100644 --- a/Core/Util/PPGeDraw.cpp +++ b/Core/Util/PPGeDraw.cpp @@ -242,6 +242,7 @@ void __PPGeSetupListArgs() } } +extern std::string _ppgeAtlasFontMetadataFileData; void __PPGeInit() { // PPGe isn't really important for headless, and LoadZIM takes a long time. bool skipZIM = System_GetPropertyBool(SYSPROP_SKIP_UI); @@ -252,19 +253,18 @@ void __PPGeInit() { int flags = 0; // TODO: Load the atlas on a thread! - bool loadedZIM = !skipZIM && LoadZIM("ppge_atlas.zim", width, height, &flags, imageData); if (!skipZIM && !loadedZIM) { ERROR_LOG(Log::sceGe, "Failed to load ppge_atlas.zim.\n\nPlace it in the directory \"assets\" under your PPSSPP directory.\n\nPPGe stuff will not be drawn."); } if (loadedZIM) { - size_t atlas_data_size; if (!g_ppge_atlas.IsMetadataLoaded()) { - uint8_t *atlas_data = g_VFS.ReadFile("ppge_atlas.meta", &atlas_data_size); + uint8_t *atlas_data = (uint8_t*)_ppgeAtlasFontMetadataFileData.data(); + size_t atlas_data_size = _ppgeAtlasFontMetadataFileData.size(); if (atlas_data) g_ppge_atlas.Load(atlas_data, atlas_data_size); - delete[] atlas_data; + //delete[] atlas_data; } } diff --git a/Core/Util/PortManager.cpp b/Core/Util/PortManager.cpp index ac6b17d29104..05157c862844 100644 --- a/Core/Util/PortManager.cpp +++ b/Core/Util/PortManager.cpp @@ -524,6 +524,7 @@ int upnpService(const unsigned int timeout) { } void __UPnPInit(const int timeout_ms) { + return; if (!upnpServiceRunning) { upnpServiceRunning = true; upnpServiceThread = std::thread(upnpService, timeout_ms); @@ -531,6 +532,7 @@ void __UPnPInit(const int timeout_ms) { } void __UPnPShutdown() { + return; if (upnpServiceRunning) { upnpServiceRunning = false; if (upnpServiceThread.joinable()) { diff --git a/Core/Util/RecentFiles.cpp b/Core/Util/RecentFiles.cpp index 8a9f0444512e..8e8ab4987389 100644 --- a/Core/Util/RecentFiles.cpp +++ b/Core/Util/RecentFiles.cpp @@ -31,6 +31,7 @@ void RecentFilesManager::EnsureThread() { return; } std::lock_guard guard(cmdLock_); + fprintf(stderr, "Unexpected thread creation found in RecentFiles.cpp\n"); std::abort(); thread_ = std::thread([this] { // NOTE: Can't create the thread in the constructor, because at that point, // JNI attachment doesn't yet work. diff --git a/Core/WebServer.cpp b/Core/WebServer.cpp index 1a36a45b9155..09d458a41307 100644 --- a/Core/WebServer.cpp +++ b/Core/WebServer.cpp @@ -460,6 +460,8 @@ bool StartWebServer(WebServerFlags flags) { case ServerStatus::STOPPED: serverStatus = ServerStatus::STARTING; serverFlags = (int)flags; + + fprintf(stderr, "Unexpected thread creation found in WebServer.cpp\n"); std::abort(); serverThread = std::thread(&ExecuteWebServer); return true; diff --git a/GPU/Common/PresentationCommon.cpp b/GPU/Common/PresentationCommon.cpp index e35283684d09..32f168eabbb8 100644 --- a/GPU/Common/PresentationCommon.cpp +++ b/GPU/Common/PresentationCommon.cpp @@ -589,11 +589,12 @@ void PresentationCommon::DestroyStereoShader() { Draw::ShaderModule *PresentationCommon::CompileShaderModule(ShaderStage stage, ShaderLanguage lang, const std::string &src, std::string *errorString) const { std::string translated = src; if (lang != lang_) { + // Removed glslang dep // Gonna have to upconvert the shader. - if (!TranslateShader(&translated, lang_, draw_->GetShaderLanguageDesc(), nullptr, src, lang, stage, errorString)) { - ERROR_LOG(Log::FrameBuf, "Failed to translate post-shader. Error string: '%s'\nSource code:\n%s\n", errorString->c_str(), src.c_str()); - return nullptr; - } + // if (!TranslateShader(&translated, lang_, draw_->GetShaderLanguageDesc(), nullptr, src, lang, stage, errorString)) { + // ERROR_LOG(Log::FrameBuf, "Failed to translate post-shader. Error string: '%s'\nSource code:\n%s\n", errorString->c_str(), src.c_str()); + // return nullptr; + // } } Draw::ShaderModule *shader = draw_->CreateShaderModule(stage, lang_, (const uint8_t *)translated.c_str(), translated.size(), "postshader"); return shader; diff --git a/GPU/GPU.cpp b/GPU/GPU.cpp index 7dfc759ebe4f..ab244b485c34 100644 --- a/GPU/GPU.cpp +++ b/GPU/GPU.cpp @@ -26,17 +26,17 @@ #include "GPU/GPUCommon.h" #if PPSSPP_API(ANY_GL) -#include "GPU/GLES/GPU_GLES.h" +// #include "GPU/GLES/GPU_GLES.h" #endif -#include "GPU/Vulkan/GPU_Vulkan.h" +// #include "GPU/Vulkan/GPU_Vulkan.h" #include "GPU/Software/SoftGpu.h" #if PPSSPP_API(D3D9) -#include "GPU/Directx9/GPU_DX9.h" +// #include "GPU/Directx9/GPU_DX9.h" #endif #if PPSSPP_API(D3D11) -#include "GPU/D3D11/GPU_D3D11.h" +// #include "GPU/D3D11/GPU_D3D11.h" #endif GPUStatistics gpuStats; @@ -60,13 +60,16 @@ bool GPU_IsStarted() { } bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { + SetGPU(new SoftGPU(ctx, draw)); + return true; + const auto &gpuCore = PSP_CoreParameter().gpuCore; _assert_(draw || gpuCore == GPUCORE_SOFTWARE); #if PPSSPP_PLATFORM(UWP) if (gpuCore == GPUCORE_SOFTWARE) { SetGPU(new SoftGPU(ctx, draw)); } else { - SetGPU(new GPU_D3D11(ctx, draw)); + // SetGPU(new GPU_D3D11(ctx, draw)); } return true; #else @@ -74,24 +77,24 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { case GPUCORE_GLES: // Disable GLES on ARM Windows (but leave it enabled on other ARM platforms). #if PPSSPP_API(ANY_GL) - SetGPU(new GPU_GLES(ctx, draw)); + // SetGPU(new GPU_GLES(ctx, draw)); break; #else return false; #endif case GPUCORE_SOFTWARE: - SetGPU(new SoftGPU(ctx, draw)); + // SetGPU(new SoftGPU(ctx, draw)); break; case GPUCORE_DIRECTX9: #if PPSSPP_API(D3D9) - SetGPU(new GPU_DX9(ctx, draw)); + // SetGPU(new GPU_DX9(ctx, draw)); break; #else return false; #endif case GPUCORE_DIRECTX11: #if PPSSPP_API(D3D11) - SetGPU(new GPU_D3D11(ctx, draw)); + // SetGPU(new GPU_D3D11(ctx, draw)); break; #else return false; @@ -102,7 +105,7 @@ bool GPU_Init(GraphicsContext *ctx, Draw::DrawContext *draw) { ERROR_LOG(Log::G3D, "Unable to init Vulkan GPU backend, no context"); break; } - SetGPU(new GPU_Vulkan(ctx, draw)); + // SetGPU(new GPU_Vulkan(ctx, draw)); break; #endif default: diff --git a/UI/Theme.cpp b/UI/Theme.cpp index 9ab731dcfbd1..cdc3f112b616 100644 --- a/UI/Theme.cpp +++ b/UI/Theme.cpp @@ -186,17 +186,9 @@ static UI::Style MakeStyle(uint32_t fg, uint32_t bg) { } static void LoadAtlasMetadata(Atlas &metadata, const char *filename, bool required) { - size_t atlas_data_size = 0; - const uint8_t *atlas_data = g_VFS.ReadFile(filename, &atlas_data_size); - bool load_success = atlas_data != nullptr && metadata.Load(atlas_data, atlas_data_size); - if (!load_success) { - if (required) - ERROR_LOG(Log::G3D, "Failed to load %s - graphics will be broken", filename); - else - WARN_LOG(Log::G3D, "Failed to load %s", filename); - // Stumble along with broken visuals instead of dying... - } - delete[] atlas_data; + uint8_t *atlas_data = (uint8_t*)_atlasFontMetadataFileData.data(); + size_t atlas_data_size = _atlasFontMetadataFileData.size(); + if (atlas_data) g_ppge_atlas.Load(atlas_data, atlas_data_size); } void UpdateTheme(UIContext *ctx) { diff --git a/ext/xxhash.c b/ext/_xxhash.c similarity index 100% rename from ext/xxhash.c rename to ext/_xxhash.c diff --git a/ext/libzip/zip_mkstempm.c b/ext/libzip/zip_mkstempm.c index c1afade331e9..de4e842ebbf3 100644 --- a/ext/libzip/zip_mkstempm.c +++ b/ext/libzip/zip_mkstempm.c @@ -79,15 +79,15 @@ _zip_mkstempm(char *path, int mode) { value /= 36; } - if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, mode == -1 ? 0666 : (mode_t)mode)) >= 0) { - if (mode != -1) { - /* open() honors umask(), which we don't want in this case */ - (void)chmod(path, (mode_t)mode); - } - return fd; - } - if (errno != EEXIST) { + //if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, mode == -1 ? 0666 : (mode_t)mode)) >= 0) { + // if (mode != -1) { + // /* open() honors umask(), which we don't want in this case */ + // (void)chmod(path, (mode_t)mode); + // } + // return fd; + //} + //if (errno != EEXIST) { return -1; - } + //} } } diff --git a/libretro/LibretroGraphicsContext.cpp b/libretro/LibretroGraphicsContext.cpp index a220353d55e1..5f508ac9ffd7 100644 --- a/libretro/LibretroGraphicsContext.cpp +++ b/libretro/LibretroGraphicsContext.cpp @@ -1,10 +1,10 @@ #include "libretro/LibretroGraphicsContext.h" -#include "libretro/LibretroGLContext.h" -#include "libretro/LibretroGLCoreContext.h" -#include "libretro/LibretroVulkanContext.h" +// #include "libretro/LibretroGLContext.h" +// #include "libretro/LibretroGLCoreContext.h" +// #include "libretro/LibretroVulkanContext.h" #ifdef _WIN32 -#include "libretro/LibretroD3D11Context.h" +// #include "libretro/LibretroD3D11Context.h" #endif #include "Common/Log.h" @@ -93,6 +93,9 @@ void LibretroGraphicsContext::LostBackbuffer() { draw_->HandleEvent(Draw::Event: LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() { LibretroGraphicsContext *ctx; + ctx = new LibretroSoftwareContext(); + ctx->Init(); + return ctx; retro_hw_context_type preferred; if (!Libretro::environ_cb(RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER, &preferred)) @@ -103,7 +106,7 @@ LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() { #ifndef USING_GLES2 if (preferred == RETRO_HW_CONTEXT_DUMMY || preferred == RETRO_HW_CONTEXT_OPENGL_CORE) { - ctx = new LibretroGLCoreContext(); + // ctx = new LibretroGLCoreContext(); if (ctx->Init()) { return ctx; @@ -113,7 +116,7 @@ LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() { #endif if (preferred == RETRO_HW_CONTEXT_DUMMY || preferred == RETRO_HW_CONTEXT_OPENGL || preferred == RETRO_HW_CONTEXT_OPENGLES3) { - ctx = new LibretroGLContext(); + // ctx = new LibretroGLContext(); if (ctx->Init()) { return ctx; @@ -123,7 +126,7 @@ LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() { #ifndef HAVE_LIBNX if (preferred == RETRO_HW_CONTEXT_DUMMY || preferred == RETRO_HW_CONTEXT_VULKAN) { - ctx = new LibretroVulkanContext(); + // ctx = new LibretroVulkanContext(); if (ctx->Init()) { return ctx; @@ -134,14 +137,14 @@ LibretroGraphicsContext *LibretroGraphicsContext::CreateGraphicsContext() { #ifdef _WIN32 if (preferred == RETRO_HW_CONTEXT_DUMMY || preferred == RETRO_HW_CONTEXT_DIRECT3D) { - ctx = new LibretroD3D11Context(); + // ctx = new LibretroD3D11Context(); if (ctx->Init()) { return ctx; } delete ctx; - ctx = new LibretroD3D9Context(); + // ctx = new LibretroD3D9Context(); if (ctx->Init()) { return ctx; } diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index 222cc9891530..590decc9a01b 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -1085,12 +1085,12 @@ static void check_variables(CoreParameter &coreParam) g_Config.bTexHardwareScaling = g_Config.sTextureShaderName != "Off"; - if (gpu && (g_Config.iTexScalingType != iTexScalingType_prev - || g_Config.iTexScalingLevel != iTexScalingLevel_prev - || g_Config.sTextureShaderName != sTextureShaderName_prev)) - { - gpu->NotifyConfigChanged(); - } + //if (gpu && (g_Config.iTexScalingType != iTexScalingType_prev + // || g_Config.iTexScalingLevel != iTexScalingLevel_prev + // || g_Config.sTextureShaderName != sTextureShaderName_prev)) + //{ + // gpu->NotifyConfigChanged(); + // } if (g_Config.iLanguage < 0) g_Config.iLanguage = get_language_auto(); @@ -1115,7 +1115,7 @@ static void check_variables(CoreParameter &coreParam) updateAvInfo = true; } - if (g_Config.iInternalResolution != iInternalResolution_prev && backend != RETRO_HW_CONTEXT_NONE) + //if (g_Config.iInternalResolution != iInternalResolution_prev && backend != RETRO_HW_CONTEXT_NONE) { coreParam.pixelWidth = coreParam.renderWidth = g_Config.iInternalResolution * NATIVEWIDTH; coreParam.pixelHeight = coreParam.renderHeight = g_Config.iInternalResolution * NATIVEHEIGHT; @@ -1130,14 +1130,14 @@ static void check_variables(CoreParameter &coreParam) } } - if (g_Config.bDisplayCropTo16x9 != bDisplayCropTo16x9_prev && PSP_IsInited()) + //if (g_Config.bDisplayCropTo16x9 != bDisplayCropTo16x9_prev && PSP_IsInited()) { updateGeometry = true; if (gpu) gpu->NotifyDisplayResized(); } - if (g_Config.iMultiSampleLevel != iMultiSampleLevel_prev && PSP_IsInited()) + //if (g_Config.iMultiSampleLevel != iMultiSampleLevel_prev && PSP_IsInited()) { if (gpu) { @@ -1289,7 +1289,7 @@ void retro_get_system_av_info(struct retro_system_av_info *info) info->timing.fps = (60.0 / 1.001) / (double)vsyncSwapInterval; info->timing.sample_rate = SAMPLERATE; - _dbg_assert_(g_Config.iInternalResolution != 0); + //_dbg_assert_(g_Config.iInternalResolution != 0); info->geometry.base_width = g_Config.iInternalResolution * NATIVEWIDTH; info->geometry.base_height = g_Config.iInternalResolution * NATIVEHEIGHT; @@ -1306,8 +1306,8 @@ void retro_get_system_av_info(struct retro_system_av_info *info) /* Must reset context to resize render area properly while running, * but not necessary with software, and not working with Vulkan.. (TODO) */ - if (PSP_IsInited() && ctx && backend != RETRO_HW_CONTEXT_NONE && ctx->GetGPUCore() != GPUCORE_VULKAN) - ((LibretroHWRenderContext *)Libretro::ctx)->ContextReset(); + // if (PSP_IsInited() && ctx && backend != RETRO_HW_CONTEXT_NONE && ctx->GetGPUCore() != GPUCORE_VULKAN) + // ((LibretroHWRenderContext *)Libretro::ctx)->ContextReset(); } unsigned retro_api_version(void) { return RETRO_API_VERSION; } @@ -1466,9 +1466,9 @@ bool retro_load_game(const struct retro_game_info *game) coreParam.enableSound = true; coreParam.fileToStart = Path(std::string(game->path)); coreParam.startBreak = false; - coreParam.headLess = true; // really? + coreParam.headLess = false; // really? coreParam.graphicsContext = ctx; - coreParam.gpuCore = ctx->GetGPUCore(); + coreParam.gpuCore = GPUCORE_SOFTWARE; check_variables(coreParam); // TODO: OpenGL goes black when inited with software rendering, @@ -1651,7 +1651,7 @@ void retro_run(void) ctx->SwapBuffers(); return; case BootState::Off: - // shouldn't happen. + // shouldn't happen. _dbg_assert_(false); return; }