diff options
Diffstat (limited to 'src/yuzu_cmd')
-rw-r--r-- | src/yuzu_cmd/config.cpp | 8 | ||||
-rw-r--r-- | src/yuzu_cmd/default_ini.h | 6 | ||||
-rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 20 | ||||
-rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 34 |
4 files changed, 40 insertions, 28 deletions
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index ee6e4d658..3a311b69f 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) { - NGLOG_WARNING(Config, "Failed to load {}. Creating file from defaults...", location); + LOG_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); } - NGLOG_ERROR(Config, "Failed."); + LOG_ERROR(Config, "Failed."); return false; } - NGLOG_INFO(Config, "Successfully loaded {}", location); + LOG_INFO(Config, "Successfully loaded {}", location); return true; } @@ -98,6 +98,8 @@ void Config::ReadValues() { (float)sdl2_config->GetReal("Renderer", "resolution_factor", 1.0); Settings::values.toggle_framelimit = sdl2_config->GetBoolean("Renderer", "toggle_framelimit", true); + Settings::values.use_accurate_framebuffers = + sdl2_config->GetBoolean("Renderer", "use_accurate_framebuffers", false); Settings::values.bg_red = (float)sdl2_config->GetReal("Renderer", "bg_red", 0.0); Settings::values.bg_green = (float)sdl2_config->GetReal("Renderer", "bg_green", 0.0); diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index 1c438c3f5..71d2e040f 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h @@ -102,6 +102,10 @@ resolution_factor = # 0 (default): Off, 1: On use_vsync = +# Whether to use accurate framebuffers +# 0 (default): Off (fast), 1 : On (slow) +use_accurate_framebuffers = + # The clear color for the renderer. What shows up on the sides of the bottom screen. # Must be in range of 0.0-1.0. Defaults to 1.0 for all. bg_red = @@ -162,7 +166,7 @@ use_virtual_sd = # 1 (default): Yes, 0: No use_docked_mode = -# The system region that Citra will use during emulation +# The system region that yuzu will use during emulation # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan region_value = diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index cfd8eb7e6..e6f0bbe8f 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp @@ -62,19 +62,19 @@ void EmuWindow_SDL2::Fullscreen() { return; } - NGLOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); + LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); // Try a different fullscreening method - NGLOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); + LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { return; } - NGLOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); + LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); // Fallback algorithm: Maximise window. // Works on all systems (unless something is seriously wrong), so no fallback for this one. - NGLOG_INFO(Frontend, "Falling back on a maximised window..."); + LOG_INFO(Frontend, "Falling back on a maximised window..."); SDL_MaximizeWindow(render_window); } @@ -91,7 +91,7 @@ bool EmuWindow_SDL2::SupportsRequiredGLExtensions() { unsupported_ext.push_back("ARB_vertex_attrib_binding"); for (const std::string& ext : unsupported_ext) - NGLOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); + LOG_CRITICAL(Frontend, "Unsupported GL extension: {}", ext); return unsupported_ext.empty(); } @@ -103,7 +103,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { // Initialize the window if (SDL_Init(SDL_INIT_VIDEO) < 0) { - NGLOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); + LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting..."); exit(1); } @@ -126,7 +126,7 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); if (render_window == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting..."); + LOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting..."); exit(1); } @@ -137,17 +137,17 @@ EmuWindow_SDL2::EmuWindow_SDL2(bool fullscreen) { gl_context = SDL_GL_CreateContext(render_window); if (gl_context == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! Exiting..."); + LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! Exiting..."); exit(1); } if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) { - NGLOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting..."); + LOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting..."); exit(1); } if (!SupportsRequiredGLExtensions()) { - NGLOG_CRITICAL(Frontend, "GPU does not support all required OpenGL extensions! Exiting..."); + LOG_CRITICAL(Frontend, "GPU does not support all required OpenGL extensions! Exiting..."); exit(1); } diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 95e568b7b..8ddd202d8 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -7,6 +7,7 @@ #include <string> #include <thread> +#include "common/common_paths.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" @@ -69,7 +70,7 @@ int main(int argc, char** argv) { auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); if (argv_w == nullptr) { - NGLOG_CRITICAL(Frontend, "Failed to get command line arguments"); + LOG_CRITICAL(Frontend, "Failed to get command line arguments"); return -1; } #endif @@ -102,7 +103,7 @@ int main(int argc, char** argv) { break; case 'f': fullscreen = true; - NGLOG_INFO(Frontend, "Starting in fullscreen mode..."); + LOG_INFO(Frontend, "Starting in fullscreen mode..."); break; case 'h': PrintHelp(argv[0]); @@ -126,13 +127,18 @@ int main(int argc, char** argv) { #endif Log::Filter log_filter(Log::Level::Debug); - Log::SetFilter(&log_filter); + Log::SetGlobalFilter(log_filter); + + Log::AddBackend(std::make_unique<Log::ColorConsoleBackend>()); + FileUtil::CreateFullPath(FileUtil::GetUserPath(D_LOGS_IDX)); + Log::AddBackend( + std::make_unique<Log::FileBackend>(FileUtil::GetUserPath(D_LOGS_IDX) + LOG_FILE)); MicroProfileOnThreadCreate("EmuThread"); SCOPE_EXIT({ MicroProfileShutdown(); }); if (filepath.empty()) { - NGLOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); + LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified"); return -1; } @@ -153,28 +159,28 @@ int main(int argc, char** argv) { switch (load_result) { case Core::System::ResultStatus::ErrorGetLoader: - NGLOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); + LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filepath.c_str()); return -1; case Core::System::ResultStatus::ErrorLoader: - NGLOG_CRITICAL(Frontend, "Failed to load ROM!"); + LOG_CRITICAL(Frontend, "Failed to load ROM!"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorEncrypted: - 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/"); + 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/"); return -1; case Core::System::ResultStatus::ErrorLoader_ErrorInvalidFormat: - NGLOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); + LOG_CRITICAL(Frontend, "Error while loading ROM: The ROM format is not supported."); return -1; case Core::System::ResultStatus::ErrorNotInitialized: - NGLOG_CRITICAL(Frontend, "CPUCore not initialized"); + LOG_CRITICAL(Frontend, "CPUCore not initialized"); return -1; case Core::System::ResultStatus::ErrorSystemMode: - NGLOG_CRITICAL(Frontend, "Failed to determine system mode!"); + LOG_CRITICAL(Frontend, "Failed to determine system mode!"); return -1; case Core::System::ResultStatus::ErrorVideoCore: - NGLOG_CRITICAL(Frontend, "VideoCore not initialized"); + LOG_CRITICAL(Frontend, "VideoCore not initialized"); return -1; case Core::System::ResultStatus::Success: break; // Expected case |