diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 065750613c..f6e89707da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,7 +225,7 @@ jobs: run: | sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" sudo apt-get update -y -qq - sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev + sudo apt-get install libsdl2-dev libgl1-mesa-dev libglu1-mesa-dev libsdl2-ttf-dev libfontconfig1-dev - name: Create macOS git-version.cpp for tagged release if: startsWith(github.ref, 'refs/tags/') && runner.os == 'macOS' && matrix.extra == 'test' diff --git a/.gitignore b/.gitignore index 0723838277..842b171bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -117,6 +117,8 @@ debian/ppsspp/ # Libretro build *.o +*.tmp +*.a # YouCompleteMe file .ycm_extra_conf.pyc diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a91796708..f637fd9ce9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,14 +257,14 @@ endif() if(NOT LIBRETRO AND NOT IOS AND NOT MACOSX) find_package(SDL2) - find_package(SDL2_TTF) + find_package(SDL2_ttf) find_package(Fontconfig) endif() if(MACOSX AND NOT IOS) if(USE_SYSTEM_LIBSDL2) find_package(SDL2) - find_package(SDL2_TTF) + find_package(SDL2_ttf) else() find_library(SDL2Fwk SDL2 REQUIRED PATHS SDL/macOS) message(STATUS "found SDL2Fwk=${SDL2Fwk}") @@ -420,6 +420,9 @@ if(NOT MSVC) add_definitions(-D_XOPEN_SOURCE=700) add_definitions(-D_XOPEN_SOURCE_EXTENDED -D__BSD_VISIBLE=1 -D_BSD_SOURCE -D_DEFAULT_SOURCE) add_definitions(-D_LARGEFILE64_SOURCE=1 -D_FILE_OFFSET_BITS=64) + if(${CMAKE_SYSTEM_NAME} STREQUAL "NetBSD") + add_definitions(-D_NETBSD_SOURCE) + endif() elseif(ANDROID) add_definitions(-fsigned-char) endif() @@ -750,6 +753,8 @@ add_library(Common STATIC Common/Render/Text/draw_text.h Common/Render/Text/draw_text_android.cpp Common/Render/Text/draw_text_android.h + Common/Render/Text/draw_text_sdl.cpp + Common/Render/Text/draw_text_sdl.h Common/Render/Text/draw_text_win.cpp Common/Render/Text/draw_text_win.h Common/Render/Text/draw_text_uwp.cpp @@ -1180,15 +1185,6 @@ set(nativeExtra) set(nativeExtraLibs) if(ANDROID) - set(nativeExtra ${nativeExtra} - Common/GL/GLInterface/EGLAndroid.cpp - Common/GL/GLInterface/EGLAndroid.h - Common/GL/GLInterface/EGL.cpp - Common/GL/GLInterface/EGL.h - Common/GL/GLInterface/GLInterface.cpp - Common/GL/GLInterfaceBase.h - ) - set(NativeAppSource ${NativeAppSource} android/jni/app-android.cpp android/jni/AndroidJavaGLContext.cpp @@ -1319,7 +1315,7 @@ else() SDL/SDLVulkanGraphicsContext.cpp ) endif() - if(SDL2_TTF_FOUND) + if(SDL2_ttf_FOUND) add_definitions(-DUSE_SDL2_TTF) set(nativeExtraLibs ${nativeExtraLibs} SDL2_ttf::SDL2_ttf) @@ -1389,6 +1385,8 @@ list(APPEND NativeAppSource UI/BackgroundAudio.cpp UI/ChatScreen.h UI/ChatScreen.cpp + UI/DebugOverlay.cpp + UI/DebugOverlay.h UI/DevScreens.cpp UI/DevScreens.h UI/DisplayLayoutScreen.cpp @@ -1469,8 +1467,6 @@ add_library(native STATIC ${nativeExtra} Common/Render/Text/draw_text_qt.cpp Common/Render/Text/draw_text_qt.h - Common/Render/Text/draw_text_sdl.cpp - Common/Render/Text/draw_text_sdl.h ext/jpge/jpgd.cpp ext/jpge/jpgd.h ext/jpge/jpge.cpp @@ -1554,6 +1550,8 @@ set(CoreExtra ${CoreExtra} Core/MIPS/IR/IRInterpreter.h Core/MIPS/IR/IRJit.cpp Core/MIPS/IR/IRJit.h + Core/MIPS/IR/IRNativeCommon.cpp + Core/MIPS/IR/IRNativeCommon.h Core/MIPS/IR/IRPassSimplify.cpp Core/MIPS/IR/IRPassSimplify.h Core/MIPS/IR/IRRegCache.cpp diff --git a/Common/CPUDetect.cpp b/Common/CPUDetect.cpp index aa43930ead..2628f91d46 100644 --- a/Common/CPUDetect.cpp +++ b/Common/CPUDetect.cpp @@ -17,7 +17,7 @@ // Reference : https://stackoverflow.com/questions/6121792/how-to-check-if-a-cpu-supports-the-sse3-instruction-set #include "ppsspp_config.h" -#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) +#if (PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)) && !defined(__EMSCRIPTEN__) #include "ext/cpu_features/include/cpuinfo_x86.h" diff --git a/Common/CodeBlock.h b/Common/CodeBlock.h index f7fc8a2481..766d0a1cca 100644 --- a/Common/CodeBlock.h +++ b/Common/CodeBlock.h @@ -32,7 +32,7 @@ public: virtual const u8 *GetCodePtr() const = 0; - u8 *GetBasePtr() { + u8 *GetBasePtr() const { return region; } diff --git a/Common/Common.vcxproj b/Common/Common.vcxproj index 2b80aaa4d2..3d70da2944 100644 --- a/Common/Common.vcxproj +++ b/Common/Common.vcxproj @@ -530,27 +530,6 @@ - - - true - true - true - true - true - true - true - true - - - true - true - true - true - true - true - true - true - @@ -988,36 +967,6 @@ - - true - true - true - true - true - true - true - true - - - true - true - true - true - true - true - true - true - - - true - true - true - true - true - true - true - true - @@ -1084,4 +1033,4 @@ - \ No newline at end of file + diff --git a/Common/Common.vcxproj.filters b/Common/Common.vcxproj.filters index 5527848423..2a970c6f9f 100644 --- a/Common/Common.vcxproj.filters +++ b/Common/Common.vcxproj.filters @@ -32,15 +32,6 @@ - - GL\GLInterface - - - GL\GLInterface - - - GL - @@ -547,15 +538,6 @@ - - GL\GLInterface - - - GL\GLInterface - - - GL\GLInterface - @@ -982,12 +964,6 @@ {1b593f03-7b28-4707-9228-4981796f5589} - - {2f2ca112-9e26-499e-9cb9-38a78b4ac09d} - - - {2c723cf4-75b6-406a-90c0-ebb7a13ba476} - {7be79ad5-3520-46a1-a370-dce2a943978c} diff --git a/Common/CommonFuncs.h b/Common/CommonFuncs.h index 294cf4fb39..65b3344090 100644 --- a/Common/CommonFuncs.h +++ b/Common/CommonFuncs.h @@ -30,7 +30,7 @@ #include #include -#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) +#if (PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)) && !defined(__EMSCRIPTEN__) #define Crash() {asm ("int $3");} #elif PPSSPP_PLATFORM(SWITCH) // TODO: Implement Crash() for Switch, lets not use breakpoint for the time being diff --git a/Common/Data/Collections/FastVec.h b/Common/Data/Collections/FastVec.h index 3dab59abb8..88d8971c9f 100644 --- a/Common/Data/Collections/FastVec.h +++ b/Common/Data/Collections/FastVec.h @@ -155,3 +155,16 @@ private: bool capacityLocked_ = false; #endif }; + +// Simple cyclical vector. +// Initially, doesn't do any sanity checking. +template +class HistoryBuffer { +public: + // Out of bounds (past size() - 1) is undefined behavior. + T &operator[] (const size_t index) { return data_[index % size]; } + const T &operator[] (const size_t index) const { return data_[index % size]; } + +private: + T data_[size]{}; +}; diff --git a/Common/Data/Collections/FixedSizeQueue.h b/Common/Data/Collections/FixedSizeQueue.h index e8578c6bd8..621f4f0035 100644 --- a/Common/Data/Collections/FixedSizeQueue.h +++ b/Common/Data/Collections/FixedSizeQueue.h @@ -222,4 +222,3 @@ private: volatile int curReadBlock; volatile int curWriteBlock; }; - diff --git a/Common/Data/Encoding/Utf8.cpp b/Common/Data/Encoding/Utf8.cpp index 760fe6b07d..82567948cf 100644 --- a/Common/Data/Encoding/Utf8.cpp +++ b/Common/Data/Encoding/Utf8.cpp @@ -426,6 +426,17 @@ int u8_is_locale_utf8(const char *locale) return 0; } +bool AnyEmojiInString(const char *s, size_t byteCount) { + int i = 0; + while (i < byteCount) { + uint32_t c = u8_nextchar(s, &i); + if (CodepointIsProbablyEmoji(c)) { + return true; + } + } + return false; +} + int UTF8StringNonASCIICount(const char *utf8string) { UTF8 utf(utf8string); int count = 0; @@ -558,6 +569,12 @@ std::u16string ConvertUTF8ToUCS2(const std::string &source) { return dst; } +std::string CodepointToUTF8(uint32_t codePoint) { + char temp[16]{}; + UTF8::encode(temp, codePoint); + return std::string(temp); +} + #ifndef _WIN32 // Replacements for the Win32 wstring functions. Not to be used from emulation code! diff --git a/Common/Data/Encoding/Utf8.h b/Common/Data/Encoding/Utf8.h index 29d09f67e9..5123ef8a4b 100644 --- a/Common/Data/Encoding/Utf8.h +++ b/Common/Data/Encoding/Utf8.h @@ -26,6 +26,15 @@ int u8_strlen(const char *s); void u8_inc(const char *s, int *i); void u8_dec(const char *s, int *i); +inline bool CodepointIsProbablyEmoji(uint32_t c) { + // Original check was some ranges grabbed from https://stackoverflow.com/a/62898106. + // But let's just go with checking if outside the BMP, it's not a big deal if we accidentally + // switch to color when not needed if someone uses a weird glyph. + return c > 0xFFFF; +} + +bool AnyEmojiInString(const char *s, size_t byteCount); + class UTF8 { public: static const uint32_t INVALID = (uint32_t)-1; @@ -89,6 +98,8 @@ bool UTF8StringHasNonASCII(const char *utf8string); // Removes overlong encodings and similar. std::string SanitizeUTF8(const std::string &utf8string); +std::string CodepointToUTF8(uint32_t codePoint); + // UTF8 to Win32 UTF-16 // Should be used when calling Win32 api calls diff --git a/Common/Data/Format/IniFile.cpp b/Common/Data/Format/IniFile.cpp index 79ff0aebee..ba5055983b 100644 --- a/Common/Data/Format/IniFile.cpp +++ b/Common/Data/Format/IniFile.cpp @@ -420,42 +420,36 @@ bool Section::Delete(const char *key) // IniFile -const Section* IniFile::GetSection(const char* sectionName) const -{ - for (std::vector
::const_iterator iter = sections.begin(); iter != sections.end(); ++iter) +const Section* IniFile::GetSection(const char* sectionName) const { + for (const auto &iter : sections) if (!strcasecmp(iter->name().c_str(), sectionName)) - return (&(*iter)); + return iter.get(); + return nullptr ; +} + +Section* IniFile::GetSection(const char* sectionName) { + for (const auto &iter : sections) + if (!strcasecmp(iter->name().c_str(), sectionName)) + return iter.get(); return 0; } -Section* IniFile::GetSection(const char* sectionName) -{ - for (std::vector
::iterator iter = sections.begin(); iter != sections.end(); ++iter) - if (!strcasecmp(iter->name().c_str(), sectionName)) - return (&(*iter)); - return 0; -} - -Section* IniFile::GetOrCreateSection(const char* sectionName) -{ +Section* IniFile::GetOrCreateSection(const char* sectionName) { Section* section = GetSection(sectionName); - if (!section) - { - sections.push_back(Section(sectionName)); - section = §ions[sections.size() - 1]; + if (!section) { + sections.push_back(std::unique_ptr
(new Section(sectionName))); + section = sections.back().get(); } return section; } -bool IniFile::DeleteSection(const char* sectionName) -{ +bool IniFile::DeleteSection(const char* sectionName) { Section* s = GetSection(sectionName); if (!s) return false; - for (std::vector
::iterator iter = sections.begin(); iter != sections.end(); ++iter) - { - if (&(*iter) == s) - { + + for (auto iter = sections.begin(); iter != sections.end(); ++iter) { + if (iter->get() == s) { sections.erase(iter); return true; } @@ -463,8 +457,7 @@ bool IniFile::DeleteSection(const char* sectionName) return false; } -bool IniFile::Exists(const char* sectionName, const char* key) const -{ +bool IniFile::Exists(const char* sectionName, const char* key) const { const Section* section = GetSection(sectionName); if (!section) return false; @@ -556,7 +549,7 @@ void IniFile::SortSections() bool IniFile::Load(const Path &path) { sections.clear(); - sections.push_back(Section("")); + sections.push_back(std::unique_ptr
(new Section(""))); // first section consists of the comments before the first real section // Open file @@ -612,16 +605,16 @@ bool IniFile::Load(std::istream &in) { if (sectionNameEnd != std::string::npos) { // New section! std::string sub = line.substr(1, sectionNameEnd - 1); - sections.push_back(Section(sub)); + sections.push_back(std::unique_ptr
(new Section(sub))); if (sectionNameEnd + 1 < line.size()) { - sections[sections.size() - 1].comment = line.substr(sectionNameEnd + 1); + sections.back()->comment = line.substr(sectionNameEnd + 1); } } else { if (sections.empty()) { - sections.push_back(Section("")); + sections.push_back(std::unique_ptr
(new Section(""))); } - sections[sections.size() - 1].lines.push_back(line); + sections.back()->lines.push_back(line); } } } @@ -641,12 +634,12 @@ bool IniFile::Save(const Path &filename) // TODO: Do we still need this? It's annoying. fprintf(file, "\xEF\xBB\xBF"); - for (const Section §ion : sections) { - if (!section.name().empty() && (!section.lines.empty() || !section.comment.empty())) { - fprintf(file, "[%s]%s\n", section.name().c_str(), section.comment.c_str()); + for (const auto §ion : sections) { + if (!section->name().empty() && (!section->lines.empty() || !section->comment.empty())) { + fprintf(file, "[%s]%s\n", section->name().c_str(), section->comment.c_str()); } - for (const std::string &s : section.lines) { + for (const std::string &s : section->lines) { fprintf(file, "%s\n", s.c_str()); } } diff --git a/Common/Data/Format/IniFile.h b/Common/Data/Format/IniFile.h index cbe73f1855..528ece1f1c 100644 --- a/Common/Data/Format/IniFile.h +++ b/Common/Data/Format/IniFile.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include #include #include @@ -144,14 +145,15 @@ public: bool DeleteSection(const char* sectionName); void SortSections(); - std::vector
&Sections() { return sections; } + + std::vector> &Sections() { return sections; } bool HasSection(const char *section) { return GetSection(section) != 0; } Section* GetOrCreateSection(const char* section); private: - std::vector
sections; + std::vector> sections; const Section* GetSection(const char* section) const; Section* GetSection(const char* section); diff --git a/Common/Data/Text/I18n.cpp b/Common/Data/Text/I18n.cpp index 43b03a38b1..63b01a9048 100644 --- a/Common/Data/Text/I18n.cpp +++ b/Common/Data/Text/I18n.cpp @@ -140,13 +140,13 @@ bool I18NRepo::LoadIni(const std::string &languageID, const Path &overridePath) Clear(); - const std::vector
§ions = ini.Sections(); + const std::vector> §ions = ini.Sections(); std::lock_guard guard(catsLock_); for (auto §ion : sections) { for (size_t i = 0; i < (size_t)I18NCat::CATEGORY_COUNT; i++) { - if (!strcmp(section.name().c_str(), g_categoryNames[i])) { - cats_[i].reset(new I18NCategory(section)); + if (!strcmp(section->name().c_str(), g_categoryNames[i])) { + cats_[i].reset(new I18NCategory(*section.get())); } } } diff --git a/Common/FakeCPUDetect.cpp b/Common/FakeCPUDetect.cpp index e04ed356ed..e57799950a 100644 --- a/Common/FakeCPUDetect.cpp +++ b/Common/FakeCPUDetect.cpp @@ -18,7 +18,7 @@ #include "ppsspp_config.h" #if PPSSPP_ARCH(ARM) || PPSSPP_ARCH(ARM64) #define REAL_CPUDETECT_AVAIL 1 -#elif PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) +#elif (PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64)) && !defined(__EMSCRIPTEN__) #define REAL_CPUDETECT_AVAIL 1 #elif PPSSPP_ARCH(MIPS) || PPSSPP_ARCH(MIPS64) #define REAL_CPUDETECT_AVAIL 1 diff --git a/Common/File/FileUtil.cpp b/Common/File/FileUtil.cpp index 0d30819188..30c323b768 100644 --- a/Common/File/FileUtil.cpp +++ b/Common/File/FileUtil.cpp @@ -137,14 +137,20 @@ FILE *OpenCFile(const Path &path, const char *mode) { } // TODO: Support append modes and stuff... For now let's go with the most common one. - int descriptor = Android_OpenContentUriFd(path.ToString(), Android_OpenContentUriMode::READ_WRITE_TRUNCATE); + Android_OpenContentUriMode openMode = Android_OpenContentUriMode::READ_WRITE_TRUNCATE; + const char *fmode = "wb"; + if (!strcmp(mode, "at") || !strcmp(mode, "a")) { + openMode = Android_OpenContentUriMode::READ_WRITE; + fmode = "ab"; + } + int descriptor = Android_OpenContentUriFd(path.ToString(), openMode); if (descriptor < 0) { INFO_LOG(COMMON, "Opening '%s' for write failed", path.ToString().c_str()); return nullptr; } - FILE *f = fdopen(descriptor, "wb"); + FILE *f = fdopen(descriptor, fmode); if (f && (!strcmp(mode, "at") || !strcmp(mode, "a"))) { - // Append mode. + // Append mode - not sure we got a "true" append mode, so seek to the end. fseek(f, 0, SEEK_END); } return f; diff --git a/Common/File/PathBrowser.cpp b/Common/File/PathBrowser.cpp index 4aba1b41e4..9af0f4f86e 100644 --- a/Common/File/PathBrowser.cpp +++ b/Common/File/PathBrowser.cpp @@ -210,7 +210,7 @@ std::string PathBrowser::GetFriendlyPath() const { bool PathBrowser::GetListing(std::vector &fileInfo, const char *filter, bool *cancel) { std::unique_lock guard(pendingLock_); while (!IsListingReady() && (!cancel || !*cancel)) { - // In case cancel changes, just sleep. + // In case cancel changes, just sleep. TODO: Replace with condition variable. guard.unlock(); sleep_ms(50); guard.lock(); @@ -221,14 +221,6 @@ bool PathBrowser::GetListing(std::vector &fileInfo, const char * } bool PathBrowser::CanNavigateUp() { -/* Leaving this commented out, not sure if there's a use in UWP for navigating up from the user data folder. -#if PPSSPP_PLATFORM(UWP) - // Can't navigate up from memstick folder :( - if (path_ == GetSysDirectory(DIRECTORY_MEMSTICK_ROOT)) { - return false; - } -#endif -*/ return path_.CanNavigateUp(); } diff --git a/Common/GL/GLInterface/EGL.cpp b/Common/GL/GLInterface/EGL.cpp deleted file mode 100644 index 5f3c782f2c..0000000000 --- a/Common/GL/GLInterface/EGL.cpp +++ /dev/null @@ -1,402 +0,0 @@ -// Copyright 2012 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include -#include - -#include "Common/Log.h" -#include "Common/GL/GLInterface/EGL.h" - -// Show the current FPS -void cInterfaceEGL::Swap() { - eglSwapBuffers(egl_dpy, egl_surf); -} - -void cInterfaceEGL::SwapInterval(int Interval) { - eglSwapInterval(egl_dpy, Interval); -} - -void* cInterfaceEGL::GetFuncAddress(const std::string& name) { - return (void*)eglGetProcAddress(name.c_str()); -} - -void cInterfaceEGL::DetectMode() { - EGLint num_configs; - bool supportsGL = false, supportsGLES2 = false, supportsGLES3 = false; - static const int renderable_types[3] = { - EGL_OPENGL_BIT, - (1 << 6), /* EGL_OPENGL_ES3_BIT_KHR */ - EGL_OPENGL_ES2_BIT, - }; - - static const char *renderable_names[3] = { - "OpenGL", "OpenGL ES 3", "OpenGL ES 2" - }; - - for (int i = 0; i < 3; i++) { - int renderable_type = renderable_types[i]; - const char *renderable_name = renderable_names[i]; - // attributes for a visual in RGBA format with at least - // 8 bits per color - int attribs[] = { - EGL_RENDERABLE_TYPE, renderable_type, - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, - EGL_TRANSPARENT_TYPE, EGL_NONE, - EGL_SAMPLES, 0, - EGL_NONE - }; - - // Get how many configs there are - if (!eglChooseConfig( egl_dpy, attribs, nullptr, 0, &num_configs)) { - EGL_ILOG("DetectMode: couldn't get an EGL visual config with renderable_type=%s", renderable_name); - continue; - } - EGL_ILOG("DetectMode: got an EGL visual config with renderable_type=%s", renderable_name); - - EGLConfig* config = new EGLConfig[num_configs]; - - // Get all the configurations - if (!eglChooseConfig(egl_dpy, attribs, config, num_configs, &num_configs)) { - EGL_ILOG("DetectMode: couldn't choose an EGL visual config\n"); - delete[] config; - continue; - } - - for (int i = 0; i < num_configs; ++i) { - EGLint attribVal; - bool ret; - ret = eglGetConfigAttrib(egl_dpy, config[i], EGL_RENDERABLE_TYPE, &attribVal); - if (ret) { - if ((attribVal & EGL_OPENGL_BIT) && s_opengl_mode != GLInterfaceMode::MODE_DETECT_ES) - supportsGL = true; - if (attribVal & (1 << 6)) /* EGL_OPENGL_ES3_BIT_KHR */ - supportsGLES3 = true; // Apparently, this cannot be completely trusted so we implement a fallback to ES 2.0 below. - if (attribVal & EGL_OPENGL_ES2_BIT) - supportsGLES2 = true; - } - } - delete[] config; - } - - if (supportsGL) - s_opengl_mode = GLInterfaceMode::MODE_OPENGL; - else if (supportsGLES3) - s_opengl_mode = GLInterfaceMode::MODE_OPENGLES3; - else if (supportsGLES2) - s_opengl_mode = GLInterfaceMode::MODE_OPENGLES2; - - if (s_opengl_mode == GLInterfaceMode::MODE_DETECT) // Errored before we found a mode - s_opengl_mode = GLInterfaceMode::MODE_OPENGL; // Fall back to OpenGL -} - -static void LogEGLConfig(EGLDisplay egl_dpy, EGLConfig config) { - EGLint red = 0, green = 0, blue = 0, alpha = 0, depth = 0, stencil = 0, format = -1, type; - - struct { - EGLint value; - const char *name; - } vals[] = { - { EGL_RED_SIZE, "EGL_RED_SIZE" }, - { EGL_GREEN_SIZE, "EGL_GREEN_SIZE" }, - { EGL_BLUE_SIZE, "EGL_BLUE_SIZE" }, - { EGL_ALPHA_SIZE, "EGL_ALPHA_SIZE" }, - { EGL_DEPTH_SIZE, "EGL_DEPTH_SIZE" }, - { EGL_STENCIL_SIZE, "EGL_STENCIL_SIZE" }, - { EGL_NATIVE_VISUAL_ID, "EGL_NATIVE_VISUAL_ID" }, - { EGL_NATIVE_VISUAL_TYPE, "EGL_NATIVE_VISUAL_TYPE" }, - { EGL_MAX_SWAP_INTERVAL, "EGL_MAX_SWAP_INTERVAL" }, - { EGL_MIN_SWAP_INTERVAL, "EGL_MIN_SWAP_INTERVAL" }, - { EGL_MIN_SWAP_INTERVAL, "EGL_MIN_SWAP_INTERVAL" }, - { EGL_NATIVE_RENDERABLE, "EGL_NATIVE_RENDERABLE" }, - { EGL_COLOR_BUFFER_TYPE, "EGL_COLOR_BUFFER_TYPE" }, - { EGL_BUFFER_SIZE, "EGL_BUFFER_SIZE" }, - { EGL_CONFIG_ID, "EGL_CONFIG_ID" }, - { EGL_SAMPLES, "EGL_SAMPLES" }, - }; - - for (int i = 0; i < (int)(sizeof(vals)/sizeof(vals[0])); i++) { - EGLint value; - eglGetConfigAttrib(egl_dpy, config, vals[i].value, &value); - EGL_ILOG(" %s = %d", vals[i].name, value); - } -} - -const char *cInterfaceEGL::EGLGetErrorString(EGLint error) { - switch (error) { - case EGL_SUCCESS: return "EGL_SUCCESS"; - case EGL_NOT_INITIALIZED: return "EGL_NOT_INITIALIZED"; - case EGL_BAD_ACCESS: return "EGL_BAD_ACCESS"; - case EGL_BAD_ALLOC: return "EGL_BAD_ALLOC"; - case EGL_BAD_ATTRIBUTE: return "EGL_BAD_ATTRIBUTE"; - case EGL_BAD_CONTEXT: return "EGL_BAD_CONTEXT"; - case EGL_BAD_CONFIG: return "EGL_BAD_CONFIG"; - case EGL_BAD_CURRENT_SURFACE: return "EGL_BAD_CURRENT_SURFACE"; - case EGL_BAD_DISPLAY: return "EGL_BAD_DISPLAY"; - case EGL_BAD_SURFACE: return "EGL_BAD_SURFACE"; - case EGL_BAD_MATCH: return "EGL_BAD_MATCH"; - case EGL_BAD_PARAMETER: return "EGL_BAD_PARAMETER"; - case EGL_BAD_NATIVE_PIXMAP: return "EGL_BAD_NATIVE_PIXMAP"; - case EGL_BAD_NATIVE_WINDOW: return "EGL_BAD_NATIVE_WINDOW"; - case EGL_CONTEXT_LOST: return "EGL_CONTEXT_LOST"; - default: - return "(UNKNOWN)"; - } -} - -bool cInterfaceEGL::ChooseAndCreate(void *window_handle, bool core, bool use565) { - int attribs32[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Keep this first! - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_TRANSPARENT_TYPE, EGL_NONE, - EGL_NONE, 0 - }; - int attribs16[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Keep this first! - EGL_RED_SIZE, 5, - EGL_GREEN_SIZE, 6, - EGL_BLUE_SIZE, 5, - EGL_ALPHA_SIZE, 0, - EGL_DEPTH_SIZE, 16, - EGL_STENCIL_SIZE, 8, - EGL_TRANSPARENT_TYPE, EGL_NONE, - EGL_NONE, 0 - }; - int attribsFallback32[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Keep this first! - EGL_RED_SIZE, 8, - EGL_GREEN_SIZE, 8, - EGL_BLUE_SIZE, 8, - EGL_ALPHA_SIZE, 8, - EGL_DEPTH_SIZE, 16, - EGL_NONE, 0 - }; - int attribsFallback16[] = { - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, // Keep this first! - EGL_RED_SIZE, 5, - EGL_GREEN_SIZE, 6, - EGL_BLUE_SIZE, 5, - EGL_ALPHA_SIZE, 0, - EGL_DEPTH_SIZE, 16, - EGL_NONE, 0 - }; - - int *attribs = attribs32; - int *attribsFallback = attribsFallback32; - if (use565) { - attribs = attribs16; - attribsFallback = attribsFallback16; - } - - EGLint ctx_attribs[] = { - EGL_CONTEXT_CLIENT_VERSION, 2, - EGL_NONE, 0, - EGL_NONE, 0, - EGL_NONE, 0, - EGL_NONE, 0, - }; - - switch (s_opengl_mode) { - case MODE_OPENGL: - EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_BIT"); - attribs[1] = EGL_OPENGL_BIT; - // 1 will be major version, and 3 the minor version. - ctx_attribs[2] = 0x30FB; /* EGL_CONTEXT_MINOR_VERSION_KHR */ - // Let's always use a core profile here. - ctx_attribs[4] = 0x30FD; /* EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR */ - ctx_attribs[5] = 1; /* EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR */ - break; - case MODE_OPENGLES2: - EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES2_BIT"); - attribs[1] = EGL_OPENGL_ES2_BIT; - ctx_attribs[1] = 2; - break; - case MODE_OPENGLES3: - EGL_ILOG("Setting RENDERABLE_TYPE to EGL_OPENGL_ES3_BIT_KHR"); - attribs[1] = (1 << 6); /* EGL_OPENGL_ES3_BIT_KHR */ - ctx_attribs[1] = 3; - break; - default: - EGL_ELOG("Unknown OpenGL mode set\n"); - return false; - break; - } - - EGL_ILOG("Calling eglChooseConfig to get number of configs (use16bit=%d)...", (int)use565); - - EGLConfig *configs; - EGLint num_configs = 0; - if (!eglChooseConfig(egl_dpy, attribs, NULL, 0, &num_configs) || num_configs == 0) { - EGL_ILOG("Error: couldn't get a number of configs. Trying with fallback config (no stencil, not specifying transparent:none)\n"); - attribsFallback[1] = attribs[1]; - attribs = attribsFallback; - if (!eglChooseConfig(egl_dpy, attribs, NULL, 0, &num_configs) || num_configs == 0) { - eglTerminate(egl_dpy); - return false; - } - } - - EGL_ILOG("Got %d configs. Now choosing...", num_configs); - configs = new EGLConfig[num_configs]; - - if (!eglChooseConfig(egl_dpy, attribs, configs, num_configs, &num_configs)) { - EGL_ELOG("Error: couldn't get an EGL visual config (num_configs=%d)! Terminating EGL.\n", num_configs); - eglTerminate(egl_dpy); - return false; - } - - int chosenConfig = -1; - // Find our ideal config in the list. If it's there, use it, otherwise pick whatever the device wanted (#0) - int wantedAlpha = 8; - // Requiring alpha seems to be a problem on older devices. Let's see if this helps... - if (attribs[1] == EGL_OPENGL_ES2_BIT) - wantedAlpha = 0; - for (int i = 0; i < num_configs; i++) { - EGL_ILOG("Config %d:", i); - LogEGLConfig(egl_dpy, configs[i]); - int red, green, blue, alpha, depth, stencil; - eglGetConfigAttrib(egl_dpy, configs[i], EGL_RED_SIZE, &red); - eglGetConfigAttrib(egl_dpy, configs[i], EGL_GREEN_SIZE, &green); - eglGetConfigAttrib(egl_dpy, configs[i], EGL_BLUE_SIZE, &blue); - eglGetConfigAttrib(egl_dpy, configs[i], EGL_ALPHA_SIZE, &alpha); - eglGetConfigAttrib(egl_dpy, configs[i], EGL_DEPTH_SIZE, &depth); - eglGetConfigAttrib(egl_dpy, configs[i], EGL_STENCIL_SIZE, &stencil); - if (chosenConfig == -1 && red == 8 && green == 8 && blue == 8 && alpha == wantedAlpha && depth == 24 && stencil == 8) { - chosenConfig = i; - } - } - if (chosenConfig == -1) - chosenConfig = 0; - - EGL_ILOG("eglChooseConfig successful: num_configs=%d, choosing config %d", num_configs, chosenConfig); - - if (s_opengl_mode == MODE_OPENGL) { - EGL_ILOG("eglBindAPI(OPENGL)"); - eglBindAPI(EGL_OPENGL_API); - } else { - EGL_ILOG("eglBindAPI(OPENGL_ES)"); - eglBindAPI(EGL_OPENGL_ES_API); - } - - EGLNativeWindowType host_window = (EGLNativeWindowType)window_handle; - EGLNativeWindowType native_window = InitializePlatform(host_window, configs[chosenConfig]); - - const char *s = eglQueryString(egl_dpy, EGL_VERSION); - EGL_ILOG("EGL_VERSION = %s\n", s); - - s = eglQueryString(egl_dpy, EGL_VENDOR); - EGL_ILOG("EGL_VENDOR = %s\n", s); - - s = eglQueryString(egl_dpy, EGL_EXTENSIONS); - EGL_ILOG("EGL_EXTENSIONS = %s\n", s); - - s = eglQueryString(egl_dpy, EGL_CLIENT_APIS); - EGL_ILOG("EGL_CLIENT_APIS = %s\n", s); - - - if (s_opengl_mode == MODE_OPENGL) { - EGL_ILOG("Finding a good GL version"); - egl_ctx = nullptr; - for (int minor = 6; minor >= 0 && !egl_ctx; --minor) { - ctx_attribs[1] = 4; - ctx_attribs[3] = minor; - egl_ctx = eglCreateContext(egl_dpy, configs[chosenConfig], EGL_NO_CONTEXT, ctx_attribs); - } - if (!egl_ctx) { - ctx_attribs[1] = 3; - ctx_attribs[3] = 3; - egl_ctx = eglCreateContext(egl_dpy, configs[chosenConfig], EGL_NO_CONTEXT, ctx_attribs); - } - } else { - egl_ctx = eglCreateContext(egl_dpy, configs[chosenConfig], EGL_NO_CONTEXT, ctx_attribs); - } - if (!egl_ctx) { - EGL_ILOG("Error: eglCreateContext failed: %s\n", EGLGetErrorString(eglGetError())); - delete[] configs; - return false; - } - EGL_ILOG("Successfully created EGL context.\n"); - - egl_surf = eglCreateWindowSurface(egl_dpy, configs[chosenConfig], native_window, nullptr); - if (!egl_surf) { - EGL_ILOG("Error: eglCreateWindowSurface failed: native_window=%p error=%s ctx_attribs[1]==%d\n", native_window, EGLGetErrorString(eglGetError()), ctx_attribs[1]); - eglDestroyContext(egl_dpy, egl_ctx); - delete[] configs; - return false; - } - EGL_ILOG("Successfully created EGL window surface (window=%p).\n", native_window); - - delete[] configs; - return true; -} - -// Create rendering window. -bool cInterfaceEGL::Create(void *window_handle, bool core, bool use565) { - EGLint egl_major, egl_minor; - - egl_dpy = OpenDisplay(); - - if (!egl_dpy) { - EGL_ILOG("Error: eglGetDisplay() failed\n"); - return false; - } - - if (!eglInitialize(egl_dpy, &egl_major, &egl_minor)) { - EGL_ILOG("Error: eglInitialize() failed\n"); - return false; - } - EGL_ILOG("eglInitialize() succeeded (use565=%d)\n", (int)use565); - - if (s_opengl_mode == MODE_DETECT || s_opengl_mode == MODE_DETECT_ES) - DetectMode(); - - if (!ChooseAndCreate(window_handle, core, use565) && (s_opengl_mode == MODE_OPENGLES3 || s_opengl_mode == MODE_OPENGL)) { - // Fallback to ES 2.0 and try again. - s_opengl_mode = MODE_OPENGLES2; - if (!ChooseAndCreate(window_handle, core, use565)) { - eglTerminate(egl_dpy); - egl_dpy = nullptr; - return false; - } - } - - return true; -} - -bool cInterfaceEGL::MakeCurrent() { - return eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx); -} - -bool cInterfaceEGL::ClearCurrent() { - return eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); -} - -void cInterfaceEGL::Shutdown() { - ShutdownPlatform(); - if (egl_ctx && !eglMakeCurrent(egl_dpy, egl_surf, egl_surf, egl_ctx)) { - NOTICE_LOG(G3D, "Could not release drawing context."); - } - if (egl_ctx) { - eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); - if (!eglDestroySurface(egl_dpy, egl_surf)) - NOTICE_LOG(G3D, "Could not destroy window surface."); - if (!eglDestroyContext(egl_dpy, egl_ctx)) - NOTICE_LOG(G3D, "Could not destroy drawing context."); - if (!eglTerminate(egl_dpy)) - NOTICE_LOG(G3D, "Could not destroy display connection."); - egl_ctx = nullptr; - egl_dpy = nullptr; - egl_surf = nullptr; - } -} diff --git a/Common/GL/GLInterface/EGL.h b/Common/GL/GLInterface/EGL.h deleted file mode 100644 index e9d789748c..0000000000 --- a/Common/GL/GLInterface/EGL.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2008 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -#include -#include - -#include "Common/Log.h" -#include "Common/GL/GLInterfaceBase.h" - -#define EGL_ILOG(...) INFO_LOG(G3D, __VA_ARGS__) -#define EGL_ELOG(...) INFO_LOG(G3D, __VA_ARGS__) - - -class cInterfaceEGL : public cInterfaceBase { -public: - void SwapInterval(int Interval) override; - void Swap() override; - void SetMode(u32 mode) override { s_opengl_mode = mode; } - void* GetFuncAddress(const std::string& name) override; - bool Create(void *window_handle, bool core, bool use565) override; - bool MakeCurrent() override; - bool ClearCurrent() override; - void Shutdown() override; - -protected: - EGLSurface egl_surf; - EGLContext egl_ctx; - EGLDisplay egl_dpy; - - virtual EGLDisplay OpenDisplay() = 0; - virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) = 0; - virtual void ShutdownPlatform() = 0; - virtual void SetInternalResolution(int internalWidth, int internalHeight) {} - const char *EGLGetErrorString(EGLint error); - -private: - bool ChooseAndCreate(void *window_handle, bool core, bool use565); - void DetectMode(); -}; diff --git a/Common/GL/GLInterface/EGLAndroid.cpp b/Common/GL/GLInterface/EGLAndroid.cpp deleted file mode 100644 index 8d2065a0a7..0000000000 --- a/Common/GL/GLInterface/EGLAndroid.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include -#include "Common/Log.h" -#include "Common/GL/GLInterface/EGLAndroid.h" - -EGLDisplay cInterfaceEGLAndroid::OpenDisplay() { - return eglGetDisplay(EGL_DEFAULT_DISPLAY); -} - -EGLNativeWindowType cInterfaceEGLAndroid::InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) { - EGLint format; - if (EGL_FALSE == eglGetConfigAttrib(egl_dpy, config, EGL_NATIVE_VISUAL_ID, &format)) { - EGL_ELOG("Failed getting EGL_NATIVE_VISUAL_ID: error %s", EGLGetErrorString(eglGetError())); - return NULL; - } - - int32_t result = ANativeWindow_setBuffersGeometry(host_window, internalWidth_, internalHeight_, format); - EGL_ILOG("ANativeWindow_setBuffersGeometry returned %d", result); - - const int width = ANativeWindow_getWidth(host_window); - const int height = ANativeWindow_getHeight(host_window); - SetBackBufferDimensions(width, height); - - return host_window; -} - -void cInterfaceEGLAndroid::ShutdownPlatform() { -} diff --git a/Common/GL/GLInterface/EGLAndroid.h b/Common/GL/GLInterface/EGLAndroid.h deleted file mode 100644 index 811485d91b..0000000000 --- a/Common/GL/GLInterface/EGLAndroid.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -#include "Common/GL/GLInterface/EGL.h" - -class cInterfaceEGLAndroid : public cInterfaceEGL { -public: - cInterfaceEGLAndroid() : internalWidth_(0), internalHeight_(0) {} -protected: - EGLDisplay OpenDisplay() override; - EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) override; - void ShutdownPlatform() override; - void OverrideBackbufferDimensions(int internalWidth, int internalHeight) override { - internalWidth_ = internalWidth; - internalHeight_ = internalHeight; - } - -private: - int internalWidth_; - int internalHeight_; -}; diff --git a/Common/GL/GLInterface/EGLSwitch.cpp b/Common/GL/GLInterface/EGLSwitch.cpp deleted file mode 100644 index 4cd670c678..0000000000 --- a/Common/GL/GLInterface/EGLSwitch.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include "ppsspp_config.h" -#if PPSSPP_PLATFORM(SWITCH) -#include -#include "Common/Log.h" -#include "Common/GL/GLInterface/EGLSwitch.h" - -EGLDisplay cInterfaceEGLSwitch::OpenDisplay() { - return eglGetDisplay(EGL_DEFAULT_DISPLAY); -} - -EGLNativeWindowType cInterfaceEGLSwitch::InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) { - return nwindowGetDefault(); -} - -void cInterfaceEGLSwitch::ShutdownPlatform() { -} -#endif diff --git a/Common/GL/GLInterface/EGLSwitch.h b/Common/GL/GLInterface/EGLSwitch.h deleted file mode 100644 index b313158429..0000000000 --- a/Common/GL/GLInterface/EGLSwitch.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -#include "Common/GL/GLInterface/EGL.h" - -class cInterfaceEGLSwitch : public cInterfaceEGL { -public: - cInterfaceEGLSwitch() {} -protected: - EGLDisplay OpenDisplay() override; - EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) override; - void ShutdownPlatform() override; - void OverrideBackbufferDimensions(int internalWidth, int internalHeight) override { - internalWidth_ = internalWidth; - internalHeight_ = internalHeight; - } - -private: - int internalWidth_ = 0; - int internalHeight_ = 0; -}; diff --git a/Common/GL/GLInterface/GLInterface.cpp b/Common/GL/GLInterface/GLInterface.cpp deleted file mode 100644 index ad2e781200..0000000000 --- a/Common/GL/GLInterface/GLInterface.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2014 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#include "ppsspp_config.h" -#include "Common/GL/GLInterfaceBase.h" - -#ifdef __ANDROID__ -#include "Common/GL/GLInterface/EGLAndroid.h" -#elif PPSSPP_PLATFORM(SWITCH) -#include "Common/GL/GLInterface/EGLSwitch.h" -#elif defined(__APPLE__) -#include "Common/GL/GLInterface/AGL.h" -#elif defined(_WIN32) -#include "Common/GL/GLInterface/WGL.h" -#elif HAVE_X11 -#if defined(USE_EGL) && USE_EGL -#include "Common/GL/GLInterface/EGLX11.h" -#else -#include "Common/GL/GLInterface/GLX.h" -#endif -#else -#error Platform doesnt have a GLInterface -#endif - -cInterfaceBase* HostGL_CreateGLInterface(){ - #ifdef __ANDROID__ - return new cInterfaceEGLAndroid; - #elif PPSSPP_PLATFORM(SWITCH) - return new cInterfaceEGLSwitch; - #elif defined(__APPLE__) - return new cInterfaceAGL; - #elif defined(_WIN32) - return new cInterfaceWGL; - #elif defined(HAVE_X11) && HAVE_X11 - #if defined(USE_EGL) && USE_EGL - return new cInterfaceEGLX11; - #else - return new cInterfaceGLX; - #endif - #else - return nullptr; - #endif -} diff --git a/Common/GL/GLInterfaceBase.h b/Common/GL/GLInterfaceBase.h deleted file mode 100644 index 250f0f35e9..0000000000 --- a/Common/GL/GLInterfaceBase.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2008 Dolphin Emulator Project -// Licensed under GPLv2+ -// Refer to the license.txt file included. - -#pragma once - -#include - -#include "Common/CommonTypes.h" - -enum GLInterfaceMode { - MODE_DETECT = 0, - MODE_DETECT_ES, - MODE_OPENGL, - MODE_OPENGLES2, - MODE_OPENGLES3, -}; - -class cInterfaceBase { -protected: - // Window dimensions. - u32 s_backbuffer_width; - u32 s_backbuffer_height; - - u32 s_opengl_mode; -public: - cInterfaceBase() : s_backbuffer_width(0), s_backbuffer_height(0), s_opengl_mode(MODE_DETECT) {} - virtual ~cInterfaceBase() {} - virtual void Swap() {} - virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; } - virtual u32 GetMode() { return s_opengl_mode; } - virtual void* GetFuncAddress(const std::string& name) { return nullptr; } - virtual bool Create(void *window_handle, bool core = true, bool use16bit = false) = 0; - virtual bool MakeCurrent() { return true; } - virtual bool ClearCurrent() { return true; } - virtual void Shutdown() {} - - virtual void SwapInterval(int Interval) { } - virtual u32 GetBackBufferWidth() { return s_backbuffer_width; } - virtual u32 GetBackBufferHeight() { return s_backbuffer_height; } - - virtual void OverrideBackbufferDimensions(int w, int h) = 0; - - virtual void SetBackBufferDimensions(u32 W, u32 H) {s_backbuffer_width = W; s_backbuffer_height = H; } - virtual void Update() { } - virtual bool PeekMessages() { return false; } -}; - - -cInterfaceBase* HostGL_CreateGLInterface(); diff --git a/Common/GPU/D3D11/thin3d_d3d11.cpp b/Common/GPU/D3D11/thin3d_d3d11.cpp index 3cad78701b..133fa9cfa4 100644 --- a/Common/GPU/D3D11/thin3d_d3d11.cpp +++ b/Common/GPU/D3D11/thin3d_d3d11.cpp @@ -62,7 +62,7 @@ public: class D3D11DrawContext : public DrawContext { public: - D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *deviceContext, ID3D11Device1 *device1, ID3D11DeviceContext1 *deviceContext1, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector deviceList); + D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *deviceContext, ID3D11Device1 *device1, ID3D11DeviceContext1 *deviceContext1, IDXGISwapChain *swapChain, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector deviceList, int maxInflightFrames); ~D3D11DrawContext(); const DeviceCaps &GetDeviceCaps() const override { @@ -137,8 +137,9 @@ public: void DrawUP(const void *vdata, int vertexCount) override; void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal) override; - void BeginFrame() override; + void BeginFrame(DebugFlags debugFlags) override; void EndFrame() override; + void Present(int vblanks) override; int GetFrameCount() override { return frameCount_; } @@ -181,9 +182,10 @@ private: HWND hWnd_; ID3D11Device *device_; - ID3D11DeviceContext *context_; ID3D11Device1 *device1_; + ID3D11DeviceContext *context_; ID3D11DeviceContext1 *context1_; + IDXGISwapChain *swapChain_; ID3D11Texture2D *bbRenderTargetTex_ = nullptr; // NOT OWNED ID3D11RenderTargetView *bbRenderTargetView_ = nullptr; @@ -244,13 +246,14 @@ private: std::vector deviceList_; }; -D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *deviceContext, ID3D11Device1 *device1, ID3D11DeviceContext1 *deviceContext1, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector deviceList) +D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *deviceContext, ID3D11Device1 *device1, ID3D11DeviceContext1 *deviceContext1, IDXGISwapChain *swapChain, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector deviceList, int maxInflightFrames) : hWnd_(hWnd), device_(device), context_(deviceContext1), device1_(device1), context1_(deviceContext1), featureLevel_(featureLevel), + swapChain_(swapChain), deviceList_(deviceList) { // We no longer support Windows Phone. @@ -346,6 +349,13 @@ D3D11DrawContext::D3D11DrawContext(ID3D11Device *device, ID3D11DeviceContext *de const size_t UP_MAX_BYTES = 65536 * 24; upBuffer_ = CreateBuffer(UP_MAX_BYTES, BufferUsageFlag::DYNAMIC | BufferUsageFlag::VERTEXDATA); + + IDXGIDevice1 *dxgiDevice1 = nullptr; + hr = device_->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast(&dxgiDevice1)); + if (SUCCEEDED(hr)) { + caps_.setMaxFrameLatencySupported = true; + dxgiDevice1->SetMaximumFrameLatency(maxInflightFrames); + } } D3D11DrawContext::~D3D11DrawContext() { @@ -416,16 +426,17 @@ void D3D11DrawContext::HandleEvent(Event ev, int width, int height, void *param1 curRTHeight_ = height; break; } - case Event::PRESENTED: - // Make sure that we don't eliminate the next time the render target is set. - curRenderTargetView_ = nullptr; - curDepthStencilView_ = nullptr; - break; } } void D3D11DrawContext::EndFrame() { curPipeline_ = nullptr; +} + +void D3D11DrawContext::Present(int vblanks) { + swapChain_->Present(1, 0); + curRenderTargetView_ = nullptr; + curDepthStencilView_ = nullptr; frameCount_++; } @@ -1518,7 +1529,7 @@ void D3D11DrawContext::Clear(int mask, uint32_t colorval, float depthVal, int st } } -void D3D11DrawContext::BeginFrame() { +void D3D11DrawContext::BeginFrame(DebugFlags debugFlags) { context_->OMSetRenderTargets(1, &curRenderTargetView_, curDepthStencilView_); if (curBlend_ != nullptr) { @@ -1858,8 +1869,8 @@ void D3D11DrawContext::GetFramebufferDimensions(Framebuffer *fbo, int *w, int *h } } -DrawContext *T3DCreateD3D11Context(ID3D11Device *device, ID3D11DeviceContext *context, ID3D11Device1 *device1, ID3D11DeviceContext1 *context1, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector adapterNames) { - return new D3D11DrawContext(device, context, device1, context1, featureLevel, hWnd, adapterNames); +DrawContext *T3DCreateD3D11Context(ID3D11Device *device, ID3D11DeviceContext *context, ID3D11Device1 *device1, ID3D11DeviceContext1 *context1, IDXGISwapChain *swapChain, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector adapterNames, int maxInflightFrames) { + return new D3D11DrawContext(device, context, device1, context1, swapChain, featureLevel, hWnd, adapterNames, maxInflightFrames); } } // namespace Draw diff --git a/Common/GPU/D3D9/thin3d_d3d9.cpp b/Common/GPU/D3D9/thin3d_d3d9.cpp index a05057d8a1..a23f4220fa 100644 --- a/Common/GPU/D3D9/thin3d_d3d9.cpp +++ b/Common/GPU/D3D9/thin3d_d3d9.cpp @@ -580,6 +580,8 @@ public: } void EndFrame() override; + void Present(int vblanks) override; + int GetFrameCount() override { return frameCount_; } void UpdateDynamicUniformBuffer(const void *ub, size_t size) override; @@ -966,6 +968,18 @@ void D3D9Context::BindNativeTexture(int index, void *nativeTexture) { void D3D9Context::EndFrame() { curPipeline_ = nullptr; +} + +void D3D9Context::Present(int vblanks) { + if (deviceEx_) { + deviceEx_->EndScene(); + deviceEx_->PresentEx(NULL, NULL, NULL, NULL, 0); + deviceEx_->BeginScene(); + } else { + device_->EndScene(); + device_->Present(NULL, NULL, NULL, NULL); + device_->BeginScene(); + } frameCount_++; } diff --git a/Common/GPU/MiscTypes.h b/Common/GPU/MiscTypes.h index 0db111a73d..8bd365508a 100644 --- a/Common/GPU/MiscTypes.h +++ b/Common/GPU/MiscTypes.h @@ -2,6 +2,8 @@ #include "Common/Common.h" +// Flags and structs shared between backends that haven't found a good home. + enum class InvalidationFlags { CACHED_RENDER_STATE = 1, }; @@ -14,3 +16,21 @@ enum class InvalidationCallbackFlags { ENUM_CLASS_BITOPS(InvalidationCallbackFlags); typedef std::function InvalidationCallback; + +// These are separate from FrameData because we store some history of these. +// Also, this might be joined with more non-GPU timing information later. +struct FrameTimeData { + uint64_t frameId; + + int waitCount; + + double frameBegin; + double afterFenceWait; + double firstSubmit; + double queuePresent; + + double actualPresent; + double desiredPresentTime; + double earliestPresentTime; + double presentMargin; +}; diff --git a/Common/GPU/OpenGL/GLRenderManager.cpp b/Common/GPU/OpenGL/GLRenderManager.cpp index 1e06d2ac83..1bc9c872d7 100644 --- a/Common/GPU/OpenGL/GLRenderManager.cpp +++ b/Common/GPU/OpenGL/GLRenderManager.cpp @@ -147,6 +147,7 @@ bool GLRenderManager::ThreadFrame() { // We got a task! We can now have pushMutex_ unlocked, allowing the host to // push more work when it feels like it, and just start working. if (task->runType == GLRRunType::EXIT) { + delete task; // Oh, host wanted out. Let's leave, and also let's notify the host. // This is unlike Vulkan too which can just block on the thread existing. std::unique_lock lock(syncMutex_); @@ -183,7 +184,7 @@ void GLRenderManager::StopThread() { } std::string GLRenderManager::GetGpuProfileString() const { - int curFrame = GetCurFrame(); + int curFrame = curFrame_; const GLQueueProfileContext &profile = frameData_[curFrame].profile; float cputime_ms = 1000.0f * (profile.cpuEndTime - profile.cpuStartTime); @@ -353,8 +354,8 @@ void GLRenderManager::BeginFrame(bool enableProfiling) { frameData.profile.enabled = enableProfiling; { - VLOG("PUSH: BeginFrame (curFrame = %d, readyForFence = %d, time=%0.3f)", curFrame, (int)frameData.readyForFence, time_now_d()); std::unique_lock lock(frameData.fenceMutex); + VLOG("PUSH: BeginFrame (curFrame = %d, readyForFence = %d, time=%0.3f)", curFrame, (int)frameData.readyForFence, time_now_d()); while (!frameData.readyForFence) { frameData.fenceCondVar.wait(lock); } @@ -371,25 +372,11 @@ void GLRenderManager::BeginFrame(bool enableProfiling) { void GLRenderManager::Finish() { curRenderStep_ = nullptr; // EndCurRenderStep is this simple here. - int curFrame = GetCurFrame(); + int curFrame = curFrame_; GLFrameData &frameData = frameData_[curFrame]; frameData_[curFrame].deleter.Take(deleter_); - VLOG("PUSH: Finish, pushing task. curFrame = %d", curFrame); - GLRRenderThreadTask *task = new GLRRenderThreadTask(GLRRunType::PRESENT); - task->frame = curFrame; - - { - std::unique_lock lock(pushMutex_); - renderThreadQueue_.push(task); - renderThreadQueue_.back()->initSteps = std::move(initSteps_); - renderThreadQueue_.back()->steps = std::move(steps_); - initSteps_.clear(); - steps_.clear(); - pushCondVar_.notify_one(); - } - if (frameData.profile.enabled) { profilePassesString_ = std::move(frameData.profile.passesString); @@ -407,17 +394,74 @@ void GLRenderManager::Finish() { frameData.profile.passesString.clear(); } - curFrame_++; - if (curFrame_ >= inflightFrames_) - curFrame_ = 0; + VLOG("PUSH: Finish, pushing task. curFrame = %d", curFrame); + GLRRenderThreadTask *task = new GLRRenderThreadTask(GLRRunType::SUBMIT); + task->frame = curFrame; + { + std::unique_lock lock(pushMutex_); + renderThreadQueue_.push(task); + renderThreadQueue_.back()->initSteps = std::move(initSteps_); + renderThreadQueue_.back()->steps = std::move(steps_); + initSteps_.clear(); + steps_.clear(); + pushCondVar_.notify_one(); + } +} + +void GLRenderManager::Present() { + GLRRenderThreadTask *presentTask = new GLRRenderThreadTask(GLRRunType::PRESENT); + presentTask->frame = curFrame_; + { + std::unique_lock lock(pushMutex_); + renderThreadQueue_.push(presentTask); + } + + int newCurFrame = curFrame_ + 1; + if (newCurFrame >= inflightFrames_) { + newCurFrame = 0; + } + curFrame_ = newCurFrame; insideFrame_ = false; } // Render thread. Returns true if the caller should handle a swap. bool GLRenderManager::Run(GLRRenderThreadTask &task) { + _dbg_assert_(task.frame >= 0); + GLFrameData &frameData = frameData_[task.frame]; + if (task.runType == GLRRunType::PRESENT) { + bool swapRequest = false; + if (!frameData.skipSwap) { + if (swapIntervalChanged_) { + swapIntervalChanged_ = false; + if (swapIntervalFunction_) { + swapIntervalFunction_(swapInterval_); + } + } + // This is the swapchain framebuffer flip. + if (swapFunction_) { + VLOG(" PULL: SwapFunction()"); + swapFunction_(); + } + swapRequest = true; + } else { + frameData.skipSwap = false; + } + frameData.hasBegun = false; + + VLOG(" PULL: Frame %d.readyForFence = true", task.frame); + + { + std::lock_guard lock(frameData.fenceMutex); + frameData.readyForFence = true; + frameData.fenceCondVar.notify_one(); + // At this point, we're done with this framedata (for now). + } + return swapRequest; + } + if (!frameData.hasBegun) { frameData.hasBegun = true; @@ -461,43 +505,8 @@ bool GLRenderManager::Run(GLRRenderThreadTask &task) { } } - bool swapRequest = false; - switch (task.runType) { - case GLRRunType::PRESENT: - if (!frameData.skipSwap) { - if (swapIntervalChanged_) { - swapIntervalChanged_ = false; - if (swapIntervalFunction_) { - swapIntervalFunction_(swapInterval_); - } - } - // This is the swapchain framebuffer flip. - if (swapFunction_) { - VLOG(" PULL: SwapFunction()"); - swapFunction_(); - if (!retainControl_) { - // get out of here. - swapRequest = true; - } - } else { - VLOG(" PULL: SwapRequested"); - swapRequest = true; - } - } else { - frameData.skipSwap = false; - } - frameData.hasBegun = false; - - VLOG(" PULL: Frame %d.readyForFence = true", task.frame); - - { - std::lock_guard lock(frameData.fenceMutex); - frameData.readyForFence = true; - frameData.fenceCondVar.notify_one(); - // At this point, we're done with this framedata (for now). - } - + case GLRRunType::SUBMIT: break; case GLRRunType::SYNC: @@ -516,7 +525,7 @@ bool GLRenderManager::Run(GLRRenderThreadTask &task) { _assert_(false); } VLOG(" PULL: ::Run(): Done running tasks"); - return swapRequest; + return false; } void GLRenderManager::FlushSync() { diff --git a/Common/GPU/OpenGL/GLRenderManager.h b/Common/GPU/OpenGL/GLRenderManager.h index 5cfc5711ed..a8cdfd0b7a 100644 --- a/Common/GPU/OpenGL/GLRenderManager.h +++ b/Common/GPU/OpenGL/GLRenderManager.h @@ -198,6 +198,7 @@ public: }; enum class GLRRunType { + SUBMIT, PRESENT, SYNC, EXIT, @@ -253,7 +254,8 @@ public: // Makes sure that the GPU has caught up enough that we can start writing buffers of this frame again. void BeginFrame(bool enableProfiling); // Can run on a different thread! - void Finish(); + void Finish(); + void Present(); // Creation commands. These were not needed in Vulkan since there we can do that on the main thread. // We pass in width/height here even though it's not strictly needed until we support glTextureStorage @@ -810,9 +812,8 @@ public: _dbg_assert_(foundCount == 1); } - void SetSwapFunction(std::function swapFunction, bool retainControl) { + void SetSwapFunction(std::function swapFunction) { swapFunction_ = swapFunction; - retainControl_ = retainControl; } void SetSwapIntervalFunction(std::function swapIntervalFunction) { @@ -891,7 +892,6 @@ private: std::function swapFunction_; std::function swapIntervalFunction_; - bool retainControl_ = false; GLBufferStrategy bufferStrategy_ = GLBufferStrategy::SUBDATA; int inflightFrames_ = MAX_INFLIGHT_FRAMES; diff --git a/Common/GPU/OpenGL/thin3d_gl.cpp b/Common/GPU/OpenGL/thin3d_gl.cpp index 5c0a155027..1e261be7a0 100644 --- a/Common/GPU/OpenGL/thin3d_gl.cpp +++ b/Common/GPU/OpenGL/thin3d_gl.cpp @@ -329,9 +329,6 @@ public: DrawContext::SetTargetSize(w, h); renderManager_.Resize(w, h); } - void SetDebugFlags(DebugFlags flags) override { - debugFlags_ = flags; - } const DeviceCaps &GetDeviceCaps() const override { return caps_; @@ -367,8 +364,9 @@ public: Buffer *CreateBuffer(size_t size, uint32_t usageFlags) override; Framebuffer *CreateFramebuffer(const FramebufferDesc &desc) override; - void BeginFrame() override; + void BeginFrame(DebugFlags debugFlags) override; void EndFrame() override; + void Present(int vblanks) override; int GetFrameCount() override { return frameCount_; @@ -492,6 +490,10 @@ public: renderManager_.SetInvalidationCallback(callback); } + std::string GetGpuProfileString() const override { + return renderManager_.GetGpuProfileString(); + } + private: void ApplySamplers(); @@ -523,8 +525,6 @@ private: GLPushBuffer *push; }; FrameData frameData_[GLRenderManager::MAX_INFLIGHT_FRAMES]{}; - - DebugFlags debugFlags_ = DebugFlags::NONE; }; static constexpr int MakeIntelSimpleVer(int v1, int v2, int v3) { @@ -571,6 +571,7 @@ OpenGLContext::OpenGLContext() { caps_.textureDepthSupported = true; } + caps_.setMaxFrameLatencySupported = true; caps_.dualSourceBlend = gl_extensions.ARB_blend_func_extended || gl_extensions.EXT_blend_func_extended; caps_.anisoSupported = gl_extensions.EXT_texture_filter_anisotropic; caps_.framebufferCopySupported = gl_extensions.OES_copy_image || gl_extensions.NV_copy_image || gl_extensions.EXT_copy_image || gl_extensions.ARB_copy_image; @@ -788,8 +789,8 @@ OpenGLContext::~OpenGLContext() { } } -void OpenGLContext::BeginFrame() { - renderManager_.BeginFrame(debugFlags_ & DebugFlags::PROFILE_TIMESTAMPS); +void OpenGLContext::BeginFrame(DebugFlags debugFlags) { + renderManager_.BeginFrame(debugFlags & DebugFlags::PROFILE_TIMESTAMPS); FrameData &frameData = frameData_[renderManager_.GetCurFrame()]; renderManager_.BeginPushBuffer(frameData.push); } @@ -798,8 +799,11 @@ void OpenGLContext::EndFrame() { FrameData &frameData = frameData_[renderManager_.GetCurFrame()]; renderManager_.EndPushBuffer(frameData.push); // upload the data! renderManager_.Finish(); - Invalidate(InvalidationFlags::CACHED_RENDER_STATE); +} + +void OpenGLContext::Present(int vblanks) { + renderManager_.Present(); frameCount_++; } diff --git a/Common/GPU/Vulkan/VulkanContext.cpp b/Common/GPU/Vulkan/VulkanContext.cpp index 94227059f2..5cb6760ae4 100644 --- a/Common/GPU/Vulkan/VulkanContext.cpp +++ b/Common/GPU/Vulkan/VulkanContext.cpp @@ -549,12 +549,13 @@ void VulkanContext::ChooseDevice(int physical_device) { vkGetPhysicalDeviceQueueFamilyProperties(physical_devices_[physical_device_], &queue_count, queueFamilyProperties_.data()); _dbg_assert_(queue_count >= 1); - // Detect preferred formats, in this order. + // Detect preferred depth/stencil formats, in this order. All supported devices will support at least one of these. static const VkFormat depthStencilFormats[] = { VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_D16_UNORM_S8_UINT, }; + deviceInfo_.preferredDepthStencilFormat = VK_FORMAT_UNDEFINED; for (size_t i = 0; i < ARRAY_SIZE(depthStencilFormats); i++) { VkFormatProperties props; @@ -573,7 +574,8 @@ void VulkanContext::ChooseDevice(int physical_device) { deviceInfo_.canBlitToPreferredDepthStencilFormat = true; } - // This is as good a place as any to do this. + // This is as good a place as any to do this. Though, we don't use this much anymore after we added + // support for VMA. vkGetPhysicalDeviceMemoryProperties(physical_devices_[physical_device_], &memory_properties_); INFO_LOG(G3D, "Memory Types (%d):", memory_properties_.memoryTypeCount); for (int i = 0; i < (int)memory_properties_.memoryTypeCount; i++) { @@ -598,6 +600,7 @@ void VulkanContext::ChooseDevice(int physical_device) { features2.pNext = &multiViewFeatures; multiViewFeatures.pNext = &presentWaitFeatures; presentWaitFeatures.pNext = &presentIdFeatures; + presentIdFeatures.pNext = nullptr; vkGetPhysicalDeviceFeatures2KHR(physical_devices_[physical_device_], &features2); deviceFeatures_.available.standard = features2.features; @@ -609,24 +612,6 @@ void VulkanContext::ChooseDevice(int physical_device) { deviceFeatures_.available.multiview = {}; } - deviceFeatures_.enabled = {}; - // Enable a few safe ones if they are available. - deviceFeatures_.enabled.standard.dualSrcBlend = deviceFeatures_.available.standard.dualSrcBlend; - deviceFeatures_.enabled.standard.logicOp = deviceFeatures_.available.standard.logicOp; - deviceFeatures_.enabled.standard.depthClamp = deviceFeatures_.available.standard.depthClamp; - deviceFeatures_.enabled.standard.depthBounds = deviceFeatures_.available.standard.depthBounds; - deviceFeatures_.enabled.standard.samplerAnisotropy = deviceFeatures_.available.standard.samplerAnisotropy; - deviceFeatures_.enabled.standard.shaderClipDistance = deviceFeatures_.available.standard.shaderClipDistance; - deviceFeatures_.enabled.standard.shaderCullDistance = deviceFeatures_.available.standard.shaderCullDistance; - deviceFeatures_.enabled.standard.geometryShader = deviceFeatures_.available.standard.geometryShader; - deviceFeatures_.enabled.standard.sampleRateShading = deviceFeatures_.available.standard.sampleRateShading; - - deviceFeatures_.enabled.multiview = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES }; - deviceFeatures_.enabled.multiview.multiview = deviceFeatures_.available.multiview.multiview; - deviceFeatures_.enabled.presentId = deviceFeatures_.available.presentId; - deviceFeatures_.enabled.presentWait = deviceFeatures_.available.presentWait; - // deviceFeatures_.enabled.multiview.multiviewGeometryShader = deviceFeatures_.available.multiview.multiviewGeometryShader; - GetDeviceLayerExtensionList(nullptr, device_extension_properties_); device_extensions_enabled_.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME); @@ -658,8 +643,8 @@ VkResult VulkanContext::CreateDevice() { return VK_ERROR_INITIALIZATION_FAILED; } - VkDeviceQueueCreateInfo queue_info{VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO}; - float queue_priorities[1] = {1.0f}; + VkDeviceQueueCreateInfo queue_info{ VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO }; + float queue_priorities[1] = { 1.0f }; queue_info.queueCount = 1; queue_info.pQueuePriorities = queue_priorities; bool found = false; @@ -691,9 +676,40 @@ VkResult VulkanContext::CreateDevice() { extensionsLookup_.EXT_fragment_shader_interlock = EnableDeviceExtension(VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME); extensionsLookup_.ARM_rasterization_order_attachment_access = EnableDeviceExtension(VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME); - extensionsLookup_.KHR_present_id = EnableDeviceExtension(VK_KHR_PRESENT_ID_EXTENSION_NAME); - extensionsLookup_.KHR_present_wait = EnableDeviceExtension(VK_KHR_PRESENT_WAIT_EXTENSION_NAME); +#if !PPSSPP_PLATFORM(MAC) && !PPSSPP_PLATFORM(IOS) extensionsLookup_.GOOGLE_display_timing = EnableDeviceExtension(VK_GOOGLE_DISPLAY_TIMING_EXTENSION_NAME); +#endif + if (!extensionsLookup_.GOOGLE_display_timing) { + extensionsLookup_.KHR_present_id = EnableDeviceExtension(VK_KHR_PRESENT_ID_EXTENSION_NAME); + extensionsLookup_.KHR_present_wait = EnableDeviceExtension(VK_KHR_PRESENT_WAIT_EXTENSION_NAME); + } + + deviceFeatures_.enabled = {}; + // Enable a few safe ones if they are available. + deviceFeatures_.enabled.standard.dualSrcBlend = deviceFeatures_.available.standard.dualSrcBlend; + deviceFeatures_.enabled.standard.logicOp = deviceFeatures_.available.standard.logicOp; + deviceFeatures_.enabled.standard.depthClamp = deviceFeatures_.available.standard.depthClamp; + deviceFeatures_.enabled.standard.depthBounds = deviceFeatures_.available.standard.depthBounds; + deviceFeatures_.enabled.standard.samplerAnisotropy = deviceFeatures_.available.standard.samplerAnisotropy; + deviceFeatures_.enabled.standard.shaderClipDistance = deviceFeatures_.available.standard.shaderClipDistance; + deviceFeatures_.enabled.standard.shaderCullDistance = deviceFeatures_.available.standard.shaderCullDistance; + deviceFeatures_.enabled.standard.geometryShader = deviceFeatures_.available.standard.geometryShader; + deviceFeatures_.enabled.standard.sampleRateShading = deviceFeatures_.available.standard.sampleRateShading; + + deviceFeatures_.enabled.multiview = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES }; + if (extensionsLookup_.KHR_multiview) { + deviceFeatures_.enabled.multiview.multiview = deviceFeatures_.available.multiview.multiview; + } + // Strangely, on Intel, it reports these as available even though the extension isn't in the list. + deviceFeatures_.enabled.presentId = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR }; + if (extensionsLookup_.KHR_present_id) { + deviceFeatures_.enabled.presentId.presentId = deviceFeatures_.available.presentId.presentId; + } + deviceFeatures_.enabled.presentWait = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR }; + if (extensionsLookup_.KHR_present_wait) { + deviceFeatures_.enabled.presentWait.presentWait = deviceFeatures_.available.presentWait.presentWait; + } + // deviceFeatures_.enabled.multiview.multiviewGeometryShader = deviceFeatures_.available.multiview.multiviewGeometryShader; VkPhysicalDeviceFeatures2 features2{ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2 }; @@ -709,6 +725,9 @@ VkResult VulkanContext::CreateDevice() { device_info.pNext = &features2; features2.features = deviceFeatures_.enabled.standard; features2.pNext = &deviceFeatures_.enabled.multiview; + deviceFeatures_.enabled.multiview.pNext = &deviceFeatures_.enabled.presentWait; + deviceFeatures_.enabled.presentWait.pNext = &deviceFeatures_.enabled.presentId; + deviceFeatures_.enabled.presentId.pNext = nullptr; } else { device_info.pEnabledFeatures = &deviceFeatures_.enabled.standard; } diff --git a/Common/GPU/Vulkan/VulkanContext.h b/Common/GPU/Vulkan/VulkanContext.h index 66f1b472b8..83c05e461e 100644 --- a/Common/GPU/Vulkan/VulkanContext.h +++ b/Common/GPU/Vulkan/VulkanContext.h @@ -291,6 +291,13 @@ public: return device_extensions_enabled_; } + const std::vector &GetInstanceExtensionsAvailable() const { + return instance_extension_properties_; + } + const std::vector &GetInstanceExtensionsEnabled() const { + return instance_extensions_enabled_; + } + const VkPhysicalDeviceMemoryProperties &GetMemoryProperties() const { return memory_properties_; } @@ -314,7 +321,6 @@ public: for (const auto &iter : instance_layer_properties_) { for (const auto &ext : iter.extensions) { if (!strcmp(extensionName, ext.extensionName)) { - INFO_LOG(G3D, "%s found in layer extensions: %s", extensionName, iter.properties.layerName); return true; } } diff --git a/Common/GPU/Vulkan/VulkanDebug.cpp b/Common/GPU/Vulkan/VulkanDebug.cpp index 851d5dbb7c..022093e217 100644 --- a/Common/GPU/Vulkan/VulkanDebug.cpp +++ b/Common/GPU/Vulkan/VulkanDebug.cpp @@ -82,6 +82,10 @@ VKAPI_ATTR VkBool32 VKAPI_CALL VulkanDebugUtilsCallback( // Extended validation (ARM best practices) // Non-fifo validation not recommended return false; + case 337425955: + // False positive + // https://github.com/KhronosGroup/Vulkan-ValidationLayers/issues/3615 + return false; default: break; } diff --git a/Common/GPU/Vulkan/VulkanFrameData.cpp b/Common/GPU/Vulkan/VulkanFrameData.cpp index 472afe69a2..0ca94bd848 100644 --- a/Common/GPU/Vulkan/VulkanFrameData.cpp +++ b/Common/GPU/Vulkan/VulkanFrameData.cpp @@ -110,6 +110,22 @@ VkResult FrameData::QueuePresent(VulkanContext *vulkan, FrameDataShared &shared) present.pWaitSemaphores = &shared.renderingCompleteSemaphore; present.waitSemaphoreCount = 1; + // Can't move these into the if. + VkPresentIdKHR presentID{ VK_STRUCTURE_TYPE_PRESENT_ID_KHR }; + VkPresentTimesInfoGOOGLE presentGOOGLE{ VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE }; + + uint64_t frameId = this->frameId; + VkPresentTimeGOOGLE presentTimeGOOGLE{ (uint32_t)frameId, 0 }; // it's ok to truncate this. it'll wrap around and work (if we ever reach 4 billion frames..) + if (vulkan->Extensions().KHR_present_id && vulkan->GetDeviceFeatures().enabled.presentId.presentId) { + presentID.pPresentIds = &frameId; + presentID.swapchainCount = 1; + present.pNext = &presentID; + } else if (vulkan->Extensions().GOOGLE_display_timing) { + presentGOOGLE.pTimes = &presentTimeGOOGLE; + presentGOOGLE.swapchainCount = 1; + present.pNext = &presentGOOGLE; + } + return vkQueuePresentKHR(vulkan->GetGraphicsQueue(), &present); } diff --git a/Common/GPU/Vulkan/VulkanFrameData.h b/Common/GPU/Vulkan/VulkanFrameData.h index 63176cf469..a4638bb618 100644 --- a/Common/GPU/Vulkan/VulkanFrameData.h +++ b/Common/GPU/Vulkan/VulkanFrameData.h @@ -13,6 +13,7 @@ enum { }; enum class VKRRunType { + SUBMIT, PRESENT, SYNC, EXIT, @@ -95,6 +96,10 @@ struct FrameData { // Swapchain. uint32_t curSwapchainImage = -1; + // Frames need unique IDs to wait for present on, let's keep them here. + // Also used for indexing into the frame timing history buffer. + uint64_t frameId; + // Profiling. QueueProfileContext profile{}; diff --git a/Common/GPU/Vulkan/VulkanLoader.cpp b/Common/GPU/Vulkan/VulkanLoader.cpp index 23f664ba97..f30092ab1b 100644 --- a/Common/GPU/Vulkan/VulkanLoader.cpp +++ b/Common/GPU/Vulkan/VulkanLoader.cpp @@ -223,11 +223,16 @@ PFN_vkCmdInsertDebugUtilsLabelEXT vkCmdInsertDebugUtilsLabelEXT; PFN_vkSetDebugUtilsObjectNameEXT vkSetDebugUtilsObjectNameEXT; PFN_vkSetDebugUtilsObjectTagEXT vkSetDebugUtilsObjectTagEXT; +// Assorted other extensions. PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR; PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR; PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; +PFN_vkWaitForPresentKHR vkWaitForPresentKHR; +PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; +PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE; + } // namespace PPSSPP_VK using namespace PPSSPP_VK; @@ -726,6 +731,13 @@ void VulkanLoadDeviceFunctions(VkDevice device, const VulkanExtensions &enabledE LOAD_DEVICE_FUNC(device, vkCmdEndRenderPass); LOAD_DEVICE_FUNC(device, vkCmdExecuteCommands); + if (enabledExtensions.KHR_present_wait) { + LOAD_DEVICE_FUNC(device, vkWaitForPresentKHR); + } + if (enabledExtensions.GOOGLE_display_timing) { + LOAD_DEVICE_FUNC(device, vkGetPastPresentationTimingGOOGLE); + LOAD_DEVICE_FUNC(device, vkGetRefreshCycleDurationGOOGLE); + } if (enabledExtensions.KHR_dedicated_allocation) { LOAD_DEVICE_FUNC(device, vkGetBufferMemoryRequirements2KHR); LOAD_DEVICE_FUNC(device, vkGetImageMemoryRequirements2KHR); diff --git a/Common/GPU/Vulkan/VulkanLoader.h b/Common/GPU/Vulkan/VulkanLoader.h index a6dd6f5247..0e631ba718 100644 --- a/Common/GPU/Vulkan/VulkanLoader.h +++ b/Common/GPU/Vulkan/VulkanLoader.h @@ -235,6 +235,9 @@ extern PFN_vkGetMemoryHostPointerPropertiesEXT vkGetMemoryHostPointerPropertiesE extern PFN_vkGetPhysicalDeviceProperties2KHR vkGetPhysicalDeviceProperties2KHR; extern PFN_vkGetPhysicalDeviceFeatures2KHR vkGetPhysicalDeviceFeatures2KHR; extern PFN_vkCreateRenderPass2KHR vkCreateRenderPass2KHR; +extern PFN_vkWaitForPresentKHR vkWaitForPresentKHR; +extern PFN_vkGetPastPresentationTimingGOOGLE vkGetPastPresentationTimingGOOGLE; +extern PFN_vkGetRefreshCycleDurationGOOGLE vkGetRefreshCycleDurationGOOGLE; } // namespace PPSSPP_VK // For fast extension-enabled checks. diff --git a/Common/GPU/Vulkan/VulkanRenderManager.cpp b/Common/GPU/Vulkan/VulkanRenderManager.cpp index 4b64beb400..683b6cf515 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.cpp +++ b/Common/GPU/Vulkan/VulkanRenderManager.cpp @@ -25,6 +25,9 @@ #define UINT64_MAX 0xFFFFFFFFFFFFFFFFULL #endif + +#define USE_PRESENT_WAIT 0 + using namespace PPSSPP_VK; // renderPass is an example of the "compatibility class" or RenderPassType type. @@ -303,6 +306,11 @@ bool VulkanRenderManager::CreateBackbuffers() { } INFO_LOG(G3D, "Starting Vulkan compiler thread"); compileThread_ = std::thread(&VulkanRenderManager::CompileThreadFunc, this); + + if (USE_PRESENT_WAIT && vulkan_->Extensions().KHR_present_wait && vulkan_->GetPresentMode() == VK_PRESENT_MODE_FIFO_KHR) { + INFO_LOG(G3D, "Starting Vulkan present wait thread"); + presentWaitThread_ = std::thread(&VulkanRenderManager::PresentWaitThreadFunc, this); + } } return true; } @@ -319,9 +327,13 @@ void VulkanRenderManager::StopThread() { pushCondVar_.notify_one(); } - // Compiler thread still relies on this. + // Compiler and present thread still relies on this. run_ = false; + if (presentWaitThread_.joinable()) { + presentWaitThread_.join(); + } + // Stop the thread. if (useRenderThread_) { thread_.join(); @@ -531,13 +543,61 @@ void VulkanRenderManager::ThreadFunc() { VLOG("PULL: Quitting"); } +void VulkanRenderManager::PresentWaitThreadFunc() { + SetCurrentThreadName("PresentWait"); + + _dbg_assert_(vkWaitForPresentKHR != nullptr); + + uint64_t waitedId = frameIdGen_; + while (run_) { + const uint64_t timeout = 1000000000ULL; // 1 sec + if (VK_SUCCESS == vkWaitForPresentKHR(vulkan_->GetDevice(), vulkan_->GetSwapchain(), waitedId, timeout)) { + frameTimeData_[waitedId].actualPresent = time_now_d(); + frameTimeData_[waitedId].waitCount++; + waitedId++; + } else { + // We caught up somehow, which is a bad sign (we should have blocked, right?). Maybe we should break out of the loop? + sleep_ms(1); + frameTimeData_[waitedId].waitCount++; + } + _dbg_assert_(waitedId <= frameIdGen_); + } + + INFO_LOG(G3D, "Leaving PresentWaitThreadFunc()"); +} + +void VulkanRenderManager::PollPresentTiming() { + // For VK_GOOGLE_display_timing, we need to poll. + + // Poll for information about completed frames. + // NOTE: We seem to get the information pretty late! Like after 6 frames, which is quite weird. + // Tested on POCO F4. + if (vulkan_->Extensions().GOOGLE_display_timing) { + uint32_t count = 0; + vkGetPastPresentationTimingGOOGLE(vulkan_->GetDevice(), vulkan_->GetSwapchain(), &count, nullptr); + if (count > 0) { + VkPastPresentationTimingGOOGLE *timings = new VkPastPresentationTimingGOOGLE[count]; + vkGetPastPresentationTimingGOOGLE(vulkan_->GetDevice(), vulkan_->GetSwapchain(), &count, timings); + for (uint32_t i = 0; i < count; i++) { + uint64_t presentId = timings[i].presentID; + frameTimeData_[presentId].actualPresent = from_time_raw(timings[i].actualPresentTime); + frameTimeData_[presentId].desiredPresentTime = from_time_raw(timings[i].desiredPresentTime); + frameTimeData_[presentId].earliestPresentTime = from_time_raw(timings[i].earliestPresentTime); + double presentMargin = from_time_raw_relative(timings[i].presentMargin); + frameTimeData_[presentId].presentMargin = presentMargin; + } + delete[] timings; + } + } +} + void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfiler) { + double frameBeginTime = time_now_d() VLOG("BeginFrame"); VkDevice device = vulkan_->GetDevice(); int curFrame = vulkan_->GetCurFrame(); FrameData &frameData = frameData_[curFrame]; - VLOG("PUSH: Fencing %d", curFrame); // Makes sure the submission from the previous time around has happened. Otherwise @@ -557,11 +617,21 @@ void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfile } vkResetFences(device, 1, &frameData.fence); + uint64_t frameId = frameIdGen_++; + + PollPresentTiming(); + int validBits = vulkan_->GetQueueFamilyProperties(vulkan_->GetGraphicsQueueFamilyIndex()).timestampValidBits; // Can't set this until after the fence. frameData.profile.enabled = enableProfiling; frameData.profile.timestampsEnabled = enableProfiling && validBits > 0; + frameData.frameId = frameId; + + frameTimeData_[frameId] = {}; + frameTimeData_[frameId].frameId = frameId; + frameTimeData_[frameId].frameBegin = frameBeginTime; + frameTimeData_[frameId].afterFenceWait = time_now_d(); uint64_t queryResults[MAX_TIMESTAMP_QUERIES]; @@ -1269,7 +1339,7 @@ void VulkanRenderManager::Finish() { FrameData &frameData = frameData_[curFrame]; VLOG("PUSH: Frame[%d]", curFrame); - VKRRenderThreadTask *task = new VKRRenderThreadTask(VKRRunType::PRESENT); + VKRRenderThreadTask *task = new VKRRenderThreadTask(VKRRunType::SUBMIT); task->frame = curFrame; if (useRenderThread_) { std::unique_lock lock(pushMutex_); @@ -1284,6 +1354,23 @@ void VulkanRenderManager::Finish() { } steps_.clear(); +} + +void VulkanRenderManager::Present() { + int curFrame = vulkan_->GetCurFrame(); + + VKRRenderThreadTask *task = new VKRRenderThreadTask(VKRRunType::PRESENT); + task->frame = curFrame; + if (useRenderThread_) { + std::unique_lock lock(pushMutex_); + renderThreadQueue_.push(task); + pushCondVar_.notify_one(); + } else { + // Just do it! + Run(*task); + delete task; + } + vulkan_->EndFrame(); insideFrame_ = false; } @@ -1301,7 +1388,35 @@ void VulkanRenderManager::Wipe() { void VulkanRenderManager::Run(VKRRenderThreadTask &task) { FrameData &frameData = frameData_[task.frame]; + if (task.runType == VKRRunType::PRESENT) { + if (!frameData.skipSwap) { + VkResult res = frameData.QueuePresent(vulkan_, frameDataShared_); + frameTimeData_[frameData.frameId].queuePresent = time_now_d(); + if (res == VK_ERROR_OUT_OF_DATE_KHR) { + // We clearly didn't get this in vkAcquireNextImageKHR because of the skipSwap check above. + // Do the increment. + outOfDateFrames_++; + } else if (res == VK_SUBOPTIMAL_KHR) { + outOfDateFrames_++; + } else if (res != VK_SUCCESS) { + _assert_msg_(false, "vkQueuePresentKHR failed! result=%s", VulkanResultToString(res)); + } else { + // Success + outOfDateFrames_ = 0; + } + } else { + // We only get here if vkAcquireNextImage returned VK_ERROR_OUT_OF_DATE. + outOfDateFrames_++; + frameData.skipSwap = false; + } + return; + } + _dbg_assert_(!frameData.hasPresentCommands); + + if (!frameTimeData_[frameData.frameId].firstSubmit) { + frameTimeData_[frameData.frameId].firstSubmit = time_now_d(); + } frameData.SubmitPending(vulkan_, FrameSubmitType::Pending, frameDataShared_); if (!frameData.hasMainCommands) { @@ -1333,28 +1448,8 @@ void VulkanRenderManager::Run(VKRRenderThreadTask &task) { } switch (task.runType) { - case VKRRunType::PRESENT: + case VKRRunType::SUBMIT: frameData.SubmitPending(vulkan_, FrameSubmitType::Present, frameDataShared_); - - if (!frameData.skipSwap) { - VkResult res = frameData.QueuePresent(vulkan_, frameDataShared_); - if (res == VK_ERROR_OUT_OF_DATE_KHR) { - // We clearly didn't get this in vkAcquireNextImageKHR because of the skipSwap check above. - // Do the increment. - outOfDateFrames_++; - } else if (res == VK_SUBOPTIMAL_KHR) { - outOfDateFrames_++; - } else if (res != VK_SUCCESS) { - _assert_msg_(false, "vkQueuePresentKHR failed! result=%s", VulkanResultToString(res)); - } else { - // Success - outOfDateFrames_ = 0; - } - } else { - // We only get here if vkAcquireNextImage returned VK_ERROR_OUT_OF_DATE. - outOfDateFrames_++; - frameData.skipSwap = false; - } break; case VKRRunType::SYNC: diff --git a/Common/GPU/Vulkan/VulkanRenderManager.h b/Common/GPU/Vulkan/VulkanRenderManager.h index 012a098ba1..fbe1bbc5fc 100644 --- a/Common/GPU/Vulkan/VulkanRenderManager.h +++ b/Common/GPU/Vulkan/VulkanRenderManager.h @@ -17,6 +17,7 @@ #include "Common/System/Display.h" #include "Common/GPU/Vulkan/VulkanContext.h" #include "Common/Data/Convert/SmallDataConvert.h" +#include "Common/Data/Collections/FastVec.h" #include "Common/Math/math_util.h" #include "Common/GPU/DataFormat.h" #include "Common/GPU/MiscTypes.h" @@ -186,8 +187,9 @@ public: // Makes sure that the GPU has caught up enough that we can start writing buffers of this frame again. void BeginFrame(bool enableProfiling, bool enableLogProfiler); - // Can run on a different thread! + // These can run on a different thread! void Finish(); + void Present(); // Zaps queued up commands. Use if you know there's a risk you've queued up stuff that has already been deleted. Can happen during in-game shutdown. void Wipe(); @@ -456,6 +458,17 @@ public: void ResetStats(); void DrainCompileQueue(); + // framesBack is the number of frames into the past to look. + FrameTimeData GetFrameTimeData(int framesBack) const { + FrameTimeData data; + if (framesBack >= frameIdGen_) { + data = {}; + return data; + } + data = frameTimeData_[frameIdGen_ - framesBack]; + return data; + } + private: void EndCurRenderStep(); @@ -468,6 +481,9 @@ private: void FlushSync(); void StopThread(); + void PresentWaitThreadFunc(); + void PollPresentTiming(); + FrameDataShared frameDataShared_; FrameData frameData_[VulkanContext::MAX_INFLIGHT_FRAMES]; @@ -523,6 +539,9 @@ private: std::mutex compileMutex_; std::vector compileQueue_; + // Thread for measuring presentation delay. + std::thread presentWaitThread_; + // pipelines to check and possibly create at the end of the current render pass. std::vector pipelinesToCheck_; @@ -532,4 +551,7 @@ private: SimpleStat renderCPUTimeMs_; std::function invalidationCallback_; + + uint64_t frameIdGen_ = 31; + HistoryBuffer frameTimeData_; }; diff --git a/Common/GPU/Vulkan/thin3d_vulkan.cpp b/Common/GPU/Vulkan/thin3d_vulkan.cpp index 325b894d17..0af1e27a38 100644 --- a/Common/GPU/Vulkan/thin3d_vulkan.cpp +++ b/Common/GPU/Vulkan/thin3d_vulkan.cpp @@ -388,7 +388,6 @@ public: ~VKContext(); void DebugAnnotate(const char *annotation) override; - void SetDebugFlags(DebugFlags flags) override; const DeviceCaps &GetDeviceCaps() const override { return caps_; @@ -479,14 +478,20 @@ public: void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal) override; - void BeginFrame() override; + void BeginFrame(DebugFlags debugFlags) override; void EndFrame() override; + void Present(int vblanks) override; + void WipeQueue() override; int GetFrameCount() override { return frameCount_; } + FrameTimeData GetFrameTimeData(int framesBack) const override { + return renderManager_.GetFrameTimeData(framesBack); + } + void FlushState() override {} void ResetStats() override { @@ -513,7 +518,7 @@ public: VkDescriptorSet GetOrCreateDescriptorSet(VkBuffer buffer); std::vector GetFeatureList() const override; - std::vector GetExtensionList() const override; + std::vector GetExtensionList(bool device, bool enabledOnly) const override; uint64_t GetNativeObject(NativeObject obj, void *srcObject) override; @@ -527,6 +532,10 @@ public: renderManager_.SetInvalidationCallback(callback); } + std::string GetGpuProfileString() const override { + return renderManager_.GetGpuProfileString(); + } + private: VulkanTexture *GetNullTexture(); VulkanContext *vulkan_ = nullptr; @@ -548,7 +557,6 @@ private: AutoRef curFramebuffer_; VkDevice device_; - DebugFlags debugFlags_ = DebugFlags::NONE; enum { MAX_FRAME_COMMAND_BUFFERS = 256, @@ -863,6 +871,7 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) VkFormat depthStencilFormat = vulkan->GetDeviceInfo().preferredDepthStencilFormat; + caps_.setMaxFrameLatencySupported = true; caps_.anisoSupported = vulkan->GetDeviceFeatures().enabled.standard.samplerAnisotropy != 0; caps_.geometryShaderSupported = vulkan->GetDeviceFeatures().enabled.standard.geometryShader != 0; caps_.tesselationShaderSupported = vulkan->GetDeviceFeatures().enabled.standard.tessellationShader != 0; @@ -888,6 +897,7 @@ VKContext::VKContext(VulkanContext *vulkan, bool useRenderThread) caps_.logicOpSupported = vulkan->GetDeviceFeatures().enabled.standard.logicOp != 0; caps_.multiViewSupported = vulkan->GetDeviceFeatures().enabled.multiview.multiview != 0; caps_.sampleRateShadingSupported = vulkan->GetDeviceFeatures().enabled.standard.sampleRateShading != 0; + caps_.textureSwizzleSupported = true; const auto &limits = vulkan->GetPhysicalDeviceProperties().properties.limits; @@ -1093,9 +1103,8 @@ VKContext::~VKContext() { vulkan_->Delete().QueueDeletePipelineCache(pipelineCache_); } -void VKContext::BeginFrame() { - // TODO: Bad dependency on g_Config here! - renderManager_.BeginFrame(debugFlags_ & DebugFlags::PROFILE_TIMESTAMPS, debugFlags_ & DebugFlags::PROFILE_SCOPES); +void VKContext::BeginFrame(DebugFlags debugFlags) { + renderManager_.BeginFrame(debugFlags & DebugFlags::PROFILE_TIMESTAMPS, debugFlags & DebugFlags::PROFILE_SCOPES); FrameData &frame = frame_[vulkan_->GetCurFrame()]; @@ -1105,11 +1114,15 @@ void VKContext::BeginFrame() { } void VKContext::EndFrame() { + // Do all the work to submit the command buffers etc. renderManager_.Finish(); - // Unbind stuff, to avoid accidentally relying on it across frames (and provide some protection against forgotten unbinds of deleted things). Invalidate(InvalidationFlags::CACHED_RENDER_STATE); +} +void VKContext::Present(int vblanks) { + _dbg_assert_(vblanks == 0 || vblanks == 1); + renderManager_.Present(); frameCount_++; } @@ -1622,10 +1635,16 @@ std::vector VKContext::GetFeatureList() const { return features; } -std::vector VKContext::GetExtensionList() const { +std::vector VKContext::GetExtensionList(bool device, bool enabledOnly) const { std::vector extensions; - for (auto &iter : vulkan_->GetDeviceExtensionsAvailable()) { - extensions.push_back(iter.extensionName); + if (enabledOnly) { + for (auto &iter : (device ? vulkan_->GetDeviceExtensionsEnabled() : vulkan_->GetInstanceExtensionsEnabled())) { + extensions.push_back(iter); + } + } else { + for (auto &iter : (device ? vulkan_->GetDeviceExtensionsAvailable() : vulkan_->GetInstanceExtensionsAvailable())) { + extensions.push_back(iter.extensionName); + } } return extensions; } @@ -1854,8 +1873,4 @@ void VKContext::DebugAnnotate(const char *annotation) { renderManager_.DebugAnnotate(annotation); } -void VKContext::SetDebugFlags(DebugFlags flags) { - debugFlags_ = flags; -} - } // namespace Draw diff --git a/Common/GPU/thin3d.h b/Common/GPU/thin3d.h index 5213726c94..c90d8ed93d 100644 --- a/Common/GPU/thin3d.h +++ b/Common/GPU/thin3d.h @@ -603,6 +603,8 @@ struct DeviceCaps { bool multiViewSupported; bool isTilingGPU; // This means that it benefits from correct store-ops, msaa without backing memory, etc. bool sampleRateShadingSupported; + bool setMaxFrameLatencySupported; + bool textureSwizzleSupported; bool verySlowShaderCompiler; @@ -691,7 +693,7 @@ public: virtual const DeviceCaps &GetDeviceCaps() const = 0; virtual uint32_t GetDataFormatSupport(DataFormat fmt) const = 0; virtual std::vector GetFeatureList() const { return std::vector(); } - virtual std::vector GetExtensionList() const { return std::vector(); } + virtual std::vector GetExtensionList(bool device, bool enabledOnly) const { return std::vector(); } virtual std::vector GetDeviceList() const { return std::vector(); } virtual PresentationMode GetPresentationMode() const = 0; @@ -706,7 +708,6 @@ public: virtual void SetErrorCallback(ErrorCallbackFn callback, void *userdata) {} virtual void DebugAnnotate(const char *annotation) {} - virtual void SetDebugFlags(DebugFlags flags) {} // Partial pipeline state, used to create pipelines. (in practice, in d3d11 they'll use the native state objects directly). // TODO: Possibly ditch these and just put the descs directly in PipelineDesc since only D3D11 benefits. @@ -812,8 +813,10 @@ public: virtual void DrawUP(const void *vdata, int vertexCount) = 0; // Frame management (for the purposes of sync and resource management, necessary with modern APIs). Default implementations here. - virtual void BeginFrame() {} + virtual void BeginFrame(DebugFlags debugFlags) {} virtual void EndFrame() = 0; + virtual void Present(int vblanks) = 0; // NOTE: Not all backends support vblanks > 1. + virtual void WipeQueue() {} // This should be avoided as much as possible, in favor of clearing when binding a render target, which is native @@ -843,7 +846,14 @@ public: // Total amount of frames rendered. Unaffected by game pause, so more robust than gpuStats.numFlips virtual int GetFrameCount() = 0; - virtual int GetFramesInFlight() { return 3; } + + virtual FrameTimeData GetFrameTimeData(int framesBack) const { + return FrameTimeData{}; + } + + virtual std::string GetGpuProfileString() const { + return ""; + } protected: ShaderModule *vsPresets_[VS_MAX_PRESET]; diff --git a/Common/GPU/thin3d_create.h b/Common/GPU/thin3d_create.h index 5f304af090..fa56ebbb09 100644 --- a/Common/GPU/thin3d_create.h +++ b/Common/GPU/thin3d_create.h @@ -17,7 +17,7 @@ struct ID3D11Device; struct ID3D11DeviceContext; struct ID3D11Device1; struct ID3D11DeviceContext1; - +struct IDXGISwapChain; #endif class VulkanContext; @@ -28,7 +28,7 @@ DrawContext *T3DCreateGLContext(); #ifdef _WIN32 DrawContext *T3DCreateDX9Context(IDirect3D9 *d3d, IDirect3D9Ex *d3dEx, int adapterId, IDirect3DDevice9 *device, IDirect3DDevice9Ex *deviceEx); -DrawContext *T3DCreateD3D11Context(ID3D11Device *device, ID3D11DeviceContext *context, ID3D11Device1 *device1, ID3D11DeviceContext1 *context1, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector adapterNames); +DrawContext *T3DCreateD3D11Context(ID3D11Device *device, ID3D11DeviceContext *context, ID3D11Device1 *device1, ID3D11DeviceContext1 *context1, IDXGISwapChain *swapChain, D3D_FEATURE_LEVEL featureLevel, HWND hWnd, std::vector adapterNames, int maxInflightFrames); #endif DrawContext *T3DCreateVulkanContext(VulkanContext *context, bool useRenderThread); diff --git a/Common/GraphicsContext.h b/Common/GraphicsContext.h index 873722764c..73ebf18a7b 100644 --- a/Common/GraphicsContext.h +++ b/Common/GraphicsContext.h @@ -16,8 +16,6 @@ public: virtual void Shutdown() = 0; virtual void SwapInterval(int interval) = 0; - virtual void SwapBuffers() = 0; - // Used during window resize. Must be called from the window thread, // not the rendering thread or CPU thread. virtual void Pause() {} diff --git a/Common/MemArenaPosix.cpp b/Common/MemArenaPosix.cpp index 6956f9fcd8..7923b99b85 100644 --- a/Common/MemArenaPosix.cpp +++ b/Common/MemArenaPosix.cpp @@ -52,6 +52,7 @@ bool MemArena::NeedsProbing() { } bool MemArena::GrabMemSpace(size_t size) { +#ifndef NO_MMAP constexpr mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; // Try a few times in case multiple instances are started near each other. @@ -98,15 +99,21 @@ bool MemArena::GrabMemSpace(size_t size) { ERROR_LOG(MEMMAP, "Failed to ftruncate %d (%s) to size %08x", (int)fd, ram_temp_file.c_str(), (int)size); // Should this be a failure? } +#endif return true; } void MemArena::ReleaseSpace() { +#ifndef NO_MMAP close(fd); +#endif } void *MemArena::CreateView(s64 offset, size_t size, void *base) { +#ifdef NO_MMAP + return (void*) base; +#else void *retval = mmap(base, size, PROT_READ | PROT_WRITE, MAP_SHARED | // Do not sync memory to underlying file. Linux has this by default. #if defined(__DragonFly__) || defined(__FreeBSD__) @@ -119,10 +126,13 @@ void *MemArena::CreateView(s64 offset, size_t size, void *base) return 0; } return retval; +#endif } void MemArena::ReleaseView(s64 offset, void* view, size_t size) { +#ifndef NO_MMAP munmap(view, size); +#endif } u8* MemArena::Find4GBBase() { @@ -147,6 +157,9 @@ u8* MemArena::Find4GBBase() { // This has been known to fail lately though, see issue #12249. return hardcoded_ptr; } +#elif defined(NO_MMAP) + void* base = std::malloc(0x0A000000); + return static_cast(base); #else size_t size = 0x10000000; void* base = mmap(0, size, PROT_READ | PROT_WRITE, MAP_ANON | MAP_SHARED | MAP_NORESERVE, -1, 0); diff --git a/Common/Render/Text/draw_text_android.cpp b/Common/Render/Text/draw_text_android.cpp index d1e6244cb2..d98987ccea 100644 --- a/Common/Render/Text/draw_text_android.cpp +++ b/Common/Render/Text/draw_text_android.cpp @@ -29,8 +29,10 @@ TextDrawerAndroid::TextDrawerAndroid(Draw::DrawContext *draw) : TextDrawer(draw) } dpiScale_ = CalculateDPIScale(); + // Pick between the two supported formats, of which at least one is supported on each platform. Prefer R8 (but only if swizzle is supported) use4444Format_ = (draw->GetDataFormatSupport(Draw::DataFormat::R4G4B4A4_UNORM_PACK16) & Draw::FMT_TEXTURE) != 0; - + if ((draw->GetDataFormatSupport(Draw::DataFormat::R8_UNORM) & Draw::FMT_TEXTURE) != 0 && draw->GetDeviceCaps().textureSwizzleSupported) + use4444Format_ = false; INFO_LOG(G3D, "Initializing TextDrawerAndroid with DPI scale %f, use4444=%d", dpiScale_, (int)use4444Format_); } @@ -206,20 +208,30 @@ void TextDrawerAndroid::DrawStringBitmap(std::vector &bitmapData, TextS if (texFormat == Draw::DataFormat::B4G4R4A4_UNORM_PACK16 || texFormat == Draw::DataFormat::R4G4B4A4_UNORM_PACK16) { bitmapData.resize(entry.bmWidth * entry.bmHeight * sizeof(uint16_t)); uint16_t *bitmapData16 = (uint16_t *)&bitmapData[0]; - for (int x = 0; x < entry.bmWidth; x++) { - for (int y = 0; y < entry.bmHeight; y++) { + for (int y = 0; y < entry.bmHeight; y++) { + for (int x = 0; x < entry.bmWidth; x++) { uint32_t v = jimage[imageWidth * y + x]; - v = 0xFFF0 | ((v >> 12) & 0xF); // Just grab some bits from the green channel. + v = 0xFFF0 | ((v >> 28) & 0xF); // Grab the upper bits from the alpha channel, and put directly in the 16-bit alpha channel. bitmapData16[entry.bmWidth * y + x] = (uint16_t)v; } } } else if (texFormat == Draw::DataFormat::R8_UNORM) { bitmapData.resize(entry.bmWidth * entry.bmHeight); - for (int x = 0; x < entry.bmWidth; x++) { - for (int y = 0; y < entry.bmHeight; y++) { + for (int y = 0; y < entry.bmHeight; y++) { + for (int x = 0; x < entry.bmWidth; x++) { uint32_t v = jimage[imageWidth * y + x]; - v = (v >> 12) & 0xF; // Just grab some bits from the green channel. - bitmapData[entry.bmWidth * y + x] = (uint8_t)(v | (v << 4)); + bitmapData[entry.bmWidth * y + x] = (uint8_t)(v >> 24); + } + } + } else if (texFormat == Draw::DataFormat::R8G8B8A8_UNORM) { + bitmapData.resize(entry.bmWidth * entry.bmHeight * sizeof(uint32_t)); + uint32_t *bitmapData32 = (uint32_t *)&bitmapData[0]; + for (int y = 0; y < entry.bmHeight; y++) { + for (int x = 0; x < entry.bmWidth; x++) { + uint32_t v = jimage[imageWidth * y + x]; + // Swap R and B, for some reason. + v = (v & 0xFF00FF00) | ((v >> 16) & 0xFF) | ((v << 16) & 0xFF0000); + bitmapData32[entry.bmWidth * y + x] = v; } } } else { @@ -248,8 +260,11 @@ void TextDrawerAndroid::DrawString(DrawBuffer &target, const char *str, float x, entry = iter->second.get(); entry->lastUsedFrame = frameCount_; } else { - // Actually, I don't know why we don't always use R8_UNORM.. DataFormat texFormat = use4444Format_ ? Draw::DataFormat::R4G4B4A4_UNORM_PACK16 : Draw::DataFormat::R8_UNORM; + bool emoji = AnyEmojiInString(text.c_str(), text.size()); + if (emoji) { + texFormat = Draw::DataFormat::R8G8B8A8_UNORM; + } entry = new TextStringEntry(); @@ -265,7 +280,7 @@ void TextDrawerAndroid::DrawString(DrawBuffer &target, const char *str, float x, desc.depth = 1; desc.mipLevels = 1; desc.generateMips = false; - desc.swizzle = use4444Format_ ? Draw::TextureSwizzle::DEFAULT : Draw::TextureSwizzle::R8_AS_ALPHA, + desc.swizzle = texFormat == Draw::DataFormat::R8_UNORM ? Draw::TextureSwizzle::R8_AS_ALPHA : Draw::TextureSwizzle::DEFAULT, desc.tag = "TextDrawer"; entry->texture = draw_->CreateTexture(desc); cache_[key] = std::unique_ptr(entry); diff --git a/Common/Render/Text/draw_text_sdl.cpp b/Common/Render/Text/draw_text_sdl.cpp index 701ecc64c8..45279a0ebe 100644 --- a/Common/Render/Text/draw_text_sdl.cpp +++ b/Common/Render/Text/draw_text_sdl.cpp @@ -376,21 +376,24 @@ void TextDrawerSDL::DrawStringBitmap(std::vector &bitmapData, TextStrin if (align & ALIGN_HCENTER) TTF_SetFontWrappedAlign(font, TTF_WRAPPED_ALIGN_CENTER); - else if (align & ALIGN_LEFT) - TTF_SetFontWrappedAlign(font, TTF_WRAPPED_ALIGN_LEFT); else if (align & ALIGN_RIGHT) TTF_SetFontWrappedAlign(font, TTF_WRAPPED_ALIGN_RIGHT); + else + TTF_SetFontWrappedAlign(font, TTF_WRAPPED_ALIGN_LEFT); SDL_Color fgColor = { 0xFF, 0xFF, 0xFF, 0xFF }; SDL_Surface *text = TTF_RenderUTF8_Blended_Wrapped(font, processedStr.c_str(), fgColor, 0); SDL_LockSurface(text); entry.texture = nullptr; - entry.bmWidth = entry.width = text->pitch / sizeof(uint32_t); + // Each row of pixel needs to be aligned to 8 bytes (= 2 pixels), or else + // graphics corruption occurs. Made it 16-byte aligned just to be sure. + entry.bmWidth = entry.width = (text->w + 3) & ~3; entry.bmHeight = entry.height = text->h; entry.lastUsedFrame = frameCount_; uint32_t *imageData = (uint32_t *)text->pixels; + uint32_t pitch = text->pitch / sizeof(uint32_t); if (texFormat == Draw::DataFormat::B4G4R4A4_UNORM_PACK16 || texFormat == Draw::DataFormat::R4G4B4A4_UNORM_PACK16) { bitmapData.resize(entry.bmWidth * entry.bmHeight * sizeof(uint16_t)); @@ -399,7 +402,7 @@ void TextDrawerSDL::DrawStringBitmap(std::vector &bitmapData, TextStrin for (int x = 0; x < entry.bmWidth; x++) { for (int y = 0; y < entry.bmHeight; y++) { uint64_t index = entry.bmWidth * y + x; - bitmapData16[index] = 0xfff0 | (imageData[index] >> 28); + bitmapData16[index] = 0xfff0 | (imageData[pitch * y + x] >> 28); } } } else if (texFormat == Draw::DataFormat::R8_UNORM) { @@ -407,7 +410,7 @@ void TextDrawerSDL::DrawStringBitmap(std::vector &bitmapData, TextStrin for (int x = 0; x < entry.bmWidth; x++) { for (int y = 0; y < entry.bmHeight; y++) { uint64_t index = entry.bmWidth * y + x; - bitmapData[index] = imageData[index] >> 24; + bitmapData[index] = imageData[pitch * y + x] >> 24; } } } else { diff --git a/Common/Render/Text/draw_text_uwp.cpp b/Common/Render/Text/draw_text_uwp.cpp index fbbe454ef3..832a0caa03 100644 --- a/Common/Render/Text/draw_text_uwp.cpp +++ b/Common/Render/Text/draw_text_uwp.cpp @@ -137,7 +137,6 @@ TextDrawerUWP::TextDrawerUWP(Draw::DrawContext *draw) : TextDrawer(draw), ctx_(n ); m_d2dContext->CreateSolidColorBrush(D2D1::ColorF(D2D1::ColorF::White, 1.0f), &m_d2dWhiteBrush); - } TextDrawerUWP::~TextDrawerUWP() { @@ -381,7 +380,7 @@ void TextDrawerUWP::DrawStringBitmap(std::vector &bitmapData, TextStrin m_d2dContext->BeginDraw(); m_d2dContext->Clear(); - m_d2dContext->DrawTextLayout(D2D1::Point2F(0.0f, 0.0f), layout, m_d2dWhiteBrush); + m_d2dContext->DrawTextLayout(D2D1::Point2F(0.0f, 0.0f), layout, m_d2dWhiteBrush, texFormat == Draw::DataFormat::R8G8B8A8_UNORM ? D2D1_DRAW_TEXT_OPTIONS_ENABLE_COLOR_FONT : D2D1_DRAW_TEXT_OPTIONS_NONE); m_d2dContext->EndDraw(); layout->Release(); @@ -396,11 +395,15 @@ void TextDrawerUWP::DrawStringBitmap(std::vector &bitmapData, TextStrin // because we need white. Well, we could using swizzle, but not all our backends support that. if (texFormat == Draw::DataFormat::R8G8B8A8_UNORM || texFormat == Draw::DataFormat::B8G8R8A8_UNORM) { bitmapData.resize(entry.bmWidth * entry.bmHeight * sizeof(uint32_t)); + bool swap = texFormat == Draw::DataFormat::R8G8B8A8_UNORM; uint32_t *bitmapData32 = (uint32_t *)&bitmapData[0]; for (int y = 0; y < entry.bmHeight; y++) { + uint32_t *bmpLine = (uint32_t *)&map.bits[map.pitch * y]; for (int x = 0; x < entry.bmWidth; x++) { - uint8_t bAlpha = (uint8_t)(map.bits[map.pitch * y + x * 4] & 0xff); - bitmapData32[entry.bmWidth * y + x] = (bAlpha << 24) | 0x00ffffff; + uint32_t v = bmpLine[x]; + if (swap) + v = (v & 0xFF00FF00) | ((v >> 16) & 0xFF) | ((v << 16) & 0xFF0000); + bitmapData32[entry.bmWidth * y + x] = v; } } } else if (texFormat == Draw::DataFormat::B4G4R4A4_UNORM_PACK16 || texFormat == Draw::DataFormat::R4G4B4A4_UNORM_PACK16) { @@ -452,6 +455,7 @@ void TextDrawerUWP::DrawString(DrawBuffer &target, const char *str, float x, flo entry->lastUsedFrame = frameCount_; } else { DataFormat texFormat; + // For our purposes these are equivalent, so just choose the supported one. D3D can emulate them. if (draw_->GetDataFormatSupport(Draw::DataFormat::A4R4G4B4_UNORM_PACK16) & FMT_TEXTURE) texFormat = Draw::DataFormat::A4R4G4B4_UNORM_PACK16; @@ -460,6 +464,10 @@ void TextDrawerUWP::DrawString(DrawBuffer &target, const char *str, float x, flo else texFormat = Draw::DataFormat::R8G8B8A8_UNORM; + bool emoji = AnyEmojiInString(key.text.c_str(), key.text.size()); + if (emoji) + texFormat = Draw::DataFormat::R8G8B8A8_UNORM; + entry = new TextStringEntry(); // Convert the bitmap to a Thin3D compatible array of 16-bit pixels. Can't use a single channel format diff --git a/Common/RiscVEmitter.cpp b/Common/RiscVEmitter.cpp index 5c986bdf81..6f11dbe2cc 100644 --- a/Common/RiscVEmitter.cpp +++ b/Common/RiscVEmitter.cpp @@ -1182,11 +1182,19 @@ bool RiscVEmitter::CJInRange(const void *src, const void *dst) const { void RiscVEmitter::QuickJAL(RiscVReg scratchreg, RiscVReg rd, const u8 *dst) { if (!JInRange(GetCodePointer(), dst)) { + int32_t lower = 0; static_assert(sizeof(intptr_t) <= sizeof(int64_t)); + // If it's near PC, we're better off shooting for AUIPC. Should take 8 bytes. int64_t pcdelta = (int64_t)dst - (int64_t)GetCodePointer(); - int32_t lower = (int32_t)SignReduce64(pcdelta, 12); - uintptr_t upper = ((pcdelta - lower) >> 12) << 12; - LI(scratchreg, (uintptr_t)GetCodePointer() + upper); + if (pcdelta < 0x100000000LL && pcdelta >= -0x100000000LL) { + lower = (int32_t)SignReduce64(pcdelta, 12); + uintptr_t upper = ((pcdelta - lower) >> 12) << 12; + LI(scratchreg, (uintptr_t)GetCodePointer() + upper); + } else { + lower = (int32_t)SignReduce64((int64_t)dst, 12); + // Abuse rd as a temporary if we need to. + LI(scratchreg, dst - lower, rd == scratchreg ? R_ZERO : rd); + } JALR(rd, scratchreg, lower); } else { JAL(rd, dst); @@ -1255,8 +1263,12 @@ void RiscVEmitter::SetRegToImmediate(RiscVReg rd, uint64_t value, RiscVReg temp) // If this is just a 32-bit unsigned value, use a wall to mask. if ((svalue >> 32) == 0) { LI(rd, (int32_t)(svalue & 0xFFFFFFFF)); - SLLI(rd, rd, BitsSupported() - 32); - SRLI(rd, rd, BitsSupported() - 32); + if (SupportsBitmanip('a')) { + ZEXT_W(rd, rd); + } else { + SLLI(rd, rd, BitsSupported() - 32); + SRLI(rd, rd, BitsSupported() - 32); + } return; } @@ -1274,7 +1286,7 @@ void RiscVEmitter::SetRegToImmediate(RiscVReg rd, uint64_t value, RiscVReg temp) return; } - // Okay, let's just start with the upper 32 bits and add the rest via ORI. + // Okay, let's just start with the upper 32 bits and add the rest via ADDI. int64_t upper = svalue >> 32; LI(rd, upper); @@ -1290,7 +1302,7 @@ void RiscVEmitter::SetRegToImmediate(RiscVReg rd, uint64_t value, RiscVReg temp) int32_t chunk = (remaining >> sourceShift) & 0x07FF; SLLI(rd, rd, targetShift - shifted); - ORI(rd, rd, chunk); + ADDI(rd, rd, chunk); // Okay, increase shift and clear the bits we've deposited. shifted = targetShift; diff --git a/Common/RiscVEmitter.h b/Common/RiscVEmitter.h index fedb0b0c7f..9fe5d87164 100644 --- a/Common/RiscVEmitter.h +++ b/Common/RiscVEmitter.h @@ -217,13 +217,13 @@ public: void QuickJ(RiscVReg scratchreg, const u8 *dst) { QuickJAL(scratchreg, R_ZERO, dst); } - void QuickCallFunction(const u8 *func) { - QuickJAL(R_RA, R_RA, func); + void QuickCallFunction(const u8 *func, RiscVReg scratchreg = R_RA) { + QuickJAL(scratchreg, R_RA, func); } template - void QuickCallFunction(T *func) { + void QuickCallFunction(T *func, RiscVReg scratchreg = R_RA) { static_assert(std::is_function::value, "QuickCallFunction without function"); - QuickCallFunction((const u8 *)func); + QuickCallFunction((const u8 *)func, scratchreg); } void LUI(RiscVReg rd, s32 simm32); diff --git a/Common/System/NativeApp.h b/Common/System/NativeApp.h index 265ad5b0a7..490d35c83d 100644 --- a/Common/System/NativeApp.h +++ b/Common/System/NativeApp.h @@ -49,21 +49,16 @@ void NativeSetRestarting(); // Retrieve current restarting flag. bool NativeIsRestarting(); -// Called ~sixty times a second, delivers the current input state. -// Main thread. -void NativeUpdate(); - -// Delivers touch events "instantly", without waiting for the next frame so that NativeUpdate can deliver. -// Useful for triggering audio events, saving a few ms. -// If you don't care about touch latency, just do a no-op implementation of this. -// time is not yet implemented. finger can be from 0 to 7, inclusive. +// Delivers touch/key/axis events "instantly", without waiting for the next frame so that NativeFrame can deliver. +// Some systems like UI will buffer these events internally but at least in gameplay we can get the minimum possible +// input latency - assuming your main loop is architected properly (NativeFrame called from a different thread than input event handling). void NativeTouch(const TouchInput &touch); bool NativeKey(const KeyInput &key); void NativeAxis(const AxisInput &axis); -// Called when it's time to render. If the device can keep up, this -// will also be called sixty times per second. Main thread. -void NativeRender(GraphicsContext *graphicsContext); +// Called when it's process a frame, including rendering. If the device can keep up, this +// will be called sixty times per second. Main thread. +void NativeFrame(GraphicsContext *graphicsContext); // This should render num_samples 44khz stereo samples. // Try not to make too many assumptions on the granularity diff --git a/Common/System/OSD.cpp b/Common/System/OSD.cpp index e8cf697b27..73fb2bf3c7 100644 --- a/Common/System/OSD.cpp +++ b/Common/System/OSD.cpp @@ -21,22 +21,6 @@ void OnScreenDisplay::Update() { iter++; } } - - for (auto iter = sideEntries_.begin(); iter != sideEntries_.end(); ) { - if (now >= iter->endTime) { - iter = sideEntries_.erase(iter); - } else { - iter++; - } - } - - for (auto iter = bars_.begin(); iter != bars_.end(); ) { - if (now >= iter->endTime) { - iter = bars_.erase(iter); - } else { - iter++; - } - } } std::vector OnScreenDisplay::Entries() { @@ -44,16 +28,6 @@ std::vector OnScreenDisplay::Entries() { return entries_; // makes a copy. } -std::vector OnScreenDisplay::SideEntries() { - std::lock_guard guard(mutex_); - return sideEntries_; // makes a copy. -} - -std::vector OnScreenDisplay::ProgressBars() { - std::lock_guard guard(mutex_); - return bars_; // makes a copy. -} - void OnScreenDisplay::NudgeSidebar() { sideBarShowTime_ = time_now_d(); } @@ -89,7 +63,7 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, const std::str std::lock_guard guard(mutex_); if (id) { for (auto iter = entries_.begin(); iter != entries_.end(); ++iter) { - if (iter->id && !strcmp(iter->id, id)) { + if (iter->id == id) { Entry msg = *iter; msg.endTime = now + duration_s; msg.text = text; @@ -111,7 +85,9 @@ void OnScreenDisplay::Show(OSDType type, const std::string &text, const std::str msg.startTime = now; msg.endTime = now + duration_s; msg.type = type; - msg.id = id; + if (id) { + msg.id = id; + } entries_.insert(entries_.begin(), msg); } @@ -132,7 +108,7 @@ void OnScreenDisplay::ShowAchievementProgress(int achievementID, bool show) { double now = time_now_d(); // There can only be one of these at a time. - for (auto &entry : sideEntries_) { + for (auto &entry : entries_) { if (entry.type == OSDType::ACHIEVEMENT_PROGRESS) { if (!show) { // Hide and eventually delete it. @@ -142,7 +118,7 @@ void OnScreenDisplay::ShowAchievementProgress(int achievementID, bool show) { } // Else update it. entry.numericID = achievementID; - entry.endTime = now + forever_s; + entry.endTime = now + 2.0f; // forever_s; return; } } @@ -157,14 +133,14 @@ void OnScreenDisplay::ShowAchievementProgress(int achievementID, bool show) { entry.numericID = achievementID; entry.type = OSDType::ACHIEVEMENT_PROGRESS; entry.startTime = now; - entry.endTime = now + forever_s; - sideEntries_.insert(sideEntries_.begin(), entry); + entry.endTime = now + 2.0f; // forever_s; + entries_.insert(entries_.begin(), entry); } void OnScreenDisplay::ShowChallengeIndicator(int achievementID, bool show) { double now = time_now_d(); - for (auto &entry : sideEntries_) { + for (auto &entry : entries_) { if (entry.numericID == achievementID && entry.type == OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR && !show) { // Hide and eventually delete it. entry.endTime = now + (double)FadeoutTime(); @@ -184,17 +160,19 @@ void OnScreenDisplay::ShowChallengeIndicator(int achievementID, bool show) { entry.type = OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR; entry.startTime = now; entry.endTime = now + forever_s; - sideEntries_.insert(sideEntries_.begin(), entry); + entries_.insert(entries_.begin(), entry); } void OnScreenDisplay::ShowLeaderboardTracker(int leaderboardTrackerID, const char *trackerText, bool show) { // show=true is used both for create and update. double now = time_now_d(); - for (auto &entry : sideEntries_) { + for (auto &entry : entries_) { if (entry.numericID == leaderboardTrackerID && entry.type == OSDType::LEADERBOARD_TRACKER) { if (show) { // Just an update. entry.text = trackerText ? trackerText : ""; + // Bump the end-time, in case it was fading out. + entry.endTime = now + forever_s; } else { // Keep the current text, hide and eventually delete it. entry.endTime = now + (double)FadeoutTime(); @@ -218,7 +196,16 @@ void OnScreenDisplay::ShowLeaderboardTracker(int leaderboardTrackerID, const cha if (trackerText) { entry.text = trackerText; } - sideEntries_.insert(sideEntries_.begin(), entry); + entries_.insert(entries_.begin(), entry); +} + +void OnScreenDisplay::ShowLeaderboardStartEnd(const std::string &title, const std::string &description, bool started) { + g_OSD.Show(OSDType::LEADERBOARD_STARTED_FAILED, title, description, 3.0f); + +} + +void OnScreenDisplay::ShowLeaderboardSubmitted(const std::string &title, const std::string &value) { + g_OSD.Show(OSDType::MESSAGE_SUCCESS, title, value, 3.0f); } void OnScreenDisplay::ShowOnOff(const std::string &message, bool on, float duration_s) { @@ -235,32 +222,33 @@ void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, floa bool found = false; std::lock_guard guard(mutex_); - for (auto &bar : bars_) { - if (bar.id == id) { + for (auto &bar : entries_) { + if (bar.type == OSDType::PROGRESS_BAR && bar.id == id) { bar.minValue = minValue; bar.maxValue = maxValue; bar.progress = progress; - bar.message = message; + bar.text = message; bar.endTime = now + 60.0; // Nudge the progress bar to keep it shown. return; } } - ProgressBar bar; + Entry bar; bar.id = id; - bar.message = std::move(message); + bar.type = OSDType::PROGRESS_BAR; + bar.text = std::move(message); bar.minValue = minValue; bar.maxValue = maxValue; bar.progress = progress; bar.startTime = now + delay; bar.endTime = now + 60.0; // Show the progress bar for 60 seconds, then fade it out. - bars_.push_back(bar); + entries_.push_back(bar); } void OnScreenDisplay::RemoveProgressBar(std::string id, bool success, float delay_s) { std::lock_guard guard(mutex_); - for (auto iter = bars_.begin(); iter != bars_.end(); iter++) { - if (iter->id == id) { + for (auto iter = entries_.begin(); iter != entries_.end(); iter++) { + if (iter->type == OSDType::PROGRESS_BAR && iter->id == id) { if (success) { // Quickly shoot up to max, if we weren't there. if (iter->maxValue != 0.0f) { @@ -287,18 +275,8 @@ void OnScreenDisplay::ClearAchievementStuff() { case OSDType::ACHIEVEMENT_UNLOCKED: case OSDType::ACHIEVEMENT_PROGRESS: case OSDType::LEADERBOARD_TRACKER: - iter.endTime = now; - break; - default: - break; - } - } - for (auto &iter : sideEntries_) { - switch (iter.type) { - case OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR: - case OSDType::ACHIEVEMENT_UNLOCKED: - case OSDType::ACHIEVEMENT_PROGRESS: - case OSDType::LEADERBOARD_TRACKER: + case OSDType::LEADERBOARD_STARTED_FAILED: + case OSDType::LEADERBOARD_SUBMITTED: iter.endTime = now; break; default: diff --git a/Common/System/OSD.h b/Common/System/OSD.h index cecf0cae79..dd288c01a2 100644 --- a/Common/System/OSD.h +++ b/Common/System/OSD.h @@ -21,6 +21,12 @@ enum class OSDType { ACHIEVEMENT_CHALLENGE_INDICATOR, // Achievement icon ONLY, no auto-hide LEADERBOARD_TRACKER, + LEADERBOARD_STARTED_FAILED, + LEADERBOARD_SUBMITTED, + + PROGRESS_BAR, + + VALUE_COUNT, }; // Data holder for on-screen messages. @@ -47,6 +53,8 @@ public: void ShowAchievementProgress(int achievementID, bool show); // call with show=false to hide. There can only be one of these. When hiding it's ok to not pass a valid achievementID. void ShowChallengeIndicator(int achievementID, bool show); // call with show=false to hide. void ShowLeaderboardTracker(int leaderboardTrackerID, const char *trackerText, bool show); // show=true is used both for create and update. + void ShowLeaderboardStartEnd(const std::string &title, const std::string &description, bool started); // started = true for started, false for ended. + void ShowLeaderboardSubmitted(const std::string &title, const std::string &value); // Progress bar controls // Set is both create and update. If you set maxValue <= minValue, you'll create an "indeterminate" progress @@ -67,31 +75,23 @@ public: std::string text2; std::string iconName; int numericID; - const char *id; + std::string id; double startTime; double endTime; - }; - struct ProgressBar { - std::string id; - std::string message; + // Progress-bar-only data: float minValue; float maxValue; float progress; - double startTime; - double endTime; }; std::vector Entries(); - std::vector SideEntries(); - std::vector ProgressBars(); + static float FadeinTime() { return 0.1f; } static float FadeoutTime() { return 0.25f; } private: std::vector entries_; - std::vector sideEntries_; - std::vector bars_; std::mutex mutex_; double sideBarShowTime_ = 0.0; diff --git a/Common/System/Request.h b/Common/System/Request.h index 420de22942..e6b3a10b37 100644 --- a/Common/System/Request.h +++ b/Common/System/Request.h @@ -29,7 +29,7 @@ public: void PostSystemSuccess(int requestId, const char *responseString, int responseValue = 0); void PostSystemFailure(int requestId); - // This must be called every frame from the beginning of NativeUpdate(). + // This must be called every frame from the beginning of NativeFrame(). // This will call the callback of any finished requests. void ProcessRequests(); diff --git a/Common/System/System.h b/Common/System/System.h index 17eeda194d..9652c0d32a 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -200,6 +200,8 @@ enum class SystemNotification { POLL_CONTROLLERS, TOGGLE_DEBUG_CONSOLE, // TODO: Kinda weird, just ported forward. TEST_JAVA_EXCEPTION, + KEEP_SCREEN_AWAKE, + ACTIVITY, }; std::string System_GetProperty(SystemProperty prop); diff --git a/Common/TimeUtil.cpp b/Common/TimeUtil.cpp index ad07fbd18c..d7ed5631f3 100644 --- a/Common/TimeUtil.cpp +++ b/Common/TimeUtil.cpp @@ -1,14 +1,18 @@ +#include "ppsspp_config.h" + #include #include -#include "ppsspp_config.h" - #include "Common/TimeUtil.h" #ifdef HAVE_LIBNX #include #endif // HAVE_LIBNX +#ifdef __EMSCRIPTEN__ +#include +#endif // __EMSCRIPTEN__ + #ifdef _WIN32 #include "CommonWindows.h" #include @@ -17,11 +21,20 @@ #include #include #endif + +// for _mm_pause +#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) +#include +#endif + #include // TODO: https://github.com/floooh/sokol/blob/9a6237fcdf213e6da48e4f9201f144bcb2dcb46f/sokol_time.h#L229-L248 -#ifdef _WIN32 +static const double micros = 1000000.0; +static const double nanos = 1000000000.0; + +#if PPSSPP_PLATFORM(WINDOWS) static LARGE_INTEGER frequency; static double frequencyMult; @@ -39,6 +52,62 @@ double time_now_d() { return elapsed * frequencyMult; } +// Fake, but usable in a pinch. Don't, though. +uint64_t time_now_raw() { + return (uint64_t)(time_now_d() * nanos); +} + +double from_time_raw(uint64_t raw_time) { + if (raw_time == 0) { + return 0.0; // invalid time + } + return (double)raw_time * (1.0 / nanos); +} + +double from_time_raw_relative(uint64_t raw_time) { + return from_time_raw(raw_time); +} + +void yield() { + YieldProcessor(); +} + +#elif PPSSPP_PLATFORM(ANDROID) || PPSSPP_PLATFORM(LINUX) || PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS) + +// The only intended use is to match the timings in VK_GOOGLE_display_timing +uint64_t time_now_raw() { + struct timespec tp; + clock_gettime(CLOCK_MONOTONIC, &tp); + return tp.tv_sec * 1000000000ULL + tp.tv_nsec; +} + +static uint64_t g_startTime; + +double from_time_raw(uint64_t raw_time) { + return (double)(raw_time - g_startTime) * (1.0 / nanos); +} + +double time_now_d() { + uint64_t raw_time = time_now_raw(); + if (g_startTime == 0) { + g_startTime = raw_time; + } + return from_time_raw(raw_time); +} + +double from_time_raw_relative(uint64_t raw_time) { + return (double)raw_time * (1.0 / nanos); +} + +void yield() { +#if PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) + _mm_pause(); +#elif PPSSPP_ARCH(ARM64) + // Took this out for now. See issue #17877 + // __builtin_arm_isb(15); +#endif +} + #else double time_now_d() { @@ -48,9 +117,24 @@ double time_now_d() { if (start == 0) { start = tv.tv_sec; } - return (double)(tv.tv_sec - start) + (double)tv.tv_usec * (1.0 / 1000000.0); + return (double)(tv.tv_sec - start) + (double)tv.tv_usec * (1.0 / micros); } +// Fake, but usable in a pinch. Don't, though. +uint64_t time_now_raw() { + return (uint64_t)(time_now_d() * nanos); +} + +double from_time_raw(uint64_t raw_time) { + return (double)raw_time * (1.0 / nanos); +} + +double from_time_raw_relative(uint64_t raw_time) { + return from_time_raw(raw_time); +} + +void yield() {} + #endif void sleep_ms(int ms) { @@ -58,6 +142,8 @@ void sleep_ms(int ms) { Sleep(ms); #elif defined(HAVE_LIBNX) svcSleepThread(ms * 1000000); +#elif defined(__EMSCRIPTEN__) + emscripten_sleep(ms); #else usleep(ms * 1000); #endif diff --git a/Common/TimeUtil.h b/Common/TimeUtil.h index 0faf6dac23..a0701ae097 100644 --- a/Common/TimeUtil.h +++ b/Common/TimeUtil.h @@ -1,11 +1,24 @@ #pragma once +#include + // Seconds. double time_now_d(); +// Raw time in nanoseconds. +// The only intended use is to match the timings from VK_GOOGLE_display_timing. +uint64_t time_now_raw(); + +// This is only interesting for Linux, in relation to VK_GOOGLE_display_timing. +double from_time_raw(uint64_t raw_time); +double from_time_raw_relative(uint64_t raw_time); + // Sleep. Does not necessarily have millisecond granularity, especially on Windows. void sleep_ms(int ms); +// Yield. Signals that this thread is busy-waiting but wants to allow other hyperthreads to run. +void yield(); + void GetTimeFormatted(char formattedTime[13]); // Rust-style Instant for clear and easy timing. diff --git a/Common/UI/Screen.cpp b/Common/UI/Screen.cpp index c67b3cfe9e..036473794b 100644 --- a/Common/UI/Screen.cpp +++ b/Common/UI/Screen.cpp @@ -156,30 +156,35 @@ void ScreenManager::resized() { void ScreenManager::render() { if (!stack_.empty()) { switch (stack_.back().flags) { - case LAYER_SIDEMENU: case LAYER_TRANSPARENT: if (stack_.size() == 1) { ERROR_LOG(SYSTEM, "Can't have sidemenu over nothing"); break; } else { - auto iter = stack_.end(); + auto last = stack_.end(); + auto iter = last; iter--; - iter--; - Layer backback = *iter; - - _assert_(backback.screen); + while (iter->flags == LAYER_TRANSPARENT) { + iter--; + } + auto first = iter; + _assert_(iter->screen); // TODO: Make really sure that this "mismatched" pre/post only happens // when screens are "compatible" (both are UIScreens, for example). - backback.screen->preRender(); - backback.screen->render(); + first->screen->preRender(); + while (iter < last) { + iter->screen->render(); + iter++; + } stack_.back().screen->render(); - if (postRenderCb_) + if (postRenderCb_) { postRenderCb_(getUIContext(), postRenderUserdata_); + } if (overlayScreen_) { overlayScreen_->render(); } - backback.screen->postRender(); + first->screen->postRender(); break; } default: diff --git a/Common/UI/Screen.h b/Common/UI/Screen.h index 4a45d54186..4f559f9ed7 100644 --- a/Common/UI/Screen.h +++ b/Common/UI/Screen.h @@ -90,7 +90,6 @@ public: }; enum { - LAYER_SIDEMENU = 1, LAYER_TRANSPARENT = 2, }; diff --git a/Common/UI/UIScreen.cpp b/Common/UI/UIScreen.cpp index 62ad927e55..746a1228f3 100644 --- a/Common/UI/UIScreen.cpp +++ b/Common/UI/UIScreen.cpp @@ -191,10 +191,7 @@ void UIScreen::deviceRestored() { void UIScreen::preRender() { using namespace Draw; Draw::DrawContext *draw = screenManager()->getDrawContext(); - if (!draw) { - return; - } - draw->BeginFrame(); + _dbg_assert_(draw != nullptr); // Bind and clear the back buffer draw->BindFramebufferAsRenderTarget(nullptr, { RPAction::CLEAR, RPAction::CLEAR, RPAction::CLEAR, 0xFF000000 }, "UI"); screenManager()->getUIContext()->BeginFrame(); @@ -211,12 +208,7 @@ void UIScreen::preRender() { } void UIScreen::postRender() { - Draw::DrawContext *draw = screenManager()->getDrawContext(); - if (!draw) { - return; - } screenManager()->getUIContext()->Flush(); - draw->EndFrame(); } void UIScreen::render() { diff --git a/Common/UI/View.cpp b/Common/UI/View.cpp index 587db038ab..3b447574c7 100644 --- a/Common/UI/View.cpp +++ b/Common/UI/View.cpp @@ -25,18 +25,18 @@ static constexpr Size ITEM_HEIGHT = 64.f; static constexpr float MIN_TEXT_SCALE = 0.8f; static constexpr float MAX_ITEM_SIZE = 65535.0f; -void MeasureBySpec(Size sz, float contentWidth, MeasureSpec spec, float *measured) { +void MeasureBySpec(Size sz, float contentDim, MeasureSpec spec, float *measured) { if (sz == WRAP_CONTENT) { if (spec.type == UNSPECIFIED) - *measured = contentWidth; + *measured = contentDim; else if (spec.type == AT_MOST) - *measured = contentWidth < spec.size ? contentWidth : spec.size; + *measured = contentDim < spec.size ? contentDim : spec.size; else if (spec.type == EXACTLY) *measured = spec.size; } else if (sz == FILL_PARENT) { // UNSPECIFIED may have a minimum size of the parent. Let's use it to fill. if (spec.type == UNSPECIFIED) - *measured = std::max(spec.size, contentWidth); + *measured = std::max(spec.size, contentDim); else *measured = spec.size; } else if (spec.type == EXACTLY || (spec.type == AT_MOST && *measured > spec.size)) { @@ -46,7 +46,7 @@ void MeasureBySpec(Size sz, float contentWidth, MeasureSpec spec, float *measure } } -void ApplyBoundBySpec(float &bound, MeasureSpec spec) { +static void ApplyBoundBySpec(float &bound, MeasureSpec spec) { switch (spec.type) { case AT_MOST: bound = bound < spec.size ? bound : spec.size; @@ -122,9 +122,8 @@ void View::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) { MeasureBySpec(layoutParams_->height, contentH, vert, &measuredHeight_); } -// Default values - void View::GetContentDimensions(const UIContext &dc, float &w, float &h) const { + // Default values w = 10.0f; h = 10.0f; } diff --git a/Common/UI/ViewGroup.cpp b/Common/UI/ViewGroup.cpp index e418d63008..ee4867598d 100644 --- a/Common/UI/ViewGroup.cpp +++ b/Common/UI/ViewGroup.cpp @@ -824,55 +824,57 @@ void AnchorLayout::MeasureViews(const UIContext &dc, MeasureSpec horiz, MeasureS } } +static void ApplyAnchorLayoutParams(float measuredWidth, float measuredHeight, const Bounds &container, const AnchorLayoutParams *params, Bounds *vBounds) { + vBounds->w = measuredWidth; + vBounds->h = measuredHeight; + + // Clamp width/height to our own + if (vBounds->w > container.w) vBounds->w = container.w; + if (vBounds->h > container.h) vBounds->h = container.h; + + float left = 0, top = 0, right = 0, bottom = 0; + bool center = false; + if (params) { + left = params->left; + top = params->top; + right = params->right; + bottom = params->bottom; + center = params->center; + } + + if (left > NONE) { + vBounds->x = container.x + left; + if (center) + vBounds->x -= vBounds->w * 0.5f; + } else if (right > NONE) { + vBounds->x = container.x2() - right - vBounds->w; + if (center) { + vBounds->x += vBounds->w * 0.5f; + } + } else { + // Both left and right are NONE. Center. + vBounds->x = (container.w - vBounds->w) / 2.0f + container.x; + } + + if (top > NONE) { + vBounds->y = container.y + top; + if (center) + vBounds->y -= vBounds->h * 0.5f; + } else if (bottom > NONE) { + vBounds->y = container.y2() - bottom - vBounds->h; + if (center) + vBounds->y += vBounds->h * 0.5f; + } else { + // Both top and bottom are NONE. Center. + vBounds->y = (container.h - vBounds->h) / 2.0f + container.y; + } +} + void AnchorLayout::Layout() { for (size_t i = 0; i < views_.size(); i++) { const AnchorLayoutParams *params = views_[i]->GetLayoutParams()->As(); - Bounds vBounds; - vBounds.w = views_[i]->GetMeasuredWidth(); - vBounds.h = views_[i]->GetMeasuredHeight(); - - // Clamp width/height to our own - if (vBounds.w > bounds_.w) vBounds.w = bounds_.w; - if (vBounds.h > bounds_.h) vBounds.h = bounds_.h; - - float left = 0, top = 0, right = 0, bottom = 0; - bool center = false; - if (params) { - left = params->left; - top = params->top; - right = params->right; - bottom = params->bottom; - center = params->center; - } - - if (left > NONE) { - vBounds.x = bounds_.x + left; - if (center) - vBounds.x -= vBounds.w * 0.5f; - } else if (right > NONE) { - vBounds.x = bounds_.x2() - right - vBounds.w; - if (center) { - vBounds.x += vBounds.w * 0.5f; - } - } else { - // Both left and right are NONE. Center. - vBounds.x = (bounds_.w - vBounds.w) / 2.0f + bounds_.x; - } - - if (top > NONE) { - vBounds.y = bounds_.y + top; - if (center) - vBounds.y -= vBounds.h * 0.5f; - } else if (bottom > NONE) { - vBounds.y = bounds_.y2() - bottom - vBounds.h; - if (center) - vBounds.y += vBounds.h * 0.5f; - } else { - // Both top and bottom are NONE. Center. - vBounds.y = (bounds_.h - vBounds.h) / 2.0f + bounds_.y; - } - + ApplyAnchorLayoutParams(views_[i]->GetMeasuredWidth(), views_[i]->GetMeasuredHeight(), bounds_, params, &vBounds); views_[i]->SetBounds(vBounds); views_[i]->Layout(); } diff --git a/Core/Config.cpp b/Core/Config.cpp index da1c279033..c21b82a315 100644 --- a/Core/Config.cpp +++ b/Core/Config.cpp @@ -47,6 +47,7 @@ #include "Common/Thread/ThreadUtil.h" #include "Common/GPU/Vulkan/VulkanLoader.h" #include "Common/VR/PPSSPPVR.h" +#include "Common/System/OSD.h" #include "Core/Config.h" #include "Core/ConfigSettings.h" #include "Core/ConfigValues.h" @@ -178,6 +179,7 @@ static const ConfigSetting generalSettings[] = { ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshRate, 77, CfgFlag::PER_GAME), ConfigSetting("CwCheatScrollPosition", &g_Config.fCwCheatScrollPosition, 0.0f, CfgFlag::PER_GAME), ConfigSetting("GameListScrollPosition", &g_Config.fGameListScrollPosition, 0.0f, CfgFlag::DEFAULT), + ConfigSetting("DebugOverlay", &g_Config.iDebugOverlay, 0, CfgFlag::DONT_SAVE), ConfigSetting("ScreenshotsAsPNG", &g_Config.bScreenshotsAsPNG, false, CfgFlag::PER_GAME), ConfigSetting("UseFFV1", &g_Config.bUseFFV1, false, CfgFlag::DEFAULT), @@ -282,6 +284,13 @@ static const ConfigSetting achievementSettings[] = { ConfigSetting("AchievementsSoundEffects", &g_Config.bAchievementsSoundEffects, true, CfgFlag::DEFAULT), ConfigSetting("AchievementsUnlockAudioFile", &g_Config.sAchievementsUnlockAudioFile, "", CfgFlag::DEFAULT), ConfigSetting("AchievementsLeaderboardSubmitAudioFile", &g_Config.sAchievementsLeaderboardSubmitAudioFile, "", CfgFlag::DEFAULT), + + ConfigSetting("AchievementsLeaderboardTrackerPos", &g_Config.iAchievementsLeaderboardTrackerPos, (int)ScreenEdgePosition::TOP_LEFT, CfgFlag::DEFAULT), + ConfigSetting("AchievementsLeaderboardStartedOrFailedPos", &g_Config.iAchievementsLeaderboardStartedOrFailedPos, (int)ScreenEdgePosition::TOP_LEFT, CfgFlag::DEFAULT), + ConfigSetting("AchievementsLeaderboardSubmittedPos", &g_Config.iAchievementsLeaderboardSubmittedPos, (int)ScreenEdgePosition::TOP_LEFT, CfgFlag::DEFAULT), + ConfigSetting("AchievementsProgressPos", &g_Config.iAchievementsProgressPos, (int)ScreenEdgePosition::TOP_LEFT, CfgFlag::DEFAULT), + ConfigSetting("AchievementsChallengePos", &g_Config.iAchievementsChallengePos, (int)ScreenEdgePosition::TOP_LEFT, CfgFlag::DEFAULT), + ConfigSetting("AchievementsUnlockedPos", &g_Config.iAchievementsUnlockedPos, (int)ScreenEdgePosition::TOP_CENTER, CfgFlag::DEFAULT), }; static const ConfigSetting cpuSettings[] = { @@ -789,8 +798,8 @@ static const ConfigSetting networkSettings[] = { ConfigSetting("UPnPUseOriginalPort", &g_Config.bUPnPUseOriginalPort, false, CfgFlag::PER_GAME), ConfigSetting("EnableNetworkChat", &g_Config.bEnableNetworkChat, false, CfgFlag::PER_GAME), - ConfigSetting("ChatButtonPosition",&g_Config.iChatButtonPosition,BOTTOM_LEFT, CfgFlag::PER_GAME), - ConfigSetting("ChatScreenPosition",&g_Config.iChatScreenPosition,BOTTOM_LEFT, CfgFlag::PER_GAME), + ConfigSetting("ChatButtonPosition", &g_Config.iChatButtonPosition, (int)ScreenEdgePosition::BOTTOM_LEFT, CfgFlag::PER_GAME), + ConfigSetting("ChatScreenPosition", &g_Config.iChatScreenPosition, (int)ScreenEdgePosition::BOTTOM_LEFT, CfgFlag::PER_GAME), ConfigSetting("EnableQuickChat", &g_Config.bEnableQuickChat, true, CfgFlag::PER_GAME), ConfigSetting("QuickChat1", &g_Config.sQuickChat0, "Quick Chat 1", CfgFlag::PER_GAME), ConfigSetting("QuickChat2", &g_Config.sQuickChat1, "Quick Chat 2", CfgFlag::PER_GAME), @@ -840,13 +849,10 @@ static const ConfigSetting debuggerSettings[] = { ConfigSetting("DisplayStatusBar", &g_Config.bDisplayStatusBar, true, CfgFlag::DEFAULT), ConfigSetting("ShowBottomTabTitles",&g_Config.bShowBottomTabTitles, true, CfgFlag::DEFAULT), ConfigSetting("ShowDeveloperMenu", &g_Config.bShowDeveloperMenu, false, CfgFlag::DEFAULT), - ConfigSetting("ShowAllocatorDebug", &g_Config.bShowAllocatorDebug, false, CfgFlag::DONT_SAVE), - ConfigSetting("ShowGpuProfile", &g_Config.bShowGpuProfile, false, CfgFlag::DONT_SAVE), ConfigSetting("SkipDeadbeefFilling", &g_Config.bSkipDeadbeefFilling, false, CfgFlag::DEFAULT), ConfigSetting("FuncHashMap", &g_Config.bFuncHashMap, false, CfgFlag::DEFAULT), ConfigSetting("SkipFuncHashMap", &g_Config.sSkipFuncHashMap, "", CfgFlag::DEFAULT), ConfigSetting("MemInfoDetailed", &g_Config.bDebugMemInfoDetailed, false, CfgFlag::DEFAULT), - ConfigSetting("DrawFrameGraph", &g_Config.bDrawFrameGraph, false, CfgFlag::DEFAULT), }; static const ConfigSetting jitSettings[] = { @@ -1052,8 +1058,6 @@ void Config::Load(const char *iniFileName, const char *controllerIniFilename) { INFO_LOG(LOADER, "Loading config: %s", iniFilename_.c_str()); bSaveSettings = true; - bShowFrameProfiler = true; - IniFile iniFile; if (!iniFile.Load(iniFilename_)) { ERROR_LOG(LOADER, "Failed to read '%s'. Setting config to default.", iniFilename_.c_str()); diff --git a/Core/Config.h b/Core/Config.h index aabc73fd02..eeb6d51f2f 100644 --- a/Core/Config.h +++ b/Core/Config.h @@ -29,17 +29,6 @@ extern const char *PPSSPP_GIT_VERSION; -enum ChatPositions { - BOTTOM_LEFT = 0, - BOTTOM_CENTER = 1, - BOTOM_RIGHT = 2, - TOP_LEFT = 3, - TOP_CENTER = 4, - TOP_RIGHT = 5, - CENTER_LEFT = 6, - CENTER_RIGHT = 7, -}; - namespace http { class Request; class RequestManager; @@ -264,10 +253,6 @@ public: // These aren't saved, just for instant debugging. bool bLogFrameDrops; - bool bShowDebugStats; - bool bShowAudioDebug; - bool bShowControlDebug; - bool bShowGpuProfile; // Analog stick tilting // This is the held base angle (from the horizon), that we compute the tilt relative from. @@ -476,16 +461,18 @@ public: bool bDisplayStatusBar; bool bShowBottomTabTitles; bool bShowDeveloperMenu; - bool bShowAllocatorDebug; + // Double edged sword: much easier debugging, but not accurate. bool bSkipDeadbeefFilling; + bool bFuncHashMap; std::string sSkipFuncHashMap; bool bDebugMemInfoDetailed; - bool bDrawFrameGraph; // Volatile development settings - bool bShowFrameProfiler; + // Overlays + int iDebugOverlay; + bool bGpuLogProfiler; // Controls the Vulkan logging profiler (profiles textures uploads etc). // Retro Achievement settings @@ -497,6 +484,14 @@ public: bool bAchievementsSoundEffects; bool bAchievementsLogBadMemReads; + // Positioning of the various notifications + int iAchievementsLeaderboardTrackerPos; + int iAchievementsLeaderboardStartedOrFailedPos; + int iAchievementsLeaderboardSubmittedPos; + int iAchievementsProgressPos; + int iAchievementsChallengePos; + int iAchievementsUnlockedPos; + // Customizations std::string sAchievementsUnlockAudioFile; std::string sAchievementsLeaderboardSubmitAudioFile; diff --git a/Core/ConfigValues.h b/Core/ConfigValues.h index 300b183e5f..9765846e64 100644 --- a/Core/ConfigValues.h +++ b/Core/ConfigValues.h @@ -163,3 +163,29 @@ enum TiltTypes { TILT_ACTION_BUTTON, TILT_TRIGGER_BUTTONS, }; + +enum class ScreenEdgePosition { + BOTTOM_LEFT = 0, + BOTTOM_CENTER = 1, + BOTTOM_RIGHT = 2, + TOP_LEFT = 3, + TOP_CENTER = 4, + TOP_RIGHT = 5, + CENTER_LEFT = 6, + CENTER_RIGHT = 7, + VALUE_COUNT, +}; + +enum class DebugOverlay : int { + OFF, + DEBUG_STATS, + FRAME_GRAPH, + FRAME_TIMING, +#ifdef USE_PROFILER + FRAME_PROFILE, +#endif + CONTROL, + AUDIO, + GPU_PROFILE, + GPU_ALLOCATOR, +}; diff --git a/Core/Core.cpp b/Core/Core.cpp index daf858a30b..6dc3fd759a 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -48,10 +48,6 @@ #include "Windows/InputDevice.h" #endif -// Time until we stop considering the core active without user input. -// Should this be configurable? 2 hours currently. -static const double ACTIVITY_IDLE_TIMEOUT = 2.0 * 3600.0; - static std::condition_variable m_StepCond; static std::mutex m_hStepMutex; static std::condition_variable m_InactiveCond; @@ -63,16 +59,12 @@ static uint32_t steppingAddress = 0; static std::set lifecycleFuncs; static std::set stopFuncs; static bool windowHidden = false; -static double lastActivity = 0.0; -static double lastKeepAwake = 0.0; -static GraphicsContext *graphicsContext; static bool powerSaving = false; static MIPSExceptionInfo g_exceptionInfo; void Core_SetGraphicsContext(GraphicsContext *ctx) { - graphicsContext = ctx; - PSP_CoreParameter().graphicsContext = graphicsContext; + PSP_CoreParameter().graphicsContext = ctx; } void Core_NotifyWindowHidden(bool hidden) { @@ -80,8 +72,8 @@ void Core_NotifyWindowHidden(bool hidden) { // TODO: Wait until we can react? } -void Core_NotifyActivity() { - lastActivity = time_now_d(); +bool Core_IsWindowHidden() { + return windowHidden; } void Core_ListenLifecycle(CoreLifecycleFunc func) { @@ -162,20 +154,19 @@ static bool IsWindowSmall(int pixelWidth, int pixelHeight) { // TODO: Feels like this belongs elsewhere. bool UpdateScreenScale(int width, int height) { bool smallWindow; -#if defined(USING_QT_UI) - g_display.dpi = System_GetPropertyFloat(SYSPROP_DISPLAY_DPI); + float g_logical_dpi = System_GetPropertyFloat(SYSPROP_DISPLAY_LOGICAL_DPI); + g_display.dpi = System_GetPropertyFloat(SYSPROP_DISPLAY_DPI); + + if (g_display.dpi < 0.0f) { + g_display.dpi = 96.0f; + } + if (g_logical_dpi < 0.0f) { + g_logical_dpi = 96.0f; + } + g_display.dpi_scale_x = g_logical_dpi / g_display.dpi; g_display.dpi_scale_y = g_logical_dpi / g_display.dpi; -#elif PPSSPP_PLATFORM(WINDOWS) && !PPSSPP_PLATFORM(UWP) - g_display.dpi = System_GetPropertyFloat(SYSPROP_DISPLAY_DPI); - g_display.dpi_scale_x = 96.0f / g_display.dpi; - g_display.dpi_scale_y = 96.0f / g_display.dpi; -#else - g_display.dpi = 96.0f; - g_display.dpi_scale_x = 1.0f; - g_display.dpi_scale_y = 1.0f; -#endif g_display.dpi_scale_real_x = g_display.dpi_scale_x; g_display.dpi_scale_real_y = g_display.dpi_scale_y; @@ -205,58 +196,40 @@ bool UpdateScreenScale(int width, int height) { return false; } -// Note: not used on Android. -void UpdateRunLoop() { +// Used by Windows, SDL, Qt. +void UpdateRunLoop(GraphicsContext *ctx) { + NativeFrame(ctx); if (windowHidden && g_Config.bPauseWhenMinimized) { sleep_ms(16); return; } - NativeUpdate(); - NativeRender(graphicsContext); -} - -void KeepScreenAwake() { -#if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) - SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); -#endif } +// Note: not used on Android. void Core_RunLoop(GraphicsContext *ctx) { float refreshRate = System_GetPropertyFloat(SYSPROP_DISPLAY_REFRESH_RATE); - graphicsContext = ctx; - while ((GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT) { - // In case it was pending, we're not in game anymore. We won't get to Core_Run(). - Core_StateProcessed(); - double startTime = time_now_d(); - UpdateRunLoop(); + if (windowHidden && g_Config.bPauseWhenMinimized) { + sleep_ms(16); + return; + } + bool menuThrottle = (GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT; + + double startTime; + if (menuThrottle) { + startTime = time_now_d(); + } + + NativeFrame(ctx); + + if (menuThrottle) { // Simple throttling to not burn the GPU in the menu. + // TODO: This should move into NativeFrame. Also, it's only necessary in MAILBOX or IMMEDIATE presentation modes. double diffTime = time_now_d() - startTime; int sleepTime = (int)(1000.0 / refreshRate) - (int)(diffTime * 1000.0); if (sleepTime > 0) sleep_ms(sleepTime); - if (!windowHidden) { - ctx->SwapBuffers(); - } - } - - while ((coreState == CORE_RUNNING || coreState == CORE_STEPPING) && GetUIState() == UISTATE_INGAME) { - UpdateRunLoop(); - if (!windowHidden && !Core_IsStepping()) { - ctx->SwapBuffers(); - - // Keep the system awake for longer than normal for cutscenes and the like. - const double now = time_now_d(); - if (now < lastActivity + ACTIVITY_IDLE_TIMEOUT) { - // Only resetting it ever prime number seconds in case the call is expensive. - // Using a prime number to ensure there's no interaction with other periodic events. - if (now - lastKeepAwake > 89.0 || now < lastKeepAwake) { - KeepScreenAwake(); - lastKeepAwake = now; - } - } - } } } @@ -326,14 +299,15 @@ void Core_ProcessStepping() { } // Many platforms, like Android, do not call this function but handle things on their own. -// Instead they simply call NativeRender and NativeUpdate directly. +// Instead they simply call NativeFrame directly. bool Core_Run(GraphicsContext *ctx) { System_Notify(SystemNotification::DISASSEMBLY); while (true) { if (GetUIState() != UISTATE_INGAME) { Core_StateProcessed(); if (GetUIState() == UISTATE_EXIT) { - UpdateRunLoop(); + // Not sure why we do a final frame here? + NativeFrame(ctx); return false; } Core_RunLoop(ctx); @@ -343,6 +317,7 @@ bool Core_Run(GraphicsContext *ctx) { switch (coreState) { case CORE_RUNNING: case CORE_STEPPING: + Core_StateProcessed(); // enter a fast runloop Core_RunLoop(ctx); if (coreState == CORE_POWERDOWN) { @@ -357,7 +332,6 @@ bool Core_Run(GraphicsContext *ctx) { case CORE_RUNTIME_ERROR: // Exit loop!! Core_StateProcessed(); - return true; case CORE_NEXTFRAME: diff --git a/Core/Core.h b/Core/Core.h index f075609292..9024214c5d 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -25,7 +25,7 @@ class GraphicsContext; // called from emu thread -void UpdateRunLoop(); +void UpdateRunLoop(GraphicsContext *ctx); // Returns false when an UI exit state is detected. bool Core_Run(GraphicsContext *ctx); @@ -83,7 +83,7 @@ bool UpdateScreenScale(int width, int height); // Don't run the core when minimized etc. void Core_NotifyWindowHidden(bool hidden); -void Core_NotifyActivity(); +bool Core_IsWindowHidden(); void Core_SetPowerSaving(bool mode); bool Core_GetPowerSaving(); diff --git a/Core/Core.vcxproj b/Core/Core.vcxproj index 9794f02f81..b179805790 100644 --- a/Core/Core.vcxproj +++ b/Core/Core.vcxproj @@ -565,6 +565,7 @@ + @@ -591,6 +592,7 @@ + @@ -1150,6 +1152,7 @@ + @@ -1170,6 +1173,7 @@ + diff --git a/Core/Core.vcxproj.filters b/Core/Core.vcxproj.filters index e437d0d813..627456ae70 100644 --- a/Core/Core.vcxproj.filters +++ b/Core/Core.vcxproj.filters @@ -1240,6 +1240,12 @@ MIPS\IR + + MIPS\IR + + + Core + @@ -1998,6 +2004,12 @@ MIPS\IR + + MIPS\IR + + + Core + diff --git a/Core/CoreParameter.h b/Core/CoreParameter.h index afa15412a9..3ca526b46a 100644 --- a/Core/CoreParameter.h +++ b/Core/CoreParameter.h @@ -19,6 +19,7 @@ #include +#include "Common/File/Path.h" #include "Core/Compatibility.h" enum GPUCore { diff --git a/Core/FrameTiming.cpp b/Core/FrameTiming.cpp new file mode 100644 index 0000000000..49767bc520 --- /dev/null +++ b/Core/FrameTiming.cpp @@ -0,0 +1,12 @@ +#include "Common/Profiler/Profiler.h" +#include "Common/Log.h" +#include "Common/TimeUtil.h" + +#include "Core/RetroAchievements.h" +#include "Core/CoreParameter.h" +#include "Core/Core.h" +#include "Core/Config.h" +#include "Core/HW/Display.h" +#include "Core/FrameTiming.h" + +FrameTiming g_frameTiming; diff --git a/Core/FrameTiming.h b/Core/FrameTiming.h new file mode 100644 index 0000000000..11bd130678 --- /dev/null +++ b/Core/FrameTiming.h @@ -0,0 +1,7 @@ +#pragma once + +struct FrameTiming { + +}; + +extern FrameTiming g_frameTiming; diff --git a/Core/HLE/sceDisplay.cpp b/Core/HLE/sceDisplay.cpp index 70fbc0796f..c531c5e5c5 100644 --- a/Core/HLE/sceDisplay.cpp +++ b/Core/HLE/sceDisplay.cpp @@ -38,6 +38,7 @@ #include "Core/Config.h" #include "Core/CoreTiming.h" #include "Core/CoreParameter.h" +#include "Core/FrameTiming.h" #include "Core/Reporting.h" #include "Core/Core.h" #include "Core/System.h" @@ -496,7 +497,7 @@ static void DoFrameIdleTiming() { #endif } - if (g_Config.bDrawFrameGraph || coreCollectDebugStats) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::FRAME_GRAPH || coreCollectDebugStats) { DisplayNotifySleep(time_now_d() - before); } } @@ -662,7 +663,7 @@ void __DisplayFlip(int cyclesLate) { CoreTiming::ScheduleEvent(0 - cyclesLate, afterFlipEvent, 0); numVBlanksSinceFlip = 0; - if (g_Config.bDrawFrameGraph || coreCollectDebugStats) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::FRAME_GRAPH || coreCollectDebugStats) { // Track how long we sleep (whether vsync or sleep_ms.) DisplayNotifySleep(time_now_d() - frameSleepStart, frameSleepPos); } @@ -718,6 +719,8 @@ void hleLagSync(u64 userdata, int cyclesLate) { #ifndef _WIN32 const double left = goal - now; usleep((long)(left * 1000000.0)); +#else + yield(); #endif now = time_now_d(); } @@ -726,7 +729,7 @@ void hleLagSync(u64 userdata, int cyclesLate) { const int over = (int)((now - goal) * 1000000); ScheduleLagSync(over - emuOver); - if (g_Config.bDrawFrameGraph || coreCollectDebugStats) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::FRAME_GRAPH || coreCollectDebugStats) { DisplayNotifySleep(now - before); } } diff --git a/Core/HW/Display.cpp b/Core/HW/Display.cpp index acead8d785..1831ee3f23 100644 --- a/Core/HW/Display.cpp +++ b/Core/HW/Display.cpp @@ -92,7 +92,7 @@ static void CalculateFPS() { } } - if (g_Config.bDrawFrameGraph || coreCollectDebugStats) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::FRAME_GRAPH || coreCollectDebugStats) { frameTimeHistory[frameTimeHistoryPos++] = now - lastFrameTimeHistory; lastFrameTimeHistory = now; frameTimeHistoryPos = frameTimeHistoryPos % frameTimeHistorySize; @@ -182,6 +182,10 @@ void DisplayNotifySleep(double t, int pos) { void __DisplayGetDebugStats(char *stats, size_t bufsize) { char statbuf[4096]; + if (!gpu) { + snprintf(stats, bufsize, "N/A"); + return; + } gpu->GetStats(statbuf, sizeof(statbuf)); snprintf(stats, bufsize, diff --git a/Core/KeyMap.cpp b/Core/KeyMap.cpp index 3296ae09e9..b86644dd97 100644 --- a/Core/KeyMap.cpp +++ b/Core/KeyMap.cpp @@ -400,8 +400,8 @@ const KeyMap_IntStrPair psp_button_names[] = { {VIRTKEY_REWIND, "Rewind"}, {VIRTKEY_SAVE_STATE, "Save State"}, {VIRTKEY_LOAD_STATE, "Load State"}, - {VIRTKEY_PREVIOUS_SLOT, "Previous Slot"}, - {VIRTKEY_NEXT_SLOT, "Next Slot"}, + {VIRTKEY_PREVIOUS_SLOT, "Previous Slot"}, + {VIRTKEY_NEXT_SLOT, "Next Slot"}, #if !defined(MOBILE_DEVICE) {VIRTKEY_TOGGLE_FULLSCREEN, "Toggle Fullscreen"}, #endif diff --git a/Core/MIPS/IR/IRAnalysis.cpp b/Core/MIPS/IR/IRAnalysis.cpp index 0a8b861b89..2de3adb8d1 100644 --- a/Core/MIPS/IR/IRAnalysis.cpp +++ b/Core/MIPS/IR/IRAnalysis.cpp @@ -17,6 +17,10 @@ #include "Core/MIPS/IR/IRAnalysis.h" +// For std::min +#include + + static bool IRReadsFrom(const IRInst &inst, int reg, char type, bool directly = false) { const IRMeta *m = GetIRMeta(inst.op); @@ -62,6 +66,25 @@ bool IRReadsFromFPR(const IRInst &inst, int reg, bool directly) { return false; } +static int IRReadsFromList(const IRInst &inst, IRReg regs[4], char type) { + const IRMeta *m = GetIRMeta(inst.op); + int c = 0; + + if (m->types[1] == type) + regs[c++] = inst.src1; + if (m->types[2] == type) + regs[c++] = inst.src2; + if ((m->flags & (IRFLAG_SRC3 | IRFLAG_SRC3DST)) != 0 && m->types[0] == type) + regs[c++] = inst.src3; + + if (inst.op == IROp::Interpret || inst.op == IROp::CallReplacement || inst.op == IROp::Syscall || inst.op == IROp::Break) + return -1; + if (inst.op == IROp::Breakpoint || inst.op == IROp::MemoryCheck) + return -1; + + return c; +} + bool IRReadsFromGPR(const IRInst &inst, int reg, bool directly) { return IRReadsFrom(inst, reg, 'G', directly); } @@ -95,6 +118,59 @@ bool IRWritesToFPR(const IRInst &inst, int reg) { return false; } +int IRDestFPRs(const IRInst &inst, IRReg regs[4]) { + const IRMeta *m = GetIRMeta(inst.op); + + // Doesn't write to anything. + if ((m->flags & IRFLAG_SRC3) != 0) + return 0; + + if (m->types[0] == 'F') { + regs[0] = inst.dest; + return 1; + } + if (m->types[0] == 'V') { + for (int i = 0; i < 4; ++i) + regs[i] = inst.dest + i; + return 4; + } + if (m->types[0] == '2') { + for (int i = 0; i < 2; ++i) + regs[i] = inst.dest + i; + return 2; + } + return 0; +} + +int IRReadsFromGPRs(const IRInst &inst, IRReg regs[4]) { + return IRReadsFromList(inst, regs, 'G'); +} + +int IRReadsFromFPRs(const IRInst &inst, IRReg regs[16]) { + int c = IRReadsFromList(inst, regs, 'F'); + if (c != 0) + return c; + + const IRMeta *m = GetIRMeta(inst.op); + + // We also need to check V and 2. Indirect reads already checked, don't check again. + if (m->types[1] == 'V' || m->types[1] == '2') { + for (int i = 0; i < (m->types[1] == 'V' ? 4 : 2); ++i) + regs[c++] = inst.src1 + i; + } + if (m->types[2] == 'V' || m->types[2] == '2') { + for (int i = 0; i < (m->types[2] == 'V' ? 4 : 2); ++i) + regs[c++] = inst.src2 + i; + } + if ((m->flags & (IRFLAG_SRC3 | IRFLAG_SRC3DST)) != 0) { + if (m->types[0] == 'V' || m->types[0] == '2') { + for (int i = 0; i < (m->types[0] == 'V' ? 4 : 2); ++i) + regs[c++] = inst.src3 + i; + } + } + return c; +} + IRUsage IRNextGPRUsage(int gpr, const IRSituation &info) { // Exclude any "special" regs from this logic for now. if (gpr >= 32) diff --git a/Core/MIPS/IR/IRAnalysis.h b/Core/MIPS/IR/IRAnalysis.h index 2b5ff598b4..90650f4360 100644 --- a/Core/MIPS/IR/IRAnalysis.h +++ b/Core/MIPS/IR/IRAnalysis.h @@ -24,6 +24,9 @@ bool IRReadsFromGPR(const IRInst &inst, int reg, bool directly = false); bool IRWritesToGPR(const IRInst &inst, int reg); bool IRWritesToFPR(const IRInst &inst, int reg); int IRDestGPR(const IRInst &inst); +int IRDestFPRs(const IRInst &inst, IRReg regs[4]); +int IRReadsFromGPRs(const IRInst &inst, IRReg regs[4]); +int IRReadsFromFPRs(const IRInst &inst, IRReg regs[16]); struct IRSituation { int lookaheadCount; diff --git a/Core/MIPS/IR/IRCompFPU.cpp b/Core/MIPS/IR/IRCompFPU.cpp index b0edeea0cf..e83f3a709f 100644 --- a/Core/MIPS/IR/IRCompFPU.cpp +++ b/Core/MIPS/IR/IRCompFPU.cpp @@ -102,7 +102,7 @@ void IRFrontend::Comp_FPUComp(MIPSOpcode op) { int opc = op & 0xF; if (opc >= 8) opc -= 8; // alias if (opc == 0) { // f, sf (signalling false) - ir.Write(IROp::ZeroFpCond); + ir.Write(IROp::FpCondFromReg, 0, MIPS_REG_ZERO); return; } @@ -226,7 +226,8 @@ void IRFrontend::Comp_mxc1(MIPSOpcode op) { UpdateRoundingMode(); ApplyRoundingMode(); } else { - Comp_Generic(op); + // Maybe not strictly invalid? But likely invalid. + INVALIDOP; } return; default: diff --git a/Core/MIPS/IR/IRCompVFPU.cpp b/Core/MIPS/IR/IRCompVFPU.cpp index c902951d96..374ebf8f3a 100644 --- a/Core/MIPS/IR/IRCompVFPU.cpp +++ b/Core/MIPS/IR/IRCompVFPU.cpp @@ -212,6 +212,54 @@ namespace MIPSComp { ir.Write(IROp::Vec4Shuffle, vregs[0], origV[0], prefix); return; } + + if ((prefix & 0x000FF000) == 0x0000F000) { + // Handle some easy and common cases. + Vec4Init init = Vec4Init::AllZERO; + bool useInit; + switch (prefix & 0xFFF) { + case 0x00: useInit = true; init = Vec4Init::AllZERO; break; + case 0x01: useInit = true; init = Vec4Init::Set_1000; break; + case 0x04: useInit = true; init = Vec4Init::Set_0100; break; + case 0x10: useInit = true; init = Vec4Init::Set_0010; break; + case 0x40: useInit = true; init = Vec4Init::Set_0001; break; + case 0x55: useInit = true; init = Vec4Init::AllONE; break; + default: useInit = false; break; + } + + if (useInit) { + InitRegs(vregs, tempReg); + ir.Write(IROp::Vec4Init, vregs[0], (int)init); + return; + } + } + + // Check if we're just zeroing certain lanes - this is common. + u32 zeroedLanes = 0; + for (int i = 0; i < 4; ++i) { + int regnum = (prefix >> (i * 2)) & 3; + int abs = (prefix >> (8 + i)) & 1; + int negate = (prefix >> (16 + i)) & 1; + int constants = (prefix >> (12 + i)) & 1; + + if (!constants && regnum == i && !abs && !negate) + continue; + if (constants && regnum == 0 && abs == 0 && !negate) { + zeroedLanes |= 1 << i; + continue; + } + + // Nope, it has something else going on. + zeroedLanes = -1; + break; + } + + if (zeroedLanes != -1) { + InitRegs(vregs, tempReg); + ir.Write(IROp::Vec4Init, vregs[0], (int)Vec4Init::AllZERO); + ir.Write({ IROp::Vec4Blend, vregs[0], origV[0], vregs[0], zeroedLanes }); + return; + } } // Alright, fall back to the generic approach. @@ -282,6 +330,13 @@ namespace MIPSComp { if (js.prefixD == 0) return; + if (IsVec4(sz, regs) && js.VfpuWriteMask() != 0) { + // Use temps for all, we'll blend in the end (keeping in Vec4.) + for (int i = 0; i < 4; ++i) + regs[i] = IRVTEMP_PFX_D + i; + return; + } + for (int i = 0; i < n; i++) { // Hopefully this is rare, we'll just write it into a dumping ground reg. if (js.VfpuWriteMask(i)) @@ -295,11 +350,13 @@ namespace MIPSComp { // "D" prefix is really a post process. No need to allocate a temporary register (except // dummies to simulate writemask, which is done in GetVectorRegsPrefixD - void IRFrontend::ApplyPrefixD(const u8 *vregs, VectorSize sz) { + void IRFrontend::ApplyPrefixD(u8 *vregs, VectorSize sz, int vectorReg) { _assert_(js.prefixDFlag & JitState::PREFIX_KNOWN); if (!js.prefixD) return; + ApplyPrefixDMask(vregs, sz, vectorReg); + int n = GetNumVectorElements(sz); for (int i = 0; i < n; i++) { if (js.VfpuWriteMask(i)) @@ -314,6 +371,20 @@ namespace MIPSComp { } } + void IRFrontend::ApplyPrefixDMask(u8 *vregs, VectorSize sz, int vectorReg) { + if (IsVec4(sz, vregs) && js.VfpuWriteMask() != 0) { + u8 origV[4]; + GetVectorRegs(origV, sz, vectorReg); + + // Just keep the original values where it was masked. + ir.Write({ IROp::Vec4Blend, origV[0], vregs[0], origV[0], js.VfpuWriteMask() }); + + // So that saturate works, change it back. + for (int i = 0; i < 4; ++i) + vregs[i] = origV[i]; + } + } + void IRFrontend::Comp_SV(MIPSOpcode op) { CONDITIONAL_DISABLE(LSU_VFPU); s32 offset = (signed short)(op & 0xFFFC); @@ -410,7 +481,7 @@ namespace MIPSComp { ir.Write(IROp::SetConstF, dregs[i], ir.AddConstantFloat(type == 6 ? 0.0f : 1.0f)); } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); } void IRFrontend::Comp_VIdt(MIPSOpcode op) { @@ -449,28 +520,65 @@ namespace MIPSComp { } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); } void IRFrontend::Comp_VMatrixInit(MIPSOpcode op) { CONDITIONAL_DISABLE(VFPU_XFER); MatrixSize sz = GetMtxSize(op); - if (sz != M_4x4 || !js.HasNoPrefix()) { + if (!js.HasNoPrefix()) { DISABLE; } // Matrix init (weird prefixes) // d[N,M] = CONST[N,M] - // Not really about trying here, it will work if enabled. - VectorSize vsz = GetVectorSize(sz); - u8 vecs[4]; int vd = _VD; if (IsMatrixTransposed(vd)) { // All outputs are transpositionally symmetric, so should be fine. vd = TransposeMatrixReg(vd); } - GetMatrixColumns(vd, M_4x4, vecs); + + if (sz != M_4x4) { + // 3x3 is decently common. It expands a lot, but let's set each. + u8 dregs[16]; + GetMatrixRegs(dregs, sz, vd); + + // TODO: It might be worth using Vec4Blend for 3x3 to mask w. + int n = GetMatrixSide(sz); + for (int y = 0; y < n; ++y) { + for (int x = 0; x < n; ++x) { + switch ((op >> 16) & 0xF) { + case 3: // vmidt + if (x == 0 && y == 0) + ir.Write(IROp::SetConstF, dregs[y * 4 + x], ir.AddConstantFloat(1.0f)); + else if (x == y) + ir.Write(IROp::FMov, dregs[y * 4 + x], dregs[0]); + else + ir.Write(IROp::SetConstF, dregs[y * 4 + x], ir.AddConstantFloat(0.0f)); + break; + case 6: // vmzero + // Likely to be fast. + ir.Write(IROp::SetConstF, dregs[y * 4 + x], ir.AddConstantFloat(0.0f)); + break; + case 7: // vmone + if (x == 0 && y == 0) + ir.Write(IROp::SetConstF, dregs[y * 4 + x], ir.AddConstantFloat(1.0f)); + else + ir.Write(IROp::FMov, dregs[y * 4 + x], dregs[0]); + break; + default: + INVALIDOP; + } + } + } + return; + } + + // Not really about trying here, it will work if enabled. + VectorSize vsz = GetVectorSize(sz); + u8 vecs[4]; + GetMatrixColumns(vd, sz, vecs); for (int i = 0; i < 4; i++) { u8 vec[4]; GetVectorRegs(vec, vsz, vecs[i]); @@ -531,7 +639,7 @@ namespace MIPSComp { } ir.Write(IROp::FMov, dregs[0], IRVTEMP_0); - ApplyPrefixD(dregs, V_Single); + ApplyPrefixD(dregs, V_Single, vd); } alignas(16) static const float vavg_table[4] = { 1.0f, 1.0f / 2.0f, 1.0f / 3.0f, 1.0f / 4.0f }; @@ -571,7 +679,7 @@ namespace MIPSComp { break; } - ApplyPrefixD(dregs, V_Single); + ApplyPrefixD(dregs, V_Single, _VD); } void IRFrontend::Comp_VDot(MIPSOpcode op) { @@ -598,7 +706,7 @@ namespace MIPSComp { if (IsVec4(sz, sregs) && IsVec4(sz, tregs) && IsOverlapSafe(dregs[0], n, sregs, n, tregs)) { ir.Write(IROp::Vec4Dot, dregs[0], sregs[0], tregs[0]); - ApplyPrefixD(dregs, V_Single); + ApplyPrefixD(dregs, V_Single, vd); return; } @@ -609,7 +717,7 @@ namespace MIPSComp { ir.Write(IROp::FMul, temp1, sregs[i], tregs[i]); ir.Write(IROp::FAdd, i == (n - 1) ? dregs[0] : temp0, temp0, temp1); } - ApplyPrefixD(dregs, V_Single); + ApplyPrefixD(dregs, V_Single, vd); } void IRFrontend::Comp_VecDo3(MIPSOpcode op) { @@ -621,47 +729,65 @@ namespace MIPSComp { // Vector arithmetic // d[N] = OP(s[N], t[N]) (see below) + enum class VecDo3Op : uint8_t { + INVALID, + VADD, + VSUB, + VDIV, + VMUL, + VMIN, + VMAX, + VSGE, + VSLT, + }; + VecDo3Op type = VecDo3Op::INVALID; + // Check that we can support the ops, and prepare temporary values for ops that need it. - bool allowSIMD = true; switch (op >> 26) { case 24: //VFPU0 switch ((op >> 23) & 7) { - case 0: // d[i] = s[i] + t[i]; break; //vadd - case 1: // d[i] = s[i] - t[i]; break; //vsub - break; - case 7: // d[i] = s[i] / t[i]; break; //vdiv - if (!js.HasNoPrefix()) { - DISABLE; - } - break; - default: - INVALIDOP; + case 0: type = VecDo3Op::VADD; break; + case 1: type = VecDo3Op::VSUB; break; + case 7: type = VecDo3Op::VDIV; break; + default: INVALIDOP; } break; case 25: //VFPU1 switch ((op >> 23) & 7) { - case 0: // d[i] = s[i] * t[i]; break; //vmul - break; - default: - INVALIDOP; + case 0: type = VecDo3Op::VMUL; break; + default: INVALIDOP; } break; case 27: //VFPU3 switch ((op >> 23) & 7) { - case 2: // vmin - case 3: // vmax - allowSIMD = false; - break; - case 6: // vsge - case 7: // vslt - allowSIMD = false; - break; - default: - INVALIDOP; + case 2: type = VecDo3Op::VMIN; break; + case 3: type = VecDo3Op::VMAX; break; + case 6: type = VecDo3Op::VSGE; break; + case 7: type = VecDo3Op::VSLT; break; + default: INVALIDOP; } break; - default: - INVALIDOP; + default: INVALIDOP; + } + _assert_(type != VecDo3Op::INVALID); + + bool allowSIMD = true; + switch (type) { + case VecDo3Op::VADD: + case VecDo3Op::VSUB: + case VecDo3Op::VMUL: + break; + case VecDo3Op::VDIV: + if (!js.HasNoPrefix()) { + DISABLE; + } + break; + case VecDo3Op::VMIN: + case VecDo3Op::VMAX: + case VecDo3Op::VSGE: + case VecDo3Op::VSLT: + allowSIMD = false; + break; } VectorSize sz = GetVecSize(op); @@ -684,38 +810,21 @@ namespace MIPSComp { // If all three are consecutive 4, we're safe regardless of if we use temps so we should not check that here. if (allowSIMD && IsVec4(sz, dregs) && IsVec4(sz, sregs) && IsVec4(sz, tregs)) { IROp opFunc = IROp::Nop; - switch (op >> 26) { - case 24: //VFPU0 - switch ((op >> 23) & 7) { - case 0: // d[i] = s[i] + t[i]; break; //vadd - opFunc = IROp::Vec4Add; - break; - case 1: // d[i] = s[i] - t[i]; break; //vsub - opFunc = IROp::Vec4Sub; - break; - case 7: // d[i] = s[i] / t[i]; break; //vdiv - opFunc = IROp::Vec4Div; - break; - } + switch (type) { + case VecDo3Op::VADD: // d[i] = s[i] + t[i]; break; //vadd + opFunc = IROp::Vec4Add; break; - case 25: //VFPU1 - switch ((op >> 23) & 7) - { - case 0: // d[i] = s[i] * t[i]; break; //vmul - opFunc = IROp::Vec4Mul; - break; - } + case VecDo3Op::VSUB: // d[i] = s[i] - t[i]; break; //vsub + opFunc = IROp::Vec4Sub; break; - case 27: //VFPU3 - switch ((op >> 23) & 7) - { - case 2: // vmin - case 3: // vmax - case 6: // vsge - case 7: // vslt - DISABLE; - break; - } + case VecDo3Op::VDIV: // d[i] = s[i] / t[i]; break; //vdiv + opFunc = IROp::Vec4Div; + break; + case VecDo3Op::VMUL: // d[i] = s[i] * t[i]; break; //vmul + opFunc = IROp::Vec4Mul; + break; + default: + // Leave it Nop, disabled below. break; } @@ -724,56 +833,62 @@ namespace MIPSComp { } else { DISABLE; } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); return; } + if (type == VecDo3Op::VSGE || type == VecDo3Op::VSLT) { + // TODO: Consider a dedicated op? For now, we abuse FpCond a bit. + ir.Write(IROp::FpCondToReg, IRTEMP_0); + } + for (int i = 0; i < n; ++i) { - switch (op >> 26) { - case 24: //VFPU0 - switch ((op >> 23) & 7) { - case 0: // d[i] = s[i] + t[i]; break; //vadd - ir.Write(IROp::FAdd, tempregs[i], sregs[i], tregs[i]); - break; - case 1: // d[i] = s[i] - t[i]; break; //vsub - ir.Write(IROp::FSub, tempregs[i], sregs[i], tregs[i]); - break; - case 7: // d[i] = s[i] / t[i]; break; //vdiv - ir.Write(IROp::FDiv, tempregs[i], sregs[i], tregs[i]); - break; - } + switch (type) { + case VecDo3Op::VADD: // d[i] = s[i] + t[i]; break; //vadd + ir.Write(IROp::FAdd, tempregs[i], sregs[i], tregs[i]); break; - case 25: //VFPU1 - switch ((op >> 23) & 7) { - case 0: // d[i] = s[i] * t[i]; break; //vmul - ir.Write(IROp::FMul, tempregs[i], sregs[i], tregs[i]); - break; - } + case VecDo3Op::VSUB: // d[i] = s[i] - t[i]; break; //vsub + ir.Write(IROp::FSub, tempregs[i], sregs[i], tregs[i]); break; - case 27: //VFPU3 - switch ((op >> 23) & 7) { - case 2: // vmin - ir.Write(IROp::FMin, tempregs[i], sregs[i], tregs[i]); - break; - case 3: // vmax - ir.Write(IROp::FMax, tempregs[i], sregs[i], tregs[i]); - break; - case 6: // vsge - case 7: // vslt - DISABLE; - break; - } + case VecDo3Op::VDIV: // d[i] = s[i] / t[i]; break; //vdiv + ir.Write(IROp::FDiv, tempregs[i], sregs[i], tregs[i]); + break; + case VecDo3Op::VMUL: // d[i] = s[i] * t[i]; break; //vmul + ir.Write(IROp::FMul, tempregs[i], sregs[i], tregs[i]); + break; + case VecDo3Op::VMIN: // vmin + ir.Write(IROp::FMin, tempregs[i], sregs[i], tregs[i]); + break; + case VecDo3Op::VMAX: // vmax + ir.Write(IROp::FMax, tempregs[i], sregs[i], tregs[i]); + break; + case VecDo3Op::VSGE: // vsge + ir.Write(IROp::FCmp, (int)IRFpCompareMode::LessUnordered, sregs[i], tregs[i]); + ir.Write(IROp::FpCondToReg, IRTEMP_1); + ir.Write(IROp::XorConst, IRTEMP_1, IRTEMP_1, ir.AddConstant(1)); + ir.Write(IROp::FMovFromGPR, tempregs[i], IRTEMP_1); + ir.Write(IROp::FCvtSW, tempregs[i], tempregs[i]); + break; + case VecDo3Op::VSLT: // vslt + ir.Write(IROp::FCmp, (int)IRFpCompareMode::LessOrdered, sregs[i], tregs[i]); + ir.Write(IROp::FpCondToReg, IRTEMP_1); + ir.Write(IROp::FMovFromGPR, tempregs[i], IRTEMP_1); + ir.Write(IROp::FCvtSW, tempregs[i], tempregs[i]); break; } } + if (type == VecDo3Op::VSGE || type == VecDo3Op::VSLT) { + ir.Write(IROp::FpCondFromReg, IRTEMP_0); + } + for (int i = 0; i < n; i++) { if (dregs[i] != tempregs[i]) { ir.Write(IROp::FMov, dregs[i], tempregs[i]); } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } void IRFrontend::Comp_VV2Op(MIPSOpcode op) { @@ -782,6 +897,10 @@ namespace MIPSComp { if (optype == 0) { if (js.HasUnknownPrefix() || !IsPrefixWithinSize(js.prefixS, op)) DISABLE; + } else if (optype == 1 || optype == 2) { + // D prefix is fine for these, and used sometimes. + if (js.HasUnknownPrefix() || js.HasSPrefix()) + DISABLE; } else { // Many of these apply the D prefix strangely or override parts of the S prefix. if (!js.HasNoPrefix()) @@ -847,7 +966,7 @@ namespace MIPSComp { ir.Write(IROp::Vec4Neg, dregs[0], sregs[0]); break; } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); return; } @@ -915,7 +1034,7 @@ namespace MIPSComp { } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); } void IRFrontend::Comp_Vi2f(MIPSOpcode op) { @@ -942,7 +1061,7 @@ namespace MIPSComp { else ir.Write(IROp::FCvtScaledSW, dregs[i], sregs[i], imm); } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } void IRFrontend::Comp_Vh2f(MIPSOpcode op) { @@ -1008,11 +1127,17 @@ namespace MIPSComp { } } } + + ApplyPrefixDMask(dregs, sz, _VD); } void IRFrontend::Comp_Mftv(MIPSOpcode op) { CONDITIONAL_DISABLE(VFPU_XFER); + // Vector move from VFPU / from VFPU ctrl (no prefixes) + // gpr = S + // gpr = VFPU_CTRL[i] + int imm = op & 0xFF; MIPSGPReg rt = _RT; switch ((op >> 21) & 0x1f) { @@ -1067,8 +1192,6 @@ namespace MIPSComp { default: INVALIDOP; } - // This op is marked not to auto-eat prefix so we must do it manually. - EatPrefix(); } void IRFrontend::Comp_Vmfvc(MIPSOpcode op) { @@ -1258,7 +1381,7 @@ namespace MIPSComp { if (IsVec4(sz, sregs) && IsVec4(sz, dregs)) { if (!overlap || (vs == vd && IsOverlapSafe(treg, n, dregs))) { ir.Write(IROp::Vec4Scale, dregs[0], sregs[0], treg); - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); return; } } @@ -1274,7 +1397,7 @@ namespace MIPSComp { } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); } /* @@ -1601,7 +1724,7 @@ namespace MIPSComp { } } - ApplyPrefixD(dregs, outsize); + ApplyPrefixD(dregs, outsize, _VD); } void IRFrontend::Comp_Vx2i(MIPSOpcode op) { @@ -1700,7 +1823,7 @@ namespace MIPSComp { ir.Write(IROp::FMov, dregs[i], tempregs[i]); } } - ApplyPrefixD(dregs, outsize); + ApplyPrefixD(dregs, outsize, _VD); } void IRFrontend::Comp_VCrossQuat(MIPSOpcode op) { @@ -1723,16 +1846,16 @@ namespace MIPSComp { GetVectorRegs(tregs, sz, _VT); GetVectorRegs(dregs, sz, _VD); - u8 tempregs[4]{}; - for (int i = 0; i < n; ++i) { - if (!IsOverlapSafe(dregs[i], n, sregs, n, tregs)) { - tempregs[i] = IRVTEMP_PFX_T + i; // using IRTEMP0 for other things - } else { - tempregs[i] = dregs[i]; - } - } - if (sz == V_Triple) { + u8 tempregs[4]{}; + for (int i = 0; i < n; ++i) { + if (!IsOverlapSafe(dregs[i], n, sregs, n, tregs)) { + tempregs[i] = IRVTEMP_PFX_T + i; // using IRTEMP0 for other things + } else { + tempregs[i] = dregs[i]; + } + } + int temp0 = IRVTEMP_0; int temp1 = IRVTEMP_0 + 1; // Compute X @@ -1749,15 +1872,50 @@ namespace MIPSComp { ir.Write(IROp::FMul, temp0, sregs[0], tregs[1]); ir.Write(IROp::FMul, temp1, sregs[1], tregs[0]); ir.Write(IROp::FSub, tempregs[2], temp0, temp1); - } else if (sz == V_Quad) { - DISABLE; - } else { - DISABLE; - } - for (int i = 0; i < n; i++) { - if (tempregs[i] != dregs[i]) - ir.Write(IROp::FMov, dregs[i], tempregs[i]); + for (int i = 0; i < n; i++) { + if (tempregs[i] != dregs[i]) + ir.Write(IROp::FMov, dregs[i], tempregs[i]); + } + } else if (sz == V_Quad) { + // Rather than using vdots, we organize this as SIMD multiplies and adds. + // That means flipping the logic column-wise. Also, luckily no prefix temps used. + if (!IsConsecutive4(sregs) || !IsConsecutive4(tregs) || !IsConsecutive4(dregs)) { + DISABLE; + } + + auto shuffleImm = [](int x, int y, int z, int w) { return x | (y << 2) | (z << 4) | (w << 6); }; + auto blendConst = [](int x, int y, int z, int w) { return x | (y << 1) | (z << 2) | (w << 3); }; + + // Prepare some negatives. + ir.Write(IROp::Vec4Neg, IRVTEMP_0, tregs[0]); + + // tmp = S[x,x,x,x] * T[w,-z,y,-x] + ir.Write(IRInst{ IROp::Vec4Blend, IRVTEMP_PFX_S, tregs[0], IRVTEMP_0, blendConst(1, 0, 1, 0) }); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_T, IRVTEMP_PFX_S, shuffleImm(3, 2, 1, 0)); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_S, sregs[0], shuffleImm(0, 0, 0, 0)); + ir.Write(IROp::Vec4Mul, IRVTEMP_PFX_D, IRVTEMP_PFX_S, IRVTEMP_PFX_T); + + // tmp += S[y,y,y,y] * T[z,w,-x,-y] + ir.Write(IRInst{ IROp::Vec4Blend, IRVTEMP_PFX_S, tregs[0], IRVTEMP_0, blendConst(1, 1, 0, 0) }); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_T, IRVTEMP_PFX_S, shuffleImm(2, 3, 0, 1)); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_S, sregs[0], shuffleImm(1, 1, 1, 1)); + ir.Write(IROp::Vec4Mul, IRVTEMP_PFX_S, IRVTEMP_PFX_S, IRVTEMP_PFX_T); + ir.Write(IROp::Vec4Add, IRVTEMP_PFX_D, IRVTEMP_PFX_D, IRVTEMP_PFX_S); + + // tmp += S[z,z,z,z] * T[-y,x,w,-z] + ir.Write(IRInst{ IROp::Vec4Blend, IRVTEMP_PFX_S, tregs[0], IRVTEMP_0, blendConst(0, 1, 1, 0) }); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_T, IRVTEMP_PFX_S, shuffleImm(1, 0, 3, 2)); + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_S, sregs[0], shuffleImm(2, 2, 2, 2)); + ir.Write(IROp::Vec4Mul, IRVTEMP_PFX_S, IRVTEMP_PFX_S, IRVTEMP_PFX_T); + ir.Write(IROp::Vec4Add, IRVTEMP_PFX_D, IRVTEMP_PFX_D, IRVTEMP_PFX_S); + + // tmp += S[w,w,w,w] * T[x,y,z,w] + ir.Write(IROp::Vec4Shuffle, IRVTEMP_PFX_S, sregs[0], shuffleImm(3, 3, 3, 3)); + ir.Write(IROp::Vec4Mul, IRVTEMP_PFX_S, IRVTEMP_PFX_S, tregs[0]); + ir.Write(IROp::Vec4Add, dregs[0], IRVTEMP_PFX_D, IRVTEMP_PFX_S); + } else { + INVALIDOP; } } @@ -1805,6 +1963,10 @@ namespace MIPSComp { int tf = (op >> 19) & 1; int imm3 = (op >> 16) & 7; + if (IsVec4(sz, sregs) && IsVec4(sz, dregs)) { + // TODO: Could do a VfpuCC variant of Vec4Blend. + } + for (int i = 0; i < n; ++i) { // Simplification: Disable if overlap unsafe if (!IsOverlapSafeAllowS(dregs[i], i, n, sregs)) { @@ -1822,7 +1984,7 @@ namespace MIPSComp { ir.Write(IROp::FCmovVfpuCC, dregs[i], sregs[i], (i) | ((!tf) << 7)); } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } void IRFrontend::Comp_Viim(MIPSOpcode op) { @@ -1837,7 +1999,7 @@ namespace MIPSComp { u8 dreg; GetVectorRegsPrefixD(&dreg, V_Single, _VT); ir.Write(IROp::SetConstF, dreg, ir.AddConstantFloat((float)imm)); - ApplyPrefixD(&dreg, V_Single); + ApplyPrefixD(&dreg, V_Single, _VT); } void IRFrontend::Comp_Vfim(MIPSOpcode op) { @@ -1855,7 +2017,7 @@ namespace MIPSComp { u8 dreg; GetVectorRegsPrefixD(&dreg, V_Single, _VT); ir.Write(IROp::SetConstF, dreg, ir.AddConstantFloat(fval.f)); - ApplyPrefixD(&dreg, V_Single); + ApplyPrefixD(&dreg, V_Single, _VT); } void IRFrontend::Comp_Vcst(MIPSOpcode op) { @@ -1874,10 +2036,20 @@ namespace MIPSComp { u8 dregs[4]; GetVectorRegsPrefixD(dregs, sz, vd); - for (int i = 0; i < n; i++) { - ir.Write(IROp::SetConstF, dregs[i], ir.AddConstantFloat(cst_constants[conNum])); + + if (IsVec4(sz, dregs)) { + ir.Write(IROp::SetConstF, IRVTEMP_0, ir.AddConstantFloat(cst_constants[conNum])); + ir.Write(IROp::Vec4Shuffle, dregs[0], IRVTEMP_0, 0); + } else { + for (int i = 0; i < n; i++) { + // Most of the time, materializing a float is slower than copying from another float. + if (i == 0) + ir.Write(IROp::SetConstF, dregs[i], ir.AddConstantFloat(cst_constants[conNum])); + else + ir.Write(IROp::FMov, dregs[i], dregs[0]); + } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, vd); } // Very heavily used by FF:CC. Should be replaced by a fast approximation instead of @@ -1988,7 +2160,7 @@ namespace MIPSComp { } } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } void IRFrontend::Comp_Vocp(MIPSOpcode op) { @@ -2016,25 +2188,29 @@ namespace MIPSComp { GetVectorRegsPrefixT(tregs, sz, _VS); GetVectorRegsPrefixD(dregs, sz, _VD); - u8 tempregs[4]; - for (int i = 0; i < n; ++i) { - if (!IsOverlapSafe(dregs[i], n, sregs)) { - tempregs[i] = IRVTEMP_0 + i; - } else { - tempregs[i] = dregs[i]; + if (IsVec4(sz, dregs) && IsVec4(sz, sregs) && IsVec4(sz, tregs)) { + ir.Write(IROp::Vec4Add, dregs[0], tregs[0], sregs[0]); + } else { + u8 tempregs[4]; + for (int i = 0; i < n; ++i) { + if (!IsOverlapSafe(dregs[i], n, sregs)) { + tempregs[i] = IRVTEMP_0 + i; + } else { + tempregs[i] = dregs[i]; + } + } + + for (int i = 0; i < n; ++i) { + ir.Write(IROp::FAdd, tempregs[i], tregs[i], sregs[i]); + } + for (int i = 0; i < n; ++i) { + if (dregs[i] != tempregs[i]) { + ir.Write(IROp::FMov, dregs[i], tempregs[i]); + } } } - for (int i = 0; i < n; ++i) { - ir.Write(IROp::FAdd, tempregs[i], tregs[i], sregs[i]); - } - for (int i = 0; i < n; ++i) { - if (dregs[i] != tempregs[i]) { - ir.Write(IROp::FMov, dregs[i], tempregs[i]); - } - } - - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } void IRFrontend::Comp_ColorConv(MIPSOpcode op) { @@ -2103,6 +2279,6 @@ namespace MIPSComp { ir.Write(IROp::FMov, dregs[i], tempregs[i]); } - ApplyPrefixD(dregs, sz); + ApplyPrefixD(dregs, sz, _VD); } } diff --git a/Core/MIPS/IR/IRFrontend.h b/Core/MIPS/IR/IRFrontend.h index b53e053d73..4ae7b4a095 100644 --- a/Core/MIPS/IR/IRFrontend.h +++ b/Core/MIPS/IR/IRFrontend.h @@ -126,7 +126,8 @@ private: void CompShiftVar(MIPSOpcode op, IROp shiftType); void ApplyPrefixST(u8 *vregs, u32 prefix, VectorSize sz, int tempReg); - void ApplyPrefixD(const u8 *vregs, VectorSize sz); + void ApplyPrefixD(u8 *vregs, VectorSize sz, int vectorReg); + void ApplyPrefixDMask(u8 *vregs, VectorSize sz, int vectorReg); void GetVectorRegsPrefixS(u8 *regs, VectorSize sz, int vectorReg); void GetVectorRegsPrefixT(u8 *regs, VectorSize sz, int vectorReg); void GetVectorRegsPrefixD(u8 *regs, VectorSize sz, int vectorReg); diff --git a/Core/MIPS/IR/IRInst.cpp b/Core/MIPS/IR/IRInst.cpp index d0e0fe1d74..bc7d9f4a9a 100644 --- a/Core/MIPS/IR/IRInst.cpp +++ b/Core/MIPS/IR/IRInst.cpp @@ -113,7 +113,7 @@ static const IRMeta irMeta[] = { { IROp::FSatMinus1_1, "FSat(-1 - 1)", "FF" }, { IROp::FMovFromGPR, "FMovFromGPR", "FG" }, { IROp::FMovToGPR, "FMovToGPR", "GF" }, - { IROp::ZeroFpCond, "ZeroFpCond", "" }, + { IROp::FpCondFromReg, "FpCondFromReg", "_G" }, { IROp::FpCondToReg, "FpCondToReg", "G" }, { IROp::FpCtrlFromReg, "FpCtrlFromReg", "_G" }, { IROp::FpCtrlToReg, "FpCtrlToReg", "G" }, @@ -126,6 +126,7 @@ static const IRMeta irMeta[] = { { IROp::FCmpVfpuAggregate, "FCmpVfpuAggregate", "I" }, { IROp::Vec4Init, "Vec4Init", "Vv" }, { IROp::Vec4Shuffle, "Vec4Shuffle", "VVs" }, + { IROp::Vec4Blend, "Vec4Blend", "VVVC" }, { IROp::Vec4Mov, "Vec4Mov", "VV" }, { IROp::Vec4Add, "Vec4Add", "VVV" }, { IROp::Vec4Sub, "Vec4Sub", "VVV" }, @@ -328,14 +329,20 @@ void DisassembleIR(char *buf, size_t bufsize, IRInst inst) { char bufDst[16]; char bufSrc1[16]; char bufSrc2[16]; + // Only really used for constant. + char bufSrc3[16]; DisassembleParam(bufDst, sizeof(bufDst) - 2, inst.dest, meta->types[0], inst.constant); DisassembleParam(bufSrc1, sizeof(bufSrc1) - 2, inst.src1, meta->types[1], inst.constant); DisassembleParam(bufSrc2, sizeof(bufSrc2), inst.src2, meta->types[2], inst.constant); + DisassembleParam(bufSrc3, sizeof(bufSrc3), inst.src3, meta->types[3], inst.constant); if (meta->types[1] && meta->types[0] != '_') { strcat(bufDst, ", "); } if (meta->types[2] && meta->types[1] != '_') { strcat(bufSrc1, ", "); } - snprintf(buf, bufsize, "%s %s%s%s", meta->name, bufDst, bufSrc1, bufSrc2); + if (meta->types[3] && meta->types[2] != '_') { + strcat(bufSrc2, ", "); + } + snprintf(buf, bufsize, "%s %s%s%s%s", meta->name, bufDst, bufSrc1, bufSrc2, bufSrc3); } diff --git a/Core/MIPS/IR/IRInst.h b/Core/MIPS/IR/IRInst.h index 795dc75233..dd93ed823b 100644 --- a/Core/MIPS/IR/IRInst.h +++ b/Core/MIPS/IR/IRInst.h @@ -138,12 +138,12 @@ enum class IROp : u8 { FSat0_1, FSatMinus1_1, + FpCondFromReg, FpCondToReg, FpCtrlFromReg, FpCtrlToReg, VfpuCtrlToReg, - ZeroFpCond, FCmp, FCmovVfpuCC, @@ -164,6 +164,7 @@ enum class IROp : u8 { // support SIMD. Vec4Init, Vec4Shuffle, + Vec4Blend, Vec4Mov, Vec4Add, Vec4Sub, @@ -330,7 +331,7 @@ enum IRFlags { struct IRMeta { IROp op; const char *name; - const char types[4]; // GGG + const char types[5]; // GGG u32 flags; }; diff --git a/Core/MIPS/IR/IRInterpreter.cpp b/Core/MIPS/IR/IRInterpreter.cpp index aee5c500e8..1beed06f8d 100644 --- a/Core/MIPS/IR/IRInterpreter.cpp +++ b/Core/MIPS/IR/IRInterpreter.cpp @@ -307,11 +307,20 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, int count) { { // Can't use the SSE shuffle here because it takes an immediate. pshufb with a table would work though, // or a big switch - there are only 256 shuffles possible (4^4) + float temp[4]; for (int i = 0; i < 4; i++) - mips->f[inst->dest + i] = mips->f[inst->src1 + ((inst->src2 >> (i * 2)) & 3)]; + temp[i] = mips->f[inst->src1 + ((inst->src2 >> (i * 2)) & 3)]; + for (int i = 0; i < 4; i++) + mips->f[inst->dest + i] = temp[i]; break; } + case IROp::Vec4Blend: + // Could use _mm_blendv_ps (SSE4+BMI), vbslq_f32 (ARM), __riscv_vmerge_vvm (RISC-V) + for (int i = 0; i < 4; i++) + mips->f[inst->dest + i] = ((inst->constant >> i) & 1) ? mips->f[inst->src2 + i] : mips->f[inst->src1 + i]; + break; + case IROp::Vec4Mov: { #if defined(_M_SSE) @@ -841,6 +850,9 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, int count) { break; } + case IROp::FpCondFromReg: + mips->fpcond = mips->r[inst->dest]; + break; case IROp::FpCondToReg: mips->r[inst->dest] = mips->fpcond; break; @@ -992,10 +1004,6 @@ u32 IRInterpret(MIPSState *mips, const IRInst *inst, int count) { break; } - case IROp::ZeroFpCond: - mips->fpcond = 0; - break; - case IROp::FMovFromGPR: memcpy(&mips->f[inst->dest], &mips->r[inst->src1], 4); break; diff --git a/Core/MIPS/IR/IRJit.cpp b/Core/MIPS/IR/IRJit.cpp index 039b8ee197..3f33f52fec 100644 --- a/Core/MIPS/IR/IRJit.cpp +++ b/Core/MIPS/IR/IRJit.cpp @@ -35,8 +35,9 @@ #include "Core/MIPS/MIPSInt.h" #include "Core/MIPS/MIPSTables.h" #include "Core/MIPS/IR/IRRegCache.h" -#include "Core/MIPS/IR/IRJit.h" #include "Core/MIPS/IR/IRInterpreter.h" +#include "Core/MIPS/IR/IRJit.h" +#include "Core/MIPS/IR/IRNativeCommon.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/Reporting.h" @@ -72,7 +73,12 @@ void IRJit::ClearCache() { } void IRJit::InvalidateCacheAt(u32 em_address, int length) { - blocks_.InvalidateICache(em_address, length); + std::vector numbers = blocks_.FindInvalidatedBlockNumbers(em_address, length); + for (int block_num : numbers) { + auto block = blocks_.GetBlock(block_num); + int cookie = block->GetTargetOffset() < 0 ? block_num : block->GetTargetOffset(); + block->Destroy(cookie); + } } void IRJit::Compile(u32 em_address) { @@ -88,6 +94,7 @@ void IRJit::Compile(u32 em_address) { b->Finalize(cookie); if (b->IsValid()) { // Success, we're done. + FinalizeTargetBlock(b, block_num); return; } } @@ -135,6 +142,8 @@ bool IRJit::CompileBlock(u32 em_address, std::vector &instructions, u32 return false; // Overwrites the first instruction, and also updates stats. blocks_.FinalizeBlock(block_num, preload); + if (!preload) + FinalizeTargetBlock(b, block_num); return true; } @@ -271,10 +280,11 @@ void IRBlockCache::Clear() { byPage_.clear(); } -void IRBlockCache::InvalidateICache(u32 address, u32 length) { +std::vector IRBlockCache::FindInvalidatedBlockNumbers(u32 address, u32 length) { u32 startPage = AddressToPage(address); u32 endPage = AddressToPage(address + length); + std::vector found; for (u32 page = startPage; page <= endPage; ++page) { const auto iter = byPage_.find(page); if (iter == byPage_.end()) @@ -284,11 +294,12 @@ void IRBlockCache::InvalidateICache(u32 address, u32 length) { for (int i : blocksInPage) { if (blocks_[i].OverlapsRange(address, length)) { // Not removing from the page, hopefully doesn't build up with small recompiles. - int cookie = blocks_[i].GetTargetOffset() < 0 ? i : blocks_[i].GetTargetOffset(); - blocks_[i].Destroy(cookie); + found.push_back(i); } } } + + return found; } void IRBlockCache::FinalizeBlock(int i, bool preload) { @@ -321,10 +332,7 @@ int IRBlockCache::FindPreloadBlock(u32 em_address) { const std::vector &blocksInPage = iter->second; for (int i : blocksInPage) { - u32 start, mipsBytes; - blocks_[i].GetRange(start, mipsBytes); - - if (start == em_address) { + if (blocks_[i].GetOriginalStart() == em_address) { if (blocks_[i].HashMatches()) { return i; } @@ -446,9 +454,7 @@ int IRBlockCache::GetBlockNumberFromStartAddress(u32 em_address, bool realBlocks const std::vector &blocksInPage = iter->second; int best = -1; for (int i : blocksInPage) { - uint32_t start, size; - blocks_[i].GetRange(start, size); - if (start == em_address) { + if (blocks_[i].GetOriginalStart() == em_address) { best = i; if (blocks_[i].IsValid()) { return i; diff --git a/Core/MIPS/IR/IRJit.h b/Core/MIPS/IR/IRJit.h index 35387e7e44..cd751ba7df 100644 --- a/Core/MIPS/IR/IRJit.h +++ b/Core/MIPS/IR/IRJit.h @@ -90,6 +90,9 @@ public: start = origAddr_; size = origSize_; } + u32 GetOriginalStart() const { + return origAddr_; + } void Finalize(int number); void Destroy(int number); @@ -110,7 +113,7 @@ class IRBlockCache : public JitBlockCacheDebugInterface { public: IRBlockCache() {} void Clear(); - void InvalidateICache(u32 address, u32 length); + std::vector FindInvalidatedBlockNumbers(u32 address, u32 length); void FinalizeBlock(int i, bool preload = false); int GetNumBlocks() const override { return (int)blocks_.size(); } int AllocateBlock(int emAddr) { @@ -124,6 +127,13 @@ public: return nullptr; } } + const IRBlock *GetBlock(int i) const { + if (i >= 0 && i < (int)blocks_.size()) { + return &blocks_[i]; + } else { + return nullptr; + } + } int FindPreloadBlock(u32 em_address); int FindByCookie(int cookie); @@ -180,8 +190,9 @@ public: void UnlinkBlock(u8 *checkedEntry, u32 originalAddress) override; protected: - virtual bool CompileBlock(u32 em_address, std::vector &instructions, u32 &mipsBytes, bool preload); + bool CompileBlock(u32 em_address, std::vector &instructions, u32 &mipsBytes, bool preload); virtual bool CompileTargetBlock(IRBlock *block, int block_num, bool preload) { return true; } + virtual void FinalizeTargetBlock(IRBlock *block, int block_num) {} JitOptions jo; diff --git a/Core/MIPS/IR/IRNativeCommon.cpp b/Core/MIPS/IR/IRNativeCommon.cpp new file mode 100644 index 0000000000..1483a29839 --- /dev/null +++ b/Core/MIPS/IR/IRNativeCommon.cpp @@ -0,0 +1,677 @@ +// Copyright (c) 2023- PPSSPP Project. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 2.0 or later versions. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official git repository and contact information can be found at +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. + +#include "Common/Profiler/Profiler.h" +#include "Common/StringUtils.h" +#include "Common/TimeUtil.h" +#include "Core/MIPS/MIPSTables.h" +#include "Core/MIPS/IR/IRNativeCommon.h" + +using namespace MIPSComp; + +namespace MIPSComp { + +// Compile time flag to enable debug stats for not compiled ops. +static constexpr bool enableDebugStats = false; + +// Used only for debugging when enableDebug is true above. +static std::map debugSeenNotCompiledIR; +static std::map debugSeenNotCompiled; +static double lastDebugStatsLog = 0.0; + +static void LogDebugStats() { + if (!enableDebugStats) + return; + + double now = time_now_d(); + if (now < lastDebugStatsLog + 1.0) + return; + lastDebugStatsLog = now; + + int worstIROp = -1; + int worstIRVal = 0; + for (auto it : debugSeenNotCompiledIR) { + if (it.second > worstIRVal) { + worstIRVal = it.second; + worstIROp = it.first; + } + } + debugSeenNotCompiledIR.clear(); + + const char *worstName = nullptr; + int worstVal = 0; + for (auto it : debugSeenNotCompiled) { + if (it.second > worstVal) { + worstVal = it.second; + worstName = it.first; + } + } + debugSeenNotCompiled.clear(); + + if (worstIROp != -1) + WARN_LOG(JIT, "Most not compiled IR op: %s (%d)", GetIRMeta((IROp)worstIROp)->name, worstIRVal); + if (worstName != nullptr) + WARN_LOG(JIT, "Most not compiled op: %s (%d)", worstName, worstVal); +} + +bool IRNativeBackend::DebugStatsEnabled() const { + return enableDebugStats; +} + +void IRNativeBackend::NotifyMIPSInterpret(const char *name) { + _assert_(enableDebugStats); + debugSeenNotCompiled[name]++; +} + +void IRNativeBackend::DoMIPSInst(uint32_t value) { + MIPSOpcode op; + memcpy(&op, &value, sizeof(op)); + + if constexpr (enableDebugStats) + debugSeenNotCompiled[MIPSGetName(op)]++; + + MIPSInterpret(op); +} + +uint32_t IRNativeBackend::DoIRInst(uint64_t value) { + IRInst inst; + memcpy(&inst, &value, sizeof(inst)); + + if constexpr (enableDebugStats) + debugSeenNotCompiledIR[(uint8_t)inst.op]++; + + return IRInterpret(currentMIPS, &inst, 1); +} + +IRNativeBackend::IRNativeBackend(IRBlockCache &blocks) : blocks_(blocks) {} + +void IRNativeBackend::CompileIRInst(IRInst inst) { + switch (inst.op) { + case IROp::Nop: + break; + + case IROp::SetConst: + case IROp::SetConstF: + case IROp::Downcount: + case IROp::SetPC: + case IROp::SetPCConst: + CompIR_Basic(inst); + break; + + case IROp::Add: + case IROp::Sub: + case IROp::AddConst: + case IROp::SubConst: + case IROp::Neg: + CompIR_Arith(inst); + break; + + case IROp::And: + case IROp::Or: + case IROp::Xor: + case IROp::AndConst: + case IROp::OrConst: + case IROp::XorConst: + case IROp::Not: + CompIR_Logic(inst); + break; + + case IROp::Mov: + case IROp::Ext8to32: + case IROp::Ext16to32: + CompIR_Assign(inst); + break; + + case IROp::ReverseBits: + case IROp::BSwap16: + case IROp::BSwap32: + case IROp::Clz: + CompIR_Bits(inst); + break; + + case IROp::Shl: + case IROp::Shr: + case IROp::Sar: + case IROp::Ror: + case IROp::ShlImm: + case IROp::ShrImm: + case IROp::SarImm: + case IROp::RorImm: + CompIR_Shift(inst); + break; + + case IROp::Slt: + case IROp::SltConst: + case IROp::SltU: + case IROp::SltUConst: + CompIR_Compare(inst); + break; + + case IROp::MovZ: + case IROp::MovNZ: + case IROp::Max: + case IROp::Min: + CompIR_CondAssign(inst); + break; + + case IROp::MtLo: + case IROp::MtHi: + case IROp::MfLo: + case IROp::MfHi: + CompIR_HiLo(inst); + break; + + case IROp::Mult: + case IROp::MultU: + case IROp::Madd: + case IROp::MaddU: + case IROp::Msub: + case IROp::MsubU: + CompIR_Mult(inst); + break; + + case IROp::Div: + case IROp::DivU: + CompIR_Div(inst); + break; + + case IROp::Load8: + case IROp::Load8Ext: + case IROp::Load16: + case IROp::Load16Ext: + case IROp::Load32: + case IROp::Load32Linked: + CompIR_Load(inst); + break; + + case IROp::Load32Left: + case IROp::Load32Right: + CompIR_LoadShift(inst); + break; + + case IROp::LoadFloat: + CompIR_FLoad(inst); + break; + + case IROp::LoadVec4: + CompIR_VecLoad(inst); + break; + + case IROp::Store8: + case IROp::Store16: + case IROp::Store32: + CompIR_Store(inst); + break; + + case IROp::Store32Conditional: + CompIR_CondStore(inst); + break; + + case IROp::Store32Left: + case IROp::Store32Right: + CompIR_StoreShift(inst); + break; + + case IROp::StoreFloat: + CompIR_FStore(inst); + break; + + case IROp::StoreVec4: + CompIR_VecStore(inst); + break; + + case IROp::FAdd: + case IROp::FSub: + case IROp::FMul: + case IROp::FDiv: + case IROp::FSqrt: + case IROp::FNeg: + CompIR_FArith(inst); + break; + + case IROp::FMin: + case IROp::FMax: + CompIR_FCondAssign(inst); + break; + + case IROp::FMov: + case IROp::FAbs: + case IROp::FSign: + CompIR_FAssign(inst); + break; + + case IROp::FRound: + case IROp::FTrunc: + case IROp::FCeil: + case IROp::FFloor: + CompIR_FRound(inst); + break; + + case IROp::FCvtWS: + case IROp::FCvtSW: + case IROp::FCvtScaledWS: + case IROp::FCvtScaledSW: + CompIR_FCvt(inst); + break; + + case IROp::FSat0_1: + case IROp::FSatMinus1_1: + CompIR_FSat(inst); + break; + + case IROp::FCmp: + case IROp::FCmovVfpuCC: + case IROp::FCmpVfpuBit: + case IROp::FCmpVfpuAggregate: + CompIR_FCompare(inst); + break; + + case IROp::RestoreRoundingMode: + case IROp::ApplyRoundingMode: + case IROp::UpdateRoundingMode: + CompIR_RoundingMode(inst); + break; + + case IROp::SetCtrlVFPU: + case IROp::SetCtrlVFPUReg: + case IROp::SetCtrlVFPUFReg: + case IROp::FpCondFromReg: + case IROp::FpCondToReg: + case IROp::FpCtrlFromReg: + case IROp::FpCtrlToReg: + case IROp::VfpuCtrlToReg: + case IROp::FMovFromGPR: + case IROp::FMovToGPR: + CompIR_Transfer(inst); + break; + + case IROp::Vec4Init: + case IROp::Vec4Shuffle: + case IROp::Vec4Blend: + case IROp::Vec4Mov: + CompIR_VecAssign(inst); + break; + + case IROp::Vec4Add: + case IROp::Vec4Sub: + case IROp::Vec4Mul: + case IROp::Vec4Div: + case IROp::Vec4Scale: + case IROp::Vec4Neg: + case IROp::Vec4Abs: + CompIR_VecArith(inst); + break; + + case IROp::Vec4Dot: + CompIR_VecHoriz(inst); + break; + + case IROp::Vec2Unpack16To31: + case IROp::Vec2Unpack16To32: + case IROp::Vec4Unpack8To32: + case IROp::Vec4DuplicateUpperBitsAndShift1: + case IROp::Vec4Pack31To8: + case IROp::Vec4Pack32To8: + case IROp::Vec2Pack31To16: + case IROp::Vec2Pack32To16: + CompIR_VecPack(inst); + break; + + case IROp::Vec4ClampToZero: + case IROp::Vec2ClampToZero: + CompIR_VecClamp(inst); + break; + + case IROp::FSin: + case IROp::FCos: + case IROp::FRSqrt: + case IROp::FRecip: + case IROp::FAsin: + CompIR_FSpecial(inst); + break; + + case IROp::Interpret: + CompIR_Interpret(inst); + break; + + case IROp::Syscall: + case IROp::CallReplacement: + case IROp::Break: + CompIR_System(inst); + break; + + case IROp::Breakpoint: + case IROp::MemoryCheck: + CompIR_Breakpoint(inst); + break; + + case IROp::ValidateAddress8: + case IROp::ValidateAddress16: + case IROp::ValidateAddress32: + case IROp::ValidateAddress128: + CompIR_ValidateAddress(inst); + break; + + case IROp::ExitToConst: + case IROp::ExitToReg: + case IROp::ExitToPC: + CompIR_Exit(inst); + break; + + case IROp::ExitToConstIfEq: + case IROp::ExitToConstIfNeq: + case IROp::ExitToConstIfGtZ: + case IROp::ExitToConstIfGeZ: + case IROp::ExitToConstIfLtZ: + case IROp::ExitToConstIfLeZ: + case IROp::ExitToConstIfFpTrue: + case IROp::ExitToConstIfFpFalse: + CompIR_ExitIf(inst); + break; + + default: + _assert_msg_(false, "Unexpected IR op %d", (int)inst.op); + CompIR_Generic(inst); + break; + } +} + +IRNativeJit::IRNativeJit(MIPSState *mipsState) + : IRJit(mipsState), debugInterface_(blocks_) {} + +void IRNativeJit::Init(IRNativeBackend &backend) { + backend_ = &backend; + debugInterface_.Init(backend_); + backend_->GenerateFixedCode(mips_); + + // Wanted this to be a reference, but vtbls get in the way. Shouldn't change. + hooks_ = backend.GetNativeHooks(); +} + +bool IRNativeJit::CompileTargetBlock(IRBlock *block, int block_num, bool preload) { + return backend_->CompileBlock(block, block_num, preload); +} + +void IRNativeJit::FinalizeTargetBlock(IRBlock *block, int block_num) { + backend_->FinalizeBlock(block, block_num, jo); +} + +void IRNativeJit::RunLoopUntil(u64 globalticks) { + if constexpr (enableDebugStats) { + LogDebugStats(); + } + + PROFILE_THIS_SCOPE("jit"); + hooks_.enterDispatcher(); +} + +void IRNativeJit::ClearCache() { + IRJit::ClearCache(); + backend_->ClearAllBlocks(); +} + +void IRNativeJit::InvalidateCacheAt(u32 em_address, int length) { + std::vector numbers = blocks_.FindInvalidatedBlockNumbers(em_address, length); + for (int block_num : numbers) { + auto block = blocks_.GetBlock(block_num); + if (em_address != 0 || length < 0x1FFFFFFF) { + backend_->InvalidateBlock(block, block_num); + } + block->Destroy(block->GetTargetOffset()); + } + + if (em_address == 0 && length >= 0x1FFFFFFF) { + backend_->ClearAllBlocks(); + } +} + +bool IRNativeJit::DescribeCodePtr(const u8 *ptr, std::string &name) { + if (ptr != nullptr && backend_->DescribeCodePtr(ptr, name)) + return true; + + int offset = backend_->OffsetFromCodePtr(ptr); + if (offset == -1) + return false; + + int block_num = -1; + for (int i = 0; i < blocks_.GetNumBlocks(); ++i) { + const auto &b = blocks_.GetBlock(i); + // We allocate linearly. + if (b->GetTargetOffset() <= offset) + block_num = i; + if (b->GetTargetOffset() > offset) + break; + } + + if (block_num == -1) { + name = "(unknown or deleted block)"; + return true; + } + + const IRBlock *block = blocks_.GetBlock(block_num); + if (block) { + u32 start = 0, size = 0; + block->GetRange(start, size); + name = StringFromFormat("(block %d at %08x)", block_num, start); + return true; + } + return false; +} + +bool IRNativeJit::CodeInRange(const u8 *ptr) const { + return backend_->CodeInRange(ptr); +} + +bool IRNativeJit::IsAtDispatchFetch(const u8 *ptr) const { + return ptr == backend_->GetNativeHooks().dispatchFetch; +} + +const u8 *IRNativeJit::GetDispatcher() const { + return backend_->GetNativeHooks().dispatcher; +} + +const u8 *IRNativeJit::GetCrashHandler() const { + return backend_->GetNativeHooks().crashHandler; +} + +JitBlockCacheDebugInterface *IRNativeJit::GetBlockCacheDebugInterface() { + return &debugInterface_; +} + +bool IRNativeBackend::CodeInRange(const u8 *ptr) const { + return CodeBlock().IsInSpace(ptr); +} + +bool IRNativeBackend::DescribeCodePtr(const u8 *ptr, std::string &name) const { + if (!CodeBlock().IsInSpace(ptr)) + return false; + + // Used in disassembly viewer. + if (ptr == (const uint8_t *)hooks_.enterDispatcher) { + name = "enterDispatcher"; + } else if (ptr == hooks_.dispatcher) { + name = "dispatcher"; + } else if (ptr == hooks_.dispatchFetch) { + name = "dispatchFetch"; + } else if (ptr == hooks_.crashHandler) { + name = "crashHandler"; + } else { + return false; + } + return true; +} + +int IRNativeBackend::OffsetFromCodePtr(const u8 *ptr) { + auto &codeBlock = CodeBlock(); + if (!codeBlock.IsInSpace(ptr)) + return -1; + return (int)codeBlock.GetOffset(ptr); +} + +void IRNativeBackend::FinalizeBlock(IRBlock *block, int block_num, const JitOptions &jo) { + if (jo.enableBlocklink) { + uint32_t pc = block->GetOriginalStart(); + + // First, link other blocks to this one now that it's finalized. + auto incoming = linksTo_.equal_range(pc); + for (auto it = incoming.first; it != incoming.second; ++it) { + auto &exits = nativeBlocks_[it->second].exits; + for (auto &blockExit : exits) { + if (blockExit.dest == pc) + OverwriteExit(blockExit.offset, blockExit.len, block_num); + } + } + + // And also any blocks from this one, in case we're finalizing it later. + auto &outgoing = nativeBlocks_[block_num].exits; + for (auto &blockExit : outgoing) { + int dstBlockNum = blocks_.GetBlockNumberFromStartAddress(blockExit.dest); + const IRNativeBlock *nativeBlock = GetNativeBlock(dstBlockNum); + if (nativeBlock) + OverwriteExit(blockExit.offset, blockExit.len, dstBlockNum); + } + } +} + +const IRNativeBlock *IRNativeBackend::GetNativeBlock(int block_num) const { + if (block_num < 0 || block_num >= (int)nativeBlocks_.size()) + return nullptr; + return &nativeBlocks_[block_num]; +} + +void IRNativeBackend::SetBlockCheckedOffset(int block_num, int offset) { + if (block_num >= (int)nativeBlocks_.size()) + nativeBlocks_.resize(block_num + 1); + + nativeBlocks_[block_num].checkedOffset = offset; +} + +void IRNativeBackend::AddLinkableExit(int block_num, uint32_t pc, int exitStartOffset, int exitLen) { + linksTo_.insert(std::make_pair(pc, block_num)); + + if (block_num >= (int)nativeBlocks_.size()) + nativeBlocks_.resize(block_num + 1); + IRNativeBlockExit blockExit; + blockExit.offset = exitStartOffset; + blockExit.len = exitLen; + blockExit.dest = pc; + nativeBlocks_[block_num].exits.push_back(blockExit); +} + +void IRNativeBackend::EraseAllLinks(int block_num) { + if (block_num == -1) { + linksTo_.clear(); + nativeBlocks_.clear(); + } else { + linksTo_.erase(block_num); + if (block_num < (int)nativeBlocks_.size()) + nativeBlocks_[block_num].exits.clear(); + } +} + +IRNativeBlockCacheDebugInterface::IRNativeBlockCacheDebugInterface(const IRBlockCache &irBlocks) + : irBlocks_(irBlocks) {} + +void IRNativeBlockCacheDebugInterface::Init(const IRNativeBackend *backend) { + codeBlock_ = &backend->CodeBlock(); + backend_ = backend; +} + +int IRNativeBlockCacheDebugInterface::GetNumBlocks() const { + return irBlocks_.GetNumBlocks(); +} + +int IRNativeBlockCacheDebugInterface::GetBlockNumberFromStartAddress(u32 em_address, bool realBlocksOnly) const { + return irBlocks_.GetBlockNumberFromStartAddress(em_address, realBlocksOnly); +} + +void IRNativeBlockCacheDebugInterface::GetBlockCodeRange(int blockNum, int *startOffset, int *size) const { + int blockOffset = irBlocks_.GetBlock(blockNum)->GetTargetOffset(); + int endOffset = backend_->GetNativeBlock(blockNum)->checkedOffset; + + // If endOffset is before, the checked entry is before the block start. + if (endOffset < blockOffset) { + // We assume linear allocation. Maybe a bit dangerous, should always be right. + if (blockNum + 1 >= GetNumBlocks()) { + // Last block, get from current code pointer. + endOffset = (int)codeBlock_->GetOffset(codeBlock_->GetCodePtr()); + } else { + endOffset = irBlocks_.GetBlock(blockNum + 1)->GetTargetOffset(); + _assert_msg_(endOffset >= blockOffset, "Next block not sequential, block=%d/%08x, next=%d/%08x", blockNum, blockOffset, blockNum + 1, endOffset); + } + } + + *startOffset = blockOffset; + *size = endOffset - blockOffset; +} + +JitBlockDebugInfo IRNativeBlockCacheDebugInterface::GetBlockDebugInfo(int blockNum) const { + JitBlockDebugInfo debugInfo = irBlocks_.GetBlockDebugInfo(blockNum); + + int blockOffset, codeSize; + GetBlockCodeRange(blockNum, &blockOffset, &codeSize); + + const u8 *blockStart = codeBlock_->GetBasePtr() + blockOffset; +#if PPSSPP_ARCH(ARM) + debugInfo.targetDisasm = DisassembleArm2(blockStart, codeSize); +#elif PPSSPP_ARCH(ARM64) + debugInfo.targetDisasm = DisassembleArm64(blockStart, codeSize); +#elif PPSSPP_ARCH(X86) || PPSSPP_ARCH(AMD64) + debugInfo.targetDisasm = DisassembleX86(blockStart, codeSize); +#elif PPSSPP_ARCH(RISCV64) + debugInfo.targetDisasm = DisassembleRV64(blockStart, codeSize); +#endif + return debugInfo; +} + +void IRNativeBlockCacheDebugInterface::ComputeStats(BlockCacheStats &bcStats) const { + double totalBloat = 0.0; + double maxBloat = 0.0; + double minBloat = 1000000000.0; + int numBlocks = GetNumBlocks(); + for (int i = 0; i < numBlocks; ++i) { + const IRBlock &b = *irBlocks_.GetBlock(i); + + // Native size, not IR size. + int blockOffset, codeSize; + GetBlockCodeRange(i, &blockOffset, &codeSize); + if (codeSize == 0) + continue; + + // MIPS (PSP) size. + u32 origAddr, origSize; + b.GetRange(origAddr, origSize); + + double bloat = (double)codeSize / (double)origSize; + if (bloat < minBloat) { + minBloat = bloat; + bcStats.minBloatBlock = origAddr; + } + if (bloat > maxBloat) { + maxBloat = bloat; + bcStats.maxBloatBlock = origAddr; + } + totalBloat += bloat; + bcStats.bloatMap[(float)bloat] = origAddr; + } + bcStats.numBlocks = numBlocks; + bcStats.minBloat = (float)minBloat; + bcStats.maxBloat = (float)maxBloat; + bcStats.avgBloat = (float)(totalBloat / (double)numBlocks); +} + +} // namespace MIPSComp diff --git a/Core/MIPS/IR/IRNativeCommon.h b/Core/MIPS/IR/IRNativeCommon.h new file mode 100644 index 0000000000..cef2c593e3 --- /dev/null +++ b/Core/MIPS/IR/IRNativeCommon.h @@ -0,0 +1,183 @@ +// Copyright (c) 2023- PPSSPP Project. + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 2.0 or later versions. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License 2.0 for more details. + +// A copy of the GPL 2.0 should have been included with the program. +// If not, see http://www.gnu.org/licenses/ + +// Official git repository and contact information can be found at +// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. + +#include +#include "Core/MIPS/IR/IRJit.h" +#include "Core/MIPS/JitCommon/JitBlockCache.h" + +namespace MIPSComp { + +typedef void (*IRNativeFuncNoArg)(); + +struct IRNativeHooks { + IRNativeFuncNoArg enterDispatcher = nullptr; + + const uint8_t *dispatcher = nullptr; + const uint8_t *dispatchFetch = nullptr; + const uint8_t *crashHandler = nullptr; +}; + +struct IRNativeBlockExit { + int offset; + int len; + uint32_t dest; +}; + +struct IRNativeBlock { + int checkedOffset = 0; + std::vector exits; +}; + +class IRNativeBackend { +public: + IRNativeBackend(IRBlockCache &blocks); + virtual ~IRNativeBackend() {} + + void CompileIRInst(IRInst inst); + + virtual bool DescribeCodePtr(const u8 *ptr, std::string &name) const; + bool CodeInRange(const u8 *ptr) const; + int OffsetFromCodePtr(const u8 *ptr); + + virtual void GenerateFixedCode(MIPSState *mipsState) = 0; + virtual bool CompileBlock(IRBlock *block, int block_num, bool preload) = 0; + virtual void ClearAllBlocks() = 0; + virtual void InvalidateBlock(IRBlock *block, int block_num) = 0; + void FinalizeBlock(IRBlock *block, int block_num, const JitOptions &jo); + + const IRNativeHooks &GetNativeHooks() const { + return hooks_; + } + + const IRNativeBlock *GetNativeBlock(int block_num) const; + void SetBlockCheckedOffset(int block_num, int offset); + + virtual const CodeBlockCommon &CodeBlock() const = 0; + +protected: + virtual void CompIR_Arith(IRInst inst) = 0; + virtual void CompIR_Assign(IRInst inst) = 0; + virtual void CompIR_Basic(IRInst inst) = 0; + virtual void CompIR_Bits(IRInst inst) = 0; + virtual void CompIR_Breakpoint(IRInst inst) = 0; + virtual void CompIR_Compare(IRInst inst) = 0; + virtual void CompIR_CondAssign(IRInst inst) = 0; + virtual void CompIR_CondStore(IRInst inst) = 0; + virtual void CompIR_Div(IRInst inst) = 0; + virtual void CompIR_Exit(IRInst inst) = 0; + virtual void CompIR_ExitIf(IRInst inst) = 0; + virtual void CompIR_FArith(IRInst inst) = 0; + virtual void CompIR_FAssign(IRInst inst) = 0; + virtual void CompIR_FCompare(IRInst inst) = 0; + virtual void CompIR_FCondAssign(IRInst inst) = 0; + virtual void CompIR_FCvt(IRInst inst) = 0; + virtual void CompIR_FLoad(IRInst inst) = 0; + virtual void CompIR_FRound(IRInst inst) = 0; + virtual void CompIR_FSat(IRInst inst) = 0; + virtual void CompIR_FSpecial(IRInst inst) = 0; + virtual void CompIR_FStore(IRInst inst) = 0; + virtual void CompIR_Generic(IRInst inst) = 0; + virtual void CompIR_HiLo(IRInst inst) = 0; + virtual void CompIR_Interpret(IRInst inst) = 0; + virtual void CompIR_Load(IRInst inst) = 0; + virtual void CompIR_LoadShift(IRInst inst) = 0; + virtual void CompIR_Logic(IRInst inst) = 0; + virtual void CompIR_Mult(IRInst inst) = 0; + virtual void CompIR_RoundingMode(IRInst inst) = 0; + virtual void CompIR_Shift(IRInst inst) = 0; + virtual void CompIR_Store(IRInst inst) = 0; + virtual void CompIR_StoreShift(IRInst inst) = 0; + virtual void CompIR_System(IRInst inst) = 0; + virtual void CompIR_Transfer(IRInst inst) = 0; + virtual void CompIR_VecArith(IRInst inst) = 0; + virtual void CompIR_VecAssign(IRInst inst) = 0; + virtual void CompIR_VecClamp(IRInst inst) = 0; + virtual void CompIR_VecHoriz(IRInst inst) = 0; + virtual void CompIR_VecLoad(IRInst inst) = 0; + virtual void CompIR_VecPack(IRInst inst) = 0; + virtual void CompIR_VecStore(IRInst inst) = 0; + virtual void CompIR_ValidateAddress(IRInst inst) = 0; + + virtual void OverwriteExit(int srcOffset, int len, int block_num) = 0; + + // Returns true when debugging statistics should be compiled in. + bool DebugStatsEnabled() const; + + // Callback (compile when DebugStatsEnabled()) to log a base interpreter hit. + // Call the func returned by MIPSGetInterpretFunc(op) directly for interpret. + static void NotifyMIPSInterpret(const char *name); + + // Callback to log AND perform a base interpreter op. Alternative to NotifyMIPSInterpret(). + static void DoMIPSInst(uint32_t op); + + // Callback to log AND perform an IR interpreter inst. Returns 0 or a PC to jump to. + static uint32_t DoIRInst(uint64_t inst); + + void AddLinkableExit(int block_num, uint32_t pc, int exitStartOffset, int exitLen); + void EraseAllLinks(int block_num); + + IRNativeHooks hooks_; + IRBlockCache &blocks_; + std::vector nativeBlocks_; + std::unordered_multimap linksTo_; +}; + +class IRNativeBlockCacheDebugInterface : public JitBlockCacheDebugInterface { +public: + IRNativeBlockCacheDebugInterface(const MIPSComp::IRBlockCache &irBlocks); + void Init(const IRNativeBackend *backend); + int GetNumBlocks() const; + int GetBlockNumberFromStartAddress(u32 em_address, bool realBlocksOnly = true) const; + JitBlockDebugInfo GetBlockDebugInfo(int blockNum) const; + void ComputeStats(BlockCacheStats &bcStats) const; + +private: + void GetBlockCodeRange(int blockNum, int *startOffset, int *size) const; + + const MIPSComp::IRBlockCache &irBlocks_; + const CodeBlockCommon *codeBlock_ = nullptr; + const IRNativeBackend *backend_ = nullptr; +}; + +class IRNativeJit : public IRJit { +public: + IRNativeJit(MIPSState *mipsState); + + void RunLoopUntil(u64 globalticks) override; + + void ClearCache() override; + void InvalidateCacheAt(u32 em_address, int length = 4) override; + + bool DescribeCodePtr(const u8 *ptr, std::string &name) override; + bool CodeInRange(const u8 *ptr) const override; + bool IsAtDispatchFetch(const u8 *ptr) const override; + const u8 *GetDispatcher() const override; + const u8 *GetCrashHandler() const override; + + JitBlockCacheDebugInterface *GetBlockCacheDebugInterface() override; + +protected: + void Init(IRNativeBackend &backend); + bool CompileTargetBlock(IRBlock *block, int block_num, bool preload) override; + void FinalizeTargetBlock(IRBlock *block, int block_num) override; + + IRNativeBackend *backend_ = nullptr; + IRNativeHooks hooks_; + IRNativeBlockCacheDebugInterface debugInterface_; +}; + +} // namespace MIPSComp diff --git a/Core/MIPS/IR/IRPassSimplify.cpp b/Core/MIPS/IR/IRPassSimplify.cpp index c595d26ef9..3c020edd4f 100644 --- a/Core/MIPS/IR/IRPassSimplify.cpp +++ b/Core/MIPS/IR/IRPassSimplify.cpp @@ -418,9 +418,10 @@ bool RemoveLoadStoreLeftRight(const IRWriter &in, IRWriter &out, const IROptions bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts) { CONDITIONAL_DISABLE; - IRRegCache gpr(&out); + IRImmRegCache gpr(&out); bool logBlocks = false; + bool skipNextExitToConst = false; for (int i = 0; i < (int)in.GetInstructions().size(); i++) { IRInst inst = in.GetInstructions()[i]; bool symmetric = true; @@ -716,6 +717,20 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts break; case IROp::SetCtrlVFPU: + gpr.MapDirty(IRREG_VFPU_CTRL_BASE + inst.dest); + goto doDefault; + + case IROp::SetCtrlVFPUReg: + if (gpr.IsImm(inst.src1)) { + out.Write(IROp::SetCtrlVFPU, inst.dest, out.AddConstant(gpr.GetImm(inst.src1))); + } else { + gpr.MapDirtyIn(IRREG_VFPU_CTRL_BASE + inst.dest, inst.src1); + out.Write(inst); + } + break; + + case IROp::SetCtrlVFPUFReg: + gpr.MapDirty(IRREG_VFPU_CTRL_BASE + inst.dest); goto doDefault; case IROp::FCvtWS: @@ -725,6 +740,10 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts out.Write(inst); break; + case IROp::FpCondFromReg: + gpr.MapDirtyIn(IRREG_FPCOND, inst.src1); + out.Write(inst); + break; case IROp::FpCondToReg: if (gpr.IsImm(IRREG_FPCOND)) { gpr.SetImm(inst.dest, gpr.GetImm(IRREG_FPCOND)); @@ -750,6 +769,7 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts case IROp::Vec4Dot: case IROp::Vec4Scale: case IROp::Vec4Shuffle: + case IROp::Vec4Blend: case IROp::Vec4Neg: case IROp::Vec4Abs: case IROp::Vec4Pack31To8: @@ -763,7 +783,6 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts out.Write(inst); break; - case IROp::ZeroFpCond: case IROp::FCmp: gpr.MapDirty(IRREG_FPCOND); goto doDefault; @@ -777,20 +796,90 @@ bool PropagateConstants(const IRWriter &in, IRWriter &out, const IROptions &opts gpr.MapDirtyIn(inst.dest, IRREG_VFPU_CTRL_BASE + inst.src1); goto doDefault; + case IROp::FCmpVfpuBit: + gpr.MapDirty(IRREG_VFPU_CC); + goto doDefault; + + case IROp::FCmovVfpuCC: + gpr.MapIn(IRREG_VFPU_CC); + goto doDefault; + + case IROp::FCmpVfpuAggregate: + gpr.MapDirtyIn(IRREG_VFPU_CC, IRREG_VFPU_CC); + goto doDefault; + + case IROp::ExitToConstIfEq: + case IROp::ExitToConstIfNeq: + if (gpr.IsImm(inst.src1) && gpr.IsImm(inst.src2)) { + bool passed = false; + switch (inst.op) { + case IROp::ExitToConstIfEq: passed = gpr.GetImm(inst.src1) == gpr.GetImm(inst.src2); break; + case IROp::ExitToConstIfNeq: passed = gpr.GetImm(inst.src1) != gpr.GetImm(inst.src2); break; + default: _assert_(false); break; + } + + // This is a bit common for the first cycle of loops. + // Reduce bloat by skipping on fail, and const exit on pass. + if (passed) { + gpr.FlushAll(); + out.Write(IROp::ExitToConst, out.AddConstant(inst.constant)); + skipNextExitToConst = true; + } + break; + } + gpr.FlushAll(); + goto doDefault; + + case IROp::ExitToConstIfGtZ: + case IROp::ExitToConstIfGeZ: + case IROp::ExitToConstIfLtZ: + case IROp::ExitToConstIfLeZ: + if (gpr.IsImm(inst.src1)) { + bool passed = false; + switch (inst.op) { + case IROp::ExitToConstIfGtZ: passed = (s32)gpr.GetImm(inst.src1) > 0; break; + case IROp::ExitToConstIfGeZ: passed = (s32)gpr.GetImm(inst.src1) >= 0; break; + case IROp::ExitToConstIfLtZ: passed = (s32)gpr.GetImm(inst.src1) < 0; break; + case IROp::ExitToConstIfLeZ: passed = (s32)gpr.GetImm(inst.src1) <= 0; break; + default: _assert_(false); break; + } + + if (passed) { + gpr.FlushAll(); + out.Write(IROp::ExitToConst, out.AddConstant(inst.constant)); + skipNextExitToConst = true; + } + break; + } + gpr.FlushAll(); + goto doDefault; + + case IROp::ExitToConst: + if (skipNextExitToConst) { + skipNextExitToConst = false; + break; + } + gpr.FlushAll(); + goto doDefault; + + case IROp::ExitToReg: + if (gpr.IsImm(inst.src1)) { + // This happens sometimes near loops. + // Prefer ExitToConst to allow block linking. + u32 dest = gpr.GetImm(inst.src1); + gpr.FlushAll(); + out.Write(IROp::ExitToConst, out.AddConstant(dest)); + break; + } + gpr.FlushAll(); + goto doDefault; + case IROp::CallReplacement: case IROp::Break: case IROp::Syscall: case IROp::Interpret: - case IROp::ExitToConst: - case IROp::ExitToReg: - case IROp::ExitToConstIfEq: - case IROp::ExitToConstIfNeq: case IROp::ExitToConstIfFpFalse: case IROp::ExitToConstIfFpTrue: - case IROp::ExitToConstIfGeZ: - case IROp::ExitToConstIfGtZ: - case IROp::ExitToConstIfLeZ: - case IROp::ExitToConstIfLtZ: case IROp::Breakpoint: case IROp::MemoryCheck: default: @@ -855,11 +944,28 @@ bool PurgeTemps(const IRWriter &in, IRWriter &out, const IROptions &opts) { int index; // Whether the dest reg is read by any Exit. bool readByExit; + int8_t fplen = 0; }; std::vector checks; // This tracks the last index at which each reg was modified. int lastWrittenTo[256]; + int lastReadFrom[256]; memset(lastWrittenTo, -1, sizeof(lastWrittenTo)); + memset(lastReadFrom, -1, sizeof(lastReadFrom)); + + auto readsFromFPRCheck = [](IRInst &inst, Check &check, bool directly) { + if (check.reg < 32) + return false; + if (check.fplen >= 1 && IRReadsFromFPR(inst, check.reg - 32, directly)) + return true; + if (check.fplen >= 2 && IRReadsFromFPR(inst, check.reg - 32 + 1, directly)) + return true; + if (check.fplen >= 3 && IRReadsFromFPR(inst, check.reg - 32 + 2, directly)) + return true; + if (check.fplen >= 4 && IRReadsFromFPR(inst, check.reg - 32 + 3, directly)) + return true; + return false; + }; bool logBlocks = false; for (int i = 0, n = (int)in.GetInstructions().size(); i < n; i++) { @@ -912,6 +1018,82 @@ bool PurgeTemps(const IRWriter &in, IRWriter &out, const IROptions &opts) { // Legitimately read from, so we can't optimize out. check.reg = 0; } + } else if (readsFromFPRCheck(inst, check, false) && check.fplen >= 1) { + // If one or the other is a Vec, they must match. + bool lenMismatch = false; + + const IRMeta *m = GetIRMeta(inst.op); + auto checkMismatch = [&check, &lenMismatch](IRReg src, char type) { + int srclen = 1; + if (type == 'V') + srclen = 4; + else if (type == '2') + srclen = 2; + else if (type != 'F') + return; + + if (src + 32 + srclen > check.reg && src + 32 < check.reg + check.fplen) { + if (src + 32 != check.reg || srclen != check.fplen) + lenMismatch = true; + } + }; + + checkMismatch(inst.src1, m->types[1]); + checkMismatch(inst.src2, m->types[2]); + if ((m->flags & (IRFLAG_SRC3 | IRFLAG_SRC3DST)) != 0) + checkMismatch(inst.src3, m->types[3]); + + bool cannotReplace = !readsFromFPRCheck(inst, check, true) || lenMismatch; + if (!cannotReplace && check.srcReg >= 32 && lastWrittenTo[check.srcReg] < check.index) { + // This is probably not worth doing unless we can get rid of a temp. + if (!check.readByExit) { + if (insts[check.index].dest == inst.src1) + inst.src1 = check.srcReg - 32; + else if (insts[check.index].dest == inst.src2) + inst.src2 = check.srcReg - 32; + else + _assert_msg_(false, "Unexpected src3 read of FPR"); + + // Check if we've clobbered it entirely. + if (inst.dest == check.reg) { + check.reg = 0; + insts[check.index].op = IROp::Mov; + insts[check.index].dest = 0; + insts[check.index].src1 = 0; + } + } else { + // Let's not bother. + check.reg = 0; + } + } else if ((inst.op == IROp::FMov || inst.op == IROp::Vec4Mov) && !lenMismatch) { + // A swap could be profitable if this is a temp, and maybe in other cases. + // These can happen a lot from mask regs, etc. + // But make sure no other changes happened between. + bool destNotChanged = true; + for (int j = 0; j < check.fplen; ++j) + destNotChanged = destNotChanged && lastWrittenTo[inst.dest + 32 + j] < check.index; + + bool destNotRead = true; + for (int j = 0; j < check.fplen; ++j) + destNotRead = destNotRead && lastReadFrom[inst.dest + 32 + j] <= check.index; + + if (!check.readByExit && destNotChanged && destNotRead) { + _dbg_assert_(insts[check.index].dest == inst.src1); + insts[check.index].dest = inst.dest; + for (int j = 0; j < check.fplen; ++j) + lastWrittenTo[inst.dest + 32 + j] = check.index; + // If it's being read from (by inst now), we can't optimize out. + check.reg = 0; + // Swap the dest and src1 so we can optimize this out later, maybe. + std::swap(inst.dest, inst.src1); + } else { + // Doesn't look like a good candidate. + check.reg = 0; + } + } else { + // Legitimately read from, so we can't optimize out. + check.reg = 0; + } } else if (check.readByExit && (m->flags & IRFLAG_EXIT) != 0) { // This is an exit, and the reg is read by any exit. Clear it. check.reg = 0; @@ -922,6 +1104,21 @@ bool PurgeTemps(const IRWriter &in, IRWriter &out, const IROptions &opts) { insts[check.index].dest = 0; insts[check.index].src1 = 0; check.reg = 0; + } else if (IRWritesToFPR(inst, check.reg - 32) && check.fplen >= 1) { + IRReg destFPRs[4]; + int numFPRs = IRDestFPRs(inst, destFPRs); + + if (numFPRs == check.fplen && inst.dest + 32 == check.reg) { + // This means we've clobbered it, and with full overlap. + // Sometimes this happens for non-temps, i.e. vmmov + vinit last row. + insts[check.index].op = IROp::Mov; + insts[check.index].dest = 0; + insts[check.index].src1 = 0; + check.reg = 0; + } else { + // Since there's an overlap, we simply cannot optimize. + check.reg = 0; + } } } @@ -965,7 +1162,46 @@ bool PurgeTemps(const IRWriter &in, IRWriter &out, const IROptions &opts) { break; } - // TODO: VFPU temps? Especially for masked dregs. + IRReg regs[16]; + int readGPRs = IRReadsFromGPRs(inst, regs); + if (readGPRs == -1) { + for (int j = 0; j < 256; ++j) + lastReadFrom[j] = i; + } else { + for (int j = 0; j < readGPRs; ++j) + lastReadFrom[regs[j]] = i; + } + + int readFPRs = IRReadsFromFPRs(inst, regs); + if (readFPRs == -1) { + for (int j = 0; j < 256; ++j) + lastReadFrom[j] = i; + } else { + for (int j = 0; j < readFPRs; ++j) + lastReadFrom[regs[j] + 32] = i; + } + + int destFPRs = IRDestFPRs(inst, regs); + for (int j = 0; j < destFPRs; ++j) + lastWrittenTo[regs[j] + 32] = i; + + dest = destFPRs > 0 ? regs[0] + 32 : -1; + if (dest >= 32 && dest < IRTEMP_0) { + // Standard FPU or VFPU reg. + Check check(dest, i, true); + check.fplen = (int8_t)destFPRs; + checks.push_back(check); + } else if (dest >= IRVTEMP_PFX_S + 32 && dest < IRVTEMP_PFX_S + 32 + 16) { + // These are temporary regs and not read by exits. + Check check(dest, i, false); + check.fplen = (int8_t)destFPRs; + if (inst.op == IROp::FMov || inst.op == IROp::Vec4Mov) { + check.srcReg = inst.src1 + 32; + } + checks.push_back(check); + } else if (dest != -1) { + _assert_msg_(false, "Unexpected FPR output %d", dest); + } insts.push_back(inst); } @@ -1297,6 +1533,7 @@ bool ReorderLoadStore(const IRWriter &in, IRWriter &out, const IROptions &opts) case IROp::MtHi: case IROp::MtLo: + case IROp::FpCondFromReg: if (inst.src1 && otherRegs[inst.src1] != RegState::CHANGED) otherRegs[inst.src1] = RegState::READ; otherQueue.push_back(inst); @@ -1305,7 +1542,6 @@ bool ReorderLoadStore(const IRWriter &in, IRWriter &out, const IROptions &opts) case IROp::Nop: case IROp::Downcount: - case IROp::ZeroFpCond: if (queuing) { // These are freebies. Sometimes helps with delay slots. otherQueue.push_back(inst); diff --git a/Core/MIPS/IR/IRRegCache.cpp b/Core/MIPS/IR/IRRegCache.cpp index d731c51a74..ddd3677df4 100644 --- a/Core/MIPS/IR/IRRegCache.cpp +++ b/Core/MIPS/IR/IRRegCache.cpp @@ -1,63 +1,65 @@ #include +#include "Common/Log.h" #include "Core/MIPS/IR/IRRegCache.h" #include "Core/MIPS/IR/IRInst.h" -void IRRegCache::Flush(IRReg rd) { +void IRImmRegCache::Flush(IRReg rd) { if (rd == 0) { return; } if (reg_[rd].isImm) { + _assert_((rd > 0 && rd < 32) || (rd >= IRTEMP_0 && rd < IRREG_VFPU_CTRL_BASE)); ir_->WriteSetConstant(rd, reg_[rd].immVal); reg_[rd].isImm = false; } } -void IRRegCache::Discard(IRReg rd) { +void IRImmRegCache::Discard(IRReg rd) { if (rd == 0) { return; } reg_[rd].isImm = false; } -IRRegCache::IRRegCache(IRWriter *ir) : ir_(ir) { +IRImmRegCache::IRImmRegCache(IRWriter *ir) : ir_(ir) { memset(®_, 0, sizeof(reg_)); reg_[0].isImm = true; ir_ = ir; } -void IRRegCache::FlushAll() { +void IRImmRegCache::FlushAll() { for (int i = 0; i < TOTAL_MAPPABLE_MIPSREGS; i++) { Flush(i); } } -void IRRegCache::MapIn(IRReg rd) { +void IRImmRegCache::MapIn(IRReg rd) { Flush(rd); } -void IRRegCache::MapDirty(IRReg rd) { +void IRImmRegCache::MapDirty(IRReg rd) { Discard(rd); } -void IRRegCache::MapInIn(IRReg rs, IRReg rt) { +void IRImmRegCache::MapInIn(IRReg rs, IRReg rt) { Flush(rs); Flush(rt); } -void IRRegCache::MapInInIn(IRReg rd, IRReg rs, IRReg rt) { +void IRImmRegCache::MapInInIn(IRReg rd, IRReg rs, IRReg rt) { Flush(rd); Flush(rs); Flush(rt); } -void IRRegCache::MapDirtyIn(IRReg rd, IRReg rs) { +void IRImmRegCache::MapDirtyIn(IRReg rd, IRReg rs) { if (rs != rd) { Discard(rd); } Flush(rs); } -void IRRegCache::MapDirtyInIn(IRReg rd, IRReg rs, IRReg rt) { +void IRImmRegCache::MapDirtyInIn(IRReg rd, IRReg rs, IRReg rt) { if (rs != rd && rt != rd) { Discard(rd); } diff --git a/Core/MIPS/IR/IRRegCache.h b/Core/MIPS/IR/IRRegCache.h index 80fad1d6ef..5ab5d51d0a 100644 --- a/Core/MIPS/IR/IRRegCache.h +++ b/Core/MIPS/IR/IRRegCache.h @@ -1,6 +1,6 @@ #pragma once -// IRRegCache is only to perform pre-constant folding. This is worth it to get cleaner +// IRImmRegCache is only to perform pre-constant folding. This is worth it to get cleaner // IR. #include "Common/CommonTypes.h" @@ -19,9 +19,9 @@ struct RegIR { class IRWriter; // Transient -class IRRegCache { +class IRImmRegCache { public: - IRRegCache(IRWriter *ir); + IRImmRegCache(IRWriter *ir); void SetImm(IRReg r, u32 immVal) { reg_[r].isImm = true; diff --git a/Core/MIPS/JitCommon/JitState.cpp b/Core/MIPS/JitCommon/JitState.cpp index 00e87913a0..9144513cca 100644 --- a/Core/MIPS/JitCommon/JitState.cpp +++ b/Core/MIPS/JitCommon/JitState.cpp @@ -64,6 +64,10 @@ namespace MIPSComp { useStaticAlloc = !Disabled(JitDisable::STATIC_ALLOC); // iOS/etc. may disable at runtime if Memory::base is not nicely aligned. enablePointerify = !Disabled(JitDisable::POINTERIFY); +#endif +#if PPSSPP_ARCH(RISCV64) + // Seems to perform slightly better than a checked entry at the start. + useBackJump = true; #endif } diff --git a/Core/MIPS/RiscV/RiscVAsm.cpp b/Core/MIPS/RiscV/RiscVAsm.cpp index e07b59760b..a5205d7b9b 100644 --- a/Core/MIPS/RiscV/RiscVAsm.cpp +++ b/Core/MIPS/RiscV/RiscVAsm.cpp @@ -44,17 +44,7 @@ static void ShowPC(u32 downcount, void *membase, void *jitbase) { count++; } -static void ShowBlockError(int type) { - if (type == 1) { - ERROR_LOG(JIT, "[%08x] ShowBlockError: block num was out of range in emuhack", currentMIPS->pc); - } else if (type == 2) { - ERROR_LOG(JIT, "[%08x] ShowBlockError: block num pointed to null jitblock", currentMIPS->pc); - } else { - ERROR_LOG(JIT, "[%08x] ShowBlockError: invalid error type", currentMIPS->pc); - } -} - -void RiscVJit::GenerateFixedCode(const JitOptions &jo) { +void RiscVJitBackend::GenerateFixedCode(MIPSState *mipsState) { BeginWrite(GetMemoryProtectPageSize()); const u8 *start = AlignCodePage(); @@ -104,7 +94,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { RET(); } - enterDispatcher_ = AlignCode16(); + hooks_.enterDispatcher = (IRNativeFuncNoArg)AlignCode16(); // Start by saving some regs on the stack. There are 12 GPs and 12 FPs we want. // Note: we leave R_SP as, well, SP, so it doesn't need to be saved. @@ -130,7 +120,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { // Fixed registers, these are always kept when in Jit context. LI(MEMBASEREG, Memory::base, SCRATCH1); - LI(CTXREG, mips_, SCRATCH1); + LI(CTXREG, mipsState, SCRATCH1); LI(JITBASEREG, GetBasePtr(), SCRATCH1); LoadStaticRegisters(); @@ -141,7 +131,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { // Advance can change the downcount (or thread), so must save/restore around it. SaveStaticRegisters(); RestoreRoundingMode(true); - QuickCallFunction(&CoreTiming::Advance); + QuickCallFunction(&CoreTiming::Advance, X7); ApplyRoundingMode(true); LoadStaticRegisters(); @@ -157,7 +147,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { dispatcherPCInSCRATCH1_ = GetCodePtr(); MovToPC(SCRATCH1); - dispatcher_ = GetCodePtr(); + hooks_.dispatcher = GetCodePtr(); FixupBranch bail = BLT(DOWNCOUNTREG, R_ZERO); SetJumpTarget(skipToRealDispatch); @@ -168,7 +158,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { MV(X10, DOWNCOUNTREG); MV(X11, MEMBASEREG); MV(X12, JITBASEREG); - QuickCallFunction(&ShowPC); + QuickCallFunction(&ShowPC, X7); } LWU(SCRATCH1, CTXREG, offsetof(MIPSState, pc)); @@ -177,7 +167,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { AND(SCRATCH1, SCRATCH1, SCRATCH2); #endif ADD(SCRATCH1, SCRATCH1, MEMBASEREG); - dispatcherFetch_ = GetCodePtr(); + hooks_.dispatchFetch = GetCodePtr(); LWU(SCRATCH1, SCRATCH1, 0); SRLI(SCRATCH2, SCRATCH1, 24); // We're in other words comparing to the top 8 bits of MIPS_EMUHACK_OPCODE by subtracting. @@ -192,7 +182,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { // No block found, let's jit. We don't need to save static regs, they're all callee saved. RestoreRoundingMode(true); - QuickCallFunction(&MIPSComp::JitAt); + QuickCallFunction(&MIPSComp::JitAt, X7); ApplyRoundingMode(true); // Try again, the block index should be set now. @@ -224,7 +214,7 @@ void RiscVJit::GenerateFixedCode(const JitOptions &jo) { RET(); - crashHandler_ = GetCodePtr(); + hooks_.crashHandler = GetCodePtr(); LI(SCRATCH1, &coreState, SCRATCH2); LI(SCRATCH2, CORE_RUNTIME_ERROR); SW(SCRATCH2, SCRATCH1, 0); diff --git a/Core/MIPS/RiscV/RiscVCompALU.cpp b/Core/MIPS/RiscV/RiscVCompALU.cpp index 5cb2ff256c..c1939e9867 100644 --- a/Core/MIPS/RiscV/RiscVCompALU.cpp +++ b/Core/MIPS/RiscV/RiscVCompALU.cpp @@ -35,7 +35,7 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::CompIR_Arith(IRInst inst) { +void RiscVJitBackend::CompIR_Arith(IRInst inst) { CONDITIONAL_DISABLE; bool allowPtrMath = true; @@ -96,7 +96,7 @@ void RiscVJit::CompIR_Arith(IRInst inst) { } } -void RiscVJit::CompIR_Logic(IRInst inst) { +void RiscVJitBackend::CompIR_Logic(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -187,7 +187,7 @@ void RiscVJit::CompIR_Logic(IRInst inst) { } } -void RiscVJit::CompIR_Assign(IRInst inst) { +void RiscVJitBackend::CompIR_Assign(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -227,12 +227,46 @@ void RiscVJit::CompIR_Assign(IRInst inst) { } } -void RiscVJit::CompIR_Bits(IRInst inst) { +void RiscVJitBackend::CompIR_Bits(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { case IROp::ReverseBits: - CompIR_Generic(inst); + if (cpu_info.RiscV_Zbb) { + gpr.MapDirtyIn(inst.dest, inst.src1); + // Start by reversing bytes (note: this puts in upper 32 of XLEN.) + REV8(gpr.R(inst.dest), gpr.R(inst.src1)); + + // Swap nibbles. + LI(SCRATCH1, (s32)0xF0F0F0F0); + SRLI(SCRATCH2, gpr.R(inst.dest), XLEN - 32 - 4); + AND(SCRATCH2, SCRATCH2, SCRATCH1); + if (XLEN >= 64) + SRLI(gpr.R(inst.dest), gpr.R(inst.dest), XLEN - 28); + else + SLLI(gpr.R(inst.dest), gpr.R(inst.dest), 4); + SRLIW(SCRATCH1, SCRATCH1, 4); + AND(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH1); + OR(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH2); + + // Now the consecutive pairs. + LI(SCRATCH1, (s32)0x33333333); + SRLI(SCRATCH2, gpr.R(inst.dest), 2); + AND(SCRATCH2, SCRATCH2, SCRATCH1); + AND(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH1); + SLLIW(gpr.R(inst.dest), gpr.R(inst.dest), 2); + OR(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH2); + + // And finally the even and odd bits. + LI(SCRATCH1, (s32)0x55555555); + SRLI(SCRATCH2, gpr.R(inst.dest), 1); + AND(SCRATCH2, SCRATCH2, SCRATCH1); + AND(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH1); + SLLIW(gpr.R(inst.dest), gpr.R(inst.dest), 1); + OR(gpr.R(inst.dest), gpr.R(inst.dest), SCRATCH2); + } else { + CompIR_Generic(inst); + } break; case IROp::BSwap16: @@ -269,7 +303,7 @@ void RiscVJit::CompIR_Bits(IRInst inst) { } } -void RiscVJit::CompIR_Shift(IRInst inst) { +void RiscVJitBackend::CompIR_Shift(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -367,7 +401,7 @@ void RiscVJit::CompIR_Shift(IRInst inst) { } } -void RiscVJit::CompIR_Compare(IRInst inst) { +void RiscVJitBackend::CompIR_Compare(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg lhs = INVALID_REG; @@ -445,7 +479,7 @@ void RiscVJit::CompIR_Compare(IRInst inst) { } } -void RiscVJit::CompIR_CondAssign(IRInst inst) { +void RiscVJitBackend::CompIR_CondAssign(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg lhs = INVALID_REG; @@ -519,7 +553,7 @@ void RiscVJit::CompIR_CondAssign(IRInst inst) { } } -void RiscVJit::CompIR_HiLo(IRInst inst) { +void RiscVJitBackend::CompIR_HiLo(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -553,7 +587,7 @@ void RiscVJit::CompIR_HiLo(IRInst inst) { } } -void RiscVJit::CompIR_Mult(IRInst inst) { +void RiscVJitBackend::CompIR_Mult(IRInst inst) { CONDITIONAL_DISABLE; auto makeArgsUnsigned = [&](RiscVReg *lhs, RiscVReg *rhs) { @@ -652,7 +686,7 @@ void RiscVJit::CompIR_Mult(IRInst inst) { } } -void RiscVJit::CompIR_Div(IRInst inst) { +void RiscVJitBackend::CompIR_Div(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg numReg, denomReg; diff --git a/Core/MIPS/RiscV/RiscVCompBranch.cpp b/Core/MIPS/RiscV/RiscVCompBranch.cpp index aa9d2467a0..4b0f141649 100644 --- a/Core/MIPS/RiscV/RiscVCompBranch.cpp +++ b/Core/MIPS/RiscV/RiscVCompBranch.cpp @@ -34,15 +34,14 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::CompIR_Exit(IRInst inst) { +void RiscVJitBackend::CompIR_Exit(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg exitReg = INVALID_REG; switch (inst.op) { case IROp::ExitToConst: FlushAll(); - LI(SCRATCH1, inst.constant); - QuickJ(R_RA, dispatcherPCInSCRATCH1_); + WriteConstExit(inst.constant); break; case IROp::ExitToReg: @@ -64,7 +63,7 @@ void RiscVJit::CompIR_Exit(IRInst inst) { } } -void RiscVJit::CompIR_ExitIf(IRInst inst) { +void RiscVJitBackend::CompIR_ExitIf(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg lhs = INVALID_REG; @@ -92,8 +91,7 @@ void RiscVJit::CompIR_ExitIf(IRInst inst) { break; } - LI(SCRATCH1, inst.constant); - QuickJ(R_RA, dispatcherPCInSCRATCH1_); + WriteConstExit(inst.constant); SetJumpTarget(fixup); break; @@ -127,8 +125,7 @@ void RiscVJit::CompIR_ExitIf(IRInst inst) { break; } - LI(SCRATCH1, inst.constant); - QuickJ(R_RA, dispatcherPCInSCRATCH1_); + WriteConstExit(inst.constant); SetJumpTarget(fixup); break; diff --git a/Core/MIPS/RiscV/RiscVCompFPU.cpp b/Core/MIPS/RiscV/RiscVCompFPU.cpp index 18cd1a00c2..19655b8f65 100644 --- a/Core/MIPS/RiscV/RiscVCompFPU.cpp +++ b/Core/MIPS/RiscV/RiscVCompFPU.cpp @@ -34,7 +34,7 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::CompIR_FArith(IRInst inst) { +void RiscVJitBackend::CompIR_FArith(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -50,41 +50,9 @@ void RiscVJit::CompIR_FArith(IRInst inst) { case IROp::FMul: fpr.MapDirtyInIn(inst.dest, inst.src1, inst.src2); - // TODO: If FMUL consistently produces NAN across chip vendors, we can skip this. - // Luckily this does match the RISC-V canonical NAN. - if (inst.src1 != inst.src2) { - // These will output 0x80/0x01 if infinity, 0x10/0x80 if zero. - // We need to check if one is infinity and the other zero. - - // First, try inf * zero. - FCLASS(32, SCRATCH1, fpr.R(inst.src1)); - FCLASS(32, SCRATCH2, fpr.R(inst.src2)); - ANDI(R_RA, SCRATCH1, 0x81); - FixupBranch lhsNotInf = BEQ(R_RA, R_ZERO); - ANDI(R_RA, SCRATCH2, 0x18); - FixupBranch infZero = BNE(R_RA, R_ZERO); - - // Okay, what about the other order? - SetJumpTarget(lhsNotInf); - ANDI(R_RA, SCRATCH1, 0x18); - FixupBranch lhsNotZero = BEQ(R_RA, R_ZERO); - ANDI(R_RA, SCRATCH2, 0x81); - FixupBranch zeroInf = BNE(R_RA, R_ZERO); - - // Nope, all good. - SetJumpTarget(lhsNotZero); - FMUL(32, fpr.R(inst.dest), fpr.R(inst.src1), fpr.R(inst.src2)); - FixupBranch skip = J(); - - SetJumpTarget(infZero); - SetJumpTarget(zeroInf); - LI(SCRATCH1, 0x7FC00000); - FMV(FMv::W, FMv::X, fpr.R(inst.dest), SCRATCH1); - - SetJumpTarget(skip); - } else { - FMUL(32, fpr.R(inst.dest), fpr.R(inst.src1), fpr.R(inst.src2)); - } + // We'll assume everyone will make it such that 0 * infinity = NAN properly. + // See blame on this comment if that proves untrue. + FMUL(32, fpr.R(inst.dest), fpr.R(inst.src1), fpr.R(inst.src2)); break; case IROp::FDiv: @@ -108,7 +76,7 @@ void RiscVJit::CompIR_FArith(IRInst inst) { } } -void RiscVJit::CompIR_FCondAssign(IRInst inst) { +void RiscVJitBackend::CompIR_FCondAssign(IRInst inst) { CONDITIONAL_DISABLE; if (inst.op != IROp::FMin && inst.op != IROp::FMax) INVALIDOP; @@ -174,7 +142,7 @@ void RiscVJit::CompIR_FCondAssign(IRInst inst) { SetJumpTarget(finish); } -void RiscVJit::CompIR_FAssign(IRInst inst) { +void RiscVJitBackend::CompIR_FAssign(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -220,7 +188,7 @@ void RiscVJit::CompIR_FAssign(IRInst inst) { } } -void RiscVJit::CompIR_FRound(IRInst inst) { +void RiscVJitBackend::CompIR_FRound(IRInst inst) { CONDITIONAL_DISABLE; // TODO: If this is followed by a GPR transfer, might want to combine. @@ -251,13 +219,12 @@ void RiscVJit::CompIR_FRound(IRInst inst) { FMV(FMv::W, FMv::X, fpr.R(inst.dest), SCRATCH1); } -void RiscVJit::CompIR_FCvt(IRInst inst) { +void RiscVJitBackend::CompIR_FCvt(IRInst inst) { CONDITIONAL_DISABLE; + RiscVReg tempReg = INVALID_REG; switch (inst.op) { case IROp::FCvtWS: - case IROp::FCvtScaledWS: - case IROp::FCvtScaledSW: CompIR_Generic(inst); break; @@ -268,13 +235,51 @@ void RiscVJit::CompIR_FCvt(IRInst inst) { FCVT(FConv::S, FConv::W, fpr.R(inst.dest), SCRATCH1); break; + case IROp::FCvtScaledWS: + if (cpu_info.RiscV_D) { + Round rm = Round::NEAREST_EVEN; + switch (inst.src2 >> 6) { + case 0: rm = Round::NEAREST_EVEN; break; + case 1: rm = Round::TOZERO; break; + case 2: rm = Round::UP; break; + case 3: rm = Round::DOWN; break; + } + + tempReg = fpr.MapDirtyInTemp(inst.dest, inst.src1); + // Prepare the double src1 and the multiplier. + FCVT(FConv::D, FConv::S, fpr.R(inst.dest), fpr.R(inst.src1)); + LI(SCRATCH1, 1UL << (inst.src2 & 0x1F)); + FCVT(FConv::D, FConv::WU, tempReg, SCRATCH1, rm); + + FMUL(64, fpr.R(inst.dest), fpr.R(inst.dest), tempReg, rm); + // NAN and clamping should all be correct. + FCVT(FConv::W, FConv::D, SCRATCH1, fpr.R(inst.dest), rm); + // TODO: Could combine with a transfer, often is one... + FMV(FMv::W, FMv::X, fpr.R(inst.dest), SCRATCH1); + } else { + CompIR_Generic(inst); + } + break; + + case IROp::FCvtScaledSW: + // TODO: This is probably proceeded by a GPR transfer, might be ideal to combine. + tempReg = fpr.MapDirtyInTemp(inst.dest, inst.src1); + FMV(FMv::X, FMv::W, SCRATCH1, fpr.R(inst.src1)); + FCVT(FConv::S, FConv::W, fpr.R(inst.dest), SCRATCH1); + + // Pre-divide so we can avoid any actual divide. + LI(SCRATCH1, 1.0f / (1UL << (inst.src2 & 0x1F))); + FMV(FMv::W, FMv::X, tempReg, SCRATCH1); + FMUL(32, fpr.R(inst.dest), fpr.R(inst.dest), tempReg); + break; + default: INVALIDOP; break; } } -void RiscVJit::CompIR_FSat(IRInst inst) { +void RiscVJitBackend::CompIR_FSat(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg tempReg = INVALID_REG; @@ -334,7 +339,7 @@ void RiscVJit::CompIR_FSat(IRInst inst) { } } -void RiscVJit::CompIR_FCompare(IRInst inst) { +void RiscVJitBackend::CompIR_FCompare(IRInst inst) { CONDITIONAL_DISABLE; constexpr IRRegIndex IRREG_VFPUL_CC = IRREG_VFPU_CTRL_BASE + VFPU_CTRL_CC; @@ -548,7 +553,7 @@ void RiscVJit::CompIR_FCompare(IRInst inst) { } } -void RiscVJit::CompIR_RoundingMode(IRInst inst) { +void RiscVJitBackend::CompIR_RoundingMode(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -570,7 +575,7 @@ void RiscVJit::CompIR_RoundingMode(IRInst inst) { } } -void RiscVJit::CompIR_FSpecial(IRInst inst) { +void RiscVJitBackend::CompIR_FSpecial(IRInst inst) { CONDITIONAL_DISABLE; #ifdef __riscv_float_abi_soft @@ -587,7 +592,7 @@ void RiscVJit::CompIR_FSpecial(IRInst inst) { int offset = offsetof(MIPSState, f) + inst.src1 * 4; FL(32, F10, CTXREG, offset); } - QuickCallFunction(func); + QuickCallFunction(func, SCRATCH1); fpr.MapReg(inst.dest, MIPSMap::NOINIT); // If it's already F10, we're done - MapReg doesn't actually overwrite the reg in that case. diff --git a/Core/MIPS/RiscV/RiscVCompLoadStore.cpp b/Core/MIPS/RiscV/RiscVCompLoadStore.cpp index d6a49e6f13..09ac714519 100644 --- a/Core/MIPS/RiscV/RiscVCompLoadStore.cpp +++ b/Core/MIPS/RiscV/RiscVCompLoadStore.cpp @@ -34,7 +34,7 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::SetScratch1ToSrc1Address(IRReg src1) { +void RiscVJitBackend::SetScratch1ToSrc1Address(IRReg src1) { gpr.MapReg(src1); #ifdef MASKED_PSP_MEMORY SLLIW(SCRATCH1, gpr.R(src1), 2); @@ -53,7 +53,7 @@ void RiscVJit::SetScratch1ToSrc1Address(IRReg src1) { #endif } -int32_t RiscVJit::AdjustForAddressOffset(RiscVGen::RiscVReg *reg, int32_t constant, int32_t range) { +int32_t RiscVJitBackend::AdjustForAddressOffset(RiscVGen::RiscVReg *reg, int32_t constant, int32_t range) { if (constant < -2048 || constant + range > 2047) { LI(SCRATCH2, constant); ADD(SCRATCH1, *reg, SCRATCH2); @@ -63,7 +63,7 @@ int32_t RiscVJit::AdjustForAddressOffset(RiscVGen::RiscVReg *reg, int32_t consta return constant; } -void RiscVJit::CompIR_Load(IRInst inst) { +void RiscVJitBackend::CompIR_Load(IRInst inst) { CONDITIONAL_DISABLE; gpr.SpillLock(inst.dest, inst.src1); @@ -80,11 +80,8 @@ void RiscVJit::CompIR_Load(IRInst inst) { SetScratch1ToSrc1Address(inst.src1); addrReg = SCRATCH1; } - // If they're the same, MapReg may subtract MEMBASEREG, so just mark dirty. - if (inst.dest == inst.src1) - gpr.MarkDirty(gpr.R(inst.dest), true); - else - gpr.MapReg(inst.dest, MIPSMap::NOINIT | MIPSMap::MARK_NORM32); + // With NOINIT, MapReg won't subtract MEMBASEREG even if dest == src1. + gpr.MapReg(inst.dest, MIPSMap::NOINIT | MIPSMap::MARK_NORM32); gpr.ReleaseSpillLock(inst.dest, inst.src1); s32 imm = AdjustForAddressOffset(&addrReg, inst.constant); @@ -124,7 +121,7 @@ void RiscVJit::CompIR_Load(IRInst inst) { } } -void RiscVJit::CompIR_LoadShift(IRInst inst) { +void RiscVJitBackend::CompIR_LoadShift(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -140,7 +137,7 @@ void RiscVJit::CompIR_LoadShift(IRInst inst) { } } -void RiscVJit::CompIR_FLoad(IRInst inst) { +void RiscVJitBackend::CompIR_FLoad(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg addrReg = INVALID_REG; @@ -173,7 +170,7 @@ void RiscVJit::CompIR_FLoad(IRInst inst) { } } -void RiscVJit::CompIR_VecLoad(IRInst inst) { +void RiscVJitBackend::CompIR_VecLoad(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg addrReg = INVALID_REG; @@ -210,7 +207,7 @@ void RiscVJit::CompIR_VecLoad(IRInst inst) { } } -void RiscVJit::CompIR_Store(IRInst inst) { +void RiscVJitBackend::CompIR_Store(IRInst inst) { CONDITIONAL_DISABLE; gpr.SpillLock(inst.src3, inst.src1); @@ -255,7 +252,7 @@ void RiscVJit::CompIR_Store(IRInst inst) { } } -void RiscVJit::CompIR_CondStore(IRInst inst) { +void RiscVJitBackend::CompIR_CondStore(IRInst inst) { CONDITIONAL_DISABLE; if (inst.op != IROp::Store32Conditional) INVALIDOP; @@ -297,7 +294,7 @@ void RiscVJit::CompIR_CondStore(IRInst inst) { } } -void RiscVJit::CompIR_StoreShift(IRInst inst) { +void RiscVJitBackend::CompIR_StoreShift(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -313,7 +310,7 @@ void RiscVJit::CompIR_StoreShift(IRInst inst) { } } -void RiscVJit::CompIR_FStore(IRInst inst) { +void RiscVJitBackend::CompIR_FStore(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg addrReg = INVALID_REG; @@ -346,7 +343,7 @@ void RiscVJit::CompIR_FStore(IRInst inst) { } } -void RiscVJit::CompIR_VecStore(IRInst inst) { +void RiscVJitBackend::CompIR_VecStore(IRInst inst) { CONDITIONAL_DISABLE; RiscVReg addrReg = INVALID_REG; diff --git a/Core/MIPS/RiscV/RiscVCompSystem.cpp b/Core/MIPS/RiscV/RiscVCompSystem.cpp index 727465fad0..dbfa392a2b 100644 --- a/Core/MIPS/RiscV/RiscVCompSystem.cpp +++ b/Core/MIPS/RiscV/RiscVCompSystem.cpp @@ -38,7 +38,7 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::CompIR_Basic(IRInst inst) { +void RiscVJitBackend::CompIR_Basic(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -85,7 +85,7 @@ void RiscVJit::CompIR_Basic(IRInst inst) { } } -void RiscVJit::CompIR_Transfer(IRInst inst) { +void RiscVJitBackend::CompIR_Transfer(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -105,16 +105,17 @@ void RiscVJit::CompIR_Transfer(IRInst inst) { FMV(FMv::X, FMv::W, gpr.R(IRREG_VFPU_CTRL_BASE + inst.dest), fpr.R(inst.src1)); break; + case IROp::FpCondFromReg: + gpr.MapDirtyIn(IRREG_FPCOND, inst.src1); + MV(gpr.R(IRREG_FPCOND), gpr.R(inst.src1)); + break; + case IROp::FpCondToReg: gpr.MapDirtyIn(inst.dest, IRREG_FPCOND); MV(gpr.R(inst.dest), gpr.R(IRREG_FPCOND)); gpr.MarkDirty(gpr.R(inst.dest), gpr.IsNormalized32(IRREG_FPCOND)); break; - case IROp::ZeroFpCond: - gpr.SetImm(IRREG_FPCOND, 0); - break; - case IROp::FpCtrlFromReg: gpr.MapDirtyIn(IRREG_FPCOND, inst.src1, MapType::AVOID_LOAD_MARK_NORM32); LI(SCRATCH1, 0x0181FFFF); @@ -177,7 +178,7 @@ void RiscVJit::CompIR_Transfer(IRInst inst) { } } -void RiscVJit::CompIR_System(IRInst inst) { +void RiscVJitBackend::CompIR_System(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -188,7 +189,7 @@ void RiscVJit::CompIR_System(IRInst inst) { #ifdef USE_PROFILER // When profiling, we can't skip CallSyscall, since it times syscalls. LI(X10, (int32_t)inst.constant); - QuickCallFunction(&CallSyscall); + QuickCallFunction(&CallSyscall, SCRATCH2); #else // Skip the CallSyscall where possible. { @@ -196,10 +197,10 @@ void RiscVJit::CompIR_System(IRInst inst) { void *quickFunc = GetQuickSyscallFunc(op); if (quickFunc) { LI(X10, (uintptr_t)GetSyscallFuncPointer(op)); - QuickCallFunction((const u8 *)quickFunc); + QuickCallFunction((const u8 *)quickFunc, SCRATCH2); } else { LI(X10, (int32_t)inst.constant); - QuickCallFunction(&CallSyscall); + QuickCallFunction(&CallSyscall, SCRATCH2); } } #endif @@ -211,7 +212,7 @@ void RiscVJit::CompIR_System(IRInst inst) { case IROp::CallReplacement: FlushAll(); SaveStaticRegisters(); - QuickCallFunction(GetReplacementFunc(inst.constant)->replaceFunc); + QuickCallFunction(GetReplacementFunc(inst.constant)->replaceFunc, SCRATCH2); LoadStaticRegisters(); SUB(DOWNCOUNTREG, DOWNCOUNTREG, X10); break; @@ -222,7 +223,7 @@ void RiscVJit::CompIR_System(IRInst inst) { RestoreRoundingMode(true); SaveStaticRegisters(); MovFromPC(X10); - QuickCallFunction(&Core_Break); + QuickCallFunction(&Core_Break, SCRATCH2); LoadStaticRegisters(); ApplyRoundingMode(true); MovFromPC(SCRATCH1); @@ -236,7 +237,7 @@ void RiscVJit::CompIR_System(IRInst inst) { } } -void RiscVJit::CompIR_Breakpoint(IRInst inst) { +void RiscVJitBackend::CompIR_Breakpoint(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -251,7 +252,7 @@ void RiscVJit::CompIR_Breakpoint(IRInst inst) { } } -void RiscVJit::CompIR_ValidateAddress(IRInst inst) { +void RiscVJitBackend::CompIR_ValidateAddress(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { diff --git a/Core/MIPS/RiscV/RiscVCompVec.cpp b/Core/MIPS/RiscV/RiscVCompVec.cpp index 8140f2b856..36c4520653 100644 --- a/Core/MIPS/RiscV/RiscVCompVec.cpp +++ b/Core/MIPS/RiscV/RiscVCompVec.cpp @@ -15,6 +15,7 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. +#include #include "Core/MemMap.h" #include "Core/MIPS/RiscV/RiscVJit.h" #include "Core/MIPS/RiscV/RiscVRegCache.h" @@ -34,7 +35,7 @@ namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -void RiscVJit::CompIR_VecAssign(IRInst inst) { +void RiscVJitBackend::CompIR_VecAssign(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -110,10 +111,71 @@ void RiscVJit::CompIR_VecAssign(IRInst inst) { break; case IROp::Vec4Shuffle: - fpr.Map4DirtyIn(inst.dest, inst.src1); + if (inst.dest == inst.src1) { + RiscVReg tempReg = fpr.Map4DirtyInTemp(inst.dest, inst.src1); + + // Try to find the least swaps needed to move in place, never worse than 6 FMVs. + // Would be better with a vmerge and vector regs. + int state[4]{ 0, 1, 2, 3 }; + int goal[4]{ (inst.src2 >> 0) & 3, (inst.src2 >> 2) & 3, (inst.src2 >> 4) & 3, (inst.src2 >> 6) & 3 }; + + static constexpr int NOT_FOUND = 4; + auto findIndex = [](int *arr, int val, int start = 0) { + return (int)(std::find(arr + start, arr + 4, val) - arr); + }; + auto moveChained = [&](const std::vector &lanes, bool rotate) { + int firstState = state[lanes.front()]; + if (rotate) + FMV(32, tempReg, fpr.R(inst.dest + lanes.front())); + for (size_t i = 1; i < lanes.size(); ++i) { + FMV(32, fpr.R(inst.dest + lanes[i - 1]), fpr.R(inst.dest + lanes[i])); + state[lanes[i - 1]] = state[lanes[i]]; + } + if (rotate) { + FMV(32, fpr.R(inst.dest + lanes.back()), tempReg); + state[lanes.back()] = firstState; + } + }; + + for (int i = 0; i < 4; ++i) { + // Overlap, so if they match, nothing to do. + if (goal[i] == state[i]) + continue; + + int neededBy = findIndex(goal, state[i], i + 1); + int foundIn = findIndex(state, goal[i], 0); + _assert_(foundIn != NOT_FOUND); + + if (neededBy == NOT_FOUND || neededBy == foundIn) { + moveChained({ i, foundIn }, neededBy == foundIn); + continue; + } + + // Maybe we can avoid a swap and move the next thing into place. + int neededByDepth2 = findIndex(goal, state[neededBy], i + 1); + if (neededByDepth2 == NOT_FOUND || neededByDepth2 == foundIn) { + moveChained({ neededBy, i, foundIn }, neededByDepth2 == foundIn); + continue; + } + + // Since we only have 4 items, this is as deep as the chain could go. + int neededByDepth3 = findIndex(goal, state[neededByDepth2], i + 1); + moveChained({ neededByDepth2, neededBy, i, foundIn }, neededByDepth3 == foundIn); + } + } else { + fpr.Map4DirtyIn(inst.dest, inst.src1); + for (int i = 0; i < 4; ++i) { + int lane = (inst.src2 >> (i * 2)) & 3; + FMV(32, fpr.R(inst.dest + i), fpr.R(inst.src1 + lane)); + } + } + break; + + case IROp::Vec4Blend: + fpr.Map4DirtyInIn(inst.dest, inst.src1, inst.src2); for (int i = 0; i < 4; ++i) { - int lane = (inst.src2 >> (i * 2)) & 3; - FMV(32, fpr.R(inst.dest + i), fpr.R(inst.src1 + lane)); + int which = (inst.constant >> i) & 1; + FMV(32, fpr.R(inst.dest + i), fpr.R((which ? inst.src2 : inst.src1) + i)); } break; @@ -129,7 +191,7 @@ void RiscVJit::CompIR_VecAssign(IRInst inst) { } } -void RiscVJit::CompIR_VecArith(IRInst inst) { +void RiscVJitBackend::CompIR_VecArith(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -184,7 +246,7 @@ void RiscVJit::CompIR_VecArith(IRInst inst) { } } -void RiscVJit::CompIR_VecHoriz(IRInst inst) { +void RiscVJitBackend::CompIR_VecHoriz(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { @@ -230,20 +292,76 @@ void RiscVJit::CompIR_VecHoriz(IRInst inst) { } } -void RiscVJit::CompIR_VecPack(IRInst inst) { +void RiscVJitBackend::CompIR_VecPack(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { case IROp::Vec2Unpack16To31: case IROp::Vec2Unpack16To32: - case IROp::Vec4Unpack8To32: - case IROp::Vec4DuplicateUpperBitsAndShift1: - case IROp::Vec4Pack31To8: case IROp::Vec4Pack32To8: case IROp::Vec2Pack31To16: CompIR_Generic(inst); break; + case IROp::Vec4Unpack8To32: + fpr.SpillLock(inst.src1); + for (int i = 0; i < 4; ++i) + fpr.SpillLock(inst.dest + i); + fpr.MapReg(inst.src1); + for (int i = 0; i < 4; ++i) + fpr.MapReg(inst.dest + i, MIPSMap::NOINIT); + fpr.ReleaseSpillLocksAndDiscardTemps(); + + FMV(FMv::X, FMv::W, SCRATCH2, fpr.R(inst.src1)); + for (int i = 0; i < 4; ++i) { + // Mask using walls. + if (i != 0) { + SRLI(SCRATCH1, SCRATCH2, i * 8); + SLLI(SCRATCH1, SCRATCH1, 24); + } else { + SLLI(SCRATCH1, SCRATCH2, 24); + } + FMV(FMv::W, FMv::X, fpr.R(inst.dest + i), SCRATCH1); + } + break; + + case IROp::Vec4DuplicateUpperBitsAndShift1: + fpr.Map4DirtyIn(inst.dest, inst.src1); + for (int i = 0; i < 4; i++) { + FMV(FMv::X, FMv::W, SCRATCH1, fpr.R(inst.src1 + i)); + SRLIW(SCRATCH2, SCRATCH1, 8); + OR(SCRATCH1, SCRATCH1, SCRATCH2); + SRLIW(SCRATCH2, SCRATCH1, 16); + OR(SCRATCH1, SCRATCH1, SCRATCH2); + SRLIW(SCRATCH1, SCRATCH1, 1); + FMV(FMv::W, FMv::X, fpr.R(inst.dest + i), SCRATCH1); + } + break; + + case IROp::Vec4Pack31To8: + fpr.SpillLock(inst.dest); + for (int i = 0; i < 4; ++i) { + fpr.SpillLock(inst.src1 + i); + fpr.MapReg(inst.src1 + i); + } + fpr.MapReg(inst.dest, MIPSMap::NOINIT); + fpr.ReleaseSpillLocksAndDiscardTemps(); + + for (int i = 0; i < 4; ++i) { + FMV(FMv::X, FMv::W, SCRATCH1, fpr.R(inst.src1 + i)); + SRLI(SCRATCH1, SCRATCH1, 23); + if (i == 0) { + ANDI(SCRATCH2, SCRATCH1, 0xFF); + } else { + ANDI(SCRATCH1, SCRATCH1, 0xFF); + SLLI(SCRATCH1, SCRATCH1, 8 * i); + OR(SCRATCH2, SCRATCH2, SCRATCH1); + } + } + + FMV(FMv::W, FMv::X, fpr.R(inst.dest), SCRATCH2); + break; + case IROp::Vec2Pack32To16: fpr.MapDirtyInIn(inst.dest, inst.src1, inst.src1 + 1); FMV(FMv::X, FMv::W, SCRATCH1, fpr.R(inst.src1)); @@ -266,11 +384,25 @@ void RiscVJit::CompIR_VecPack(IRInst inst) { } } -void RiscVJit::CompIR_VecClamp(IRInst inst) { +void RiscVJitBackend::CompIR_VecClamp(IRInst inst) { CONDITIONAL_DISABLE; switch (inst.op) { case IROp::Vec4ClampToZero: + fpr.Map4DirtyIn(inst.dest, inst.src1); + for (int i = 0; i < 4; i++) { + FMV(FMv::X, FMv::W, SCRATCH1, fpr.R(inst.src1 + i)); + SRAIW(SCRATCH2, SCRATCH1, 31); + if (cpu_info.RiscV_Zbb) { + ANDN(SCRATCH1, SCRATCH1, SCRATCH2); + } else { + NOT(SCRATCH2, SCRATCH2); + AND(SCRATCH1, SCRATCH1, SCRATCH2); + } + FMV(FMv::W, FMv::X, fpr.R(inst.dest + i), SCRATCH1); + } + break; + case IROp::Vec2ClampToZero: CompIR_Generic(inst); break; diff --git a/Core/MIPS/RiscV/RiscVJit.cpp b/Core/MIPS/RiscV/RiscVJit.cpp index 04e0c23bf3..1c71239fe8 100644 --- a/Core/MIPS/RiscV/RiscVJit.cpp +++ b/Core/MIPS/RiscV/RiscVJit.cpp @@ -15,62 +15,24 @@ // Official git repository and contact information can be found at // https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/. -#include "Common/StringUtils.h" -#include "Common/TimeUtil.h" +#include +#include "ext/riscv-disas.h" #include "Core/MemMap.h" #include "Core/MIPS/MIPSTables.h" #include "Core/MIPS/RiscV/RiscVJit.h" #include "Core/MIPS/RiscV/RiscVRegCache.h" -#include "Common/Profiler/Profiler.h" namespace MIPSComp { using namespace RiscVGen; using namespace RiscVJitConstants; -static constexpr bool enableDebug = false; +// Needs space for a LI and J which might both be 32-bit offsets. +static constexpr int MIN_BLOCK_NORMAL_LEN = 16; +static constexpr int MIN_BLOCK_EXIT_LEN = 8; -static std::map debugSeenNotCompiledIR; -static std::map debugSeenNotCompiled; -double lastDebugLog = 0.0; - -static void LogDebugNotCompiled() { - if (!enableDebug) - return; - - double now = time_now_d(); - if (now < lastDebugLog + 1.0) - return; - lastDebugLog = now; - - int worstIROp = -1; - int worstIRVal = 0; - for (auto it : debugSeenNotCompiledIR) { - if (it.second > worstIRVal) { - worstIRVal = it.second; - worstIROp = it.first; - } - } - debugSeenNotCompiledIR.clear(); - - const char *worstName = nullptr; - int worstVal = 0; - for (auto it : debugSeenNotCompiled) { - if (it.second > worstVal) { - worstVal = it.second; - worstName = it.first; - } - } - debugSeenNotCompiled.clear(); - - if (worstIROp != -1) - WARN_LOG(JIT, "Most not compiled IR op: %s (%d)", GetIRMeta((IROp)worstIROp)->name, worstIRVal); - if (worstName != nullptr) - WARN_LOG(JIT, "Most not compiled op: %s (%d)", worstName, worstVal); -} - -RiscVJit::RiscVJit(MIPSState *mipsState) - : IRJit(mipsState), gpr(mipsState, &jo), fpr(mipsState, &jo), debugInterface_(blocks_, *this) { +RiscVJitBackend::RiscVJitBackend(MIPSState *mipsState, JitOptions &jitopt, IRBlockCache &blocks) + : IRNativeBackend(blocks), jo(jitopt), gpr(mipsState, &jo), fpr(mipsState, &jo) { // Automatically disable incompatible options. if (((intptr_t)Memory::base & 0x00000000FFFFFFFFUL) != 0) { jo.enablePointerify = false; @@ -83,46 +45,47 @@ RiscVJit::RiscVJit(MIPSState *mipsState) gpr.Init(this); fpr.Init(this); - - GenerateFixedCode(jo); } -RiscVJit::~RiscVJit() { -} - -void RiscVJit::RunLoopUntil(u64 globalticks) { - if constexpr (enableDebug) { - LogDebugNotCompiled(); - } - - PROFILE_THIS_SCOPE("jit"); - ((void (*)())enterDispatcher_)(); -} - -JitBlockCacheDebugInterface *MIPSComp::RiscVJit::GetBlockCacheDebugInterface() { - return &debugInterface_; +RiscVJitBackend::~RiscVJitBackend() { } static void NoBlockExits() { _assert_msg_(false, "Never exited block, invalid IR?"); } -bool RiscVJit::CompileTargetBlock(IRBlock *block, int block_num, bool preload) { +bool RiscVJitBackend::CompileBlock(IRBlock *block, int block_num, bool preload) { if (GetSpaceLeft() < 0x800) return false; - // Don't worry, the codespace isn't large enough to overflow offsets. - block->SetTargetOffset((int)GetOffset(GetCodePointer())); + u32 startPC = block->GetOriginalStart(); + bool wroteCheckedOffset = false; + FixupBranch lateCheckFail; + if (jo.enableBlocklink && !jo.useBackJump) { + SetBlockCheckedOffset(block_num, (int)GetOffset(GetCodePointer())); + wroteCheckedOffset = true; - // TODO: Block linking, checked entries and such. + FixupBranch normalEntry = BGE(DOWNCOUNTREG, R_ZERO); + LI(SCRATCH1, startPC); + QuickJ(R_RA, outerLoopPCInSCRATCH1_); + SetJumpTarget(normalEntry); + } + + // Don't worry, the codespace isn't large enough to overflow offsets. + const u8 *blockStart = GetCodePointer(); + block->SetTargetOffset((int)GetOffset(blockStart)); + compilingBlockNum_ = block_num; gpr.Start(block); fpr.Start(block); + std::map addresses; for (int i = 0; i < block->GetNumInstructions(); ++i) { const IRInst &inst = block->GetInstructions()[i]; gpr.SetIRIndex(i); fpr.SetIRIndex(i); + // TODO: This might be a little wasteful when compiling if we're not debugging jit... + addresses[GetCodePtr()] = inst; CompileIRInst(inst); @@ -133,322 +96,122 @@ bool RiscVJit::CompileTargetBlock(IRBlock *block, int block_num, bool preload) { // Safety check, in case we get a bunch of really large jit ops without a lot of branching. if (GetSpaceLeft() < 0x800) { + compilingBlockNum_ = -1; return false; } } // We should've written an exit above. If we didn't, bad things will happen. - if (enableDebug) { - QuickCallFunction(&NoBlockExits); - QuickJ(R_RA, crashHandler_); + // Only check if debug stats are enabled - needlessly wastes jit space. + if (DebugStatsEnabled()) { + QuickCallFunction(&NoBlockExits, SCRATCH2); + QuickJ(R_RA, hooks_.crashHandler); + } + + int len = (int)GetOffset(GetCodePointer()) - block->GetTargetOffset(); + if (len < MIN_BLOCK_NORMAL_LEN) { + // We need at least 16 bytes to invalidate blocks with, but larger doesn't need to align. + ReserveCodeSpace(MIN_BLOCK_NORMAL_LEN - len); + } + + if (!wroteCheckedOffset) { + // Always record this, even if block link disabled - it's used for size calc. + SetBlockCheckedOffset(block_num, (int)GetOffset(GetCodePointer())); + } + + if (jo.enableBlocklink && jo.useBackJump) { + // Most blocks shouldn't be >= 4KB, so usually we can just BGE. + if (BInRange(blockStart)) { + BGE(DOWNCOUNTREG, R_ZERO, blockStart); + } else { + FixupBranch skip = BLT(DOWNCOUNTREG, R_ZERO); + J(blockStart); + SetJumpTarget(skip); + } + LI(SCRATCH1, startPC); + QuickJ(R_RA, outerLoopPCInSCRATCH1_); + } + + if (logBlocks_ > 0) { + --logBlocks_; + + INFO_LOG(JIT, "== RISCV =="); + INFO_LOG(JIT, "=============== RISCV (%d bytes) ===============", len); + for (const u8 *p = blockStart; p < GetCodePointer(); ) { + char temp[512]; + rv_inst inst; + size_t len; + + auto it = addresses.find(p); + if (it != addresses.end()) { + DisassembleIR(temp, sizeof(temp), it->second); + INFO_LOG(JIT, "IR: # %s", temp); + } + + riscv_inst_fetch(p, &inst, &len); + riscv_disasm_inst(temp, sizeof(temp), rv64, (uintptr_t)p, inst); + p += len; + + INFO_LOG(JIT, "RV: %s", temp); + } } FlushIcache(); + compilingBlockNum_ = -1; return true; } -void RiscVJit::CompileIRInst(IRInst inst) { - switch (inst.op) { - case IROp::Nop: - break; +void RiscVJitBackend::WriteConstExit(uint32_t pc) { + int block_num = blocks_.GetBlockNumberFromStartAddress(pc); + const IRNativeBlock *nativeBlock = GetNativeBlock(block_num); - case IROp::SetConst: - case IROp::SetConstF: - case IROp::Downcount: - case IROp::SetPC: - case IROp::SetPCConst: - CompIR_Basic(inst); - break; + int exitStart = (int)GetOffset(GetCodePointer()); + if (block_num >= 0 && jo.enableBlocklink && nativeBlock && nativeBlock->checkedOffset != 0) { + // Don't bother recording, we don't every overwrite to "unlink". + // Instead, we would mark the target block to jump to the dispatcher. + QuickJ(SCRATCH1, GetBasePtr() + nativeBlock->checkedOffset); + } else { + LI(SCRATCH1, pc); + QuickJ(R_RA, dispatcherPCInSCRATCH1_); + } - case IROp::Add: - case IROp::Sub: - case IROp::AddConst: - case IROp::SubConst: - case IROp::Neg: - CompIR_Arith(inst); - break; + if (jo.enableBlocklink) { + // In case of compression or early link, make sure it's large enough. + int len = (int)GetOffset(GetCodePointer()) - exitStart; + if (len < MIN_BLOCK_EXIT_LEN) { + ReserveCodeSpace(MIN_BLOCK_EXIT_LEN - len); + len = MIN_BLOCK_EXIT_LEN; + } - case IROp::And: - case IROp::Or: - case IROp::Xor: - case IROp::AndConst: - case IROp::OrConst: - case IROp::XorConst: - case IROp::Not: - CompIR_Logic(inst); - break; - - case IROp::Mov: - case IROp::Ext8to32: - case IROp::Ext16to32: - CompIR_Assign(inst); - break; - - case IROp::ReverseBits: - case IROp::BSwap16: - case IROp::BSwap32: - case IROp::Clz: - CompIR_Bits(inst); - break; - - case IROp::Shl: - case IROp::Shr: - case IROp::Sar: - case IROp::Ror: - case IROp::ShlImm: - case IROp::ShrImm: - case IROp::SarImm: - case IROp::RorImm: - CompIR_Shift(inst); - break; - - case IROp::Slt: - case IROp::SltConst: - case IROp::SltU: - case IROp::SltUConst: - CompIR_Compare(inst); - break; - - case IROp::MovZ: - case IROp::MovNZ: - case IROp::Max: - case IROp::Min: - CompIR_CondAssign(inst); - break; - - case IROp::MtLo: - case IROp::MtHi: - case IROp::MfLo: - case IROp::MfHi: - CompIR_HiLo(inst); - break; - - case IROp::Mult: - case IROp::MultU: - case IROp::Madd: - case IROp::MaddU: - case IROp::Msub: - case IROp::MsubU: - CompIR_Mult(inst); - break; - - case IROp::Div: - case IROp::DivU: - CompIR_Div(inst); - break; - - case IROp::Load8: - case IROp::Load8Ext: - case IROp::Load16: - case IROp::Load16Ext: - case IROp::Load32: - case IROp::Load32Linked: - CompIR_Load(inst); - break; - - case IROp::Load32Left: - case IROp::Load32Right: - CompIR_LoadShift(inst); - break; - - case IROp::LoadFloat: - CompIR_FLoad(inst); - break; - - case IROp::LoadVec4: - CompIR_VecLoad(inst); - break; - - case IROp::Store8: - case IROp::Store16: - case IROp::Store32: - CompIR_Store(inst); - break; - - case IROp::Store32Conditional: - CompIR_CondStore(inst); - break; - - case IROp::Store32Left: - case IROp::Store32Right: - CompIR_StoreShift(inst); - break; - - case IROp::StoreFloat: - CompIR_FStore(inst); - break; - - case IROp::StoreVec4: - CompIR_VecStore(inst); - break; - - case IROp::FAdd: - case IROp::FSub: - case IROp::FMul: - case IROp::FDiv: - case IROp::FSqrt: - case IROp::FNeg: - CompIR_FArith(inst); - break; - - case IROp::FMin: - case IROp::FMax: - CompIR_FCondAssign(inst); - break; - - case IROp::FMov: - case IROp::FAbs: - case IROp::FSign: - CompIR_FAssign(inst); - break; - - case IROp::FRound: - case IROp::FTrunc: - case IROp::FCeil: - case IROp::FFloor: - CompIR_FRound(inst); - break; - - case IROp::FCvtWS: - case IROp::FCvtSW: - case IROp::FCvtScaledWS: - case IROp::FCvtScaledSW: - CompIR_FCvt(inst); - break; - - case IROp::FSat0_1: - case IROp::FSatMinus1_1: - CompIR_FSat(inst); - break; - - case IROp::FCmp: - case IROp::FCmovVfpuCC: - case IROp::FCmpVfpuBit: - case IROp::FCmpVfpuAggregate: - CompIR_FCompare(inst); - break; - - case IROp::RestoreRoundingMode: - case IROp::ApplyRoundingMode: - case IROp::UpdateRoundingMode: - CompIR_RoundingMode(inst); - break; - - case IROp::SetCtrlVFPU: - case IROp::SetCtrlVFPUReg: - case IROp::SetCtrlVFPUFReg: - case IROp::FpCondToReg: - case IROp::ZeroFpCond: - case IROp::FpCtrlFromReg: - case IROp::FpCtrlToReg: - case IROp::VfpuCtrlToReg: - case IROp::FMovFromGPR: - case IROp::FMovToGPR: - CompIR_Transfer(inst); - break; - - case IROp::Vec4Init: - case IROp::Vec4Shuffle: - case IROp::Vec4Mov: - CompIR_VecAssign(inst); - break; - - case IROp::Vec4Add: - case IROp::Vec4Sub: - case IROp::Vec4Mul: - case IROp::Vec4Div: - case IROp::Vec4Scale: - case IROp::Vec4Neg: - case IROp::Vec4Abs: - CompIR_VecArith(inst); - break; - - case IROp::Vec4Dot: - CompIR_VecHoriz(inst); - break; - - case IROp::Vec2Unpack16To31: - case IROp::Vec2Unpack16To32: - case IROp::Vec4Unpack8To32: - case IROp::Vec4DuplicateUpperBitsAndShift1: - case IROp::Vec4Pack31To8: - case IROp::Vec4Pack32To8: - case IROp::Vec2Pack31To16: - case IROp::Vec2Pack32To16: - CompIR_VecPack(inst); - break; - - case IROp::Vec4ClampToZero: - case IROp::Vec2ClampToZero: - CompIR_VecClamp(inst); - break; - - case IROp::FSin: - case IROp::FCos: - case IROp::FRSqrt: - case IROp::FRecip: - case IROp::FAsin: - CompIR_FSpecial(inst); - break; - - case IROp::Interpret: - CompIR_Interpret(inst); - break; - - case IROp::Syscall: - case IROp::CallReplacement: - case IROp::Break: - CompIR_System(inst); - break; - - case IROp::Breakpoint: - case IROp::MemoryCheck: - CompIR_Breakpoint(inst); - break; - - case IROp::ValidateAddress8: - case IROp::ValidateAddress16: - case IROp::ValidateAddress32: - case IROp::ValidateAddress128: - CompIR_ValidateAddress(inst); - break; - - case IROp::ExitToConst: - case IROp::ExitToReg: - case IROp::ExitToPC: - CompIR_Exit(inst); - break; - - case IROp::ExitToConstIfEq: - case IROp::ExitToConstIfNeq: - case IROp::ExitToConstIfGtZ: - case IROp::ExitToConstIfGeZ: - case IROp::ExitToConstIfLtZ: - case IROp::ExitToConstIfLeZ: - case IROp::ExitToConstIfFpTrue: - case IROp::ExitToConstIfFpFalse: - CompIR_ExitIf(inst); - break; - - default: - _assert_msg_(false, "Unexpected IR op %d", (int)inst.op); - CompIR_Generic(inst); - break; + AddLinkableExit(compilingBlockNum_, pc, exitStart, len); } } -static u32 DoIRInst(uint64_t value) { - IRInst inst; - memcpy(&inst, &value, sizeof(inst)); +void RiscVJitBackend::OverwriteExit(int srcOffset, int len, int block_num) { + _dbg_assert_(len >= MIN_BLOCK_EXIT_LEN); - if constexpr (enableDebug) - debugSeenNotCompiledIR[(uint8_t)inst.op]++; + const IRNativeBlock *nativeBlock = GetNativeBlock(block_num); + if (nativeBlock) { + u8 *writable = GetWritablePtrFromCodePtr(GetBasePtr()) + srcOffset; + if (PlatformIsWXExclusive()) { + ProtectMemoryPages(writable, len, MEM_PROT_READ | MEM_PROT_WRITE); + } - return IRInterpret(currentMIPS, &inst, 1); + RiscVEmitter emitter(GetBasePtr() + srcOffset, writable); + emitter.QuickJ(SCRATCH1, GetBasePtr() + nativeBlock->checkedOffset); + int bytesWritten = (int)(emitter.GetWritableCodePtr() - writable); + if (bytesWritten < len) + emitter.ReserveCodeSpace(len - bytesWritten); + emitter.FlushIcache(); + + if (PlatformIsWXExclusive()) { + ProtectMemoryPages(writable, 16, MEM_PROT_READ | MEM_PROT_EXEC); + } + } } -void RiscVJit::CompIR_Generic(IRInst inst) { +void RiscVJitBackend::CompIR_Generic(IRInst inst) { // If we got here, we're going the slow way. uint64_t value; memcpy(&value, &inst, sizeof(inst)); @@ -456,7 +219,7 @@ void RiscVJit::CompIR_Generic(IRInst inst) { FlushAll(); LI(X10, value, SCRATCH2); SaveStaticRegisters(); - QuickCallFunction(&DoIRInst); + QuickCallFunction(&DoIRInst, SCRATCH2); LoadStaticRegisters(); // We only need to check the return value if it's a potential exit. @@ -473,36 +236,29 @@ void RiscVJit::CompIR_Generic(IRInst inst) { } } -static void DebugInterpretHit(const char *name) { - if (enableDebug) - debugSeenNotCompiled[name]++; -} - -void RiscVJit::CompIR_Interpret(IRInst inst) { +void RiscVJitBackend::CompIR_Interpret(IRInst inst) { MIPSOpcode op(inst.constant); // IR protects us against this being a branching instruction (well, hopefully.) FlushAll(); SaveStaticRegisters(); - if (enableDebug) { + if (DebugStatsEnabled()) { LI(X10, MIPSGetName(op)); - QuickCallFunction(&DebugInterpretHit); + QuickCallFunction(&NotifyMIPSInterpret, SCRATCH2); } LI(X10, (int32_t)inst.constant); - QuickCallFunction((const u8 *)MIPSGetInterpretFunc(op)); + QuickCallFunction((const u8 *)MIPSGetInterpretFunc(op), SCRATCH2); LoadStaticRegisters(); } -void RiscVJit::FlushAll() { +void RiscVJitBackend::FlushAll() { gpr.FlushAll(); fpr.FlushAll(); } -bool RiscVJit::DescribeCodePtr(const u8 *ptr, std::string &name) { +bool RiscVJitBackend::DescribeCodePtr(const u8 *ptr, std::string &name) const { // Used in disassembly viewer. - if (ptr == dispatcher_) { - name = "dispatcher"; - } else if (ptr == dispatcherPCInSCRATCH1_) { + if (ptr == dispatcherPCInSCRATCH1_) { name = "dispatcher (PC in SCRATCH1)"; } else if (ptr == dispatcherNoCheck_) { name = "dispatcherNoCheck"; @@ -510,81 +266,67 @@ bool RiscVJit::DescribeCodePtr(const u8 *ptr, std::string &name) { name = "saveStaticRegisters"; } else if (ptr == loadStaticRegisters_) { name = "loadStaticRegisters"; - } else if (ptr == enterDispatcher_) { - name = "enterDispatcher"; } else if (ptr == applyRoundingMode_) { name = "applyRoundingMode"; - } else if (!IsInSpace(ptr)) { - return false; } else { - int offset = (int)GetOffset(ptr); - int block_num = -1; - for (int i = 0; i < blocks_.GetNumBlocks(); ++i) { - const auto &b = blocks_.GetBlock(i); - // We allocate linearly. - if (b->GetTargetOffset() <= offset) - block_num = i; - if (b->GetTargetOffset() > offset) - break; - } - - if (block_num == -1) { - name = "(unknown or deleted block)"; - return true; - } - - const IRBlock *block = blocks_.GetBlock(block_num); - if (block) { - u32 start = 0, size = 0; - block->GetRange(start, size); - name = StringFromFormat("(block %d at %08x)", block_num, start); - return true; - } - return false; + return IRNativeBackend::DescribeCodePtr(ptr, name); } return true; } -bool RiscVJit::CodeInRange(const u8 *ptr) const { - return IsInSpace(ptr); -} - -bool RiscVJit::IsAtDispatchFetch(const u8 *ptr) const { - return ptr == dispatcherFetch_; -} - -const u8 *RiscVJit::GetDispatcher() const { - return dispatcher_; -} - -const u8 *RiscVJit::GetCrashHandler() const { - return crashHandler_; -} - -void RiscVJit::ClearCache() { - IRJit::ClearCache(); - +void RiscVJitBackend::ClearAllBlocks() { ClearCodeSpace(jitStartOffset_); FlushIcacheSection(region + jitStartOffset_, region + region_size - jitStartOffset_); + EraseAllLinks(-1); } -void RiscVJit::RestoreRoundingMode(bool force) { +void RiscVJitBackend::InvalidateBlock(IRBlock *block, int block_num) { + int offset = block->GetTargetOffset(); + u8 *writable = GetWritablePtrFromCodePtr(GetBasePtr()) + offset; + + // Overwrite the block with a jump to compile it again. + u32 pc = block->GetOriginalStart(); + if (pc != 0) { + // Hopefully we always have at least 16 bytes, which should be all we need. + if (PlatformIsWXExclusive()) { + ProtectMemoryPages(writable, 16, MEM_PROT_READ | MEM_PROT_WRITE); + } + + RiscVEmitter emitter(GetBasePtr() + offset, writable); + // We sign extend to ensure it will fit in 32-bit and 8 bytes LI. + // TODO: May need to change if dispatcher doesn't reload PC. + emitter.LI(SCRATCH1, (int32_t)pc); + emitter.QuickJ(R_RA, dispatcherPCInSCRATCH1_); + int bytesWritten = (int)(emitter.GetWritableCodePtr() - writable); + if (bytesWritten < MIN_BLOCK_NORMAL_LEN) + emitter.ReserveCodeSpace(MIN_BLOCK_NORMAL_LEN - bytesWritten); + emitter.FlushIcache(); + + if (PlatformIsWXExclusive()) { + ProtectMemoryPages(writable, 16, MEM_PROT_READ | MEM_PROT_EXEC); + } + } + + EraseAllLinks(block_num); +} + +void RiscVJitBackend::RestoreRoundingMode(bool force) { FSRMI(Round::NEAREST_EVEN); } -void RiscVJit::ApplyRoundingMode(bool force) { +void RiscVJitBackend::ApplyRoundingMode(bool force) { QuickCallFunction(applyRoundingMode_); } -void RiscVJit::MovFromPC(RiscVReg r) { +void RiscVJitBackend::MovFromPC(RiscVReg r) { LWU(r, CTXREG, offsetof(MIPSState, pc)); } -void RiscVJit::MovToPC(RiscVReg r) { +void RiscVJitBackend::MovToPC(RiscVReg r) { SW(r, CTXREG, offsetof(MIPSState, pc)); } -void RiscVJit::SaveStaticRegisters() { +void RiscVJitBackend::SaveStaticRegisters() { if (jo.useStaticAlloc) { QuickCallFunction(saveStaticRegisters_); } else { @@ -593,7 +335,7 @@ void RiscVJit::SaveStaticRegisters() { } } -void RiscVJit::LoadStaticRegisters() { +void RiscVJitBackend::LoadStaticRegisters() { if (jo.useStaticAlloc) { QuickCallFunction(loadStaticRegisters_); } else { @@ -601,16 +343,16 @@ void RiscVJit::LoadStaticRegisters() { } } -void RiscVJit::NormalizeSrc1(IRInst inst, RiscVReg *reg, RiscVReg tempReg, bool allowOverlap) { +void RiscVJitBackend::NormalizeSrc1(IRInst inst, RiscVReg *reg, RiscVReg tempReg, bool allowOverlap) { *reg = NormalizeR(inst.src1, allowOverlap ? 0 : inst.dest, tempReg); } -void RiscVJit::NormalizeSrc12(IRInst inst, RiscVReg *lhs, RiscVReg *rhs, RiscVReg lhsTempReg, RiscVReg rhsTempReg, bool allowOverlap) { +void RiscVJitBackend::NormalizeSrc12(IRInst inst, RiscVReg *lhs, RiscVReg *rhs, RiscVReg lhsTempReg, RiscVReg rhsTempReg, bool allowOverlap) { *lhs = NormalizeR(inst.src1, allowOverlap ? 0 : inst.dest, lhsTempReg); *rhs = NormalizeR(inst.src2, allowOverlap ? 0 : inst.dest, rhsTempReg); } -RiscVReg RiscVJit::NormalizeR(IRRegIndex rs, IRRegIndex rd, RiscVReg tempReg) { +RiscVReg RiscVJitBackend::NormalizeR(IRRegIndex rs, IRRegIndex rd, RiscVReg tempReg) { // For proper compare, we must sign extend so they both match or don't match. // But don't change pointers, in case one is SP (happens in LittleBigPlanet.) if (gpr.IsImm(rs) && gpr.GetImm(rs) == 0) { @@ -622,78 +364,4 @@ RiscVReg RiscVJit::NormalizeR(IRRegIndex rs, IRRegIndex rd, RiscVReg tempReg) { } } -RiscVBlockCacheDebugInterface::RiscVBlockCacheDebugInterface(IRBlockCache &irBlocks, RiscVJit &jit) - : irBlocks_(irBlocks), jit_(jit) {} - -int RiscVBlockCacheDebugInterface::GetNumBlocks() const { - return irBlocks_.GetNumBlocks(); -} - -int RiscVBlockCacheDebugInterface::GetBlockNumberFromStartAddress(u32 em_address, bool realBlocksOnly) const { - return irBlocks_.GetBlockNumberFromStartAddress(em_address, realBlocksOnly); -} - -void RiscVBlockCacheDebugInterface::GetBlockCodeRange(int blockNum, int *startOffset, int *size) const { - int blockOffset = irBlocks_.GetBlock(blockNum)->GetTargetOffset(); - int endOffset; - // We assume linear allocation. Maybe a bit dangerous, should always be right. - if (blockNum + 1 >= GetNumBlocks()) { - // Last block, get from current code pointer. - endOffset = (int)jit_.GetOffset(jit_.GetCodePointer()); - } else { - endOffset = irBlocks_.GetBlock(blockNum + 1)->GetTargetOffset(); - _assert_msg_(endOffset >= blockOffset, "Next block not sequential, block=%d/%08x, next=%d/%08x", blockNum, blockOffset, blockNum + 1, endOffset); - } - - *startOffset = blockOffset; - *size = endOffset - blockOffset; -} - -JitBlockDebugInfo RiscVBlockCacheDebugInterface::GetBlockDebugInfo(int blockNum) const { - JitBlockDebugInfo debugInfo = irBlocks_.GetBlockDebugInfo(blockNum); - -#if PPSSPP_ARCH(RISCV64) - int blockOffset, codeSize; - GetBlockCodeRange(blockNum, &blockOffset, &codeSize); - debugInfo.targetDisasm = DisassembleRV64(jit_.GetBasePtr() + blockOffset, codeSize); -#endif - return debugInfo; -} - -void RiscVBlockCacheDebugInterface::ComputeStats(BlockCacheStats &bcStats) const { - double totalBloat = 0.0; - double maxBloat = 0.0; - double minBloat = 1000000000.0; - int numBlocks = GetNumBlocks(); - for (int i = 0; i < numBlocks; ++i) { - const IRBlock &b = *irBlocks_.GetBlock(i); - - // RISC-V (jit) size. - int blockOffset, codeSize; - GetBlockCodeRange(i, &blockOffset, &codeSize); - if (codeSize == 0) - continue; - - // MIPS (PSP) size. - u32 origAddr, mipsBytes; - b.GetRange(origAddr, mipsBytes); - - double bloat = (double)codeSize / (double)mipsBytes; - if (bloat < minBloat) { - minBloat = bloat; - bcStats.minBloatBlock = origAddr; - } - if (bloat > maxBloat) { - maxBloat = bloat; - bcStats.maxBloatBlock = origAddr; - } - totalBloat += bloat; - bcStats.bloatMap[bloat] = origAddr; - } - bcStats.numBlocks = numBlocks; - bcStats.minBloat = minBloat; - bcStats.maxBloat = maxBloat; - bcStats.avgBloat = totalBloat / (double)numBlocks; -} - } // namespace MIPSComp diff --git a/Core/MIPS/RiscV/RiscVJit.h b/Core/MIPS/RiscV/RiscVJit.h index 74c221fecb..d8bba616ad 100644 --- a/Core/MIPS/RiscV/RiscVJit.h +++ b/Core/MIPS/RiscV/RiscVJit.h @@ -21,6 +21,7 @@ #include #include "Common/RiscVEmitter.h" #include "Core/MIPS/IR/IRJit.h" +#include "Core/MIPS/IR/IRNativeCommon.h" #include "Core/MIPS/JitCommon/JitState.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/MIPS/RiscV/RiscVRegCache.h" @@ -28,48 +29,24 @@ namespace MIPSComp { -class RiscVJit; - -class RiscVBlockCacheDebugInterface : public JitBlockCacheDebugInterface { +class RiscVJitBackend : public RiscVGen::RiscVCodeBlock, public IRNativeBackend { public: - RiscVBlockCacheDebugInterface(IRBlockCache &irBlocks, RiscVJit &jit); - int GetNumBlocks() const; - int GetBlockNumberFromStartAddress(u32 em_address, bool realBlocksOnly = true) const; - JitBlockDebugInfo GetBlockDebugInfo(int blockNum) const; - void ComputeStats(BlockCacheStats &bcStats) const; + RiscVJitBackend(MIPSState *mipsState, JitOptions &jo, IRBlockCache &blocks); + ~RiscVJitBackend(); -private: - void GetBlockCodeRange(int blockNum, int *startOffset, int *size) const; + bool DescribeCodePtr(const u8 *ptr, std::string &name) const override; - IRBlockCache &irBlocks_; - RiscVJit &jit_; -}; - -class RiscVJit : public RiscVGen::RiscVCodeBlock, public IRJit { -public: - RiscVJit(MIPSState *mipsState); - ~RiscVJit(); - - void RunLoopUntil(u64 globalticks) override; - - bool DescribeCodePtr(const u8 *ptr, std::string &name) override; - bool CodeInRange(const u8 *ptr) const override; - bool IsAtDispatchFetch(const u8 *ptr) const override; - const u8 *GetDispatcher() const override; - const u8 *GetCrashHandler() const override; - - void ClearCache() override; - - JitBlockCacheDebugInterface *GetBlockCacheDebugInterface() override; + void GenerateFixedCode(MIPSState *mipsState) override; + bool CompileBlock(IRBlock *block, int block_num, bool preload) override; + void ClearAllBlocks() override; + void InvalidateBlock(IRBlock *block, int block_num) override; protected: - bool CompileTargetBlock(IRBlock *block, int block_num, bool preload) override; - - void CompileIRInst(IRInst inst); + const CodeBlockCommon &CodeBlock() const override { + return *this; + } private: - void GenerateFixedCode(const JitOptions &jo); - void RestoreRoundingMode(bool force = false); void ApplyRoundingMode(bool force = false); void MovFromPC(RiscVGen::RiscVReg r); @@ -81,48 +58,51 @@ private: // Note: destroys SCRATCH1. void FlushAll(); - void CompIR_Arith(IRInst inst); - void CompIR_Assign(IRInst inst); - void CompIR_Basic(IRInst inst); - void CompIR_Bits(IRInst inst); - void CompIR_Breakpoint(IRInst inst); - void CompIR_Compare(IRInst inst); - void CompIR_CondAssign(IRInst inst); - void CompIR_CondStore(IRInst inst); - void CompIR_Div(IRInst inst); - void CompIR_Exit(IRInst inst); - void CompIR_ExitIf(IRInst inst); - void CompIR_FArith(IRInst inst); - void CompIR_FAssign(IRInst inst); - void CompIR_FCompare(IRInst inst); - void CompIR_FCondAssign(IRInst inst); - void CompIR_FCvt(IRInst inst); - void CompIR_FLoad(IRInst inst); - void CompIR_FRound(IRInst inst); - void CompIR_FSat(IRInst inst); - void CompIR_FSpecial(IRInst inst); - void CompIR_FStore(IRInst inst); - void CompIR_Generic(IRInst inst); - void CompIR_HiLo(IRInst inst); - void CompIR_Interpret(IRInst inst); - void CompIR_Load(IRInst inst); - void CompIR_LoadShift(IRInst inst); - void CompIR_Logic(IRInst inst); - void CompIR_Mult(IRInst inst); - void CompIR_RoundingMode(IRInst inst); - void CompIR_Shift(IRInst inst); - void CompIR_Store(IRInst inst); - void CompIR_StoreShift(IRInst inst); - void CompIR_System(IRInst inst); - void CompIR_Transfer(IRInst inst); - void CompIR_VecArith(IRInst inst); - void CompIR_VecAssign(IRInst inst); - void CompIR_VecClamp(IRInst inst); - void CompIR_VecHoriz(IRInst inst); - void CompIR_VecLoad(IRInst inst); - void CompIR_VecPack(IRInst inst); - void CompIR_VecStore(IRInst inst); - void CompIR_ValidateAddress(IRInst inst); + void WriteConstExit(uint32_t pc); + void OverwriteExit(int srcOffset, int len, int block_num) override; + + void CompIR_Arith(IRInst inst) override; + void CompIR_Assign(IRInst inst) override; + void CompIR_Basic(IRInst inst) override; + void CompIR_Bits(IRInst inst) override; + void CompIR_Breakpoint(IRInst inst) override; + void CompIR_Compare(IRInst inst) override; + void CompIR_CondAssign(IRInst inst) override; + void CompIR_CondStore(IRInst inst) override; + void CompIR_Div(IRInst inst) override; + void CompIR_Exit(IRInst inst) override; + void CompIR_ExitIf(IRInst inst) override; + void CompIR_FArith(IRInst inst) override; + void CompIR_FAssign(IRInst inst) override; + void CompIR_FCompare(IRInst inst) override; + void CompIR_FCondAssign(IRInst inst) override; + void CompIR_FCvt(IRInst inst) override; + void CompIR_FLoad(IRInst inst) override; + void CompIR_FRound(IRInst inst) override; + void CompIR_FSat(IRInst inst) override; + void CompIR_FSpecial(IRInst inst) override; + void CompIR_FStore(IRInst inst) override; + void CompIR_Generic(IRInst inst) override; + void CompIR_HiLo(IRInst inst) override; + void CompIR_Interpret(IRInst inst) override; + void CompIR_Load(IRInst inst) override; + void CompIR_LoadShift(IRInst inst) override; + void CompIR_Logic(IRInst inst) override; + void CompIR_Mult(IRInst inst) override; + void CompIR_RoundingMode(IRInst inst) override; + void CompIR_Shift(IRInst inst) override; + void CompIR_Store(IRInst inst) override; + void CompIR_StoreShift(IRInst inst) override; + void CompIR_System(IRInst inst) override; + void CompIR_Transfer(IRInst inst) override; + void CompIR_VecArith(IRInst inst) override; + void CompIR_VecAssign(IRInst inst) override; + void CompIR_VecClamp(IRInst inst) override; + void CompIR_VecHoriz(IRInst inst) override; + void CompIR_VecLoad(IRInst inst) override; + void CompIR_VecPack(IRInst inst) override; + void CompIR_VecStore(IRInst inst) override; + void CompIR_ValidateAddress(IRInst inst) override; void SetScratch1ToSrc1Address(IRReg src1); // Modifies SCRATCH regs. @@ -131,27 +111,34 @@ private: void NormalizeSrc12(IRInst inst, RiscVGen::RiscVReg *lhs, RiscVGen::RiscVReg *rhs, RiscVGen::RiscVReg lhsTempReg, RiscVGen::RiscVReg rhsTempReg, bool allowOverlap); RiscVGen::RiscVReg NormalizeR(IRRegIndex rs, IRRegIndex rd, RiscVGen::RiscVReg tempReg); + JitOptions &jo; RiscVRegCache gpr; RiscVRegCacheFPU fpr; - RiscVBlockCacheDebugInterface debugInterface_; - - const u8 *enterDispatcher_ = nullptr; const u8 *outerLoop_ = nullptr; const u8 *outerLoopPCInSCRATCH1_ = nullptr; const u8 *dispatcherCheckCoreState_ = nullptr; const u8 *dispatcherPCInSCRATCH1_ = nullptr; - const u8 *dispatcher_ = nullptr; const u8 *dispatcherNoCheck_ = nullptr; - const u8 *dispatcherFetch_ = nullptr; const u8 *applyRoundingMode_ = nullptr; const u8 *saveStaticRegisters_ = nullptr; const u8 *loadStaticRegisters_ = nullptr; - const u8 *crashHandler_ = nullptr; - int jitStartOffset_ = 0; + int compilingBlockNum_ = -1; + int logBlocks_ = 0; +}; + +class RiscVJit : public IRNativeJit { +public: + RiscVJit(MIPSState *mipsState) + : IRNativeJit(mipsState), rvBackend_(mipsState, jo, blocks_) { + Init(rvBackend_); + } + +private: + RiscVJitBackend rvBackend_; }; } // namespace MIPSComp diff --git a/Core/MIPS/RiscV/RiscVRegCacheFPU.cpp b/Core/MIPS/RiscV/RiscVRegCacheFPU.cpp index c99261b9f9..1ecb7b4847 100644 --- a/Core/MIPS/RiscV/RiscVRegCacheFPU.cpp +++ b/Core/MIPS/RiscV/RiscVRegCacheFPU.cpp @@ -255,6 +255,20 @@ void RiscVRegCacheFPU::Map4DirtyInIn(IRRegIndex rdbase, IRRegIndex rsbase, IRReg ReleaseSpillLock(rdbase + i, rsbase + i, rtbase + i); } +RiscVReg RiscVRegCacheFPU::Map4DirtyInTemp(IRRegIndex rdbase, IRRegIndex rsbase, bool avoidLoad) { + for (int i = 0; i < 4; ++i) + SpillLock(rdbase + i, rsbase + i); + bool load = !avoidLoad || (rdbase < rsbase + 4 && rdbase + 4 > rsbase); + for (int i = 0; i < 4; ++i) + MapReg(rdbase + i, load ? MIPSMap::DIRTY : MIPSMap::NOINIT); + for (int i = 0; i < 4; ++i) + MapReg(rsbase + i); + RiscVReg temp = AllocateReg(); + for (int i = 0; i < 4; ++i) + ReleaseSpillLock(rdbase + i, rsbase + i); + return temp; +} + void RiscVRegCacheFPU::FlushRiscVReg(RiscVReg r) { _dbg_assert_(r >= F0 && r <= F31); int reg = r - F0; diff --git a/Core/MIPS/RiscV/RiscVRegCacheFPU.h b/Core/MIPS/RiscV/RiscVRegCacheFPU.h index 9edda169aa..2331a4c986 100644 --- a/Core/MIPS/RiscV/RiscVRegCacheFPU.h +++ b/Core/MIPS/RiscV/RiscVRegCacheFPU.h @@ -69,6 +69,7 @@ public: RiscVGen::RiscVReg MapDirtyInTemp(IRRegIndex rd, IRRegIndex rs, bool avoidLoad = true); void Map4DirtyIn(IRRegIndex rdbase, IRRegIndex rsbase, bool avoidLoad = true); void Map4DirtyInIn(IRRegIndex rdbase, IRRegIndex rsbase, IRRegIndex rtbase, bool avoidLoad = true); + RiscVGen::RiscVReg Map4DirtyInTemp(IRRegIndex rdbase, IRRegIndex rsbase, bool avoidLoad = true); void FlushBeforeCall(); void FlushAll(); void FlushR(IRRegIndex r); diff --git a/Core/MIPS/x86/IRToX86.cpp b/Core/MIPS/x86/IRToX86.cpp index f543025cdb..a9ba6761b9 100644 --- a/Core/MIPS/x86/IRToX86.cpp +++ b/Core/MIPS/x86/IRToX86.cpp @@ -259,6 +259,7 @@ void IRToX86::ConvertIRToNative(const IRInst *instructions, int count, const u32 // Cross moves case IROp::FMovFromGPR: case IROp::FMovToGPR: + case IROp::FpCondFromReg: case IROp::FpCondToReg: case IROp::VfpuCtrlToReg: @@ -266,7 +267,6 @@ void IRToX86::ConvertIRToNative(const IRInst *instructions, int count, const u32 case IROp::SetCtrlVFPU: case IROp::SetCtrlVFPUReg: case IROp::SetCtrlVFPUFReg: - case IROp::ZeroFpCond: // Block Exits case IROp::ExitToConst: diff --git a/Core/MemMap.h b/Core/MemMap.h index 7a0af46257..67e17babcd 100644 --- a/Core/MemMap.h +++ b/Core/MemMap.h @@ -67,7 +67,7 @@ extern u32 g_PSPModel; // UWP has such limited memory management that we need to mask // even in 64-bit mode. Also, when using the sanitizer, we need to mask as well. -#if PPSSPP_ARCH(32BIT) || PPSSPP_PLATFORM(UWP) || USE_ASAN || PPSSPP_PLATFORM(IOS) +#if PPSSPP_ARCH(32BIT) || PPSSPP_PLATFORM(UWP) || USE_ASAN || PPSSPP_PLATFORM(IOS) || defined(__EMSCRIPTEN__) #define MASKED_PSP_MEMORY #endif diff --git a/Core/RetroAchievements.cpp b/Core/RetroAchievements.cpp index 22b3c3bcee..15740d6ce7 100644 --- a/Core/RetroAchievements.cpp +++ b/Core/RetroAchievements.cpp @@ -244,22 +244,37 @@ static void event_handler_callback(const rc_client_event_t *event, rc_client_t * break; } case RC_CLIENT_EVENT_LEADERBOARD_STARTED: - // A leaderboard attempt has started. The handler may show a message with the leaderboard title and /or description indicating the attempt started. - INFO_LOG(ACHIEVEMENTS, "Leaderboard attempt started: %s", event->leaderboard->title); - g_OSD.Show(OSDType::MESSAGE_INFO, ApplySafeSubstitutions(ac->T("%1: Leaderboard attempt started"), event->leaderboard->title), DeNull(event->leaderboard->description), 3.0f); - break; case RC_CLIENT_EVENT_LEADERBOARD_FAILED: - INFO_LOG(ACHIEVEMENTS, "Leaderboard attempt failed: %s", event->leaderboard->title); - g_OSD.Show(OSDType::MESSAGE_INFO, ApplySafeSubstitutions(ac->T("%1: Leaderboard attempt failed"), event->leaderboard->title), 3.0f); - // A leaderboard attempt has failed. + { + bool started = event->type == RC_CLIENT_EVENT_LEADERBOARD_STARTED; + // A leaderboard attempt has started. The handler may show a message with the leaderboard title and /or description indicating the attempt started. + const char *title = ""; + const char *description = ""; + // Hack around some problematic events in Burnout Legends. Hopefully this can be fixed in the backend. + if (strlen(event->leaderboard->title) > 0) { + title = event->leaderboard->title; + description = event->leaderboard->description; + } else { + title = event->leaderboard->description; + } + INFO_LOG(ACHIEVEMENTS, "Attempt %s: %s", started ? "started" : "failed", title); + g_OSD.ShowLeaderboardStartEnd(ApplySafeSubstitutions(ac->T(started ? "%1: Attempt started" : "%1: Attempt failed"), title), description, started); break; + } case RC_CLIENT_EVENT_LEADERBOARD_SUBMITTED: + { INFO_LOG(ACHIEVEMENTS, "Leaderboard result submitted: %s", event->leaderboard->title); - g_OSD.Show(OSDType::MESSAGE_SUCCESS, - ApplySafeSubstitutions(ac->T("Submitted %1 for %2"), DeNull(event->leaderboard->tracker_value), DeNull(event->leaderboard->title)), - DeNull(event->leaderboard->description), 3.0f); + const char *title = ""; + // Hack around some problematic events in Burnout Legends. Hopefully this can be fixed in the backend. + if (strlen(event->leaderboard->title) > 0) { + title = event->leaderboard->title; + } else { + title = event->leaderboard->description; + } + g_OSD.ShowLeaderboardSubmitted(ApplySafeSubstitutions(ac->T("Submitted %1 for %2"), DeNull(event->leaderboard->tracker_value), title), ""); System_PostUIMessage("play_sound", "leaderboard_submitted"); break; + } case RC_CLIENT_EVENT_ACHIEVEMENT_CHALLENGE_INDICATOR_SHOW: INFO_LOG(ACHIEVEMENTS, "Challenge indicator show: %s", event->achievement->title); g_OSD.ShowChallengeIndicator(event->achievement->id, true); @@ -281,6 +296,7 @@ static void event_handler_callback(const rc_client_event_t *event, rc_client_t * // If a progress indicator is already visible, it should be updated with the new icon and text, and the two second timer should be restarted. g_OSD.ShowAchievementProgress(event->achievement->id, true); break; + /* case RC_CLIENT_EVENT_ACHIEVEMENT_PROGRESS_INDICATOR_UPDATE: INFO_LOG(ACHIEVEMENTS, "Progress indicator update: %s, progress: '%s' (%f)", event->achievement->title, event->achievement->measured_progress, event->achievement->measured_percent); g_OSD.ShowAchievementProgress(event->achievement->id, true); @@ -293,6 +309,7 @@ static void event_handler_callback(const rc_client_event_t *event, rc_client_t * // If a progress indicator is already visible, it should be updated with the new icon and text, and the two second timer should be restarted. g_OSD.ShowAchievementProgress(0, false); break; + */ case RC_CLIENT_EVENT_LEADERBOARD_TRACKER_SHOW: INFO_LOG(ACHIEVEMENTS, "Leaderboard tracker show: '%s' (id %d)", event->leaderboard_tracker->display, event->leaderboard_tracker->id); // A leaderboard_tracker has become active. The handler should show the tracker text on screen. diff --git a/Core/Util/PortManager.h b/Core/Util/PortManager.h index 31b9f67f95..e5d778283f 100644 --- a/Core/Util/PortManager.h +++ b/Core/Util/PortManager.h @@ -37,18 +37,12 @@ #include #include -#ifdef _MSC_VER -#pragma pack(push,1) -#endif -typedef struct UPnPArgs { +struct UPnPArgs { int cmd; std::string protocol; unsigned short port; unsigned short intport; -} PACK; -#ifdef _MSC_VER -#pragma pack(pop) -#endif +}; #define IP_PROTOCOL_TCP "TCP" #define IP_PROTOCOL_UDP "UDP" diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index de00bf5d6a..5c0858791c 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -106,7 +106,7 @@ int DrawEngineCommon::ComputeNumVertsToDecode() const { void DrawEngineCommon::DecodeVerts(u8 *dest) { int decodeCounter = decodeCounter_; for (; decodeCounter < numDrawCalls_; decodeCounter++) { - DecodeVertsStep(dest, decodeCounter, decodedVerts_, &drawCalls_[decodeCounter].uvScale); // NOTE! DecodeVertsStep can modify decodeCounter_! + DecodeVertsStep(dest, decodeCounter, decodedVerts_, &drawCalls_[decodeCounter].uvScale); // NOTE! DecodeVertsStep can modify the decodeCounter parameter! } decodeCounter_ = decodeCounter; @@ -802,8 +802,8 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti prevPrim_ = prim; } - // If vtype has changed, setup the vertex decoder. - if (vertTypeID != lastVType_ || !dec_) { + // If vtype has changed, setup the vertex decoder. Don't need to nullcheck dec_ since we set lastVType_ to an invalid value whenever we null it. + if (vertTypeID != lastVType_) { dec_ = GetVertexDecoder(vertTypeID); lastVType_ = vertTypeID; } @@ -811,7 +811,7 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti *bytesRead = vertexCount * dec_->VertexSize(); // Check that we have enough vertices to form the requested primitive. - if ((vertexCount < 2 && prim > 0) || (vertexCount < 3 && prim > GE_PRIM_LINE_STRIP && prim != GE_PRIM_RECTANGLES)) + if (vertexCount < 3 && ((vertexCount < 2 && prim > 0) || (prim > GE_PRIM_LINE_STRIP && prim != GE_PRIM_RECTANGLES))) return; DeferredDrawCall &dc = drawCalls_[numDrawCalls_]; @@ -832,13 +832,13 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti numDrawCalls_++; vertexCountInDrawCalls_ += vertexCount; - if (decOptions_.applySkinInDecode && (vertTypeID & GE_VTYPE_WEIGHT_MASK)) { + if ((vertTypeID & GE_VTYPE_WEIGHT_MASK) && decOptions_.applySkinInDecode) { DecodeVertsStep(decoded_, decodeCounter_, decodedVerts_, &dc.uvScale); decodeCounter_++; } if (prim == GE_PRIM_RECTANGLES && (gstate.getTextureAddress(0) & 0x3FFFFFFF) == (gstate.getFrameBufAddress() & 0x3FFFFFFF)) { - // Rendertarget == texture? Shouldn't happen. Still, try some mitigations. + // This prevents issues with consecutive self-renders in Ridge Racer. gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); DispatchFlush(); } diff --git a/GPU/Common/GPUDebugInterface.h b/GPU/Common/GPUDebugInterface.h index 54ff31481e..974ebc2413 100644 --- a/GPU/Common/GPUDebugInterface.h +++ b/GPU/Common/GPUDebugInterface.h @@ -252,14 +252,6 @@ public: virtual bool GetOutputFramebuffer(GPUDebugBuffer &buffer) { return false; } - - // TODO: - // cached framebuffers / textures / vertices? - // get content of specific framebuffer / texture? - // vertex / texture decoding? - - // Note: Wanted to name it GetProfileString but clashes with a Windows API. - virtual std::string GetGpuProfileString() { return ""; } }; bool GPUDebugInitExpression(GPUDebugInterface *g, const char *str, PostfixExpression &exp); diff --git a/GPU/Common/PostShader.cpp b/GPU/Common/PostShader.cpp index 51864c903c..c8321e9315 100644 --- a/GPU/Common/PostShader.cpp +++ b/GPU/Common/PostShader.cpp @@ -100,7 +100,7 @@ void LoadPostShaderInfo(Draw::DrawContext *draw, const std::vector &direct // Alright, let's loop through the sections and see if any is a shader. for (size_t i = 0; i < ini.Sections().size(); i++) { - Section §ion = ini.Sections()[i]; + Section §ion = *(ini.Sections()[i].get()); std::string shaderType; section.Get("Type", &shaderType, "render"); diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index bf05e7a02e..5afc2b5be7 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -142,7 +142,7 @@ void TextureCacheCommon::StartFrame() { timesInvalidatedAllThisFrame_ = 0; replacementTimeThisFrame_ = 0.0; - if (g_Config.bShowDebugStats) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS) { gpuStats.numReplacerTrackedTex = replacer_.GetNumTrackedTextures(); gpuStats.numCachedReplacedTextures = replacer_.GetNumCachedReplacedTextures(); } diff --git a/GPU/Common/TextureDecoder.cpp b/GPU/Common/TextureDecoder.cpp index 32da2dffa9..da58590db8 100644 --- a/GPU/Common/TextureDecoder.cpp +++ b/GPU/Common/TextureDecoder.cpp @@ -243,8 +243,13 @@ static u32 QuickTexHashNonSSE(const void *checkp, u32 size) { if (((intptr_t)checkp & 0xf) == 0 && (size & 0x3f) == 0) { static const u16 cursor2_initial[8] = {0xc00bU, 0x9bd9U, 0x4b73U, 0xb651U, 0x4d9bU, 0x4309U, 0x0083U, 0x0001U}; union u32x4_u16x8 { +#if defined(__GNUC__) + uint32_t x32 __attribute__((vector_size(16))); + uint16_t x16 __attribute__((vector_size(16))); +#else u32 x32[4]; u16 x16[8]; +#endif }; u32x4_u16x8 cursor{}; u32x4_u16x8 cursor2; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index d333b9f2f9..41c0abc253 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -309,8 +309,3 @@ void GPU_GLES::GetStats(char *buffer, size_t bufsize) { shaderManagerGL_->GetNumPrograms() ); } - -std::string GPU_GLES::GetGpuProfileString() { - GLRenderManager *rm = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); - return rm->GetGpuProfileString(); -} diff --git a/GPU/GLES/GPU_GLES.h b/GPU/GLES/GPU_GLES.h index 5b56504eea..9e03285ee9 100644 --- a/GPU/GLES/GPU_GLES.h +++ b/GPU/GLES/GPU_GLES.h @@ -51,8 +51,6 @@ public: void BeginHostFrame() override; void EndHostFrame() override; - std::string GetGpuProfileString() override; - protected: void FinishDeferred() override; diff --git a/GPU/Vulkan/DebugVisVulkan.cpp b/GPU/Vulkan/DebugVisVulkan.cpp index 7fa7b55fe0..f259fafe8f 100644 --- a/GPU/Vulkan/DebugVisVulkan.cpp +++ b/GPU/Vulkan/DebugVisVulkan.cpp @@ -98,9 +98,6 @@ void DrawGPUMemoryVis(UIContext *ui, GPUInterface *gpu) { } void DrawGPUProfilerVis(UIContext *ui, GPUInterface *gpu) { - if (!gpu) { - return; - } using namespace Draw; const int padding = 10 + System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_LEFT); const int starty = 50 + System_GetPropertyFloat(SYSPROP_DISPLAY_SAFE_INSET_TOP); @@ -115,8 +112,7 @@ void DrawGPUProfilerVis(UIContext *ui, GPUInterface *gpu) { scale = 0.7f; } - GPUCommon *gpuCommon = static_cast(gpu); - std::string text = gpuCommon->GetGpuProfileString(); + std::string text = ui->GetDrawContext()->GetGpuProfileString(); ui->SetFontScale(0.4f, 0.4f); ui->DrawTextShadow(text.c_str(), x, y, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index 7146123a65..340d2391fa 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -499,8 +499,3 @@ std::string GPU_Vulkan::DebugGetShaderString(std::string id, DebugShaderType typ return GPUCommonHW::DebugGetShaderString(id, type, stringType); } } - -std::string GPU_Vulkan::GetGpuProfileString() { - VulkanRenderManager *rm = (VulkanRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); - return rm->GetGpuProfileString(); -} diff --git a/GPU/Vulkan/GPU_Vulkan.h b/GPU/Vulkan/GPU_Vulkan.h index 1c7f76756a..d5bae97988 100644 --- a/GPU/Vulkan/GPU_Vulkan.h +++ b/GPU/Vulkan/GPU_Vulkan.h @@ -59,8 +59,6 @@ public: return textureCacheVulkan_; } - std::string GetGpuProfileString() override; - protected: void FinishDeferred() override; void CheckRenderResized() override; diff --git a/Qt/QtMain.cpp b/Qt/QtMain.cpp index a787d95d6d..52c738209d 100644 --- a/Qt/QtMain.cpp +++ b/Qt/QtMain.cpp @@ -475,7 +475,7 @@ void MainUI::EmuThreadFunc() { emuThreadState = (int)EmuThreadState::RUNNING; while (emuThreadState != (int)EmuThreadState::QUIT_REQUESTED) { updateAccelerometer(); - UpdateRunLoop(); + UpdateRunLoop(graphicsContext); } emuThreadState = (int)EmuThreadState::STOPPED; @@ -719,7 +719,7 @@ void MainUI::paintGL() { #endif updateAccelerometer(); if (emuThreadState == (int)EmuThreadState::DISABLED) { - UpdateRunLoop(); + UpdateRunLoop(graphicsContext); } else { graphicsContext->ThreadFrame(); // Do the rest in EmuThreadFunc diff --git a/Qt/QtMain.h b/Qt/QtMain.h index 39cce11f77..d1cf6c7d40 100644 --- a/Qt/QtMain.h +++ b/Qt/QtMain.h @@ -70,7 +70,6 @@ public: // See TODO in constructor. // renderManager_->SwapInterval(interval); } - void SwapBuffers() override {} void Resize() override {} Draw::DrawContext *GetDrawContext() override { diff --git a/Qt/mainwindow.cpp b/Qt/mainwindow.cpp index 21cfcde0f8..6f9722d496 100644 --- a/Qt/mainwindow.cpp +++ b/Qt/mainwindow.cpp @@ -587,8 +587,6 @@ void MainWindow::createMenus() ->addDisableState(UISTATE_MENU); debugMenu->add(new MenuAction(this, SLOT(dumpNextAct()), QT_TR_NOOP("D&ump next frame to log"))) ->addDisableState(UISTATE_MENU); - debugMenu->add(new MenuAction(this, SLOT(statsAct()), QT_TR_NOOP("Show debu&g statistics"))) - ->addEventChecked(&g_Config.bShowDebugStats); debugMenu->addSeparator(); debugMenu->add(new MenuAction(this, SLOT(consoleAct()), QT_TR_NOOP("&Log console"), Qt::CTRL + Qt::Key_L)) ->addDisableState(UISTATE_MENU); diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 78981436c0..84b33bcf7a 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -178,10 +178,6 @@ private slots: void fullscrAct(); void raiseTopMost(); - void statsAct() { - g_Config.bShowDebugStats = !g_Config.bShowDebugStats; - System_PostUIMessage("clear jit", ""); - } // Help void websiteAct(); diff --git a/SDL/CocoaBarItems.mm b/SDL/CocoaBarItems.mm index 444124e208..e1bc11a398 100644 --- a/SDL/CocoaBarItems.mm +++ b/SDL/CocoaBarItems.mm @@ -217,7 +217,7 @@ void OSXOpenURL(const char *url) { item.state = [self controlStateForBool:g_Config.bIgnoreBadMemAccess]; break; case 12: - item.state = [self controlStateForBool:g_Config.bShowDebugStats]; + item.state = [self controlStateForBool:(DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS]; break; default: item.enabled = state == UISTATE_INGAME ? YES : NO; @@ -405,7 +405,7 @@ void OSXOpenURL(const char *url) { copyBaseAddr.target = self; copyBaseAddr.tag = 11; - MENU_ITEM(showDebugStatsAction, DESKTOPUI_LOCALIZED("Show Debug Statistics"), @selector(toggleShowDebugStats:), g_Config.bShowDebugStats, 12) + MENU_ITEM(showDebugStatsAction, DESKTOPUI_LOCALIZED("Show Debug Statistics"), @selector(toggleShowDebugStats:), ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS), 12) [parent addItem:loadSymbolMapAction]; [parent addItem:saveMapFileAction]; @@ -541,9 +541,18 @@ TOGGLE_METHOD(AutoFrameSkip, g_Config.bAutoFrameSkip, g_Config.UpdateAfterSettin TOGGLE_METHOD(SoftwareRendering, g_Config.bSoftwareRendering) TOGGLE_METHOD(FullScreen, g_Config.bFullScreen, System_MakeRequest(SystemRequestType::TOGGLE_FULLSCREEN_STATE, 0, g_Config.UseFullScreen() ? "1" : "0", "", 3)) // TOGGLE_METHOD(VSync, g_Config.bVSync) -TOGGLE_METHOD(ShowDebugStats, g_Config.bShowDebugStats, System_PostUIMessage("clear jit", "")) #undef TOGGLE_METHOD +-(void)toggleShowDebugStats: (NSMenuItem *)item { \ + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS) { + g_Config.iDebugOverlay = (int)DebugOverlay::OFF; + } else { + g_Config.iDebugOverlay = (int)DebugOverlay::DEBUG_STATS; + } + System_PostUIMessage("clear jit", ""); + item.state = [self controlStateForBool: (DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS]; \ +} + -(void)setToggleShowCounterItem: (NSMenuItem *)item { [self addOrRemoveInteger:(int)(item.tag - 100) to:&g_Config.iShowStatusFlags]; item.state = [self controlStateForBool:g_Config.iShowStatusFlags & item.tag]; diff --git a/SDL/SDLGLGraphicsContext.cpp b/SDL/SDLGLGraphicsContext.cpp index 91b89a4966..462cf25996 100644 --- a/SDL/SDLGLGraphicsContext.cpp +++ b/SDL/SDLGLGraphicsContext.cpp @@ -429,7 +429,7 @@ int SDLGLGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, int h, #else SDL_GL_SwapWindow(window_); #endif - }, false); + }); renderManager_->SetSwapIntervalFunction([&](int interval) { INFO_LOG(G3D, "SDL SwapInterval: %d", interval); diff --git a/SDL/SDLGLGraphicsContext.h b/SDL/SDLGLGraphicsContext.h index 95d627deda..b71b99349a 100644 --- a/SDL/SDLGLGraphicsContext.h +++ b/SDL/SDLGLGraphicsContext.h @@ -19,10 +19,6 @@ public: void Shutdown() override; void ShutdownFromRenderThread() override; - void SwapBuffers() override { - // Do nothing, the render thread takes care of this. - } - // Gets forwarded to the render thread. void SwapInterval(int interval) override; diff --git a/SDL/SDLJoystick.cpp b/SDL/SDLJoystick.cpp index f51335912f..2d41e363eb 100644 --- a/SDL/SDLJoystick.cpp +++ b/SDL/SDLJoystick.cpp @@ -155,7 +155,7 @@ InputKeyCode SDLJoystick::getKeycodeForButton(SDL_GameControllerButton button) { } } -void SDLJoystick::ProcessInput(SDL_Event &event){ +void SDLJoystick::ProcessInput(const SDL_Event &event){ switch (event.type) { case SDL_CONTROLLERBUTTONDOWN: if (event.cbutton.state == SDL_PRESSED) { diff --git a/SDL/SDLJoystick.h b/SDL/SDLJoystick.h index 1046a5f283..e91bfd0b5c 100644 --- a/SDL/SDLJoystick.h +++ b/SDL/SDLJoystick.h @@ -20,7 +20,7 @@ public: ~SDLJoystick(); void registerEventHandler(); - void ProcessInput(SDL_Event &event); + void ProcessInput(const SDL_Event &event); private: void setUpController(int deviceIndex); diff --git a/SDL/SDLMain.cpp b/SDL/SDLMain.cpp index 955592a492..86bd191316 100644 --- a/SDL/SDLMain.cpp +++ b/SDL/SDLMain.cpp @@ -64,6 +64,12 @@ SDLJoystick *joystick = NULL; #include "SDLGLGraphicsContext.h" #include "SDLVulkanGraphicsContext.h" +#if PPSSPP_PLATFORM(MAC) +#include "SDL2/SDL_vulkan.h" +#else +#include "SDL_vulkan.h" +#endif + #if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS) #include "UI/DarwinFileSystemServices.h" #endif @@ -85,9 +91,14 @@ static bool g_RestartRequested = false; static int g_DesktopWidth = 0; static int g_DesktopHeight = 0; +static float g_DesktopDPI = 1.0f; +static float g_ForcedDPI = 0.0f; // if this is 0.0f, use g_DesktopDPI static float g_RefreshRate = 60.f; static int g_sampleRate = 44100; +static int g_frameCount = 0; +static bool g_rebootEmuThread = false; + static SDL_AudioSpec g_retFmt; // Window state to be transferred to the main SDL thread. @@ -173,6 +184,27 @@ static void StopSDLAudioDevice() { } } +static void UpdateScreenDPI(SDL_Window *window) { + int drawable_width, window_width; + SDL_GetWindowSize(window, &window_width, NULL); + + if (g_Config.iGPUBackend == (int)GPUBackend::OPENGL) + SDL_GL_GetDrawableSize(window, &drawable_width, NULL); + else if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) + SDL_Vulkan_GetDrawableSize(window, &drawable_width, NULL); + + // Round up a little otherwise there would be a gap sometimes + // in fractional scaling + g_DesktopDPI = ((float) drawable_width + 1.0f) / window_width; + + // Temporary hack +#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS) + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { + g_DesktopDPI = 1.0f; + } +#endif +} + // Simple implementations of System functions @@ -495,6 +527,8 @@ float System_GetPropertyFloat(SystemProperty prop) { switch (prop) { case SYSPROP_DISPLAY_REFRESH_RATE: return g_RefreshRate; + case SYSPROP_DISPLAY_DPI: + return (g_ForcedDPI == 0.0f ? g_DesktopDPI : g_ForcedDPI) * 96.0; case SYSPROP_DISPLAY_SAFE_INSET_LEFT: case SYSPROP_DISPLAY_SAFE_INSET_RIGHT: case SYSPROP_DISPLAY_SAFE_INSET_TOP: @@ -622,7 +656,7 @@ static void EmuThreadFunc(GraphicsContext *graphicsContext) { NativeInitGraphics(graphicsContext); while (emuThreadState != (int)EmuThreadState::QUIT_REQUESTED) { - UpdateRunLoop(); + UpdateRunLoop(graphicsContext); } emuThreadState = (int)EmuThreadState::STOPPED; graphicsContext->StopThread(); @@ -644,6 +678,419 @@ static void EmuThreadJoin() { emuThread = std::thread(); } +struct InputStateTracker { + void TranslateMouseWheel() { + // SDL2 doesn't consider the mousewheel a button anymore + // so let's send the KEY_UP if it was moved after some frames + if (mouseWheelMovedUpFrames > 0) { + mouseWheelMovedUpFrames--; + if (mouseWheelMovedUpFrames == 0) { + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; + key.flags = KEY_UP; + NativeKey(key); + } + } + if (mouseWheelMovedDownFrames > 0) { + mouseWheelMovedDownFrames--; + if (mouseWheelMovedDownFrames == 0) { + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; + key.flags = KEY_UP; + NativeKey(key); + } + } + } + + void MouseControl() { + // Disabled by default, needs a workaround to map to psp keys. + if (g_Config.bMouseControl) { + float scaleFactor_x = g_display.dpi_scale_x * 0.1 * g_Config.fMouseSensitivity; + float scaleFactor_y = g_display.dpi_scale_y * 0.1 * g_Config.fMouseSensitivity; + + AxisInput axisX, axisY; + axisX.axisId = JOYSTICK_AXIS_MOUSE_REL_X; + axisX.deviceId = DEVICE_ID_MOUSE; + axisX.value = std::max(-1.0f, std::min(1.0f, mouseDeltaX * scaleFactor_x)); + axisY.axisId = JOYSTICK_AXIS_MOUSE_REL_Y; + axisY.deviceId = DEVICE_ID_MOUSE; + axisY.value = std::max(-1.0f, std::min(1.0f, mouseDeltaY * scaleFactor_y)); + + if (GetUIState() == UISTATE_INGAME || g_Config.bMapMouse) { + NativeAxis(axisX); + NativeAxis(axisY); + } + mouseDeltaX *= g_Config.fMouseSmoothing; + mouseDeltaY *= g_Config.fMouseSmoothing; + } + } + + void MouseCaptureControl() { + bool captureMouseCondition = g_Config.bMouseControl && ((GetUIState() == UISTATE_INGAME && g_Config.bMouseConfine) || g_Config.bMapMouse); + if (mouseCaptured != captureMouseCondition) { + mouseCaptured = captureMouseCondition; + if (captureMouseCondition) + SDL_SetRelativeMouseMode(SDL_TRUE); + else + SDL_SetRelativeMouseMode(SDL_FALSE); + } + } + + bool mouseDown; + float mouseDeltaX; + float mouseDeltaY; + int mouseWheelMovedUpFrames; + int mouseWheelMovedDownFrames; + bool mouseCaptured; +}; + +static void ProcessSDLEvent(SDL_Window *window, const SDL_Event &event, InputStateTracker *inputTracker) { + // We have to juggle around 3 kinds of "DPI spaces" if a logical DPI is + // provided (through --dpi, it is equal to system DPI if unspecified): + // - SDL gives us motion events in "system DPI" points + // - UpdateScreenScale expects pixels, so in a way "96 DPI" points + // - The UI code expects motion events in "logical DPI" points + float mx = event.motion.x * g_DesktopDPI * g_display.dpi_scale_x; + float my = event.motion.y * g_DesktopDPI * g_display.dpi_scale_x; + + switch (event.type) { + case SDL_QUIT: + g_QuitRequested = 1; + break; + +#if !defined(MOBILE_DEVICE) + case SDL_WINDOWEVENT: + switch (event.window.event) { + case SDL_WINDOWEVENT_SIZE_CHANGED: // better than RESIZED, more general + { + int new_width = event.window.data1; + int new_height = event.window.data2; + + // The size given by SDL is in point-units, convert these to + // pixels before passing to UpdateScreenScale() + int new_width_px = new_width * g_DesktopDPI; + int new_height_px = new_height * g_DesktopDPI; + + Core_NotifyWindowHidden(false); + + Uint32 window_flags = SDL_GetWindowFlags(window); + bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); + + // This one calls NativeResized if the size changed. + UpdateScreenScale(new_width_px, new_height_px); + + // Set variable here in case fullscreen was toggled by hotkey + if (g_Config.UseFullScreen() != fullscreen) { + g_Config.bFullScreen = fullscreen; + g_Config.iForceFullScreen = -1; + } else { + // It is possible for the monitor to change DPI, so recalculate + // DPI on each resize event. + UpdateScreenDPI(window); + } + + if (!g_Config.bFullScreen) { + g_Config.iWindowWidth = new_width; + g_Config.iWindowHeight = new_height; + } + // Hide/Show cursor correctly toggling fullscreen + if (lastUIState == UISTATE_INGAME && fullscreen && !g_Config.bShowTouchControls) { + SDL_ShowCursor(SDL_DISABLE); + } else if (lastUIState != UISTATE_INGAME || !fullscreen) { + SDL_ShowCursor(SDL_ENABLE); + } + break; + } + + case SDL_WINDOWEVENT_MOVED: + { + int x = event.window.data1; + int y = event.window.data2; + Uint32 window_flags = SDL_GetWindowFlags(window); + bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); + if (!fullscreen) { + g_Config.iWindowX = x; + g_Config.iWindowY = y; + } + break; + } + + case SDL_WINDOWEVENT_MINIMIZED: + case SDL_WINDOWEVENT_HIDDEN: + Core_NotifyWindowHidden(true); + break; + case SDL_WINDOWEVENT_EXPOSED: + case SDL_WINDOWEVENT_SHOWN: + Core_NotifyWindowHidden(false); + break; + default: + break; + } + break; +#endif + case SDL_KEYDOWN: + { + if (event.key.repeat > 0) { break;} + int k = event.key.keysym.sym; + KeyInput key; + key.flags = KEY_DOWN; + auto mapped = KeyMapRawSDLtoNative.find(k); + if (mapped == KeyMapRawSDLtoNative.end() || mapped->second == NKCODE_UNKNOWN) { + break; + } + key.keyCode = mapped->second; + key.deviceId = DEVICE_ID_KEYBOARD; + NativeKey(key); + +#ifdef _DEBUG + if (k == SDLK_F7) { + printf("f7 pressed - rebooting emuthread\n"); + g_rebootEmuThread = true; + } +#endif + break; + } + case SDL_KEYUP: + { + if (event.key.repeat > 0) { break;} + int k = event.key.keysym.sym; + KeyInput key; + key.flags = KEY_UP; + auto mapped = KeyMapRawSDLtoNative.find(k); + if (mapped == KeyMapRawSDLtoNative.end() || mapped->second == NKCODE_UNKNOWN) { + break; + } + key.keyCode = mapped->second; + key.deviceId = DEVICE_ID_KEYBOARD; + NativeKey(key); + break; + } + case SDL_TEXTINPUT: + { + int pos = 0; + int c = u8_nextchar(event.text.text, &pos); + KeyInput key; + key.flags = KEY_CHAR; + key.unicodeChar = c; + key.deviceId = DEVICE_ID_KEYBOARD; + NativeKey(key); + break; + } +// This behavior doesn't feel right on a macbook with a touchpad. +#if !PPSSPP_PLATFORM(MAC) + case SDL_FINGERMOTION: + { + int w, h; + SDL_GetWindowSize(window, &w, &h); + TouchInput input; + input.id = event.tfinger.fingerId; + input.x = event.tfinger.x * w * g_DesktopDPI * g_display.dpi_scale_x; + input.y = event.tfinger.y * h * g_DesktopDPI * g_display.dpi_scale_x; + input.flags = TOUCH_MOVE; + input.timestamp = event.tfinger.timestamp; + NativeTouch(input); + break; + } + case SDL_FINGERDOWN: + { + int w, h; + SDL_GetWindowSize(window, &w, &h); + TouchInput input; + input.id = event.tfinger.fingerId; + input.x = event.tfinger.x * w * g_DesktopDPI * g_display.dpi_scale_x; + input.y = event.tfinger.y * h * g_DesktopDPI * g_display.dpi_scale_x; + input.flags = TOUCH_DOWN; + input.timestamp = event.tfinger.timestamp; + NativeTouch(input); + + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + key.keyCode = NKCODE_EXT_MOUSEBUTTON_1; + key.flags = KEY_DOWN; + NativeKey(key); + break; + } + case SDL_FINGERUP: + { + int w, h; + SDL_GetWindowSize(window, &w, &h); + TouchInput input; + input.id = event.tfinger.fingerId; + input.x = event.tfinger.x * w * g_DesktopDPI * g_display.dpi_scale_x; + input.y = event.tfinger.y * h * g_DesktopDPI * g_display.dpi_scale_x; + input.flags = TOUCH_UP; + input.timestamp = event.tfinger.timestamp; + NativeTouch(input); + + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + key.keyCode = NKCODE_EXT_MOUSEBUTTON_1; + key.flags = KEY_UP; + NativeKey(key); + break; + } +#endif + case SDL_MOUSEBUTTONDOWN: + switch (event.button.button) { + case SDL_BUTTON_LEFT: + { + inputTracker->mouseDown = true; + TouchInput input{}; + input.x = mx; + input.y = my; + input.flags = TOUCH_DOWN | TOUCH_MOUSE; + input.id = 0; + NativeTouch(input); + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_1, KEY_DOWN); + NativeKey(key); + } + break; + case SDL_BUTTON_RIGHT: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_2, KEY_DOWN); + NativeKey(key); + } + break; + case SDL_BUTTON_MIDDLE: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_3, KEY_DOWN); + NativeKey(key); + } + break; + case SDL_BUTTON_X1: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_4, KEY_DOWN); + NativeKey(key); + } + break; + case SDL_BUTTON_X2: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_5, KEY_DOWN); + NativeKey(key); + } + break; + } + break; + case SDL_MOUSEWHEEL: + { + KeyInput key; + key.deviceId = DEVICE_ID_MOUSE; + key.flags = KEY_DOWN; +#if SDL_VERSION_ATLEAST(2, 0, 18) + if (event.wheel.preciseY != 0.0f) { + // Should the scale be DPI-driven? + const float scale = 30.0f; + key.keyCode = event.wheel.preciseY > 0 ? NKCODE_EXT_MOUSEWHEEL_UP : NKCODE_EXT_MOUSEWHEEL_DOWN; + key.flags |= KEY_HASWHEELDELTA; + int wheelDelta = event.wheel.preciseY * scale; + if (event.wheel.preciseY < 0) { + wheelDelta = -wheelDelta; + } + key.flags |= wheelDelta << 16; + NativeKey(key); + break; + } +#endif + if (event.wheel.y > 0) { + key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; + inputTracker->mouseWheelMovedUpFrames = 5; + NativeKey(key); + } else if (event.wheel.y < 0) { + key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; + inputTracker->mouseWheelMovedDownFrames = 5; + NativeKey(key); + } + break; + } + case SDL_MOUSEMOTION: + if (inputTracker->mouseDown) { + TouchInput input{}; + input.x = mx; + input.y = my; + input.flags = TOUCH_MOVE | TOUCH_MOUSE; + input.id = 0; + NativeTouch(input); + } + inputTracker->mouseDeltaX += event.motion.xrel; + inputTracker->mouseDeltaY += event.motion.yrel; + break; + case SDL_MOUSEBUTTONUP: + switch (event.button.button) { + case SDL_BUTTON_LEFT: + { + inputTracker->mouseDown = false; + TouchInput input{}; + input.x = mx; + input.y = my; + input.flags = TOUCH_UP | TOUCH_MOUSE; + input.id = 0; + NativeTouch(input); + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_1, KEY_UP); + NativeKey(key); + } + break; + case SDL_BUTTON_RIGHT: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_2, KEY_UP); + NativeKey(key); + } + break; + case SDL_BUTTON_MIDDLE: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_3, KEY_UP); + NativeKey(key); + } + break; + case SDL_BUTTON_X1: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_4, KEY_UP); + NativeKey(key); + } + break; + case SDL_BUTTON_X2: + { + KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_5, KEY_UP); + NativeKey(key); + } + break; + } + break; + +#if SDL_VERSION_ATLEAST(2, 0, 4) + case SDL_AUDIODEVICEADDED: + // Automatically switch to the new device. + if (event.adevice.iscapture == 0) { + const char *name = SDL_GetAudioDeviceName(event.adevice.which, 0); + if (!name) { + break; + } + // Don't start auto switching for a second, because some devices init on start. + bool doAutoSwitch = g_Config.bAutoAudioDevice && g_frameCount > 60; + if (doAutoSwitch || g_Config.sAudioDevice == name) { + StopSDLAudioDevice(); + InitSDLAudioDevice(name ? name : ""); + } + } + break; + case SDL_AUDIODEVICEREMOVED: + if (event.adevice.iscapture == 0 && event.adevice.which == audioDev) { + StopSDLAudioDevice(); + InitSDLAudioDevice(); + } + break; +#endif + + default: + if (joystick) { + joystick->ProcessInput(event); + } + break; + } + +} + #ifdef _WIN32 #undef main #endif @@ -690,7 +1137,7 @@ int main(int argc, char *argv[]) { int set_yres = -1; bool portrait = false; bool set_ipad = false; - float set_dpi = 1.0f; + float set_dpi = 0.0f; float set_scale = 1.0f; // Produce a new set of arguments with the ones we skip. @@ -782,7 +1229,7 @@ int main(int argc, char *argv[]) { #elif defined(USING_FBDEV) || PPSSPP_PLATFORM(SWITCH) mode |= SDL_WINDOW_FULLSCREEN_DESKTOP; #else - mode |= SDL_WINDOW_RESIZABLE; + mode |= SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI; #endif if (mode & SDL_WINDOW_FULLSCREEN_DESKTOP) { @@ -801,8 +1248,6 @@ int main(int argc, char *argv[]) { g_Config.bFullScreen = false; } - set_dpi = 1.0f / set_dpi; - if (set_ipad) { g_display.pixel_xres = 1024; g_display.pixel_yres = 768; @@ -817,9 +1262,8 @@ int main(int argc, char *argv[]) { if (set_yres > 0) { g_display.pixel_yres = set_yres; } - float dpi_scale = 1.0f; if (set_dpi > 0) { - dpi_scale = set_dpi; + g_ForcedDPI = set_dpi; } // Mac / Linux @@ -870,18 +1314,6 @@ int main(int argc, char *argv[]) { if (g_Config.iWindowHeight > 0) h = g_Config.iWindowHeight; } - g_display.pixel_xres = w; - g_display.pixel_yres = h; - g_display.dp_xres = (float)g_display.pixel_xres * dpi_scale; - g_display.dp_yres = (float)g_display.pixel_yres * dpi_scale; - - g_display.pixel_in_dps_x = (float)g_display.pixel_xres / g_display.dp_xres; - g_display.pixel_in_dps_y = (float)g_display.pixel_yres / g_display.dp_yres; - g_display.dpi_scale_x = g_display.dp_xres / (float)g_display.pixel_xres; - g_display.dpi_scale_y = g_display.dp_yres / (float)g_display.pixel_yres; - g_display.dpi_scale_real_x = g_display.dpi_scale_x; - g_display.dpi_scale_real_y = g_display.dpi_scale_y; - // g_display.Print(); GraphicsContext *graphicsContext = nullptr; SDL_Window *window = nullptr; @@ -909,6 +1341,17 @@ int main(int argc, char *argv[]) { } #endif } +#if PPSSPP_PLATFORM(MAC) || PPSSPP_PLATFORM(IOS) + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { + g_ForcedDPI = 1.0f; + } +#endif + + UpdateScreenDPI(window); + + float dpi_scale = 1.0f / (g_ForcedDPI == 0.0f ? g_DesktopDPI : g_ForcedDPI); + + UpdateScreenScale(w * g_DesktopDPI, h * g_DesktopDPI); bool useEmuThread = g_Config.iGPUBackend == (int)GPUBackend::OPENGL; @@ -960,388 +1403,32 @@ int main(int argc, char *argv[]) { } EnableFZ(); - int framecount = 0; - bool mouseDown = false; - if (useEmuThread) { EmuThreadStart(graphicsContext); } graphicsContext->ThreadStart(); - float mouseDeltaX = 0; - float mouseDeltaY = 0; - int mouseWheelMovedUpFrames = 0; - int mouseWheelMovedDownFrames = 0; - bool mouseCaptured = false; - bool windowHidden = false; + InputStateTracker inputTracker{}; #if PPSSPP_PLATFORM(MAC) // setup menu items for macOS initializeOSXExtras(); #endif - bool rebootEmuThread = false; - while (true) { double startTime = time_now_d(); - // SDL2 doesn't consider the mousewheel a button anymore - // so let's send the KEY_UP if it was moved after some frames - if (mouseWheelMovedUpFrames > 0) { - mouseWheelMovedUpFrames--; - if (mouseWheelMovedUpFrames == 0) { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; - key.flags = KEY_UP; - NativeKey(key); - } - } - if (mouseWheelMovedDownFrames > 0) { - mouseWheelMovedDownFrames--; - if (mouseWheelMovedDownFrames == 0) { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; - key.flags = KEY_UP; - NativeKey(key); - } - } - SDL_Event event, touchEvent; + inputTracker.TranslateMouseWheel(); + + SDL_Event event; while (SDL_PollEvent(&event)) { - float mx = event.motion.x * g_display.dpi_scale_x; - float my = event.motion.y * g_display.dpi_scale_y; - - switch (event.type) { - case SDL_QUIT: - g_QuitRequested = 1; - break; - -#if !defined(MOBILE_DEVICE) - case SDL_WINDOWEVENT: - switch (event.window.event) { - case SDL_WINDOWEVENT_SIZE_CHANGED: // better than RESIZED, more general - { - int new_width = event.window.data1; - int new_height = event.window.data2; - - windowHidden = false; - Core_NotifyWindowHidden(windowHidden); - - Uint32 window_flags = SDL_GetWindowFlags(window); - bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); - - // This one calls NativeResized if the size changed. - UpdateScreenScale(new_width, new_height); - - // Set variable here in case fullscreen was toggled by hotkey - if (g_Config.UseFullScreen() != fullscreen) { - g_Config.bFullScreen = fullscreen; - g_Config.iForceFullScreen = -1; - } - - if (!g_Config.bFullScreen) { - g_Config.iWindowWidth = new_width; - g_Config.iWindowHeight = new_height; - } - // Hide/Show cursor correctly toggling fullscreen - if (lastUIState == UISTATE_INGAME && fullscreen && !g_Config.bShowTouchControls) { - SDL_ShowCursor(SDL_DISABLE); - } else if (lastUIState != UISTATE_INGAME || !fullscreen) { - SDL_ShowCursor(SDL_ENABLE); - } - break; - } - - case SDL_WINDOWEVENT_MOVED: - { - int x = event.window.data1; - int y = event.window.data2; - Uint32 window_flags = SDL_GetWindowFlags(window); - bool fullscreen = (window_flags & SDL_WINDOW_FULLSCREEN); - if (!fullscreen) { - g_Config.iWindowX = x; - g_Config.iWindowY = y; - } - break; - } - - case SDL_WINDOWEVENT_MINIMIZED: - case SDL_WINDOWEVENT_HIDDEN: - windowHidden = true; - Core_NotifyWindowHidden(windowHidden); - break; - case SDL_WINDOWEVENT_EXPOSED: - case SDL_WINDOWEVENT_SHOWN: - windowHidden = false; - Core_NotifyWindowHidden(windowHidden); - break; - default: - break; - } - break; -#endif - case SDL_KEYDOWN: - { - if (event.key.repeat > 0) { break;} - int k = event.key.keysym.sym; - KeyInput key; - key.flags = KEY_DOWN; - auto mapped = KeyMapRawSDLtoNative.find(k); - if (mapped == KeyMapRawSDLtoNative.end() || mapped->second == NKCODE_UNKNOWN) { - break; - } - key.keyCode = mapped->second; - key.deviceId = DEVICE_ID_KEYBOARD; - NativeKey(key); - -#ifdef _DEBUG - if (k == SDLK_F7 && useEmuThread) { - printf("f7 pressed - rebooting emuthread\n"); - rebootEmuThread = true; - } -#endif - break; - } - case SDL_KEYUP: - { - if (event.key.repeat > 0) { break;} - int k = event.key.keysym.sym; - KeyInput key; - key.flags = KEY_UP; - auto mapped = KeyMapRawSDLtoNative.find(k); - if (mapped == KeyMapRawSDLtoNative.end() || mapped->second == NKCODE_UNKNOWN) { - break; - } - key.keyCode = mapped->second; - key.deviceId = DEVICE_ID_KEYBOARD; - NativeKey(key); - break; - } - case SDL_TEXTINPUT: - { - int pos = 0; - int c = u8_nextchar(event.text.text, &pos); - KeyInput key; - key.flags = KEY_CHAR; - key.unicodeChar = c; - key.deviceId = DEVICE_ID_KEYBOARD; - NativeKey(key); - break; - } -// This behavior doesn't feel right on a macbook with a touchpad. -#if !PPSSPP_PLATFORM(MAC) - case SDL_FINGERMOTION: - { - SDL_GetWindowSize(window, &w, &h); - TouchInput input; - input.id = event.tfinger.fingerId; - input.x = event.tfinger.x * w; - input.y = event.tfinger.y * h; - input.flags = TOUCH_MOVE; - input.timestamp = event.tfinger.timestamp; - NativeTouch(input); - break; - } - case SDL_FINGERDOWN: - { - SDL_GetWindowSize(window, &w, &h); - TouchInput input; - input.id = event.tfinger.fingerId; - input.x = event.tfinger.x * w; - input.y = event.tfinger.y * h; - input.flags = TOUCH_DOWN; - input.timestamp = event.tfinger.timestamp; - NativeTouch(input); - - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEBUTTON_1; - key.flags = KEY_DOWN; - NativeKey(key); - break; - } - case SDL_FINGERUP: - { - SDL_GetWindowSize(window, &w, &h); - TouchInput input; - input.id = event.tfinger.fingerId; - input.x = event.tfinger.x * w; - input.y = event.tfinger.y * h; - input.flags = TOUCH_UP; - input.timestamp = event.tfinger.timestamp; - NativeTouch(input); - - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.keyCode = NKCODE_EXT_MOUSEBUTTON_1; - key.flags = KEY_UP; - NativeKey(key); - break; - } -#endif - case SDL_MOUSEBUTTONDOWN: - switch (event.button.button) { - case SDL_BUTTON_LEFT: - { - mouseDown = true; - TouchInput input{}; - input.x = mx; - input.y = my; - input.flags = TOUCH_DOWN | TOUCH_MOUSE; - input.id = 0; - NativeTouch(input); - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_1, KEY_DOWN); - NativeKey(key); - } - break; - case SDL_BUTTON_RIGHT: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_2, KEY_DOWN); - NativeKey(key); - } - break; - case SDL_BUTTON_MIDDLE: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_3, KEY_DOWN); - NativeKey(key); - } - break; - case SDL_BUTTON_X1: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_4, KEY_DOWN); - NativeKey(key); - } - break; - case SDL_BUTTON_X2: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_5, KEY_DOWN); - NativeKey(key); - } - break; - } - break; - case SDL_MOUSEWHEEL: - { - KeyInput key; - key.deviceId = DEVICE_ID_MOUSE; - key.flags = KEY_DOWN; -#if SDL_VERSION_ATLEAST(2, 0, 18) - if (event.wheel.preciseY != 0.0f) { - // Should the scale be DPI-driven? - const float scale = 30.0f; - key.keyCode = event.wheel.preciseY > 0 ? NKCODE_EXT_MOUSEWHEEL_UP : NKCODE_EXT_MOUSEWHEEL_DOWN; - key.flags |= KEY_HASWHEELDELTA; - int wheelDelta = event.wheel.preciseY * scale; - if (event.wheel.preciseY < 0) { - wheelDelta = -wheelDelta; - } - key.flags |= wheelDelta << 16; - NativeKey(key); - break; - } -#endif - if (event.wheel.y > 0) { - key.keyCode = NKCODE_EXT_MOUSEWHEEL_UP; - mouseWheelMovedUpFrames = 5; - NativeKey(key); - } else if (event.wheel.y < 0) { - key.keyCode = NKCODE_EXT_MOUSEWHEEL_DOWN; - mouseWheelMovedDownFrames = 5; - NativeKey(key); - } - break; - } - case SDL_MOUSEMOTION: - if (mouseDown) { - TouchInput input{}; - input.x = mx; - input.y = my; - input.flags = TOUCH_MOVE | TOUCH_MOUSE; - input.id = 0; - NativeTouch(input); - } - mouseDeltaX += event.motion.xrel; - mouseDeltaY += event.motion.yrel; - break; - case SDL_MOUSEBUTTONUP: - switch (event.button.button) { - case SDL_BUTTON_LEFT: - { - mouseDown = false; - TouchInput input{}; - input.x = mx; - input.y = my; - input.flags = TOUCH_UP | TOUCH_MOUSE; - input.id = 0; - NativeTouch(input); - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_1, KEY_UP); - NativeKey(key); - } - break; - case SDL_BUTTON_RIGHT: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_2, KEY_UP); - NativeKey(key); - } - break; - case SDL_BUTTON_MIDDLE: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_3, KEY_UP); - NativeKey(key); - } - break; - case SDL_BUTTON_X1: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_4, KEY_UP); - NativeKey(key); - } - break; - case SDL_BUTTON_X2: - { - KeyInput key(DEVICE_ID_MOUSE, NKCODE_EXT_MOUSEBUTTON_5, KEY_UP); - NativeKey(key); - } - break; - } - break; - -#if SDL_VERSION_ATLEAST(2, 0, 4) - case SDL_AUDIODEVICEADDED: - // Automatically switch to the new device. - if (event.adevice.iscapture == 0) { - const char *name = SDL_GetAudioDeviceName(event.adevice.which, 0); - if (!name) { - break; - } - // Don't start auto switching for a second, because some devices init on start. - bool doAutoSwitch = g_Config.bAutoAudioDevice && framecount > 60; - if (doAutoSwitch || g_Config.sAudioDevice == name) { - StopSDLAudioDevice(); - InitSDLAudioDevice(name ? name : ""); - } - } - break; - case SDL_AUDIODEVICEREMOVED: - if (event.adevice.iscapture == 0 && event.adevice.which == audioDev) { - StopSDLAudioDevice(); - InitSDLAudioDevice(); - } - break; -#endif - - default: - if (joystick) { - joystick->ProcessInput(event); - } - break; - } + ProcessSDLEvent(window, event, &inputTracker); } if (g_QuitRequested || g_RestartRequested) break; const uint8_t *keys = SDL_GetKeyboardState(NULL); if (emuThreadState == (int)EmuThreadState::DISABLED) { - UpdateRunLoop(); + UpdateRunLoop(graphicsContext); } if (g_QuitRequested || g_RestartRequested) break; @@ -1356,47 +1443,15 @@ int main(int argc, char *argv[]) { } #endif - // Disabled by default, needs a workaround to map to psp keys. - if (g_Config.bMouseControl) { - float scaleFactor_x = g_display.dpi_scale_x * 0.1 * g_Config.fMouseSensitivity; - float scaleFactor_y = g_display.dpi_scale_y * 0.1 * g_Config.fMouseSensitivity; + inputTracker.MouseControl(); + inputTracker.MouseCaptureControl(); - AxisInput axisX, axisY; - axisX.axisId = JOYSTICK_AXIS_MOUSE_REL_X; - axisX.deviceId = DEVICE_ID_MOUSE; - axisX.value = std::max(-1.0f, std::min(1.0f, mouseDeltaX * scaleFactor_x)); - axisY.axisId = JOYSTICK_AXIS_MOUSE_REL_Y; - axisY.deviceId = DEVICE_ID_MOUSE; - axisY.value = std::max(-1.0f, std::min(1.0f, mouseDeltaY * scaleFactor_y)); - - if (GetUIState() == UISTATE_INGAME || g_Config.bMapMouse) { - NativeAxis(axisX); - NativeAxis(axisY); - } - mouseDeltaX *= g_Config.fMouseSmoothing; - mouseDeltaY *= g_Config.fMouseSmoothing; - } - bool captureMouseCondition = g_Config.bMouseControl && ((GetUIState() == UISTATE_INGAME && g_Config.bMouseConfine) || g_Config.bMapMouse); - if (mouseCaptured != captureMouseCondition) { - mouseCaptured = captureMouseCondition; - if (captureMouseCondition) - SDL_SetRelativeMouseMode(SDL_TRUE); - else - SDL_SetRelativeMouseMode(SDL_FALSE); - } - - if (framecount % 60 == 0) { - // glsl_refresh(); // auto-reloads modified GLSL shaders once per second. - } - - bool renderThreadPaused = windowHidden && g_Config.bPauseWhenMinimized && emuThreadState != (int)EmuThreadState::DISABLED; + bool renderThreadPaused = Core_IsWindowHidden() && g_Config.bPauseWhenMinimized && emuThreadState != (int)EmuThreadState::DISABLED; if (emuThreadState != (int)EmuThreadState::DISABLED && !renderThreadPaused) { if (!graphicsContext->ThreadFrame()) break; } - graphicsContext->SwapBuffers(); - { std::lock_guard guard(g_mutexWindow); if (g_windowState.update) { @@ -1404,9 +1459,9 @@ int main(int argc, char *argv[]) { } } - if (rebootEmuThread) { + if (g_rebootEmuThread) { printf("rebooting emu thread"); - rebootEmuThread = false; + g_rebootEmuThread = false; EmuThreadStop("shutdown"); // Skipping GL calls, the old context is gone. while (graphicsContext->ThreadFrame()) { @@ -1442,7 +1497,7 @@ int main(int argc, char *argv[]) { sleep_ms(sleepTime); } - framecount++; + g_frameCount++; } if (useEmuThread) { diff --git a/SDL/SDLVulkanGraphicsContext.cpp b/SDL/SDLVulkanGraphicsContext.cpp index 270a8f30a1..f58ae422dd 100644 --- a/SDL/SDLVulkanGraphicsContext.cpp +++ b/SDL/SDLVulkanGraphicsContext.cpp @@ -136,7 +136,11 @@ bool SDLVulkanGraphicsContext::Init(SDL_Window *&window, int x, int y, int w, in return false; } - draw_ = Draw::T3DCreateVulkanContext(vulkan_, g_Config.bRenderMultiThreading); + bool useMultiThreading = g_Config.bRenderMultiThreading; + if (g_Config.iInflightFrames == 1) { + useMultiThreading = false; + } + draw_ = Draw::T3DCreateVulkanContext(vulkan_, useMultiThreading); SetGPUBackend(GPUBackend::VULKAN); bool success = draw_->CreatePresets(); _assert_(success); diff --git a/SDL/SDLVulkanGraphicsContext.h b/SDL/SDLVulkanGraphicsContext.h index d309e685d5..1fe5b0c94f 100644 --- a/SDL/SDLVulkanGraphicsContext.h +++ b/SDL/SDLVulkanGraphicsContext.h @@ -26,10 +26,6 @@ public: void Shutdown() override; - void SwapBuffers() override { - // We don't do it this way. - } - void Resize() override; void Poll() override; diff --git a/SDL/macbundle.sh b/SDL/macbundle.sh index 9c67205efc..b51e804ce3 100755 --- a/SDL/macbundle.sh +++ b/SDL/macbundle.sh @@ -1,10 +1,11 @@ #!/bin/bash -echo "Hello" +echo "Hello from macbundle.sh" PPSSPP="${1}" PPSSPP_SHORTNAME="${2}" PPSSPPSDL="${PPSSPP}/Contents/MacOS/${PPSSPP_SHORTNAME}" +MOLTENVK="${PPSSPP}/Contents/Frameworks/libMoltenVK.dylib" ls ${PPSSPPSDL} @@ -35,11 +36,7 @@ install_name_tool -rpath "${RPATH}" "@executable_path/../Frameworks" "${PPSSPPSD echo "Done." -GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../git-version.cpp") -# Hack, need to do something better here. -if [ -z "$GIT_VERSION_LINE" ]; then - GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../build/git-version.cpp") -fi +GIT_VERSION_LINE=$(grep "PPSSPP_GIT_VERSION = " "$(dirname "${0}")/../build/git-version.cpp") echo "Setting version to '${GIT_VERSION_LINE}'..." SHORT_VERSION_MATCH='.*"v([0-9\.]+(-[0-9]+)?).*";' @@ -54,5 +51,7 @@ fi # AdHoc codesign is required for Apple Silicon. echo "Signing..." -codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPPSDL}" || echo "Failed signing" -codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPP}" || echo "Failed signing" + +codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${MOLTENVK}" || echo "Failed signing MoltenVK" +codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPPSDL}" || echo "Failed signing PPSSPPSDL" +codesign -fs - --entitlements ../macOS/Entitlements.plist --timestamp "${PPSSPP}" || echo "Failed signing PPSSPP" diff --git a/Tools/langtool/src/main.rs b/Tools/langtool/src/main.rs index f18060959c..ebe82ad8f8 100644 --- a/Tools/langtool/src/main.rs +++ b/Tools/langtool/src/main.rs @@ -17,7 +17,10 @@ struct Opt { #[derive(StructOpt, Debug)] enum Command { - CopyMissingLines {}, + CopyMissingLines { + #[structopt(short, long)] + dont_comment_missing: bool, + }, CommentUnknownLines {}, RemoveUnknownLines {}, AddNewKey { @@ -43,7 +46,11 @@ enum Command { }, } -fn copy_missing_lines(reference_ini: &IniFile, target_ini: &mut IniFile) -> io::Result<()> { +fn copy_missing_lines( + reference_ini: &IniFile, + target_ini: &mut IniFile, + comment_missing: bool, +) -> io::Result<()> { for reference_section in &reference_ini.sections { // Insert any missing full sections. if !target_ini.insert_section_if_missing(reference_section) { @@ -53,7 +60,9 @@ fn copy_missing_lines(reference_ini: &IniFile, target_ini: &mut IniFile) -> io:: } //target_section.remove_lines_if_not_in(reference_section); - target_section.comment_out_lines_if_not_in(reference_section); + if comment_missing { + target_section.comment_out_lines_if_not_in(reference_section); + } } } else { // Note: insert_section_if_missing will copy the entire section, @@ -177,8 +186,10 @@ fn main() { let mut target_ini = IniFile::parse(&target_ini_filename).unwrap(); match opt.cmd { - Command::CopyMissingLines {} => { - copy_missing_lines(reference_ini, &mut target_ini).unwrap(); + Command::CopyMissingLines { + dont_comment_missing, + } => { + copy_missing_lines(reference_ini, &mut target_ini, !dont_comment_missing).unwrap(); } Command::CommentUnknownLines {} => { deal_with_unknown_lines(reference_ini, &mut target_ini, false).unwrap(); diff --git a/UI/DebugOverlay.cpp b/UI/DebugOverlay.cpp new file mode 100644 index 0000000000..4ccdb89998 --- /dev/null +++ b/UI/DebugOverlay.cpp @@ -0,0 +1,200 @@ +#include "Common/Render/DrawBuffer.h" +#include "Common/GPU/thin3d.h" +#include "Common/System/System.h" +#include "UI/DebugOverlay.h" +#include "Core/HW/Display.h" +#include "Core/HLE/sceSas.h" +#include "Core/ControlMapper.h" +#include "Core/Config.h" +#include "Core/System.h" +#include "GPU/GPU.h" +// TODO: This should be moved here or to Common, doesn't belong in /GPU +#include "GPU/Vulkan/DebugVisVulkan.h" + +// For std::max +#include + + +static void DrawDebugStats(UIContext *ctx, const Bounds &bounds) { + FontID ubuntu24("UBUNTU24"); + + float left = std::max(bounds.w / 2 - 20.0f, 550.0f); + float right = bounds.w - left - 20.0f; + + char statbuf[4096]; + + ctx->Flush(); + ctx->BindFontTexture(); + ctx->Draw()->SetFontScale(.7f, .7f); + + __DisplayGetDebugStats(statbuf, sizeof(statbuf)); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, left, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, left, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + + __SasGetDebugStats(statbuf, sizeof(statbuf)); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + left + 21, bounds.y + 31, right, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + left + 20, bounds.y + 30, right, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + + ctx->Draw()->SetFontScale(1.0f, 1.0f); + ctx->Flush(); + ctx->RebindTexture(); +} + +static void DrawAudioDebugStats(UIContext *ctx, const Bounds &bounds) { + FontID ubuntu24("UBUNTU24"); + + char statbuf[4096] = { 0 }; + System_AudioGetDebugStats(statbuf, sizeof(statbuf)); + + ctx->Flush(); + ctx->BindFontTexture(); + ctx->Draw()->SetFontScale(0.7f, 0.7f); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, bounds.w - 20, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, bounds.w - 20, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); + ctx->Draw()->SetFontScale(1.0f, 1.0f); + ctx->Flush(); + ctx->RebindTexture(); +} + +static void DrawControlDebug(UIContext *ctx, const ControlMapper &mapper, const Bounds &bounds) { + FontID ubuntu24("UBUNTU24"); + + char statbuf[4096] = { 0 }; + mapper.GetDebugString(statbuf, sizeof(statbuf)); + + ctx->Flush(); + ctx->BindFontTexture(); + ctx->Draw()->SetFontScale(0.5f, 0.5f); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, bounds.w - 20, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII); + ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, bounds.w - 20, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); + ctx->Draw()->SetFontScale(1.0f, 1.0f); + ctx->Flush(); + ctx->RebindTexture(); +} + +static void DrawFrameTimes(UIContext *ctx, const Bounds &bounds) { + FontID ubuntu24("UBUNTU24"); + double *sleepHistory; + int valid, pos; + double *history = __DisplayGetFrameTimes(&valid, &pos, &sleepHistory); + int scale = 7000; + int width = 600; + + ctx->Flush(); + ctx->BeginNoTex(); + int bottom = bounds.y2(); + for (int i = 0; i < valid; ++i) { + double activeTime = history[i] - sleepHistory[i]; + ctx->Draw()->vLine(bounds.x + i, bottom, bottom - activeTime * scale, 0xFF3FFF3F); + ctx->Draw()->vLine(bounds.x + i, bottom - activeTime * scale, bottom - history[i] * scale, 0x7F3FFF3F); + } + ctx->Draw()->vLine(bounds.x + pos, bottom, bottom - 512, 0xFFff3F3f); + + ctx->Draw()->hLine(bounds.x, bottom - 0.0333 * scale, bounds.x + width, 0xFF3f3Fff); + ctx->Draw()->hLine(bounds.x, bottom - 0.0167 * scale, bounds.x + width, 0xFF3f3Fff); + + ctx->Flush(); + ctx->Begin(); + ctx->BindFontTexture(); + ctx->Draw()->SetFontScale(0.5f, 0.5f); + ctx->Draw()->DrawText(ubuntu24, "33.3ms", bounds.x + width, bottom - 0.0333 * scale, 0xFF3f3Fff, ALIGN_BOTTOMLEFT | FLAG_DYNAMIC_ASCII); + ctx->Draw()->DrawText(ubuntu24, "16.7ms", bounds.x + width, bottom - 0.0167 * scale, 0xFF3f3Fff, ALIGN_BOTTOMLEFT | FLAG_DYNAMIC_ASCII); + ctx->Draw()->SetFontScale(1.0f, 1.0f); + ctx->Flush(); + ctx->RebindTexture(); +} + +static void DrawFrameTiming(UIContext *ctx, const Bounds &bounds) { + FontID ubuntu24("UBUNTU24"); + + char statBuf[1024]{}; + + ctx->Flush(); + ctx->BindFontTexture(); + ctx->Draw()->SetFontScale(0.5f, 0.5f); + + for (int i = 0; i < 8; i++) { + FrameTimeData data = ctx->GetDrawContext()->GetFrameTimeData(6 + i); + FrameTimeData prevData = ctx->GetDrawContext()->GetFrameTimeData(7 + i); + if (data.frameBegin == 0.0) { + snprintf(statBuf, sizeof(statBuf), "(No frame time data)"); + } else { + double stride = data.frameBegin - prevData.frameBegin; + double fenceLatency_s = data.afterFenceWait - data.frameBegin; + double submitLatency_s = data.firstSubmit - data.frameBegin; + double queuePresentLatency_s = data.queuePresent - data.frameBegin; + double actualPresentLatency_s = data.actualPresent - data.frameBegin; + double presentMargin = data.presentMargin; + double computedMargin = data.actualPresent - data.queuePresent; + + char presentStats[256] = ""; + if (data.actualPresent != 0.0) { + snprintf(presentStats, sizeof(presentStats), + "* Present: %0.1f ms\n" + "* Margin: %0.1f ms\n" + "* Margin(c): %0.1f ms\n", + actualPresentLatency_s * 1000.0, + presentMargin * 1000.0, + computedMargin * 1000.0); + } + snprintf(statBuf, sizeof(statBuf), + "* Stride: %0.1f (waits: %d)\n" + "%llu: From start:\n" + "* Past fence: %0.1f ms\n" + "* Submit #1: %0.1f ms\n" + "* Queue-p: %0.1f ms\n" + "%s", + stride * 1000.0, + data.waitCount, + (long long)data.frameId, + fenceLatency_s * 1000.0, + submitLatency_s * 1000.0, + queuePresentLatency_s * 1000.0, + presentStats + ); + } + ctx->Draw()->DrawTextRect(ubuntu24, statBuf, bounds.x + 10 + i * 150, bounds.y + 50, bounds.w - 20, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); + } + ctx->Draw()->SetFontScale(1.0f, 1.0f); + ctx->Flush(); + ctx->RebindTexture(); +} + +void DrawControlMapperOverlay(UIContext *ctx, const Bounds &bounds, const ControlMapper &controlMapper) { + DrawControlDebug(ctx, controlMapper, ctx->GetLayoutBounds()); +} + +void DrawDebugOverlay(UIContext *ctx, const Bounds &bounds, DebugOverlay overlay) { + bool inGame = GetUIState() == UISTATE_INGAME; + + switch (overlay) { + case DebugOverlay::DEBUG_STATS: + if (!inGame) + DrawDebugStats(ctx, ctx->GetLayoutBounds()); + break; + case DebugOverlay::FRAME_GRAPH: + if (!inGame) + DrawFrameTimes(ctx, ctx->GetLayoutBounds()); + break; + case DebugOverlay::FRAME_TIMING: + DrawFrameTiming(ctx, ctx->GetLayoutBounds()); + break; + case DebugOverlay::AUDIO: + DrawAudioDebugStats(ctx, ctx->GetLayoutBounds()); + break; +#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_PLATFORM(SWITCH) + case DebugOverlay::GPU_PROFILE: + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) { + DrawGPUProfilerVis(ctx, gpu); + } + break; + case DebugOverlay::GPU_ALLOCATOR: + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) { + DrawGPUMemoryVis(ctx, gpu); + } + break; +#endif + default: + break; + } +} diff --git a/UI/DebugOverlay.h b/UI/DebugOverlay.h new file mode 100644 index 0000000000..119f220fc4 --- /dev/null +++ b/UI/DebugOverlay.h @@ -0,0 +1,8 @@ +#pragma once + +#include "Common/UI/Context.h" +#include "Core/ConfigValues.h" +#include "Core/ControlMapper.h" + +void DrawControlMapperOverlay(UIContext *ctx, const Bounds &bounds, const ControlMapper &controlMapper); +void DrawDebugOverlay(UIContext *ctx, const Bounds &bounds, DebugOverlay overlay); diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index 3ee20c4f0d..cc9f83a531 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -39,6 +39,7 @@ #endif #include "Common/File/AndroidStorage.h" #include "Common/Data/Text/I18n.h" +#include "Common/Data/Encoding/Utf8.h" #include "Common/Net/HTTPClient.h" #include "Common/UI/Context.h" #include "Common/UI/View.h" @@ -88,6 +89,30 @@ static const char *logLevelList[] = { "Verb." }; +static const char *g_debugOverlayList[] = { + "Off", + "Debug stats", + "Draw Frametimes Graph", + "Frame timing", +#ifdef USE_PROFILER + "Frame profile", +#endif + "Control Debug", + "Audio Debug", + "GPU Profile", + "GPU Allocator Viewer", +}; + +void AddOverlayList(UI::ViewGroup *items, ScreenManager *screenManager) { + using namespace UI; + auto dev = GetI18NCategory(I18NCat::DEVELOPER); + int numOverlays = ARRAY_SIZE(g_debugOverlayList); + if (!(g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL)) { + numOverlays -= 2; // skip the last 2. + } + items->Add(new PopupMultiChoice((int *)&g_Config.iDebugOverlay, dev->T("Debug overlay"), g_debugOverlayList, 0, numOverlays, I18NCat::DEVELOPER, screenManager)); +} + void DevMenuScreen::CreatePopupContents(UI::ViewGroup *parent) { using namespace UI; auto dev = GetI18NCategory(I18NCat::DEVELOPER); @@ -103,27 +128,21 @@ void DevMenuScreen::CreatePopupContents(UI::ViewGroup *parent) { items->Add(new Choice(sy->T("Developer Tools")))->OnClick.Handle(this, &DevMenuScreen::OnDeveloperTools); items->Add(new Choice(dev->T("Jit Compare")))->OnClick.Handle(this, &DevMenuScreen::OnJitCompare); items->Add(new Choice(dev->T("Shader Viewer")))->OnClick.Handle(this, &DevMenuScreen::OnShaderView); - if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) { - items->Add(new CheckBox(&g_Config.bShowAllocatorDebug, dev->T("GPU Allocator Viewer"))); - } - if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) { - items->Add(new CheckBox(&g_Config.bShowGpuProfile, dev->T("GPU Profile"))); - } - items->Add(new Choice(dev->T("Toggle Freeze")))->OnClick.Handle(this, &DevMenuScreen::OnFreezeFrame); - items->Add(new Choice(dev->T("Dump next frame to log")))->OnClick.Handle(this, &DevMenuScreen::OnDumpFrame); - items->Add(new Choice(dev->T("Toggle Audio Debug")))->OnClick.Add([](UI::EventParams &) { - g_Config.bShowAudioDebug = !g_Config.bShowAudioDebug; + AddOverlayList(items, screenManager()); + items->Add(new Choice(dev->T("Toggle Freeze")))->OnClick.Add([](UI::EventParams &e) { + if (PSP_CoreParameter().frozen) { + PSP_CoreParameter().frozen = false; + } else { + PSP_CoreParameter().freezeNext = true; + } return UI::EVENT_DONE; }); - items->Add(new Choice(dev->T("Toggle Control Debug")))->OnClick.Add([](UI::EventParams &) { - g_Config.bShowControlDebug = !g_Config.bShowControlDebug; + + items->Add(new Choice(dev->T("Dump next frame to log")))->OnClick.Add([](UI::EventParams &e) { + gpu->DumpNextFrame(); return UI::EVENT_DONE; }); -#ifdef USE_PROFILER - items->Add(new CheckBox(&g_Config.bShowFrameProfiler, dev->T("Frame Profiler"), "")); -#endif - items->Add(new CheckBox(&g_Config.bDrawFrameGraph, dev->T("Draw Frametimes Graph"))); items->Add(new Choice(dev->T("Reset limited logging")))->OnClick.Handle(this, &DevMenuScreen::OnResetLimitedLogging); scroll->Add(items); @@ -171,20 +190,6 @@ UI::EventReturn DevMenuScreen::OnShaderView(UI::EventParams &e) { return UI::EVENT_DONE; } -UI::EventReturn DevMenuScreen::OnFreezeFrame(UI::EventParams &e) { - if (PSP_CoreParameter().frozen) { - PSP_CoreParameter().frozen = false; - } else { - PSP_CoreParameter().freezeNext = true; - } - return UI::EVENT_DONE; -} - -UI::EventReturn DevMenuScreen::OnDumpFrame(UI::EventParams &e) { - gpu->DumpNextFrame(); - return UI::EVENT_DONE; -} - void DevMenuScreen::dialogFinished(const Screen *dialog, DialogResult result) { UpdateUIState(UISTATE_INGAME); // Close when a subscreen got closed. @@ -459,6 +464,11 @@ const char *GetCompilerABI() { #endif } +void SystemInfoScreen::update() { + TabbedUIDialogScreenWithGameBackground::update(); + g_OSD.NudgeSidebar(); +} + void SystemInfoScreen::CreateTabs() { using namespace Draw; using namespace UI; @@ -755,36 +765,58 @@ void SystemInfoScreen::CreateTabs() { VulkanContext *vk = (VulkanContext *)draw->GetNativeObject(Draw::NativeObject::CONTEXT); - gpuExtensions->Add(new ItemHeader(si->T("Vulkan Features"))); + CollapsibleSection *vulkanFeatures = gpuExtensions->Add(new CollapsibleSection(si->T("Vulkan Features"))); std::vector features = draw->GetFeatureList(); for (auto &feature : features) { - gpuExtensions->Add(new TextView(feature, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + vulkanFeatures->Add(new TextView(feature, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); } - gpuExtensions->Add(new ItemHeader(si->T("Present Modes"))); + CollapsibleSection *presentModes = gpuExtensions->Add(new CollapsibleSection(si->T("Present Modes"))); for (auto mode : vk->GetAvailablePresentModes()) { std::string str = VulkanPresentModeToString(mode); if (mode == vk->GetPresentMode()) { str += std::string(" (") + di->T("Current") + ")"; } - gpuExtensions->Add(new TextView(VulkanPresentModeToString(mode), new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + presentModes->Add(new TextView(str, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); } - gpuExtensions->Add(new ItemHeader(si->T("Display Color Formats"))); + CollapsibleSection *colorFormats = gpuExtensions->Add(new CollapsibleSection(si->T("Display Color Formats"))); if (vk) { for (auto &format : vk->SurfaceFormats()) { std::string line = StringFromFormat("%s : %s", VulkanFormatToString(format.format), VulkanColorSpaceToString(format.colorSpace)); - gpuExtensions->Add(new TextView(line, + colorFormats->Add(new TextView(line, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); } } #endif - gpuExtensions->Add(new ItemHeader(si->T("Vulkan Extensions"))); - std::vector extensions = draw->GetExtensionList(); + CollapsibleSection *enabledExtensions = gpuExtensions->Add(new CollapsibleSection(std::string(si->T("Vulkan Extensions")) + " (" + di->T("Enabled") + ")")); + std::vector extensions = draw->GetExtensionList(true, true); std::sort(extensions.begin(), extensions.end()); for (auto &extension : extensions) { - gpuExtensions->Add(new TextView(extension, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + enabledExtensions->Add(new TextView(extension, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + } + // Also get instance extensions + enabledExtensions->Add(new ItemHeader("Instance")); + extensions = draw->GetExtensionList(false, true); + std::sort(extensions.begin(), extensions.end()); + for (auto &extension : extensions) { + enabledExtensions->Add(new TextView(extension, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + } + + CollapsibleSection *vulkanExtensions = gpuExtensions->Add(new CollapsibleSection(si->T("Vulkan Extensions"))); + extensions = draw->GetExtensionList(true, false); + std::sort(extensions.begin(), extensions.end()); + for (auto &extension : extensions) { + vulkanExtensions->Add(new TextView(extension, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); + } + + vulkanExtensions->Add(new ItemHeader("Instance")); + // Also get instance extensions + extensions = draw->GetExtensionList(false, false); + std::sort(extensions.begin(), extensions.end()); + for (auto &extension : extensions) { + vulkanExtensions->Add(new TextView(extension, new LayoutParams(FILL_PARENT, WRAP_CONTENT)))->SetFocusable(true); } } @@ -803,7 +835,8 @@ void SystemInfoScreen::CreateTabs() { internals->Add(new ItemHeader(si->T("Notification tests"))); internals->Add(new Choice(si->T("Error")))->OnClick.Add([&](UI::EventParams &) { - g_OSD.Show(OSDType::MESSAGE_ERROR, "Error"); + std::string str = "Error " + CodepointToUTF8(0x1F41B) + CodepointToUTF8(0x1F41C) + CodepointToUTF8(0x1F914); + g_OSD.Show(OSDType::MESSAGE_ERROR, str); return UI::EVENT_DONE; }); internals->Add(new Choice(si->T("Warning")))->OnClick.Add([&](UI::EventParams &) { @@ -852,6 +885,13 @@ void SystemInfoScreen::CreateTabs() { g_OSD.ShowLeaderboardTracker(1, nullptr, false); return UI::EVENT_DONE; }); + + static const char *positions[] = { "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right", "None" }; + auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS); + + internals->Add(new ItemHeader(ac->T("Notifications"))); + internals->Add(new PopupMultiChoice(&g_Config.iAchievementsLeaderboardTrackerPos, ac->T("Leaderboard tracker"), positions, 0, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + #if PPSSPP_PLATFORM(ANDROID) internals->Add(new Choice(si->T("Exception")))->OnClick.Add([&](UI::EventParams &) { System_Notify(SystemNotification::TEST_JAVA_EXCEPTION); @@ -1176,7 +1216,7 @@ void JitCompareScreen::OnRandomBlock(int flag) { currentBlock_ = rand() % numBlocks; JitBlockDebugInfo b = blockCache->GetBlockDebugInfo(currentBlock_); u32 mipsBytes = (u32)b.origDisasm.size() * 4; - for (u32 addr = b.originalAddress; addr <= b.originalAddress + mipsBytes; addr += 4) { + for (u32 addr = b.originalAddress; addr < b.originalAddress + mipsBytes; addr += 4) { MIPSOpcode opcode = Memory::Read_Instruction(addr); if (MIPSGetInfo(opcode) & flag) { char temp[256]; diff --git a/UI/DevScreens.h b/UI/DevScreens.h index 743b83af08..d000bfb594 100644 --- a/UI/DevScreens.h +++ b/UI/DevScreens.h @@ -42,8 +42,6 @@ protected: UI::EventReturn OnLogConfig(UI::EventParams &e); UI::EventReturn OnJitCompare(UI::EventParams &e); UI::EventReturn OnShaderView(UI::EventParams &e); - UI::EventReturn OnFreezeFrame(UI::EventParams &e); - UI::EventReturn OnDumpFrame(UI::EventParams &e); UI::EventReturn OnDeveloperTools(UI::EventParams &e); UI::EventReturn OnResetLimitedLogging(UI::EventParams &e); @@ -113,6 +111,8 @@ public: void CreateTabs() override; + void update() override; + protected: bool ShowSearchControls() const override { return false; } }; @@ -224,3 +224,5 @@ private: void DrawProfile(UIContext &ui); const char *GetCompilerABI(); + +void AddOverlayList(UI::ViewGroup *items, ScreenManager *screenManager); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index aeeea0be4c..156ba94478 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -92,6 +92,7 @@ using namespace std::placeholders; #include "UI/ProfilerDraw.h" #include "UI/DiscordIntegration.h" #include "UI/ChatScreen.h" +#include "UI/DebugOverlay.h" #include "Core/Reporting.h" @@ -563,7 +564,7 @@ void EmuScreen::sendMessage(const char *message, const char *value) { } void EmuScreen::UnsyncTouch(const TouchInput &touch) { - Core_NotifyActivity(); + System_Notify(SystemNotification::ACTIVITY); if (chatMenu_ && chatMenu_->GetVisibility() == UI::V_VISIBLE) { // Avoid pressing touch button behind the chat @@ -829,7 +830,7 @@ void EmuScreen::onVKeyAnalog(int virtualKeyCode, float value) { } bool EmuScreen::UnsyncKey(const KeyInput &key) { - Core_NotifyActivity(); + System_Notify(SystemNotification::ACTIVITY); if (UI::IsFocusMovementEnabled()) { if (UIScreen::UnsyncKey(key)) { @@ -848,8 +849,7 @@ bool EmuScreen::UnsyncKey(const KeyInput &key) { } void EmuScreen::UnsyncAxis(const AxisInput &axis) { - Core_NotifyActivity(); - + System_Notify(SystemNotification::ACTIVITY); return controlMapper_.Axis(axis); } @@ -894,15 +894,15 @@ protected: // TODO: Shouldn't actually need bounds for this, Anchor can center too. static UI::AnchorLayoutParams *AnchorInCorner(const Bounds &bounds, int corner, float xOffset, float yOffset) { using namespace UI; - switch (g_Config.iChatButtonPosition) { - case 0: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, NONE, NONE, yOffset, true); - case 1: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, bounds.centerX(), NONE, NONE, yOffset, true); - case 2: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, NONE, xOffset, yOffset, true); - case 3: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, yOffset, NONE, NONE, true); - case 4: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, bounds.centerX(), yOffset, NONE, NONE, true); - case 5: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, yOffset, xOffset, NONE, true); - case 6: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, bounds.centerY(), NONE, NONE, true); - case 7: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, bounds.centerY(), xOffset, NONE, true); + switch ((ScreenEdgePosition)g_Config.iChatButtonPosition) { + case ScreenEdgePosition::BOTTOM_LEFT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, NONE, NONE, yOffset, true); + case ScreenEdgePosition::BOTTOM_CENTER: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, bounds.centerX(), NONE, NONE, yOffset, true); + case ScreenEdgePosition::BOTTOM_RIGHT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, NONE, xOffset, yOffset, true); + case ScreenEdgePosition::TOP_LEFT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, yOffset, NONE, NONE, true); + case ScreenEdgePosition::TOP_CENTER: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, bounds.centerX(), yOffset, NONE, NONE, true); + case ScreenEdgePosition::TOP_RIGHT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, yOffset, xOffset, NONE, true); + case ScreenEdgePosition::CENTER_LEFT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, bounds.centerY(), NONE, NONE, true); + case ScreenEdgePosition::CENTER_RIGHT: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, NONE, bounds.centerY(), xOffset, NONE, true); default: return new AnchorLayoutParams(WRAP_CONTENT, WRAP_CONTENT, xOffset, NONE, NONE, yOffset, true); } } @@ -1172,31 +1172,6 @@ void EmuScreen::checkPowerDown() { } } -static void DrawDebugStats(UIContext *ctx, const Bounds &bounds) { - FontID ubuntu24("UBUNTU24"); - - float left = std::max(bounds.w / 2 - 20.0f, 550.0f); - float right = bounds.w - left - 20.0f; - - char statbuf[4096]; - - ctx->Flush(); - ctx->BindFontTexture(); - ctx->Draw()->SetFontScale(.7f, .7f); - - __DisplayGetDebugStats(statbuf, sizeof(statbuf)); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, left, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, left, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - - __SasGetDebugStats(statbuf, sizeof(statbuf)); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + left + 21, bounds.y + 31, right, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + left + 20, bounds.y + 30, right, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - - ctx->Draw()->SetFontScale(1.0f, 1.0f); - ctx->Flush(); - ctx->RebindTexture(); -} - static const char *CPUCoreAsString(int core) { switch (core) { case 0: return "Interpreter"; @@ -1343,38 +1318,6 @@ Invalid / Unknown (%d) ctx->RebindTexture(); } -static void DrawAudioDebugStats(UIContext *ctx, const Bounds &bounds) { - FontID ubuntu24("UBUNTU24"); - - char statbuf[4096] = { 0 }; - System_AudioGetDebugStats(statbuf, sizeof(statbuf)); - - ctx->Flush(); - ctx->BindFontTexture(); - ctx->Draw()->SetFontScale(0.7f, 0.7f); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, bounds.w - 20, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, bounds.w - 20, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII | FLAG_WRAP_TEXT); - ctx->Draw()->SetFontScale(1.0f, 1.0f); - ctx->Flush(); - ctx->RebindTexture(); -} - -static void DrawControlDebug(UIContext *ctx, const ControlMapper &mapper, const Bounds &bounds) { - FontID ubuntu24("UBUNTU24"); - - char statbuf[4096] = { 0 }; - mapper.GetDebugString(statbuf, sizeof(statbuf)); - - ctx->Flush(); - ctx->BindFontTexture(); - ctx->Draw()->SetFontScale(0.5f, 0.5f); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 11, bounds.y + 31, bounds.w - 20, bounds.h - 30, 0xc0000000, FLAG_DYNAMIC_ASCII); - ctx->Draw()->DrawTextRect(ubuntu24, statbuf, bounds.x + 10, bounds.y + 30, bounds.w - 20, bounds.h - 30, 0xFFFFFFFF, FLAG_DYNAMIC_ASCII); - ctx->Draw()->SetFontScale(1.0f, 1.0f); - ctx->Flush(); - ctx->RebindTexture(); -} - static void DrawFPS(UIContext *ctx, const Bounds &bounds) { FontID ubuntu24("UBUNTU24"); float vps, fps, actual_fps; @@ -1408,42 +1351,9 @@ static void DrawFPS(UIContext *ctx, const Bounds &bounds) { ctx->RebindTexture(); } -static void DrawFrameTimes(UIContext *ctx, const Bounds &bounds) { - FontID ubuntu24("UBUNTU24"); - int valid, pos; - double *sleepHistory; - double *history = __DisplayGetFrameTimes(&valid, &pos, &sleepHistory); - int scale = 7000; - int width = 600; - - ctx->Flush(); - ctx->BeginNoTex(); - int bottom = bounds.y2(); - for (int i = 0; i < valid; ++i) { - double activeTime = history[i] - sleepHistory[i]; - ctx->Draw()->vLine(bounds.x + i, bottom, bottom - activeTime * scale, 0xFF3FFF3F); - ctx->Draw()->vLine(bounds.x + i, bottom - activeTime * scale, bottom - history[i] * scale, 0x7F3FFF3F); - } - ctx->Draw()->vLine(bounds.x + pos, bottom, bottom - 512, 0xFFff3F3f); - - ctx->Draw()->hLine(bounds.x, bottom - 0.0333 * scale, bounds.x + width, 0xFF3f3Fff); - ctx->Draw()->hLine(bounds.x, bottom - 0.0167 * scale, bounds.x + width, 0xFF3f3Fff); - - ctx->Flush(); - ctx->Begin(); - ctx->BindFontTexture(); - ctx->Draw()->SetFontScale(0.5f, 0.5f); - ctx->Draw()->DrawText(ubuntu24, "33.3ms", bounds.x + width, bottom - 0.0333 * scale, 0xFF3f3Fff, ALIGN_BOTTOMLEFT | FLAG_DYNAMIC_ASCII); - ctx->Draw()->DrawText(ubuntu24, "16.7ms", bounds.x + width, bottom - 0.0167 * scale, 0xFF3f3Fff, ALIGN_BOTTOMLEFT | FLAG_DYNAMIC_ASCII); - ctx->Draw()->SetFontScale(1.0f, 1.0f); - ctx->Flush(); - ctx->RebindTexture(); -} - void EmuScreen::preRender() { using namespace Draw; DrawContext *draw = screenManager()->getDrawContext(); - draw->BeginFrame(); // Here we do NOT bind the backbuffer or clear the screen, unless non-buffered. // The emuscreen is different than the others - we really want to allow the game to render to framebuffers // before we ever bind the backbuffer for rendering. On mobile GPUs, switching back and forth between render @@ -1477,7 +1387,6 @@ void EmuScreen::postRender() { return; if (stopRender_) draw->WipeQueue(); - draw->EndFrame(); } void EmuScreen::render() { @@ -1489,6 +1398,10 @@ void EmuScreen::render() { g_OSD.NudgeSidebar(); + if (screenManager()->topScreen() == this) { + System_Notify(SystemNotification::KEEP_SCREEN_AWAKE); + } + if (invalid_) { // Loading, or after shutdown? if (loadingTextView_->GetVisibility() == UI::V_VISIBLE) @@ -1515,7 +1428,7 @@ void EmuScreen::render() { } } - Core_UpdateDebugStats(g_Config.bShowDebugStats || g_Config.bLogFrameDrops); + Core_UpdateDebugStats((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS || g_Config.bLogFrameDrops); bool blockedExecution = Achievements::IsBlockingExecution(); if (!blockedExecution) { @@ -1591,7 +1504,7 @@ bool EmuScreen::hasVisibleUI() { if (g_Config.bEnableCardboardVR || g_Config.bEnableNetworkChat) return true; // Debug UI. - if (g_Config.bShowDebugStats || g_Config.bShowDeveloperMenu || g_Config.bShowAudioDebug || g_Config.bShowFrameProfiler || g_Config.bShowControlDebug) + if ((DebugOverlay)g_Config.iDebugOverlay != DebugOverlay::OFF || g_Config.bShowDeveloperMenu) return true; // Exception information. @@ -1626,40 +1539,16 @@ void EmuScreen::renderUI() { } if (!invalid_) { - if (g_Config.bShowDebugStats) { - DrawDebugStats(ctx, ctx->GetLayoutBounds()); + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::CONTROL) { + DrawControlMapperOverlay(ctx, ctx->GetLayoutBounds(), controlMapper_); } - - if (g_Config.bShowAudioDebug) { - DrawAudioDebugStats(ctx, ctx->GetLayoutBounds()); - } - if (g_Config.iShowStatusFlags) { DrawFPS(ctx, ctx->GetLayoutBounds()); } - - if (g_Config.bDrawFrameGraph) { - DrawFrameTimes(ctx, ctx->GetLayoutBounds()); - } - - if (g_Config.bShowControlDebug) { - DrawControlDebug(ctx, controlMapper_, ctx->GetLayoutBounds()); - } } -#if !PPSSPP_PLATFORM(UWP) && !PPSSPP_PLATFORM(SWITCH) - if ((g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) && g_Config.bShowAllocatorDebug) { - DrawGPUMemoryVis(ctx, gpu); - } - - if ((g_Config.iGPUBackend == (int)GPUBackend::VULKAN || g_Config.iGPUBackend == (int)GPUBackend::OPENGL) && g_Config.bShowGpuProfile) { - DrawGPUProfilerVis(ctx, gpu); - } - -#endif - #ifdef USE_PROFILER - if (g_Config.bShowFrameProfiler && !invalid_) { + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::FRAME_PROFILE && !invalid_) { DrawProfile(*ctx); } #endif diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 08ddcc1410..ff0601b52b 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -432,7 +432,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) return !g_Config.bSkipBufferEffects && g_Config.iFrameSkip == 0; }); - if (GetGPUBackend() == GPUBackend::VULKAN || GetGPUBackend() == GPUBackend::OPENGL) { + if (draw->GetDeviceCaps().setMaxFrameLatencySupported) { static const char *bufferOptions[] = { "No buffer", "Up to 1", "Up to 2" }; PopupMultiChoice *inflightChoice = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iInflightFrames, gr->T("Buffer graphics commands (faster, input lag)"), bufferOptions, 1, ARRAY_SIZE(bufferOptions), I18NCat::GRAPHICS, screenManager())); inflightChoice->OnChoice.Handle(this, &GameSettingsScreen::OnInflightFramesChoice); @@ -562,8 +562,7 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings) #ifdef CAN_DISPLAY_CURRENT_BATTERY_CAPACITY BitCheckBox *showBattery = graphicsSettings->Add(new BitCheckBox(&g_Config.iShowStatusFlags, (int)ShowStatusFlags::BATTERY_PERCENT, gr->T("Show Battery %"))); #endif - - graphicsSettings->Add(new CheckBox(&g_Config.bShowDebugStats, gr->T("Show Debug Statistics")))->OnClick.Handle(this, &GameSettingsScreen::OnJitAffectingSetting); + AddOverlayList(graphicsSettings, screenManager()); } void GameSettingsScreen::CreateAudioSettings(UI::ViewGroup *audioSettings) { @@ -1665,6 +1664,8 @@ void DeveloperToolsScreen::CreateViews() { cpuTests->SetEnabled(TestsAvailable()); #endif + AddOverlayList(list, screenManager()); + if (g_Config.iGPUBackend == (int)GPUBackend::VULKAN) { list->Add(new CheckBox(&g_Config.bRenderMultiThreading, dev->T("Multi-threaded rendering"), ""))->OnClick.Add([](UI::EventParams &e) { // TODO: Not translating yet. Will combine with other translations of settings that need restart. @@ -1880,7 +1881,7 @@ UI::EventReturn DeveloperToolsScreen::OnRemoteDebugger(UI::EventParams &e) { } // Persist the setting. Maybe should separate? g_Config.bRemoteDebuggerOnStartup = allowDebugger_; - return UI::EVENT_CONTINUE; + return UI::EVENT_DONE; } void DeveloperToolsScreen::update() { diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 68bc44ee58..0787ac288e 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -776,6 +776,15 @@ void GameBrowser::Refresh() { if (System_GetPropertyBool(SYSPROP_HAS_FOLDER_BROWSER)) { topBar->Add(new Choice(mm->T("Browse"), ImageID("I_FOLDER_OPEN"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Handle(this, &GameBrowser::BrowseClick); } + if (System_GetPropertyInt(SYSPROP_DEVICE_TYPE) == DEVICE_TYPE_TV) { + topBar->Add(new Choice(mm->T("Enter Path"), new LayoutParams(WRAP_CONTENT, 64.0f)))->OnClick.Add([=](UI::EventParams &) { + auto mm = GetI18NCategory(I18NCat::MAINMENU); + System_InputBoxGetString(mm->T("Enter Path"), path_.GetPath().ToString(), [=](const char *responseString, int responseValue) { + this->SetPath(Path(responseString)); + }); + return UI::EVENT_DONE; + }); + } #endif } else { topBar->Add(new Spacer(new LinearLayoutParams(FILL_PARENT, 64.0f, 1.0f))); diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index 0f928332e2..9bede1bd6b 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -34,6 +34,7 @@ #include "Common/File/VFS/VFS.h" #include "Common/Data/Color/RGBAUtil.h" +#include "Common/Data/Encoding/Utf8.h" #include "Common/Data/Text/I18n.h" #include "Common/Data/Random/Rng.h" #include "Common/TimeUtil.h" @@ -794,11 +795,13 @@ void LogoScreen::render() { int ppsspp_org_y = bounds.h / 2 + 130; dc.DrawText("www.ppsspp.org", bounds.centerX(), ppsspp_org_y, textColor, ALIGN_CENTER); -#if !PPSSPP_PLATFORM(UWP) +#if !PPSSPP_PLATFORM(UWP) || defined(_DEBUG) // Draw the graphics API, except on UWP where it's always D3D11 std::string apiName = screenManager()->getDrawContext()->GetInfoString(InfoField::APINAME); #ifdef _DEBUG - apiName += ", debug build"; + apiName += ", debug build "; + // Add some emoji for testing. + apiName += CodepointToUTF8(0x1F41B) + CodepointToUTF8(0x1F41C) + CodepointToUTF8(0x1F914); #endif dc.DrawText(gr->T(apiName), bounds.centerX(), ppsspp_org_y + 50, textColor, ALIGN_CENTER); #endif diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index d79e599ea8..62745e88b7 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -90,6 +90,7 @@ #include "Core/ConfigValues.h" #include "Core/Core.h" #include "Core/FileLoaders/DiskCachingFileLoader.h" +#include "Core/FrameTiming.h" #include "Core/KeyMap.h" #include "Core/Reporting.h" #include "Core/RetroAchievements.h" @@ -151,6 +152,8 @@ #include +void HandleGlobalMessage(const std::string &msg, const std::string &value); + ScreenManager *g_screenManager; std::string config_filename; @@ -1069,23 +1072,7 @@ void RenderOverlays(UIContext *dc, void *userdata) { } } -void NativeRender(GraphicsContext *graphicsContext) { - _dbg_assert_(graphicsContext != nullptr); - _dbg_assert_(g_screenManager != nullptr); - - g_GameManager.Update(); - - if (GetUIState() != UISTATE_INGAME) { - // Note: We do this from NativeRender so that the graphics context is - // guaranteed valid, to be safe - g_gameInfoCache messes around with textures. - g_BackgroundAudio.Update(); - } - - float xres = g_display.dp_xres; - float yres = g_display.dp_yres; - - // Apply the UIContext bounds as a 2D transformation matrix. - // TODO: This should be moved into the draw context... +static Matrix4x4 ComputeOrthoMatrix(float xres, float yres) { Matrix4x4 ortho; switch (GetGPUBackend()) { case GPUBackend::VULKAN: @@ -1113,25 +1100,88 @@ void NativeRender(GraphicsContext *graphicsContext) { if (g_display.rotation != DisplayRotation::ROTATE_0) { ortho = ortho * g_display.rot_matrix; } + return ortho; +} + +void NativeFrame(GraphicsContext *graphicsContext) { + PROFILE_END_FRAME(); + + std::vector toProcess; + { + std::lock_guard lock(pendingMutex); + toProcess = std::move(pendingMessages); + pendingMessages.clear(); + } + + for (const auto &item : toProcess) { + HandleGlobalMessage(item.msg, item.value); + g_screenManager->sendMessage(item.msg.c_str(), item.value.c_str()); + } + + g_requestManager.ProcessRequests(); + + // it's ok to call this redundantly with DoFrame from EmuScreen + Achievements::Idle(); + + g_DownloadManager.Update(); + g_screenManager->update(); + + g_Discord.Update(); + g_BackgroundAudio.Play(); + + g_OSD.Update(); + + UI::SetSoundEnabled(g_Config.bUISound); + + _dbg_assert_(graphicsContext != nullptr); + _dbg_assert_(g_screenManager != nullptr); + + g_GameManager.Update(); + + if (GetUIState() != UISTATE_INGAME) { + // Note: We do this from NativeFrame so that the graphics context is + // guaranteed valid, to be safe - g_gameInfoCache messes around with textures. + g_BackgroundAudio.Update(); + } + + // Apply the UIContext bounds as a 2D transformation matrix. + // TODO: This should be moved into the draw context... + Matrix4x4 ortho = ComputeOrthoMatrix(g_display.dp_xres, g_display.dp_yres); + + Draw::DebugFlags debugFlags = Draw::DebugFlags::NONE; + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::GPU_PROFILE) + debugFlags |= Draw::DebugFlags::PROFILE_TIMESTAMPS; + if (g_Config.bGpuLogProfiler) + debugFlags |= Draw::DebugFlags::PROFILE_SCOPES; + + g_draw->BeginFrame(debugFlags); ui_draw2d.PushDrawMatrix(ortho); ui_draw2d_front.PushDrawMatrix(ortho); g_screenManager->getUIContext()->SetTintSaturation(g_Config.fUITint, g_Config.fUISaturation); - Draw::DebugFlags debugFlags = Draw::DebugFlags::NONE; - if (g_Config.bShowGpuProfile) - debugFlags |= Draw::DebugFlags::PROFILE_TIMESTAMPS; - if (g_Config.bGpuLogProfiler) - debugFlags |= Draw::DebugFlags::PROFILE_SCOPES; - g_screenManager->getDrawContext()->SetDebugFlags(debugFlags); - // All actual rendering happen in here. g_screenManager->render(); if (g_screenManager->getUIContext()->Text()) { g_screenManager->getUIContext()->Text()->OncePerFrame(); } + ui_draw2d.PopDrawMatrix(); + ui_draw2d_front.PopDrawMatrix(); + + g_draw->EndFrame(); + + // This, between EndFrame and Present, is where we should actually wait to do present time management. + // There might not be a meaningful distinction here for all backends.. + + if (renderCounter < 10 && ++renderCounter == 10) { + // We're rendering fine, clear out failure info. + ClearFailedGPUBackends(); + } + + g_draw->Present(1); + if (resized) { INFO_LOG(G3D, "Resized flag set - recalculating bounds"); resized = false; @@ -1163,14 +1213,6 @@ void NativeRender(GraphicsContext *graphicsContext) { // INFO_LOG(G3D, "Polling graphics context"); graphicsContext->Poll(); } - - ui_draw2d.PopDrawMatrix(); - ui_draw2d_front.PopDrawMatrix(); - - if (renderCounter < 10 && ++renderCounter == 10) { - // We're rendering fine, clear out failure info. - ClearFailedGPUBackends(); - } } void HandleGlobalMessage(const std::string &msg, const std::string &value) { @@ -1228,37 +1270,6 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { } } -void NativeUpdate() { - PROFILE_END_FRAME(); - - std::vector toProcess; - { - std::lock_guard lock(pendingMutex); - toProcess = std::move(pendingMessages); - pendingMessages.clear(); - } - - for (const auto &item : toProcess) { - HandleGlobalMessage(item.msg, item.value); - g_screenManager->sendMessage(item.msg.c_str(), item.value.c_str()); - } - - g_requestManager.ProcessRequests(); - - // it's ok to call this redundantly with DoFrame from EmuScreen - Achievements::Idle(); - - g_DownloadManager.Update(); - g_screenManager->update(); - - g_Discord.Update(); - g_BackgroundAudio.Play(); - - g_OSD.Update(); - - UI::SetSoundEnabled(g_Config.bUISound); -} - bool NativeIsAtTopLevel() { // This might need some synchronization? if (!g_screenManager) { diff --git a/UI/OnScreenDisplay.cpp b/UI/OnScreenDisplay.cpp index a8bc84c441..0302515a3c 100644 --- a/UI/OnScreenDisplay.cpp +++ b/UI/OnScreenDisplay.cpp @@ -10,6 +10,7 @@ #include "Common/Math/math_util.h" #include "Common/UI/IconCache.h" #include "UI/RetroAchievementScreens.h" +#include "UI/DebugOverlay.h" #include "Common/UI/Context.h" #include "Common/System/OSD.h" @@ -156,12 +157,12 @@ static void RenderOSDEntry(UIContext &dc, const OnScreenDisplay::Entry &entry, B } } -static void MeasureOSDProgressBar(const UIContext &dc, const OnScreenDisplay::ProgressBar &bar, float *width, float *height) { +static void MeasureOSDProgressBar(const UIContext &dc, const OnScreenDisplay::Entry &bar, float *width, float *height) { *height = 36; *width = 450.0f; } -static void RenderOSDProgressBar(UIContext &dc, const OnScreenDisplay::ProgressBar &entry, Bounds bounds, int align, float alpha) { +static void RenderOSDProgressBar(UIContext &dc, const OnScreenDisplay::Entry &entry, Bounds bounds, int align, float alpha) { uint32_t foreGround = whiteAlpha(alpha); dc.DrawRectDropShadow(bounds, 12.0f, 0.7f * alpha); @@ -197,7 +198,7 @@ static void RenderOSDProgressBar(UIContext &dc, const OnScreenDisplay::ProgressB dc.SetFontStyle(dc.theme->uiFont); dc.SetFontScale(1.0f, 1.0f); - dc.DrawTextShadowRect(entry.message.c_str(), bounds, colorAlpha(0xFFFFFFFF, alpha), (align & FLAG_DYNAMIC_ASCII) | ALIGN_CENTER); + dc.DrawTextShadowRect(entry.text.c_str(), bounds, colorAlpha(0xFFFFFFFF, alpha), (align & FLAG_DYNAMIC_ASCII) | ALIGN_CENTER); } static void MeasureLeaderboardTracker(UIContext &dc, const std::string &text, float *width, float *height) { @@ -226,143 +227,215 @@ void OnScreenMessagesView::Draw(UIContext &dc) { double now = time_now_d(); - float y = 10.0f; + const float padding = 5.0f; + const float fadeinCoef = 1.0f / OnScreenDisplay::FadeinTime(); const float fadeoutCoef = 1.0f / OnScreenDisplay::FadeoutTime(); float sidebarAlpha = g_OSD.SidebarAlpha(); - if (sidebarAlpha > 0.0f) { - // Draw side entries. Top entries should apply on top of them if there's a collision, so drawing - // these first makes sense. - const std::vector sideEntries = g_OSD.SideEntries(); - for (auto &entry : sideEntries) { - float tw, th; + struct LayoutEdge { + float height; + float maxWidth; + float alpha; + }; - const rc_client_achievement_t *achievement = nullptr; - AchievementRenderStyle style; + struct MeasuredEntry { + float w; + float h; + float h1; + float alpha; + int align; + int align2; + AchievementRenderStyle style; + }; - switch (entry.type) { - case OSDType::ACHIEVEMENT_PROGRESS: - { - achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); - if (!achievement) - continue; - style = AchievementRenderStyle::PROGRESS_INDICATOR; - MeasureAchievement(dc, achievement, style, &tw, &th); - break; - } - case OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR: - { - achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); - if (!achievement) - continue; - style = AchievementRenderStyle::CHALLENGE_INDICATOR; - MeasureAchievement(dc, achievement, style, &tw, &th); - break; - } - case OSDType::LEADERBOARD_TRACKER: - { - MeasureLeaderboardTracker(dc, entry.text, &tw, &th); - break; - } - default: - continue; - } - Bounds b(10.0f, y, tw, th); - // We don't multiply in sidebarAlpha here because it shouldn't drive the below animation. - float alpha = Clamp((float)(entry.endTime - now) * fadeoutCoef, 0.0f, 1.0f); - // OK, render the thing. - - switch (entry.type) { - case OSDType::ACHIEVEMENT_PROGRESS: - case OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR: - { - RenderAchievement(dc, achievement, style, b, alpha * sidebarAlpha, entry.startTime, now, false); - break; - } - case OSDType::LEADERBOARD_TRACKER: - RenderLeaderboardTracker(dc, b, entry.text, alpha * sidebarAlpha); - break; - default: - continue; - } - - y += (b.h + 4.0f) * alpha; // including alpha here gets us smooth animations. - } - } - - y = 10.0f; - - // Draw the progress bars. - const std::vector bars = g_OSD.ProgressBars(); - for (auto &bar : bars) { - float tw, th; - MeasureOSDProgressBar(dc, bar, &tw, &th); - Bounds b(0.0f, y, tw, th); - b.x = (bounds_.w - b.w) * 0.5f; - - float enterAlpha = saturatef((float)(now - bar.startTime) * 4.0f); - float leaveAlpha = saturatef((float)(bar.endTime - now) * 4.0f); - float alpha = std::min(enterAlpha, leaveAlpha); - RenderOSDProgressBar(dc, bar, b, 0, alpha); - y += (b.h + 4.0f) * alpha; // including alpha here gets us smooth animations. - } - - // Draw the rest of the top-center messages. + // Grab all the entries. Makes a copy so we can release the lock ASAP. const std::vector entries = g_OSD.Entries(); - for (const auto &entry : entries) { - dc.SetFontScale(1.0f, 1.0f); - // Messages that are wider than the screen are left-aligned instead of centered. - int align = 0; - // If we have newlines, we may be looking at ASCII debug output. But let's verify. - if (entry.text.find('\n') != 0) { - if (!UTF8StringHasNonASCII(entry.text.c_str())) - align |= FLAG_DYNAMIC_ASCII; + std::vector measuredEntries; + measuredEntries.resize(entries.size()); + + // Indexed by the enum ScreenEdgePosition. + LayoutEdge edges[(size_t)ScreenEdgePosition::VALUE_COUNT]{}; + for (size_t i = 0; i < (size_t)ScreenEdgePosition::VALUE_COUNT; i++) { + edges[i].alpha = sidebarAlpha; + } + edges[(size_t)ScreenEdgePosition::TOP_CENTER].alpha = 1.0f; + + ScreenEdgePosition typeEdges[(size_t)OSDType::VALUE_COUNT]{}; + // Default to top. + for (int i = 0; i < (size_t)OSDType::VALUE_COUNT; i++) { + typeEdges[i] = ScreenEdgePosition::TOP_CENTER; + } + + typeEdges[(size_t)OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR] = (ScreenEdgePosition)g_Config.iAchievementsChallengePos; + typeEdges[(size_t)OSDType::ACHIEVEMENT_PROGRESS] = (ScreenEdgePosition)g_Config.iAchievementsProgressPos; + typeEdges[(size_t)OSDType::LEADERBOARD_TRACKER] = (ScreenEdgePosition)g_Config.iAchievementsLeaderboardTrackerPos; + typeEdges[(size_t)OSDType::LEADERBOARD_STARTED_FAILED] = (ScreenEdgePosition)g_Config.iAchievementsLeaderboardStartedOrFailedPos; + typeEdges[(size_t)OSDType::LEADERBOARD_SUBMITTED] = (ScreenEdgePosition)g_Config.iAchievementsLeaderboardSubmittedPos; + typeEdges[(size_t)OSDType::ACHIEVEMENT_UNLOCKED] = (ScreenEdgePosition)g_Config.iAchievementsUnlockedPos; + + dc.SetFontScale(1.0f, 1.0f); + + // First pass: Measure all the sides. + for (size_t i = 0; i < entries.size(); i++) { + const auto &entry = entries[i]; + auto &measuredEntry = measuredEntries[i]; + + ScreenEdgePosition pos = typeEdges[(size_t)entry.type]; + if (pos == ScreenEdgePosition::VALUE_COUNT || pos == (ScreenEdgePosition)-1) { + // NONE. + continue; } - float tw, th = 0.0f, h1 = 0.0f; + measuredEntry.align = 0; + measuredEntry.align2 = 0; + // If we have newlines, we may be looking at ASCII debug output. But let's verify. + if (entry.text.find('\n') != std::string::npos) { + if (!UTF8StringHasNonASCII(entry.text.c_str())) + measuredEntry.align |= FLAG_DYNAMIC_ASCII; + } + if (entry.text2.find('\n') != std::string::npos) { + if (!UTF8StringHasNonASCII(entry.text2.c_str())) + measuredEntry.align2 |= FLAG_DYNAMIC_ASCII; + } switch (entry.type) { + case OSDType::ACHIEVEMENT_PROGRESS: + { + const rc_client_achievement_t *achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); + if (!achievement) + continue; + measuredEntry.style = AchievementRenderStyle::PROGRESS_INDICATOR; + MeasureAchievement(dc, achievement, measuredEntry.style, &measuredEntry.w, &measuredEntry.h); + break; + } + case OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR: + { + const rc_client_achievement_t *achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); + if (!achievement) + continue; + measuredEntry.style = AchievementRenderStyle::CHALLENGE_INDICATOR; + MeasureAchievement(dc, achievement, measuredEntry.style, &measuredEntry.w, &measuredEntry.h); + break; + } + case OSDType::LEADERBOARD_TRACKER: + { + MeasureLeaderboardTracker(dc, entry.text, &measuredEntry.w, &measuredEntry.h); + break; + } case OSDType::ACHIEVEMENT_UNLOCKED: { const rc_client_achievement_t *achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); - if (achievement) { - MeasureAchievement(dc, achievement, AchievementRenderStyle::UNLOCKED, &tw, &th); - h1 = th; - } - tw = 550.0f; + if (!achievement) + continue; + measuredEntry.style = AchievementRenderStyle::UNLOCKED; + MeasureAchievement(dc, achievement, AchievementRenderStyle::UNLOCKED, &measuredEntry.w, &measuredEntry.h); + measuredEntry.h1 = measuredEntry.h; + measuredEntry.w = 550.0f; break; } + case OSDType::PROGRESS_BAR: + MeasureOSDProgressBar(dc, entry, &measuredEntry.w, &measuredEntry.h); + break; default: - MeasureOSDEntry(dc, entry, align, &tw, &th, &h1); + MeasureOSDEntry(dc, entry, measuredEntry.align, &measuredEntry.w, &measuredEntry.h, &measuredEntry.h1); break; } - Bounds b(0.0f, y, tw, th); + float enterAlpha = saturatef((float)(now - entry.startTime) * fadeoutCoef); + float leaveAlpha = saturatef((float)(entry.endTime - now) * fadeoutCoef); + float alpha = std::min(enterAlpha, leaveAlpha); + measuredEntry.alpha = alpha; - if (tw > bounds_.w) { - // Left-aligned - b.x = 2; - } else { - // Centered - b.x = (bounds_.w - b.w) * 0.5f; + edges[(size_t)pos].height += (measuredEntry.h + 4.0f) * alpha; + edges[(size_t)pos].maxWidth = std::max(edges[(size_t)pos].maxWidth, measuredEntry.w); + } + + // Now, perform layout for all 8 edges. + for (size_t i = 0; i < (size_t)ScreenEdgePosition::VALUE_COUNT; i++) { + if (edges[i].height == 0.0f) { + // Nothing on this side, ignore it entirely. + continue; } - // Scale down if height doesn't fit. - float scale = 1.0f; - if (th > bounds_.h - y) { - // Scale down! - scale = std::max(0.15f, (bounds_.h - y) / th); - dc.SetFontScale(scale, scale); - b.w *= scale; - b.h *= scale; + // First, compute the start position. + float y = padding; + int horizAdj = 0; + int vertAdj = 0; + switch ((ScreenEdgePosition)i) { + case ScreenEdgePosition::TOP_LEFT: horizAdj = -1; vertAdj = -1; break; + case ScreenEdgePosition::CENTER_LEFT: horizAdj = -1; break; + case ScreenEdgePosition::BOTTOM_LEFT: horizAdj = -1; vertAdj = 1; break; + case ScreenEdgePosition::TOP_RIGHT: horizAdj = 1; vertAdj = -1; break; + case ScreenEdgePosition::CENTER_RIGHT: horizAdj = 1; break; + case ScreenEdgePosition::BOTTOM_RIGHT: horizAdj = 1; vertAdj = 1; break; + case ScreenEdgePosition::TOP_CENTER: vertAdj = -1; break; + case ScreenEdgePosition::BOTTOM_CENTER: vertAdj = 1; break; + default: break; } - float alpha = Clamp((float)(entry.endTime - now) * 4.0f, 0.0f, 1.0f); - RenderOSDEntry(dc, entry, b, h1, align, alpha); - y += (b.h * scale + 4.0f) * alpha; // including alpha here gets us smooth animations. + if (vertAdj == 0) { + // Center vertically + y = (bounds_.h - edges[i].height) * 0.5f; + } else if (vertAdj == 1) { + y = (bounds_.h - edges[i].height); + } + + // Then, loop through the entries and those belonging here, get rendered here. + for (size_t j = 0; j < (size_t)entries.size(); j++) { + auto &entry = entries[j]; + if (typeEdges[(size_t)entry.type] != (ScreenEdgePosition)i) { // yes, i + continue; + } + auto &measuredEntry = measuredEntries[j]; + float alpha = measuredEntry.alpha * edges[i].alpha; + + Bounds b(padding, y, measuredEntry.w, measuredEntry.h); + + if (horizAdj == 0) { + // Centered + b.x = (bounds_.w - b.w) * 0.5f; + } else if (horizAdj == 1) { + // Right-aligned + b.x = bounds_.w - (b.w + padding); + } + + switch (entry.type) { + case OSDType::ACHIEVEMENT_PROGRESS: + case OSDType::ACHIEVEMENT_CHALLENGE_INDICATOR: + { + const rc_client_achievement_t *achievement = rc_client_get_achievement_info(Achievements::GetClient(), entry.numericID); + RenderAchievement(dc, achievement, measuredEntry.style, b, alpha, entry.startTime, now, false); + break; + } + case OSDType::LEADERBOARD_TRACKER: + RenderLeaderboardTracker(dc, b, entry.text, alpha); + break; + case OSDType::PROGRESS_BAR: + RenderOSDProgressBar(dc, entry, b, 0, alpha); + break; + default: + { + // Scale down if height doesn't fit. + float scale = 1.0f; + if (measuredEntry.h > bounds_.h - y) { + // Scale down! + scale = std::max(0.15f, (bounds_.h - y) / measuredEntry.h); + dc.SetFontScale(scale, scale); + b.w *= scale; + b.h *= scale; + } + + float alpha = Clamp((float)(entry.endTime - now) * 4.0f, 0.0f, 1.0f); + RenderOSDEntry(dc, entry, b, measuredEntry.h1, measuredEntry.align, alpha); + break; + } + } + + y += (measuredEntry.h + 4.0f) * measuredEntry.alpha; + } } } @@ -384,6 +457,18 @@ void OSDOverlayScreen::CreateViews() { root_->Add(new OnScreenMessagesView(new UI::AnchorLayoutParams(0.0f, 0.0f, 0.0f, 0.0f))); } +void OSDOverlayScreen::render() { + UIScreen::render(); + + DebugOverlay debugOverlay = (DebugOverlay)g_Config.iDebugOverlay; + + // Special case control for now, since it uses the control mapper that's owned by EmuScreen. + if (debugOverlay != DebugOverlay::OFF && debugOverlay != DebugOverlay::CONTROL) { + UIContext *uiContext = screenManager()->getUIContext(); + DrawDebugOverlay(uiContext, uiContext->GetLayoutBounds(), debugOverlay); + } +} + void NoticeView::GetContentDimensionsBySpec(const UIContext &dc, UI::MeasureSpec horiz, UI::MeasureSpec vert, float &w, float &h) const { Bounds bounds(0, 0, layoutParams_->width, layoutParams_->height); if (bounds.w < 0) { diff --git a/UI/OnScreenDisplay.h b/UI/OnScreenDisplay.h index 24c819da01..5cde5cf585 100644 --- a/UI/OnScreenDisplay.h +++ b/UI/OnScreenDisplay.h @@ -28,6 +28,7 @@ class OSDOverlayScreen : public UIScreen { public: const char *tag() const override { return "OSDOverlayScreen"; } void CreateViews() override; + void render() override; }; enum class NoticeLevel { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 9414463aa4..60a6e968e2 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -380,7 +380,7 @@ void GamePauseScreen::CreateViews() { }); } if (g_Config.bAchievementsEnable && Achievements::HasAchievementsOrLeaderboards()) { - rightColumnItems->Add(new Choice(pa->T("Achievements")))->OnClick.Add([&](UI::EventParams &e) { + rightColumnItems->Add(new Choice(ac->T("Achievements")))->OnClick.Add([&](UI::EventParams &e) { screenManager()->push(new RetroAchievementsListScreen(gamePath_)); return UI::EVENT_DONE; }); diff --git a/UI/RetroAchievementScreens.cpp b/UI/RetroAchievementScreens.cpp index 8bc67c8d44..20a5a776d1 100644 --- a/UI/RetroAchievementScreens.cpp +++ b/UI/RetroAchievementScreens.cpp @@ -77,6 +77,19 @@ void RetroAchievementsListScreen::CreateTabs() { #endif } +inline const char *AchievementBucketTitle(int bucketType) { + switch (bucketType) { + case RC_CLIENT_ACHIEVEMENT_BUCKET_LOCKED: return "Locked achievements"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_UNLOCKED: return "Unlocked achievements"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_UNSUPPORTED: return "Unsupported achievements"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_UNOFFICIAL: return "Unofficial achievements"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_RECENTLY_UNLOCKED: return "Recently unlocked achievements"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_ACTIVE_CHALLENGE: return "Achievements with active challenges"; + case RC_CLIENT_ACHIEVEMENT_BUCKET_ALMOST_THERE: return "Almost completed achievements"; + default: return "?"; + } +} + void RetroAchievementsListScreen::CreateAchievementsTab(UI::ViewGroup *achievements) { auto di = GetI18NCategory(I18NCat::DIALOG); auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS); @@ -88,58 +101,28 @@ void RetroAchievementsListScreen::CreateAchievementsTab(UI::ViewGroup *achieveme filter = RC_CLIENT_ACHIEVEMENT_CATEGORY_CORE_AND_UNOFFICIAL; } - rc_client_achievement_list_t *list = rc_client_create_achievement_list(Achievements::GetClient(), - filter, RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_LOCK_STATE); - - std::vector unlockedAchievements; - std::vector lockedAchievements; - std::vector otherAchievements; - - for (uint32_t i = 0; i < list->num_buckets; i++) { - const rc_client_achievement_bucket_t &bucket = list->buckets[i]; - for (uint32_t j = 0; j < bucket.num_achievements; j++) { - switch (bucket.bucket_type) { - case RC_CLIENT_ACHIEVEMENT_BUCKET_LOCKED: - lockedAchievements.push_back(bucket.achievements[j]); - break; - case RC_CLIENT_ACHIEVEMENT_BUCKET_UNLOCKED: - unlockedAchievements.push_back(bucket.achievements[j]); - break; - default: - otherAchievements.push_back(bucket.achievements[j]); - break; - } - } - } - achievements->Add(new ItemHeader(ac->T("Achievements"))); - achievements->Add(new GameAchievementSummaryView()); if (Achievements::EncoreModeActive()) { achievements->Add(new NoticeView(NoticeLevel::WARN, ac->T("In Encore mode - unlock state may not be accurate"), "")); } - CollapsibleSection *unlocked = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Unlocked achievements"), (int)unlockedAchievements.size())); - unlocked->SetSpacing(2.0f); - for (auto &achievement : unlockedAchievements) { - unlocked->Add(new AchievementView(achievement)); - } - achievements->Add(unlocked); + rc_client_achievement_list_t *list = rc_client_create_achievement_list(Achievements::GetClient(), + filter, RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS); - CollapsibleSection *locked = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Locked achievements"), (int)lockedAchievements.size())); - unlocked->SetSpacing(2.0f); - for (auto &achievement : lockedAchievements) { - locked->Add(new AchievementView(achievement)); + for (uint32_t i = 0; i < list->num_buckets; i++) { + const rc_client_achievement_bucket_t &bucket = list->buckets[i]; + if (!bucket.num_achievements) { + continue; + } + std::string title = StringFromFormat("%s (%d)", ac->T(AchievementBucketTitle(bucket.bucket_type)), bucket.num_achievements); + CollapsibleSection *section = achievements->Add(new CollapsibleSection(title)); + section->SetSpacing(2.0f); + for (uint32_t j = 0; j < bucket.num_achievements; j++) { + section->Add(new AchievementView(bucket.achievements[j])); + } } - achievements->Add(locked); - - CollapsibleSection *other = new CollapsibleSection(StringFromFormat("%s (%d)", ac->T("Other achievements"), (int)otherAchievements.size())); - unlocked->SetSpacing(2.0f); - for (auto &achievement : otherAchievements) { - other->Add(new AchievementView(achievement)); - } - achievements->Add(other); } void RetroAchievementsListScreen::CreateLeaderboardsTab(UI::ViewGroup *viewGroup) { @@ -192,7 +175,11 @@ RetroAchievementsLeaderboardScreen::~RetroAchievementsLeaderboardScreen() { RetroAchievementsLeaderboardScreen::RetroAchievementsLeaderboardScreen(const Path &gamePath, int leaderboardID) : TabbedUIDialogScreenWithGameBackground(gamePath), leaderboardID_(leaderboardID) { - rc_client_begin_fetch_leaderboard_entries(Achievements::GetClient(), leaderboardID_, 0, 20, [](int result, const char *error_message, rc_client_leaderboard_entry_list_t *list, rc_client_t *client, void *userdata) { + FetchEntries(); +} + +void RetroAchievementsLeaderboardScreen::FetchEntries() { + auto callback = [](int result, const char *error_message, rc_client_leaderboard_entry_list_t *list, rc_client_t *client, void *userdata) { if (result != RC_OK) { g_OSD.Show(OSDType::MESSAGE_ERROR, error_message, 10.0f); return; @@ -201,7 +188,13 @@ RetroAchievementsLeaderboardScreen::RetroAchievementsLeaderboardScreen(const Pat RetroAchievementsLeaderboardScreen *thiz = (RetroAchievementsLeaderboardScreen *)userdata; thiz->pendingEntryList_ = list; thiz->pendingAsyncCall_ = nullptr; - }, this); + }; + + if (nearMe_) { + rc_client_begin_fetch_leaderboard_entries_around_user(Achievements::GetClient(), leaderboardID_, 10, callback, this); + } else { + rc_client_begin_fetch_leaderboard_entries(Achievements::GetClient(), leaderboardID_, 0, 25, callback, this); + } } void RetroAchievementsLeaderboardScreen::CreateTabs() { @@ -213,6 +206,17 @@ void RetroAchievementsLeaderboardScreen::CreateTabs() { layout->Add(new TextView(leaderboard->description)); layout->Add(new ItemHeader(ac->T("Leaderboard"))); + auto strip = layout->Add(new ChoiceStrip(ORIENT_HORIZONTAL)); + strip->AddChoice(ac->T("Top players")); + strip->AddChoice(ac->T("Around me")); + strip->OnChoice.Add([=](UI::EventParams &e) { + strip->SetSelection(e.a, false); + nearMe_ = e.a != 0; + FetchEntries(); + return UI::EVENT_DONE; + }); + strip->SetSelection(nearMe_ ? 1 : 0, false); + if (entryList_) { for (uint32_t i = 0; i < entryList_->num_entries; i++) { bool is_self = (i == entryList_->user_index); @@ -275,7 +279,7 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup) using namespace UI; if (!g_Config.bAchievementsEnable) { - viewGroup->Add(new TextView(ac->T("Achievements are disabled"))); + viewGroup->Add(new NoticeView(NoticeLevel::INFO, ac->T("Achievements are disabled"), "", new LinearLayoutParams(Margins(5)))); } else if (Achievements::IsLoggedIn()) { const rc_client_user_t *info = rc_client_get_user_info(Achievements::GetClient()); @@ -283,7 +287,7 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup) if (strcmp(info->display_name, info->username) != 0) { viewGroup->Add(new InfoItem(ac->T("Name"), info->display_name)); } - viewGroup->Add(new InfoItem(ac->T("Username"), info->username)); + viewGroup->Add(new InfoItem(di->T("Username"), info->username)); // viewGroup->Add(new InfoItem(ac->T("Unread messages"), info.numUnreadMessages)); viewGroup->Add(new Choice(di->T("Log out")))->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn { Achievements::Logout(); @@ -304,8 +308,8 @@ void RetroAchievementsSettingsScreen::CreateAccountTab(UI::ViewGroup *viewGroup) return UI::EVENT_DONE; }); } else if (System_GetPropertyBool(SYSPROP_HAS_LOGIN_DIALOG)) { - viewGroup->Add(new Choice(ac->T("Log in")))->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn { - System_AskUsernamePassword(ac->T("Log in"), [](const std::string &value, int) { + viewGroup->Add(new Choice(di->T("Log in")))->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn { + System_AskUsernamePassword(di->T("Log in"), [](const std::string &value, int) { std::vector parts; SplitString(value, '\n', parts); if (parts.size() == 2 && !parts[0].empty() && !parts[1].empty()) { @@ -363,16 +367,27 @@ void RetroAchievementsSettingsScreen::CreateCustomizeTab(UI::ViewGroup *viewGrou auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS); using namespace UI; - viewGroup->Add(new ItemHeader(ac->T("Sound effects"))); + viewGroup->Add(new ItemHeader(ac->T("Sound Effects"))); viewGroup->Add(new AudioFileChooser(&g_Config.sAchievementsUnlockAudioFile, ac->T("Achievement unlocked"), UISound::ACHIEVEMENT_UNLOCKED)); viewGroup->Add(new AudioFileChooser(&g_Config.sAchievementsLeaderboardSubmitAudioFile, ac->T("Leaderboard score submission"), UISound::LEADERBOARD_SUBMITTED)); + + static const char *positions[] = { "None", "Bottom Left", "Bottom Center", "Bottom Right", "Top Left", "Top Center", "Top Right", "Center Left", "Center Right" }; + + viewGroup->Add(new ItemHeader(ac->T("Notifications"))); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsLeaderboardStartedOrFailedPos, ac->T("Leaderboard attempt started or failed"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsLeaderboardSubmittedPos, ac->T("Leaderboard result submitted"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsLeaderboardTrackerPos, ac->T("Leaderboard tracker"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsUnlockedPos, ac->T("Achievement unlocked"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsChallengePos, ac->T("Challenge indicator"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); + viewGroup->Add(new PopupMultiChoice(&g_Config.iAchievementsProgressPos, ac->T("Achievement progress"), positions, -1, ARRAY_SIZE(positions), I18NCat::DIALOG, screenManager()))->SetEnabledPtr(&g_Config.bAchievementsEnable); } void RetroAchievementsSettingsScreen::CreateDeveloperToolsTab(UI::ViewGroup *viewGroup) { auto ac = GetI18NCategory(I18NCat::ACHIEVEMENTS); + auto di = GetI18NCategory(I18NCat::DIALOG); using namespace UI; - viewGroup->Add(new ItemHeader(ac->T("Settings"))); + viewGroup->Add(new ItemHeader(di->T("Settings"))); viewGroup->Add(new CheckBox(&g_Config.bAchievementsUnofficial, ac->T("Unofficial achievements")))->SetEnabledPtr(&g_Config.bAchievementsEnable); viewGroup->Add(new CheckBox(&g_Config.bAchievementsLogBadMemReads, ac->T("Log bad memory accesses")))->SetEnabledPtr(&g_Config.bAchievementsEnable); } @@ -608,12 +623,15 @@ void RenderLeaderboardSummary(UIContext &dc, const rc_client_leaderboard_t *lead dc.RebindTexture(); } -void RenderLeaderboardEntry(UIContext &dc, const rc_client_leaderboard_entry_t *entry, const Bounds &bounds, float alpha, bool hasFocus) { +void RenderLeaderboardEntry(UIContext &dc, const rc_client_leaderboard_entry_t *entry, const Bounds &bounds, float alpha, bool hasFocus, bool isCurrentUser) { using namespace UI; UI::Drawable background = dc.theme->itemStyle.background; if (hasFocus) { background = dc.theme->itemFocusedStyle.background; } + if (isCurrentUser) { + background = dc.theme->itemDownStyle.background; + } background.color = alphaMul(background.color, alpha); uint32_t fgColor = alphaMul(dc.theme->itemStyle.fgColor, alpha); @@ -704,7 +722,7 @@ void LeaderboardSummaryView::GetContentDimensions(const UIContext &dc, float &w, } void LeaderboardEntryView::Draw(UIContext &dc) { - RenderLeaderboardEntry(dc, entry_, bounds_, 1.0f, HasFocus()); + RenderLeaderboardEntry(dc, entry_, bounds_, 1.0f, HasFocus(), isCurrentUser_); } void LeaderboardEntryView::GetContentDimensions(const UIContext &dc, float &w, float &h) const { diff --git a/UI/RetroAchievementScreens.h b/UI/RetroAchievementScreens.h index a38e13d38a..87bf205a45 100644 --- a/UI/RetroAchievementScreens.h +++ b/UI/RetroAchievementScreens.h @@ -64,9 +64,11 @@ protected: bool ShowSearchControls() const override { return false; } private: + void FetchEntries(); void Poll(); int leaderboardID_; + bool nearMe_ = false; // Keep the fetched list alive and destroy in destructor. rc_client_leaderboard_entry_list_t *entryList_ = nullptr; diff --git a/UI/Theme.cpp b/UI/Theme.cpp index 3e4b6193a2..c59a591275 100644 --- a/UI/Theme.cpp +++ b/UI/Theme.cpp @@ -113,7 +113,7 @@ static void LoadThemeInfo(const std::vector &directories) { // Alright, let's loop through the sections and see if any is a theme. for (size_t i = 0; i < ini.Sections().size(); i++) { - Section §ion = ini.Sections()[i]; + Section §ion = *(ini.Sections()[i].get()); ThemeInfo info; section.Get("Name", &info.name, section.name().c_str()); diff --git a/UI/UI.vcxproj b/UI/UI.vcxproj index 68cf5bac73..bc54fd4ced 100644 --- a/UI/UI.vcxproj +++ b/UI/UI.vcxproj @@ -40,6 +40,7 @@ + @@ -76,6 +77,7 @@ + diff --git a/UI/UI.vcxproj.filters b/UI/UI.vcxproj.filters index 4ce9a0676a..5c1d68dab9 100644 --- a/UI/UI.vcxproj.filters +++ b/UI/UI.vcxproj.filters @@ -89,6 +89,9 @@ Screens + + Screens + @@ -178,6 +181,9 @@ Screens + + Screens + diff --git a/UWP/App.cpp b/UWP/App.cpp index 3fd917e254..639650eae7 100644 --- a/UWP/App.cpp +++ b/UWP/App.cpp @@ -201,9 +201,8 @@ void App::Run() { while (!m_windowClosed) { if (m_windowVisible) { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent); - if (m_main->Render()) { - m_deviceResources->Present(); - } + m_main->Render(); + // TODO: Adopt some practices from m_deviceResources->Present(); } else { CoreWindow::GetForCurrentThread()->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending); } diff --git a/UWP/CoreUWP/CoreUWP.vcxproj b/UWP/CoreUWP/CoreUWP.vcxproj index 5af1ee85d0..8c83c0410e 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj +++ b/UWP/CoreUWP/CoreUWP.vcxproj @@ -196,6 +196,7 @@ + @@ -302,6 +303,7 @@ + @@ -438,6 +440,7 @@ + @@ -562,6 +565,7 @@ + diff --git a/UWP/CoreUWP/CoreUWP.vcxproj.filters b/UWP/CoreUWP/CoreUWP.vcxproj.filters index 363504bba7..3d49ff54fc 100644 --- a/UWP/CoreUWP/CoreUWP.vcxproj.filters +++ b/UWP/CoreUWP/CoreUWP.vcxproj.filters @@ -645,6 +645,9 @@ MIPS\IR + + MIPS\IR + MIPS\IR @@ -1134,6 +1137,7 @@ + @@ -1670,6 +1674,9 @@ MIPS\IR + + MIPS\IR + MIPS\IR @@ -1794,6 +1801,7 @@ + diff --git a/UWP/PPSSPP_UWPMain.cpp b/UWP/PPSSPP_UWPMain.cpp index 01c6bec6bd..858b1edbf5 100644 --- a/UWP/PPSSPP_UWPMain.cpp +++ b/UWP/PPSSPP_UWPMain.cpp @@ -191,12 +191,6 @@ void PPSSPP_UWPMain::BootToLaunchFile() { // Renders the current frame according to the current application state. // Returns true if the frame was rendered and is ready to be displayed. bool PPSSPP_UWPMain::Render() { - ctx_->GetDrawContext()->HandleEvent(Draw::Event::PRESENTED, 0, 0, nullptr, nullptr); - NativeUpdate(); - - // This is not perfect but it will do the job - BootToLaunchFile(); - static bool hasSetThreadName = false; if (!hasSetThreadName) { SetCurrentThreadName("UWPRenderThread"); @@ -242,7 +236,7 @@ bool PPSSPP_UWPMain::Render() { context->RSSetViewports(1, &viewport); - NativeRender(ctx_.get()); + NativeFrame(ctx_.get()); return true; } @@ -347,7 +341,7 @@ UWPGraphicsContext::UWPGraphicsContext(std::shared_ptr reso std::vector adapterNames; draw_ = Draw::T3DCreateD3D11Context( - resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetDeviceFeatureLevel(), 0, adapterNames); + resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetSwapChain(), resources->GetDeviceFeatureLevel(), 0, adapterNames, g_Config.iInflightFrames); bool success = draw_->CreatePresets(); _assert_(success); } @@ -356,10 +350,6 @@ void UWPGraphicsContext::Shutdown() { delete draw_; } -void UWPGraphicsContext::SwapInterval(int interval) { - -} - std::string System_GetProperty(SystemProperty prop) { static bool hasCheckedGPUDriverVersion = false; switch (prop) { diff --git a/UWP/PPSSPP_UWPMain.h b/UWP/PPSSPP_UWPMain.h index 939de3fed4..f144d0cb51 100644 --- a/UWP/PPSSPP_UWPMain.h +++ b/UWP/PPSSPP_UWPMain.h @@ -19,8 +19,7 @@ public: UWPGraphicsContext(std::shared_ptr resources); void Shutdown() override; - void SwapInterval(int interval) override; - void SwapBuffers() override {} + void SwapInterval(int interval) override {} void Resize() override {} Draw::DrawContext * GetDrawContext() override { return draw_; diff --git a/UWP/UI_UWP/UI_UWP.vcxproj b/UWP/UI_UWP/UI_UWP.vcxproj index ceb1d347cf..5694417bb5 100644 --- a/UWP/UI_UWP/UI_UWP.vcxproj +++ b/UWP/UI_UWP/UI_UWP.vcxproj @@ -123,6 +123,7 @@ + @@ -160,6 +161,7 @@ + diff --git a/UWP/UI_UWP/UI_UWP.vcxproj.filters b/UWP/UI_UWP/UI_UWP.vcxproj.filters index 179a0bf35a..aa3b1b3b6b 100644 --- a/UWP/UI_UWP/UI_UWP.vcxproj.filters +++ b/UWP/UI_UWP/UI_UWP.vcxproj.filters @@ -36,6 +36,7 @@ + @@ -73,5 +74,6 @@ + \ No newline at end of file diff --git a/UWP/UWP.vcxproj b/UWP/UWP.vcxproj index 55789fece1..2edb5f9f5d 100644 --- a/UWP/UWP.vcxproj +++ b/UWP/UWP.vcxproj @@ -859,7 +859,7 @@ true - + true @@ -980,4 +980,4 @@ - \ No newline at end of file + diff --git a/UWP/UWP.vcxproj.filters b/UWP/UWP.vcxproj.filters index e4f984a3cb..de4e5d9ed0 100644 --- a/UWP/UWP.vcxproj.filters +++ b/UWP/UWP.vcxproj.filters @@ -363,7 +363,7 @@ Content\shaders - + Content\shaders @@ -613,4 +613,4 @@ Content - \ No newline at end of file + diff --git a/Windows/GPU/D3D11Context.cpp b/Windows/GPU/D3D11Context.cpp index 7319f989f9..4173f9a6ac 100644 --- a/Windows/GPU/D3D11Context.cpp +++ b/Windows/GPU/D3D11Context.cpp @@ -33,17 +33,6 @@ #error This file should not be compiled for UWP. #endif -D3D11Context::D3D11Context() : draw_(nullptr), adapterId(-1), hDC(nullptr), hWnd_(nullptr), hD3D11(nullptr) { -} - -D3D11Context::~D3D11Context() { -} - -void D3D11Context::SwapBuffers() { - swapChain_->Present(swapInterval_, 0); - draw_->HandleEvent(Draw::Event::PRESENTED, 0, 0, nullptr, nullptr); -} - void D3D11Context::SwapInterval(int interval) { swapInterval_ = interval; } @@ -81,13 +70,6 @@ HRESULT D3D11Context::CreateTheDevice(IDXGIAdapter *adapter) { return hr; } -static void GetRes(HWND hWnd, int &xres, int &yres) { - RECT rc; - GetClientRect(hWnd, &rc); - xres = rc.right - rc.left; - yres = rc.bottom - rc.top; -} - bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { hWnd_ = wnd; LoadD3D11Error result = LoadD3D11(); @@ -171,19 +153,15 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { } #endif - draw_ = Draw::T3DCreateD3D11Context(device_, context_, device1_, context1_, featureLevel_, hWnd_, adapterNames); - SetGPUBackend(GPUBackend::DIRECT3D11, chosenAdapterName); - bool success = draw_->CreatePresets(); // If we can run D3D11, there's a compiler installed. I think. - _assert_msg_(success, "Failed to compile preset shaders"); int width; int height; - GetRes(hWnd_, width, height); + W32Util::GetWindowRes(hWnd_, &width, &height); // Obtain DXGI factory from device (since we used nullptr for pAdapter above) - IDXGIFactory1* dxgiFactory = nullptr; - IDXGIDevice* dxgiDevice = nullptr; - IDXGIAdapter* adapter = nullptr; + IDXGIFactory1 *dxgiFactory = nullptr; + IDXGIDevice *dxgiDevice = nullptr; + IDXGIAdapter *adapter = nullptr; hr = device_->QueryInterface(__uuidof(IDXGIDevice), reinterpret_cast(&dxgiDevice)); if (SUCCEEDED(hr)) { hr = dxgiDevice->GetAdapter(&adapter); @@ -215,6 +193,11 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { dxgiFactory->MakeWindowAssociation(hWnd_, DXGI_MWA_NO_ALT_ENTER); dxgiFactory->Release(); + draw_ = Draw::T3DCreateD3D11Context(device_, context_, device1_, context1_, swapChain_, featureLevel_, hWnd_, adapterNames, g_Config.iInflightFrames); + SetGPUBackend(GPUBackend::DIRECT3D11, chosenAdapterName); + bool success = draw_->CreatePresets(); // If we can run D3D11, there's a compiler installed. I think. + _assert_msg_(success, "Failed to compile preset shaders"); + GotBackbuffer(); return true; } @@ -249,7 +232,7 @@ void D3D11Context::Resize() { LostBackbuffer(); int width; int height; - GetRes(hWnd_, width, height); + W32Util::GetWindowRes(hWnd_, &width, &height); swapChain_->ResizeBuffers(0, width, height, DXGI_FORMAT_UNKNOWN, 0); GotBackbuffer(); } diff --git a/Windows/GPU/D3D11Context.h b/Windows/GPU/D3D11Context.h index 07d551b7de..3d40355899 100644 --- a/Windows/GPU/D3D11Context.h +++ b/Windows/GPU/D3D11Context.h @@ -28,12 +28,9 @@ class DrawContext; class D3D11Context : public WindowsGraphicsContext { public: - D3D11Context(); - ~D3D11Context(); bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override; void Resize() override; @@ -59,13 +56,12 @@ private: ID3D11Debug *d3dDebug_ = nullptr; ID3D11InfoQueue *d3dInfoQueue_ = nullptr; #endif - D3D_FEATURE_LEVEL featureLevel_ = D3D_FEATURE_LEVEL_11_0; - int adapterId; - HDC hDC; // Private GDI Device Context - HWND hWnd_; // Holds Our Window Handle - HMODULE hD3D11; - int width; - int height; + int adapterId = -1; + HDC hDC = nullptr; // Private GDI Device Context + HWND hWnd_ = nullptr; // Holds Our Window Handle + HMODULE hD3D11 = nullptr; + int width = 0; + int height = 0; int swapInterval_ = 0; }; diff --git a/Windows/GPU/D3D9Context.cpp b/Windows/GPU/D3D9Context.cpp index 7ffe7f79f0..776ed26fc0 100644 --- a/Windows/GPU/D3D9Context.cpp +++ b/Windows/GPU/D3D9Context.cpp @@ -21,27 +21,8 @@ #include "Common/GPU/thin3d_create.h" #include "Common/GPU/D3D9/D3DCompilerLoader.h" -void D3D9Context::SwapBuffers() { - if (has9Ex_) { - deviceEx_->EndScene(); - deviceEx_->PresentEx(NULL, NULL, NULL, NULL, 0); - deviceEx_->BeginScene(); - } else { - device_->EndScene(); - device_->Present(NULL, NULL, NULL, NULL); - device_->BeginScene(); - } -} - typedef HRESULT (__stdcall *DIRECT3DCREATE9EX)(UINT, IDirect3D9Ex**); -static void GetRes(HWND hWnd, int &xres, int &yres) { - RECT rc; - GetClientRect(hWnd, &rc); - xres = rc.right - rc.left; - yres = rc.bottom - rc.top; -} - void D3D9Context::SwapInterval(int interval) { swapInterval_ = interval; } @@ -126,7 +107,7 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { dwBehaviorFlags |= D3DCREATE_SOFTWARE_VERTEXPROCESSING; int xres, yres; - GetRes(hWnd_, xres, yres); + W32Util::GetWindowRes(hWnd_, &xres, &yres); presentParams_ = {}; presentParams_.BackBufferWidth = xres; @@ -183,8 +164,8 @@ bool D3D9Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) { void D3D9Context::Resize() { // This should only be called from the emu thread. int xres, yres; - GetRes(hWnd_, xres, yres); - uint32_t newInterval = swapInterval_ == 1 ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE;; + W32Util::GetWindowRes(hWnd_, &xres, &yres); + uint32_t newInterval = swapInterval_ == 1 ? D3DPRESENT_INTERVAL_ONE : D3DPRESENT_INTERVAL_IMMEDIATE; bool w_changed = presentParams_.BackBufferWidth != xres; bool h_changed = presentParams_.BackBufferHeight != yres; bool i_changed = presentParams_.PresentationInterval != newInterval; diff --git a/Windows/GPU/D3D9Context.h b/Windows/GPU/D3D9Context.h index 9ad836d338..8f1806bf44 100644 --- a/Windows/GPU/D3D9Context.h +++ b/Windows/GPU/D3D9Context.h @@ -35,7 +35,6 @@ public: bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override; void Resize() override; diff --git a/Windows/GPU/WindowsGLContext.cpp b/Windows/GPU/WindowsGLContext.cpp index 42e65df116..a4aa0e511a 100644 --- a/Windows/GPU/WindowsGLContext.cpp +++ b/Windows/GPU/WindowsGLContext.cpp @@ -39,7 +39,7 @@ // Currently, just compile time for debugging. May be NVIDIA only. static const int simulateGLES = false; -void WindowsGLContext::SwapBuffers() { +void WindowsGLContext::Poll() { // We no longer call RenderManager::Swap here, it's handled by the render thread, which // we're not on here. @@ -432,7 +432,7 @@ bool WindowsGLContext::InitFromRenderThread(std::string *error_message) { renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); renderManager_->SetInflightFrames(g_Config.iInflightFrames); SetGPUBackend(GPUBackend::OPENGL); - renderManager_->SetSwapFunction([&]() {::SwapBuffers(hDC); }, true); + renderManager_->SetSwapFunction([&]() {::SwapBuffers(hDC); }); if (wglSwapIntervalEXT) { // glew loads wglSwapIntervalEXT if available renderManager_->SetSwapIntervalFunction([&](int interval) { diff --git a/Windows/GPU/WindowsGLContext.h b/Windows/GPU/WindowsGLContext.h index 2909be60f1..eac76176c3 100644 --- a/Windows/GPU/WindowsGLContext.h +++ b/Windows/GPU/WindowsGLContext.h @@ -18,7 +18,8 @@ public: void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override; + + void Poll() override; // Used during window resize. Must be called from the window thread, // not the rendering thread or CPU thread. diff --git a/Windows/GPU/WindowsGraphicsContext.h b/Windows/GPU/WindowsGraphicsContext.h index db022e9b5d..41efb96a2f 100644 --- a/Windows/GPU/WindowsGraphicsContext.h +++ b/Windows/GPU/WindowsGraphicsContext.h @@ -7,4 +7,3 @@ class WindowsGraphicsContext : public GraphicsContext { public: virtual bool Init(HINSTANCE hInst, HWND window, std::string *error_message) = 0; }; - diff --git a/Windows/GPU/WindowsVulkanContext.cpp b/Windows/GPU/WindowsVulkanContext.cpp index e4c31ab8e9..71347e8e55 100644 --- a/Windows/GPU/WindowsVulkanContext.cpp +++ b/Windows/GPU/WindowsVulkanContext.cpp @@ -131,7 +131,12 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m return false; } - draw_ = Draw::T3DCreateVulkanContext(vulkan_, g_Config.bRenderMultiThreading); + bool useMultiThreading = g_Config.bRenderMultiThreading; + if (g_Config.iInflightFrames == 1) { + useMultiThreading = false; + } + + draw_ = Draw::T3DCreateVulkanContext(vulkan_, useMultiThreading); SetGPUBackend(GPUBackend::VULKAN, vulkan_->GetPhysicalDeviceProperties(deviceNum).properties.deviceName); bool success = draw_->CreatePresets(); _assert_msg_(success, "Failed to compile preset shaders"); diff --git a/Windows/GPU/WindowsVulkanContext.h b/Windows/GPU/WindowsVulkanContext.h index 49e6613e3e..c331ec1dbb 100644 --- a/Windows/GPU/WindowsVulkanContext.h +++ b/Windows/GPU/WindowsVulkanContext.h @@ -30,7 +30,6 @@ public: bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override; void Shutdown() override; void SwapInterval(int interval) override {} - void SwapBuffers() override {} void Resize() override; void Poll() override; diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index 78a7cc07e0..d0dbbf1ce2 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -285,11 +285,8 @@ namespace MainWindow System_PostUIMessage("window minimized", "false"); } - int width = 0, height = 0; - RECT rc; - GetClientRect(hwndMain, &rc); - width = rc.right - rc.left; - height = rc.bottom - rc.top; + int width, height; + W32Util::GetWindowRes(hwndMain, &width, &height); // Moves the internal display window to match the inner size of the main window. MoveWindow(hwndDisplay, 0, 0, width, height, TRUE); diff --git a/Windows/MainWindowMenu.cpp b/Windows/MainWindowMenu.cpp index 2e7101f76f..551e3495de 100644 --- a/Windows/MainWindowMenu.cpp +++ b/Windows/MainWindowMenu.cpp @@ -709,7 +709,13 @@ namespace MainWindow { break; case ID_DEBUG_SHOWDEBUGSTATISTICS: - g_Config.bShowDebugStats = !g_Config.bShowDebugStats; + // This is still useful as a shortcut to tell users to use. + // So let's fake the enum. + if ((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS) { + g_Config.iDebugOverlay = (int)DebugOverlay::OFF; + } else { + g_Config.iDebugOverlay = (int)DebugOverlay::DEBUG_STATS; + } System_PostUIMessage("clear jit", ""); break; @@ -958,7 +964,7 @@ namespace MainWindow { HMENU menu = GetMenu(GetHWND()); #define CHECKITEM(item,value) CheckMenuItem(menu,item,MF_BYCOMMAND | ((value) ? MF_CHECKED : MF_UNCHECKED)); CHECKITEM(ID_DEBUG_IGNOREILLEGALREADS, g_Config.bIgnoreBadMemAccess); - CHECKITEM(ID_DEBUG_SHOWDEBUGSTATISTICS, g_Config.bShowDebugStats); + CHECKITEM(ID_DEBUG_SHOWDEBUGSTATISTICS, (DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS); CHECKITEM(ID_OPTIONS_HARDWARETRANSFORM, g_Config.bHardwareTransform); CHECKITEM(ID_DEBUG_BREAKONLOAD, !g_Config.bAutoRun); CHECKITEM(ID_OPTIONS_VERTEXCACHE, g_Config.bVertexCache); diff --git a/Windows/W32Util/Misc.cpp b/Windows/W32Util/Misc.cpp index 97f4e475e5..f7f015c122 100644 --- a/Windows/W32Util/Misc.cpp +++ b/Windows/W32Util/Misc.cpp @@ -87,6 +87,13 @@ namespace W32Util SetWindowPos(hwnd, style, 0,0,0,0, SWP_NOMOVE | SWP_NOSIZE); } + void GetWindowRes(HWND hWnd, int *xres, int *yres) { + RECT rc; + GetClientRect(hWnd, &rc); + *xres = rc.right - rc.left; + *yres = rc.bottom - rc.top; + } + static const wchar_t *RemoveExecutableFromCommandLine(const wchar_t *cmdline) { if (!cmdline) { return L""; diff --git a/Windows/W32Util/Misc.h b/Windows/W32Util/Misc.h index ddfaa0a893..8fd41b0989 100644 --- a/Windows/W32Util/Misc.h +++ b/Windows/W32Util/Misc.h @@ -15,6 +15,8 @@ namespace W32Util void SpawnNewInstance(bool overrideArgs = false, const std::string &args = ""); void GetSelfExecuteParams(std::wstring &workingDirectory, std::wstring &moduleFilename); + void GetWindowRes(HWND hWnd, int *xres, int *yres); + struct ClipboardData { ClipboardData(const char *format, size_t sz); ClipboardData(UINT format, size_t sz); diff --git a/Windows/main.cpp b/Windows/main.cpp index 6cbd2e6243..658ec85b86 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -43,6 +43,7 @@ #include "Common/Thread/ThreadUtil.h" #include "Common/Data/Encoding/Utf8.h" #include "Common/Net/Resolve.h" +#include "Common/TimeUtil.h" #include "W32Util/DarkMode.h" #include "W32Util/ShellUtil.h" @@ -115,6 +116,12 @@ WindowsInputManager g_inputManager; int g_lastNumInstances = 0; +static double g_lastActivity = 0.0; +static double g_lastKeepAwake = 0.0; +// Time until we stop considering the core active without user input. +// Should this be configurable? 2 hours currently. +static const double ACTIVITY_IDLE_TIMEOUT = 2.0 * 3600.0; + void System_ShowFileInFolder(const char *path) { // SHParseDisplayName can't handle relative paths, so normalize first. std::string resolved = ReplaceAll(File::ResolvePath(path), "/", "\\"); @@ -444,6 +451,29 @@ void System_Notify(SystemNotification notification) { case SystemNotification::TOGGLE_DEBUG_CONSOLE: MainWindow::ToggleDebugConsoleVisibility(); break; + + case SystemNotification::ACTIVITY: + g_lastActivity = time_now_d(); + break; + + case SystemNotification::KEEP_SCREEN_AWAKE: + { + // Keep the system awake for longer than normal for cutscenes and the like. + const double now = time_now_d(); + if (now < g_lastActivity + ACTIVITY_IDLE_TIMEOUT) { + // Only resetting it ever prime number seconds in case the call is expensive. + // Using a prime number to ensure there's no interaction with other periodic events. + if (now - g_lastKeepAwake > 89.0 || now < g_lastKeepAwake) { + // Note that this needs to be called periodically. + // It's also possible to set ES_CONTINUOUS but let's not, for simplicity. +#if defined(_WIN32) && !PPSSPP_PLATFORM(UWP) + SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); +#endif + g_lastKeepAwake = now; + } + } + break; + } } } diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 494a4d6316..ef5383e3ba 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -50,11 +50,6 @@ NATIVE_FILES :=\ $(SRC)/Common/GPU/OpenGL/GLQueueRunner.cpp \ $(SRC)/Common/GPU/OpenGL/DataFormatGL.cpp -EGL_FILES := \ - $(SRC)/Common/GL/GLInterface/EGL.cpp \ - $(SRC)/Common/GL/GLInterface/EGLAndroid.cpp \ - $(SRC)/Common/GL/GLInterface/GLInterface.cpp - VULKAN_FILES := \ $(SRC)/Common/GPU/Vulkan/thin3d_vulkan.cpp \ $(SRC)/Common/GPU/Vulkan/VulkanQueueRunner.cpp \ @@ -175,7 +170,6 @@ EXT_FILES := \ EXEC_AND_LIB_FILES := \ $(ARCH_FILES) \ - $(EGL_FILES) \ $(VULKAN_FILES) \ $(VR_FILES) \ $(VMA_FILES) \ @@ -400,6 +394,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/MIPS/IR/IRCompVFPU.cpp \ $(SRC)/Core/MIPS/IR/IRInst.cpp \ $(SRC)/Core/MIPS/IR/IRInterpreter.cpp \ + $(SRC)/Core/MIPS/IR/IRNativeCommon.cpp \ $(SRC)/Core/MIPS/IR/IRPassSimplify.cpp \ $(SRC)/Core/MIPS/IR/IRRegCache.cpp \ $(SRC)/GPU/Math3D.cpp \ @@ -484,6 +479,7 @@ EXEC_AND_LIB_FILES := \ $(SRC)/Core/ConfigSettings.cpp \ $(SRC)/Core/CoreTiming.cpp \ $(SRC)/Core/CwCheat.cpp \ + $(SRC)/Core/FrameTiming.cpp \ $(SRC)/Core/HDRemaster.cpp \ $(SRC)/Core/Instance.cpp \ $(SRC)/Core/KeyMap.cpp \ @@ -763,6 +759,7 @@ LOCAL_SRC_FILES := \ $(SRC)/UI/BackgroundAudio.cpp \ $(SRC)/UI/DiscordIntegration.cpp \ $(SRC)/UI/ChatScreen.cpp \ + $(SRC)/UI/DebugOverlay.cpp \ $(SRC)/UI/DevScreens.cpp \ $(SRC)/UI/DisplayLayoutScreen.cpp \ $(SRC)/UI/EmuScreen.cpp \ diff --git a/android/jni/AndroidJavaGLContext.h b/android/jni/AndroidJavaGLContext.h index 4b4ff95d14..d02ffcfac1 100644 --- a/android/jni/AndroidJavaGLContext.h +++ b/android/jni/AndroidJavaGLContext.h @@ -15,7 +15,6 @@ public: void ShutdownFromRenderThread() override; void Shutdown() override {} - void SwapBuffers() override {} void SwapInterval(int interval) override {} void Resize() override {} diff --git a/android/jni/AndroidVulkanContext.cpp b/android/jni/AndroidVulkanContext.cpp index 18ef569a12..467880aab6 100644 --- a/android/jni/AndroidVulkanContext.cpp +++ b/android/jni/AndroidVulkanContext.cpp @@ -113,7 +113,11 @@ bool AndroidVulkanContext::InitFromRenderThread(ANativeWindow *wnd, int desiredB bool success = true; if (g_Vulkan->InitSwapchain()) { - draw_ = Draw::T3DCreateVulkanContext(g_Vulkan, g_Config.bRenderMultiThreading); + bool useMultiThreading = g_Config.bRenderMultiThreading; + if (g_Config.iInflightFrames == 1) { + useMultiThreading = false; + } + draw_ = Draw::T3DCreateVulkanContext(g_Vulkan, useMultiThreading); SetGPUBackend(GPUBackend::VULKAN); success = draw_->CreatePresets(); // Doesn't fail, we ship the compiler. _assert_msg_(success, "Failed to compile preset shaders"); @@ -157,9 +161,6 @@ void AndroidVulkanContext::Shutdown() { INFO_LOG(G3D, "AndroidVulkanContext::Shutdown completed"); } -void AndroidVulkanContext::SwapBuffers() { -} - void AndroidVulkanContext::Resize() { INFO_LOG(G3D, "AndroidVulkanContext::Resize begin (oldsize: %dx%d)", g_Vulkan->GetBackbufferWidth(), g_Vulkan->GetBackbufferHeight()); diff --git a/android/jni/AndroidVulkanContext.h b/android/jni/AndroidVulkanContext.h index 31d88c1a20..69d302bdea 100644 --- a/android/jni/AndroidVulkanContext.h +++ b/android/jni/AndroidVulkanContext.h @@ -16,7 +16,6 @@ public: void Shutdown() override; void SwapInterval(int interval) override; - void SwapBuffers() override; void Resize() override; void *GetAPIContext() override { return g_Vulkan; } diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 61c737396c..1cd0adc908 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -311,7 +311,7 @@ static void EmuThreadFunc() { // Wait for render loop to get started. INFO_LOG(SYSTEM, "Runloop: Waiting for displayInit..."); while (!graphicsContext || graphicsContext->GetState() == GraphicsContextState::PENDING) { - sleep_ms(20); + sleep_ms(5); } // Check the state of the graphics context before we try to feed it into NativeInitGraphics. @@ -1121,8 +1121,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeApp_sendRequestResult(JNIEn void LockedNativeUpdateRender() { std::lock_guard renderGuard(renderLock); - NativeUpdate(); - NativeRender(graphicsContext); + NativeFrame(graphicsContext); } void UpdateRunLoopAndroid(JNIEnv *env) { @@ -1312,7 +1311,7 @@ extern "C" void JNICALL Java_org_ppsspp_ppsspp_NativeActivity_requestExitVulkanR } exitRenderLoop = true; while (renderLoopRunning) { - sleep_ms(10); + sleep_ms(5); } } @@ -1518,8 +1517,6 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runVulkanRenderLoo while (!exitRenderLoop) { LockedNativeUpdateRender(); - graphicsContext->SwapBuffers(); - ProcessFrameCommands(env); } diff --git a/android/src/org/ppsspp/ppsspp/TextRenderer.java b/android/src/org/ppsspp/ppsspp/TextRenderer.java index d33016442c..60b18912c5 100644 --- a/android/src/org/ppsspp/ppsspp/TextRenderer.java +++ b/android/src/org/ppsspp/ppsspp/TextRenderer.java @@ -14,7 +14,7 @@ public class TextRenderer { p = new Paint(Paint.SUBPIXEL_TEXT_FLAG | Paint.ANTI_ALIAS_FLAG); p.setColor(Color.WHITE); bg = new Paint(); - bg.setColor(Color.BLACK); + bg.setColor(0); } public static void init(Context ctx) { diff --git a/assets/lang/ar_AE.ini b/assets/lang/ar_AE.ini index c82e09f2c8..6342faa42c 100644 --- a/assets/lang/ar_AE.ini +++ b/assets/lang/ar_AE.ini @@ -7,29 +7,38 @@ # perl -CSAD -p -i -e 's/(.* = )(?!\x{200e})(.*\p{Arabic}.*)/\1\x{200e}\2/g' ar_AE.ini [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -43,6 +52,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -293,6 +303,7 @@ Log Dropped Frame Statistics = ‎سجل التفاصيل للفريمات ال Log Level = ‎مستوي السجل Log View = ‎أظهر السجل Logging Channels = ‎قنوات التسجيل +Multi-threaded rendering = Multi-threaded rendering Next = ‎التالي No block = ‎لا بوك Prev = ‎السابق @@ -312,8 +323,8 @@ Stats = ‎الحالات System Information = ‎معلومات النظام Texture ini file created = Texture ini file created Texture Replacement = ‎إستبدال الرسوم -Toggle Audio Debug = ‎تفعيل تصحيح الصوت -Toggle Control Debug = Toggle Control Debug +Audio Debug = ‎تفعيل تصحيح الصوت +Control Debug = Control Debug Toggle Freeze = ‎تفعيل الإيقاف Touchscreen Test = Touchscreen test VFPU = VFPU @@ -742,6 +753,7 @@ None = None Note = Note OpenChat = Open chat Pause = ‎توقف مؤقت +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -910,6 +922,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = ‎كرتوني CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -917,6 +930,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = ‎CRT خطوط الفحص +FakeReflections = FakeReflections FXAA = ‎FXAA منعم الحواف Gamma = Gamma GreenLevel = Green level @@ -937,6 +951,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1140,6 +1155,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1247,6 +1263,7 @@ Record Audio = ‎تسجيل الصوت Record Display = ‎سجل الفيديو Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = ‎إلي الإفتراضي PPSSPP's إعادة إعدادات +RetroAchievements = RetroAchievements Rewind Snapshot Interval = ‎ترجيع تردد اللقطة (يأكل الذاكرة) Save path in installed.txt = ‎installed.txt مسار الحفظ في Save path in My Documents = ‎مسار الحفظ في مستنداتي @@ -1317,6 +1334,7 @@ New version of PPSSPP available = ‎تتوفر نسخة جديدة من الب 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/az_AZ.ini b/assets/lang/az_AZ.ini index 37ac303f61..4c084a73cb 100644 --- a/assets/lang/az_AZ.ini +++ b/assets/lang/az_AZ.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = System information Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/bg_BG.ini b/assets/lang/bg_BG.ini index 5ad190a2ab..c8c62ff830 100644 --- a/assets/lang/bg_BG.ini +++ b/assets/lang/bg_BG.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = Системна информация Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Пауза +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Анимация CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Възстанови първоначалните настройки на PPSSPP +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind snapshot честота („яде“ памет) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Налична е нова версия на P 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/ca_ES.ini b/assets/lang/ca_ES.ini index f95e5bbbae..b53fe4557f 100644 --- a/assets/lang/ca_ES.ini +++ b/assets/lang/ca_ES.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Registra estadístiques de caigudes de quadres Log Level = Nivell del registre Log View = Veure el registre Logging Channels = Canals del registre +Multi-threaded rendering = Multi-threaded rendering Next = Següent No block = No bloquis Prev = Anterior @@ -304,8 +315,8 @@ Stats = Estadístiques System Information = Informació del sistema Texture ini file created = Texture ini file created Texture Replacement = Reemplaçament de textures -Toggle Audio Debug = Commuta la depuració d'àudio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Depuració d'àudio +Control Debug = Control Debug Toggle Freeze = Commuta la imatge Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Nova versió de PPSSPP disponible 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/cz_CZ.ini b/assets/lang/cz_CZ.ini index 64f72f9cdf..0d63680c66 100644 --- a/assets/lang/cz_CZ.ini +++ b/assets/lang/cz_CZ.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Úroveň záznamu Log View = Zobrazení záznamu Logging Channels = Kanály záznamu +Multi-threaded rendering = Multi-threaded rendering Next = Další No block = Žádný blok Prev = Předchozí @@ -304,8 +315,8 @@ Stats = Statistiky System Information = Informace o systému Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Přepnout ladění zvuku -Toggle Control Debug = Toggle Control Debug +Audio Debug = Přepnout ladění zvuku +Control Debug = Control Debug Toggle Freeze = Přepnout zamrznutí Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pauza +Previous Slot = Previous Slot R = R RapidFire = Rychlá palba Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Animák CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = Skenovací řádky CRT +FakeReflections = FakeReflections FXAA = Vyhlazování hran FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Zvyšovač rozlišení Spline36 VideoSmoothingAA = VideoSmoothingAA Vignette = Viněta @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Obnovit výchozí nastavení PPSSPP +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Četnost snímků přetočení (žrout paměti) Save path in installed.txt = Cesta pro uložení dat je installed.txt Save path in My Documents = Cesta pro uložení dat je v Dokumentech @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Je dostupná nová verze PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/da_DK.ini b/assets/lang/da_DK.ini index 33587c9968..bf62f2c68c 100644 --- a/assets/lang/da_DK.ini +++ b/assets/lang/da_DK.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log Droppede Frames Statistik Log Level = Logniveau Log View = Log visning Logging Channels = Logkanaler +Multi-threaded rendering = Multi-threaded rendering Next = Næste No block = Ingen blokering Prev = Forrige @@ -304,8 +315,8 @@ Stats = Stats System Information = System information Texture ini file created = Texture ini file created Texture Replacement = Texture Erstatning -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Skift freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Hurtigskydning Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Tegnefilm CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlinier +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 opskalere VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Optag lyd Record Display = Optag skærm Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Sæt PPSSPP's indstillinger tilbage til standard +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Tilbagespol snapshot frekvens (mem hog) Save path in installed.txt = Gem sti i installed.txt Save path in My Documents = Gem sti i Mine Dokumenter @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Ny version af PPSSPP tilgængelig 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/de_DE.ini b/assets/lang/de_DE.ini index eb17e8081f..9a1d18cb0a 100644 --- a/assets/lang/de_DE.ini +++ b/assets/lang/de_DE.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Statistik für fehlende Einzelbilder loggen Log Level = Loglevel Log View = Logbuch Logging Channels = Logkanäle +Multi-threaded rendering = Multi-threaded rendering Next = Nächstes No block = Kein Block Prev = Vorheriges @@ -304,8 +315,8 @@ Stats = Statistiken System Information = Systeminformationen Texture ini file created = Texture ini file created Texture Replacement = Austausch von Texturen -Toggle Audio Debug = Ton-Debugging umschalten -Toggle Control Debug = Toggle Control Debug +Audio Debug = Ton-Debugging +Control Debug = Control Debug Toggle Freeze = Bild einfrieren an/aus Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Schnellfeuer Record = Aufnehmen @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT Scanlines +FakeReflections = FakeReflections FXAA = FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = UpscaleSpline36 VideoSmoothingAA = Video Bildglättung Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU Information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Sprache/Region Memory Page Size = Seitengröße des Speichers @@ -1239,6 +1255,7 @@ Record Audio = Ton aufzeichnen Record Display = Bildschirm aufzeichnen Reset Recording on Save/Load State = Zurücksetzen der Aufnahme bei Laden/Speichern eines Standes Restore Default Settings = Auf Standardeinstellungen zurücksetzen +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Zurückspulen-Snapshot Frequenz (Speicherfresser) Save path in installed.txt = Speicherpfad in installed.txt Save path in My Documents = Speicherpfad in "Meine Dokumente" @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Neue PPSSPP Version verfügbar 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/dr_ID.ini b/assets/lang/dr_ID.ini index 3bb3d12f38..de101b63fb 100644 --- a/assets/lang/dr_ID.ini +++ b/assets/lang/dr_ID.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = Pempakitan to sistem dipake Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Paus +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/en_US.ini b/assets/lang/en_US.ini index 58a0bad5bf..c8ee58af06 100644 --- a/assets/lang/en_US.ini +++ b/assets/lang/en_US.ini @@ -24,28 +24,40 @@ [Achievements] %d achievements, %d points = %d achievements, %d points -%1: Leaderboard attempt started = %1: Leaderboard attempt started -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed +%1: Attempt started = %1: Attempt started +%1: Attempt failed = %1: Attempt failed Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement unlocked = Achievement unlocked +Achievement progress = Achievement progress Achievements = Achievements +Achievements enabled = Achievements enabled Achievements are disabled = Achievements are disabled +Achievements with active challenges = Achievements with active challenges +Almost completed achievements = Almost completed achievements Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled Leaderboards = Leaderboards +Leaderboard tracker = Leaderboard tracker Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Around me = Around me +Notifications = Notifications +Recently unlocked achievements = Recently unlocked achievements Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -59,7 +71,9 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements +Unsupported achievements = Unsupported achievements Unofficial achievements = Unofficial achievements [Audio] @@ -300,6 +314,7 @@ Enter address = Enter address FPU = FPU Framedump tests = Framedump tests Frame Profiler = Frame profiler +Frame timing = Frame timing GPU Driver Test = GPU driver test GPU Profile = GPU profile GPU log profiler = GPU log profiler @@ -329,8 +344,8 @@ Stats = Stats System Information = System information Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -755,6 +770,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -880,6 +896,7 @@ Amount = Amount Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon ColorCorrection = Color correction @@ -889,6 +906,7 @@ CRT = CRT scanlines FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level +FakeReflections = FakeReflections Intensity = Intensity LCDPersistence = LCD Persistence Natural = Natural Colors @@ -905,6 +923,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = Video Smoothing AA Vignette = Vignette @@ -1148,6 +1167,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1254,6 +1274,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1334,6 +1355,7 @@ Screen representation = Screen representation % of native FoV = % of native FoV 6DoF movement = 6DoF movement Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Game camera rotation step per frame = Game camera rotation step per frame Game camera uses rotation smoothing = Game camera uses rotation smoothing diff --git a/assets/lang/es_ES.ini b/assets/lang/es_ES.ini index a18d4d4825..68b62d3736 100644 --- a/assets/lang/es_ES.ini +++ b/assets/lang/es_ES.ini @@ -1,32 +1,41 @@ [Achievements] %d achievements, %d points = %d logros, %d puntos -%1: Leaderboard attempt started = %1: intento para el leaderboard iniciado -%1: Leaderboard attempt failed = %1: intento para el leaderboard fallido +%1: Attempt started = %1: intento para el leaderboard iniciado +%1: Attempt failed = %1: intento para el leaderboard fallido Account = Cuenta -Achievement Unlocked = Logro Desbloqueado +Achievement progress = Achievement progress +Achievement unlocked = Logro Desbloqueado Achievements = Logros Achievements are disabled = Los logros están desactivados +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = No se pudo iniciar sesión a RetroAchievements +Challenge indicator = Challenge indicator Challenge Mode = Modo Desafío Challenge Mode (no savestates) = Modo Desafío (Sin estados) Contacting RetroAchievements server... = Contactando al servidor de RetroAchievements... Customize = Customizar Earned = Has obtenido %d de %d logros y %d de %d puntos Encore Mode = Modo Encore +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = Como usar RetroAchievements In Encore mode - listings may be wrong below = En el modo Encore - las listas de abajo pueden estar equivocadas +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Subir puntos al leaderboard Leaderboard submission is enabled = Se ha activado la subida de puntos al leaderboard +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Logros bloqueados Log bad memory accesses = Registrar malos accesos a la memoría Mastered %1 = Completaste %1 +Notifications = Notifications Register on www.retroachievements.org = Registrate en www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements no está disponible para este juego RetroAchievements website = Página web de RetroAchievements Rich Presence = Rich Presence -Save states not available in Challenge Mode = Los estados no están disponibles en el modo desafío +Save states not available in Challenge Mode = Los estados no están disponibles en el modo desafío Save state loaded without achievement data = Estado guardado sin información de los logros Sound Effects = Efectos de sonido Statistics = Estadísticas @@ -35,6 +44,7 @@ Syncing achievements data... = Sincronizando información de logros... Test Mode = Modo prueba This feature is not available in Challenge Mode = Esta opción no está disponible en el modo desafío This game has no achievements = Este juego no tiene logros +Top players = Top players Unlocked achievements = Logros desbloqueados Unofficial achievements = Logros no oficiales @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Registrar estadísticas de caídas de fotogramas Log Level = Nivel de registro Log View = Ver el registro Logging Channels = Canales de registro +Multi-threaded rendering = Multi-threaded rendering Next = Siguiente No block = No bloquear Prev = Anterior @@ -304,8 +315,8 @@ Stats = Estadísticas System Information = Información del sistema Texture ini file created = Archivo ini de texturas creado Texture Replacement = Reemplazo de texturas -Toggle Audio Debug = Parar/Reanudar depuración de audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Depuración de audio +Control Debug = Control Debug Toggle Freeze = Parar/Reanudar imagen Touchscreen Test = Test de pantalla táctil VFPU = VFPU @@ -735,6 +746,7 @@ None = Ninguno Note = Nota OpenChat = Abrir Chat Pause = Pausa +Previous Slot = Previous Slot R = R RapidFire = Fuego rápido Record = Grabar @@ -903,6 +915,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Bordes negros Bloom = Resplandor +BloomNoBlur = Bloom (no blur) Brightness = Brillo Cartoon = Dibujos animados CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -910,6 +923,7 @@ ColorCorrection = Corrección de color ColorPreservation = Color preservation Contrast = Contraste CRT = Pantalla de tubo (CRT) +FakeReflections = FakeReflections FXAA = Antialiasing por FXAA Gamma = Gamma GreenLevel = Green level @@ -930,6 +944,7 @@ SSAA(Gauss) = Super muestreo AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Escalado en Spline36 VideoSmoothingAA = Suavizado de vídeo AA Vignette = Viñeta @@ -1133,6 +1148,7 @@ GPU Flags = GPU Flags GPU Information = Información de la GPU High precision float range = Rango de alta precisión (flotante) High precision int range = Rango de alta precisión (enteros) +Icon cache = Icon cache JIT available = JIT available Lang/Region = Idioma/Región Memory Page Size = Tamaño de página de memoria @@ -1240,6 +1256,7 @@ Record Audio = Grabar audio Record Display = Grabar pantalla Reset Recording on Save/Load State = Reiniciar grabación al cargar/guardar estado Restore Default Settings = Reestablecer ajustes +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Intervalo de rebobinado Save path in installed.txt = Carpeta de guardado en "installed.txt" Save path in My Documents = Carpeta de guardado en "Mis documentos" @@ -1311,6 +1328,7 @@ New version of PPSSPP available = Nueva versión de PPSSPP disponible 6DoF movement = Movimiento 6DoF Camera type = Camera type Distance to 2D menus and scenes = Distancia de los menús y escenas 2D +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Escala de campo de visión Force 72Hz update = Forzar actualizar a 72Hz diff --git a/assets/lang/es_LA.ini b/assets/lang/es_LA.ini index 641c32113a..50bfce9bee 100644 --- a/assets/lang/es_LA.ini +++ b/assets/lang/es_LA.ini @@ -1,32 +1,41 @@ [Achievements] %d achievements, %d points = %d logros, %d puntos -%1: Leaderboard attempt started = %1: intento para el leaderboard iniciado -%1: Leaderboard attempt failed = %1: intento para el leaderboard fallido +%1: Attempt started = %1: intento para el leaderboard iniciado +%1: Attempt failed = %1: intento para el leaderboard fallido Account = Cuenta -Achievement Unlocked = Logro Desbloqueado +Achievement progress = Achievement progress +Achievement unlocked = Logro Desbloqueado Achievements = Logros Achievements are disabled = Los logros están desactivados +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = No se pudo iniciar sesión a RetroAchievements +Challenge indicator = Challenge indicator Challenge Mode = Modo Desafío Challenge Mode (no savestates) = Modo Desafío (Sin estados) Contacting RetroAchievements server... = Contactando al servidor de RetroAchievements... Customize = Customizar Earned = Has obtenido %d de %d logros y %d de %d puntos Encore Mode = Modo Encore +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = Como usar RetroAchievements In Encore mode - listings may be wrong below = En el modo Encore - las listas de abajo pueden estar equivocadas +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Subir puntos al leaderboard Leaderboard submission is enabled = Se ha activado la subida de puntos al leaderboard +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Logros bloqueados Log bad memory accesses = Registrar malos accesos a la memoría Mastered %1 = Completaste %1 +Notifications = Notifications Register on www.retroachievements.org = Registrate en www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements no está disponible para este juego RetroAchievements website = Página web de RetroAchievements Rich Presence = Rich Presence -Save states not available in Challenge Mode = Los estados no están disponibles en el modo desafío +Save states not available in Challenge Mode = Los estados no están disponibles en el modo desafío Save state loaded without achievement data = Estado guardado sin información de los logros Sound Effects = Efectos de sonido Statistics = Estadísticas @@ -35,6 +44,7 @@ Syncing achievements data... = Sincronizando información de logros... Test Mode = Modo prueba This feature is not available in Challenge Mode = Esta opción no está disponible en el modo desafío This game has no achievements = Este juego no tiene logros +Top players = Top players Unlocked achievements = Logros desbloqueados Unofficial achievements = Logros no oficiales @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Registrar estadísticas de frames caídos Log Level = Nivel de registro Log View = Ver el registro Logging Channels = Canales de registro +Multi-threaded rendering = Multi-threaded rendering Next = Siguiente No block = No bloquear Prev = Atras @@ -304,8 +315,8 @@ Stats = Estadísticas System Information = Información del sistema Texture ini file created = Texture ini file created Texture Replacement = Remplazar texturas -Toggle Audio Debug = Parar/Reanudar depuración de audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Depuración de audio +Control Debug = Control Debug Toggle Freeze = Parar/Reanudar imagen Touchscreen Test = Probar pantalla táctil VFPU = VFPU @@ -734,6 +745,7 @@ None = Ninguno Note = Sonido OpenChat = Abrir chat Pause = Pausa +Previous Slot = Previous Slot R = R RapidFire = Disparo rápido Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Borde negro Bloom = Resplandor +BloomNoBlur = Bloom (no blur) Brightness = Brillo Cartoon = Caricaturas CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Corrección de color ColorPreservation = Color preservation Contrast = Contraste CRT = Pantalla de tubo (CRT) +FakeReflections = FakeReflections FXAA = Antialiasing por FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Super muestreo AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Escalado en Spline36 VideoSmoothingAA = Suavizado de vídeo AA Vignette = Viñeta @@ -1134,6 +1149,7 @@ GPU Flags = GPU Flags GPU Information = Info de GPU High precision float range = Rango de alta precisión (flotante) High precision int range = Rango de alta precisión (enteros) +Icon cache = Icon cache JIT available = JIT available Lang/Region = Idioma/Región Memory Page Size = Tamaño de página de memoria @@ -1241,6 +1257,7 @@ Record Audio = Grabar Audio Record Display = Grabar pantalla Reset Recording on Save/Load State = Reiniciar grabación al abrir/guardar estados Restore Default Settings = Reestablecer ajustes +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Frecuencia de rebobinado\n(consume memoria) Save path in installed.txt = Guardar ruta en installed.txt Save path in My Documents = Guardar ruta en "C:/Users/(tu usuario)/Documents" @@ -1311,6 +1328,7 @@ New version of PPSSPP available = Nueva versión de PPSSPP disponible 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/fa_IR.ini b/assets/lang/fa_IR.ini index 354f6ce5d4..ab2a3693d0 100644 --- a/assets/lang/fa_IR.ini +++ b/assets/lang/fa_IR.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = ورود آمار کادر کاهش یافته ا Log Level = سطح خطا Log View = مشاهده خطا Logging Channels = رکورد خطا چنل ها +Multi-threaded rendering = Multi-threaded rendering Next = بعدی No block = بدون بلوک Prev = قبلی @@ -304,8 +315,8 @@ Stats = Stats System Information = ‎اطلاعات سیستم Texture ini file created = ایجاد کنید یک فایل بافت با فرمت ini Texture Replacement = جایگزینی بافت -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = روشنایی Cartoon = کارتون CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = گاما GreenLevel = سطح سبز @@ -929,6 +943,7 @@ SSAA(Gauss) = نمونه برداری فوق العاده AA (گوس) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = اسپلین 36 تا اسکلهر VideoSmoothingAA = صاف کردن ویدئو AA Vignette = شکل @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = ‎ضبط صدا Record Display = ‎ضبط صفحه Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = ‎به حالت اولیه PPSSPP بازگشت تنظیمات +RetroAchievements = RetroAchievements Rewind Snapshot Interval = ‎تعداد فریم ذخیره شده برای به عقب رفتن (مصرف زیاد رم) Save path in installed.txt = Save path in installed.txt Save path in My Documents = ذخیره در داکیومنت ها @@ -1309,6 +1326,7 @@ New version of PPSSPP available = ورژن جدیدی از ppsspp موجود ا 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/fi_FI.ini b/assets/lang/fi_FI.ini index 01e14c2e77..f3485145d7 100644 --- a/assets/lang/fi_FI.ini +++ b/assets/lang/fi_FI.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d saavutusta, %d pistettä Account = Tili -Achievement Unlocked = Saavutus avattu +Achievement progress = Achievement progress +Achievement unlocked = Saavutus avattu Achievements = Saavutukset Achievements are disabled = Saavutukset ovat pois käytöstä +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = RetroAchievements:iin ei voida kirjautua juuri nyt +Challenge indicator = Challenge indicator Challenge Mode = Haastetila Challenge Mode (no savestates) = Haastetila (ei tilatallennuksia) Contacting RetroAchievements server... = Yhdistetään RetroAchievements:in palvelimelle... Customize = Mukauta Earned = Olet ansainnut %d/%d saavutusta, ja %d/%d pistettä Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = Kuinka käyttää RetroAchievements:ia In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Sijoituslistan pisteiden lähetys Leaderboard submission is enabled = Sijoituslistan lähetys on käytössä +Leaderboard tracker = Leaderboard tracker Leaderboards = Sijoituslista Links = Linkit Locked achievements = Lukitut saavutukset Log bad memory accesses = Kirjaa virheelliset muistipääsyt Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Rekisteröidy osoitteessa www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements eivät ole käytössä tälle pelille RetroAchievements website = RetroAchievements verkkosivu @@ -35,6 +44,7 @@ Syncing achievements data... = Synkoronoidaan saavutusten tietoja... Test Mode = Testitila This feature is not available in Challenge Mode = Tämä ominaisuus ei ole käytettävissä haastetilassa This game has no achievements = Tällä pelillä ei ole saavutuksia +Top players = Top players Unlocked achievements = Avatut saavutukset Unofficial achievements = Epäviralliset saavutukset @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = System information Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = Ei mitään Note = Note OpenChat = Avaa keskustelu Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Nopea tulitus Record = Nauhoita @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Nauhoita ääntä Record Display = Nauhoita näyttöä Reset Recording on Save/Load State = Nollaa nauhoitus tallennettaessa/ladattaessa tila Restore Default Settings = Palauta PPSSPP:n oletusasetukset +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Pikakelaa tilannevedosten välit (muistisyöppö) Save path in installed.txt = Tallennuskansio installed.txt-tiedostossa Save path in My Documents = Tallennuskansio Omat tiedostot -kansiossa @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/fr_FR.ini b/assets/lang/fr_FR.ini index 9059c48b8d..7ead375b00 100644 --- a/assets/lang/fr_FR.ini +++ b/assets/lang/fr_FR.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Enregistrer les statistiques sur les pertes d'ima Log Level = Niveau du journal Log View = Voir le journal Logging Channels = Filtres du journal de débogage +Multi-threaded rendering = Multi-threaded rendering Next = Suivant No block = Pas de bloc Prev = Précédent @@ -304,8 +315,8 @@ Stats = Statistiques System Information = Informations système Texture ini file created = Texture ini file created Texture Replacement = Remplacement de textures -Toggle Audio Debug = Activer/Désactiver le débogage audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Débogage audio +Control Debug = Control Debug Toggle Freeze = Geler/Dégeler l'image Touchscreen Test = Test de l'écran tactile VFPU = VFPU @@ -734,6 +745,7 @@ None = Aucun Note = Note OpenChat = Ouvrir chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Tir rapide Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Bordure noire Bloom = Flou lumineux +BloomNoBlur = Bloom (no blur) Brightness = Luminosité Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Correction des couleurs ColorPreservation = Color preservation Contrast = Contraste CRT = Lignes de balayage CRT +FakeReflections = FakeReflections FXAA = Anticrénelage FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Anticrénelage supersampling (Gauss) Strength = Strength Tex4xBRZ = 4×BRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Upscaling Spline36 VideoSmoothingAA = Anticrénelage des vidéos Vignette = Vignette @@ -1123,6 +1138,7 @@ GPU Flags = GPU Flags GPU Information = Informations GPU High precision float range = Amplitude de float haute précision High precision int range = Amplitude d'entier haute précision +Icon cache = Icon cache JIT available = JIT available Lang/Region = Langue/Région Memory Page Size = Taille de page mémoire @@ -1230,6 +1246,7 @@ Record Audio = Enregistrer le son Record Display = Enregistrer l'affichage Reset Recording on Save/Load State = Redémarrer l'enregistrement lors de la sauvegarde/chargement d'état Restore Default Settings = Restaurer les paramètres par défaut +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Fréquence instantanés rembobinage (+ de mémoire) Save path in installed.txt = Chemin de sauvegarde dans "installed.txt" Save path in My Documents = Chemin de sauvegarde dans "Mes documents" @@ -1300,6 +1317,7 @@ New version of PPSSPP available = Nouvelle version de PPSSPP disponible 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/gl_ES.ini b/assets/lang/gl_ES.ini index 12c814bc61..5db384b6e3 100644 --- a/assets/lang/gl_ES.ini +++ b/assets/lang/gl_ES.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Nivel de rexistro Log View = Ver o rexistro Logging Channels = Canles de rexistro +Multi-threaded rendering = Multi-threaded rendering Next = Seguinte No block = Non bloquear Prev = Anterior @@ -304,8 +315,8 @@ Stats = Stats System Information = Información do sistema Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Parar/Reanudar depuración de audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Depuración de audio +Control Debug = Control Debug Toggle Freeze = Parar/Reanudar imaxe Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pausa +Previous Slot = Previous Slot R = R RapidFire = Fogo rápido Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Brillo +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Debuxos animados CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = Monitor con «scanlines» (CRT) +FakeReflections = FakeReflections FXAA = Antialiasing FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 «upscaler» VideoSmoothingAA = VideoSmoothingAA Vignette = Viñeta @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Reestablecer axustes +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Frecuencia de rebobinado de instantánea (mem hog) Save path in installed.txt = Carpeta de gardado en installed.txt Save path in My Documents = Carpeta de gardado en Meus documentos @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Nova versión de PPSSPP dispoñible 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/gr_EL.ini b/assets/lang/gr_EL.ini index f4558e3660..f51c31ecd8 100644 --- a/assets/lang/gr_EL.ini +++ b/assets/lang/gr_EL.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Καταγραφή Στατιστικών για Log Level = Επίπεδο καταγραφής Log View = Εμφάνιση καταγραφέα Logging Channels = Καταγραφή καναλιών +Multi-threaded rendering = Multi-threaded rendering Next = Επόμενο No block = Κανένα block Prev = Προηγούμενο @@ -304,8 +315,8 @@ Stats = Στατιστικά System Information = Πληροφορίες Συστήματος Texture ini file created = Texture ini file created Texture Replacement = Αντικατάσταση υφών -Toggle Audio Debug = Εναλλαγή debug ήχου -Toggle Control Debug = Toggle Control Debug +Audio Debug = Debug ήχου +Control Debug = Control Debug Toggle Freeze = Πάγωμα Εναλαγής Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Πάυση +Previous Slot = Previous Slot R = R RapidFire = Ταχεία βολή Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Καρτούν CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = Γραμμές σάρωσης CRT +FakeReflections = FakeReflections FXAA = Εξομάλυνση κορυφών FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = Πληροφορίες GPU High precision float range = High precision float range High precision int range = Εύρος υψηλής ακρίβειας int +Icon cache = Icon cache JIT available = JIT available Lang/Region = Γλώσσα/Περιοχή Memory Page Size = Μέγεθος σελίδας μνήμης @@ -1239,6 +1255,7 @@ Record Audio = Καταγραφή Ήχου Record Display = Καταγραφή Εικόνας Reset Recording on Save/Load State = Επαναφορά της εγγραφής κατή την Αποθήκευση/Φόρτωση σημείου αποθήκευσης Restore Default Settings = Επαναφορά προεπιλεγμένων ρυθμίσεων του PPSSPP +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Συχνότητα Αντιστροφής Στιγμιότυπου (mem hog) Save path in installed.txt = Αποθήκευση διαδρομής στο installed.txt Save path in My Documents = Αποθήκευση διαδρομής στα Έγγραφα μου @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Νέα διαθέσιμη έκδοση PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/he_IL.ini b/assets/lang/he_IL.ini index 0ee8fd9926..1a42307847 100644 --- a/assets/lang/he_IL.ini +++ b/assets/lang/he_IL.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = מידע על המערכת Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = עצור +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/he_IL_invert.ini b/assets/lang/he_IL_invert.ini index f4a7b671d5..dbd838e27e 100644 --- a/assets/lang/he_IL_invert.ini +++ b/assets/lang/he_IL_invert.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = תכרעמה לע עדימ Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = עצור +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/hr_HR.ini b/assets/lang/hr_HR.ini index 84a68e2dbe..116b2683ae 100644 --- a/assets/lang/hr_HR.ini +++ b/assets/lang/hr_HR.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log pregled Logging Channels = Logging kanali +Multi-threaded rendering = Multi-threaded rendering Next = Sljedeće No block = Nema bloka Prev = Prošlo @@ -304,8 +315,8 @@ Stats = Stats System Information = System informacija Texture ini file created = Texture ini file created Texture Replacement = Zamjena teksturi -Toggle Audio Debug = Uključi audio debuganje -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio debuganje +Control Debug = Control Debug Toggle Freeze = Uključi zamrzavanje Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Otvori chat Pause = Pauza +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 nadograđivač VideoSmoothingAA = Video ublaživanja AA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = Informacije o GPU High precision float range = High precision float range High precision int range = Visoka preciznost int dohvata +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Regija Memory Page Size = Veličina memorijske stranice @@ -1239,6 +1255,7 @@ Record Audio = Snimi audio Record Display = Snimi prikaz Reset Recording on Save/Load State = Ponovo postavi snimak na Save/Load state Restore Default Settings = Vrati PPSSPP opcije na zadano +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Vrati snapshot frekvenciju (mem hog) Save path in installed.txt = Spremi put u installed.txt Save path in My Documents = Spremi put u My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Nova verzija PPSSPP-a je dostupna 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/hu_HU.ini b/assets/lang/hu_HU.ini index dbc560b78d..bbd6af1477 100644 --- a/assets/lang/hu_HU.ini +++ b/assets/lang/hu_HU.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission +Leaderboard tracker = Leaderboard tracker Leaderboard submission is enabled = Leaderboard submission is enabled Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Eldobott képkockák statisztikáinak naplózása Log Level = Naplózási szint Log View = Nápló megtekintése Logging Channels = Naplózási csatornák +Multi-threaded rendering = Multi-threaded rendering Next = Következő No block = Nincs blokk Prev = Előző @@ -304,8 +315,8 @@ Stats = Statisztikák System Information = Rendszer információ Texture ini file created = Texture ini file created Texture Replacement = Textúra csere -Toggle Audio Debug = Audió hibakereső ki/bekapcsolása -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio hibaelhárítás +Control Debug = Control Debug Toggle Freeze = Fagyasztás ki/bekapcsolása Touchscreen Test = Érintőképernyő teszt VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Megj. OpenChat = Open chat Pause = Szünet +Previous Slot = Previous Slot R = R RapidFire = Gyorstüzelés Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Fekete keret Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Rajzfilm CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Színkorrekció ColorPreservation = Color preservation Contrast = Kontraszt CRT = CRT +FakeReflections = FakeReflections FXAA = FXAA élsimítás Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 felskálázó VideoSmoothingAA = VideoSmoothingAA Vignette = Vignetta @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU információ High precision float range = High precision float range High precision int range = Nagy pontosságú int tartomány +Icon cache = Icon cache JIT available = JIT available Lang/Region = Nyelv/Régió Memory Page Size = Memória lapozóméret @@ -1239,6 +1255,7 @@ Record Audio = Audió felvétele Record Display = Videó felvétele Reset Recording on Save/Load State = Felvétel leállítása állapotmentés készítésekor vagy betöltésekor Restore Default Settings = PPSSPP beállításainak alapértelmezettre állítása +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Visszatekerési állapotmentések gyakorisága (sok memória kell) Save path in installed.txt = Mentés helye installed.txt-ben Save path in My Documents = Mentés helye a Dokumentumok mappában @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Elérhető a PPSSPP egy újabb verziója 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/id_ID.ini b/assets/lang/id_ID.ini index ce05491d38..7b7770ff09 100644 --- a/assets/lang/id_ID.ini +++ b/assets/lang/id_ID.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log statistik laju bingkai yang jatuh Log Level = Tingkatan pencatat Log View = Tampilan pencatat Logging Channels = Kanal pencatatan +Multi-threaded rendering = Multi-threaded rendering Next = Sesudah No block = Tidak ada blok Prev = Sebelum @@ -304,8 +315,8 @@ Stats = Statistik System Information = Informasi sistem Texture ini file created = Texture ini file created Texture Replacement = Penggantian tekstur -Toggle Audio Debug = Alihkan awakutu audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Awakutu audio +Control Debug = Control Debug Toggle Freeze = Alihkan pembekuan Touchscreen Test = Tes layar sentuh VFPU = VFPU @@ -734,6 +745,7 @@ None = Tidak ada Note = Catatan OpenChat = Buka obrolan Pause = Jeda +Previous Slot = Previous Slot R = R RapidFire = Tembakan beruntun Record = Rekam @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Perbatasan Hitam Bloom = Kembang +BloomNoBlur = Bloom (no blur) Brightness = Kecerahan Cartoon = Kartun CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Koreksi Warna ColorPreservation = Color preservation Contrast = Kontras CRT = CRT +FakeReflections = FakeReflections FXAA = Mengurangi Artifak Distorsi (FXAA) Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = SSAA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Kelas Atas VideoSmoothingAA = Penghalus Video AA Vignette = Penggelapan di sisi @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = Informasi GPU High precision float range = Kisaran pengambang presisi tinggi High precision int range = Rentang integer presisi tinggi +Icon cache = Icon cache JIT available = JIT available Lang/Region = Bahasa/regional Memory Page Size = Ukuran halaman memori @@ -1239,6 +1255,7 @@ Record Audio = Rekam suara Record Display = Rekam tampilan Reset Recording on Save/Load State = Atur ulang rekaman pada status simpan/muat Restore Default Settings = Atur ulang pengaturan PPSSPP ke awal +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Putar ulang frekuensi foto (memory hog) Save path in installed.txt = Simpan jalur dalam installed.txt Save path in My Documents = Simpan jalur dalam dokumen saya @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Versi baru PPSSPP tersedia 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/it_IT.ini b/assets/lang/it_IT.ini index f84d30c366..027f5302be 100644 --- a/assets/lang/it_IT.ini +++ b/assets/lang/it_IT.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Statistiche dei Frame persi Log Level = Livello del Log Log View = Visualizza Log Logging Channels = Registra Canali +Multi-threaded rendering = Multi-threaded rendering Next = Avanti No block = Nessun blocco Prev = Indietro @@ -304,8 +315,8 @@ Stats = Statistiche System Information = Informazioni Sistema Texture ini file created = Creato file ini delle texture Texture Replacement = Sostituzione Texture -Toggle Audio Debug = Attiva/Disattiva debug audio -Toggle Control Debug = Attiva/Disattiva controllo debug +Audio Debug = Audio debug +Control Debug = Controllo debug Toggle Freeze = Attiva/Disattiva congelamento Touchscreen Test = Test del touchscreen VFPU = VFPU @@ -736,6 +747,7 @@ None = Niente Note = Nota OpenChat = Apri la chat Pause = Pausa +Previous Slot = Previous Slot R = R RapidFire = Fuoco rapido Record = Record @@ -874,6 +886,7 @@ Animation speed (0 -> disable) = Velocità animazione (0 -> disabilita) Aspect = Aspetto Black border = Bordo nero Bloom = Sfocatura luminosa +BloomNoBlur = Bloom (no blur) Brightness = Luminosità Cartoon = Disegno CatmullRom = Upscaler bicubico (Catmull-Rom) @@ -881,6 +894,7 @@ ColorCorrection = Correzione dei colori ColorPreservation = Preservazione colore Contrast = Contrasto CRT = Linee di scansione CRT +FakeReflections = FakeReflections FXAA = Antialiasing FXAA Gamma = Gamma GreenLevel = Livello del verde @@ -901,6 +915,7 @@ SSAA(Gauss) = Supercampionamento AA (Gauss) Strength = Forza Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Upscaling Spline36 VideoSmoothingAA = AA nitido del video Vignette = Miniatura @@ -1133,6 +1148,7 @@ GPU Flags = Flag GPU GPU Information = Informazioni GPU High precision float range = Ampiezza di float ad alta precisione High precision int range = Ampiezza interi ad alta precisione +Icon cache = Icon cache JIT available = JIT disponibile Lang/Region = Lingua/Regione Memory Page Size = Ampiezza pagina di memoria @@ -1214,6 +1230,7 @@ No animation = Nessuna animazione Path does not exist! = Il percorso non esiste! PSP Memory Stick = Memory Stick PSP Recent games = Giochi recenti +RetroAchievements = RetroAchievements Set Memory Stick folder = Imposta la cartella della Memory Stick Show Memory Stick folder = Mostra cartella Memory Stick Theme = Tema @@ -1310,6 +1327,7 @@ New version of PPSSPP available = È disponibile una nuova versione di PPSSPP 6DoF movement = Movimento 6DoF Camera type = Tipo di telecamera Distance to 2D menus and scenes = Distanza dai menu e dalle scene 2D +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Solo per esperti Field of view scale = Scalatura "Field of view" Force 72Hz update = Forza aggiornamento a 72Hz diff --git a/assets/lang/ja_JP.ini b/assets/lang/ja_JP.ini index 04fca0a49a..a1ca8ad871 100644 --- a/assets/lang/ja_JP.ini +++ b/assets/lang/ja_JP.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = ドロップしたフレームの統計を記録 Log Level = ログレベル Log View = ログビュー Logging Channels = ログチャネル +Multi-threaded rendering = Multi-threaded rendering Next = 次へ No block = ブロックなし Prev = 前へ @@ -304,8 +315,8 @@ Stats = 状況 System Information = システム情報 Texture ini file created = Texture ini file created Texture Replacement = テクスチャの置き換え -Toggle Audio Debug = オーディオのデバッグを切り替える -Toggle Control Debug = Toggle Control Debug +Audio Debug = オーディオのデバッグを切り替える +Control Debug = Control Debug Toggle Freeze = フリーズを切り替える Touchscreen Test = タッチスクリーンのテスト VFPU = VFPU @@ -734,6 +745,7 @@ None = 設定なし Note = ♪ボタン OpenChat = チャットを開く Pause = 一時停止 +Previous Slot = Previous Slot R = R RapidFire = 連射 Record = Record @@ -873,6 +885,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -880,6 +893,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -900,6 +914,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = Video Smoothing AA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU情報 High precision float range = 高精度浮動小数点の範囲 High precision int range = 高精度整数の範囲 +Icon cache = Icon cache JIT available = JIT available Lang/Region = 言語/地域 Memory Page Size = メモリページサイズ @@ -1239,6 +1255,7 @@ Record Audio = オーディオを記録する Record Display = 画面を記録する Reset Recording on Save/Load State = ステートをセーブ/ロードしたら記録をリセットする Restore Default Settings = 設定をデフォルトに戻す +RetroAchievements = RetroAchievements Rewind Snapshot Interval = スナップショットの巻き戻し頻度 (メモリを消費) Save path in installed.txt = パスを installed.txt に保存する Save path in My Documents = パスを My Documents に保存する @@ -1309,6 +1326,7 @@ New version of PPSSPP available = 新しいバージョンのPPSSPPを利用で 6DoF movement = 6DoF動作 Camera type = Camera type Distance to 2D menus and scenes = 2Dメニューと空間までの距離 +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = 視野角のスケール Force 72Hz update = 72Hzに強制的に更新 diff --git a/assets/lang/jv_ID.ini b/assets/lang/jv_ID.ini index 11d42c3c40..508d95d5fb 100644 --- a/assets/lang/jv_ID.ini +++ b/assets/lang/jv_ID.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Tingkat Log Log View = Tampilan Log Logging Channels = Saluran ngangkut barang +Multi-threaded rendering = Multi-threaded rendering Next = Sabanjure No block = Ora pemblokiran Prev = Sadurunge @@ -304,8 +315,8 @@ Stats = Stats System Information = Informasi Sistem Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Pilian Debug Suoro -Toggle Control Debug = Toggle Control Debug +Audio Debug = Debug Suoro +Control Debug = Control Debug Toggle Freeze = Pilian Beku Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Ngaso +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Kartun CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Mulihake setelan PPSSPP kanggo gawan +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Frekuensi gambar asli seko mundur (mem hog) Save path in installed.txt = Nyimpen path ing installed.txt Save path in My Documents = Nyimpen path ing Dokumen kulo @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Versi anyar PPSSPP mpun ono monggo di comot 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/ko_KR.ini b/assets/lang/ko_KR.ini index 7b2616f055..209e768038 100644 --- a/assets/lang/ko_KR.ini +++ b/assets/lang/ko_KR.ini @@ -1,28 +1,37 @@ [Achievements] %d achievements, %d points = %d 성과, %d 포인트 -%1: Leaderboard attempt started = %1: 순위표 시도 시작 -%1: Leaderboard attempt failed = %1: 순위표 시도 실패 +%1: Attempt started = %1: 순위표 시도 시작 +%1: Attempt failed = %1: 순위표 시도 실패 #%1: Submitting leaderboard score: %2! = %1: 리더보드 점수 제출: %2! Account = 계정 -Achievement Unlocked = 성과 잠금 해제 +Achievement progress = 성과 진행률 +Achievement unlocked = 성과 잠금 해제 Achievements = 성과 Achievements are disabled = 성과 비활성화 -Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Achievements enabled = 성과 활성화 +Around me = 내 주변 +Can't log in to RetroAchievements right now = 지금 RetroAchievements에 로그인할 수 없음 +Challenge indicator = 도전 표시기 Challenge Mode = 도전 모드 Challenge Mode (no savestates) = 도전 모드 (저장 상태 없음) -Contacting RetroAchievements server... = Contacting RetroAchievements server... -Customize = Customize +Contacting RetroAchievements server... = RetroAchievements 서버에 연결 중... +Customize = 맞춤 설정 Earned = %d 의 %d 성과 및 %d 의 %d 포인트 획득 Encore Mode = 앙코르 모드 +Failed logging in to RetroAchievements = RetroAchievements에 로그인 실패 How to use RetroAchievements = RetroAchievements 사용 방법 -In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +In Encore mode - listings may be wrong below = 앙코르 모드 - 아래 목록이 잘못 표시될 수 있음 +Leaderboard attempt started or failed = 순위표 시도 시작 또는 실패 +Leaderboard result submitted = 순위표 결과 제출 Leaderboard score submission = 순위표 점수 제출 Leaderboard submission is enabled = 순위표 제출 활성화 +Leaderboard tracker = 순위표 추적기 Leaderboards = 순위표 Links = 링크 Locked achievements = 잠겨진 성과 Log bad memory accesses = 불량 메모리 접속 로그 Mastered %1 = 마스터한 %1 +Notifications = 알림 Submitted %1 for %2 = 2에 %1을(를) 제출 This feature is not available in Challenge Mode = 도전 모드에서는 이 기능을 사용할 수 없음 Save states not available in Challenge Mode = 도전 모드에서 사용할 수 없는 저장 상태 @@ -36,6 +45,7 @@ Statistics = 통계 Syncing achievements data... = 성과 데이터 동기화 중... Test Mode = 테스트 모드 This game has no achievements = 이 게임에는 성과가 없음 +Top players = Top players Unlocked achievements = 잠금 해제된 성과 Unofficial achievements = 비공식 성과 @@ -121,7 +131,7 @@ OnScreen = 화면 터치 제어 Portrait = 세로 방향 Portrait Reversed = 세로 방향 반전 PSP Action Buttons = PSP 액션 버튼 -Rapid fire interval = Rapid fire interval +Rapid fire interval = 연사 간격 Raw input = 원시 입력 Reset to defaults = 기본값으로 재설정 Screen Rotation = 화면 회전 @@ -286,6 +296,7 @@ Log Dropped Frame Statistics = 삭제된 프레임 통계 기록 Log Level = 로그 레벨 Log View = 로그 보기 Logging Channels = 로깅 채널 +Multi-threaded rendering = 다중 스레드 렌더링 Next = 다음 No block = 차단 없음 Prev = 이전 @@ -305,8 +316,8 @@ Stats = 상태 System Information = 시스템 정보 Texture ini file created = 텍스처 ini 파일 생성 Texture Replacement = 텍스쳐 교체 -Toggle Audio Debug = 오디오 디버그 토글 -Toggle Control Debug = 제어 디버그 토글 +Audio Debug = 오디오 디버그 +Control Debug = 제어 디버그 토글 Toggle Freeze = 프리징 토글 Touchscreen Test = 터치화면 테스트 VFPU = VFPU @@ -619,7 +630,7 @@ Stereo rendering = 스트레오 렌더링 Stretch = 늘이기 Texture Filter = 텍스처 필터링 Texture Filtering = 텍스처 필터링 -Texture replacement pack activated = Texture replacement pack activated +Texture replacement pack activated = 텍스처 교체 팩 활성화 Texture Scaling = 텍스처 스케일링 Texture Shader = 텍스처 쉐이더 Turn off Hardware Tessellation - unsupported = "하드웨어 조각화" 끄기: 지원되지 않음 @@ -731,6 +742,7 @@ None = 없음 Note = 참고 OpenChat = 채팅 열기 Pause = 일시 정지 +Previous Slot = 이전 슬롯 R = R RapidFire = 연사 Record = 녹화 @@ -819,7 +831,7 @@ Quick Chat 3 = 빠른 채팅 3 Quick Chat 4 = 빠른 채팅 4 Quick Chat 5 = 빠른 채팅 5 QuickChat = 빠른 채팅 -Randomize = Randomize +Randomize = 무작위화 Send = 보내기 Send Discord Presence information = 디스코드 "리치 프레즌스" 정보 보내기 Unable to find UPnP device = UPnP 장치를 찾을 수 없습니다. @@ -833,20 +845,20 @@ You're in Offline Mode, go to lobby or online hall = 오프라인 모드입니 [PSPSettings] Auto = Auto -Chinese (simplified) = Chinese (simplified) -Chinese (traditional) = Chinese (traditional) -Dutch = Dutch -English = English -French = French -Game language = Game language -German = German -Italian = Italian -Japanese = Japanese -Korean = Korean -Games often don't support all languages = Games often don't support all languages -Portuguese = Portuguese -Russian = Russian -Spanish = Spanish +Chinese (simplified) = 중국어 (간체) +Chinese (traditional) = 중국어 (번체) +Dutch = 네덜란드어 +English = 영어 +French = 프랑스어 +Game language = 게임 언어 +German = 독일어 +Italian = 이탈리아어 +Japanese = 일본어 +Korean = 한국어 +Games often don't support all languages = 게임이 모든 언어를 지원하지 않는 경우가 많음 +Portuguese = 포르투갈어 +Russian = 러시아어 +Spanish = 스페인어 [Pause] Cheats = 치트 @@ -873,12 +885,14 @@ Amount = 양 Aspect = 화면 Black border = 검정 테두리 Bloom = 블룸 +BloomNoBlur = 블룸 (흐림 없음) Brightness = 밝기 Cartoon = 카툰 ColorCorrection = 색상 교정 ColorPreservation = 색상 보존 Contrast = 명암 CRT = CRT 스캔라인 +FakeReflections = 가짜반사 FXAA = FXAA 안티 에일리어싱 Gamma = 감마 GreenLevel = 녹색 수준 @@ -898,6 +912,7 @@ SSAA(Gauss) = 슈퍼샘플 AA (가우스) Strength = 늘이기 Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = 업스케일바이큐빅 UpscaleSpline36 = 스플라인36 업스케일러 VideoSmoothingAA = 비디오 스무딩 AA Vignette = 비네트 효과 @@ -1124,6 +1139,7 @@ GPU Flags = GPU 플래그 GPU Information = GPU 정보 High precision float range = 고정밀 부동소수점 범위 High precision int range = 고정밀 정수 범위 +Icon cache = Icon cache JIT available = JIT 사용 가능 Lang/Region = 언어/지역 Memory Page Size = 메모리 페이지 크기 @@ -1230,6 +1246,7 @@ Record Audio = 오디오 녹음 Record Display = 녹화 표시 Reset Recording on Save/Load State = 저장/불러오기 상태에서 녹화 재설정 Restore Default Settings = PPSSPP의 설정을 기본값으로 복원 +RetroAchievements = RetroAchievements Rewind Snapshot Interval = 되감기 스냅샷 빈도 (메모리 호그) Save path in installed.txt = install.txt에 경로 저장 Save path in My Documents = 내 문서에 경로 저장 @@ -1310,6 +1327,7 @@ Screen representation = 화면 표현 % of native FoV = 실제 시야의 % 6DoF movement = 6DoF 이동 Distance to 2D menus and scenes = 2D 메뉴 및 장면까지의 거리 +Distance to 3D scenes when VR disabled = VR 비활성화 시 3D 장면까지의 거리 Experts only = 전문가 전용 Game camera rotation step per frame = 프레임당 게임 카메라 회전 단계 Game camera uses rotation smoothing = 회전 스무딩을 사용하는 게임 카메라 diff --git a/assets/lang/lo_LA.ini b/assets/lang/lo_LA.ini index d5135f3d7e..80d8766617 100644 --- a/assets/lang/lo_LA.ini +++ b/assets/lang/lo_LA.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = ເກັບຄ່າສະຖິຕິເຟຣ Log Level = ເກັບຄ່າລະດັບ Log View = ເກັບຄ່າມຸມມອງ Logging Channels = ຊ່ອງທາງເກັບຄ່າຂໍ້ມູນ +Multi-threaded rendering = Multi-threaded rendering Next = ຕໍ່ໄປ No block = ບໍ່ຕ້ອງບລັອກ Prev = ກ່ອນໜ້າ @@ -304,8 +315,8 @@ Stats = ສະຖິຕິ System Information = ຂໍ້ມູນຂອງລະບົບ Texture ini file created = Texture ini file created Texture Replacement = ການແທນທີ່ພື້ນຜິວ -Toggle Audio Debug = ແກ້ໄຂຈຸດບົກພ່ອງຂອງສຽງ -Toggle Control Debug = Toggle Control Debug +Audio Debug = ແກ້ໄຂຈຸດບົກພ່ອງຂອງສຽງ +Control Debug = Control Debug Toggle Freeze = ປຸ່ມແຊ່ແຂງ Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = ຢຸດຊົ່ວຄາວ +Previous Slot = Previous Slot R = R RapidFire = ປຸ່ມລົວຕໍ່ເນື່ອງ Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT +FakeReflections = FakeReflections FXAA = FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = ບັນທຶກສຽງ Audio Record Display = ບັນທຶກພາບ Display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = "ຄືນຄ່າການຕັ້ງຄ່າຂອງ PPSSPP ເປັນຄ່າເລີ່ມຕົ້ນ" +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = ບັນທຶກຂໍ້ມູນໃນ installed.txt Save path in My Documents = ບັນທຶກຂໍ້ມູນໄວ້ທີ່ My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = ເວີຊັ່ນໃໝ່ຂອງ PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/lt-LT.ini b/assets/lang/lt-LT.ini index ef4daaf46b..7c08003f99 100644 --- a/assets/lang/lt-LT.ini +++ b/assets/lang/lt-LT.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Rašymo į statusą kanalai +Multi-threaded rendering = Multi-threaded rendering Next = Kitas No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = Sistemos informacija Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pauzė +Previous Slot = Previous Slot R = R RapidFire = Greita-"ugnis" Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Animacinis filmas CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT skenavimo linjos +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Išaukštinimas VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Nustatyti "PPSSPP" parametrus į numatytuosius +RetroAchievements = RetroAchievements Rewind Snapshot Interval = "Vėjinti" momentinės nuotraukos dažnį (atminties "rijikas") Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Galima nauja "PPSSPP" versija 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/ms_MY.ini b/assets/lang/ms_MY.ini index bf75fe60c2..76e3207d01 100644 --- a/assets/lang/ms_MY.ini +++ b/assets/lang/ms_MY.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Log Channel +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = Maklumat sistem Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Jeda +Previous Slot = Previous Slot R = R RapidFire = Tembak-Berterusan Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Mekar +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Kartun CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Anti aliasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Penskalaan spline36 VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Kembalikan tetapan PPSSPP ke lalai +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Kekerapan pusingan gambar skrin (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Versi terbaru PPSSPP tersedia 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/nl_NL.ini b/assets/lang/nl_NL.ini index 05ccf32aa3..8e7fb99c71 100644 --- a/assets/lang/nl_NL.ini +++ b/assets/lang/nl_NL.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Overgeslagen framestatistieken vastleggen Log Level = Logniveau Log View = Logboekoverzicht Logging Channels = Logboekkanalen +Multi-threaded rendering = Multi-threaded rendering Next = Volgende No block = Geen blok Prev = Vorige @@ -304,8 +315,8 @@ Stats = Statistieken System Information = Systeeminformatie Texture ini file created = Texture ini file created Texture Replacement = Texturevervanging -Toggle Audio Debug = Foutopsporing voor audio in-/uitschakelen -Toggle Control Debug = Toggle Control Debug +Audio Debug = Foutopsporing voor audio +Control Debug = Control Debug Toggle Freeze = Bevriezen in-/uitschakelen Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Muzieknoot OpenChat = Open chat Pause = Pauzeren +Previous Slot = Previous Slot R = R RapidFire = Snelvuur Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloeieffect +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT-scanlijnen +FakeReflections = FakeReflections FXAA = FXAA-antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36-upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignet @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU-informatie High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Taal/regio Memory Page Size = Grootte geheugenpagina @@ -1239,6 +1255,7 @@ Record Audio = Audio opnemen Record Display = Scherm opnemen Reset Recording on Save/Load State = Opname opnieuw opstarten bij opslaan/laden van states Restore Default Settings = PPSSPP's standaardinstellingen herstellen +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Terugspoelfrequentie (kost geheugen) Save path in installed.txt = Opslagpad in installed.txt Save path in My Documents = Opslagpad in Mijn documenten @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Er is een nieuwe versie van PPSSPP beschikbaar 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/no_NO.ini b/assets/lang/no_NO.ini index 69199fd326..a7b0eefeaa 100644 --- a/assets/lang/no_NO.ini +++ b/assets/lang/no_NO.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -304,8 +315,8 @@ Stats = Stats System Information = Systeminformasjon Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pause +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Restore PPSSPP's settings to default +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = New version of PPSSPP available 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/pl_PL.ini b/assets/lang/pl_PL.ini index a38b7e3077..fb61dded5c 100644 --- a/assets/lang/pl_PL.ini +++ b/assets/lang/pl_PL.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Konto -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Osiągnięcia Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Tryb Wyzwania Challenge Mode (no savestates) = Tryb Wyzwania (bez zapisów stanu) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = Zdobyłeś %d z %d osiągnięć i %d z %d punktów Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = Jak używać RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Tabele wyników Links = Linki Locked achievements = Zablokowane osiągnięcia Log bad memory accesses = Rejestruj złe dostępy do pamięci Mastered %1 = Wymaksowane %1 +Notifications = Notifications Register on www.retroachievements.org = Zarejestruj się na www.retroachievements.org RetroAchievements are not available for this game = Usługa RetroAchievements nie jest dostępna dla tej gry RetroAchievements website = Strona internetowa RetroAchievements @@ -35,6 +44,7 @@ Syncing achievements data... = Synchronizacja osiągnięć... Test Mode = Tryb Testowy This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = Ta gra nie ma osiągnięć +Top players = Top players Unlocked achievements = Odblokowane osiągnięcia Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Loguj statystyki pominiętych klatek Log Level = Poziom dziennika zdarzeń Log View = Pokaż dziennik zdarzeń Logging Channels = Kanały dziennika zdarzeń debugera +Multi-threaded rendering = Multi-threaded rendering Next = Następny No block = Brak bloku Prev = Poprzedni @@ -304,8 +315,8 @@ Stats = Statystyki System Information = Informacje o systemie Texture ini file created = Stworzono plik ini Tekstury Texture Replacement = Podmiana tekstur -Toggle Audio Debug = Wł./Wył. debugowanie audio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Debugowanie audio +Control Debug = Control Debug Toggle Freeze = Wł./Wył. zamrożenie Touchscreen Test = Test ekranu dotykowego VFPU = VFPU @@ -738,6 +749,7 @@ None = Nic Note = Notka OpenChat = Otwórz czat Pause = Pauza +Previous Slot = Previous Slot R = R RapidFire = Auto. strzelanie Record = Nagraj @@ -906,6 +918,7 @@ Animation speed (0 -> disable) = Prędkość animacji (0 -> wył.) Aspect = Proporcje Black border = Black border Bloom = Efekt rozmycia +BloomNoBlur = Bloom (no blur) Brightness = Jasność Cartoon = Komiks CatmullRom = Dwusześcienny (Catmull-Rom) Upscaler @@ -913,6 +926,7 @@ ColorCorrection = Korekcja kolorów ColorPreservation = Zachowanie kolorów Contrast = Kontrast CRT = Imitacja monitora CRT +FakeReflections = FakeReflections FXAA = Wygładzanie FXAA Gamma = Gamma GreenLevel = Poziom zieleni @@ -933,6 +947,7 @@ SSAA(Gauss) = Wygładzanie metodą supersampling (algorytm Gaussa) Strength = Siła Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Skalowanie Spline36 VideoSmoothingAA = Wygładzanie wideo Vignette = Winieta @@ -1136,6 +1151,7 @@ GPU Flags = Flagi GPU GPU Information = Informacje o GPU High precision float range = Zakres l. zmiennoprzecinkowych wys. precyzji High precision int range = Zakres l. całkowitych wys. precyzji +Icon cache = Icon cache JIT available = JIT dostępne Lang/Region = Język/Region Memory Page Size = Rozmiar pamięci stronnicowania @@ -1243,6 +1259,7 @@ Record Audio = Nagrywaj dźwięk Record Display = Nagrywaj obraz Reset Recording on Save/Load State = Resetuj nagrywanie przy zapisie/wczytaniu stanu Restore Default Settings = Przywróć domyślne ustawienia +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Częstotl. zapisu stanów przewijania (wymaga pamięci) Save path in installed.txt = Ścieżka zapisu w installed.txt Save path in My Documents = Ścieżka zapisu w Dokumentach @@ -1313,6 +1330,7 @@ New version of PPSSPP available = Dostępna jest nowa wersja PPSSPP! 6DoF movement = 6DoF movement Camera type = Typ kamery Distance to 2D menus and scenes = Dystans do elemtentów 2D +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Tylko dla ekspertów Field of view scale = Skala pola widzenia Force 72Hz update = Wymuś odświeżanie w 72Hz diff --git a/assets/lang/pt_BR.ini b/assets/lang/pt_BR.ini index a476532e69..8882bbfef0 100644 --- a/assets/lang/pt_BR.ini +++ b/assets/lang/pt_BR.ini @@ -23,44 +23,54 @@ # Happy translating. [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started %d achievements, %d points = %d conquistas, %d pontos +%1: Attempt started = %1: A tentativa começou +%1: Attempt failed = %1: A tentativa falhou Account = Conta -Achievement Unlocked = Achievement Unlocked +Achievement unlocked = Conquistas Destrancadas +Achievement progress = Progresso das Conquistas Achievements = Conquistas -Achievements are disabled = Achievements are disabled -Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now -Challenge Mode = Modo de Desafio -Challenge Mode (no savestates) = Modo de Desafio (sem save states) -Contacting RetroAchievements server... = Contacting RetroAchievements server... -Customize = Customize +Achievements enabled = Conquistas ativadas +Achievements are disabled = As conquistas estão desativadas +Can't log in to RetroAchievements right now = Não consegue logar no RetroAchievements agora +Challenge indicator = Indicador do desafio +Challenge Mode = Modo Desafio +Challenge Mode (no savestates) = Modo Desafio (sem save states) +Contacting RetroAchievements server... = Contactando o servidor do RetroAchievements... +Customize = Personalizar Earned = Você ganhou %d de %d conquistas e %d de %d pontos -Encore Mode = Encore Mode -How to use RetroAchievements = Como usar RetroAchievements -In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below -Leaderboard score submission = Leaderboard score submission +Encore Mode = Modo de Repetição +Failed logging in to RetroAchievements = Falhou em logar no RetroAchievements +How to use RetroAchievements = Como usar os RetroAchievements +In Encore mode - listings may be wrong below = No modo de repetição - As listagens abaixo podem estar erradas +Leaderboard attempt started or failed = A tentativa da tabela de classificação começou ou falhou +Leaderboard result submitted = Resultado submetido a tabela de classificação +Leaderboard score submission = Submissão de pontuações a tabela de classificação Leaderboard submission is enabled = A submissão a tabela de classificação está ativada -Leaderboards = Tabelas de Classificação +Leaderboards = Tabelas de classificação +Leaderboard tracker = Leaderboard tracker Links = Links Locked achievements = Conquistas trancadas Log bad memory accesses = Registrar acessos ruins da memória Mastered %1 = Conquistou o %1 +Around me = Ao redor de mim +Notifications = Notificações Register on www.retroachievements.org = Registrar no www.retroachievements.org RetroAchievements are not available for this game = Os RetroAchievements não estão disponíveis pra este jogo -RetroAchievements website = Site da Web dos RetroAchievements +RetroAchievements website = Site dos RetroAchievements Rich Presence = Presença Rica -Save state loaded without achievement data = Save state loaded without achievement data -Save states not available in Challenge Mode = Save states not available in Challenge Mode +Save states not available in Challenge Mode = Os save states não estão disponíveis no Modo Desafio +Save state loaded without achievement data = O save state foi carregado sem os dados das conquistas Sound Effects = Efeitos de Som Statistics = Estatísticas -Submitted %1 for %2 = Submitted %1 for %2 +Submitted %1 for %2 = Submeteu o %1 pro %2 Syncing achievements data... = Sincronizando os dados das conquistas... Test Mode = Modo Teste -This feature is not available in Challenge Mode = This feature is not available in Challenge Mode +This feature is not available in Challenge Mode = Esta função não está disponível no Modo Desafio This game has no achievements = Este jogo não tem conquistas +Top players = Os melhores jogadores Unlocked achievements = Conquistas destrancadas -Unofficial achievements = Unofficial achievements +Unofficial = Não oficial [Audio] Alternate speed volume = Velocidade alternativa do volume @@ -82,7 +92,7 @@ Use global volume = Usar volume global WASAPI (fast) = WASAPI (rápido) [Controls] -Analog Binding = Ligação com o Analógico +Analog Binding = Associação com o Analógico Analog Limiter = Limitador do analógico Analog Settings = Configurações do Analógico Analog Stick = Direcional analógico @@ -92,8 +102,8 @@ Auto = Automático Auto-centering analog stick = Auto-centralizar o direcional analógico Auto-hide buttons after delay = Auto-esconder os botões após um atraso de Auto-rotation speed = Velocidade da auto-rotação -Binds = Vinculados -Button Binding = Vinculação dos botões +Binds = Associações +Button Binding = Associação com os botões Button Opacity = Opacidade dos botões Button style = Estilo do botão Calibrate Analog Stick = Calibrar Direcional Analógico @@ -144,7 +154,7 @@ OnScreen = Controles do toque na tela Portrait = Retrato Portrait Reversed = Retrato invertido PSP Action Buttons = Botões de ação do PSP -Rapid fire interval = Rapid fire interval +Rapid fire interval = Intervalo do fogo rápido Raw input = Entrada natural dos dados Reset to defaults = Resetar para os padrões Screen Rotation = Rotação da tela @@ -309,6 +319,7 @@ Log Dropped Frame Statistics = Registrar as estatísticas da queda dos frames Log Level = Nível do registro Log View = Visualização do registro Logging Channels = Canais do registro +Multi-threaded rendering = Renderização multi-threads Next = Próximo No block = Nenhum bloco Prev = Anterior @@ -328,8 +339,8 @@ Stats = Estatísticas System Information = Informação do sistema Texture ini file created = Arquivo ini da textura criado Texture Replacement = Substituição das texturas -Toggle Audio Debug = Alternar debug do áudio -Toggle Control Debug = Alternar Debug do Controle +Audio Debug = Debug do áudio +Control Debug = Debug do Controle Toggle Freeze = Alternar congelamento Touchscreen Test = Teste do Touchscreen VFPU = VFPU @@ -339,16 +350,16 @@ VFPU = VFPU * PSP res = * Resolução do PSP Active = Ativo Back = Voltar -Bottom Center = Centro do rodapé +Bottom Center = No centro do rodapé Bottom Left = A esquerda do rodapé Bottom Right = A direita do rodapé Cancel = Cancelar Center = Centro -Center Left = Centralizar a esquerda -Center Right = Centralizar a direita -Changing this setting requires PPSSPP to restart. = A alteração dessa configuração requer a reinicialização do PPSSPP. -Channel: = Canal: -Choose PPSSPP save folder = Escolha a pasta dos saves do PPSSPP +Center Left = A esquerda do centro +Center Right = A direita do centro +Channel: = Canaal: +Changing this setting requires PPSSPP to restart. = Mudar esta configuração requer que o PPSSPP reinicie. +Choose PPSSPP save folder = Escolha a pasta de salvamento do PPSSPP Confirm Overwrite = Você quer sobrescrever os dados? Confirm Save = Você quer salvar estes dados? ConfirmLoad = Carregar estes dados? @@ -372,8 +383,8 @@ Edit = Editar Enable All = Ativar tudo Enabled = Ativado Enter = Inserir -Failed to connect to server, check your internet connection. = Failed to connect to server, check your internet connection. -Failed to log in, check your username and password. = Failed to log in, check your username and password. +Failed to log in, check your username and password. = Falhou em logar, verifique seu nome de usuário e senha. +Failed to connect to server, check your internet connection. = Falhou em conectar ao servidor, verifique sua conexão com a internet. Filter = Filtro Finish = Concluir GE Frame Dumps = Dumps do Frame do GE @@ -386,8 +397,8 @@ Loading = Carregando\nPor favor espere... LoadingFailed = Incapaz de carregar os dados. Log in = Logar Log out = Sair -Logged in! = Logged in! -Logging in... = Logging in... +Logging in... = Logando... +Logged in! = Logado! Move = Mover Move Up = Mover pra Cima Move Down = Mover pra Baixo @@ -423,9 +434,9 @@ Supported = Suportado There is no data = Não há dados. Toggle All = Alternar todos Toggle List = Alternar lista -Top Center = Centro superior -Top Left = Superior esquerdo -Top Right = Superior direito +Unsupported = Não suportado +Top Left = A esquerda do topo +Top Right = A direita do topo Unsupported = Não suportado Username = Nome de usuário When you save, it will load on a PSP, but not an older PPSSPP = Quando você salvar ele carregará num PSP mas não num PPSSPP mais antigo @@ -576,7 +587,7 @@ Direct3D 11 = Direct3D 11 Disabled = Desativado Display Layout && Effects = Exibir esquema && efeitos Display Resolution (HW scaler) = Resolução da tela (Dimensionador do hardware) -Enable Cardboard VR = Ativa o VR Cardboard +Enable Cardboard VR = Ativa o cartaz da realidade virtual FPS = FPS Frame Rate Control = Controle da taxa dos frames Frame Skipping = Pulo dos frames @@ -590,7 +601,7 @@ hardware transform error - falling back to software = Erro de transformação pe HardwareTessellation Tip = Usa o hardware pra fazer as curvas High = Alta Hybrid = Híbrido -Hybrid + Bicubic = Híbrido + Bi-cúbico +Hybrid + Bicubic = Híbrido + bi-cúbico Ignore camera notch when centering = Ignora o nível da câmera quando centralizar Integer scale factor = Fator de escala do inteiro Internal Resolution = Resolução interna @@ -642,7 +653,7 @@ Stereo rendering = Renderização do estéreo Stretch = Esticar Texture Filter = Filtragem das texturas Texture Filtering = Filtragem das texturas -Texture replacement pack activated = Texture replacement pack activated +Texture replacement pack activated = Pacote de substituição das texturas ativado Texture Scaling = Dimensionamento das texturas Texture Shader = Shader das texturas Turn off Hardware Tessellation - unsupported = Desliga a "Tesselação por hardware": não suportado. @@ -671,12 +682,12 @@ Zip archive corrupt = Arquivo ZIP corrompido Zip file does not contain PSP software = O arquivo ZIP não contém software do PSP [KeyMapping] -Allow combo mappings = Allow combo mappings +Allow combo mappings = Permitir os mapeamentos dos combos Autoconfigure = Auto-configurar Autoconfigure for device = Auto-configurar pro dispositivo -Bind All = Vincular tudo +Bind All = Associar tudo Clear All = Limpar tudo -Combo mappings are not enabled = Combo mappings are not enabled +Combo mappings are not enabled = Os mapeamentos dos combos não estão ativados Default All = Restaurar os padrões Map a new key for = Mapear uma nova tecla pra Map Key = Mapear tecla @@ -754,6 +765,7 @@ None = Nenhum Note = Nota OpenChat = Abrir o bate-papo Pause = Pausar +Previous Slot = Slot anterior R = R RapidFire = Fogo rápido Record = Gravar @@ -796,7 +808,7 @@ Display Portrait Reversed = Exibir Retrato Revertido [Networking] AdHoc Server = Servidor Ad-hoc -AdhocServer Failed to Bind Port = O servidor Ad-hoc falhou em se conectar a porta +AdhocServer Failed to Bind Port = O servidor Ad-hoc falhou em se associar com a porta AM: Data from Unknown Port = AM: Dados de uma Porta Desconhecida Auto = Auto Change Mac Address = Mudar o endereço do MAC @@ -822,8 +834,8 @@ Enter Quick Chat 3 = Entrar no bate-papo rápido 3 Enter Quick Chat 4 = Entrar no bate-papo rápido 4 Enter Quick Chat 5 = Entrar no bate-papo rápido 5 Error = Erro -Failed to Bind Localhost IP = Falhou em conectar ao IP do hospedeiro local -Failed to Bind Port = Falhou em conectar a porta +Failed to Bind Localhost IP = Falhou em associar com o IP do hospedeiro local +Failed to Bind Port = Falhou em associar com a porta Failed to connect to Adhoc Server = Falhou em conectar ao servidor ad hoc Forced First Connect = Primeira conexão forçada (conexão mais rápida) GM: Data from Unknown Port = GM: Dados da Porta Desconhecida @@ -842,7 +854,7 @@ Quick Chat 3 = Bate-papo rápido 3 Quick Chat 4 = Bate-papo rápido 4 Quick Chat 5 = Bate-papo rápido 5 QuickChat = Bate-papo rápido -Randomize = Randomize +Randomize = Tornar aleatório Send = Enviar Send Discord Presence information = Enviar informação da "Presença Rica" no Discord Unable to find UPnP device = Incapaz de achar o dispositivo UPnP @@ -854,23 +866,6 @@ Validating address... = Validando endereço... WLAN Channel = Canal do WLAN You're in Offline Mode, go to lobby or online hall = Você está no modo offline, vá pro lobby ou pro salão online -[PSPSettings] -Auto = Auto -Chinese (simplified) = Chinese (simplified) -Chinese (traditional) = Chinese (traditional) -Dutch = Dutch -English = English -French = French -Game language = Game language -German = German -Italian = Italian -Japanese = Japanese -Korean = Korean -Games often don't support all languages = Games often don't support all languages -Portuguese = Portuguese -Russian = Russian -Spanish = Spanish - [Pause] Cheats = Trapaças Continue = Continuar @@ -891,11 +886,12 @@ Undo last save = Desfazer o último salvamento 4xHqGLSL = Ampliador da arte dos pixels 4×HQ 5xBR = Ampliador da arte dos pixels 5xBR 5xBR-lv2 = Ampliador da arte dos pixels 5xBR-lv2 -AAColor = Cores-do-AA +AAColor = Cores do AA Amount = Quantidade Aspect = Aspecto Black border = Borda preta Bloom = Bloom +BloomNoBlur = Bloom (sem desfoque) Brightness = Brilho Cartoon = Cartoon ColorCorrection = Correção das cores @@ -905,6 +901,7 @@ CRT = Scanlines do CRT FXAA = Anti-aliasing do FXAA Gamma = Gama GreenLevel = Nível verde +FakeReflections = Reflexos falsos Intensity = Intensidade LCDPersistence = Persistência do LCD Natural = Cores naturais @@ -921,12 +918,13 @@ SSAA(Gauss) = Super-amostragem do AA (Gauss) Strength = Força Tex4xBRZ = 4xBRZ TexMMPX = MMPX -UpscaleSpline36 = Ampliador Spline36 +UpscaleBicubic = Ampliador bi-cúbico +UpscaleSpline36 = Ampliador spline36 VideoSmoothingAA = Suavização de vídeo do AA Vignette = Vinheta Animation speed (0 -> disable) = Velocidade da animação (0 -> desativar) -CatmullRom = Ampliador Bi-cúbico (Catmull-Rom) -MitchellNetravali = Ampliador Bi-cúbico (Mitchell-Netravali) +CatmullRom = Ampliador bi-cúbico (Catmull-Rom) +MitchellNetravali = Ampliador bi-cúbico (Mitchell-Netravali) [PSPCredits] all the forum mods = Todos os moderadores do fórum @@ -997,6 +995,23 @@ Use PSP folder at root of storage = Use a pasta do PSP na raiz da armazenagem Welcome to PPSSPP! = Bem-vindo ao PPSSPP! WhatsThis = O que é isto? +[PSPSettings] +Auto = Auto +Chinese (simplified) = Chinês (simplificado) +Chinese (traditional) = Chinês (tradicional) +Dutch = Holandês +English = Inglês +French = Francês +Game language = Idioma do jogo +German = Alemão +Italian = Italiano +Japanese = Japonês +Korean = Coreano +Games often don't support all languages = Os jogos frequentemente não suportam todos os idiomas +Portuguese = Português +Russian = Russo +Spanish = Espanhol + [RemoteISO] Browse Games = Procurar jogos Local Server Port = Porta do servidor local @@ -1147,6 +1162,7 @@ GPU Flags = Bandeira da GPU GPU Information = Informações da GPU High precision float range = Alcance do flutuante de alta precisão High precision int range = Alcance do inteiro de alta precisão +Icon cache = Cache do ícone JIT available = JIT disponível Lang/Region = Idioma/Região Memory Page Size = Tamanho da página de memória @@ -1253,6 +1269,7 @@ Record Audio = Gravar áudio Record Display = Gravar tela Reset Recording on Save/Load State = Resetar a gravação ao salvar/carregar o state Restore Default Settings = Restaurar as configurações do PPSSPP para os padrões +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Retroceder a frequência dos snapshots (consome muita memória) Save path in installed.txt = Caminho do save em installed.txt Save path in My Documents = Caminho do save em Meus Documentos @@ -1333,6 +1350,7 @@ Screen representation = Representação da tela % of native FoV = % do campo de visão nativo 6DoF movement = Movimentação do 6DoF Distance to 2D menus and scenes = Distância até os menus e cenas 2D +Distance to 3D scenes when VR disabled = Distância nas cenas em 3D quando a realidade virtual está desativada Experts only = Só pra experts Game camera rotation step per frame = Passo da rotação da câmera do jogo por frame Game camera uses rotation smoothing = A câmera do jogo usa suavização da rotação diff --git a/assets/lang/pt_PT.ini b/assets/lang/pt_PT.ini index 1f9da3e337..738459a36b 100644 --- a/assets/lang/pt_PT.ini +++ b/assets/lang/pt_PT.ini @@ -23,29 +23,38 @@ # Happy translating. [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -59,6 +68,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -309,6 +319,7 @@ Log Dropped Frame Statistics = Guardar no log as estátisticas da queda dos quad Log Level = Nível do log Log View = Visualização do log Logging Channels = Canais do log +Multi-threaded rendering = Multi-threaded rendering Next = Próximo No block = Nenhum bloco Prev = Anterior @@ -328,8 +339,8 @@ Stats = Estatísticas System Information = Informação do sistema Texture ini file created = Ficheiro .ini da textura criado com sucesso Texture Replacement = Substituição das texturas -Toggle Audio Debug = Alternar depuração do áudio -Toggle Control Debug = Toggle Control Debug +Audio Debug = Depuração do áudio +Control Debug = Control Debug Toggle Freeze = Alternar congelamento Touchscreen Test = Teste do Touchscreen VFPU = VFPU @@ -754,6 +765,7 @@ None = Nenhum Note = Nota OpenChat = Abrir o bate-papo Pause = Pausar +Previous Slot = Previous Slot R = R RapidFire = Fogo rápido Record = Gravar @@ -896,12 +908,14 @@ Amount = Quantidade Aspect = Aspect Black border = Borda preta Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brilho Cartoon = Estilo Cartoon ColorCorrection = Correção das cores ColorPreservation = Color preservation Contrast = Contraste CRT = Scanlines do CRT +FakeReflections = FakeReflections FXAA = Anti-aliasing do FXAA Gamma = Gama GreenLevel = Green level @@ -921,6 +935,7 @@ SSAA(Gauss) = Super-amostragem do AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Ampliador Spline36 VideoSmoothingAA = Suavização de vídeo do AA Vignette = Vinheta @@ -1148,6 +1163,7 @@ GPU Flags = GPU Flags GPU Information = Informações da GPU High precision float range = Alcance do flutuante de alta precisão High precision int range = Alcance do inteiro de alta precisão +Icon cache = Icon cache JIT available = JIT available Lang/Region = Idioma/Região Memory Page Size = Tamanho da página de memória @@ -1254,6 +1270,7 @@ Record Audio = Gravar áudio Record Display = Gravar tela Reset Recording on Save/Load State = Reiniciar a gravação ao salvar/carregar o estado Restore Default Settings = Restaurar as Definições do PPSSPP para os padrões +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rebobinar frequência dos snapshots (consome memória) Save path in installed.txt = Caminho do save em installed.txt Save path in My Documents = Caminho do save em Meus Documentos @@ -1335,6 +1352,7 @@ Screen representation = Representação da tela 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/ro_RO.ini b/assets/lang/ro_RO.ini index 8355f16c1b..ff87d93a56 100644 --- a/assets/lang/ro_RO.ini +++ b/assets/lang/ro_RO.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -286,6 +296,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Log level Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Next No block = No block Prev = Previous @@ -305,8 +316,8 @@ Stats = Stats System Information = System information Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -735,6 +746,7 @@ None = None Note = Note OpenChat = Open chat Pause = Pauză +Previous Slot = Previous Slot R = R RapidFire = Foc-rapid Record = Record @@ -903,6 +915,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -910,6 +923,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -930,6 +944,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1133,6 +1148,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1240,6 +1256,7 @@ Record Audio = Record audio Record Display = Record display Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Adu la setări PPSSPP inițiale +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1310,6 +1327,7 @@ New version of PPSSPP available = Nouă versiune de PPSSPP disponibilă. 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/ru_RU.ini b/assets/lang/ru_RU.ini index 1f656a96d1..326e75b3fb 100644 --- a/assets/lang/ru_RU.ini +++ b/assets/lang/ru_RU.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Логировать статистику про Log Level = Уровень отладки Log View = Отображение логов Logging Channels = Параметры логирования +Multi-threaded rendering = Multi-threaded rendering Next = Следующий No block = Нет блока Prev = Предыдущий @@ -304,8 +315,8 @@ Stats = Статистика System Information = Информация о системе Texture ini file created = Создан файл textures.ini Texture Replacement = Подмена текстур -Toggle Audio Debug = Включить/выключить отладку аудио -Toggle Control Debug = Включить/выключить отладку управления +Audio Debug = отладку аудио +Control Debug = отладку управления Toggle Freeze = Запустить/остановить Touchscreen Test = Тест сенсорного экрана VFPU = VFPU @@ -734,6 +745,7 @@ None = Нет Note = Нота OpenChat = Открыть чат Pause = Пауза +Previous Slot = Previous Slot R = R RapidFire = Турбо кнопка Record = Запись @@ -873,6 +885,7 @@ Animation speed (0 -> disable) = Скорость анимации (0 -> disable Aspect = Соотношение Black border = Черные рамки Bloom = Свечение +BloomNoBlur = Bloom (no blur) Brightness = Яркость Cartoon = Мультипликация CatmullRom = Бикубический (Catmull-Rom) апскейлер @@ -880,6 +893,7 @@ ColorCorrection = Цветокоррекция ColorPreservation = Сохранение цвета Contrast = Контрастность CRT = ЭЛТ-развертка +FakeReflections = FakeReflections FXAA = Сглаживание FXAA Gamma = Гамма GreenLevel = Green level @@ -900,6 +914,7 @@ SSAA(Gauss) = SSAA (Гаусс) Strength = Сила Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Масштабирование Spline36 VideoSmoothingAA = Сглаживание видео Vignette = Виньетирование @@ -1132,6 +1147,7 @@ GPU Flags = Флаги ГП GPU Information = Информация о ГП High precision float range = Диапазон точных дробных чисел High precision int range = Диапазон точных целых чисел +Icon cache = Icon cache JIT available = JIT доступен Lang/Region = Язык/регион Memory Page Size = Размер страницы памяти @@ -1239,6 +1255,7 @@ Record Audio = Запись звука Record Display = Запись видео Reset Recording on Save/Load State = Сбрасывать запись при сохранении/загрузке Restore Default Settings = Сбросить настройки PPSSPP +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Частота сохранения состояний Save path in installed.txt = Путь до сохранений в installed.txt Save path in My Documents = Путь до сохранений в "Мои документы" @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Доступна новая версия PPSSP 6DoF movement = Движение 6DoF Camera type = Тип камеры Distance to 2D menus and scenes = Расстояние до 2D-меню и сцен +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Только для экспертов Field of view scale = Масштаб угла обзора Force 72Hz update = Принудительная частота обновления 72 Гц diff --git a/assets/lang/sv_SE.ini b/assets/lang/sv_SE.ini index 6a03562234..a474bd6487 100644 --- a/assets/lang/sv_SE.ini +++ b/assets/lang/sv_SE.ini @@ -1,27 +1,36 @@ [Achievements] %d achievements, %d points = %d achievements, %d poäng -%1: Leaderboard attempt started = %1: Topplisteförsök startat -%1: Leaderboard attempt failed = %1: Topplisteförsök misslyckades +%1: Attempt started = %1: Topplisteförsök startat +%1: Attempt failed = %1: Topplisteförsök misslyckades Account = Inloggning -Achievement Unlocked = Achievement avklarat! +Achievement progress = Achievement progress +Achievement unlocked = Achievement avklarat! Achievements = Achievements Achievements are disabled = Achievements är avstängda +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Utmanings-läge Challenge Mode (no savestates) = Utmanings-läge (inga sparade state) Contacting RetroAchievements server... = Contacting RetroAchievements server... -Customize = Inställningar +Customize = Anpassa Earned = Du har tjänat %d av %d achievements, och %d of %d poäng Encore Mode = Encore-läge (kan ta achievements igen) +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = Hur man använder RetroAchievements In Encore mode - listings may be wrong below = I Encore-läge - saker kan visas fel nedan +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Skickar in poäng till ledartabeller +Leaderboard tracker = Leaderboard tracker Leaderboards = Topplistor Links = Länkar Locked achievements = Låsta achievements Log bad memory accesses = Logga felaktiga minnesåtkomster Mastered %1 = Klarade av %1! +Notifications = Notifications Register on www.retroachievements.org = Registrera på www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements finns inte tillgängliga för detta spel RetroAchievements website = RetroAchievements webbsida @@ -35,6 +44,7 @@ Syncing achievements data... = Synkar achievementdata... Test Mode = Test-läge This feature is not available in Challenge Mode = Denna feature är inte tillgänglig i utmaningsläge This game has no achievements = Detta spel har inga achievements +Top players = Top players Unlocked achievements = Upplåsta achievements Unofficial achievements = Inofficiella achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Loggnivå Log View = Log view Logging Channels = Loggkanaler +Multi-threaded rendering = Multi-threaded rendering Next = Nästa No block = Inget block Prev = Föregående @@ -304,8 +315,8 @@ Stats = Stats System Information = Systeminformation Texture ini file created = Texture ini file created Texture Replacement = Ersätt texturer -Toggle Audio Debug = Toggla audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio debug +Control Debug = Control Debug Toggle Freeze = Toggla freeze Touchscreen Test = Touchskärm-test VFPU = VFPU @@ -735,6 +746,7 @@ None = None Note = Not OpenChat = Öppna chat Pause = Paus +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Spela in @@ -857,6 +869,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Svart kant Bloom = Bloom-effekt +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -864,6 +877,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Gamma = Gamma GreenLevel = Grön-nivå @@ -884,6 +898,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Styrka Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = UpscaleSpline36 VideoSmoothingAA = VideoSmoothingAA Vignette = Vignett @@ -1133,6 +1148,7 @@ GPU Flags = GPU Flags GPU Information = GPU-information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1240,6 +1256,7 @@ Record Audio = Spela in audio till fil Record Display = Spela in video till fil Reset Recording on Save/Load State = Reset recording on Save/Load state Restore Default Settings = Återställ standard-inställningar +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = Sparkatalog från installed.txt Save path in My Documents = Sparkatalog i Dokument @@ -1310,6 +1327,7 @@ New version of PPSSPP available = Ny version av PPSSPP tillgänglig 6DoF movement = 6DoF rörelse Camera type = Kameratyp Distance to 2D menus and scenes = Avstånd till 2D-menyer och scener +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view-skala Force 72Hz update = Tvinga 72Hz uppdateringsfrekvens diff --git a/assets/lang/tg_PH.ini b/assets/lang/tg_PH.ini index ff72bcf87e..79607da054 100644 --- a/assets/lang/tg_PH.ini +++ b/assets/lang/tg_PH.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Log dropped frame statistics Log Level = Level ng Log Log View = Log view Logging Channels = Logging channels +Multi-threaded rendering = Multi-threaded rendering Next = Susunod No block = No block Prev = Nagdaan @@ -304,8 +315,8 @@ Stats = Stats System Information = Impormasyon tungkol sa system Texture ini file created = Texture ini file created Texture Replacement = Texture replacement -Toggle Audio Debug = Toggle audio debug -Toggle Control Debug = Toggle Control Debug +Audio Debug = Audio Debug +Control Debug = Control Debug Toggle Freeze = Toggle freeze Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Note OpenChat = Open chat Pause = Hinto +Previous Slot = Previous Slot R = R RapidFire = RapidFire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Cartoon CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT scanlines +FakeReflections = FakeReflections FXAA = FXAA Antialiasing Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Supersampling AA (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Upscaler VideoSmoothingAA = VideoSmoothingAA Vignette = Vignette @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = GPU information High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Lang/Region Memory Page Size = Memory page size @@ -1239,6 +1255,7 @@ Record Audio = I-record ang Audio Record Display = I-record ang Display Reset Recording on Save/Load State = Reset Recording on Save/Load state Restore Default Settings = Ibalik ang settings sa dati nitong ayos +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Rewind Snapshot Interval (mem hog) Save path in installed.txt = I-save sa direksyon na installed.txt Save path in My Documents = I-save sa direksyon na "Aking Dokumento" @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Meron nang bagong bersiyon ang PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/th_TH.ini b/assets/lang/th_TH.ini index b91f659068..2dd1504bf5 100644 --- a/assets/lang/th_TH.ini +++ b/assets/lang/th_TH.ini @@ -1,13 +1,16 @@ [Achievements] -%1: Leaderboard attempt failed = %1: ส่งข้อมูลไปยังกระดานแต้มผู้นำล้มเหลว -%1: Leaderboard attempt started = %1: เริ่มการส่งข้อมูลไปยังกระดานแต้มผู้นำแล้ว +%1: Attempt failed = %1: ส่งข้อมูลไปยังกระดานแต้มผู้นำล้มเหลว +%1: Attempt started = %1: เริ่มการส่งข้อมูลไปยังกระดานแต้มผู้นำแล้ว %d achievements, %d points = %d เป้าหมายความสำเร็จ, %d แต้ม Account = บัญชีผู้ใช้งาน +Achievement progress = Achievement progress Achievement unlocked = ตอนเป้าหมายความสำเร็จถูกปลดล็อค Achievements = เป้าหมายความสำเร็จ Achievements enabled = เปิดใช้งาน เป้าหมายความสำเร็จ Achievements are disabled = ปิดใช้งาน เป้าหมายความสำเร็จ +Around me = Around me Can't log in to RetroAchievements right now = ไม่สามารถล็อกอินเข้าไปยัง RetroAchievements ได้ในขณะนี้ +Challenge indicator = Challenge indicator Challenge Mode = โหมดท้าทาย Challenge Mode (no savestates) = โหมดท้าทาย (ไม่มีเซฟสเตท) Contacting RetroAchievements server... = กำลังเชื่อมต่อกับเซิร์ฟเวอร์ RetroAchievements... @@ -17,22 +20,23 @@ Encore Mode = โหมดคำราม Failed logging in to RetroAchievements = ล้มเหลวในการเข้าใช้งานไปยัง RetroAchievements How to use RetroAchievements = วิธีใช้งาน RetroAchievements In Encore mode - listings may be wrong below = ในโหมดคำราม - รายชื่อด้านล่างอาจจะผิด +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = ตอนส่งคะแนนไปยังกระดานแต้มผู้นำ Leaderboard submission is enabled = เปิดใช้งานการส่งคะแนนไปยังกระดานแต้มผู้นำ +Leaderboard tracker = Leaderboard tracker Leaderboards = กระดานแต้มผู้นำ Links = ลิงก์ Locked achievements = เป้าหมายความสำเร็จที่ยังถูกล็อคเอาไว้ Log bad memory accesses = เก็บค่าการเข้าถึงหน่วยความจำที่ไม่ดี -Log in = เข้าใช้งาน Mastered %1 = เชี่ยวชาญ %1 +Notifications = Notifications Register on www.retroachievements.org = สมัครได้ที่ www.retroachievements.org RetroAchievements are not available for this game = ไม่สามารถใช้งาน RetroAchievements กับเกมนี้ได้ RetroAchievements website = เว็บไซต์ RetroAchievements Rich Presence = Rich Presence Save state loaded without achievement data = โหลดเซฟสเตทแล้วโดยที่ไม่มีข้อมูลเป้าหมายความสำเร็จ Save states not available in Challenge Mode = ไม่สามารถใช้งานเซฟสเตทได้ในโหมดท้าทาย -Settings = การตั้งค่า -Sound effects = เสียงเอฟเฟ็คท์ Sound Effects = เสียงเอฟเฟ็คท์ Statistics = สถิติ Submitted %1 for %2 = ส่ง %1 สำหรับ %2 @@ -40,9 +44,9 @@ Syncing achievements data... = กำลังซิงก์ข้อมูล Test Mode = โหมดทดสอบ This feature is not available in Challenge Mode = ฟีเจอร์นี้ไม่สามารถปรับใช้งานได้ในโหมดท้าทาย This game has no achievements = เกมนี้ไม่มีเป้าหมายความสำเร็จ +Top players = Top players Unlocked achievements = เป้าหมายความสำเร็จที่ถูกปลดล็อคแล้ว Unofficial achievements = เป้าหมายความสำเร็จอย่างไม่เป็นทางการ -Username = ชื่อผู้ใช้งาน [Audio] Alternate speed volume = ระดับเสียงในโหมดเร่งความเร็ว @@ -311,8 +315,8 @@ Stats = สถิติ System Information = ข้อมูลโดยรวมของระบบ Texture ini file created = ไฟล์ Texture.ini ได้ถูกสร้างแล้ว Texture Replacement = การแทนที่พื้นผิว -Toggle Audio Debug = แก้ไขจุดบกพร่องของเสียง -Toggle Control Debug = แก้ไขจุดบกพร่องการควบคุม +Audio Debug = แก้ไขจุดบกพร่องของเสียง +Control Debug = แก้ไขจุดบกพร่องการควบคุม Toggle Freeze = ปุ่มแช่แข็ง Touchscreen Test = ทดสอบหน้าจอสัมผัส VFPU = VFPU @@ -885,7 +889,6 @@ Russian = รัสเซีย Spanish = สเปน [Pause] -Achievements = เป้าหมายความสำเร็จ Cheats = สูตรโกง Continue = ดำเนินการต่อ Create Game Config = สร้างการตั้งค่าเฉพาะเกม @@ -914,16 +917,18 @@ Bloom = ภาพสว่างขึ้น BloomNoBlur = ภาพสว่างขึ้น (ไม่เบลอ) Brightness = แสงสว่าง Cartoon = ภาพออกแนวการ์ตูน +CatmullRom = Bicubic (Catmull-Rom) Upscaler ColorCorrection = ภาพสีสมจริง ColorPreservation = การเก็บรักษาสีเดิม Contrast = ความคมชัด CRT = ภาพออกโทนเหลืองขึ้นเส้น -FakeReclections = ภาพเงาสะท้อนลวงตา +FakeReflections = ภาพเงาสะท้อนลวงตา FXAA = ภาพเน้นลบขอบรอยหยัก Gamma = แกมม่า GreenLevel = ระดับสีเขียว Intensity = ความเข้มของแสง LCDPersistence = ภาพ LCD แบบค้างคา +MitchellNetravali = Bicubic (Mitchell-Netravali) Upscaler Natural = ภาพเน้นสีธรรมชาติ NaturalA = ภาพเน้นสีธรรมชาติ (ไม่เบลอ) Off = ปิด diff --git a/assets/lang/tr_TR.ini b/assets/lang/tr_TR.ini index f880929e75..192fd02065 100644 --- a/assets/lang/tr_TR.ini +++ b/assets/lang/tr_TR.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -287,6 +297,7 @@ Log Dropped Frame Statistics = Düşen kare istatistiklerini günlüğe kaydet Log Level = Günlük seviyesi Log View = Günlük görünümü Logging Channels = Günlük kanalları +Multi-threaded rendering = Multi-threaded rendering Next = Sonraki No block = No block Prev = Önceki @@ -306,8 +317,8 @@ Stats = İstatistikler System Information = Sistem bilgisi Texture ini file created = Texture ini file created Texture Replacement = Doku değiştirme -Toggle Audio Debug = Ses hata ayıklamasını Aç/Kapat -Toggle Control Debug = Toggle Control Debug +Audio Debug = Ses hata ayıklamasını +Control Debug = Control Debug Toggle Freeze = Donmayı Aç/Kapa Touchscreen Test = Dokunmatik ekran testi VFPU = VFPU @@ -736,6 +747,7 @@ None = Hiçbiri Note = Not OpenChat = Chat'i Aç Pause = PPSSPP Menüsü +Previous Slot = Previous Slot R = R RapidFire = Seri Ateş Record = Record @@ -903,6 +915,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Siyah çerçeve Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Parlaklık Cartoon = Çizgi film CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -910,6 +923,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Karşıtlık CRT = CRT tarama çizgileri +FakeReflections = FakeReflections FXAA = FXAA Kenar Yumuşatma Gamma = Gamma GreenLevel = Green level @@ -930,6 +944,7 @@ SSAA(Gauss) = Süper örneklemeli Kenar Yumuşatma (Gauss) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Yeniden Ölçeklendirici VideoSmoothingAA = VideoSmoothingAA Vignette = Vinyet @@ -1133,6 +1148,7 @@ GPU Flags = GPU Flags GPU Information = GPU bilgisi High precision float range = High precision float range High precision int range = High precision int range +Icon cache = Icon cache JIT available = JIT available Lang/Region = Dil/Bölge Memory Page Size = Bellek sayfa boyutu @@ -1240,6 +1256,7 @@ Record Audio = Sesi kaydet Record Display = Görüntüyü kaydet Reset Recording on Save/Load State = Kaydet/Yükle durumunda kaydı sıfırla Restore Default Settings = Varsayılan ayarları yükle +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Geri sarma görüntüsü sıklığı (mem hog) Save path in installed.txt = Yolu installed.txt'ye kaydet Save path in My Documents = Dosyaları "Belgeler"'e kaydet @@ -1310,6 +1327,7 @@ New version of PPSSPP available = PPSSPP'nin yeni versiyonu mevcut 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/uk_UA.ini b/assets/lang/uk_UA.ini index 0f77d1cbc1..368c98336c 100644 --- a/assets/lang/uk_UA.ini +++ b/assets/lang/uk_UA.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Лог статистики пропущених Log Level = Лог рівня Log View = Лог виду Logging Channels = Параметри логування +Multi-threaded rendering = Multi-threaded rendering Next = Наступний No block = Немає блоку Prev = Попередній @@ -304,8 +315,8 @@ Stats = Статистика System Information = Інформація про систему Texture ini file created = Texture ini file created Texture Replacement = Заміна текстур -Toggle Audio Debug = Ввімкнути/Вимкнути налагодження аудіо -Toggle Control Debug = Toggle Control Debug +Audio Debug = Налагодження аудіо +Control Debug = Control Debug Toggle Freeze = Запустити/Зупинити Touchscreen Test = Тест сенсорного екрану VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Примітка OpenChat = Відкритий чат Pause = Пауза +Previous Slot = Previous Slot R = R RapidFire = Турбо кнопка Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Bloom +BloomNoBlur = Bloom (no blur) Brightness = Яскравість Cartoon = Мультиплікація CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Корекція кольорів ColorPreservation = Color preservation Contrast = Контраст CRT = Кінескоп 1 +FakeReflections = FakeReflections FXAA = FXAA згладжування Gamma = Гамма GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = SSAA (Гаусс) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Високоякісний Spline36 VideoSmoothingAA = Згладжування відео (VSAA) Vignette = Віньєтка @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = Інформація про GPU High precision float range = High precision float range High precision int range = Внутрішній діапазон високої точності +Icon cache = Icon cache JIT available = JIT available Lang/Region = Мова/Регіон Memory Page Size = Розмір сторінки пам'яті @@ -1239,6 +1255,7 @@ Record Audio = Запис аудіо Record Display = Запис відео Reset Recording on Save/Load State = Скидати запис при збереженні / завантаженні Restore Default Settings = Скинути налаштування +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Змінити частоту кадрів (багато пам'яті) Save path in installed.txt = Шлях до збережень в installed.txt Save path in My Documents = Шлях до збережень в Моїх документах @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Доступна нова версія PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/vi_VN.ini b/assets/lang/vi_VN.ini index fd8c4f06ec..8a304d934d 100644 --- a/assets/lang/vi_VN.ini +++ b/assets/lang/vi_VN.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d achievements, %d points Account = Account -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = Achievements Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = Challenge Mode Challenge Mode (no savestates) = Challenge Mode (no savestates) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = You have earned %d of %d achievements, and %d of %d points Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = How to use RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = Leaderboard submission is enabled +Leaderboard tracker = Leaderboard tracker Leaderboards = Leaderboards Links = Links Locked achievements = Locked achievements Log bad memory accesses = Log bad memory accesses Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = Register on www.retroachievements.org RetroAchievements are not available for this game = RetroAchievements are not available for this game RetroAchievements website = RetroAchievements website @@ -35,6 +44,7 @@ Syncing achievements data... = Syncing achievements data... Test Mode = Test Mode This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = This game has no achievements +Top players = Top players Unlocked achievements = Unlocked achievements Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = Khung nhật ký thống kê Log Level = Cấp nhật ký Log View = Xem nhật ký Logging Channels = Kênh nhật ký +Multi-threaded rendering = Multi-threaded rendering Next = Tiếp tục No block = không chặn Prev = Trở lại @@ -304,8 +315,8 @@ Stats = Thống kê System Information = Thông tin hệ thống Texture ini file created = Texture ini file created Texture Replacement = Thay thế Texture -Toggle Audio Debug = Chuyển qua chế độ debug âm thanh -Toggle Control Debug = Toggle Control Debug +Audio Debug = Chế độ gỡ lỗi âm thanh +Control Debug = Control Debug Toggle Freeze = Chuyển qua chế độ đóng băng Touchscreen Test = Touchscreen test VFPU = VFPU @@ -734,6 +745,7 @@ None = None Note = Chú ý OpenChat = Open chat Pause = Tạm dừng +Previous Slot = Previous Slot R = R RapidFire = Rapid-fire Record = Record @@ -902,6 +914,7 @@ Animation speed (0 -> disable) = Animation speed (0 -> disable) Aspect = Aspect Black border = Black border Bloom = Tăng độ nét +BloomNoBlur = Bloom (no blur) Brightness = Brightness Cartoon = Hoạt họa CatmullRom = Bicubic (Catmull-Rom) Upscaler @@ -909,6 +922,7 @@ ColorCorrection = Color correction ColorPreservation = Color preservation Contrast = Contrast CRT = CRT đường quét +FakeReflections = FakeReflections FXAA = Chống răng cưa FXAA Gamma = Gamma GreenLevel = Green level @@ -929,6 +943,7 @@ SSAA(Gauss) = Siêu mẫu AA (cốt) Strength = Strength Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 Cao cấp VideoSmoothingAA = Video mịn AA Vignette = Đen góc @@ -1132,6 +1147,7 @@ GPU Flags = GPU Flags GPU Information = Thông tin GPU High precision float range = High precision float range High precision int range = Phạm vi int chính xác cao +Icon cache = Icon cache JIT available = JIT available Lang/Region = ngôn ngữ/Vùng Memory Page Size = Kích cỡ bộ nhớ @@ -1239,6 +1255,7 @@ Record Audio = Ghi audio Record Display = Hiển thị ghi Reset Recording on Save/Load State = Đặt lại ghi trên trạng thái Save/Load. Restore Default Settings = Chỉnh các thiết lập về mặc định +RetroAchievements = RetroAchievements Rewind Snapshot Interval = Tần số Rewind snapshot Save path in installed.txt = Save path in installed.txt Save path in My Documents = Save path in My Documents @@ -1309,6 +1326,7 @@ New version of PPSSPP available = Đã có phiên bản mới của PPSSPP 6DoF movement = 6DoF movement Camera type = Camera type Distance to 2D menus and scenes = Distance to 2D menus and scenes +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = Experts only Field of view scale = Field of view scale Force 72Hz update = Force 72Hz update diff --git a/assets/lang/zh_CN.ini b/assets/lang/zh_CN.ini index d25bb7f341..80055f0fc1 100644 --- a/assets/lang/zh_CN.ini +++ b/assets/lang/zh_CN.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: 排名失败 -%1: Leaderboard attempt started = %1: 开始尝试排名 +%1: Attempt failed = %1: 排名失败 +%1: Attempt started = %1: 开始尝试排名 %d achievements, %d points = %d 成就, %d 点数 Account = 账号 -Achievement Unlocked = 成就达成! +Achievement progress = Achievement progress +Achievement unlocked = 成就达成! Achievements = 成就 Achievements are disabled = 未启用成就功能 +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = 暂时无法登录到RetroAchievements +Challenge indicator = Challenge indicator Challenge Mode = 挑战模式 Challenge Mode (no savestates) = 挑战模式 (无即时存档) Contacting RetroAchievements server... = 连接RetroAchievements服务器... Customize = 自定义 Earned = 你已经达成%d个成就,总共有%d个可解锁, %d点数,总共%d点 Encore Mode = 回味模式 +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = 如何使用RetroAchievements In Encore mode - listings may be wrong below = 回味模式 - 下面列表中可能错误 +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = 排名得分提交 Leaderboard submission is enabled = 排名上传已启用 +Leaderboard tracker = Leaderboard tracker Leaderboards = 排行榜 Links = 链接 Locked achievements = 可解锁的成就 Log bad memory accesses = 记录损坏的内存访问 Mastered %1 = Mastered %1 +Notifications = Notifications Register on www.retroachievements.org = 在www.retroachievements.org注册 RetroAchievements are not available for this game = RetroAchievements暂不适用于当前游戏 RetroAchievements website = RetroAchievements网站 @@ -30,11 +39,12 @@ Save state loaded without achievement data = 读取即时存档时不带成就 Save states not available in Challenge Mode = 挑战模式下禁用即时存档 Sound Effects = 音效 Statistics = 统计 -Submitted %1 for %2 = 对%2提交%1中 +Submitted %1 for %2 = 对%2提交%1中 Syncing achievements data... = 同步成就数据中... Test Mode = 测试模式 This feature is not available in Challenge Mode = 挑战模式下此功能不可用 This game has no achievements = 此游戏没有成就列表 +Top players = Top players Unlocked achievements = 解锁的成就 Unofficial achievements = 自定义成就 @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = 记录丢弃帧统计信息 Log Level = 日志等级 Log View = 日志视图 Logging Channels = 记录日志分类 +Multi-threaded rendering = Multi-threaded rendering Next = 下一个 No block = 没有内存块 Prev = 之前 @@ -304,8 +315,8 @@ Stats = 统计数据 System Information = 系统信息 Texture ini file created = 创建纹理ini文件 Texture Replacement = 纹理替换 -Toggle Audio Debug = 切换音频调试 -Toggle Control Debug = 切换操纵调试 +Audio Debug = 切换音频调试 +Control Debug = 切换操纵调试 Toggle Freeze = 切换冻结 Touchscreen Test = 触屏测试 VFPU = VFPU @@ -734,6 +745,7 @@ None = 无 Note = 音效键♪ OpenChat = 打开聊天 Pause = 暂停界面 +Previous Slot = Previous Slot R = R RapidFire = 连发键 Record = 录制 @@ -903,12 +915,14 @@ Animation speed (0 -> disable) = 动画速度(0->禁用) Aspect = 孔径比例 Black border = 黑色描边 Bloom = 泛光 +BloomNoBlur = Bloom (no blur) Brightness = 亮度 Cartoon = 卡通 ColorCorrection = 颜色修正 ColorPreservation = 颜色保留 Contrast = 对比度 CRT = CRT 扫描线 +FakeReflections = FakeReflections FXAA = FXAA(快速近似抗锯齿) Gamma = 伽马值 GreenLevel = 绿色等级 @@ -928,6 +942,7 @@ SSAA(Gauss) = SSAA(超级采样抗锯齿-高斯采样) Strength = 强度 Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36缩放 VideoSmoothingAA = 视频平滑抗锯齿 Vignette = 暗角 @@ -1124,6 +1139,7 @@ GPU Flags = GPU特性 GPU Information = GPU信息 High precision float range = 高精度浮点范围 High precision int range = 高精度整数范围 +Icon cache = Icon cache JIT available = JIT可用 Lang/Region = 语言/区域 Memory Page Size = 内存页大小 @@ -1166,6 +1182,7 @@ AVI Dump started. = AVI转储开始 AVI Dump stopped. = AVI转储停止 Cache ISO in RAM = 在内存中缓存完整ISO Change CPU Clock = 修改PSP的CPU频率(不稳定) +RetroAchievements = RetroAchievements Rewind Snapshot Interval = 倒带快照间隔 Color Tint = 颜色色调 Color Saturation = 饱和度 @@ -1312,6 +1329,7 @@ Search term = 搜索关键词 6DoF movement = 6自由度移动 Camera type = 相机类型 Distance to 2D menus and scenes = 2D 菜单和场景的距离 +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = 专家模式 Field of view scale = 视角比例 Force 72Hz update = 强制72Hz刷新 diff --git a/assets/lang/zh_TW.ini b/assets/lang/zh_TW.ini index 4629c1d6c4..16b89675f7 100644 --- a/assets/lang/zh_TW.ini +++ b/assets/lang/zh_TW.ini @@ -1,27 +1,36 @@ [Achievements] -%1: Leaderboard attempt failed = %1: Leaderboard attempt failed -%1: Leaderboard attempt started = %1: Leaderboard attempt started +%1: Attempt failed = %1: Attempt failed +%1: Attempt started = %1: Attempt started %d achievements, %d points = %d 個成就,%d 個點數 Account = 帳戶 -Achievement Unlocked = Achievement Unlocked +Achievement progress = Achievement progress +Achievement unlocked = Achievement unlocked Achievements = 成就 Achievements are disabled = Achievements are disabled +Achievements enabled = Achievements enabled +Around me = Around me Can't log in to RetroAchievements right now = Can't log in to RetroAchievements right now +Challenge indicator = Challenge indicator Challenge Mode = 挑戰模式 Challenge Mode (no savestates) = 挑戰模式 (無存檔) Contacting RetroAchievements server... = Contacting RetroAchievements server... Customize = Customize Earned = 您已經取得 %d/%d 個成就,以及 %d/%d 個點數 Encore Mode = Encore Mode +Failed logging in to RetroAchievements = Failed logging in to RetroAchievements How to use RetroAchievements = 如何使用 RetroAchievements In Encore mode - listings may be wrong below = In Encore mode - listings may be wrong below +Leaderboard attempt started or failed = Leaderboard attempt started or failed +Leaderboard result submitted = Leaderboard result submitted Leaderboard score submission = Leaderboard score submission Leaderboard submission is enabled = 排行榜提交已啟用 +Leaderboard tracker = Leaderboard tracker Leaderboards = 排行榜 Links = 連結 Locked achievements = 已鎖定的成就 Log bad memory accesses = 記憶體存取記錄錯誤 Mastered %1 = 已達成 %1 +Notifications = Notifications Register on www.retroachievements.org = 在 www.retroachievements.org 上註冊 RetroAchievements are not available for this game = RetroAchievements 無法在這個遊戲中使用 RetroAchievements website = RetroAchievements 網站 @@ -35,6 +44,7 @@ Syncing achievements data... = 正在同步成就資料… Test Mode = 測試模式 This feature is not available in Challenge Mode = This feature is not available in Challenge Mode This game has no achievements = 這個遊戲沒有成就 +Top players = Top players Unlocked achievements = 已解鎖的成就 Unofficial achievements = Unofficial achievements @@ -285,6 +295,7 @@ Log Dropped Frame Statistics = 記錄捨棄影格統計資料 Log Level = 記錄層級 Log View = 記錄檢視 Logging Channels = 記錄通道 +Multi-threaded rendering = Multi-threaded rendering Next = 下一個 No block = 沒有區塊 Prev = 上一個 @@ -304,8 +315,8 @@ Stats = 統計資料 System Information = 系統資訊 Texture ini file created = 紋理 ini 檔案已建立 Texture Replacement = 紋理取代 -Toggle Audio Debug = 切換音訊偵錯開關 -Toggle Control Debug = 切換控制偵錯開關 +Audio Debug = 切換音訊偵錯開關 +Control Debug = 切換控制偵錯開關 Toggle Freeze = 切換凍結開關 Touchscreen Test = 觸控式螢幕測試 VFPU = VFPU @@ -730,6 +741,7 @@ None = 無 Note = 聲音按鈕 OpenChat = 開啟聊天 Pause = 暫停 +Previous Slot = Previous Slot R = R RapidFire = 快速開火 Record = 錄製 @@ -872,12 +884,14 @@ Amount = 數量 Aspect = 長寬 Black border = 黑色框線 Bloom = 光圈 +BloomNoBlur = Bloom (no blur) Brightness = 亮度 Cartoon = 卡通 ColorCorrection = 色彩修正 ColorPreservation = 色彩保留 Contrast = 對比度 CRT = CRT 掃描線 +FakeReflections = FakeReflections FXAA = FXAA 消除鋸齒 Gamma = 色差補正 GreenLevel = 綠色色階 @@ -897,6 +911,7 @@ SSAA(Gauss) = 超級取樣 AA (高斯) Strength = 強度 Tex4xBRZ = 4xBRZ TexMMPX = MMPX +UpscaleBicubic = UpscaleBicubic UpscaleSpline36 = Spline36 放大 VideoSmoothingAA = 視訊平滑 AA Vignette = 暈影 @@ -1123,6 +1138,7 @@ GPU Flags = GPU 旗標 GPU Information = GPU 資訊 High precision float range = 高精確度浮點數範圍 High precision int range = 高精確度整數範圍 +Icon cache = Icon cache JIT available = 可用 JIT Lang/Region = 語言/區域 Memory Page Size = 記憶體分頁大小 @@ -1229,6 +1245,7 @@ Record Audio = 錄製音訊 Record Display = 錄製視訊 Reset Recording on Save/Load State = 儲存/載入存檔時重設錄製 Restore Default Settings = 將 PPSSPP 設定重設為預設值 +RetroAchievements = RetroAchievements Rewind Snapshot Interval = 倒轉快照間隔 Save path in installed.txt = 儲存路徑於 installed.txt Save path in My Documents = 儲存路徑於「我的文件」 @@ -1310,6 +1327,7 @@ Screen representation = 螢幕呈現 6DoF movement = 六自由度移動 Camera type = 相機類型 Distance to 2D menus and scenes = 2D 選單及場景距離 +Distance to 3D scenes when VR disabled = Distance to 3D scenes when VR disabled Experts only = 僅限專家 Field of view scale = 視野縮放 Force 72Hz update = 強制 72Hz 更新 diff --git a/assets/shaders/defaultshaders.ini b/assets/shaders/defaultshaders.ini index 73217d45e9..8b80d1dc03 100644 --- a/assets/shaders/defaultshaders.ini +++ b/assets/shaders/defaultshaders.ini @@ -38,9 +38,9 @@ SettingDefaultValue2=1.0 SettingMaxValue2=2.0 SettingMinValue2=0.5 SettingStep2=0.1 -[FakeReclections] +[FakeReflections] Name=Fake Reflections -Fragment=fakereclections.fsh +Fragment=fakereflections.fsh Vertex=fxaa.vsh SettingName1=Amount SettingDefaultValue1=0.6 diff --git a/assets/shaders/fakereclections.fsh b/assets/shaders/fakereflections.fsh similarity index 100% rename from assets/shaders/fakereclections.fsh rename to assets/shaders/fakereflections.fsh diff --git a/build.gradle b/build.gradle index 7a9290a97a..dd644184b0 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.0.0' + classpath 'com.android.tools.build:gradle:8.1.0' } } diff --git a/ext/naett b/ext/naett index 8c3a5d9278..10a9624456 160000 --- a/ext/naett +++ b/ext/naett @@ -1 +1 @@ -Subproject commit 8c3a5d92780eacacc24ab34a12cf585997e08ff9 +Subproject commit 10a9624456829e5f2b4c264e14760301125d12eb diff --git a/ext/rcheevos b/ext/rcheevos index 13333347f0..97db619aa4 160000 --- a/ext/rcheevos +++ b/ext/rcheevos @@ -1 +1 @@ -Subproject commit 13333347f0809aa751856c849ffe751d612ae0a4 +Subproject commit 97db619aa4de15fe19887255e75899ae65d2e432 diff --git a/ext/riscv-disas.cpp b/ext/riscv-disas.cpp index 7eba6b51eb..816c985cca 100644 --- a/ext/riscv-disas.cpp +++ b/ext/riscv-disas.cpp @@ -119,7 +119,7 @@ static const rvc_constraint rvcc_jal_j[] = { rvc_rd_eq_x0, rvc_end }; static const rvc_constraint rvcc_jal_jal[] = { rvc_rd_eq_ra, rvc_end }; static const rvc_constraint rvcc_jalr_jr[] = { rvc_rd_eq_x0, rvc_imm_eq_zero, rvc_end }; static const rvc_constraint rvcc_jalr_jalr[] = { rvc_rd_eq_ra, rvc_imm_eq_zero, rvc_end }; -static const rvc_constraint rvcc_jalr_ret[] = { rvc_rd_eq_x0, rvc_rs1_eq_ra, rvc_end }; +static const rvc_constraint rvcc_jalr_ret[] = { rvc_rd_eq_x0, rvc_rs1_eq_ra, rvc_imm_eq_zero, rvc_end }; static const rvc_constraint rvcc_addi_nop[] = { rvc_rd_eq_x0, rvc_rs1_eq_x0, rvc_imm_eq_zero, rvc_end }; static const rvc_constraint rvcc_rdcycle[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc00, rvc_end }; static const rvc_constraint rvcc_rdtime[] = { rvc_rs1_eq_x0, rvc_csr_eq_0xc01, rvc_end }; diff --git a/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib b/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib index 0238f282d5..030887a605 100755 Binary files a/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib and b/ext/vulkan/macOS/Frameworks/libMoltenVK.dylib differ diff --git a/ffmpeg b/ffmpeg index a94f3e6fa8..b0173289b1 160000 --- a/ffmpeg +++ b/ffmpeg @@ -1 +1 @@ -Subproject commit a94f3e6fa89e6ac5763e6b9d23ab3c4a72bbcd6c +Subproject commit b0173289b16e7708963600068229860a732cc30f diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 4a79bad5d8..e8e3d83d9f 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -94,8 +94,7 @@ public: }; // Temporary hacks around annoying linking errors. -void NativeUpdate() { } -void NativeRender(GraphicsContext *graphicsContext) { } +void NativeFrame(GraphicsContext *graphicsContext) { } void NativeResized() { } std::string System_GetProperty(SystemProperty prop) { return ""; } @@ -234,12 +233,12 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, const System_Notify(SystemNotification::BOOT_DONE); - Core_UpdateDebugStats(g_Config.bShowDebugStats || g_Config.bLogFrameDrops); + Core_UpdateDebugStats((DebugOverlay)g_Config.iDebugOverlay == DebugOverlay::DEBUG_STATS || g_Config.bLogFrameDrops); PSP_BeginHostFrame(); Draw::DrawContext *draw = coreParameter.graphicsContext ? coreParameter.graphicsContext->GetDrawContext() : nullptr; if (draw) - draw->BeginFrame(); + draw->BeginFrame(Draw::DebugFlags::NONE); bool passed = true; double deadline = time_now_d() + opt.timeout; diff --git a/headless/SDLHeadlessHost.cpp b/headless/SDLHeadlessHost.cpp index 7333e46460..5d6fede8b8 100644 --- a/headless/SDLHeadlessHost.cpp +++ b/headless/SDLHeadlessHost.cpp @@ -96,7 +96,6 @@ public: void Shutdown() override {} void Resize() override {} void SwapInterval(int interval) override {} - void SwapBuffers() override {} private: Draw::DrawContext *draw_ = nullptr; @@ -166,7 +165,7 @@ bool GLDummyGraphicsContext::InitFromRenderThread(std::string *errorMessage) { _assert_(success); renderManager_->SetSwapFunction([&]() { SDL_GL_SwapWindow(screen_); - }, false); + }); return success; } @@ -193,7 +192,6 @@ bool SDLHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext * if (!gfx_->ThreadFrame()) { break; } - gfx_->SwapBuffers(); } threadState_ = RenderThreadState::STOPPING; @@ -221,7 +219,6 @@ void SDLHeadlessHost::ShutdownGraphics() { } void SDLHeadlessHost::SwapBuffers() { - gfx_->SwapBuffers(); } #endif diff --git a/headless/WindowsHeadlessHost.cpp b/headless/WindowsHeadlessHost.cpp index 3aef27028a..a4da9eed64 100644 --- a/headless/WindowsHeadlessHost.cpp +++ b/headless/WindowsHeadlessHost.cpp @@ -132,7 +132,6 @@ bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsConte if (!gfx_->ThreadFrame()) { break; } - gfx_->SwapBuffers(); } threadState_ = RenderThreadState::STOPPING; @@ -173,5 +172,4 @@ void WindowsHeadlessHost::SwapBuffers() { TranslateMessage(&msg); DispatchMessage(&msg); } - gfx_->SwapBuffers(); } diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 2bfa3dd63c..89eff3a67b 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -64,7 +64,6 @@ public: } void SwapInterval(int interval) override {} - void SwapBuffers() override {} void Resize() override {} void Shutdown() override {} @@ -238,8 +237,7 @@ extern float g_safeInsetBottom; INFO_LOG(SYSTEM, "Emulation thread starting\n"); while (threadEnabled) { - NativeUpdate(); - NativeRender(graphicsContext); + NativeFrame(graphicsContext); } diff --git a/libretro/LibretroD3D11Context.cpp b/libretro/LibretroD3D11Context.cpp index 82661ab2d7..1ef528fc51 100644 --- a/libretro/LibretroD3D11Context.cpp +++ b/libretro/LibretroD3D11Context.cpp @@ -46,7 +46,7 @@ void LibretroD3D11Context::CreateDrawContext() { ID3D11DeviceContext1 *context1 = nullptr; d3d11_->context->QueryInterface(__uuidof(ID3D11DeviceContext1), (void **)&context1); - draw_ = Draw::T3DCreateD3D11Context(d3d11_->device, d3d11_->context, device1, context1, d3d11_->featureLevel, NULL, adapterNames); + draw_ = Draw::T3DCreateD3D11Context(d3d11_->device, d3d11_->context, device1, context1, d3d11_->featureLevel, NULL, adapterNames, 3); } void LibretroD3D11Context::DestroyDrawContext() { diff --git a/libretro/LibretroGraphicsContext.h b/libretro/LibretroGraphicsContext.h index ee15e5a1ac..ca267afdf8 100644 --- a/libretro/LibretroGraphicsContext.h +++ b/libretro/LibretroGraphicsContext.h @@ -22,6 +22,7 @@ public: DestroyDrawContext(); } void SwapInterval(int interval) override {} + virtual void SwapBuffers() = 0; void Resize() override {} virtual void GotBackbuffer(); diff --git a/libretro/LibretroVulkanContext.cpp b/libretro/LibretroVulkanContext.cpp index c07a000bcc..ccce6c9ad5 100644 --- a/libretro/LibretroVulkanContext.cpp +++ b/libretro/LibretroVulkanContext.cpp @@ -139,7 +139,11 @@ void LibretroVulkanContext::CreateDrawContext() { return; } - draw_ = Draw::T3DCreateVulkanContext(vk, true); + bool useMultiThreading = g_Config.bRenderMultiThreading; + if (g_Config.iInflightFrames == 1) { + useMultiThreading = false; + } + draw_ = Draw::T3DCreateVulkanContext(vk, useMultiThreading); ((VulkanRenderManager*)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER))->SetInflightFrames(g_Config.iInflightFrames); SetGPUBackend(GPUBackend::VULKAN); } diff --git a/libretro/Makefile b/libretro/Makefile index 4eb5be6e8e..4625c9da0f 100644 --- a/libretro/Makefile +++ b/libretro/Makefile @@ -300,16 +300,12 @@ else ifneq (,$(findstring armv,$(platform))) # emscripten else ifeq ($(platform), emscripten) + TARGET_ARCH = wasm32 + GLES = 1 TARGET := $(TARGET_NAME)_libretro_emscripten.bc - GLES := 1 - CPUFLAGS += - PLATCFLAGS += -DCC_resampler=mupen_CC_resampler -Dsinc_resampler=mupen_sinc_resampler \ - -Drglgen_symbol_map=mupen_rglgen_symbol_map -Dmain_exit=mupen_main_exit \ - -Dadler32=mupen_adler32 -Drarch_resampler_realloc=mupen_rarch_resampler_realloc \ - -Daudio_convert_s16_to_float_C=mupen_audio_convert_s16_to_float_C -Daudio_convert_float_to_s16_C=mupen_audio_convert_float_to_s16_C \ - -Daudio_convert_init_simd=mupen_audio_convert_init_simd -Drglgen_resolve_symbols_custom=mupen_rglgen_resolve_symbols_custom \ - -Drglgen_resolve_symbols=mupen_rglgen_resolve_symbols - PLATFORM_EXT = unix + PLATCFLAGS += -msimd128 -msse3 -mssse3 -msse4.1 -pthread -D__EMSCRIPTEN__ -DNO_MMAP + PLATFORM_EXT = emscripten + STATIC_LINKING = 1 # Windows MSVC all architectures else ifneq (,$(findstring windows_msvc2019,$(platform))) @@ -435,7 +431,11 @@ else GLFLAGS += -DHAVE_OPENGL endif -COREFLAGS += -D__LIBRETRO__ -DPPSSPP -DUSE_FFMPEG -DWITH_UPNP -DGLEW_STATIC -DGLEW_NO_GLU -DMINIUPNP_STATICLIB +COREFLAGS += -D__LIBRETRO__ -DPPSSPP -DWITH_UPNP -DGLEW_STATIC -DGLEW_NO_GLU -DMINIUPNP_STATICLIB +ifneq ($(platform), emscripten) + # ffmpeg does not work with emscripten + COREFLAGS += -DUSE_FFMPEG +endif ifeq ($(DEBUG), 1) ifneq (,$(findstring msvc,$(platform))) @@ -445,6 +445,8 @@ ifeq ($(DEBUG), 1) CPUOPTS += -O0 -g endif CPUOPTS += -D_DEBUG +else ifeq ($(platform), emscripten) + CPUOPTS += -O3 -DNDEBUG else CPUOPTS += -O2 -DNDEBUG endif @@ -494,7 +496,7 @@ all: $(TARGET) $(TARGET): $(OBJECTS) ifeq ($(STATIC_LINKING), 1) - $(AR) rcs $A $(OBJECTS) + $(AR) rcs $(TARGET) $(OBJECTS) else $(LD) $(LINKOUT)$@ $(OBJECTS) $(LDFLAGS) $(GL_LIB) endif diff --git a/libretro/Makefile.common b/libretro/Makefile.common index 70c00dfee2..373af9fe31 100644 --- a/libretro/Makefile.common +++ b/libretro/Makefile.common @@ -667,6 +667,7 @@ SOURCES_CXX += \ $(COREDIR)/HW/SasReverb.cpp \ $(COREDIR)/HW/StereoResampler.cpp \ $(COREDIR)/Compatibility.cpp \ + $(COREDIR)/FrameTiming.cpp \ $(COREDIR)/Loaders.cpp \ $(COREDIR)/MIPS/JitCommon/JitCommon.cpp \ $(COREDIR)/MIPS/JitCommon/JitState.cpp \ @@ -677,9 +678,10 @@ SOURCES_CXX += \ $(COREDIR)/MIPS/IR/IRCompFPU.cpp \ $(COREDIR)/MIPS/IR/IRCompLoadStore.cpp \ $(COREDIR)/MIPS/IR/IRCompVFPU.cpp \ + $(COREDIR)/MIPS/IR/IRInst.cpp \ $(COREDIR)/MIPS/IR/IRInterpreter.cpp \ $(COREDIR)/MIPS/IR/IRJit.cpp \ - $(COREDIR)/MIPS/IR/IRInst.cpp \ + $(COREDIR)/MIPS/IR/IRNativeCommon.cpp \ $(COREDIR)/MIPS/IR/IRPassSimplify.cpp \ $(COREDIR)/MIPS/IR/IRRegCache.cpp \ $(COREDIR)/MIPS/IR/IRFrontend.cpp \ diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp index cbb1609d65..7ca2ac3181 100644 --- a/libretro/libretro.cpp +++ b/libretro/libretro.cpp @@ -474,6 +474,7 @@ static void check_variables(CoreParameter &coreParam) g_Config.iLanguage = PSP_SYSTEMPARAM_LANGUAGE_CHINESE_SIMPLIFIED; } +#ifndef __EMSCRIPTEN__ var.key = "ppsspp_cpu_core"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) { @@ -491,6 +492,9 @@ static void check_variables(CoreParameter &coreParam) // to experiment in future iOS versions or something... g_Config.iCpuCore = (int)CPUCore::IR_JIT; } +#else + g_Config.iCpuCore = (int)CPUCore::INTERPRETER; +#endif var.key = "ppsspp_fast_memory"; if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) @@ -1163,7 +1167,7 @@ namespace Libretro { ctx->SetRenderTarget(); if (ctx->GetDrawContext()) - ctx->GetDrawContext()->BeginFrame(); + ctx->GetDrawContext()->BeginFrame(Draw::DebugFlags::NONE); gpu->BeginHostFrame(); @@ -1172,8 +1176,10 @@ namespace Libretro gpu->EndHostFrame(); - if (ctx->GetDrawContext()) + if (ctx->GetDrawContext()) { ctx->GetDrawContext()->EndFrame(); + ctx->GetDrawContext()->Present(1); + } } static void EmuThreadFunc() @@ -1704,8 +1710,7 @@ void System_Notify(SystemNotification notification) { } bool System_MakeRequest(SystemRequestType type, int requestId, const std::string ¶m1, const std::string ¶m2, int param3) { return false; } void System_PostUIMessage(const std::string &message, const std::string ¶m) {} -void NativeUpdate() {} -void NativeRender(GraphicsContext *graphicsContext) {} +void NativeFrame(GraphicsContext *graphicsContext) {} void NativeResized() {} void System_Toast(const char *str) {} diff --git a/macOS/Info.plist b/macOS/Info.plist index c4f448c261..03a318124a 100644 --- a/macOS/Info.plist +++ b/macOS/Info.plist @@ -90,6 +90,8 @@ CSResourcesFileMapped + NSHighResolutionCapable + NSHumanReadableCopyright UTExportedTypeDeclarations diff --git a/macOS/InfoGold.plist b/macOS/InfoGold.plist index cd816e2501..2bec2d6606 100644 --- a/macOS/InfoGold.plist +++ b/macOS/InfoGold.plist @@ -90,6 +90,8 @@ CSResourcesFileMapped + NSHighResolutionCapable + NSHumanReadableCopyright UTExportedTypeDeclarations diff --git a/ppsspp_config.h b/ppsspp_config.h index 5f46f501af..e26b1220e1 100644 --- a/ppsspp_config.h +++ b/ppsspp_config.h @@ -8,7 +8,7 @@ #define PPSSPP_API(PPSSPP_FEATURE) (PPSSPP_API_##PPSSPP_FEATURE) // ARCH defines -#if defined(_M_IX86) || defined(__i386__) +#if defined(_M_IX86) || defined(__i386__) || defined (__EMSCRIPTEN__) #define PPSSPP_ARCH_X86 1 #define PPSSPP_ARCH_32BIT 1 //TODO: Remove this compat define @@ -17,7 +17,7 @@ #endif #endif -#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) +#if (defined(_M_X64) || defined(__amd64__) || defined(__x86_64__)) && !defined(__EMSCRIPTEN__) #define PPSSPP_ARCH_AMD64 1 #if defined(__ILP32__) #define PPSSPP_ARCH_32BIT 1 diff --git a/unittest/JitHarness.cpp b/unittest/JitHarness.cpp index 750b39ab57..4ad53fc65c 100644 --- a/unittest/JitHarness.cpp +++ b/unittest/JitHarness.cpp @@ -37,8 +37,7 @@ #include "Core/HLE/HLE.h" // Temporary hacks around annoying linking errors. Copied from Headless. -void NativeUpdate() { } -void NativeRender(GraphicsContext *graphicsContext) { } +void NativeFrame(GraphicsContext *graphicsContext) { } void NativeResized() { } bool System_MakeRequest(SystemRequestType type, int requestId, const std::string ¶m1, const std::string ¶m2, int param3) { return false; }