From 713b5f6bed3c997275ee57d472def7af7e6bb77f Mon Sep 17 00:00:00 2001 From: lizzie Date: Wed, 10 Jun 2026 00:06:37 +0000 Subject: [PATCH] --null-renderer --- docs/user/CommandLine.md | 1 + src/yuzu_cmd/yuzu.cpp | 10 ++++++++++ tools/miniserver.js | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/user/CommandLine.md b/docs/user/CommandLine.md index 6e1f0f237c..795d4d82a0 100644 --- a/docs/user/CommandLine.md +++ b/docs/user/CommandLine.md @@ -27,3 +27,4 @@ There are two main applications, an SDL-based app (`eden-cli`) and a Qt based ap - `--user/-u`: Specify the user index. - `--version/-v`: Display version and quit. - `--input-profile/-i`: Specifies input profile name to use (for player #0 only). +- `--null-render/-n`: Forces the usage of the "Null" render backend irrespective of settings. diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index aa94de0a80..b985a9e368 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp @@ -8,6 +8,7 @@ #include #include #include +#include "common/settings_enums.h" #ifdef __EMSCRIPTEN__ #include #endif @@ -214,6 +215,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { std::optional override_gdb_port{}; bool use_multiplayer = false; bool fullscreen = false; + bool force_null_render = false; std::string nickname{}; std::string password{}; std::string address{}; @@ -232,6 +234,7 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { {"user", required_argument, 0, 'u'}, {"version", no_argument, 0, 'v'}, {"input-profile", no_argument, 0, 'i'}, + {"null-render", no_argument, 0, 'n'}, {0, 0, 0, 0}, // clang-format on }; @@ -302,6 +305,9 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { case 'v': PrintVersion(); return SDL_APP_FAILURE; + case 'n': + force_null_render = true; + break; } } else { #ifdef _WIN32 @@ -339,6 +345,10 @@ extern "C" SDL_AppResult SDL_AppInit(void **appstate, int argc, char **argv) { Settings::values.gdbstub_port = *override_gdb_port; } + if (force_null_render) { + Settings::values.renderer_backend = Settings::RendererBackend::Null; + } + #ifdef _WIN32 LocalFree(argv_w); #endif diff --git a/tools/miniserver.js b/tools/miniserver.js index f16d463573..96dee9aa3a 100755 --- a/tools/miniserver.js +++ b/tools/miniserver.js @@ -48,7 +48,7 @@ var Module = { //do not prepend var }; var tty_stdout = document.createElement('div'); document.body.appendChild(tty_stdout); -Module.arguments = ['game.nro']; +Module.arguments = ['--null-render', 'game.nro']; var gameNroFileBuffer = {};