diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/file_util.cpp | 96 | ||||
-rw-r--r-- | src/common/memory_util.cpp | 16 | ||||
-rw-r--r-- | src/common/param_package.cpp | 12 | ||||
-rw-r--r-- | src/common/string_util.cpp | 10 | ||||
-rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic.cpp | 4 | ||||
-rw-r--r-- | src/core/core.cpp | 22 | ||||
-rw-r--r-- | src/core/core_timing.h | 16 | ||||
-rw-r--r-- | src/core/frontend/input.h | 6 | ||||
-rw-r--r-- | src/core/telemetry_session.cpp | 6 | ||||
-rw-r--r-- | src/core/tracer/recorder.cpp | 2 | ||||
-rw-r--r-- | src/input_common/sdl/sdl.cpp | 6 | ||||
-rw-r--r-- | src/video_core/engines/shader_bytecode.h | 10 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_decompiler.cpp | 119 | ||||
-rw-r--r-- | src/yuzu/game_list.cpp | 5 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 10 | ||||
-rw-r--r-- | src/yuzu_cmd/config.cpp | 6 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 8 | ||||
-rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 24 |
18 files changed, 244 insertions, 134 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 4e1d702f7..37f9e996c 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -118,7 +118,7 @@ bool IsDirectory(const std::string& filename) { #endif if (result < 0) { - LOG_DEBUG(Common_Filesystem, "stat failed on %s: %s", filename.c_str(), GetLastErrorMsg()); + NGLOG_DEBUG(Common_Filesystem, "stat failed on {}: {}", filename, GetLastErrorMsg()); return false; } @@ -128,31 +128,29 @@ bool IsDirectory(const std::string& filename) { // Deletes a given filename, return true on success // Doesn't supports deleting a directory bool Delete(const std::string& filename) { - LOG_TRACE(Common_Filesystem, "file %s", filename.c_str()); + NGLOG_TRACE(Common_Filesystem, "file {}", filename); // Return true because we care about the file no // being there, not the actual delete. if (!Exists(filename)) { - LOG_DEBUG(Common_Filesystem, "%s does not exist", filename.c_str()); + NGLOG_DEBUG(Common_Filesystem, "{} does not exist", filename); return true; } // We can't delete a directory if (IsDirectory(filename)) { - LOG_ERROR(Common_Filesystem, "Failed: %s is a directory", filename.c_str()); + NGLOG_ERROR(Common_Filesystem, "Failed: {} is a directory", filename); return false; } #ifdef _WIN32 if (!DeleteFileW(Common::UTF8ToUTF16W(filename).c_str())) { - LOG_ERROR(Common_Filesystem, "DeleteFile failed on %s: %s", filename.c_str(), - GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "DeleteFile failed on {}: {}", filename, GetLastErrorMsg()); return false; } #else if (unlink(filename.c_str()) == -1) { - LOG_ERROR(Common_Filesystem, "unlink failed on %s: %s", filename.c_str(), - GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "unlink failed on {}: {}", filename, GetLastErrorMsg()); return false; } #endif @@ -162,16 +160,16 @@ bool Delete(const std::string& filename) { // Returns true if successful, or path already exists. bool CreateDir(const std::string& path) { - LOG_TRACE(Common_Filesystem, "directory %s", path.c_str()); + NGLOG_TRACE(Common_Filesystem, "directory {}", path); #ifdef _WIN32 if (::CreateDirectoryW(Common::UTF8ToUTF16W(path).c_str(), nullptr)) return true; DWORD error = GetLastError(); if (error == ERROR_ALREADY_EXISTS) { - LOG_DEBUG(Common_Filesystem, "CreateDirectory failed on %s: already exists", path.c_str()); + NGLOG_DEBUG(Common_Filesystem, "CreateDirectory failed on {}: already exists", path); return true; } - LOG_ERROR(Common_Filesystem, "CreateDirectory failed on %s: %i", path.c_str(), error); + NGLOG_ERROR(Common_Filesystem, "CreateDirectory failed on {}: {}", path, error); return false; #else if (mkdir(path.c_str(), 0755) == 0) @@ -180,11 +178,11 @@ bool CreateDir(const std::string& path) { int err = errno; if (err == EEXIST) { - LOG_DEBUG(Common_Filesystem, "mkdir failed on %s: already exists", path.c_str()); + NGLOG_DEBUG(Common_Filesystem, "mkdir failed on {}: already exists", path); return true; } - LOG_ERROR(Common_Filesystem, "mkdir failed on %s: %s", path.c_str(), strerror(err)); + NGLOG_ERROR(Common_Filesystem, "mkdir failed on {}: {}", path, strerror(err)); return false; #endif } @@ -192,10 +190,10 @@ bool CreateDir(const std::string& path) { // Creates the full path of fullPath returns true on success bool CreateFullPath(const std::string& fullPath) { int panicCounter = 100; - LOG_TRACE(Common_Filesystem, "path %s", fullPath.c_str()); + NGLOG_TRACE(Common_Filesystem, "path {}", fullPath); if (FileUtil::Exists(fullPath)) { - LOG_DEBUG(Common_Filesystem, "path exists %s", fullPath.c_str()); + NGLOG_DEBUG(Common_Filesystem, "path exists {}", fullPath); return true; } @@ -211,14 +209,14 @@ bool CreateFullPath(const std::string& fullPath) { // Include the '/' so the first call is CreateDir("/") rather than CreateDir("") std::string const subPath(fullPath.substr(0, position + 1)); if (!FileUtil::IsDirectory(subPath) && !FileUtil::CreateDir(subPath)) { - LOG_ERROR(Common, "CreateFullPath: directory creation failed"); + NGLOG_ERROR(Common, "CreateFullPath: directory creation failed"); return false; } // A safety check panicCounter--; if (panicCounter <= 0) { - LOG_ERROR(Common, "CreateFullPath: directory structure is too deep"); + NGLOG_ERROR(Common, "CreateFullPath: directory structure is too deep"); return false; } position++; @@ -227,11 +225,11 @@ bool CreateFullPath(const std::string& fullPath) { // Deletes a directory filename, returns true on success bool DeleteDir(const std::string& filename) { - LOG_TRACE(Common_Filesystem, "directory %s", filename.c_str()); + NGLOG_TRACE(Common_Filesystem, "directory {}", filename); // check if a directory if (!FileUtil::IsDirectory(filename)) { - LOG_ERROR(Common_Filesystem, "Not a directory %s", filename.c_str()); + NGLOG_ERROR(Common_Filesystem, "Not a directory {}", filename); return false; } @@ -242,14 +240,14 @@ bool DeleteDir(const std::string& filename) { if (rmdir(filename.c_str()) == 0) return true; #endif - LOG_ERROR(Common_Filesystem, "failed %s: %s", filename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); return false; } // renames file srcFilename to destFilename, returns true on success bool Rename(const std::string& srcFilename, const std::string& destFilename) { - LOG_TRACE(Common_Filesystem, "%s --> %s", srcFilename.c_str(), destFilename.c_str()); + NGLOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); #ifdef _WIN32 if (_wrename(Common::UTF8ToUTF16W(srcFilename).c_str(), Common::UTF8ToUTF16W(destFilename).c_str()) == 0) @@ -258,21 +256,21 @@ bool Rename(const std::string& srcFilename, const std::string& destFilename) { if (rename(srcFilename.c_str(), destFilename.c_str()) == 0) return true; #endif - LOG_ERROR(Common_Filesystem, "failed %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), - GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, + GetLastErrorMsg()); return false; } // copies file srcFilename to destFilename, returns true on success bool Copy(const std::string& srcFilename, const std::string& destFilename) { - LOG_TRACE(Common_Filesystem, "%s --> %s", srcFilename.c_str(), destFilename.c_str()); + NGLOG_TRACE(Common_Filesystem, "{} --> {}", srcFilename, destFilename); #ifdef _WIN32 if (CopyFileW(Common::UTF8ToUTF16W(srcFilename).c_str(), Common::UTF8ToUTF16W(destFilename).c_str(), FALSE)) return true; - LOG_ERROR(Common_Filesystem, "failed %s --> %s: %s", srcFilename.c_str(), destFilename.c_str(), - GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed {} --> {}: {}", srcFilename, destFilename, + GetLastErrorMsg()); return false; #else @@ -284,8 +282,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { // Open input file FILE* input = fopen(srcFilename.c_str(), "rb"); if (!input) { - LOG_ERROR(Common_Filesystem, "opening input failed %s --> %s: %s", srcFilename.c_str(), - destFilename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "opening input failed {} --> {}: {}", srcFilename, + destFilename, GetLastErrorMsg()); return false; } @@ -293,8 +291,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { FILE* output = fopen(destFilename.c_str(), "wb"); if (!output) { fclose(input); - LOG_ERROR(Common_Filesystem, "opening output failed %s --> %s: %s", srcFilename.c_str(), - destFilename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "opening output failed {} --> {}: {}", srcFilename, + destFilename, GetLastErrorMsg()); return false; } @@ -304,8 +302,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { size_t rnum = fread(buffer, sizeof(char), BSIZE, input); if (rnum != BSIZE) { if (ferror(input) != 0) { - LOG_ERROR(Common_Filesystem, "failed reading from source, %s --> %s: %s", - srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed reading from source, {} --> {}: {}", + srcFilename, destFilename, GetLastErrorMsg()); goto bail; } } @@ -313,8 +311,8 @@ bool Copy(const std::string& srcFilename, const std::string& destFilename) { // write output size_t wnum = fwrite(buffer, sizeof(char), rnum, output); if (wnum != rnum) { - LOG_ERROR(Common_Filesystem, "failed writing to output, %s --> %s: %s", - srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed writing to output, {} --> {}: {}", srcFilename, + destFilename, GetLastErrorMsg()); goto bail; } } @@ -334,12 +332,12 @@ bail: // Returns the size of filename (64bit) u64 GetSize(const std::string& filename) { if (!Exists(filename)) { - LOG_ERROR(Common_Filesystem, "failed %s: No such file", filename.c_str()); + NGLOG_ERROR(Common_Filesystem, "failed {}: No such file", filename); return 0; } if (IsDirectory(filename)) { - LOG_ERROR(Common_Filesystem, "failed %s: is a directory", filename.c_str()); + NGLOG_ERROR(Common_Filesystem, "failed {}: is a directory", filename); return 0; } @@ -350,11 +348,11 @@ u64 GetSize(const std::string& filename) { if (stat(filename.c_str(), &buf) == 0) #endif { - LOG_TRACE(Common_Filesystem, "%s: %lld", filename.c_str(), (long long)buf.st_size); + NGLOG_TRACE(Common_Filesystem, "{}: {}", filename, buf.st_size); return buf.st_size; } - LOG_ERROR(Common_Filesystem, "Stat failed %s: %s", filename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "Stat failed {}: {}", filename, GetLastErrorMsg()); return 0; } @@ -362,7 +360,7 @@ u64 GetSize(const std::string& filename) { u64 GetSize(const int fd) { struct stat buf; if (fstat(fd, &buf) != 0) { - LOG_ERROR(Common_Filesystem, "GetSize: stat failed %i: %s", fd, GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "GetSize: stat failed {}: {}", fd, GetLastErrorMsg()); return 0; } return buf.st_size; @@ -373,12 +371,14 @@ u64 GetSize(FILE* f) { // can't use off_t here because it can be 32-bit u64 pos = ftello(f); if (fseeko(f, 0, SEEK_END) != 0) { - LOG_ERROR(Common_Filesystem, "GetSize: seek failed %p: %s", f, GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), + GetLastErrorMsg()); return 0; } u64 size = ftello(f); if ((size != pos) && (fseeko(f, pos, SEEK_SET) != 0)) { - LOG_ERROR(Common_Filesystem, "GetSize: seek failed %p: %s", f, GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "GetSize: seek failed {}: {}", fmt::ptr(f), + GetLastErrorMsg()); return 0; } return size; @@ -386,10 +386,10 @@ u64 GetSize(FILE* f) { // creates an empty file filename, returns true on success bool CreateEmptyFile(const std::string& filename) { - LOG_TRACE(Common_Filesystem, "%s", filename.c_str()); + NGLOG_TRACE(Common_Filesystem, "{}", filename); if (!FileUtil::IOFile(filename, "wb")) { - LOG_ERROR(Common_Filesystem, "failed %s: %s", filename.c_str(), GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "failed {}: {}", filename, GetLastErrorMsg()); return false; } @@ -398,7 +398,7 @@ bool CreateEmptyFile(const std::string& filename) { bool ForeachDirectoryEntry(unsigned* num_entries_out, const std::string& directory, DirectoryEntryCallable callback) { - LOG_TRACE(Common_Filesystem, "directory %s", directory.c_str()); + NGLOG_TRACE(Common_Filesystem, "directory {}", directory); // How many files + directories we found unsigned found_entries = 0; @@ -556,7 +556,7 @@ std::string GetCurrentDir() { char* dir; if (!(dir = getcwd(nullptr, 0))) { #endif - LOG_ERROR(Common_Filesystem, "GetCurrentDirectory failed: %s", GetLastErrorMsg()); + NGLOG_ERROR(Common_Filesystem, "GetCurrentDirectory failed: {}", GetLastErrorMsg()); return nullptr; } #ifdef _WIN32 @@ -676,7 +676,7 @@ std::string GetSysDirectory() { #endif sysDir += DIR_SEP; - LOG_DEBUG(Common_Filesystem, "Setting to %s:", sysDir.c_str()); + NGLOG_DEBUG(Common_Filesystem, "Setting to {}:", sysDir); return sysDir; } @@ -692,7 +692,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new if (!FileUtil::IsDirectory(paths[D_USER_IDX])) { paths[D_USER_IDX] = AppDataRoamingDirectory() + DIR_SEP EMU_DATA_DIR DIR_SEP; } else { - LOG_INFO(Common_Filesystem, "Using the local user directory"); + NGLOG_INFO(Common_Filesystem, "Using the local user directory"); } paths[D_CONFIG_IDX] = paths[D_USER_IDX] + CONFIG_DIR DIR_SEP; @@ -719,7 +719,7 @@ const std::string& GetUserPath(const unsigned int DirIDX, const std::string& new if (!newPath.empty()) { if (!FileUtil::IsDirectory(newPath)) { - LOG_ERROR(Common_Filesystem, "Invalid path specified %s", newPath.c_str()); + NGLOG_ERROR(Common_Filesystem, "Invalid path specified {}", newPath); return paths[DirIDX]; } else { paths[DirIDX] = newPath; diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 759ad02ca..79b7215d3 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -55,7 +55,7 @@ void* AllocateExecutableMemory(size_t size, bool low) { if (ptr == MAP_FAILED) { ptr = nullptr; #endif - LOG_ERROR(Common_Memory, "Failed to allocate executable memory"); + NGLOG_ERROR(Common_Memory, "Failed to allocate executable memory"); } #if !defined(_WIN32) && defined(ARCHITECTURE_X64) && !defined(MAP_32BIT) else { @@ -68,7 +68,7 @@ void* AllocateExecutableMemory(size_t size, bool low) { #if EMU_ARCH_BITS == 64 if ((u64)ptr >= 0x80000000 && low == true) - LOG_ERROR(Common_Memory, "Executable memory ended up above 2GB!"); + NGLOG_ERROR(Common_Memory, "Executable memory ended up above 2GB!"); #endif return ptr; @@ -85,7 +85,7 @@ void* AllocateMemoryPages(size_t size) { #endif if (ptr == nullptr) - LOG_ERROR(Common_Memory, "Failed to allocate raw memory"); + NGLOG_ERROR(Common_Memory, "Failed to allocate raw memory"); return ptr; } @@ -99,12 +99,12 @@ void* AllocateAlignedMemory(size_t size, size_t alignment) { ptr = memalign(alignment, size); #else if (posix_memalign(&ptr, alignment, size) != 0) - LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); + NGLOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); #endif #endif if (ptr == nullptr) - LOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); + NGLOG_ERROR(Common_Memory, "Failed to allocate aligned memory"); return ptr; } @@ -113,7 +113,7 @@ void FreeMemoryPages(void* ptr, size_t size) { if (ptr) { #ifdef _WIN32 if (!VirtualFree(ptr, 0, MEM_RELEASE)) - LOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n%s", GetLastErrorMsg()); + NGLOG_ERROR(Common_Memory, "FreeMemoryPages failed!\n{}", GetLastErrorMsg()); #else munmap(ptr, size); #endif @@ -134,7 +134,7 @@ void WriteProtectMemory(void* ptr, size_t size, bool allowExecute) { #ifdef _WIN32 DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READ : PAGE_READONLY, &oldValue)) - LOG_ERROR(Common_Memory, "WriteProtectMemory failed!\n%s", GetLastErrorMsg()); + NGLOG_ERROR(Common_Memory, "WriteProtectMemory failed!\n{}", GetLastErrorMsg()); #else mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_EXEC) : PROT_READ); #endif @@ -145,7 +145,7 @@ void UnWriteProtectMemory(void* ptr, size_t size, bool allowExecute) { DWORD oldValue; if (!VirtualProtect(ptr, size, allowExecute ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE, &oldValue)) - LOG_ERROR(Common_Memory, "UnWriteProtectMemory failed!\n%s", GetLastErrorMsg()); + NGLOG_ERROR(Common_Memory, "UnWriteProtectMemory failed!\n{}", GetLastErrorMsg()); #else mprotect(ptr, size, allowExecute ? (PROT_READ | PROT_WRITE | PROT_EXEC) : PROT_WRITE | PROT_READ); diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp index 3a6ef8c27..ab0154133 100644 --- a/src/common/param_package.cpp +++ b/src/common/param_package.cpp @@ -25,7 +25,7 @@ ParamPackage::ParamPackage(const std::string& serialized) { std::vector<std::string> key_value; Common::SplitString(pair, KEY_VALUE_SEPARATOR, key_value); if (key_value.size() != 2) { - LOG_ERROR(Common, "invalid key pair %s", pair.c_str()); + NGLOG_ERROR(Common, "invalid key pair {}", pair); continue; } @@ -64,7 +64,7 @@ std::string ParamPackage::Serialize() const { std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const { auto pair = data.find(key); if (pair == data.end()) { - LOG_DEBUG(Common, "key %s not found", key.c_str()); + NGLOG_DEBUG(Common, "key '{}' not found", key); return default_value; } @@ -74,14 +74,14 @@ std::string ParamPackage::Get(const std::string& key, const std::string& default int ParamPackage::Get(const std::string& key, int default_value) const { auto pair = data.find(key); if (pair == data.end()) { - LOG_DEBUG(Common, "key %s not found", key.c_str()); + NGLOG_DEBUG(Common, "key '{}' not found", key); return default_value; } try { return std::stoi(pair->second); } catch (const std::logic_error&) { - LOG_ERROR(Common, "failed to convert %s to int", pair->second.c_str()); + NGLOG_ERROR(Common, "failed to convert {} to int", pair->second); return default_value; } } @@ -89,14 +89,14 @@ int ParamPackage::Get(const std::string& key, int default_value) const { float ParamPackage::Get(const std::string& key, float default_value) const { auto pair = data.find(key); if (pair == data.end()) { - LOG_DEBUG(Common, "key %s not found", key.c_str()); + NGLOG_DEBUG(Common, "key {} not found", key); return default_value; } try { return std::stof(pair->second); } catch (const std::logic_error&) { - LOG_ERROR(Common, "failed to convert %s to float", pair->second.c_str()); + NGLOG_ERROR(Common, "failed to convert {} to float", pair->second); return default_value; } } diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 124a8937f..96c52e3ba 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -107,7 +107,7 @@ std::string StringFromFormat(const char* format, ...) { #else va_start(args, format); if (vasprintf(&buf, format, args) < 0) - LOG_ERROR(Common, "Unable to allocate memory for string"); + NGLOG_ERROR(Common, "Unable to allocate memory for string"); va_end(args); std::string temp = buf; @@ -347,7 +347,7 @@ static std::string CodeToUTF8(const char* fromcode, const std::basic_string<T>& iconv_t const conv_desc = iconv_open("UTF-8", fromcode); if ((iconv_t)(-1) == conv_desc) { - LOG_ERROR(Common, "Iconv initialization failure [%s]: %s", fromcode, strerror(errno)); + NGLOG_ERROR(Common, "Iconv initialization failure [{}]: {}", fromcode, strerror(errno)); iconv_close(conv_desc); return {}; } @@ -376,7 +376,7 @@ static std::string CodeToUTF8(const char* fromcode, const std::basic_string<T>& ++src_buffer; } } else { - LOG_ERROR(Common, "iconv failure [%s]: %s", fromcode, strerror(errno)); + NGLOG_ERROR(Common, "iconv failure [{}]: {}", fromcode, strerror(errno)); break; } } @@ -395,7 +395,7 @@ std::u16string UTF8ToUTF16(const std::string& input) { iconv_t const conv_desc = iconv_open("UTF-16LE", "UTF-8"); if ((iconv_t)(-1) == conv_desc) { - LOG_ERROR(Common, "Iconv initialization failure [UTF-8]: %s", strerror(errno)); + NGLOG_ERROR(Common, "Iconv initialization failure [UTF-8]: {}", strerror(errno)); iconv_close(conv_desc); return {}; } @@ -424,7 +424,7 @@ std::u16string UTF8ToUTF16(const std::string& input) { ++src_buffer; } } else { - LOG_ERROR(Common, "iconv failure [UTF-8]: %s", strerror(errno)); + NGLOG_ERROR(Common, "iconv failure [UTF-8]: {}", strerror(errno)); break; } } diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index 6afad0e0c..3078b64ef 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -55,8 +55,8 @@ public: } void InterpreterFallback(u64 pc, size_t num_instructions) override { - LOG_INFO(Core_ARM, "Unicorn fallback @ 0x%" PRIx64 " for %zu instructions (instr = %08x)", - pc, num_instructions, MemoryReadCode(pc)); + NGLOG_INFO(Core_ARM, "Unicorn fallback @ {:#X} for {} instructions (instr = {:08X})", pc, + num_instructions, MemoryReadCode(pc)); ARM_Interface::ThreadContext ctx; parent.SaveContext(ctx); diff --git a/src/core/core.cpp b/src/core/core.cpp index ee4af4dcc..9e2229d02 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -55,7 +55,7 @@ System::ResultStatus System::RunLoop(bool tight_loop) { // If we don't have a currently active thread then don't execute instructions, // instead advance to the next event and try to yield to the next thread if (Kernel::GetCurrentThread() == nullptr) { - LOG_TRACE(Core_ARM, "Idling"); + NGLOG_TRACE(Core_ARM, "Idling"); CoreTiming::Idle(); CoreTiming::Advance(); PrepareReschedule(); @@ -82,15 +82,15 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file app_loader = Loader::GetLoader(filepath); if (!app_loader) { - LOG_CRITICAL(Core, "Failed to obtain loader for %s!", filepath.c_str()); + NGLOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); return ResultStatus::ErrorGetLoader; } std::pair<boost::optional<u32>, Loader::ResultStatus> system_mode = app_loader->LoadKernelSystemMode(); if (system_mode.second != Loader::ResultStatus::Success) { - LOG_CRITICAL(Core, "Failed to determine system mode (Error %i)!", - static_cast<int>(system_mode.second)); + NGLOG_CRITICAL(Core, "Failed to determine system mode (Error {})!", + static_cast<int>(system_mode.second)); switch (system_mode.second) { case Loader::ResultStatus::ErrorEncrypted: @@ -106,15 +106,15 @@ System::ResultStatus System::Load(EmuWindow* emu_window, const std::string& file ResultStatus init_result{Init(emu_window, system_mode.first.get())}; if (init_result != ResultStatus::Success) { - LOG_CRITICAL(Core, "Failed to initialize system (Error %i)!", - static_cast<int>(init_result)); + NGLOG_CRITICAL(Core, "Failed to initialize system (Error {})!", + static_cast<int>(init_result)); System::Shutdown(); return init_result; } const Loader::ResultStatus load_result{app_loader->Load(current_process)}; if (Loader::ResultStatus::Success != load_result) { - LOG_CRITICAL(Core, "Failed to load ROM (Error %i)!", static_cast<int>(load_result)); + NGLOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast<int>(load_result)); System::Shutdown(); switch (load_result) { @@ -151,7 +151,7 @@ void System::Reschedule() { } System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { - LOG_DEBUG(HW_Memory, "initialized OK"); + NGLOG_DEBUG(HW_Memory, "initialized OK"); CoreTiming::Init(); @@ -162,7 +162,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { cpu_core = std::make_shared<ARM_Dynarmic>(); #else cpu_core = std::make_shared<ARM_Unicorn>(); - LOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); + NGLOG_WARNING(Core, "CPU JIT requested, but Dynarmic not available"); #endif } else { cpu_core = std::make_shared<ARM_Unicorn>(); @@ -184,7 +184,7 @@ System::ResultStatus System::Init(EmuWindow* emu_window, u32 system_mode) { return ResultStatus::ErrorVideoCore; } - LOG_DEBUG(Core, "Initialized OK"); + NGLOG_DEBUG(Core, "Initialized OK"); // Reset counters and set time origin to current frame GetAndResetPerfStats(); @@ -218,7 +218,7 @@ void System::Shutdown() { app_loader.reset(); - LOG_DEBUG(Core, "Shutdown OK"); + NGLOG_DEBUG(Core, "Shutdown OK"); } Service::SM::ServiceManager& System::ServiceManager() { diff --git a/src/core/core_timing.h b/src/core/core_timing.h index b9eb38ea4..26e4b1134 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -51,11 +51,11 @@ inline s64 usToCycles(int us) { inline s64 usToCycles(s64 us) { if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { - LOG_ERROR(Core_Timing, "Integer overflow, use max value"); + NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } if (us > MAX_VALUE_TO_MULTIPLY) { - LOG_DEBUG(Core_Timing, "Time very big, do rounding"); + NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (us / 1000000); } return (BASE_CLOCK_RATE * us) / 1000000; @@ -63,11 +63,11 @@ inline s64 usToCycles(s64 us) { inline s64 usToCycles(u64 us) { if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { - LOG_ERROR(Core_Timing, "Integer overflow, use max value"); + NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } if (us > MAX_VALUE_TO_MULTIPLY) { - LOG_DEBUG(Core_Timing, "Time very big, do rounding"); + NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * static_cast<s64>(us / 1000000); } return (BASE_CLOCK_RATE * static_cast<s64>(us)) / 1000000; @@ -83,11 +83,11 @@ inline s64 nsToCycles(int ns) { inline s64 nsToCycles(s64 ns) { if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { - LOG_ERROR(Core_Timing, "Integer overflow, use max value"); + NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } if (ns > MAX_VALUE_TO_MULTIPLY) { - LOG_DEBUG(Core_Timing, "Time very big, do rounding"); + NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (ns / 1000000000); } return (BASE_CLOCK_RATE * ns) / 1000000000; @@ -95,11 +95,11 @@ inline s64 nsToCycles(s64 ns) { inline s64 nsToCycles(u64 ns) { if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { - LOG_ERROR(Core_Timing, "Integer overflow, use max value"); + NGLOG_ERROR(Core_Timing, "Integer overflow, use max value"); return std::numeric_limits<s64>::max(); } if (ns > MAX_VALUE_TO_MULTIPLY) { - LOG_DEBUG(Core_Timing, "Time very big, do rounding"); + NGLOG_DEBUG(Core_Timing, "Time very big, do rounding"); return BASE_CLOCK_RATE * (static_cast<s64>(ns) / 1000000000); } return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; diff --git a/src/core/frontend/input.h b/src/core/frontend/input.h index 8c256beb5..79e52488f 100644 --- a/src/core/frontend/input.h +++ b/src/core/frontend/input.h @@ -59,7 +59,7 @@ template <typename InputDeviceType> void RegisterFactory(const std::string& name, std::shared_ptr<Factory<InputDeviceType>> factory) { auto pair = std::make_pair(name, std::move(factory)); if (!Impl::FactoryList<InputDeviceType>::list.insert(std::move(pair)).second) { - LOG_ERROR(Input, "Factory %s already registered", name.c_str()); + NGLOG_ERROR(Input, "Factory '{}' already registered", name); } } @@ -71,7 +71,7 @@ void RegisterFactory(const std::string& name, std::shared_ptr<Factory<InputDevic template <typename InputDeviceType> void UnregisterFactory(const std::string& name) { if (Impl::FactoryList<InputDeviceType>::list.erase(name) == 0) { - LOG_ERROR(Input, "Factory %s not registered", name.c_str()); + NGLOG_ERROR(Input, "Factory '{}' not registered", name); } } @@ -88,7 +88,7 @@ std::unique_ptr<InputDeviceType> CreateDevice(const std::string& params) { const auto pair = factory_list.find(engine); if (pair == factory_list.end()) { if (engine != "null") { - LOG_ERROR(Input, "Unknown engine name: %s", engine.c_str()); + NGLOG_ERROR(Input, "Unknown engine name: {}", engine); } return std::make_unique<InputDeviceType>(); } diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index cecf0a5cb..02c52bb55 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp @@ -42,14 +42,14 @@ u64 GetTelemetryId() { if (FileUtil::Exists(filename)) { FileUtil::IOFile file(filename, "rb"); if (!file.IsOpen()) { - LOG_ERROR(Core, "failed to open telemetry_id: %s", filename.c_str()); + NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } file.ReadBytes(&telemetry_id, sizeof(u64)); } else { FileUtil::IOFile file(filename, "wb"); if (!file.IsOpen()) { - LOG_ERROR(Core, "failed to open telemetry_id: %s", filename.c_str()); + NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } telemetry_id = GenerateTelemetryId(); @@ -65,7 +65,7 @@ u64 RegenerateTelemetryId() { FileUtil::IOFile file(filename, "wb"); if (!file.IsOpen()) { - LOG_ERROR(Core, "failed to open telemetry_id: %s", filename.c_str()); + NGLOG_ERROR(Core, "failed to open telemetry_id: {}", filename); return {}; } file.WriteBytes(&new_telemetry_id, sizeof(u64)); diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index f3b0d6a8f..2f848c994 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -159,7 +159,7 @@ void Recorder::Finish(const std::string& filename) { throw "Failed to write stream element"; } } catch (const char* str) { - LOG_ERROR(HW_GPU, "Writing CiTrace file failed: %s", str); + NGLOG_ERROR(HW_GPU, "Writing CiTrace file failed: {}", str); } } diff --git a/src/input_common/sdl/sdl.cpp b/src/input_common/sdl/sdl.cpp index 3b87d6b65..231a0f7af 100644 --- a/src/input_common/sdl/sdl.cpp +++ b/src/input_common/sdl/sdl.cpp @@ -32,7 +32,7 @@ public: explicit SDLJoystick(int joystick_index) : joystick{SDL_JoystickOpen(joystick_index), SDL_JoystickClose} { if (!joystick) { - LOG_ERROR(Input, "failed to open joystick %d", joystick_index); + NGLOG_ERROR(Input, "failed to open joystick {}", joystick_index); } } @@ -204,7 +204,7 @@ public: trigger_if_greater = false; } else { trigger_if_greater = true; - LOG_ERROR(Input, "Unknown direction %s", direction_name.c_str()); + NGLOG_ERROR(Input, "Unknown direction '{}'", direction_name); } return std::make_unique<SDLAxisButton>(GetJoystick(joystick_index), axis, threshold, trigger_if_greater); @@ -235,7 +235,7 @@ public: void Init() { if (SDL_Init(SDL_INIT_JOYSTICK) < 0) { - LOG_CRITICAL(Input, "SDL_Init(SDL_INIT_JOYSTICK) failed with: %s", SDL_GetError()); + NGLOG_CRITICAL(Input, "SDL_Init(SDL_INIT_JOYSTICK) failed with: {}", SDL_GetError()); } else { using namespace Input; RegisterFactory<ButtonDevice>("sdl", std::make_shared<SDLButtonFactory>()); diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index f4d11fa5d..f3ca30cfa 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h @@ -19,7 +19,10 @@ namespace Tegra { namespace Shader { struct Register { - // Register 255 is special cased to always be 0 + /// Number of registers + static constexpr size_t NumRegisters = 256; + + /// Register 255 is special cased to always be 0 static constexpr size_t ZeroIndex = 255; constexpr Register() = default; @@ -48,6 +51,11 @@ struct Register { return ~value; } + u64 GetSwizzledIndex(u64 elem) const { + elem = (value + elem) & 3; + return (value & ~3) + elem; + } + private: u64 value{}; }; diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp index 3dffb205d..3716bb782 100644 --- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp +++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp @@ -146,6 +146,90 @@ private: std::string shader_source; }; +/** + * Represents an emulated shader register, used to track the state of that register for emulation + * with GLSL. At this time, a register can be used as a float or an integer. This class is used for + * bookkeeping within the GLSL program. + */ +class GLSLRegister { +public: + GLSLRegister(size_t index, ShaderWriter& shader) + : index{index}, shader{shader}, float_str{"freg_" + std::to_string(index)}, + integer_str{"ireg_" + std::to_string(index)} {} + + /// Returns a GLSL string representing the current state of the register + const std::string& GetActiveString() { + declr_type.insert(active_type); + + switch (active_type) { + case Type::Float: + return float_str; + case Type::Integer: + return integer_str; + } + + UNREACHABLE(); + return float_str; + } + + /// Returns a GLSL string representing the register as a float + const std::string& GetFloatString() const { + ASSERT(IsFloatUsed()); + return float_str; + } + + /// Returns a GLSL string representing the register as an integer + const std::string& GetIntegerString() const { + ASSERT(IsIntegerUsed()); + return integer_str; + } + + /// Convert the current register state from float to integer + void FloatToInteger() { + ASSERT(active_type == Type::Float); + + const std::string src = GetActiveString(); + active_type = Type::Integer; + const std::string dest = GetActiveString(); + + shader.AddLine(dest + " = floatBitsToInt(" + src + ");"); + } + + /// Convert the current register state from integer to float + void IntegerToFloat() { + ASSERT(active_type == Type::Integer); + + const std::string src = GetActiveString(); + active_type = Type::Float; + const std::string dest = GetActiveString(); + + shader.AddLine(dest + " = intBitsToFloat(" + src + ");"); + } + + /// Returns true if the register was ever used as a float, used for register declarations + bool IsFloatUsed() const { + return declr_type.find(Type::Float) != declr_type.end(); + } + + /// Returns true if the register was ever used as an integer, used for register declarations + bool IsIntegerUsed() const { + return declr_type.find(Type::Integer) != declr_type.end(); + } + +private: + enum class Type { + Float, + Integer, + }; + + const size_t index; + const std::string float_str; + const std::string integer_str; + ShaderWriter& shader; + Type active_type{Type::Float}; + std::set<Type> declr_type; +}; + class GLSLGenerator { public: GLSLGenerator(const std::set<Subroutine>& subroutines, const ProgramCode& program_code, @@ -153,6 +237,7 @@ public: : subroutines(subroutines), program_code(program_code), main_offset(main_offset), stage(stage) { + BuildRegisterList(); Generate(); } @@ -166,6 +251,13 @@ public: } private: + /// Build the GLSL register list + void BuildRegisterList() { + for (size_t index = 0; index < Register::NumRegisters; ++index) { + regs.emplace_back(index, shader); + } + } + /// Gets the Subroutine object corresponding to the specified address. const Subroutine& GetSubroutine(u32 begin, u32 end) const { auto iter = subroutines.find(Subroutine{begin, end}); @@ -221,14 +313,11 @@ private: /// Generates code representing a temporary (GPR) register. std::string GetRegister(const Register& reg, unsigned elem = 0) { - if (reg == Register::ZeroIndex) + if (reg == Register::ZeroIndex) { return "0"; - if (stage == Maxwell3D::Regs::ShaderStage::Fragment && reg < 4) { - // GPRs 0-3 are output color for the fragment shader - return std::string{"color."} + "rgba"[(reg + elem) & 3]; } - return *declr_register.insert("register_" + std::to_string(reg + elem)).first; + return regs[reg.GetSwizzledIndex(elem)].GetActiveString(); } /// Generates code representing a uniform (C buffer) register. @@ -628,6 +717,15 @@ private: case OpCode::Id::EXIT: { ASSERT_MSG(instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex), "Predicated exits not implemented"); + + // Final color output is currently hardcoded to GPR0-3 for fragment shaders + if (stage == Maxwell3D::Regs::ShaderStage::Fragment) { + shader.AddLine("color.r = " + GetRegister(0) + ";"); + shader.AddLine("color.g = " + GetRegister(1) + ";"); + shader.AddLine("color.b = " + GetRegister(2) + ";"); + shader.AddLine("color.a = " + GetRegister(3) + ";"); + } + shader.AddLine("return true;"); offset = PROGRAM_END - 1; break; @@ -755,8 +853,13 @@ private: /// Add declarations for registers void GenerateDeclarations() { - for (const auto& reg : declr_register) { - declarations.AddLine("float " + reg + " = 0.0;"); + for (const auto& reg : regs) { + if (reg.IsFloatUsed()) { + declarations.AddLine("float " + reg.GetFloatString() + " = 0.0;"); + } + if (reg.IsIntegerUsed()) { + declarations.AddLine("int " + reg.GetIntegerString() + " = 0;"); + } } declarations.AddNewLine(); @@ -803,9 +906,9 @@ private: ShaderWriter shader; ShaderWriter declarations; + std::vector<GLSLRegister> regs; // Declarations - std::set<std::string> declr_register; std::set<std::string> declr_predicates; std::set<Attribute::Index> declr_input_attribute; std::set<Attribute::Index> declr_output_attribute; diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp index 76ced4de4..bbd681eae 100644 --- a/src/yuzu/game_list.cpp +++ b/src/yuzu/game_list.cpp @@ -315,7 +315,8 @@ void GameList::PopupContextMenu(const QPoint& menu_location) { void GameList::PopulateAsync(const QString& dir_path, bool deep_scan) { if (!FileUtil::Exists(dir_path.toStdString()) || !FileUtil::IsDirectory(dir_path.toStdString())) { - LOG_ERROR(Frontend, "Could not find game list folder at %s", dir_path.toLocal8Bit().data()); + NGLOG_ERROR(Frontend, "Could not find game list folder at {}", + dir_path.toLocal8Bit().data()); search_field->setFilterResult(0, 0); return; } @@ -364,7 +365,7 @@ static bool HasSupportedFileExtension(const std::string& file_name) { void GameList::RefreshGameDirectory() { if (!UISettings::values.gamedir.isEmpty() && current_worker != nullptr) { - LOG_INFO(Frontend, "Change detected in the games directory. Reloading game list."); + NGLOG_INFO(Frontend, "Change detected in the games directory. Reloading game list."); search_field->clear(); PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); } diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 20796e92c..a5d7807e2 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -359,19 +359,17 @@ bool GMainWindow::LoadROM(const QString& filename) { if (result != Core::System::ResultStatus::Success) { switch (result) { case Core::System::ResultStatus::ErrorGetLoader: - LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", - filename.toStdString().c_str()); + NGLOG_CRITICAL(Frontend, "Failed to obtain loader for {}!", filename.toStdString()); QMessageBox::critical(this, tr("Error while loading ROM!"), tr("The ROM format is not supported.")); break; case Core::System::ResultStatus::ErrorUnsupportedArch: - LOG_CRITICAL(Frontend, "Unsupported architecture detected!", - filename.toStdString().c_str()); + NGLOG_CRITICAL(Frontend, "Unsupported architecture detected!", filename.toStdString()); QMessageBox::critical(this, tr("Error while loading ROM!"), tr("The ROM uses currently unusable 32-bit architecture")); break; case Core::System::ResultStatus::ErrorSystemMode: - LOG_CRITICAL(Frontend, "Failed to load ROM!"); + NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); QMessageBox::critical(this, tr("Error while loading ROM!"), tr("Could not determine the system mode.")); break; @@ -859,7 +857,7 @@ void GMainWindow::UpdateUITheme() { QString theme_uri(":" + UISettings::values.theme + "/style.qss"); QFile f(theme_uri); if (!f.exists()) { - LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); + NGLOG_ERROR(Frontend, "Unable to set style, stylesheet file not found"); } else { f.open(QFile::ReadOnly | QFile::Text); QTextStream ts(&f); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 8b479bc6d..675f9cafa 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -27,17 +27,17 @@ bool Config::LoadINI(const std::string& default_contents, bool retry) { const char* location = this->sdl2_config_loc.c_str(); if (sdl2_config->ParseError() < 0) { if (retry) { - LOG_WARNING(Config, "Failed to load %s. Creating file from defaults...", location); + NGLOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); FileUtil::CreateFullPath(location); FileUtil::WriteStringToFile(true, default_contents, location); sdl2_config = std::make_unique<INIReader>(location); // Reopen file return LoadINI(default_contents, false); } - LOG_ERROR(Config, "Failed."); + NGLOG_ERROR(Config, "Failed."); return false; } - LOG_INFO(Config, "Successfully loaded %s", location); + NGLOG_INFO(Config, "Successfully loaded {}", location); return true; } diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 36d40a9b5..b6ed0c498 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -84,7 +84,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { // Initialize the window if (SDL_Init(SDL_INIT_VIDEO) < 0) { - LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); + NGLOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); exit(1); } @@ -107,7 +107,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); if (render_window == nullptr) { - LOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting..."); + NGLOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting..."); exit(1); } @@ -118,12 +118,12 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { gl_context = SDL_GL_CreateContext(render_window); if (gl_context == nullptr) { - LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! Exiting..."); + NGLOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! Exiting..."); exit(1); } if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) { - LOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting..."); + NGLOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting..."); exit(1); } diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 39603e881..f99413966 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -71,7 +71,7 @@ int main(int argc, char** argv) { auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); if (argv_w == nullptr) { - LOG_CRITICAL(Frontend, "Failed to get command line arguments"); + NGLOG_CRITICAL(Frontend, "Failed to get command line arguments"); return -1; } #endif @@ -134,7 +134,7 @@ int main(int argc, char** argv) { SCOPE_EXIT({ MicroProfileShutdown(); }); if (filepath.empty()) { - LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); + NGLOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return -1; } @@ -155,28 +155,28 @@ int main(int argc, char** argv) { switch (load_result) { case Core::System::ResultStatus::ErrorGetLoader: - LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); + NGLOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); return -1; case Core::System::ResultStatus::ErrorLoader: - LOG_CRITICAL(Frontend, "Failed to load ROM!"); + NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: - LOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " - "being used with yuzu. \n\n For more information on dumping and " - "decrypting games, please refer to: " - "https://yuzu-emu.org/wiki/dumping-game-cartridges/"); + NGLOG_CRITICAL(Frontend, "The game that you are trying to load must be decrypted before " + "being used with yuzu. \n\n For more information on dumping and " + "decrypting games, please refer to: " + "https://yuzu-emu.org/wiki/dumping-game-cartridges/"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: - LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); + NGLOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); return -1; case Core::System::ResultStatus::ErrorNotInitialized: - LOG_CRITICAL(Frontend, "CPUCore not initialized"); + NGLOG_CRITICAL(Frontend, "CPUCore not initialized"); return -1; case Core::System::ResultStatus::ErrorSystemMode: - LOG_CRITICAL(Frontend, "Failed to determine system mode!"); + NGLOG_CRITICAL(Frontend, "Failed to determine system mode!"); return -1; case Core::System::ResultStatus::ErrorVideoCore: - LOG_CRITICAL(Frontend, "VideoCore not initialized"); + NGLOG_CRITICAL(Frontend, "VideoCore not initialized"); return -1; case Core::System::ResultStatus::Success: break; // Expected case |