diff options
Diffstat (limited to 'src/yuzu_cmd')
| -rw-r--r-- | src/yuzu_cmd/CMakeLists.txt | 5 | ||||
| -rw-r--r-- | src/yuzu_cmd/config.cpp | 35 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 163 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | 52 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | 34 | ||||
| -rw-r--r-- | src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | 2 | ||||
| -rw-r--r-- | src/yuzu_cmd/yuzu.cpp | 10 |
8 files changed, 196 insertions, 113 deletions
diff --git a/src/yuzu_cmd/CMakeLists.txt b/src/yuzu_cmd/CMakeLists.txt index 4bf25727b..e55a19649 100644 --- a/src/yuzu_cmd/CMakeLists.txt +++ b/src/yuzu_cmd/CMakeLists.txt | |||
| @@ -38,6 +38,11 @@ target_include_directories(yuzu-cmd PRIVATE ${RESOURCES_DIR}) | |||
| 38 | 38 | ||
| 39 | target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) | 39 | target_include_directories(yuzu-cmd PRIVATE ../../externals/Vulkan-Headers/include) |
| 40 | 40 | ||
| 41 | if (YUZU_USE_EXTERNAL_SDL2) | ||
| 42 | target_compile_definitions(yuzu-cmd PRIVATE -DYUZU_USE_EXTERNAL_SDL2) | ||
| 43 | target_include_directories(yuzu-cmd PRIVATE ${PROJECT_BINARY_DIR}/externals/SDL/include) | ||
| 44 | endif() | ||
| 45 | |||
| 41 | if(UNIX AND NOT APPLE) | 46 | if(UNIX AND NOT APPLE) |
| 42 | install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") | 47 | install(TARGETS yuzu-cmd RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") |
| 43 | endif() | 48 | endif() |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 325584a1a..640d7d111 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -242,17 +242,15 @@ static const std::array<int, 8> keyboard_mods{ | |||
| 242 | }; | 242 | }; |
| 243 | 243 | ||
| 244 | template <> | 244 | template <> |
| 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<float>& setting) { | ||
| 246 | setting = sdl2_config->GetReal(group, setting.GetLabel(), setting.GetDefault()); | ||
| 247 | } | ||
| 248 | template <> | ||
| 249 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) { | 245 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<std::string>& setting) { |
| 250 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); | 246 | setting = sdl2_config->Get(group, setting.GetLabel(), setting.GetDefault()); |
| 251 | } | 247 | } |
| 248 | |||
| 252 | template <> | 249 | template <> |
| 253 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) { | 250 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<bool>& setting) { |
| 254 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); | 251 | setting = sdl2_config->GetBoolean(group, setting.GetLabel(), setting.GetDefault()); |
| 255 | } | 252 | } |
| 253 | |||
| 256 | template <typename Type> | 254 | template <typename Type> |
| 257 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) { | 255 | void Config::ReadSetting(const std::string& group, Settings::BasicSetting<Type>& setting) { |
| 258 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), | 256 | setting = static_cast<Type>(sdl2_config->GetInteger(group, setting.GetLabel(), |
| @@ -294,6 +292,8 @@ void Config::ReadValues() { | |||
| 294 | 292 | ||
| 295 | ReadSetting("ControlsGeneral", Settings::values.motion_device); | 293 | ReadSetting("ControlsGeneral", Settings::values.motion_device); |
| 296 | 294 | ||
| 295 | ReadSetting("ControlsGeneral", Settings::values.touch_device); | ||
| 296 | |||
| 297 | ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled); | 297 | ReadSetting("ControlsGeneral", Settings::values.keyboard_enabled); |
| 298 | 298 | ||
| 299 | ReadSetting("ControlsGeneral", Settings::values.debug_pad_enabled); | 299 | ReadSetting("ControlsGeneral", Settings::values.debug_pad_enabled); |
| @@ -416,16 +416,39 @@ void Config::ReadValues() { | |||
| 416 | } | 416 | } |
| 417 | 417 | ||
| 418 | ReadSetting("System", Settings::values.language_index); | 418 | ReadSetting("System", Settings::values.language_index); |
| 419 | ReadSetting("System", Settings::values.region_index); | ||
| 419 | ReadSetting("System", Settings::values.time_zone_index); | 420 | ReadSetting("System", Settings::values.time_zone_index); |
| 421 | ReadSetting("System", Settings::values.sound_index); | ||
| 420 | 422 | ||
| 421 | // Core | 423 | // Core |
| 422 | ReadSetting("Core", Settings::values.use_multi_core); | 424 | ReadSetting("Core", Settings::values.use_multi_core); |
| 423 | 425 | ||
| 426 | // Cpu | ||
| 427 | ReadSetting("Cpu", Settings::values.cpu_accuracy); | ||
| 428 | ReadSetting("Cpu", Settings::values.cpu_debug_mode); | ||
| 429 | ReadSetting("Cpu", Settings::values.cpuopt_page_tables); | ||
| 430 | ReadSetting("Cpu", Settings::values.cpuopt_block_linking); | ||
| 431 | ReadSetting("Cpu", Settings::values.cpuopt_return_stack_buffer); | ||
| 432 | ReadSetting("Cpu", Settings::values.cpuopt_fast_dispatcher); | ||
| 433 | ReadSetting("Cpu", Settings::values.cpuopt_context_elimination); | ||
| 434 | ReadSetting("Cpu", Settings::values.cpuopt_const_prop); | ||
| 435 | ReadSetting("Cpu", Settings::values.cpuopt_misc_ir); | ||
| 436 | ReadSetting("Cpu", Settings::values.cpuopt_reduce_misalign_checks); | ||
| 437 | ReadSetting("Cpu", Settings::values.cpuopt_fastmem); | ||
| 438 | ReadSetting("Cpu", Settings::values.cpuopt_unsafe_unfuse_fma); | ||
| 439 | ReadSetting("Cpu", Settings::values.cpuopt_unsafe_reduce_fp_error); | ||
| 440 | ReadSetting("Cpu", Settings::values.cpuopt_unsafe_ignore_standard_fpcr); | ||
| 441 | ReadSetting("Cpu", Settings::values.cpuopt_unsafe_inaccurate_nan); | ||
| 442 | ReadSetting("Cpu", Settings::values.cpuopt_unsafe_fastmem_check); | ||
| 443 | |||
| 424 | // Renderer | 444 | // Renderer |
| 425 | ReadSetting("Renderer", Settings::values.renderer_backend); | 445 | ReadSetting("Renderer", Settings::values.renderer_backend); |
| 426 | ReadSetting("Renderer", Settings::values.renderer_debug); | 446 | ReadSetting("Renderer", Settings::values.renderer_debug); |
| 447 | ReadSetting("Renderer", Settings::values.enable_nsight_aftermath); | ||
| 448 | ReadSetting("Renderer", Settings::values.disable_shader_loop_safety_checks); | ||
| 427 | ReadSetting("Renderer", Settings::values.vulkan_device); | 449 | ReadSetting("Renderer", Settings::values.vulkan_device); |
| 428 | 450 | ||
| 451 | ReadSetting("Renderer", Settings::values.fullscreen_mode); | ||
| 429 | ReadSetting("Renderer", Settings::values.aspect_ratio); | 452 | ReadSetting("Renderer", Settings::values.aspect_ratio); |
| 430 | ReadSetting("Renderer", Settings::values.max_anisotropy); | 453 | ReadSetting("Renderer", Settings::values.max_anisotropy); |
| 431 | ReadSetting("Renderer", Settings::values.use_frame_limit); | 454 | ReadSetting("Renderer", Settings::values.use_frame_limit); |
| @@ -435,11 +458,12 @@ void Config::ReadValues() { | |||
| 435 | ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); | 458 | ReadSetting("Renderer", Settings::values.use_asynchronous_gpu_emulation); |
| 436 | ReadSetting("Renderer", Settings::values.use_vsync); | 459 | ReadSetting("Renderer", Settings::values.use_vsync); |
| 437 | ReadSetting("Renderer", Settings::values.disable_fps_limit); | 460 | ReadSetting("Renderer", Settings::values.disable_fps_limit); |
| 438 | ReadSetting("Renderer", Settings::values.use_assembly_shaders); | 461 | ReadSetting("Renderer", Settings::values.shader_backend); |
| 439 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); | 462 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); |
| 440 | ReadSetting("Renderer", Settings::values.use_nvdec_emulation); | 463 | ReadSetting("Renderer", Settings::values.use_nvdec_emulation); |
| 441 | ReadSetting("Renderer", Settings::values.accelerate_astc); | 464 | ReadSetting("Renderer", Settings::values.accelerate_astc); |
| 442 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); | 465 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); |
| 466 | ReadSetting("Renderer", Settings::values.use_caches_gc); | ||
| 443 | 467 | ||
| 444 | ReadSetting("Renderer", Settings::values.bg_red); | 468 | ReadSetting("Renderer", Settings::values.bg_red); |
| 445 | ReadSetting("Renderer", Settings::values.bg_green); | 469 | ReadSetting("Renderer", Settings::values.bg_green); |
| @@ -460,7 +484,6 @@ void Config::ReadValues() { | |||
| 460 | // Debugging | 484 | // Debugging |
| 461 | Settings::values.record_frame_times = | 485 | Settings::values.record_frame_times = |
| 462 | sdl2_config->GetBoolean("Debugging", "record_frame_times", false); | 486 | sdl2_config->GetBoolean("Debugging", "record_frame_times", false); |
| 463 | ReadSetting("Debugging", Settings::values.program_args); | ||
| 464 | ReadSetting("Debugging", Settings::values.dump_exefs); | 487 | ReadSetting("Debugging", Settings::values.dump_exefs); |
| 465 | ReadSetting("Debugging", Settings::values.dump_nso); | 488 | ReadSetting("Debugging", Settings::values.dump_nso); |
| 466 | ReadSetting("Debugging", Settings::values.enable_fs_access_log); | 489 | ReadSetting("Debugging", Settings::values.enable_fs_access_log); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index cc9850aad..b7115b06a 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -65,6 +65,13 @@ button_screenshot= | |||
| 65 | lstick= | 65 | lstick= |
| 66 | rstick= | 66 | rstick= |
| 67 | 67 | ||
| 68 | # To use the debug_pad, prepend `debug_pad_` before each button setting above. | ||
| 69 | # i.e. debug_pad_button_a= | ||
| 70 | |||
| 71 | # Enable debug pad inputs to the guest | ||
| 72 | # 0 (default): Disabled, 1: Enabled | ||
| 73 | debug_pad_enabled = | ||
| 74 | |||
| 68 | # Whether to enable or disable vibration | 75 | # Whether to enable or disable vibration |
| 69 | # 0: Disabled, 1 (default): Enabled | 76 | # 0: Disabled, 1 (default): Enabled |
| 70 | vibration_enabled= | 77 | vibration_enabled= |
| @@ -73,6 +80,10 @@ vibration_enabled= | |||
| 73 | # 0 (default): Disabled, 1: Enabled | 80 | # 0 (default): Disabled, 1: Enabled |
| 74 | enable_accurate_vibrations= | 81 | enable_accurate_vibrations= |
| 75 | 82 | ||
| 83 | # Enables controller motion inputs | ||
| 84 | # 0: Disabled, 1 (default): Enabled | ||
| 85 | motion_enabled = | ||
| 86 | |||
| 76 | # for motion input, the following devices are available: | 87 | # for motion input, the following devices are available: |
| 77 | # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: | 88 | # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: |
| 78 | # - "update_period": update period in milliseconds (default to 100) | 89 | # - "update_period": update period in milliseconds (default to 100) |
| @@ -98,19 +109,30 @@ use_touch_from_button= | |||
| 98 | #touch_from_button_maps_0_bind_1=bar | 109 | #touch_from_button_maps_0_bind_1=bar |
| 99 | # etc. | 110 | # etc. |
| 100 | 111 | ||
| 101 | # Most desktop operating systems do not expose a way to poll the motion state of the controllers | 112 | # List of Cemuhook UDP servers, delimited by ','. |
| 102 | # so as a way around it, cemuhook created a udp client/server protocol to broadcast the data directly | 113 | # Default: 127.0.0.1:26760 |
| 103 | # from a controller device to the client program. Citra has a client that can connect and read | 114 | # Example: 127.0.0.1:26760,123.4.5.67:26761 |
| 104 | # from any cemuhook compatible motion program. | 115 | udp_input_servers = |
| 105 | 116 | ||
| 106 | # IPv4 address of the udp input server (Default "127.0.0.1") | 117 | # Enable controlling an axis via a mouse input. |
| 107 | udp_input_address=127.0.0.1 | 118 | # 0 (default): Off, 1: On |
| 119 | mouse_panning = | ||
| 120 | |||
| 121 | # Set mouse sensitivity. | ||
| 122 | # Default: 1.0 | ||
| 123 | mouse_panning_sensitivity = | ||
| 108 | 124 | ||
| 109 | # Port of the udp input server. (Default 26760) | 125 | # Emulate an analog control stick from keyboard inputs. |
| 110 | udp_input_port= | 126 | # 0 (default): Disabled, 1: Enabled |
| 127 | emulate_analog_keyboard = | ||
| 128 | |||
| 129 | # Enable mouse inputs to the guest | ||
| 130 | # 0 (default): Disabled, 1: Enabled | ||
| 131 | mouse_enabled = | ||
| 111 | 132 | ||
| 112 | # The pad to request data on. Should be between 0 (Pad 1) and 3 (Pad 4). (Default 0) | 133 | # Enable keyboard inputs to the guest |
| 113 | udp_pad_index= | 134 | # 0 (default): Disabled, 1: Enabled |
| 135 | keyboard_enabled = | ||
| 114 | 136 | ||
| 115 | [Core] | 137 | [Core] |
| 116 | # Whether to use multi-core for CPU emulation | 138 | # Whether to use multi-core for CPU emulation |
| @@ -118,6 +140,17 @@ udp_pad_index= | |||
| 118 | use_multi_core= | 140 | use_multi_core= |
| 119 | 141 | ||
| 120 | [Cpu] | 142 | [Cpu] |
| 143 | # Adjusts various optimizations. | ||
| 144 | # Auto-select mode enables choice unsafe optimizations. | ||
| 145 | # Accurate enables only safe optimizations. | ||
| 146 | # Unsafe allows any unsafe optimizations. | ||
| 147 | # 0 (default): Auto-select, 1: Accurate, 2: Enable unsafe optimizations | ||
| 148 | cpu_accuracy = | ||
| 149 | |||
| 150 | # Allow disabling safe optimizations. | ||
| 151 | # 0 (default): Disabled, 1: Enabled | ||
| 152 | cpu_debug_mode = | ||
| 153 | |||
| 121 | # Enable inline page tables optimization (faster guest memory access) | 154 | # Enable inline page tables optimization (faster guest memory access) |
| 122 | # 0: Disabled, 1 (default): Enabled | 155 | # 0: Disabled, 1 (default): Enabled |
| 123 | cpuopt_page_tables = | 156 | cpuopt_page_tables = |
| @@ -154,6 +187,31 @@ cpuopt_reduce_misalign_checks = | |||
| 154 | # 0: Disabled, 1 (default): Enabled | 187 | # 0: Disabled, 1 (default): Enabled |
| 155 | cpuopt_fastmem = | 188 | cpuopt_fastmem = |
| 156 | 189 | ||
| 190 | # Enable unfuse FMA (improve performance on CPUs without FMA) | ||
| 191 | # Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select. | ||
| 192 | # 0: Disabled, 1 (default): Enabled | ||
| 193 | cpuopt_unsafe_unfuse_fma = | ||
| 194 | |||
| 195 | # Enable faster FRSQRTE and FRECPE | ||
| 196 | # Only enabled if cpu_accuracy is set to Unsafe. | ||
| 197 | # 0: Disabled, 1 (default): Enabled | ||
| 198 | cpuopt_unsafe_reduce_fp_error = | ||
| 199 | |||
| 200 | # Enable faster ASIMD instructions (32 bits only) | ||
| 201 | # Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select. | ||
| 202 | # 0: Disabled, 1 (default): Enabled | ||
| 203 | cpuopt_unsafe_ignore_standard_fpcr = | ||
| 204 | |||
| 205 | # Enable inaccurate NaN handling | ||
| 206 | # Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select. | ||
| 207 | # 0: Disabled, 1 (default): Enabled | ||
| 208 | cpuopt_unsafe_inaccurate_nan = | ||
| 209 | |||
| 210 | # Disable address space checks (64 bits only) | ||
| 211 | # Only enabled if cpu_accuracy is set to Unsafe. Automatically chosen with cpu_accuracy = Auto-select. | ||
| 212 | # 0: Disabled, 1 (default): Enabled | ||
| 213 | cpuopt_unsafe_fastmem_check = | ||
| 214 | |||
| 157 | [Renderer] | 215 | [Renderer] |
| 158 | # Which backend API to use. | 216 | # Which backend API to use. |
| 159 | # 0 (default): OpenGL, 1: Vulkan | 217 | # 0 (default): OpenGL, 1: Vulkan |
| @@ -163,16 +221,20 @@ backend = | |||
| 163 | # 0 (default): Disabled, 1: Enabled | 221 | # 0 (default): Disabled, 1: Enabled |
| 164 | debug = | 222 | debug = |
| 165 | 223 | ||
| 224 | # Enable Nsight Aftermath crash dumps | ||
| 225 | # 0 (default): Disabled, 1: Enabled | ||
| 226 | nsight_aftermath = | ||
| 227 | |||
| 228 | # Disable shader loop safety checks, executing the shader without loop logic changes | ||
| 229 | # 0 (default): Disabled, 1: Enabled | ||
| 230 | disable_shader_loop_safety_checks = | ||
| 231 | |||
| 166 | # Which Vulkan physical device to use (defaults to 0) | 232 | # Which Vulkan physical device to use (defaults to 0) |
| 167 | vulkan_device = | 233 | vulkan_device = |
| 168 | 234 | ||
| 169 | # Whether to use software or hardware rendering. | 235 | # Whether to use fullscreen or borderless window mode |
| 170 | # 0: Software, 1 (default): Hardware | 236 | # 0 (Windows default): Borderless window, 1 (All other default): Exclusive fullscreen |
| 171 | use_hw_renderer = | 237 | fullscreen_mode = |
| 172 | |||
| 173 | # Whether to use the Just-In-Time (JIT) compiler for shader emulation | ||
| 174 | # 0: Interpreter (slow), 1 (default): JIT (fast) | ||
| 175 | use_shader_jit = | ||
| 176 | 238 | ||
| 177 | # Aspect ratio | 239 | # Aspect ratio |
| 178 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window | 240 | # 0: Default (16:9), 1: Force 4:3, 2: Force 21:9, 3: Stretch to Window |
| @@ -186,9 +248,10 @@ max_anisotropy = | |||
| 186 | # 0 (default): Off, 1: On | 248 | # 0 (default): Off, 1: On |
| 187 | use_vsync = | 249 | use_vsync = |
| 188 | 250 | ||
| 189 | # Whether to use OpenGL assembly shaders or not. NV_gpu_program5 is required. | 251 | # Selects the OpenGL shader backend. NV_gpu_program5 is required for GLASM. If NV_gpu_program5 is |
| 190 | # 0: Off, 1 (default): On | 252 | # not available and GLASM is selected, GLSL will be used. |
| 191 | use_assembly_shaders = | 253 | # 0: GLSL, 1 (default): GLASM, 2: SPIR-V |
| 254 | shader_backend = | ||
| 192 | 255 | ||
| 193 | # Whether to allow asynchronous shader building. | 256 | # Whether to allow asynchronous shader building. |
| 194 | # 0 (default): Off, 1: On | 257 | # 0 (default): Off, 1: On |
| @@ -211,57 +274,31 @@ use_frame_limit = | |||
| 211 | frame_limit = | 274 | frame_limit = |
| 212 | 275 | ||
| 213 | # Whether to use disk based shader cache | 276 | # Whether to use disk based shader cache |
| 214 | # 0 (default): Off, 1 : On | 277 | # 0: Off, 1 (default): On |
| 215 | use_disk_shader_cache = | 278 | use_disk_shader_cache = |
| 216 | 279 | ||
| 217 | # Which gpu accuracy level to use | 280 | # Which gpu accuracy level to use |
| 218 | # 0 (Normal), 1 (High), 2 (Extreme) | 281 | # 0: Normal, 1 (default): High, 2: Extreme (Very slow) |
| 219 | gpu_accuracy = | 282 | gpu_accuracy = |
| 220 | 283 | ||
| 221 | # Whether to use asynchronous GPU emulation | 284 | # Whether to use asynchronous GPU emulation |
| 222 | # 0 : Off (slow), 1 (default): On (fast) | 285 | # 0 : Off (slow), 1 (default): On (fast) |
| 223 | use_asynchronous_gpu_emulation = | 286 | use_asynchronous_gpu_emulation = |
| 224 | 287 | ||
| 225 | # Forces VSync on the display thread. Usually doesn't impact performance, but on some drivers it can | 288 | # Inform the guest that GPU operations completed more quickly than they did. |
| 226 | # so only turn this off if you notice a speed difference. | ||
| 227 | # 0: Off, 1 (default): On | 289 | # 0: Off, 1 (default): On |
| 228 | use_vsync = | 290 | use_fast_gpu_time = |
| 229 | 291 | ||
| 230 | # Whether to use garbage collection or not for GPU caches. | 292 | # Whether to use garbage collection or not for GPU caches. |
| 231 | # 0 (default): Off, 1: On | 293 | # 0 (default): Off, 1: On |
| 232 | use_caches_gc = | 294 | use_caches_gc = |
| 233 | 295 | ||
| 234 | # The clear color for the renderer. What shows up on the sides of the bottom screen. | 296 | # The clear color for the renderer. What shows up on the sides of the bottom screen. |
| 235 | # Must be in range of 0.0-1.0. Defaults to 1.0 for all. | 297 | # Must be in range of 0-255. Defaults to 0 for all. |
| 236 | bg_red = | 298 | bg_red = |
| 237 | bg_blue = | 299 | bg_blue = |
| 238 | bg_green = | 300 | bg_green = |
| 239 | 301 | ||
| 240 | [Layout] | ||
| 241 | # Layout for the screen inside the render window. | ||
| 242 | # 0 (default): Default Top Bottom Screen, 1: Single Screen Only, 2: Large Screen Small Screen | ||
| 243 | layout_option = | ||
| 244 | |||
| 245 | # Toggle custom layout (using the settings below) on or off. | ||
| 246 | # 0 (default): Off, 1: On | ||
| 247 | custom_layout = | ||
| 248 | |||
| 249 | # Screen placement when using Custom layout option | ||
| 250 | # 0x, 0y is the top left corner of the render window. | ||
| 251 | custom_top_left = | ||
| 252 | custom_top_top = | ||
| 253 | custom_top_right = | ||
| 254 | custom_top_bottom = | ||
| 255 | custom_bottom_left = | ||
| 256 | custom_bottom_top = | ||
| 257 | custom_bottom_right = | ||
| 258 | custom_bottom_bottom = | ||
| 259 | |||
| 260 | # Swaps the prominent screen with the other screen. | ||
| 261 | # For example, if Single Screen is chosen, setting this to 1 will display the bottom screen instead of the top screen. | ||
| 262 | # 0 (default): Top Screen is prominent, 1: Bottom Screen is prominent | ||
| 263 | swap_screen = | ||
| 264 | |||
| 265 | [Audio] | 302 | [Audio] |
| 266 | # Which audio output engine to use. | 303 | # Which audio output engine to use. |
| 267 | # auto (default): Auto-select | 304 | # auto (default): Auto-select |
| @@ -281,7 +318,7 @@ enable_audio_stretching = | |||
| 281 | output_device = | 318 | output_device = |
| 282 | 319 | ||
| 283 | # Output volume. | 320 | # Output volume. |
| 284 | # 1.0 (default): 100%, 0.0; mute | 321 | # 100 (default): 100%, 0; mute |
| 285 | volume = | 322 | volume = |
| 286 | 323 | ||
| 287 | [Data Storage] | 324 | [Data Storage] |
| @@ -308,10 +345,6 @@ gamecard_path = | |||
| 308 | # 1 (default): Yes, 0: No | 345 | # 1 (default): Yes, 0: No |
| 309 | use_docked_mode = | 346 | use_docked_mode = |
| 310 | 347 | ||
| 311 | # Allow the use of NFC in games | ||
| 312 | # 1 (default): Yes, 0 : No | ||
| 313 | enable_nfc = | ||
| 314 | |||
| 315 | # Sets the seed for the RNG generator built into the switch | 348 | # Sets the seed for the RNG generator built into the switch |
| 316 | # rng_seed will be ignored and randomly generated if rng_seed_enabled is false | 349 | # rng_seed will be ignored and randomly generated if rng_seed_enabled is false |
| 317 | rng_seed_enabled = | 350 | rng_seed_enabled = |
| @@ -323,10 +356,6 @@ rng_seed = | |||
| 323 | custom_rtc_enabled = | 356 | custom_rtc_enabled = |
| 324 | custom_rtc = | 357 | custom_rtc = |
| 325 | 358 | ||
| 326 | # Sets the account username, max length is 32 characters | ||
| 327 | # yuzu (default) | ||
| 328 | username = yuzu | ||
| 329 | |||
| 330 | # Sets the systems language index | 359 | # Sets the systems language index |
| 331 | # 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese, | 360 | # 0: Japanese, 1: English (default), 2: French, 3: German, 4: Italian, 5: Spanish, 6: Chinese, |
| 332 | # 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French, | 361 | # 7: Korean, 8: Dutch, 9: Portuguese, 10: Russian, 11: Taiwanese, 12: British English, 13: Canadian French, |
| @@ -335,17 +364,25 @@ language_index = | |||
| 335 | 364 | ||
| 336 | # The system region that yuzu will use during emulation | 365 | # The system region that yuzu will use during emulation |
| 337 | # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan | 366 | # -1: Auto-select (default), 0: Japan, 1: USA, 2: Europe, 3: Australia, 4: China, 5: Korea, 6: Taiwan |
| 338 | region_value = | 367 | region_index = |
| 339 | 368 | ||
| 340 | # The system time zone that yuzu will use during emulation | 369 | # The system time zone that yuzu will use during emulation |
| 341 | # 0: Auto-select (default), 1: Default (system archive value), Others: Index for specified time zone | 370 | # 0: Auto-select (default), 1: Default (system archive value), Others: Index for specified time zone |
| 342 | time_zone_index = | 371 | time_zone_index = |
| 343 | 372 | ||
| 373 | # Sets the sound output mode. | ||
| 374 | # 0: Mono, 1 (default): Stereo, 2: Surround | ||
| 375 | sound_index = | ||
| 376 | |||
| 344 | [Miscellaneous] | 377 | [Miscellaneous] |
| 345 | # A filter which removes logs below a certain logging level. | 378 | # A filter which removes logs below a certain logging level. |
| 346 | # Examples: *:Debug Kernel.SVC:Trace Service.*:Critical | 379 | # Examples: *:Debug Kernel.SVC:Trace Service.*:Critical |
| 347 | log_filter = *:Trace | 380 | log_filter = *:Trace |
| 348 | 381 | ||
| 382 | # Use developer keys | ||
| 383 | # 0 (default): Disabled, 1: Enabled | ||
| 384 | use_dev_keys = | ||
| 385 | |||
| 349 | [Debugging] | 386 | [Debugging] |
| 350 | # Record frame time data, can be found in the log directory. Boolean value | 387 | # Record frame time data, can be found in the log directory. Boolean value |
| 351 | record_frame_times = | 388 | record_frame_times = |
| @@ -355,6 +392,8 @@ dump_exefs=false | |||
| 355 | dump_nso=false | 392 | dump_nso=false |
| 356 | # Determines whether or not yuzu will save the filesystem access log. | 393 | # Determines whether or not yuzu will save the filesystem access log. |
| 357 | enable_fs_access_log=false | 394 | enable_fs_access_log=false |
| 395 | # Enables verbose reporting services | ||
| 396 | reporting_services = | ||
| 358 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode | 397 | # Determines whether or not yuzu will report to the game that the emulated console is in Kiosk Mode |
| 359 | # false: Retail/Normal Mode (default), true: Kiosk Mode | 398 | # false: Retail/Normal Mode (default), true: Kiosk Mode |
| 360 | quest_flag = | 399 | quest_flag = |
| @@ -393,4 +432,4 @@ title_ids = | |||
| 393 | # For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|') | 432 | # For each title ID, have a key/value pair called `disabled_<title_id>` equal to the names of the add-ons to disable (sep. by '|') |
| 394 | # e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey | 433 | # e.x. disabled_0100000000010000 = Update|DLC <- disables Updates and DLC on Super Mario Odyssey |
| 395 | )"; | 434 | )"; |
| 396 | } | 435 | } // namespace DefaultINI |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp index 06b20c975..353e51ea7 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.cpp | |||
| @@ -2,18 +2,11 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 6 | #ifdef __clang__ | ||
| 7 | #pragma clang diagnostic push | ||
| 8 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 9 | #endif | ||
| 10 | #include <SDL.h> | 5 | #include <SDL.h> |
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic pop | ||
| 13 | #endif | ||
| 14 | 6 | ||
| 15 | #include "common/logging/log.h" | 7 | #include "common/logging/log.h" |
| 16 | #include "common/scm_rev.h" | 8 | #include "common/scm_rev.h" |
| 9 | #include "common/settings.h" | ||
| 17 | #include "core/core.h" | 10 | #include "core/core.h" |
| 18 | #include "core/perf_stats.h" | 11 | #include "core/perf_stats.h" |
| 19 | #include "input_common/keyboard.h" | 12 | #include "input_common/keyboard.h" |
| @@ -130,24 +123,37 @@ void EmuWindow_SDL2::OnResize() { | |||
| 130 | } | 123 | } |
| 131 | 124 | ||
| 132 | void EmuWindow_SDL2::Fullscreen() { | 125 | void EmuWindow_SDL2::Fullscreen() { |
| 133 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { | 126 | switch (Settings::values.fullscreen_mode.GetValue()) { |
| 134 | return; | 127 | case 1: // Exclusive fullscreen |
| 135 | } | 128 | // Set window size to render size before entering fullscreen -- SDL does not resize to |
| 136 | 129 | // display dimensions in this mode. | |
| 137 | LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); | 130 | // TODO: Multiply the window size by resolution_factor (for both docked modes) |
| 131 | if (Settings::values.use_docked_mode) { | ||
| 132 | SDL_SetWindowSize(render_window, Layout::ScreenDocked::Width, | ||
| 133 | Layout::ScreenDocked::Height); | ||
| 134 | } | ||
| 138 | 135 | ||
| 139 | // Try a different fullscreening method | 136 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN) == 0) { |
| 140 | LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); | 137 | return; |
| 141 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { | 138 | } |
| 142 | return; | ||
| 143 | } | ||
| 144 | 139 | ||
| 145 | LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); | 140 | LOG_ERROR(Frontend, "Fullscreening failed: {}", SDL_GetError()); |
| 141 | LOG_INFO(Frontend, "Attempting to use borderless fullscreen..."); | ||
| 142 | [[fallthrough]]; | ||
| 143 | case 0: // Borderless window | ||
| 144 | if (SDL_SetWindowFullscreen(render_window, SDL_WINDOW_FULLSCREEN_DESKTOP) == 0) { | ||
| 145 | return; | ||
| 146 | } | ||
| 146 | 147 | ||
| 147 | // Fallback algorithm: Maximise window. | 148 | LOG_ERROR(Frontend, "Borderless fullscreening failed: {}", SDL_GetError()); |
| 148 | // Works on all systems (unless something is seriously wrong), so no fallback for this one. | 149 | [[fallthrough]]; |
| 149 | LOG_INFO(Frontend, "Falling back on a maximised window..."); | 150 | default: |
| 150 | SDL_MaximizeWindow(render_window); | 151 | // Fallback algorithm: Maximise window. |
| 152 | // Works on all systems (unless something is seriously wrong), so no fallback for this one. | ||
| 153 | LOG_INFO(Frontend, "Falling back on a maximised window..."); | ||
| 154 | SDL_MaximizeWindow(render_window); | ||
| 155 | break; | ||
| 156 | } | ||
| 151 | } | 157 | } |
| 152 | 158 | ||
| 153 | void EmuWindow_SDL2::WaitEvent() { | 159 | void EmuWindow_SDL2::WaitEvent() { |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp index 837a44be7..eadb41790 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_gl.cpp | |||
| @@ -7,15 +7,7 @@ | |||
| 7 | #include <string> | 7 | #include <string> |
| 8 | 8 | ||
| 9 | #define SDL_MAIN_HANDLED | 9 | #define SDL_MAIN_HANDLED |
| 10 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | ||
| 11 | #ifdef __clang__ | ||
| 12 | #pragma clang diagnostic push | ||
| 13 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 14 | #endif | ||
| 15 | #include <SDL.h> | 10 | #include <SDL.h> |
| 16 | #ifdef __clang__ | ||
| 17 | #pragma clang diagnostic pop | ||
| 18 | #endif | ||
| 19 | 11 | ||
| 20 | #include <fmt/format.h> | 12 | #include <fmt/format.h> |
| 21 | #include <glad/glad.h> | 13 | #include <glad/glad.h> |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp index 3401ad4b4..d1473dbab 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.cpp | |||
| @@ -15,19 +15,16 @@ | |||
| 15 | #include "video_core/renderer_vulkan/renderer_vulkan.h" | 15 | #include "video_core/renderer_vulkan/renderer_vulkan.h" |
| 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" | 16 | #include "yuzu_cmd/emu_window/emu_window_sdl2_vk.h" |
| 17 | 17 | ||
| 18 | // Include these late to avoid polluting everything with Xlib macros | 18 | #ifdef YUZU_USE_EXTERNAL_SDL2 |
| 19 | // Ignore -Wimplicit-fallthrough due to https://github.com/libsdl-org/SDL/issues/4307 | 19 | // Include this before SDL.h to prevent the external from including a dummy |
| 20 | #ifdef __clang__ | 20 | #define USING_GENERATED_CONFIG_H |
| 21 | #pragma clang diagnostic push | 21 | #include <SDL_config.h> |
| 22 | #pragma clang diagnostic ignored "-Wimplicit-fallthrough" | ||
| 23 | #endif | 22 | #endif |
| 23 | |||
| 24 | #include <SDL.h> | 24 | #include <SDL.h> |
| 25 | #ifdef __clang__ | ||
| 26 | #pragma clang diagnostic pop | ||
| 27 | #endif | ||
| 28 | #include <SDL_syswm.h> | 25 | #include <SDL_syswm.h> |
| 29 | 26 | ||
| 30 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem) | 27 | EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen) |
| 31 | : EmuWindow_SDL2{input_subsystem} { | 28 | : EmuWindow_SDL2{input_subsystem} { |
| 32 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, | 29 | const std::string window_title = fmt::format("yuzu {} | {}-{} (Vulkan)", Common::g_build_name, |
| 33 | Common::g_scm_branch, Common::g_scm_desc); | 30 | Common::g_scm_branch, Common::g_scm_desc); |
| @@ -45,12 +42,21 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 45 | 42 | ||
| 46 | SetWindowIcon(); | 43 | SetWindowIcon(); |
| 47 | 44 | ||
| 45 | if (fullscreen) { | ||
| 46 | Fullscreen(); | ||
| 47 | } | ||
| 48 | |||
| 48 | switch (wm.subsystem) { | 49 | switch (wm.subsystem) { |
| 49 | #ifdef SDL_VIDEO_DRIVER_WINDOWS | 50 | #ifdef SDL_VIDEO_DRIVER_WINDOWS |
| 50 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: | 51 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: |
| 51 | window_info.type = Core::Frontend::WindowSystemType::Windows; | 52 | window_info.type = Core::Frontend::WindowSystemType::Windows; |
| 52 | window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window); | 53 | window_info.render_surface = reinterpret_cast<void*>(wm.info.win.window); |
| 53 | break; | 54 | break; |
| 55 | #else | ||
| 56 | case SDL_SYSWM_TYPE::SDL_SYSWM_WINDOWS: | ||
| 57 | LOG_CRITICAL(Frontend, "Window manager subsystem Windows not compiled"); | ||
| 58 | std::exit(EXIT_FAILURE); | ||
| 59 | break; | ||
| 54 | #endif | 60 | #endif |
| 55 | #ifdef SDL_VIDEO_DRIVER_X11 | 61 | #ifdef SDL_VIDEO_DRIVER_X11 |
| 56 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: | 62 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: |
| @@ -58,6 +64,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 58 | window_info.display_connection = wm.info.x11.display; | 64 | window_info.display_connection = wm.info.x11.display; |
| 59 | window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window); | 65 | window_info.render_surface = reinterpret_cast<void*>(wm.info.x11.window); |
| 60 | break; | 66 | break; |
| 67 | #else | ||
| 68 | case SDL_SYSWM_TYPE::SDL_SYSWM_X11: | ||
| 69 | LOG_CRITICAL(Frontend, "Window manager subsystem X11 not compiled"); | ||
| 70 | std::exit(EXIT_FAILURE); | ||
| 71 | break; | ||
| 61 | #endif | 72 | #endif |
| 62 | #ifdef SDL_VIDEO_DRIVER_WAYLAND | 73 | #ifdef SDL_VIDEO_DRIVER_WAYLAND |
| 63 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: | 74 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: |
| @@ -65,6 +76,11 @@ EmuWindow_SDL2_VK::EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsyste | |||
| 65 | window_info.display_connection = wm.info.wl.display; | 76 | window_info.display_connection = wm.info.wl.display; |
| 66 | window_info.render_surface = wm.info.wl.surface; | 77 | window_info.render_surface = wm.info.wl.surface; |
| 67 | break; | 78 | break; |
| 79 | #else | ||
| 80 | case SDL_SYSWM_TYPE::SDL_SYSWM_WAYLAND: | ||
| 81 | LOG_CRITICAL(Frontend, "Window manager subsystem Wayland not compiled"); | ||
| 82 | std::exit(EXIT_FAILURE); | ||
| 83 | break; | ||
| 68 | #endif | 84 | #endif |
| 69 | default: | 85 | default: |
| 70 | LOG_CRITICAL(Frontend, "Window manager subsystem not implemented"); | 86 | LOG_CRITICAL(Frontend, "Window manager subsystem not implemented"); |
diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h index bdfdc3c6f..de53844f0 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2_vk.h | |||
| @@ -19,7 +19,7 @@ class InputSubsystem; | |||
| 19 | 19 | ||
| 20 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { | 20 | class EmuWindow_SDL2_VK final : public EmuWindow_SDL2 { |
| 21 | public: | 21 | public: |
| 22 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem); | 22 | explicit EmuWindow_SDL2_VK(InputCommon::InputSubsystem* input_subsystem, bool fullscreen); |
| 23 | ~EmuWindow_SDL2_VK() override; | 23 | ~EmuWindow_SDL2_VK() override; |
| 24 | 24 | ||
| 25 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; | 25 | std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override; |
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp index 9607cdcb1..35ce23696 100644 --- a/src/yuzu_cmd/yuzu.cpp +++ b/src/yuzu_cmd/yuzu.cpp | |||
| @@ -175,7 +175,7 @@ int main(int argc, char** argv) { | |||
| 175 | emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen); | 175 | emu_window = std::make_unique<EmuWindow_SDL2_GL>(&input_subsystem, fullscreen); |
| 176 | break; | 176 | break; |
| 177 | case Settings::RendererBackend::Vulkan: | 177 | case Settings::RendererBackend::Vulkan: |
| 178 | emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem); | 178 | emu_window = std::make_unique<EmuWindow_SDL2_VK>(&input_subsystem, fullscreen); |
| 179 | break; | 179 | break; |
| 180 | } | 180 | } |
| 181 | 181 | ||
| @@ -218,9 +218,11 @@ int main(int argc, char** argv) { | |||
| 218 | // Core is loaded, start the GPU (makes the GPU contexts current to this thread) | 218 | // Core is loaded, start the GPU (makes the GPU contexts current to this thread) |
| 219 | system.GPU().Start(); | 219 | system.GPU().Start(); |
| 220 | 220 | ||
| 221 | system.Renderer().ReadRasterizer()->LoadDiskResources( | 221 | if (Settings::values.use_disk_shader_cache.GetValue()) { |
| 222 | system.CurrentProcess()->GetTitleID(), std::stop_token{}, | 222 | system.Renderer().ReadRasterizer()->LoadDiskResources( |
| 223 | [](VideoCore::LoadCallbackStage, size_t value, size_t total) {}); | 223 | system.CurrentProcess()->GetTitleID(), std::stop_token{}, |
| 224 | [](VideoCore::LoadCallbackStage, size_t value, size_t total) {}); | ||
| 225 | } | ||
| 224 | 226 | ||
| 225 | void(system.Run()); | 227 | void(system.Run()); |
| 226 | while (emu_window->IsOpen()) { | 228 | while (emu_window->IsOpen()) { |