summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.ci/scripts/linux/docker.sh2
-rwxr-xr-x.ci/scripts/windows/docker.sh2
-rw-r--r--.ci/templates/build-msvc.yml2
-rwxr-xr-x.travis/linux/build.sh2
-rw-r--r--CMakeLists.txt31
m---------externals/cubeb0
-rw-r--r--src/audio_core/cubeb_sink.cpp1
-rw-r--r--src/common/CMakeLists.txt1
-rw-r--r--src/common/scope_exit.h2
-rw-r--r--src/common/telemetry.h4
-rw-r--r--src/common/x64/xbyak_abi.h20
-rw-r--r--src/core/CMakeLists.txt1
-rw-r--r--src/core/core.cpp5
-rw-r--r--src/core/file_sys/common_funcs.h56
-rw-r--r--src/core/file_sys/content_archive.cpp31
-rw-r--r--src/core/file_sys/content_archive.h8
-rw-r--r--src/core/file_sys/nca_patch.cpp2
-rw-r--r--src/core/file_sys/nca_patch.h2
-rw-r--r--src/core/file_sys/patch_manager.cpp4
-rw-r--r--src/core/file_sys/romfs_factory.cpp22
-rw-r--r--src/core/file_sys/romfs_factory.h4
-rw-r--r--src/core/file_sys/system_archive/data/font_nintendo_extended.cpp555
-rw-r--r--src/core/file_sys/system_archive/data/font_nintendo_extended.h2
-rw-r--r--src/core/file_sys/vfs.cpp32
-rw-r--r--src/core/file_sys/vfs.h44
-rw-r--r--src/core/file_sys/vfs_concat.cpp18
-rw-r--r--src/core/file_sys/vfs_concat.h2
-rw-r--r--src/core/file_sys/vfs_layered.cpp24
-rw-r--r--src/core/file_sys/vfs_layered.h18
-rw-r--r--src/core/file_sys/vfs_offset.cpp4
-rw-r--r--src/core/file_sys/vfs_offset.h6
-rw-r--r--src/core/file_sys/vfs_real.cpp24
-rw-r--r--src/core/file_sys/vfs_real.h24
-rw-r--r--src/core/file_sys/vfs_static.h2
-rw-r--r--src/core/file_sys/vfs_vector.cpp12
-rw-r--r--src/core/file_sys/vfs_vector.h26
-rw-r--r--src/core/file_sys/xts_archive.cpp6
-rw-r--r--src/core/file_sys/xts_archive.h6
-rw-r--r--src/core/frontend/applets/error.cpp7
-rw-r--r--src/core/hle/ipc_helpers.h67
-rw-r--r--src/core/hle/kernel/memory/memory_block.h6
-rw-r--r--src/core/hle/kernel/memory/memory_block_manager.h4
-rw-r--r--src/core/hle/kernel/physical_core.h2
-rw-r--r--src/core/hle/kernel/process_capability.cpp2
-rw-r--r--src/core/hle/kernel/resource_limit.cpp4
-rw-r--r--src/core/hle/kernel/server_session.cpp3
-rw-r--r--src/core/hle/kernel/svc.cpp60
-rw-r--r--src/core/hle/service/am/am.cpp12
-rw-r--r--src/core/hle/service/am/applets/controller.cpp23
-rw-r--r--src/core/hle/service/am/applets/error.cpp4
-rw-r--r--src/core/hle/service/am/applets/general_backend.cpp6
-rw-r--r--src/core/hle/service/aoc/aoc_u.cpp88
-rw-r--r--src/core/hle/service/aoc/aoc_u.h2
-rw-r--r--src/core/hle/service/apm/controller.cpp3
-rw-r--r--src/core/hle/service/apm/interface.cpp7
-rw-r--r--src/core/hle/service/bcat/backend/boxcat.cpp2
-rw-r--r--src/core/hle/service/fatal/fatal.cpp5
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp41
-rw-r--r--src/core/hle/service/filesystem/filesystem.h4
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.cpp57
-rw-r--r--src/core/hle/service/filesystem/fsp_srv.h1
-rw-r--r--src/core/hle/service/friend/friend.cpp3
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp41
-rw-r--r--src/core/hle/service/hid/controllers/npad.h4
-rw-r--r--src/core/hle/service/lm/lm.cpp2
-rw-r--r--src/core/hle/service/ncm/ncm.cpp2
-rw-r--r--src/core/hle/service/nim/nim.cpp14
-rw-r--r--src/core/hle/service/ns/pl_u.cpp9
-rw-r--r--src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h33
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.cpp116
-rw-r--r--src/core/hle/service/nvflinger/buffer_queue.h3
-rw-r--r--src/core/hle/service/prepo/prepo.cpp4
-rw-r--r--src/core/hle/service/service.cpp2
-rw-r--r--src/core/hle/service/set/set_sys.cpp4
-rw-r--r--src/core/hle/service/sockets/bsd.cpp14
-rw-r--r--src/core/hle/service/sockets/sockets.h23
-rw-r--r--src/core/hle/service/sockets/sockets_translate.cpp62
-rw-r--r--src/core/hle/service/sockets/sockets_translate.h4
-rw-r--r--src/core/hle/service/vi/vi.cpp30
-rw-r--r--src/core/loader/deconstructed_rom_directory.h2
-rw-r--r--src/core/loader/elf.h2
-rw-r--r--src/core/loader/kip.h2
-rw-r--r--src/core/loader/nax.h2
-rw-r--r--src/core/loader/nca.h2
-rw-r--r--src/core/loader/nro.h2
-rw-r--r--src/core/loader/nso.h2
-rw-r--r--src/core/loader/nsp.h2
-rw-r--r--src/core/loader/xci.h2
-rw-r--r--src/core/memory.cpp2
-rw-r--r--src/core/network/network.cpp62
-rw-r--r--src/core/network/network.h24
-rw-r--r--src/core/network/sockets.h4
-rw-r--r--src/core/settings.cpp2
-rw-r--r--src/core/settings.h2
-rwxr-xr-xsrc/input_common/analog_from_button.cpp22
-rw-r--r--src/video_core/CMakeLists.txt9
-rw-r--r--src/video_core/buffer_cache/buffer_block.h19
-rw-r--r--src/video_core/buffer_cache/buffer_cache.h2
-rw-r--r--src/video_core/buffer_cache/map_interval.h3
-rw-r--r--src/video_core/command_classes/codecs/codec.cpp4
-rw-r--r--src/video_core/command_classes/vic.cpp2
-rw-r--r--src/video_core/dirty_flags.cpp2
-rw-r--r--src/video_core/engines/fermi_2d.cpp3
-rw-r--r--src/video_core/engines/maxwell_3d.cpp11
-rw-r--r--src/video_core/engines/maxwell_3d.h67
-rw-r--r--src/video_core/engines/maxwell_dma.h12
-rw-r--r--src/video_core/engines/shader_bytecode.h6
-rw-r--r--src/video_core/gpu.cpp8
-rw-r--r--src/video_core/macro/macro_interpreter.cpp7
-rw-r--r--src/video_core/macro/macro_jit_x64.cpp5
-rw-r--r--src/video_core/query_cache.h8
-rw-r--r--src/video_core/renderer_opengl/gl_arb_decompiler.cpp12
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.cpp32
-rw-r--r--src/video_core/renderer_opengl/gl_buffer_cache.h14
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.cpp23
-rw-r--r--src/video_core/renderer_opengl/gl_query_cache.h10
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp14
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h8
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.cpp9
-rw-r--r--src/video_core/renderer_opengl/gl_shader_cache.h9
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.cpp12
-rw-r--r--src/video_core/renderer_opengl/gl_shader_decompiler.h4
-rw-r--r--src/video_core/renderer_opengl/gl_shader_disk_cache.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_state_tracker.cpp2
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.cpp21
-rw-r--r--src/video_core/renderer_opengl/gl_texture_cache.h6
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h30
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp6
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.h8
-rw-r--r--src/video_core/renderer_vulkan/maxwell_to_vk.cpp37
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.cpp110
-rw-r--r--src/video_core/renderer_vulkan/vk_buffer_cache.h16
-rw-r--r--src/video_core/renderer_vulkan/vk_command_pool.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_command_pool.h2
-rw-r--r--src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.cpp21
-rw-r--r--src/video_core/renderer_vulkan/vk_pipeline_cache.h20
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.cpp22
-rw-r--r--src/video_core/renderer_vulkan/vk_query_cache.h4
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.cpp14
-rw-r--r--src/video_core/renderer_vulkan/vk_rasterizer.h10
-rw-r--r--src/video_core/renderer_vulkan/vk_shader_decompiler.cpp11
-rw-r--r--src/video_core/renderer_vulkan/vk_state_tracker.cpp2
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.cpp12
-rw-r--r--src/video_core/renderer_vulkan/vk_texture_cache.h11
-rw-r--r--src/video_core/shader/ast.cpp13
-rw-r--r--src/video_core/shader/ast.h31
-rw-r--r--src/video_core/shader/async_shaders.cpp2
-rw-r--r--src/video_core/shader/async_shaders.h2
-rw-r--r--src/video_core/shader/control_flow.cpp14
-rw-r--r--src/video_core/shader/control_flow.h14
-rw-r--r--src/video_core/shader/decode.cpp6
-rw-r--r--src/video_core/shader/decode/arithmetic.cpp3
-rw-r--r--src/video_core/shader/decode/arithmetic_integer.cpp9
-rw-r--r--src/video_core/shader/decode/arithmetic_integer_immediate.cpp5
-rw-r--r--src/video_core/shader/decode/conversion.cpp4
-rw-r--r--src/video_core/shader/decode/memory.cpp25
-rw-r--r--src/video_core/shader/decode/other.cpp34
-rw-r--r--src/video_core/shader/decode/shift.cpp2
-rw-r--r--src/video_core/shader/decode/texture.cpp9
-rw-r--r--src/video_core/shader/decode/warp.cpp2
-rw-r--r--src/video_core/shader/expr.h6
-rw-r--r--src/video_core/shader/node.h16
-rw-r--r--src/video_core/shader/node_helper.cpp2
-rw-r--r--src/video_core/shader/shader_ir.cpp21
-rw-r--r--src/video_core/shader/shader_ir.h8
-rw-r--r--src/video_core/surface.cpp12
-rw-r--r--src/video_core/texture_cache/copy_params.h18
-rw-r--r--src/video_core/texture_cache/format_lookup_table.cpp12
-rw-r--r--src/video_core/texture_cache/surface_base.cpp8
-rw-r--r--src/video_core/texture_cache/surface_base.h10
-rw-r--r--src/video_core/texture_cache/surface_params.cpp4
-rw-r--r--src/video_core/texture_cache/surface_view.h10
-rw-r--r--src/video_core/texture_cache/texture_cache.h5
-rw-r--r--src/video_core/textures/convert.cpp2
-rw-r--r--src/video_core/textures/texture.h2
-rw-r--r--src/yuzu/applets/controller.cpp4
-rw-r--r--src/yuzu/applets/controller.h2
-rw-r--r--src/yuzu/applets/error.cpp6
-rw-r--r--src/yuzu/applets/profile_select.cpp4
-rw-r--r--src/yuzu/applets/profile_select.h2
-rw-r--r--src/yuzu/applets/software_keyboard.cpp4
-rw-r--r--src/yuzu/applets/software_keyboard.h2
-rw-r--r--src/yuzu/applets/web_browser.cpp8
-rw-r--r--src/yuzu/applets/web_browser.h4
-rw-r--r--src/yuzu/configuration/config.cpp9
-rw-r--r--src/yuzu/configuration/configure_debug.cpp5
-rw-r--r--src/yuzu/configuration/configure_debug.ui74
-rw-r--r--src/yuzu/configuration/configure_input_advanced.cpp2
-rw-r--r--src/yuzu/configuration/configure_input_advanced.ui31
-rw-r--r--src/yuzu/configuration/configure_motion_touch.cpp4
-rw-r--r--src/yuzu/game_list_p.h3
-rw-r--r--src/yuzu/main.cpp7
-rw-r--r--src/yuzu_cmd/config.cpp4
-rw-r--r--src/yuzu_cmd/default_ini.h3
-rw-r--r--src/yuzu_cmd/yuzu.cpp24
-rw-r--r--src/yuzu_tester/config.cpp1
-rw-r--r--src/yuzu_tester/yuzu.cpp1
198 files changed, 1749 insertions, 1377 deletions
diff --git a/.ci/scripts/linux/docker.sh b/.ci/scripts/linux/docker.sh
index 05f6ffe7d..e0c018cfd 100755
--- a/.ci/scripts/linux/docker.sh
+++ b/.ci/scripts/linux/docker.sh
@@ -5,7 +5,7 @@ cd /yuzu
5ccache -s 5ccache -s
6 6
7mkdir build || true && cd build 7mkdir build || true && cd build
8cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DYUZU_USE_BUNDLED_UNICORN=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON 8cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${ENABLE_COMPATIBILITY_REPORTING:-"OFF"} -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DUSE_DISCORD_PRESENCE=ON -DENABLE_QT_TRANSLATION=ON
9 9
10ninja 10ninja
11 11
diff --git a/.ci/scripts/windows/docker.sh b/.ci/scripts/windows/docker.sh
index adfd636fa..2bc9f36ab 100755
--- a/.ci/scripts/windows/docker.sh
+++ b/.ci/scripts/windows/docker.sh
@@ -5,7 +5,7 @@ cd /yuzu
5ccache -s 5ccache -s
6 6
7mkdir build || true && cd build 7mkdir build || true && cd build
8cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DYUZU_USE_BUNDLED_UNICORN=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON 8cmake .. -G Ninja -DDISPLAY_VERSION=$1 -DCMAKE_TOOLCHAIN_FILE="$(pwd)/../CMakeModules/MinGWCross.cmake" -DUSE_CCACHE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_QT_TRANSLATION=ON
9ninja 9ninja
10 10
11ccache -s 11ccache -s
diff --git a/.ci/templates/build-msvc.yml b/.ci/templates/build-msvc.yml
index 0b4bbd341..33ff8201f 100644
--- a/.ci/templates/build-msvc.yml
+++ b/.ci/templates/build-msvc.yml
@@ -8,7 +8,7 @@ steps:
8 displayName: 'Install vulkan-sdk' 8 displayName: 'Install vulkan-sdk'
9- script: python -m pip install --upgrade pip conan 9- script: python -m pip install --upgrade pip conan
10 displayName: 'Install conan' 10 displayName: 'Install conan'
11- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 16 2019" -A x64 --config Release -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_BUNDLED_UNICORN=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DUSE_DISCORD_PRESENCE=ON -DDISPLAY_VERSION=${{ parameters['version'] }} .. && cd .. 11- script: refreshenv && mkdir build && cd build && cmake -G "Visual Studio 16 2019" -A x64 --config Release -DYUZU_USE_BUNDLED_QT=1 -DYUZU_USE_QT_WEB_ENGINE=ON -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DYUZU_ENABLE_COMPATIBILITY_REPORTING=${COMPAT} -DUSE_DISCORD_PRESENCE=ON -DDISPLAY_VERSION=${{ parameters['version'] }} .. && cd ..
12 displayName: 'Configure CMake' 12 displayName: 'Configure CMake'
13- task: MSBuild@1 13- task: MSBuild@1
14 displayName: 'Build' 14 displayName: 'Build'
diff --git a/.travis/linux/build.sh b/.travis/linux/build.sh
index 3929f97fc..0c7fb8c9d 100755
--- a/.travis/linux/build.sh
+++ b/.travis/linux/build.sh
@@ -1,4 +1,4 @@
1#!/bin/bash -ex 1#!/bin/bash -ex
2 2
3mkdir -p "$HOME/.ccache" 3mkdir -p "$HOME/.ccache"
4docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.travis/linux/docker.sh 4docker run -e ENABLE_COMPATIBILITY_REPORTING --env-file .travis/common/travis-ci.env -v $(pwd):/yuzu -v "$HOME/.ccache":/home/yuzu/.ccache yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.travis/linux/docker.sh
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 273260378..66bbd985a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -113,6 +113,9 @@ if (NOT DEFINED ARCHITECTURE)
113endif() 113endif()
114message(STATUS "Target architecture: ${ARCHITECTURE}") 114message(STATUS "Target architecture: ${ARCHITECTURE}")
115 115
116if (UNIX)
117 add_definitions(-DYUZU_UNIX=1)
118endif()
116 119
117# Configure C++ standard 120# Configure C++ standard
118# =========================== 121# ===========================
@@ -157,7 +160,6 @@ macro(yuzu_find_packages)
157 # Capitalization matters here. We need the naming to match the generated paths from Conan 160 # Capitalization matters here. We need the naming to match the generated paths from Conan
158 set(REQUIRED_LIBS 161 set(REQUIRED_LIBS
159 # Cmake Pkg Prefix Version Conan Pkg 162 # Cmake Pkg Prefix Version Conan Pkg
160 "Boost 1.73 boost/1.73.0"
161 "Catch2 2.13 catch2/2.13.0" 163 "Catch2 2.13 catch2/2.13.0"
162 "fmt 7.1 fmt/7.1.2" 164 "fmt 7.1 fmt/7.1.2"
163 # can't use until https://github.com/bincrafters/community/issues/1173 165 # can't use until https://github.com/bincrafters/community/issues/1173
@@ -192,6 +194,22 @@ macro(yuzu_find_packages)
192 unset(FN_FORCE_REQUIRED) 194 unset(FN_FORCE_REQUIRED)
193endmacro() 195endmacro()
194 196
197find_package(Boost 1.73.0 COMPONENTS context headers QUIET)
198if (Boost_FOUND)
199 set(Boost_LIBRARIES Boost::boost)
200 # Conditionally add Boost::context only if the active version of the Conan or system Boost package provides it
201 # The old version is missing Boost::context, so we want to avoid adding in that case
202 # The new version requires adding Boost::context to prevent linking issues
203 #
204 # This one is used by Conan on subsequent CMake configures, not the first configure.
205 if (TARGET Boost::context)
206 list(APPEND Boost_LIBRARIES Boost::context)
207 endif()
208else()
209 message(STATUS "Boost 1.73.0 or newer not found, falling back to Conan")
210 list(APPEND CONAN_REQUIRED_LIBS "boost/1.73.0")
211endif()
212
195# Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS 213# Attempt to locate any packages that are required and report the missing ones in CONAN_REQUIRED_LIBS
196yuzu_find_packages() 214yuzu_find_packages()
197 215
@@ -296,6 +314,17 @@ if (CONAN_REQUIRED_LIBS)
296 # this time with required, so we bail if its not found. 314 # this time with required, so we bail if its not found.
297 yuzu_find_packages(FORCE_REQUIRED) 315 yuzu_find_packages(FORCE_REQUIRED)
298 316
317 if (NOT Boost_FOUND)
318 find_package(Boost 1.73.0 REQUIRED COMPONENTS context headers)
319 set(Boost_LIBRARIES Boost::boost)
320 # Conditionally add Boost::context only if the active version of the Conan Boost package provides it
321 # The old version is missing Boost::context, so we want to avoid adding in that case
322 # The new version requires adding Boost::context to prevent linking issues
323 if (TARGET Boost::context)
324 list(APPEND Boost_LIBRARIES Boost::context)
325 endif()
326 endif()
327
299 # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function 328 # Due to issues with variable scopes in functions, we need to also find_package(qt5) outside of the function
300 if(ENABLE_QT) 329 if(ENABLE_QT)
301 list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}") 330 list(APPEND CMAKE_MODULE_PATH "${CONAN_QT_ROOT_RELEASE}")
diff --git a/externals/cubeb b/externals/cubeb
Subproject 616d773441b5355800ce64197a699e6cd6b3617 Subproject 1d66483ad2b93f0e00e175f9480c771af90003a
diff --git a/src/audio_core/cubeb_sink.cpp b/src/audio_core/cubeb_sink.cpp
index cf7b186e4..043447eaa 100644
--- a/src/audio_core/cubeb_sink.cpp
+++ b/src/audio_core/cubeb_sink.cpp
@@ -30,6 +30,7 @@ public:
30 params.rate = sample_rate; 30 params.rate = sample_rate;
31 params.channels = num_channels; 31 params.channels = num_channels;
32 params.format = CUBEB_SAMPLE_S16NE; 32 params.format = CUBEB_SAMPLE_S16NE;
33 params.prefs = CUBEB_STREAM_PREF_PERSIST;
33 switch (num_channels) { 34 switch (num_channels) {
34 case 1: 35 case 1:
35 params.layout = CUBEB_LAYOUT_MONO; 36 params.layout = CUBEB_LAYOUT_MONO;
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 8e51104a1..943ff996e 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -209,7 +209,6 @@ else()
209endif() 209endif()
210 210
211create_target_directory_groups(common) 211create_target_directory_groups(common)
212find_package(Boost 1.71 COMPONENTS context headers REQUIRED)
213 212
214target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile) 213target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile)
215target_link_libraries(common PRIVATE lz4::lz4 xbyak) 214target_link_libraries(common PRIVATE lz4::lz4 xbyak)
diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h
index 68ef5f197..fa46cb394 100644
--- a/src/common/scope_exit.h
+++ b/src/common/scope_exit.h
@@ -10,7 +10,7 @@
10namespace detail { 10namespace detail {
11template <typename Func> 11template <typename Func>
12struct ScopeExitHelper { 12struct ScopeExitHelper {
13 explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {} 13 explicit ScopeExitHelper(Func&& func_) : func(std::move(func_)) {}
14 ~ScopeExitHelper() { 14 ~ScopeExitHelper() {
15 if (active) { 15 if (active) {
16 func(); 16 func();
diff --git a/src/common/telemetry.h b/src/common/telemetry.h
index a50c5d1de..49186e848 100644
--- a/src/common/telemetry.h
+++ b/src/common/telemetry.h
@@ -52,8 +52,8 @@ public:
52template <typename T> 52template <typename T>
53class Field : public FieldInterface { 53class Field : public FieldInterface {
54public: 54public:
55 Field(FieldType type, std::string name, T value) 55 Field(FieldType type_, std::string name_, T value_)
56 : name(std::move(name)), type(type), value(std::move(value)) {} 56 : name(std::move(name_)), type(type_), value(std::move(value_)) {}
57 57
58 Field(const Field&) = default; 58 Field(const Field&) = default;
59 Field& operator=(const Field&) = default; 59 Field& operator=(const Field&) = default;
diff --git a/src/common/x64/xbyak_abi.h b/src/common/x64/xbyak_abi.h
index 26e4bfda5..c2c9b6134 100644
--- a/src/common/x64/xbyak_abi.h
+++ b/src/common/x64/xbyak_abi.h
@@ -11,25 +11,25 @@
11 11
12namespace Common::X64 { 12namespace Common::X64 {
13 13
14constexpr std::size_t RegToIndex(const Xbyak::Reg& reg) { 14constexpr size_t RegToIndex(const Xbyak::Reg& reg) {
15 using Kind = Xbyak::Reg::Kind; 15 using Kind = Xbyak::Reg::Kind;
16 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0, 16 ASSERT_MSG((reg.getKind() & (Kind::REG | Kind::XMM)) != 0,
17 "RegSet only support GPRs and XMM registers."); 17 "RegSet only support GPRs and XMM registers.");
18 ASSERT_MSG(reg.getIdx() < 16, "RegSet only supports XXM0-15."); 18 ASSERT_MSG(reg.getIdx() < 16, "RegSet only supports XXM0-15.");
19 return reg.getIdx() + (reg.getKind() == Kind::REG ? 0 : 16); 19 return static_cast<size_t>(reg.getIdx()) + (reg.getKind() == Kind::REG ? 0 : 16);
20} 20}
21 21
22constexpr Xbyak::Reg64 IndexToReg64(std::size_t reg_index) { 22constexpr Xbyak::Reg64 IndexToReg64(size_t reg_index) {
23 ASSERT(reg_index < 16); 23 ASSERT(reg_index < 16);
24 return Xbyak::Reg64(static_cast<int>(reg_index)); 24 return Xbyak::Reg64(static_cast<int>(reg_index));
25} 25}
26 26
27constexpr Xbyak::Xmm IndexToXmm(std::size_t reg_index) { 27constexpr Xbyak::Xmm IndexToXmm(size_t reg_index) {
28 ASSERT(reg_index >= 16 && reg_index < 32); 28 ASSERT(reg_index >= 16 && reg_index < 32);
29 return Xbyak::Xmm(static_cast<int>(reg_index - 16)); 29 return Xbyak::Xmm(static_cast<int>(reg_index - 16));
30} 30}
31 31
32constexpr Xbyak::Reg IndexToReg(std::size_t reg_index) { 32constexpr Xbyak::Reg IndexToReg(size_t reg_index) {
33 if (reg_index < 16) { 33 if (reg_index < 16) {
34 return IndexToReg64(reg_index); 34 return IndexToReg64(reg_index);
35 } else { 35 } else {
@@ -182,7 +182,7 @@ inline size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, std::b
182 size_t rsp_alignment, size_t needed_frame_size = 0) { 182 size_t rsp_alignment, size_t needed_frame_size = 0) {
183 auto frame_info = ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size); 183 auto frame_info = ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size);
184 184
185 for (std::size_t i = 0; i < regs.size(); ++i) { 185 for (size_t i = 0; i < regs.size(); ++i) {
186 if (regs[i] && ABI_ALL_GPRS[i]) { 186 if (regs[i] && ABI_ALL_GPRS[i]) {
187 code.push(IndexToReg64(i)); 187 code.push(IndexToReg64(i));
188 } 188 }
@@ -192,7 +192,7 @@ inline size_t ABI_PushRegistersAndAdjustStack(Xbyak::CodeGenerator& code, std::b
192 code.sub(code.rsp, frame_info.subtraction); 192 code.sub(code.rsp, frame_info.subtraction);
193 } 193 }
194 194
195 for (std::size_t i = 0; i < regs.size(); ++i) { 195 for (size_t i = 0; i < regs.size(); ++i) {
196 if (regs[i] && ABI_ALL_XMMS[i]) { 196 if (regs[i] && ABI_ALL_XMMS[i]) {
197 code.movaps(code.xword[code.rsp + frame_info.xmm_offset], IndexToXmm(i)); 197 code.movaps(code.xword[code.rsp + frame_info.xmm_offset], IndexToXmm(i));
198 frame_info.xmm_offset += 0x10; 198 frame_info.xmm_offset += 0x10;
@@ -206,7 +206,7 @@ inline void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, std::bits
206 size_t rsp_alignment, size_t needed_frame_size = 0) { 206 size_t rsp_alignment, size_t needed_frame_size = 0) {
207 auto frame_info = ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size); 207 auto frame_info = ABI_CalculateFrameSize(regs, rsp_alignment, needed_frame_size);
208 208
209 for (std::size_t i = 0; i < regs.size(); ++i) { 209 for (size_t i = 0; i < regs.size(); ++i) {
210 if (regs[i] && ABI_ALL_XMMS[i]) { 210 if (regs[i] && ABI_ALL_XMMS[i]) {
211 code.movaps(IndexToXmm(i), code.xword[code.rsp + frame_info.xmm_offset]); 211 code.movaps(IndexToXmm(i), code.xword[code.rsp + frame_info.xmm_offset]);
212 frame_info.xmm_offset += 0x10; 212 frame_info.xmm_offset += 0x10;
@@ -218,8 +218,8 @@ inline void ABI_PopRegistersAndAdjustStack(Xbyak::CodeGenerator& code, std::bits
218 } 218 }
219 219
220 // GPRs need to be popped in reverse order 220 // GPRs need to be popped in reverse order
221 for (std::size_t j = 0; j < regs.size(); ++j) { 221 for (size_t j = 0; j < regs.size(); ++j) {
222 const std::size_t i = regs.size() - j - 1; 222 const size_t i = regs.size() - j - 1;
223 if (regs[i] && ABI_ALL_GPRS[i]) { 223 if (regs[i] && ABI_ALL_GPRS[i]) {
224 code.pop(IndexToReg64(i)); 224 code.pop(IndexToReg64(i));
225 } 225 }
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index eb1fbcb61..2dad18e4d 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -41,6 +41,7 @@ add_library(core STATIC
41 file_sys/bis_factory.h 41 file_sys/bis_factory.h
42 file_sys/card_image.cpp 42 file_sys/card_image.cpp
43 file_sys/card_image.h 43 file_sys/card_image.h
44 file_sys/common_funcs.h
44 file_sys/content_archive.cpp 45 file_sys/content_archive.cpp
45 file_sys/content_archive.h 46 file_sys/content_archive.h
46 file_sys/control_metadata.cpp 47 file_sys/control_metadata.cpp
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 77d21d41c..0961c0819 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -237,7 +237,7 @@ struct System::Impl {
237 Kernel::Process::Create(system, "main", Kernel::Process::ProcessType::Userland); 237 Kernel::Process::Create(system, "main", Kernel::Process::ProcessType::Userland);
238 const auto [load_result, load_parameters] = app_loader->Load(*main_process, system); 238 const auto [load_result, load_parameters] = app_loader->Load(*main_process, system);
239 if (load_result != Loader::ResultStatus::Success) { 239 if (load_result != Loader::ResultStatus::Success) {
240 LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast<int>(load_result)); 240 LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", load_result);
241 Shutdown(); 241 Shutdown();
242 242
243 return static_cast<ResultStatus>(static_cast<u32>(ResultStatus::ErrorLoader) + 243 return static_cast<ResultStatus>(static_cast<u32>(ResultStatus::ErrorLoader) +
@@ -267,8 +267,7 @@ struct System::Impl {
267 267
268 u64 title_id{0}; 268 u64 title_id{0};
269 if (app_loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) { 269 if (app_loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) {
270 LOG_ERROR(Core, "Failed to find title id for ROM (Error {})", 270 LOG_ERROR(Core, "Failed to find title id for ROM (Error {})", load_result);
271 static_cast<u32>(load_result));
272 } 271 }
273 perf_stats = std::make_unique<PerfStats>(title_id); 272 perf_stats = std::make_unique<PerfStats>(title_id);
274 // Reset counters and set time origin to current frame 273 // Reset counters and set time origin to current frame
diff --git a/src/core/file_sys/common_funcs.h b/src/core/file_sys/common_funcs.h
new file mode 100644
index 000000000..7ed97aa50
--- /dev/null
+++ b/src/core/file_sys/common_funcs.h
@@ -0,0 +1,56 @@
1// Copyright 2020 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include "common/common_types.h"
8
9namespace FileSys {
10
11constexpr u64 AOC_TITLE_ID_MASK = 0x7FF;
12constexpr u64 AOC_TITLE_ID_OFFSET = 0x1000;
13constexpr u64 BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
14
15/**
16 * Gets the base title ID from a given title ID.
17 *
18 * @param title_id The title ID.
19 * @returns The base title ID.
20 */
21[[nodiscard]] constexpr u64 GetBaseTitleID(u64 title_id) {
22 return title_id & BASE_TITLE_ID_MASK;
23}
24
25/**
26 * Gets the base title ID with a program index offset from a given title ID.
27 *
28 * @param title_id The title ID.
29 * @param program_index The program index.
30 * @returns The base title ID with a program index offset.
31 */
32[[nodiscard]] constexpr u64 GetBaseTitleIDWithProgramIndex(u64 title_id, u64 program_index) {
33 return GetBaseTitleID(title_id) + program_index;
34}
35
36/**
37 * Gets the AOC (Add-On Content) base title ID from a given title ID.
38 *
39 * @param title_id The title ID.
40 * @returns The AOC base title ID.
41 */
42[[nodiscard]] constexpr u64 GetAOCBaseTitleID(u64 title_id) {
43 return GetBaseTitleID(title_id) + AOC_TITLE_ID_OFFSET;
44}
45
46/**
47 * Gets the AOC (Add-On Content) ID from a given AOC title ID.
48 *
49 * @param aoc_title_id The AOC title ID.
50 * @returns The AOC ID.
51 */
52[[nodiscard]] constexpr u64 GetAOCID(u64 aoc_title_id) {
53 return aoc_title_id & AOC_TITLE_ID_MASK;
54}
55
56} // namespace FileSys
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 76af47ff9..a6c0337fa 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -410,8 +410,9 @@ u8 NCA::GetCryptoRevision() const {
410std::optional<Core::Crypto::Key128> NCA::GetKeyAreaKey(NCASectionCryptoType type) const { 410std::optional<Core::Crypto::Key128> NCA::GetKeyAreaKey(NCASectionCryptoType type) const {
411 const auto master_key_id = GetCryptoRevision(); 411 const auto master_key_id = GetCryptoRevision();
412 412
413 if (!keys.HasKey(Core::Crypto::S128KeyType::KeyArea, master_key_id, header.key_index)) 413 if (!keys.HasKey(Core::Crypto::S128KeyType::KeyArea, master_key_id, header.key_index)) {
414 return {}; 414 return std::nullopt;
415 }
415 416
416 std::vector<u8> key_area(header.key_area.begin(), header.key_area.end()); 417 std::vector<u8> key_area(header.key_area.begin(), header.key_area.end());
417 Core::Crypto::AESCipher<Core::Crypto::Key128> cipher( 418 Core::Crypto::AESCipher<Core::Crypto::Key128> cipher(
@@ -420,15 +421,17 @@ std::optional<Core::Crypto::Key128> NCA::GetKeyAreaKey(NCASectionCryptoType type
420 cipher.Transcode(key_area.data(), key_area.size(), key_area.data(), Core::Crypto::Op::Decrypt); 421 cipher.Transcode(key_area.data(), key_area.size(), key_area.data(), Core::Crypto::Op::Decrypt);
421 422
422 Core::Crypto::Key128 out; 423 Core::Crypto::Key128 out;
423 if (type == NCASectionCryptoType::XTS) 424 if (type == NCASectionCryptoType::XTS) {
424 std::copy(key_area.begin(), key_area.begin() + 0x10, out.begin()); 425 std::copy(key_area.begin(), key_area.begin() + 0x10, out.begin());
425 else if (type == NCASectionCryptoType::CTR || type == NCASectionCryptoType::BKTR) 426 } else if (type == NCASectionCryptoType::CTR || type == NCASectionCryptoType::BKTR) {
426 std::copy(key_area.begin() + 0x20, key_area.begin() + 0x30, out.begin()); 427 std::copy(key_area.begin() + 0x20, key_area.begin() + 0x30, out.begin());
427 else 428 } else {
428 LOG_CRITICAL(Crypto, "Called GetKeyAreaKey on invalid NCASectionCryptoType type={:02X}", 429 LOG_CRITICAL(Crypto, "Called GetKeyAreaKey on invalid NCASectionCryptoType type={:02X}",
429 static_cast<u8>(type)); 430 type);
431 }
432
430 u128 out_128{}; 433 u128 out_128{};
431 memcpy(out_128.data(), out.data(), 16); 434 std::memcpy(out_128.data(), out.data(), sizeof(u128));
432 LOG_TRACE(Crypto, "called with crypto_rev={:02X}, kak_index={:02X}, key={:016X}{:016X}", 435 LOG_TRACE(Crypto, "called with crypto_rev={:02X}, kak_index={:02X}, key={:016X}{:016X}",
433 master_key_id, header.key_index, out_128[1], out_128[0]); 436 master_key_id, header.key_index, out_128[1], out_128[0]);
434 437
@@ -507,7 +510,7 @@ VirtualFile NCA::Decrypt(const NCASectionHeader& s_header, VirtualFile in, u64 s
507 // TODO(DarkLordZach): Find a test case for XTS-encrypted NCAs 510 // TODO(DarkLordZach): Find a test case for XTS-encrypted NCAs
508 default: 511 default:
509 LOG_ERROR(Crypto, "called with unhandled crypto type={:02X}", 512 LOG_ERROR(Crypto, "called with unhandled crypto type={:02X}",
510 static_cast<u8>(s_header.raw.header.crypto_type)); 513 s_header.raw.header.crypto_type);
511 return nullptr; 514 return nullptr;
512 } 515 }
513} 516}
@@ -516,15 +519,17 @@ Loader::ResultStatus NCA::GetStatus() const {
516 return status; 519 return status;
517} 520}
518 521
519std::vector<std::shared_ptr<VfsFile>> NCA::GetFiles() const { 522std::vector<VirtualFile> NCA::GetFiles() const {
520 if (status != Loader::ResultStatus::Success) 523 if (status != Loader::ResultStatus::Success) {
521 return {}; 524 return {};
525 }
522 return files; 526 return files;
523} 527}
524 528
525std::vector<std::shared_ptr<VfsDirectory>> NCA::GetSubdirectories() const { 529std::vector<VirtualDir> NCA::GetSubdirectories() const {
526 if (status != Loader::ResultStatus::Success) 530 if (status != Loader::ResultStatus::Success) {
527 return {}; 531 return {};
532 }
528 return dirs; 533 return dirs;
529} 534}
530 535
@@ -532,7 +537,7 @@ std::string NCA::GetName() const {
532 return file->GetName(); 537 return file->GetName();
533} 538}
534 539
535std::shared_ptr<VfsDirectory> NCA::GetParentDirectory() const { 540VirtualDir NCA::GetParentDirectory() const {
536 return file->GetContainingDirectory(); 541 return file->GetContainingDirectory();
537} 542}
538 543
diff --git a/src/core/file_sys/content_archive.h b/src/core/file_sys/content_archive.h
index 69292232a..e9eccdea3 100644
--- a/src/core/file_sys/content_archive.h
+++ b/src/core/file_sys/content_archive.h
@@ -82,7 +82,7 @@ struct NCAHeader {
82}; 82};
83static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size."); 83static_assert(sizeof(NCAHeader) == 0x400, "NCAHeader has incorrect size.");
84 84
85inline bool IsDirectoryExeFS(const std::shared_ptr<VfsDirectory>& pfs) { 85inline bool IsDirectoryExeFS(const VirtualDir& pfs) {
86 // According to switchbrew, an exefs must only contain these two files: 86 // According to switchbrew, an exefs must only contain these two files:
87 return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr; 87 return pfs->GetFile("main") != nullptr && pfs->GetFile("main.npdm") != nullptr;
88} 88}
@@ -104,10 +104,10 @@ public:
104 104
105 Loader::ResultStatus GetStatus() const; 105 Loader::ResultStatus GetStatus() const;
106 106
107 std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; 107 std::vector<VirtualFile> GetFiles() const override;
108 std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; 108 std::vector<VirtualDir> GetSubdirectories() const override;
109 std::string GetName() const override; 109 std::string GetName() const override;
110 std::shared_ptr<VfsDirectory> GetParentDirectory() const override; 110 VirtualDir GetParentDirectory() const override;
111 111
112 NCAContentType GetType() const; 112 NCAContentType GetType() const;
113 u64 GetTitleId() const; 113 u64 GetTitleId() const;
diff --git a/src/core/file_sys/nca_patch.cpp b/src/core/file_sys/nca_patch.cpp
index 5990a2fd5..adcf0732f 100644
--- a/src/core/file_sys/nca_patch.cpp
+++ b/src/core/file_sys/nca_patch.cpp
@@ -191,7 +191,7 @@ bool BKTR::Resize(std::size_t new_size) {
191 return false; 191 return false;
192} 192}
193 193
194std::shared_ptr<VfsDirectory> BKTR::GetContainingDirectory() const { 194VirtualDir BKTR::GetContainingDirectory() const {
195 return base_romfs->GetContainingDirectory(); 195 return base_romfs->GetContainingDirectory();
196} 196}
197 197
diff --git a/src/core/file_sys/nca_patch.h b/src/core/file_sys/nca_patch.h
index 60c544f8e..503cf473e 100644
--- a/src/core/file_sys/nca_patch.h
+++ b/src/core/file_sys/nca_patch.h
@@ -106,7 +106,7 @@ public:
106 106
107 bool Resize(std::size_t new_size) override; 107 bool Resize(std::size_t new_size) override;
108 108
109 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; 109 VirtualDir GetContainingDirectory() const override;
110 110
111 bool IsWritable() const override; 111 bool IsWritable() const override;
112 112
diff --git a/src/core/file_sys/patch_manager.cpp b/src/core/file_sys/patch_manager.cpp
index e9d1607d0..7c3284df8 100644
--- a/src/core/file_sys/patch_manager.cpp
+++ b/src/core/file_sys/patch_manager.cpp
@@ -12,6 +12,7 @@
12#include "common/logging/log.h" 12#include "common/logging/log.h"
13#include "common/string_util.h" 13#include "common/string_util.h"
14#include "core/core.h" 14#include "core/core.h"
15#include "core/file_sys/common_funcs.h"
15#include "core/file_sys/content_archive.h" 16#include "core/file_sys/content_archive.h"
16#include "core/file_sys/control_metadata.h" 17#include "core/file_sys/control_metadata.h"
17#include "core/file_sys/ips_layer.h" 18#include "core/file_sys/ips_layer.h"
@@ -30,7 +31,6 @@ namespace FileSys {
30namespace { 31namespace {
31 32
32constexpr u32 SINGLE_BYTE_MODULUS = 0x100; 33constexpr u32 SINGLE_BYTE_MODULUS = 0x100;
33constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
34 34
35constexpr std::array<const char*, 14> EXEFS_FILE_NAMES{ 35constexpr std::array<const char*, 14> EXEFS_FILE_NAMES{
36 "main", "main.npdm", "rtld", "sdk", "subsdk0", "subsdk1", "subsdk2", 36 "main", "main.npdm", "rtld", "sdk", "subsdk0", "subsdk1", "subsdk2",
@@ -532,7 +532,7 @@ PatchManager::PatchVersionNames PatchManager::GetPatchVersionNames(VirtualFile u
532 dlc_match.reserve(dlc_entries.size()); 532 dlc_match.reserve(dlc_entries.size());
533 std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match), 533 std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match),
534 [this](const ContentProviderEntry& entry) { 534 [this](const ContentProviderEntry& entry) {
535 return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == title_id && 535 return GetBaseTitleID(entry.title_id) == title_id &&
536 content_provider.GetEntry(entry)->GetStatus() == 536 content_provider.GetEntry(entry)->GetStatus() ==
537 Loader::ResultStatus::Success; 537 Loader::ResultStatus::Success;
538 }); 538 });
diff --git a/src/core/file_sys/romfs_factory.cpp b/src/core/file_sys/romfs_factory.cpp
index 987199747..f4e16e4be 100644
--- a/src/core/file_sys/romfs_factory.cpp
+++ b/src/core/file_sys/romfs_factory.cpp
@@ -7,6 +7,7 @@
7#include "common/common_types.h" 7#include "common/common_types.h"
8#include "common/logging/log.h" 8#include "common/logging/log.h"
9#include "core/file_sys/card_image.h" 9#include "core/file_sys/card_image.h"
10#include "core/file_sys/common_funcs.h"
10#include "core/file_sys/content_archive.h" 11#include "core/file_sys/content_archive.h"
11#include "core/file_sys/nca_metadata.h" 12#include "core/file_sys/nca_metadata.h"
12#include "core/file_sys/patch_manager.h" 13#include "core/file_sys/patch_manager.h"
@@ -47,6 +48,27 @@ ResultVal<VirtualFile> RomFSFactory::OpenCurrentProcess(u64 current_process_titl
47 patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw)); 48 patch_manager.PatchRomFS(file, ivfc_offset, ContentRecordType::Program, update_raw));
48} 49}
49 50
51ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFS(u64 title_id, ContentRecordType type) const {
52 auto nca = content_provider.GetEntry(title_id, type);
53
54 if (nca == nullptr) {
55 // TODO: Find the right error code to use here
56 return RESULT_UNKNOWN;
57 }
58
59 const PatchManager patch_manager{title_id, filesystem_controller, content_provider};
60
61 return MakeResult<VirtualFile>(
62 patch_manager.PatchRomFS(nca->GetRomFS(), nca->GetBaseIVFCOffset(), type));
63}
64
65ResultVal<VirtualFile> RomFSFactory::OpenPatchedRomFSWithProgramIndex(
66 u64 title_id, u8 program_index, ContentRecordType type) const {
67 const auto res_title_id = GetBaseTitleIDWithProgramIndex(title_id, program_index);
68
69 return OpenPatchedRomFS(res_title_id, type);
70}
71
50ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage, 72ResultVal<VirtualFile> RomFSFactory::Open(u64 title_id, StorageId storage,
51 ContentRecordType type) const { 73 ContentRecordType type) const {
52 const std::shared_ptr<NCA> res = GetEntry(title_id, storage, type); 74 const std::shared_ptr<NCA> res = GetEntry(title_id, storage, type);
diff --git a/src/core/file_sys/romfs_factory.h b/src/core/file_sys/romfs_factory.h
index ec704dfa8..96dd0d578 100644
--- a/src/core/file_sys/romfs_factory.h
+++ b/src/core/file_sys/romfs_factory.h
@@ -42,6 +42,10 @@ public:
42 42
43 void SetPackedUpdate(VirtualFile update_raw); 43 void SetPackedUpdate(VirtualFile update_raw);
44 [[nodiscard]] ResultVal<VirtualFile> OpenCurrentProcess(u64 current_process_title_id) const; 44 [[nodiscard]] ResultVal<VirtualFile> OpenCurrentProcess(u64 current_process_title_id) const;
45 [[nodiscard]] ResultVal<VirtualFile> OpenPatchedRomFS(u64 title_id,
46 ContentRecordType type) const;
47 [[nodiscard]] ResultVal<VirtualFile> OpenPatchedRomFSWithProgramIndex(
48 u64 title_id, u8 program_index, ContentRecordType type) const;
45 [[nodiscard]] ResultVal<VirtualFile> Open(u64 title_id, StorageId storage, 49 [[nodiscard]] ResultVal<VirtualFile> Open(u64 title_id, StorageId storage,
46 ContentRecordType type) const; 50 ContentRecordType type) const;
47 51
diff --git a/src/core/file_sys/system_archive/data/font_nintendo_extended.cpp b/src/core/file_sys/system_archive/data/font_nintendo_extended.cpp
index 69d62ce8f..29ef110a6 100644
--- a/src/core/file_sys/system_archive/data/font_nintendo_extended.cpp
+++ b/src/core/file_sys/system_archive/data/font_nintendo_extended.cpp
@@ -6,191 +6,384 @@
6 6
7namespace FileSys::SystemArchive::SharedFontData { 7namespace FileSys::SystemArchive::SharedFontData {
8 8
9const std::array<unsigned char, 2932> FONT_NINTENDO_EXTENDED{{ 9const std::array<unsigned char, 6024> FONT_NINTENDO_EXTENDED{{
10 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x80, 0x00, 0x03, 0x00, 0x70, 0x44, 0x53, 0x49, 0x47, 10 0x00, 0x01, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x80, 0x00, 0x03, 0x00, 0x60, 0x4F, 0x53, 0x2F, 0x32,
11 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x0b, 0x6c, 0x00, 0x00, 0x00, 0x08, 0x4f, 0x53, 0x2f, 0x32, 11 0x34, 0x00, 0x1E, 0x26, 0x00, 0x00, 0x01, 0x68, 0x00, 0x00, 0x00, 0x60, 0x63, 0x6D, 0x61, 0x70,
12 0x33, 0x86, 0x1d, 0x9b, 0x00, 0x00, 0x01, 0x78, 0x00, 0x00, 0x00, 0x60, 0x63, 0x6d, 0x61, 0x70, 12 0xC1, 0xE7, 0xC8, 0xF3, 0x00, 0x00, 0x02, 0x0C, 0x00, 0x00, 0x01, 0x72, 0x63, 0x76, 0x74, 0x20,
13 0xc2, 0x06, 0x20, 0xde, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x63, 0x76, 0x74, 0x20, 13 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x05, 0x0C, 0x00, 0x00, 0x00, 0x06, 0x66, 0x70, 0x67, 0x6D,
14 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x04, 0x2c, 0x00, 0x00, 0x00, 0x06, 0x66, 0x70, 0x67, 0x6d, 14 0x06, 0x59, 0x9C, 0x37, 0x00, 0x00, 0x03, 0x80, 0x00, 0x00, 0x01, 0x73, 0x67, 0x61, 0x73, 0x70,
15 0x06, 0x59, 0x9c, 0x37, 0x00, 0x00, 0x02, 0xa0, 0x00, 0x00, 0x01, 0x73, 0x67, 0x61, 0x73, 0x70, 15 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x17, 0x80, 0x00, 0x00, 0x00, 0x08, 0x67, 0x6C, 0x79, 0x66,
16 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x0b, 0x64, 0x00, 0x00, 0x00, 0x08, 0x67, 0x6c, 0x79, 0x66, 16 0x50, 0x0B, 0xEA, 0xFA, 0x00, 0x00, 0x05, 0x50, 0x00, 0x00, 0x0F, 0x04, 0x68, 0x65, 0x61, 0x64,
17 0x10, 0x31, 0x88, 0x00, 0x00, 0x00, 0x04, 0x34, 0x00, 0x00, 0x04, 0x64, 0x68, 0x65, 0x61, 0x64, 17 0x18, 0x65, 0x81, 0x09, 0x00, 0x00, 0x00, 0xEC, 0x00, 0x00, 0x00, 0x36, 0x68, 0x68, 0x65, 0x61,
18 0x15, 0x9d, 0xef, 0x91, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x36, 0x68, 0x68, 0x65, 0x61, 18 0x09, 0x88, 0x03, 0x86, 0x00, 0x00, 0x01, 0x24, 0x00, 0x00, 0x00, 0x24, 0x68, 0x6D, 0x74, 0x78,
19 0x09, 0x60, 0x03, 0x71, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0x00, 0x24, 0x68, 0x6d, 0x74, 0x78, 19 0x0A, 0xF0, 0x01, 0x94, 0x00, 0x00, 0x01, 0xC8, 0x00, 0x00, 0x00, 0x42, 0x6C, 0x6F, 0x63, 0x61,
20 0x0d, 0x2e, 0x03, 0xa7, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x26, 0x6c, 0x6f, 0x63, 0x61, 20 0x34, 0x80, 0x30, 0x6E, 0x00, 0x00, 0x05, 0x14, 0x00, 0x00, 0x00, 0x3A, 0x6D, 0x61, 0x78, 0x70,
21 0x05, 0xc0, 0x04, 0x6c, 0x00, 0x00, 0x08, 0x98, 0x00, 0x00, 0x00, 0x1e, 0x6d, 0x61, 0x78, 0x70, 21 0x02, 0x2C, 0x00, 0x72, 0x00, 0x00, 0x01, 0x48, 0x00, 0x00, 0x00, 0x20, 0x6E, 0x61, 0x6D, 0x65,
22 0x02, 0x1c, 0x00, 0x5f, 0x00, 0x00, 0x01, 0x58, 0x00, 0x00, 0x00, 0x20, 0x6e, 0x61, 0x6d, 0x65, 22 0xDB, 0xC5, 0x42, 0x4D, 0x00, 0x00, 0x14, 0x54, 0x00, 0x00, 0x01, 0xFE, 0x70, 0x6F, 0x73, 0x74,
23 0x7c, 0xe0, 0x84, 0x5c, 0x00, 0x00, 0x08, 0xb8, 0x00, 0x00, 0x02, 0x09, 0x70, 0x6f, 0x73, 0x74, 23 0xF4, 0xB4, 0xAC, 0xAB, 0x00, 0x00, 0x16, 0x54, 0x00, 0x00, 0x01, 0x2A, 0x70, 0x72, 0x65, 0x70,
24 0x47, 0x4e, 0x74, 0x19, 0x00, 0x00, 0x0a, 0xc4, 0x00, 0x00, 0x00, 0x9e, 0x70, 0x72, 0x65, 0x70, 24 0x1C, 0xFC, 0x7D, 0x9C, 0x00, 0x00, 0x04, 0xF4, 0x00, 0x00, 0x00, 0x16, 0x00, 0x01, 0x00, 0x00,
25 0x1c, 0xfc, 0x7d, 0x9c, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x16, 0x00, 0x01, 0x00, 0x00, 25 0x00, 0x01, 0x00, 0x00, 0xC9, 0x16, 0x5B, 0x71, 0x5F, 0x0F, 0x3C, 0xF5, 0x00, 0x0B, 0x04, 0x00,
26 0x00, 0x01, 0x00, 0x00, 0x7c, 0xc7, 0xb1, 0x63, 0x5f, 0x0f, 0x3c, 0xf5, 0x00, 0x1b, 0x03, 0xe8, 26 0x00, 0x00, 0x00, 0x00, 0xD9, 0x44, 0x2F, 0x5D, 0x00, 0x00, 0x00, 0x00, 0xDC, 0x02, 0x0D, 0xA7,
27 0x00, 0x00, 0x00, 0x00, 0xd9, 0x44, 0x2f, 0x5d, 0x00, 0x00, 0x00, 0x00, 0xd9, 0x45, 0x7b, 0x69, 27 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x00,
28 0x00, 0x00, 0x00, 0x00, 0x03, 0xe6, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x06, 0x00, 0x02, 0x00, 0x00, 28 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x9A, 0xFF, 0x80, 0x02, 0x00, 0x04, 0x00,
29 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x84, 0xff, 0x83, 0x01, 0xf4, 0x03, 0xe8, 29 0x00, 0x00, 0x00, 0x00, 0x03, 0xEC, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
30 0x00, 0x00, 0x00, 0x00, 0x03, 0xe6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x71,
31 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x5e, 31 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x00, 0x00,
32 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 32 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0xC4, 0x01, 0x90, 0x00, 0x05,
33 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x74, 0x01, 0x90, 0x00, 0x05, 33 0x00, 0x04, 0x00, 0xD2, 0x00, 0xD2, 0x00, 0x00, 0x01, 0x26, 0x00, 0xD2, 0x00, 0xD2, 0x00, 0x00,
34 0x00, 0x04, 0x00, 0xcd, 0x00, 0xcd, 0x00, 0x00, 0x01, 0x1f, 0x00, 0xcd, 0x00, 0xcd, 0x00, 0x00, 34 0x03, 0xDA, 0x00, 0x68, 0x02, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
35 0x03, 0xc3, 0x00, 0x66, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
36 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
37 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0xc0, 0x00, 0x00, 0xe0, 0xe9, 0x03, 0x84, 0xff, 0x83, 36 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0xC0, 0x00, 0x0D, 0xE0, 0xF0, 0x03, 0x9A, 0xFF, 0x80,
38 0x01, 0xf4, 0x02, 0xee, 0x00, 0xfa, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0xe8, 37 0x02, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00,
39 0x02, 0xbc, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x03, 0xe8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 0x02, 0xCD, 0x00, 0x00, 0x00, 0x20, 0x00, 0x01, 0x04, 0x00, 0x00, 0xA4, 0x00, 0x00, 0x00, 0x00,
40 0x00, 0xfa, 0x00, 0x00, 0x00, 0xfa, 0x00, 0x00, 0x03, 0xe8, 0x00, 0xeb, 0x01, 0x21, 0x00, 0xff, 39 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14,
41 0x00, 0xff, 0x01, 0x3d, 0x01, 0x17, 0x00, 0x42, 0x00, 0x1c, 0x00, 0x3e, 0x00, 0x17, 0x00, 0x00, 40 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14,
42 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x68, 0x00, 0x01, 0x00, 0x00, 41 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14,
43 0x00, 0x00, 0x00, 0x1c, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x06, 0x00, 0x4c, 42 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
44 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6C,
44 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x04, 0x00, 0x50, 0x00, 0x00, 0x00, 0x10,
45 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x20, 0xE0, 0xA9, 0xE0, 0xB4,
46 0xE0, 0xE9, 0xE0, 0xF0, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x20, 0xE0, 0xA0,
47 0xE0, 0xB3, 0xE0, 0xE0, 0xE0, 0xEF, 0xFF, 0xFF, 0x00, 0x01, 0xFF, 0xF5, 0xFF, 0xE3, 0x1F, 0x64,
48 0x1F, 0x5B, 0x1F, 0x30, 0x1F, 0x2B, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
49 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x01, 0x00,
50 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
51 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00,
45 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 52 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
46 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
47 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
48 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x04, 0x00, 0x38, 0x00, 0x00, 0x00, 0x0a,
49 0x00, 0x08, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x20, 0xe0, 0xe9, 0xff, 0xff,
50 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x20, 0xe0, 0xe0, 0xff, 0xff, 0x00, 0x01, 0xff, 0xf5,
51 0xff, 0xe3, 0x1f, 0x24, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
52 0xb8, 0x00, 0x00, 0x2c, 0x4b, 0xb8, 0x00, 0x09, 0x50, 0x58, 0xb1, 0x01, 0x01, 0x8e, 0x59, 0xb8,
53 0x01, 0xff, 0x85, 0xb8, 0x00, 0x44, 0x1d, 0xb9, 0x00, 0x09, 0x00, 0x03, 0x5f, 0x5e, 0x2d, 0xb8,
54 0x00, 0x01, 0x2c, 0x20, 0x20, 0x45, 0x69, 0x44, 0xb0, 0x01, 0x60, 0x2d, 0xb8, 0x00, 0x02, 0x2c,
55 0xb8, 0x00, 0x01, 0x2a, 0x21, 0x2d, 0xb8, 0x00, 0x03, 0x2c, 0x20, 0x46, 0xb0, 0x03, 0x25, 0x46,
56 0x52, 0x58, 0x23, 0x59, 0x20, 0x8a, 0x20, 0x8a, 0x49, 0x64, 0x8a, 0x20, 0x46, 0x20, 0x68, 0x61,
57 0x64, 0xb0, 0x04, 0x25, 0x46, 0x20, 0x68, 0x61, 0x64, 0x52, 0x58, 0x23, 0x65, 0x8a, 0x59, 0x2f,
58 0x20, 0xb0, 0x00, 0x53, 0x58, 0x69, 0x20, 0xb0, 0x00, 0x54, 0x58, 0x21, 0xb0, 0x40, 0x59, 0x1b,
59 0x69, 0x20, 0xb0, 0x00, 0x54, 0x58, 0x21, 0xb0, 0x40, 0x65, 0x59, 0x59, 0x3a, 0x2d, 0xb8, 0x00,
60 0x04, 0x2c, 0x20, 0x46, 0xb0, 0x04, 0x25, 0x46, 0x52, 0x58, 0x23, 0x8a, 0x59, 0x20, 0x46, 0x20,
61 0x6a, 0x61, 0x64, 0xb0, 0x04, 0x25, 0x46, 0x20, 0x6a, 0x61, 0x64, 0x52, 0x58, 0x23, 0x8a, 0x59,
62 0x2f, 0xfd, 0x2d, 0xb8, 0x00, 0x05, 0x2c, 0x4b, 0x20, 0xb0, 0x03, 0x26, 0x50, 0x58, 0x51, 0x58,
63 0xb0, 0x80, 0x44, 0x1b, 0xb0, 0x40, 0x44, 0x59, 0x1b, 0x21, 0x21, 0x20, 0x45, 0xb0, 0xc0, 0x50,
64 0x58, 0xb0, 0xc0, 0x44, 0x1b, 0x21, 0x59, 0x59, 0x2d, 0xb8, 0x00, 0x06, 0x2c, 0x20, 0x20, 0x45,
65 0x69, 0x44, 0xb0, 0x01, 0x60, 0x20, 0x20, 0x45, 0x7d, 0x69, 0x18, 0x44, 0xb0, 0x01, 0x60, 0x2d,
66 0xb8, 0x00, 0x07, 0x2c, 0xb8, 0x00, 0x06, 0x2a, 0x2d, 0xb8, 0x00, 0x08, 0x2c, 0x4b, 0x20, 0xb0,
67 0x03, 0x26, 0x53, 0x58, 0xb0, 0x40, 0x1b, 0xb0, 0x00, 0x59, 0x8a, 0x8a, 0x20, 0xb0, 0x03, 0x26,
68 0x53, 0x58, 0x23, 0x21, 0xb0, 0x80, 0x8a, 0x8a, 0x1b, 0x8a, 0x23, 0x59, 0x20, 0xb0, 0x03, 0x26,
69 0x53, 0x58, 0x23, 0x21, 0xb8, 0x00, 0xc0, 0x8a, 0x8a, 0x1b, 0x8a, 0x23, 0x59, 0x20, 0xb0, 0x03,
70 0x26, 0x53, 0x58, 0x23, 0x21, 0xb8, 0x01, 0x00, 0x8a, 0x8a, 0x1b, 0x8a, 0x23, 0x59, 0x20, 0xb0,
71 0x03, 0x26, 0x53, 0x58, 0x23, 0x21, 0xb8, 0x01, 0x40, 0x8a, 0x8a, 0x1b, 0x8a, 0x23, 0x59, 0x20,
72 0xb8, 0x00, 0x03, 0x26, 0x53, 0x58, 0xb0, 0x03, 0x25, 0x45, 0xb8, 0x01, 0x80, 0x50, 0x58, 0x23,
73 0x21, 0xb8, 0x01, 0x80, 0x23, 0x21, 0x1b, 0xb0, 0x03, 0x25, 0x45, 0x23, 0x21, 0x23, 0x21, 0x59,
74 0x1b, 0x21, 0x59, 0x44, 0x2d, 0xb8, 0x00, 0x09, 0x2c, 0x4b, 0x53, 0x58, 0x45, 0x44, 0x1b, 0x21,
75 0x21, 0x59, 0x2d, 0x00, 0xb8, 0x00, 0x00, 0x2b, 0x00, 0xba, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07,
76 0x2b, 0xb8, 0x00, 0x00, 0x20, 0x45, 0x7d, 0x69, 0x18, 0x44, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
77 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x03, 0xe6, 0x03, 0xe8, 0x00, 0x06,
78 0x00, 0x00, 0x35, 0x01, 0x33, 0x15, 0x01, 0x23, 0x35, 0x03, 0x52, 0x94, 0xfc, 0xa6, 0x8c, 0x90,
79 0x03, 0x58, 0x86, 0xfc, 0xa0, 0x8e, 0x00, 0x00, 0x00, 0x02, 0x00, 0xeb, 0x00, 0xcc, 0x02, 0xfb,
80 0x03, 0x1e, 0x00, 0x08, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x33, 0x13, 0x23, 0x27, 0x23, 0x07, 0x23,
81 0x13, 0x17, 0x07, 0x06, 0x15, 0x33, 0x27, 0x07, 0x01, 0xbc, 0x6d, 0xd2, 0x7c, 0x26, 0xcc, 0x26,
82 0x7c, 0xd1, 0x35, 0x40, 0x02, 0x89, 0x45, 0x02, 0x03, 0x1e, 0xfd, 0xae, 0x77, 0x77, 0x02, 0x52,
83 0x9b, 0xcc, 0x08, 0x04, 0xda, 0x02, 0x00, 0x00, 0x00, 0x03, 0x01, 0x21, 0x00, 0xcc, 0x02, 0xc5,
84 0x03, 0x1e, 0x00, 0x15, 0x00, 0x1f, 0x00, 0x2b, 0x00, 0x00, 0x25, 0x11, 0x33, 0x32, 0x1e, 0x02,
85 0x15, 0x14, 0x0e, 0x02, 0x07, 0x1e, 0x01, 0x15, 0x14, 0x0e, 0x02, 0x2b, 0x01, 0x13, 0x33, 0x32,
86 0x36, 0x35, 0x34, 0x26, 0x2b, 0x01, 0x1d, 0x01, 0x33, 0x32, 0x3e, 0x02, 0x35, 0x34, 0x26, 0x2b,
87 0x01, 0x15, 0x01, 0x21, 0xea, 0x25, 0x3f, 0x2e, 0x1a, 0x0e, 0x15, 0x1b, 0x0e, 0x2d, 0x2d, 0x1a,
88 0x2e, 0x3f, 0x25, 0xf8, 0x76, 0x62, 0x20, 0x2a, 0x28, 0x22, 0x62, 0x76, 0x10, 0x18, 0x11, 0x09,
89 0x22, 0x22, 0x74, 0xcc, 0x02, 0x52, 0x18, 0x2b, 0x3c, 0x24, 0x1d, 0x1f, 0x17, 0x17, 0x14, 0x0f,
90 0x48, 0x2f, 0x24, 0x3f, 0x2e, 0x1a, 0x01, 0x5b, 0x29, 0x20, 0x20, 0x2b, 0x94, 0xf8, 0x0e, 0x16,
91 0x1c, 0x0e, 0x1f, 0x31, 0x9e, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xff, 0x00, 0xcc, 0x02, 0xe7,
92 0x03, 0x1e, 0x00, 0x0c, 0x00, 0x00, 0x01, 0x33, 0x17, 0x37, 0x33, 0x03, 0x13, 0x23, 0x27, 0x07,
93 0x23, 0x13, 0x03, 0x01, 0x04, 0x86, 0x69, 0x69, 0x86, 0xa3, 0xa8, 0x88, 0x6c, 0x6c, 0x88, 0xa8,
94 0xa3, 0x03, 0x1e, 0xcb, 0xcb, 0xfe, 0xda, 0xfe, 0xd4, 0xcf, 0xcf, 0x01, 0x2c, 0x01, 0x26, 0x00,
95 0x00, 0x01, 0x00, 0xff, 0x00, 0xcc, 0x02, 0xe7, 0x03, 0x1e, 0x00, 0x0f, 0x00, 0x00, 0x01, 0x03,
96 0x33, 0x17, 0x32, 0x15, 0x1e, 0x01, 0x15, 0x1b, 0x01, 0x33, 0x03, 0x15, 0x23, 0x35, 0x01, 0xb8,
97 0xb9, 0x7e, 0x01, 0x01, 0x01, 0x03, 0x70, 0x75, 0x7f, 0xb9, 0x76, 0x01, 0xa3, 0x01, 0x7b, 0x01,
98 0x01, 0x01, 0x05, 0x02, 0xff, 0x00, 0x01, 0x0a, 0xfe, 0x85, 0xd7, 0xd7, 0x00, 0x01, 0x01, 0x3d,
99 0x00, 0xcc, 0x02, 0xa9, 0x03, 0x1e, 0x00, 0x06, 0x00, 0x00, 0x25, 0x11, 0x33, 0x11, 0x33, 0x15,
100 0x21, 0x01, 0x3d, 0x75, 0xf7, 0xfe, 0x94, 0xcc, 0x02, 0x52, 0xfe, 0x10, 0x62, 0x00, 0x00, 0x00,
101 0x00, 0x02, 0x01, 0x17, 0x00, 0xbc, 0x02, 0xcf, 0x03, 0x0e, 0x00, 0x15, 0x00, 0x21, 0x00, 0x00,
102 0x25, 0x11, 0x33, 0x32, 0x1e, 0x02, 0x1d, 0x01, 0x0e, 0x03, 0x1d, 0x01, 0x17, 0x15, 0x23, 0x27,
103 0x23, 0x15, 0x23, 0x13, 0x33, 0x32, 0x3e, 0x02, 0x35, 0x34, 0x26, 0x2b, 0x01, 0x15, 0x01, 0x17,
104 0xf4, 0x27, 0x40, 0x2e, 0x19, 0x01, 0x1f, 0x24, 0x1e, 0x78, 0x7d, 0x6a, 0x5c, 0x75, 0x76, 0x72,
105 0x12, 0x19, 0x11, 0x08, 0x26, 0x26, 0x6a, 0xbc, 0x02, 0x52, 0x1d, 0x31, 0x42, 0x25, 0x16, 0x18,
106 0x32, 0x2a, 0x1b, 0x02, 0x01, 0xef, 0x06, 0xd7, 0xd7, 0x01, 0x3f, 0x10, 0x1a, 0x1e, 0x0f, 0x23,
107 0x36, 0xb0, 0x00, 0x00, 0x00, 0x02, 0x00, 0x42, 0x00, 0xbc, 0x03, 0xa4, 0x03, 0x0e, 0x00, 0x0a,
108 0x00, 0x11, 0x00, 0x00, 0x13, 0x35, 0x21, 0x15, 0x01, 0x21, 0x15, 0x21, 0x35, 0x01, 0x21, 0x01,
109 0x11, 0x33, 0x11, 0x33, 0x15, 0x21, 0x42, 0x01, 0xa7, 0xfe, 0xeb, 0x01, 0x1b, 0xfe, 0x53, 0x01,
110 0x15, 0xfe, 0xeb, 0x01, 0xf7, 0x75, 0xf6, 0xfe, 0x95, 0x02, 0xac, 0x62, 0x45, 0xfe, 0x55, 0x62,
111 0x47, 0x01, 0xa9, 0xfe, 0x10, 0x02, 0x52, 0xfe, 0x10, 0x62, 0x00, 0x00, 0x00, 0x03, 0x00, 0x1c,
112 0x00, 0xbc, 0x03, 0xca, 0x03, 0x0e, 0x00, 0x0a, 0x00, 0x21, 0x00, 0x2f, 0x00, 0x00, 0x13, 0x35,
113 0x21, 0x15, 0x01, 0x21, 0x15, 0x21, 0x35, 0x01, 0x21, 0x01, 0x11, 0x33, 0x32, 0x1e, 0x02, 0x15,
114 0x14, 0x06, 0x07, 0x0e, 0x03, 0x15, 0x17, 0x15, 0x23, 0x27, 0x23, 0x15, 0x23, 0x13, 0x33, 0x32,
115 0x3e, 0x02, 0x35, 0x34, 0x2e, 0x02, 0x2b, 0x01, 0x15, 0x1c, 0x01, 0xa7, 0xfe, 0xeb, 0x01, 0x1b,
116 0xfe, 0x53, 0x01, 0x15, 0xfe, 0xeb, 0x01, 0xf7, 0xf3, 0x27, 0x41, 0x2d, 0x19, 0x1c, 0x20, 0x01,
117 0x0d, 0x0e, 0x0a, 0x78, 0x7d, 0x69, 0x5c, 0x75, 0x76, 0x71, 0x11, 0x1a, 0x12, 0x09, 0x0a, 0x14,
118 0x1d, 0x13, 0x69, 0x02, 0xac, 0x62, 0x45, 0xfe, 0x55, 0x62, 0x47, 0x01, 0xa9, 0xfe, 0x10, 0x02,
119 0x52, 0x1d, 0x31, 0x42, 0x25, 0x2b, 0x44, 0x1d, 0x01, 0x08, 0x09, 0x07, 0x01, 0xf1, 0x06, 0xd7,
120 0xd7, 0x01, 0x3f, 0x11, 0x19, 0x1f, 0x0e, 0x11, 0x20, 0x19, 0x0f, 0xb0, 0x00, 0x02, 0x00, 0x3e,
121 0x00, 0xb3, 0x03, 0xa8, 0x03, 0x17, 0x00, 0x3a, 0x00, 0x41, 0x00, 0x00, 0x13, 0x34, 0x3e, 0x02,
122 0x33, 0x32, 0x1e, 0x02, 0x15, 0x23, 0x27, 0x34, 0x27, 0x2e, 0x01, 0x23, 0x22, 0x0e, 0x02, 0x15,
123 0x14, 0x16, 0x15, 0x1e, 0x05, 0x15, 0x14, 0x0e, 0x02, 0x23, 0x22, 0x2e, 0x02, 0x35, 0x33, 0x1e,
124 0x01, 0x33, 0x32, 0x3e, 0x02, 0x35, 0x34, 0x2e, 0x04, 0x35, 0x01, 0x11, 0x33, 0x11, 0x33, 0x15,
125 0x21, 0x50, 0x24, 0x3b, 0x4a, 0x27, 0x28, 0x4b, 0x39, 0x22, 0x73, 0x01, 0x01, 0x08, 0x2b, 0x29,
126 0x10, 0x20, 0x19, 0x0f, 0x01, 0x0b, 0x35, 0x41, 0x46, 0x3b, 0x25, 0x23, 0x3a, 0x4b, 0x27, 0x2b,
127 0x50, 0x3f, 0x26, 0x74, 0x05, 0x34, 0x33, 0x10, 0x20, 0x1a, 0x11, 0x2c, 0x42, 0x4d, 0x42, 0x2c,
128 0x01, 0xef, 0x73, 0xf6, 0xfe, 0x97, 0x02, 0x70, 0x2a, 0x3f, 0x2a, 0x14, 0x18, 0x2e, 0x44, 0x2c,
129 0x02, 0x03, 0x01, 0x27, 0x27, 0x07, 0x10, 0x1a, 0x12, 0x02, 0x0b, 0x02, 0x1f, 0x22, 0x19, 0x17,
130 0x27, 0x3f, 0x34, 0x2c, 0x3e, 0x28, 0x13, 0x1a, 0x32, 0x48, 0x2e, 0x30, 0x30, 0x06, 0x0f, 0x1a,
131 0x13, 0x21, 0x27, 0x1e, 0x1b, 0x29, 0x3e, 0x31, 0xfe, 0x4c, 0x02, 0x53, 0xfe, 0x10, 0x63, 0x00,
132 0x00, 0x03, 0x00, 0x17, 0x00, 0xb3, 0x03, 0xce, 0x03, 0x17, 0x00, 0x38, 0x00, 0x4f, 0x00, 0x5d,
133 0x00, 0x00, 0x13, 0x34, 0x3e, 0x02, 0x33, 0x32, 0x1e, 0x02, 0x15, 0x23, 0x27, 0x34, 0x23, 0x2e,
134 0x01, 0x23, 0x22, 0x0e, 0x02, 0x15, 0x14, 0x1e, 0x04, 0x15, 0x14, 0x0e, 0x02, 0x23, 0x22, 0x2e,
135 0x02, 0x35, 0x33, 0x1e, 0x01, 0x33, 0x32, 0x3e, 0x02, 0x35, 0x34, 0x26, 0x27, 0x2e, 0x03, 0x35,
136 0x01, 0x11, 0x33, 0x32, 0x1e, 0x02, 0x15, 0x14, 0x06, 0x07, 0x30, 0x0e, 0x02, 0x31, 0x17, 0x15,
137 0x23, 0x27, 0x23, 0x15, 0x23, 0x13, 0x33, 0x32, 0x3e, 0x02, 0x35, 0x34, 0x2e, 0x02, 0x2b, 0x01,
138 0x15, 0x2a, 0x24, 0x3a, 0x4a, 0x26, 0x29, 0x4b, 0x39, 0x23, 0x73, 0x01, 0x01, 0x08, 0x2a, 0x2a,
139 0x10, 0x1f, 0x1a, 0x10, 0x2c, 0x42, 0x4d, 0x42, 0x2c, 0x23, 0x39, 0x4b, 0x27, 0x2b, 0x51, 0x3f,
140 0x27, 0x75, 0x05, 0x34, 0x33, 0x10, 0x20, 0x1a, 0x10, 0x1f, 0x1c, 0x25, 0x53, 0x47, 0x2e, 0x01,
141 0xed, 0xf3, 0x27, 0x41, 0x2d, 0x19, 0x1c, 0x20, 0x0c, 0x0e, 0x0c, 0x78, 0x7d, 0x68, 0x5d, 0x75,
142 0x76, 0x71, 0x11, 0x1a, 0x12, 0x09, 0x0a, 0x14, 0x1d, 0x13, 0x69, 0x02, 0x71, 0x2a, 0x3e, 0x2a,
143 0x14, 0x18, 0x2e, 0x44, 0x2c, 0x02, 0x02, 0x27, 0x29, 0x07, 0x11, 0x1a, 0x12, 0x1d, 0x24, 0x1c,
144 0x1d, 0x2b, 0x40, 0x32, 0x2c, 0x3f, 0x29, 0x13, 0x1a, 0x31, 0x49, 0x2e, 0x30, 0x30, 0x06, 0x0f,
145 0x19, 0x13, 0x1e, 0x22, 0x0b, 0x0e, 0x20, 0x2f, 0x43, 0x30, 0xfe, 0x4b, 0x02, 0x52, 0x1d, 0x32,
146 0x42, 0x25, 0x2c, 0x42, 0x1d, 0x08, 0x0a, 0x08, 0xf1, 0x06, 0xd7, 0xd7, 0x01, 0x3f, 0x11, 0x19,
147 0x1f, 0x0e, 0x11, 0x20, 0x19, 0x0f, 0xb0, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x12, 0x00, 0x12,
148 0x00, 0x12, 0x00, 0x32, 0x00, 0x72, 0x00, 0x8e, 0x00, 0xac, 0x00, 0xbe, 0x00, 0xf0, 0x01, 0x14,
149 0x01, 0x5c, 0x01, 0xb6, 0x02, 0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0xa2, 0x00, 0x01,
150 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
151 0x00, 0x02, 0x00, 0x07, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x2f,
152 0x00, 0x17, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x12, 0x00, 0x46, 0x00, 0x01,
153 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0d, 0x00, 0x58, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
154 0x00, 0x06, 0x00, 0x12, 0x00, 0x65, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x01, 0x00, 0x20,
155 0x00, 0x77, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x02, 0x00, 0x0e, 0x00, 0x97, 0x00, 0x03,
156 0x00, 0x01, 0x04, 0x09, 0x00, 0x03, 0x00, 0x5e, 0x00, 0xa5, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09,
157 0x00, 0x04, 0x00, 0x24, 0x01, 0x03, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x05, 0x00, 0x1a,
158 0x01, 0x27, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x06, 0x00, 0x24, 0x01, 0x41, 0x00, 0x03,
159 0x00, 0x01, 0x04, 0x09, 0x00, 0x11, 0x00, 0x02, 0x01, 0x65, 0x59, 0x75, 0x7a, 0x75, 0x4f, 0x53,
160 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61,
161 0x72, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x3b, 0x3b,
162 0x59, 0x75, 0x7a, 0x75, 0x4f, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
163 0x2d, 0x52, 0x3b, 0x32, 0x30, 0x31, 0x39, 0x3b, 0x46, 0x4c, 0x56, 0x49, 0x2d, 0x36, 0x31, 0x34,
164 0x59, 0x75, 0x7a, 0x75, 0x4f, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e,
165 0x20, 0x52, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x30, 0x30, 0x59,
166 0x75, 0x7a, 0x75, 0x4f, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2d,
167 0x52, 0x00, 0x59, 0x00, 0x75, 0x00, 0x7a, 0x00, 0x75, 0x00, 0x4f, 0x00, 0x53, 0x00, 0x53, 0x00,
168 0x45, 0x00, 0x78, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00,
169 0x6e, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00, 0x6c, 0x00, 0x61, 0x00, 0x72, 0x00,
170 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00,
171 0x31, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x3b, 0x00, 0x3b, 0x00, 0x59, 0x00,
172 0x75, 0x00, 0x7a, 0x00, 0x75, 0x00, 0x4f, 0x00, 0x53, 0x00, 0x53, 0x00, 0x45, 0x00, 0x78, 0x00,
173 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x2d, 0x00,
174 0x52, 0x00, 0x3b, 0x00, 0x32, 0x00, 0x30, 0x00, 0x31, 0x00, 0x39, 0x00, 0x3b, 0x00, 0x46, 0x00,
175 0x4c, 0x00, 0x56, 0x00, 0x49, 0x00, 0x2d, 0x00, 0x36, 0x00, 0x31, 0x00, 0x34, 0x00, 0x59, 0x00,
176 0x75, 0x00, 0x7a, 0x00, 0x75, 0x00, 0x4f, 0x00, 0x53, 0x00, 0x53, 0x00, 0x45, 0x00, 0x78, 0x00,
177 0x74, 0x00, 0x65, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x20, 0x00,
178 0x52, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00,
179 0x20, 0x00, 0x31, 0x00, 0x2e, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00, 0x59, 0x00, 0x75, 0x00,
180 0x7a, 0x00, 0x75, 0x00, 0x4f, 0x00, 0x53, 0x00, 0x53, 0x00, 0x45, 0x00, 0x78, 0x00, 0x74, 0x00,
181 0x65, 0x00, 0x6e, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6f, 0x00, 0x6e, 0x00, 0x2d, 0x00, 0x52, 0x00,
182 0x52, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x9c, 0x00, 0x32,
183 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
184 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x01, 0x02, 0x01, 0x03, 0x00, 0x03, 0x01, 0x04, 55 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
185 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, 0x01, 0x08, 0x01, 0x09, 0x01, 0x0a, 0x01, 0x0b, 0x01, 0x0c, 56 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
186 0x01, 0x0d, 0x07, 0x75, 0x6e, 0x69, 0x30, 0x30, 0x30, 0x30, 0x07, 0x75, 0x6e, 0x69, 0x30, 0x30, 57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
187 0x30, 0x44, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 0x45, 0x30, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 58 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
188 0x45, 0x31, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 0x45, 0x32, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 59 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
189 0x45, 0x33, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 0x45, 0x34, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 60 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
190 0x45, 0x35, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 0x45, 0x36, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 61 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
191 0x45, 0x37, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 0x45, 0x38, 0x07, 0x75, 0x6e, 0x69, 0x45, 0x30, 62 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
192 0x45, 0x39, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0xff, 0xff, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x01, 63 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
193 0x00, 0x00, 0x00, 0x00, 64 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
65 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
66 0xB8, 0x00, 0x00, 0x2C, 0x4B, 0xB8, 0x00, 0x09, 0x50, 0x58, 0xB1, 0x01, 0x01, 0x8E, 0x59, 0xB8,
67 0x01, 0xFF, 0x85, 0xB8, 0x00, 0x44, 0x1D, 0xB9, 0x00, 0x09, 0x00, 0x03, 0x5F, 0x5E, 0x2D, 0xB8,
68 0x00, 0x01, 0x2C, 0x20, 0x20, 0x45, 0x69, 0x44, 0xB0, 0x01, 0x60, 0x2D, 0xB8, 0x00, 0x02, 0x2C,
69 0xB8, 0x00, 0x01, 0x2A, 0x21, 0x2D, 0xB8, 0x00, 0x03, 0x2C, 0x20, 0x46, 0xB0, 0x03, 0x25, 0x46,
70 0x52, 0x58, 0x23, 0x59, 0x20, 0x8A, 0x20, 0x8A, 0x49, 0x64, 0x8A, 0x20, 0x46, 0x20, 0x68, 0x61,
71 0x64, 0xB0, 0x04, 0x25, 0x46, 0x20, 0x68, 0x61, 0x64, 0x52, 0x58, 0x23, 0x65, 0x8A, 0x59, 0x2F,
72 0x20, 0xB0, 0x00, 0x53, 0x58, 0x69, 0x20, 0xB0, 0x00, 0x54, 0x58, 0x21, 0xB0, 0x40, 0x59, 0x1B,
73 0x69, 0x20, 0xB0, 0x00, 0x54, 0x58, 0x21, 0xB0, 0x40, 0x65, 0x59, 0x59, 0x3A, 0x2D, 0xB8, 0x00,
74 0x04, 0x2C, 0x20, 0x46, 0xB0, 0x04, 0x25, 0x46, 0x52, 0x58, 0x23, 0x8A, 0x59, 0x20, 0x46, 0x20,
75 0x6A, 0x61, 0x64, 0xB0, 0x04, 0x25, 0x46, 0x20, 0x6A, 0x61, 0x64, 0x52, 0x58, 0x23, 0x8A, 0x59,
76 0x2F, 0xFD, 0x2D, 0xB8, 0x00, 0x05, 0x2C, 0x4B, 0x20, 0xB0, 0x03, 0x26, 0x50, 0x58, 0x51, 0x58,
77 0xB0, 0x80, 0x44, 0x1B, 0xB0, 0x40, 0x44, 0x59, 0x1B, 0x21, 0x21, 0x20, 0x45, 0xB0, 0xC0, 0x50,
78 0x58, 0xB0, 0xC0, 0x44, 0x1B, 0x21, 0x59, 0x59, 0x2D, 0xB8, 0x00, 0x06, 0x2C, 0x20, 0x20, 0x45,
79 0x69, 0x44, 0xB0, 0x01, 0x60, 0x20, 0x20, 0x45, 0x7D, 0x69, 0x18, 0x44, 0xB0, 0x01, 0x60, 0x2D,
80 0xB8, 0x00, 0x07, 0x2C, 0xB8, 0x00, 0x06, 0x2A, 0x2D, 0xB8, 0x00, 0x08, 0x2C, 0x4B, 0x20, 0xB0,
81 0x03, 0x26, 0x53, 0x58, 0xB0, 0x40, 0x1B, 0xB0, 0x00, 0x59, 0x8A, 0x8A, 0x20, 0xB0, 0x03, 0x26,
82 0x53, 0x58, 0x23, 0x21, 0xB0, 0x80, 0x8A, 0x8A, 0x1B, 0x8A, 0x23, 0x59, 0x20, 0xB0, 0x03, 0x26,
83 0x53, 0x58, 0x23, 0x21, 0xB8, 0x00, 0xC0, 0x8A, 0x8A, 0x1B, 0x8A, 0x23, 0x59, 0x20, 0xB0, 0x03,
84 0x26, 0x53, 0x58, 0x23, 0x21, 0xB8, 0x01, 0x00, 0x8A, 0x8A, 0x1B, 0x8A, 0x23, 0x59, 0x20, 0xB0,
85 0x03, 0x26, 0x53, 0x58, 0x23, 0x21, 0xB8, 0x01, 0x40, 0x8A, 0x8A, 0x1B, 0x8A, 0x23, 0x59, 0x20,
86 0xB8, 0x00, 0x03, 0x26, 0x53, 0x58, 0xB0, 0x03, 0x25, 0x45, 0xB8, 0x01, 0x80, 0x50, 0x58, 0x23,
87 0x21, 0xB8, 0x01, 0x80, 0x23, 0x21, 0x1B, 0xB0, 0x03, 0x25, 0x45, 0x23, 0x21, 0x23, 0x21, 0x59,
88 0x1B, 0x21, 0x59, 0x44, 0x2D, 0xB8, 0x00, 0x09, 0x2C, 0x4B, 0x53, 0x58, 0x45, 0x44, 0x1B, 0x21,
89 0x21, 0x59, 0x2D, 0x00, 0xB8, 0x00, 0x00, 0x2B, 0x00, 0xBA, 0x00, 0x01, 0x00, 0x01, 0x00, 0x07,
90 0x2B, 0xB8, 0x00, 0x00, 0x20, 0x45, 0x7D, 0x69, 0x18, 0x44, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00,
91 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x16, 0x00, 0x16, 0x00, 0x16, 0x00, 0x70,
92 0x00, 0xDC, 0x01, 0x34, 0x01, 0x7C, 0x01, 0xA2, 0x01, 0xF4, 0x02, 0x3C, 0x02, 0xA8, 0x03, 0x4C,
93 0x03, 0xE2, 0x04, 0x20, 0x04, 0x58, 0x04, 0x9A, 0x04, 0xEE, 0x05, 0x32, 0x05, 0x64, 0x05, 0x80,
94 0x05, 0xC6, 0x05, 0xF6, 0x06, 0x54, 0x06, 0xB2, 0x07, 0x38, 0x07, 0x60, 0x07, 0x82, 0x00, 0x00,
95 0x00, 0x02, 0x00, 0xA4, 0xFF, 0xFF, 0x03, 0x5C, 0x03, 0x09, 0x00, 0x03, 0x00, 0x07, 0x00, 0x00,
96 0x13, 0x11, 0x21, 0x11, 0x25, 0x21, 0x11, 0x21, 0xCD, 0x02, 0x66, 0xFD, 0x71, 0x02, 0xB8, 0xFD,
97 0x48, 0x02, 0xE0, 0xFD, 0x48, 0x02, 0xB8, 0x29, 0xFC, 0xF6, 0x00, 0x00, 0x00, 0x04, 0x00, 0x14,
98 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0F, 0x00, 0x1F, 0x00, 0x2F, 0x00, 0x39, 0x00, 0x00,
99 0x00, 0x22, 0x0E, 0x02, 0x14, 0x1E, 0x02, 0x32, 0x3E, 0x02, 0x34, 0x2E, 0x01, 0x24, 0x32, 0x1E,
100 0x02, 0x14, 0x0E, 0x02, 0x22, 0x2E, 0x02, 0x34, 0x3E, 0x01, 0x13, 0x12, 0x37, 0x33, 0x13, 0x12,
101 0x15, 0x16, 0x23, 0x2F, 0x01, 0x23, 0x07, 0x23, 0x22, 0x26, 0x25, 0x30, 0x27, 0x26, 0x2F, 0x01,
102 0x06, 0x07, 0x06, 0x32, 0x02, 0x5A, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77,
103 0x46, 0x46, 0x77, 0xFE, 0x9E, 0xC8, 0xB7, 0x83, 0x4E, 0x4E, 0x83, 0xB7, 0xC8, 0xB7, 0x83, 0x4E,
104 0x4E, 0x83, 0x23, 0x6C, 0x5E, 0x6D, 0x68, 0x68, 0x01, 0x39, 0x38, 0x2E, 0xD1, 0x2B, 0x37, 0x33,
105 0x04, 0x01, 0x48, 0x1D, 0x1C, 0x0A, 0x05, 0x01, 0x45, 0x01, 0x89, 0x03, 0x3F, 0x46, 0x77, 0xA4,
106 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x4E, 0x83, 0xB7, 0xC8, 0xB7,
107 0x83, 0x4E, 0x4E, 0x83, 0xB7, 0xC8, 0xB7, 0x83, 0xFD, 0x64, 0x01, 0x1A, 0xEB, 0xFE, 0xFE, 0xFE,
108 0xFD, 0x03, 0x01, 0x01, 0x77, 0x78, 0x01, 0xCF, 0x4C, 0x4C, 0x1C, 0x0C, 0x02, 0xBE, 0x02, 0x00,
109 0x00, 0x05, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0F, 0x00, 0x1B, 0x00, 0x2F,
110 0x00, 0x3A, 0x00, 0x44, 0x00, 0x00, 0x12, 0x14, 0x1E, 0x02, 0x32, 0x3E, 0x02, 0x34, 0x2E, 0x02,
111 0x22, 0x0E, 0x01, 0x02, 0x10, 0x3E, 0x01, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x26, 0x01,
112 0x16, 0x17, 0x14, 0x06, 0x07, 0x06, 0x2B, 0x01, 0x19, 0x01, 0x17, 0x32, 0x17, 0x16, 0x17, 0x16,
113 0x07, 0x06, 0x0F, 0x01, 0x36, 0x37, 0x34, 0x2E, 0x01, 0x27, 0x23, 0x15, 0x33, 0x32, 0x27, 0x32,
114 0x37, 0x36, 0x26, 0x27, 0x26, 0x2B, 0x01, 0x15, 0x45, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46,
115 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE,
116 0xF4, 0xE2, 0x01, 0xF7, 0x61, 0x01, 0x4E, 0x3E, 0x29, 0xAF, 0x4E, 0x81, 0x8B, 0x1D, 0x3C, 0x1F,
117 0x19, 0x04, 0x06, 0x39, 0x57, 0x44, 0x01, 0x1B, 0x2D, 0x51, 0x46, 0x46, 0x47, 0x66, 0x70, 0x16,
118 0x1F, 0x01, 0x2C, 0x08, 0x4B, 0x4C, 0x01, 0xDE, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4,
119 0xA4, 0x77, 0x46, 0x46, 0x77, 0xFE, 0x7C, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2,
120 0x84, 0x84, 0x01, 0x6D, 0x21, 0x5B, 0x40, 0x50, 0x05, 0x03, 0x01, 0x03, 0x01, 0x05, 0x01, 0x05,
121 0x09, 0x30, 0x25, 0x29, 0x40, 0x21, 0xC2, 0x06, 0x3E, 0x1A, 0x21, 0x0B, 0x01, 0x8C, 0xE1, 0x0A,
122 0x0E, 0x54, 0x0B, 0x02, 0x79, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC,
123 0x03, 0x70, 0x00, 0x0F, 0x00, 0x1B, 0x00, 0x38, 0x00, 0x00, 0x12, 0x14, 0x1E, 0x02, 0x32, 0x3E,
124 0x02, 0x34, 0x2E, 0x02, 0x22, 0x0E, 0x01, 0x02, 0x10, 0x3E, 0x01, 0x20, 0x1E, 0x01, 0x10, 0x0E,
125 0x01, 0x20, 0x26, 0x36, 0x34, 0x3F, 0x01, 0x27, 0x26, 0x27, 0x33, 0x17, 0x16, 0x33, 0x36, 0x3F,
126 0x02, 0x32, 0x14, 0x06, 0x16, 0x12, 0x14, 0x2B, 0x01, 0x27, 0x26, 0x06, 0x0F, 0x01, 0x23, 0x45,
127 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x84, 0xE2,
128 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x7B, 0x58, 0x58, 0x4D, 0x4F, 0x05, 0x7A,
129 0x34, 0x34, 0x02, 0x01, 0x33, 0x32, 0x3C, 0x3C, 0xA1, 0x01, 0xB0, 0x3E, 0x3F, 0x39, 0x3B, 0x02,
130 0x3A, 0x38, 0x3F, 0x01, 0xDE, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46,
131 0x46, 0x77, 0xFE, 0x7C, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x60,
132 0x02, 0x87, 0x88, 0x79, 0x7A, 0x06, 0x54, 0x54, 0x01, 0x53, 0x53, 0x01, 0x01, 0xFB, 0x04, 0xFE,
133 0xF8, 0x02, 0x5B, 0x5A, 0x03, 0x59, 0x59, 0x00, 0x00, 0x03, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC,
134 0x03, 0x70, 0x00, 0x0F, 0x00, 0x1B, 0x00, 0x2B, 0x00, 0x00, 0x00, 0x22, 0x0E, 0x02, 0x14, 0x1E,
135 0x02, 0x32, 0x3E, 0x02, 0x34, 0x2E, 0x01, 0x24, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E,
136 0x01, 0x10, 0x36, 0x01, 0x35, 0x27, 0x26, 0x34, 0x3B, 0x01, 0x17, 0x16, 0x36, 0x3F, 0x01, 0x33,
137 0x03, 0x15, 0x23, 0x02, 0x5A, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46,
138 0x46, 0x77, 0xFE, 0x7C, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x01,
139 0x36, 0x5E, 0x5F, 0x3C, 0x3D, 0x3D, 0x3D, 0x03, 0x3B, 0x3B, 0x77, 0xBE, 0x68, 0x03, 0x3F, 0x46,
140 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x84, 0xE2, 0xFE,
141 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFD, 0xF9, 0x6E, 0x96, 0x95, 0x01, 0x67, 0x67,
142 0x03, 0x66, 0x65, 0xFE, 0xD3, 0xDA, 0x00, 0x00, 0x00, 0x03, 0x00, 0x14, 0xFF, 0xBD, 0x03, 0xEC,
143 0x03, 0x4B, 0x00, 0x06, 0x00, 0x0C, 0x00, 0x12, 0x00, 0x00, 0x01, 0x21, 0x22, 0x15, 0x30, 0x11,
144 0x21, 0x17, 0x21, 0x11, 0x10, 0x25, 0x21, 0x01, 0x11, 0x33, 0x11, 0x21, 0x15, 0x03, 0xBB, 0xFD,
145 0x77, 0xED, 0x03, 0x76, 0x31, 0xFC, 0x28, 0x01, 0x1E, 0x02, 0xBA, 0xFD, 0x5C, 0x68, 0x01, 0x08,
146 0x03, 0x1A, 0xEE, 0xFD, 0xC2, 0x31, 0x02, 0x6F, 0x01, 0x1E, 0x01, 0xFD, 0x36, 0x02, 0x07, 0xFE,
147 0x50, 0x57, 0x00, 0x00, 0x00, 0x04, 0x00, 0x14, 0xFF, 0xBD, 0x03, 0xEC, 0x03, 0x4B, 0x00, 0x06,
148 0x00, 0x0C, 0x00, 0x27, 0x00, 0x32, 0x00, 0x00, 0x05, 0x11, 0x34, 0x27, 0x30, 0x21, 0x11, 0x07,
149 0x11, 0x21, 0x20, 0x19, 0x01, 0x25, 0x11, 0x33, 0x32, 0x17, 0x16, 0x17, 0x16, 0x17, 0x16, 0x07,
150 0x06, 0x07, 0x06, 0x07, 0x1E, 0x02, 0x15, 0x07, 0x23, 0x27, 0x2E, 0x01, 0x2F, 0x01, 0x15, 0x13,
151 0x36, 0x35, 0x34, 0x27, 0x26, 0x27, 0x23, 0x15, 0x33, 0x36, 0x03, 0xBB, 0xED, 0xFD, 0x77, 0x31,
152 0x02, 0xBA, 0x01, 0x1E, 0xFD, 0x2A, 0x77, 0x76, 0x15, 0x49, 0x20, 0x35, 0x08, 0x04, 0x06, 0x13,
153 0x66, 0x0C, 0x01, 0x1F, 0x2E, 0x65, 0x3D, 0x3D, 0x2A, 0x56, 0x28, 0x2E, 0x19, 0x99, 0x3C, 0x20,
154 0x10, 0x56, 0x4F, 0x46, 0x47, 0x12, 0x02, 0x3E, 0xED, 0x01, 0xFC, 0xD4, 0x31, 0x03, 0x8E, 0xFE,
155 0xE1, 0xFD, 0x91, 0xC4, 0x02, 0x07, 0x01, 0x04, 0x13, 0x21, 0x44, 0x1D, 0x19, 0x58, 0x15, 0x02,
156 0x01, 0x13, 0x2D, 0xA2, 0x01, 0x01, 0x3D, 0x81, 0x1A, 0x01, 0x01, 0xDA, 0x01, 0x2D, 0x08, 0x3A,
157 0x29, 0x0F, 0x08, 0x01, 0x85, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x14, 0xFF, 0xF5, 0x03, 0xEC,
158 0x03, 0x13, 0x00, 0x09, 0x00, 0x11, 0x00, 0x26, 0x00, 0x32, 0x00, 0x00, 0x37, 0x21, 0x34, 0x10,
159 0x35, 0x34, 0x27, 0x21, 0x04, 0x11, 0x23, 0x10, 0x25, 0x21, 0x16, 0x15, 0x11, 0x21, 0x37, 0x35,
160 0x37, 0x36, 0x22, 0x2B, 0x01, 0x3D, 0x01, 0x3B, 0x01, 0x1D, 0x01, 0x0F, 0x01, 0x3B, 0x01, 0x1D,
161 0x01, 0x2B, 0x01, 0x25, 0x35, 0x3B, 0x01, 0x1D, 0x01, 0x3B, 0x01, 0x1D, 0x01, 0x2B, 0x01, 0x45,
162 0x03, 0x76, 0x45, 0xFE, 0x2D, 0xFE, 0xA2, 0x31, 0x01, 0x8F, 0x01, 0xD3, 0x76, 0xFC, 0x28, 0xA7,
163 0x68, 0x68, 0x01, 0x5B, 0x5D, 0x90, 0x91, 0x6C, 0x6D, 0x71, 0x70, 0xA0, 0xA0, 0x01, 0x75, 0x27,
164 0x28, 0x63, 0x63, 0x8B, 0x8A, 0x27, 0x69, 0x01, 0xA4, 0x69, 0x44, 0x01, 0x02, 0xFE, 0xA4, 0x01,
165 0x8C, 0x03, 0x01, 0x75, 0xFD, 0x58, 0xBB, 0x24, 0x80, 0x80, 0x21, 0x21, 0x1F, 0x1E, 0x85, 0x86,
166 0x20, 0x22, 0xC3, 0xC3, 0xA1, 0xA3, 0x20, 0x22, 0x00, 0x05, 0x00, 0x14, 0xFF, 0xF5, 0x03, 0xEC,
167 0x03, 0x13, 0x00, 0x08, 0x00, 0x10, 0x00, 0x2B, 0x00, 0x37, 0x00, 0x44, 0x00, 0x00, 0x37, 0x21,
168 0x11, 0x10, 0x25, 0x30, 0x21, 0x06, 0x15, 0x03, 0x11, 0x34, 0x37, 0x21, 0x04, 0x19, 0x01, 0x01,
169 0x35, 0x17, 0x32, 0x17, 0x16, 0x17, 0x16, 0x07, 0x06, 0x07, 0x06, 0x17, 0x16, 0x17, 0x16, 0x17,
170 0x16, 0x23, 0x2F, 0x01, 0x2E, 0x01, 0x2F, 0x01, 0x15, 0x23, 0x37, 0x32, 0x36, 0x37, 0x36, 0x35,
171 0x26, 0x27, 0x26, 0x2B, 0x01, 0x15, 0x05, 0x35, 0x37, 0x36, 0x26, 0x2B, 0x01, 0x35, 0x21, 0x15,
172 0x03, 0x17, 0x15, 0x45, 0x03, 0x76, 0xFE, 0xA2, 0xFE, 0x2D, 0x45, 0x31, 0x76, 0x01, 0xD3, 0x01,
173 0x8F, 0xFE, 0x1E, 0x65, 0x6F, 0x15, 0x46, 0x10, 0x05, 0x04, 0x0D, 0x4F, 0x09, 0x09, 0x1F, 0x1D,
174 0x3A, 0x06, 0x01, 0x30, 0x2F, 0x22, 0x37, 0x1E, 0x29, 0x14, 0x4E, 0x82, 0x34, 0x19, 0x0E, 0x13,
175 0x0A, 0x22, 0x07, 0x38, 0x37, 0xFE, 0x3E, 0x68, 0x68, 0x01, 0x5C, 0x5C, 0x01, 0x20, 0xD8, 0xE1,
176 0x27, 0x01, 0x5D, 0x01, 0x5B, 0x03, 0x01, 0x44, 0xFD, 0x58, 0x02, 0xA8, 0x75, 0x01, 0x03, 0xFE,
177 0x74, 0xFE, 0x71, 0x01, 0x5C, 0xC5, 0x01, 0x04, 0x0C, 0x43, 0x15, 0x1D, 0x44, 0x10, 0x04, 0x06,
178 0x14, 0x2B, 0x56, 0x10, 0x01, 0x01, 0x34, 0x52, 0x1C, 0x01, 0x01, 0xA5, 0xE3, 0x04, 0x06, 0x0A,
179 0x20, 0x2C, 0x04, 0x01, 0x65, 0xE3, 0x47, 0x80, 0x80, 0x01, 0x42, 0x3D, 0xFE, 0xF5, 0x01, 0x41,
180 0x00, 0x04, 0x00, 0x14, 0x00, 0x52, 0x03, 0xEC, 0x02, 0xB6, 0x00, 0x08, 0x00, 0x16, 0x00, 0x64,
181 0x00, 0x70, 0x00, 0x00, 0x25, 0x11, 0x21, 0x22, 0x15, 0x30, 0x15, 0x14, 0x33, 0x11, 0x21, 0x32,
182 0x15, 0x11, 0x14, 0x27, 0x21, 0x22, 0x26, 0x3D, 0x01, 0x34, 0x36, 0x13, 0x26, 0x27, 0x26, 0x27,
183 0x26, 0x37, 0x33, 0x36, 0x37, 0x36, 0x33, 0x16, 0x17, 0x16, 0x17, 0x16, 0x37, 0x36, 0x37, 0x36,
184 0x35, 0x34, 0x27, 0x26, 0x27, 0x26, 0x27, 0x26, 0x27, 0x26, 0x27, 0x26, 0x34, 0x37, 0x36, 0x37,
185 0x36, 0x37, 0x36, 0x17, 0x16, 0x17, 0x16, 0x17, 0x16, 0x17, 0x16, 0x0F, 0x01, 0x22, 0x06, 0x23,
186 0x27, 0x26, 0x27, 0x26, 0x23, 0x22, 0x07, 0x06, 0x07, 0x06, 0x17, 0x16, 0x17, 0x16, 0x17, 0x16,
187 0x17, 0x16, 0x17, 0x16, 0x07, 0x06, 0x07, 0x06, 0x27, 0x37, 0x35, 0x3B, 0x01, 0x1D, 0x01, 0x3B,
188 0x01, 0x1D, 0x01, 0x2B, 0x01, 0x03, 0xBB, 0xFD, 0x2A, 0xA0, 0xA0, 0x02, 0xEE, 0x19, 0x19, 0xFD,
189 0x12, 0x57, 0x7A, 0x7A, 0xCA, 0x38, 0x1D, 0x16, 0x08, 0x03, 0x01, 0x02, 0x0F, 0x0C, 0x1E, 0x01,
190 0x02, 0x04, 0x0C, 0x2B, 0x0F, 0x0E, 0x18, 0x0C, 0x09, 0x04, 0x15, 0x32, 0x23, 0x12, 0x1C, 0x0E,
191 0x09, 0x03, 0x01, 0x01, 0x09, 0x21, 0x0F, 0x14, 0x2E, 0x2A, 0x13, 0x0F, 0x0C, 0x08, 0x0B, 0x05,
192 0x02, 0x01, 0x02, 0x03, 0x36, 0x03, 0x02, 0x03, 0x08, 0x0D, 0x23, 0x16, 0x0E, 0x10, 0x01, 0x01,
193 0x07, 0x0B, 0x32, 0x25, 0x13, 0x26, 0x0F, 0x09, 0x01, 0x01, 0x0F, 0x11, 0x24, 0x21, 0x2A, 0xE3,
194 0x20, 0x20, 0x52, 0x50, 0x71, 0x71, 0x84, 0x02, 0x00, 0xAF, 0xA2, 0xAF, 0x02, 0x32, 0x19, 0xFD,
195 0xCE, 0x19, 0x01, 0x84, 0x5C, 0xA2, 0x5C, 0x85, 0xFE, 0x29, 0x04, 0x1E, 0x18, 0x26, 0x0F, 0x01,
196 0x02, 0x01, 0x03, 0x05, 0x0B, 0x29, 0x06, 0x02, 0x03, 0x04, 0x11, 0x0B, 0x0D, 0x0A, 0x06, 0x12,
197 0x0D, 0x0A, 0x07, 0x0C, 0x18, 0x0D, 0x10, 0x06, 0x18, 0x05, 0x27, 0x14, 0x09, 0x03, 0x0A, 0x0D,
198 0x06, 0x09, 0x09, 0x0D, 0x0F, 0x14, 0x0C, 0x06, 0x03, 0x02, 0x04, 0x10, 0x0A, 0x11, 0x08, 0x09,
199 0x0E, 0x0C, 0x07, 0x0C, 0x0C, 0x0A, 0x07, 0x0F, 0x20, 0x11, 0x18, 0x1E, 0x1A, 0x1E, 0x0C, 0x0B,
200 0x03, 0xAA, 0xA5, 0x89, 0x8A, 0x1C, 0x1B, 0x00, 0x00, 0x05, 0x00, 0x14, 0x00, 0x53, 0x03, 0xEC,
201 0x02, 0xB6, 0x00, 0x08, 0x00, 0x16, 0x00, 0x2E, 0x00, 0x38, 0x00, 0x65, 0x00, 0x00, 0x01, 0x30,
202 0x21, 0x11, 0x21, 0x32, 0x3D, 0x01, 0x34, 0x27, 0x32, 0x16, 0x1D, 0x01, 0x14, 0x06, 0x23, 0x21,
203 0x26, 0x35, 0x11, 0x34, 0x33, 0x01, 0x11, 0x33, 0x32, 0x17, 0x16, 0x17, 0x16, 0x07, 0x06, 0x07,
204 0x17, 0x1E, 0x01, 0x1F, 0x01, 0x23, 0x2A, 0x01, 0x2E, 0x01, 0x23, 0x27, 0x15, 0x37, 0x32, 0x37,
205 0x36, 0x27, 0x2E, 0x01, 0x2B, 0x01, 0x15, 0x05, 0x26, 0x27, 0x37, 0x32, 0x3F, 0x01, 0x16, 0x17,
206 0x1E, 0x01, 0x37, 0x36, 0x27, 0x2E, 0x04, 0x37, 0x3E, 0x01, 0x33, 0x32, 0x17, 0x16, 0x17, 0x14,
207 0x06, 0x27, 0x26, 0x27, 0x26, 0x0E, 0x01, 0x1E, 0x02, 0x17, 0x16, 0x06, 0x07, 0x06, 0x07, 0x06,
208 0x03, 0x1B, 0xFD, 0x2A, 0x02, 0xD6, 0xA0, 0xA0, 0x57, 0x7A, 0x7A, 0x57, 0xFD, 0x12, 0x19, 0x19,
209 0x01, 0xD3, 0x47, 0x44, 0x11, 0x3E, 0x18, 0x21, 0x0B, 0x0C, 0x43, 0x04, 0x17, 0x1C, 0x1E, 0x16,
210 0x26, 0x26, 0x03, 0x4D, 0x18, 0x1E, 0x11, 0x25, 0x3A, 0x0C, 0x22, 0x08, 0x03, 0x1B, 0x3E, 0x29,
211 0xFE, 0xAC, 0x0D, 0x04, 0x02, 0x02, 0x1E, 0x1D, 0x03, 0x02, 0x0C, 0x4C, 0x13, 0x20, 0x07, 0x04,
212 0x1B, 0x56, 0x2D, 0x1C, 0x01, 0x02, 0x44, 0x35, 0x49, 0x1F, 0x10, 0x03, 0x41, 0x01, 0x06, 0x0A,
213 0x16, 0x3C, 0x18, 0x0C, 0x16, 0x5D, 0x15, 0x33, 0x03, 0x2B, 0x1E, 0x34, 0x59, 0x02, 0x84, 0xFE,
214 0x00, 0xAF, 0xA2, 0xAF, 0x32, 0x85, 0x5C, 0xA2, 0x5C, 0x84, 0x01, 0x17, 0x02, 0x32, 0x19, 0xFE,
215 0x2F, 0x01, 0x45, 0x01, 0x02, 0x19, 0x22, 0x32, 0x39, 0x0B, 0x08, 0x0F, 0x27, 0x2F, 0x24, 0x75,
216 0x12, 0x01, 0x88, 0xBB, 0x04, 0x09, 0x2A, 0x0F, 0x0D, 0x53, 0x8A, 0x17, 0x1E, 0x04, 0x03, 0x03,
217 0x0C, 0x04, 0x26, 0x0E, 0x0C, 0x14, 0x1A, 0x0E, 0x0E, 0x16, 0x16, 0x2C, 0x1A, 0x2D, 0x2D, 0x2A,
218 0x16, 0x1D, 0x06, 0x04, 0x01, 0x1A, 0x09, 0x11, 0x09, 0x17, 0x18, 0x0D, 0x17, 0x0C, 0x1B, 0x71,
219 0x1B, 0x12, 0x01, 0x03, 0x00, 0x03, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0F,
220 0x00, 0x1B, 0x00, 0x27, 0x00, 0x00, 0x00, 0x22, 0x0E, 0x02, 0x14, 0x1E, 0x02, 0x32, 0x3E, 0x02,
221 0x34, 0x2E, 0x01, 0x24, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E, 0x01, 0x10, 0x36, 0x13,
222 0x33, 0x35, 0x33, 0x15, 0x33, 0x15, 0x23, 0x15, 0x23, 0x35, 0x23, 0x02, 0x5A, 0xB4, 0xA4, 0x77,
223 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xFE, 0x7C, 0x01, 0x0C, 0xE2, 0x84,
224 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x7C, 0xC5, 0x4E, 0xC5, 0xC4, 0x50, 0xC4, 0x03, 0x3F,
225 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x84, 0xE2,
226 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFE, 0xC0, 0xC4, 0xC5, 0x4E, 0xC5, 0xC5,
227 0x00, 0x03, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0F, 0x00, 0x1B, 0x00, 0x1F,
228 0x00, 0x00, 0x00, 0x22, 0x0E, 0x02, 0x14, 0x1E, 0x02, 0x32, 0x3E, 0x02, 0x34, 0x2E, 0x01, 0x24,
229 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E, 0x01, 0x10, 0x36, 0x13, 0x35, 0x21, 0x15, 0x02,
230 0x5A, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xFE, 0x7C,
231 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x7C, 0x01, 0xD8, 0x03, 0x3F,
232 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x46, 0x46, 0x77, 0xA4, 0xB4, 0xA4, 0x77, 0x77, 0x84, 0xE2,
233 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFE, 0x71, 0x4E, 0x4E, 0x00, 0x00, 0x00,
234 0x00, 0x03, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B, 0x00, 0x1B, 0x00, 0x25,
235 0x00, 0x00, 0x00, 0x20, 0x0E, 0x01, 0x10, 0x1E, 0x01, 0x20, 0x3E, 0x01, 0x10, 0x26, 0x01, 0x12,
236 0x37, 0x33, 0x13, 0x12, 0x15, 0x16, 0x23, 0x2F, 0x01, 0x23, 0x07, 0x23, 0x22, 0x26, 0x25, 0x30,
237 0x27, 0x26, 0x2F, 0x01, 0x06, 0x07, 0x06, 0x32, 0x02, 0x86, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2,
238 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xFD, 0xA0, 0x6C, 0x5E, 0x6D, 0x68, 0x68, 0x01, 0x39, 0x38, 0x2E,
239 0xD1, 0x2B, 0x37, 0x33, 0x04, 0x01, 0x48, 0x1D, 0x1C, 0x0A, 0x05, 0x01, 0x45, 0x01, 0x89, 0x03,
240 0x70, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFD, 0x9A, 0x01, 0x1A,
241 0xEB, 0xFE, 0xFE, 0xFE, 0xFD, 0x03, 0x01, 0x01, 0x77, 0x78, 0x01, 0xCF, 0x4C, 0x4C, 0x1C, 0x0C,
242 0x02, 0xBE, 0x02, 0x00, 0x00, 0x04, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B,
243 0x00, 0x20, 0x00, 0x2B, 0x00, 0x35, 0x00, 0x00, 0x36, 0x10, 0x3E, 0x01, 0x20, 0x1E, 0x01, 0x10,
244 0x0E, 0x01, 0x20, 0x26, 0x01, 0x30, 0x37, 0x36, 0x37, 0x36, 0x27, 0x26, 0x27, 0x26, 0x23, 0x27,
245 0x19, 0x01, 0x33, 0x32, 0x37, 0x3E, 0x01, 0x35, 0x26, 0x07, 0x06, 0x2B, 0x01, 0x35, 0x33, 0x1E,
246 0x02, 0x15, 0x06, 0x27, 0x23, 0x35, 0x33, 0x16, 0x17, 0x16, 0x14, 0x07, 0x06, 0x14, 0x84, 0xE2,
247 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x01, 0xF7, 0x0A, 0x3A, 0x05, 0x04, 0x19,
248 0x20, 0x3B, 0x1D, 0x8B, 0x81, 0x4E, 0xAF, 0x29, 0x3E, 0x4E, 0x01, 0xAE, 0x0D, 0x47, 0x46, 0x46,
249 0x52, 0x2C, 0x1B, 0x01, 0xB7, 0x27, 0x4C, 0x4C, 0x07, 0x2C, 0x1E, 0x16, 0xFE, 0x01, 0x0C, 0xE2,
250 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x01, 0x6D, 0x06, 0x21, 0x40, 0x2A, 0x24, 0x30,
251 0x09, 0x05, 0x01, 0xFE, 0xFB, 0xFE, 0xFD, 0x03, 0x05, 0x4F, 0x41, 0x5B, 0x9B, 0x01, 0x8C, 0x01,
252 0x0B, 0x21, 0x1A, 0x3E, 0xDA, 0x79, 0x01, 0x01, 0x0B, 0x54, 0x0E, 0x0A, 0x00, 0x02, 0x00, 0x14,
253 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B, 0x00, 0x29, 0x00, 0x00, 0x36, 0x10, 0x3E, 0x01,
254 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x26, 0x36, 0x14, 0x3B, 0x01, 0x37, 0x36, 0x37, 0x36,
255 0x1F, 0x01, 0x33, 0x32, 0x34, 0x02, 0x26, 0x36, 0x34, 0x23, 0x0F, 0x01, 0x06, 0x07, 0x22, 0x2F,
256 0x01, 0x23, 0x16, 0x1F, 0x01, 0x07, 0x14, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE,
257 0xF4, 0xE2, 0x7B, 0x3D, 0x3F, 0x38, 0x3A, 0x01, 0x02, 0x3A, 0x39, 0x3F, 0x3E, 0xB0, 0x01, 0xA1,
258 0x3C, 0x3C, 0x32, 0x33, 0x01, 0x02, 0x34, 0x34, 0x7A, 0x05, 0x4F, 0x4D, 0x58, 0xFE, 0x01, 0x0C,
259 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x62, 0x02, 0x59, 0x59, 0x02, 0x01, 0x5A,
260 0x5B, 0x02, 0x01, 0x08, 0x04, 0xFB, 0x01, 0x01, 0x53, 0x53, 0x01, 0x54, 0x54, 0x06, 0x7A, 0x79,
261 0x88, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B,
262 0x00, 0x1B, 0x00, 0x00, 0x00, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E, 0x01, 0x10, 0x36,
263 0x01, 0x15, 0x33, 0x35, 0x13, 0x23, 0x07, 0x0E, 0x01, 0x2F, 0x01, 0x23, 0x22, 0x16, 0x1F, 0x01,
264 0x01, 0x7A, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x01, 0x36, 0x68,
265 0xBE, 0x77, 0x3B, 0x3C, 0x02, 0x3D, 0x3D, 0x3D, 0x3D, 0x01, 0x5F, 0x5E, 0x03, 0x70, 0x84, 0xE2,
266 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFD, 0xF9, 0x6D, 0xDA, 0x01, 0x2D, 0x65,
267 0x66, 0x03, 0x67, 0x67, 0x01, 0x95, 0x96, 0x00, 0x00, 0x02, 0x00, 0x14, 0xFF, 0xBF, 0x03, 0xEC,
268 0x03, 0x4A, 0x00, 0x05, 0x00, 0x0B, 0x00, 0x00, 0x05, 0x21, 0x11, 0x10, 0x05, 0x21, 0x01, 0x21,
269 0x35, 0x21, 0x11, 0x23, 0x03, 0xEC, 0xFC, 0x28, 0x01, 0x14, 0x02, 0xC4, 0xFD, 0x5C, 0x01, 0x70,
270 0xFE, 0xF8, 0x68, 0x41, 0x02, 0x77, 0x01, 0x14, 0x01, 0xFD, 0x38, 0x57, 0x01, 0xB0, 0x00, 0x00,
271 0x00, 0x03, 0x00, 0x14, 0xFF, 0xBF, 0x03, 0xEC, 0x03, 0x49, 0x00, 0x05, 0x00, 0x20, 0x00, 0x2B,
272 0x00, 0x00, 0x17, 0x11, 0x21, 0x20, 0x19, 0x01, 0x25, 0x33, 0x35, 0x17, 0x1E, 0x01, 0x1F, 0x01,
273 0x33, 0x37, 0x2E, 0x02, 0x27, 0x34, 0x37, 0x36, 0x37, 0x36, 0x27, 0x26, 0x27, 0x26, 0x27, 0x26,
274 0x2B, 0x01, 0x05, 0x06, 0x2B, 0x01, 0x35, 0x33, 0x16, 0x17, 0x16, 0x15, 0x14, 0x14, 0x02, 0xC4,
275 0x01, 0x14, 0xFD, 0x2A, 0x69, 0x19, 0x2E, 0x28, 0x56, 0x2A, 0x3D, 0x3D, 0x01, 0x65, 0x2C, 0x20,
276 0x0D, 0x66, 0x13, 0x06, 0x04, 0x09, 0x34, 0x20, 0x49, 0x15, 0x76, 0x77, 0x01, 0x02, 0x0C, 0x47,
277 0x46, 0x4F, 0x56, 0x10, 0x20, 0x41, 0x03, 0x8A, 0xFE, 0xED, 0xFD, 0x89, 0xC2, 0xDA, 0x01, 0x01,
278 0x1A, 0x81, 0x3D, 0x01, 0x01, 0xA3, 0x2C, 0x13, 0x01, 0x02, 0x13, 0x5A, 0x1A, 0x1C, 0x44, 0x21,
279 0x13, 0x04, 0x01, 0xDA, 0x02, 0x85, 0x01, 0x08, 0x0F, 0x29, 0x3A, 0x00, 0x00, 0x03, 0x00, 0x14,
280 0xFF, 0xFB, 0x03, 0xEC, 0x03, 0x0E, 0x00, 0x08, 0x00, 0x15, 0x00, 0x1B, 0x00, 0x00, 0x05, 0x21,
281 0x11, 0x10, 0x21, 0x30, 0x21, 0x32, 0x15, 0x01, 0x21, 0x35, 0x23, 0x13, 0x35, 0x21, 0x15, 0x33,
282 0x32, 0x22, 0x0F, 0x01, 0x05, 0x21, 0x35, 0x23, 0x11, 0x23, 0x03, 0xEC, 0xFC, 0x28, 0x01, 0x8A,
283 0x01, 0xEC, 0x62, 0xFC, 0xCF, 0x01, 0x40, 0xE1, 0xD9, 0xFE, 0xDF, 0x5D, 0x5C, 0x01, 0x67, 0x68,
284 0x01, 0x75, 0x01, 0x15, 0xC6, 0x4F, 0x05, 0x01, 0x89, 0x01, 0x8A, 0x63, 0xFD, 0xE1, 0x42, 0x01,
285 0x0B, 0x3D, 0x42, 0x80, 0x80, 0x48, 0x42, 0x01, 0x44, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x14,
286 0xFF, 0xFB, 0x03, 0xEC, 0x03, 0x0E, 0x00, 0x07, 0x00, 0x22, 0x00, 0x2F, 0x00, 0x3C, 0x00, 0x00,
287 0x17, 0x11, 0x34, 0x37, 0x21, 0x20, 0x19, 0x01, 0x01, 0x15, 0x33, 0x35, 0x17, 0x1E, 0x01, 0x1F,
288 0x02, 0x32, 0x35, 0x26, 0x27, 0x26, 0x27, 0x26, 0x37, 0x36, 0x37, 0x36, 0x27, 0x26, 0x27, 0x26,
289 0x23, 0x27, 0x17, 0x30, 0x23, 0x35, 0x33, 0x32, 0x17, 0x16, 0x17, 0x14, 0x07, 0x0E, 0x01, 0x05,
290 0x21, 0x35, 0x27, 0x13, 0x35, 0x21, 0x15, 0x33, 0x32, 0x14, 0x0F, 0x01, 0x14, 0x62, 0x01, 0xEC,
291 0x01, 0x8A, 0xFE, 0x1E, 0x4E, 0x14, 0x29, 0x1E, 0x37, 0x22, 0x2F, 0x2F, 0x06, 0x3A, 0x1D, 0x1F,
292 0x09, 0x09, 0x4E, 0x0E, 0x04, 0x05, 0x0F, 0x47, 0x15, 0x6F, 0x65, 0x82, 0x34, 0x37, 0x38, 0x07,
293 0x23, 0x09, 0x13, 0x0D, 0x1A, 0xFD, 0xD6, 0x01, 0x40, 0xE1, 0xD8, 0xFE, 0xE0, 0x5C, 0x5C, 0x67,
294 0x68, 0x05, 0x02, 0xB0, 0x62, 0x01, 0xFE, 0x76, 0xFE, 0x77, 0x01, 0x56, 0xC5, 0xA5, 0x01, 0x01,
295 0x1C, 0x52, 0x34, 0x01, 0x01, 0x0E, 0x58, 0x2C, 0x13, 0x06, 0x04, 0x0F, 0x45, 0x1E, 0x14, 0x42,
296 0x0D, 0x04, 0x01, 0xA7, 0x65, 0x01, 0x04, 0x2C, 0x21, 0x09, 0x07, 0x03, 0xE3, 0x41, 0x01, 0x01,
297 0x0B, 0x3D, 0x42, 0x01, 0x80, 0x80, 0x00, 0x00, 0x00, 0x03, 0x00, 0x14, 0x00, 0x5D, 0x03, 0xEC,
298 0x02, 0xAB, 0x00, 0x08, 0x00, 0x37, 0x00, 0x3D, 0x00, 0x00, 0x13, 0x30, 0x21, 0x11, 0x21, 0x22,
299 0x3D, 0x01, 0x34, 0x05, 0x37, 0x34, 0x27, 0x26, 0x27, 0x26, 0x07, 0x06, 0x07, 0x0E, 0x01, 0x17,
300 0x1E, 0x01, 0x17, 0x16, 0x14, 0x07, 0x06, 0x26, 0x27, 0x26, 0x27, 0x22, 0x06, 0x07, 0x22, 0x17,
301 0x1E, 0x01, 0x17, 0x16, 0x37, 0x36, 0x27, 0x26, 0x27, 0x2E, 0x02, 0x37, 0x36, 0x33, 0x32, 0x1F,
302 0x02, 0x33, 0x35, 0x23, 0x11, 0x23, 0xD6, 0x03, 0x16, 0xFC, 0xEA, 0xC2, 0x01, 0xC6, 0x02, 0x01,
303 0x0C, 0x3A, 0x2B, 0x2D, 0x13, 0x10, 0x2B, 0x01, 0x33, 0x17, 0x55, 0x15, 0x04, 0x09, 0x14, 0x58,
304 0x0C, 0x04, 0x02, 0x02, 0x26, 0x14, 0x01, 0x03, 0x08, 0x33, 0x38, 0x5F, 0x20, 0x10, 0x01, 0x03,
305 0x3C, 0x12, 0x59, 0x11, 0x01, 0x02, 0x39, 0x2C, 0x09, 0x02, 0x9D, 0xE2, 0xA2, 0x40, 0x02, 0xAB,
306 0xFD, 0xB2, 0xD2, 0xAA, 0xD2, 0xDC, 0x03, 0x07, 0x0B, 0x38, 0x10, 0x0C, 0x09, 0x04, 0x08, 0x19,
307 0x6C, 0x17, 0x0B, 0x17, 0x11, 0x07, 0x17, 0x0A, 0x1A, 0x0A, 0x29, 0x0C, 0x04, 0x04, 0x02, 0x10,
308 0x25, 0x37, 0x04, 0x06, 0x37, 0x1D, 0x1C, 0x3F, 0x19, 0x08, 0x16, 0x13, 0x0B, 0x1F, 0x2B, 0x04,
309 0xE9, 0x37, 0x01, 0x13, 0x00, 0x04, 0x00, 0x14, 0x00, 0x5D, 0x03, 0xEC, 0x02, 0xAB, 0x00, 0x07,
310 0x00, 0x1F, 0x00, 0x2A, 0x00, 0x58, 0x00, 0x00, 0x01, 0x32, 0x1D, 0x01, 0x14, 0x23, 0x21, 0x11,
311 0x01, 0x33, 0x35, 0x17, 0x1E, 0x03, 0x3B, 0x01, 0x27, 0x2E, 0x01, 0x2F, 0x01, 0x36, 0x37, 0x36,
312 0x27, 0x26, 0x27, 0x26, 0x2B, 0x01, 0x17, 0x30, 0x23, 0x35, 0x33, 0x32, 0x16, 0x17, 0x16, 0x07,
313 0x06, 0x05, 0x16, 0x37, 0x36, 0x37, 0x3E, 0x01, 0x27, 0x2E, 0x03, 0x3E, 0x01, 0x17, 0x16, 0x17,
314 0x30, 0x37, 0x36, 0x27, 0x26, 0x27, 0x26, 0x27, 0x22, 0x06, 0x07, 0x06, 0x1E, 0x03, 0x17, 0x16,
315 0x07, 0x06, 0x26, 0x27, 0x26, 0x27, 0x07, 0x06, 0x23, 0x07, 0x16, 0x03, 0x2A, 0xC2, 0xC2, 0xFC,
316 0xEA, 0x01, 0xEC, 0x41, 0x11, 0x1F, 0x17, 0x4D, 0x02, 0x27, 0x26, 0x16, 0x1E, 0x1C, 0x17, 0x04,
317 0x43, 0x0C, 0x0B, 0x21, 0x18, 0x3E, 0x0F, 0x46, 0x47, 0x66, 0x25, 0x29, 0x3E, 0x1B, 0x03, 0x08,
318 0x22, 0x0C, 0xFE, 0x4D, 0x22, 0x59, 0x34, 0x1E, 0x2B, 0x03, 0x33, 0x16, 0x5C, 0x16, 0x0C, 0x18,
319 0x3C, 0x16, 0x0B, 0x05, 0x22, 0x21, 0x01, 0x03, 0x10, 0x1F, 0x49, 0x36, 0x43, 0x02, 0x01, 0x1C,
320 0x2D, 0x56, 0x1B, 0x04, 0x07, 0x20, 0x13, 0x4B, 0x0D, 0x01, 0x04, 0x1D, 0x1E, 0x02, 0x02, 0x04,
321 0x02, 0xAB, 0xD2, 0xAA, 0xD2, 0x02, 0x4E, 0xFE, 0x39, 0x89, 0x01, 0x01, 0x11, 0x75, 0x01, 0x25,
322 0x2F, 0x27, 0x0F, 0x08, 0x0C, 0x38, 0x33, 0x21, 0x19, 0x02, 0x01, 0x8A, 0x53, 0x0D, 0x0F, 0x2A,
323 0x09, 0x04, 0x8A, 0x3A, 0x03, 0x01, 0x12, 0x1B, 0x71, 0x1B, 0x0C, 0x17, 0x0D, 0x18, 0x17, 0x09,
324 0x11, 0x09, 0x1A, 0x01, 0x01, 0x07, 0x1E, 0x15, 0x29, 0x01, 0x2D, 0x2D, 0x1A, 0x2C, 0x16, 0x16,
325 0x0D, 0x0F, 0x1A, 0x14, 0x0C, 0x0D, 0x27, 0x04, 0x0C, 0x03, 0x03, 0x04, 0x1E, 0x00, 0x00, 0x00,
326 0x00, 0x02, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B, 0x00, 0x17, 0x00, 0x00,
327 0x00, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E, 0x01, 0x10, 0x36, 0x13, 0x15, 0x33, 0x15,
328 0x33, 0x35, 0x33, 0x35, 0x23, 0x35, 0x23, 0x15, 0x01, 0x7A, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2,
329 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x7C, 0xC4, 0x50, 0xC4, 0xC5, 0x4E, 0x03, 0x70, 0x84, 0xE2, 0xFE,
330 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFE, 0xC0, 0x4F, 0xC5, 0xC5, 0x4E, 0xC5, 0xC4,
331 0x00, 0x02, 0x00, 0x14, 0xFF, 0x98, 0x03, 0xEC, 0x03, 0x70, 0x00, 0x0B, 0x00, 0x0F, 0x00, 0x00,
332 0x00, 0x20, 0x1E, 0x01, 0x10, 0x0E, 0x01, 0x20, 0x2E, 0x01, 0x10, 0x36, 0x13, 0x21, 0x35, 0x21,
333 0x01, 0x7A, 0x01, 0x0C, 0xE2, 0x84, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0x7C, 0x01, 0xD8,
334 0xFE, 0x28, 0x03, 0x70, 0x84, 0xE2, 0xFE, 0xF4, 0xE2, 0x84, 0x84, 0xE2, 0x01, 0x0C, 0xE2, 0xFE,
335 0x71, 0x4E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0xAE, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
336 0x00, 0x00, 0x00, 0x15, 0x00, 0x2C, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x10,
337 0x00, 0x64, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x07, 0x00, 0x85, 0x00, 0x01,
338 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x10, 0x00, 0xAF, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00,
339 0x00, 0x04, 0x00, 0x10, 0x00, 0xE2, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x0D,
340 0x01, 0x0F, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x01, 0x3F, 0x00, 0x03,
341 0x00, 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x2A, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09,
342 0x00, 0x01, 0x00, 0x20, 0x00, 0x42, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x02, 0x00, 0x0E,
343 0x00, 0x75, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x03, 0x00, 0x20, 0x00, 0x8D, 0x00, 0x03,
344 0x00, 0x01, 0x04, 0x09, 0x00, 0x04, 0x00, 0x20, 0x00, 0xC0, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09,
345 0x00, 0x05, 0x00, 0x1A, 0x00, 0xF3, 0x00, 0x03, 0x00, 0x01, 0x04, 0x09, 0x00, 0x06, 0x00, 0x20,
346 0x01, 0x1D, 0x00, 0x59, 0x00, 0x75, 0x00, 0x7A, 0x00, 0x75, 0x00, 0x20, 0x00, 0x45, 0x00, 0x6D,
347 0x00, 0x75, 0x00, 0x6C, 0x00, 0x61, 0x00, 0x74, 0x00, 0x6F, 0x00, 0x72, 0x00, 0x20, 0x00, 0x50,
348 0x00, 0x72, 0x00, 0x6F, 0x00, 0x6A, 0x00, 0x65, 0x00, 0x63, 0x00, 0x74, 0x00, 0x00, 0x59, 0x75,
349 0x7A, 0x75, 0x20, 0x45, 0x6D, 0x75, 0x6C, 0x61, 0x74, 0x6F, 0x72, 0x20, 0x50, 0x72, 0x6F, 0x6A,
350 0x65, 0x63, 0x74, 0x00, 0x00, 0x59, 0x00, 0x75, 0x00, 0x7A, 0x00, 0x75, 0x00, 0x4F, 0x00, 0x53,
351 0x00, 0x53, 0x00, 0x45, 0x00, 0x78, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x73, 0x00, 0x69,
352 0x00, 0x6F, 0x00, 0x6E, 0x00, 0x00, 0x59, 0x75, 0x7A, 0x75, 0x4F, 0x53, 0x53, 0x45, 0x78, 0x74,
353 0x65, 0x6E, 0x73, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x52, 0x00, 0x65, 0x00, 0x67, 0x00, 0x75, 0x00,
354 0x6C, 0x00, 0x61, 0x00, 0x72, 0x00, 0x00, 0x52, 0x65, 0x67, 0x75, 0x6C, 0x61, 0x72, 0x00, 0x00,
355 0x59, 0x00, 0x75, 0x00, 0x7A, 0x00, 0x75, 0x00, 0x4F, 0x00, 0x53, 0x00, 0x53, 0x00, 0x45, 0x00,
356 0x78, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00,
357 0x00, 0x59, 0x75, 0x7A, 0x75, 0x4F, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6E, 0x73, 0x69, 0x6F,
358 0x6E, 0x00, 0x00, 0x59, 0x00, 0x75, 0x00, 0x7A, 0x00, 0x75, 0x00, 0x4F, 0x00, 0x53, 0x00, 0x53,
359 0x00, 0x45, 0x00, 0x78, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6F,
360 0x00, 0x6E, 0x00, 0x00, 0x59, 0x75, 0x7A, 0x75, 0x4F, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6E,
361 0x73, 0x69, 0x6F, 0x6E, 0x00, 0x00, 0x56, 0x00, 0x65, 0x00, 0x72, 0x00, 0x73, 0x00, 0x69, 0x00,
362 0x6F, 0x00, 0x6E, 0x00, 0x20, 0x00, 0x31, 0x00, 0x2E, 0x00, 0x30, 0x00, 0x30, 0x00, 0x30, 0x00,
363 0x00, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6F, 0x6E, 0x20, 0x31, 0x2E, 0x30, 0x30, 0x30, 0x00, 0x00,
364 0x59, 0x00, 0x75, 0x00, 0x7A, 0x00, 0x75, 0x00, 0x4F, 0x00, 0x53, 0x00, 0x53, 0x00, 0x45, 0x00,
365 0x78, 0x00, 0x74, 0x00, 0x65, 0x00, 0x6E, 0x00, 0x73, 0x00, 0x69, 0x00, 0x6F, 0x00, 0x6E, 0x00,
366 0x00, 0x59, 0x75, 0x7A, 0x75, 0x4F, 0x53, 0x53, 0x45, 0x78, 0x74, 0x65, 0x6E, 0x73, 0x69, 0x6F,
367 0x6E, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xB5, 0x00, 0x32,
368 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
369 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x01, 0x02, 0x01, 0x03, 0x00, 0x03, 0x01, 0x04,
370 0x01, 0x05, 0x01, 0x06, 0x01, 0x07, 0x01, 0x08, 0x01, 0x09, 0x01, 0x0A, 0x01, 0x0B, 0x01, 0x0C,
371 0x01, 0x0D, 0x01, 0x0E, 0x01, 0x0F, 0x01, 0x10, 0x01, 0x11, 0x01, 0x12, 0x01, 0x13, 0x01, 0x14,
372 0x01, 0x15, 0x01, 0x16, 0x01, 0x17, 0x01, 0x18, 0x01, 0x19, 0x01, 0x1A, 0x01, 0x1B, 0x07, 0x75,
373 0x6E, 0x69, 0x30, 0x30, 0x30, 0x30, 0x07, 0x75, 0x6E, 0x69, 0x30, 0x30, 0x30, 0x44, 0x07, 0x75,
374 0x6E, 0x69, 0x45, 0x30, 0x41, 0x30, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x41, 0x31, 0x07, 0x75,
375 0x6E, 0x69, 0x45, 0x30, 0x41, 0x32, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x41, 0x33, 0x07, 0x75,
376 0x6E, 0x69, 0x45, 0x30, 0x41, 0x34, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x41, 0x35, 0x07, 0x75,
377 0x6E, 0x69, 0x45, 0x30, 0x41, 0x36, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x41, 0x37, 0x07, 0x75,
378 0x6E, 0x69, 0x45, 0x30, 0x41, 0x38, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x41, 0x39, 0x07, 0x75,
379 0x6E, 0x69, 0x45, 0x30, 0x42, 0x33, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x42, 0x34, 0x07, 0x75,
380 0x6E, 0x69, 0x45, 0x30, 0x45, 0x30, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x45, 0x31, 0x07, 0x75,
381 0x6E, 0x69, 0x45, 0x30, 0x45, 0x32, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x45, 0x33, 0x07, 0x75,
382 0x6E, 0x69, 0x45, 0x30, 0x45, 0x34, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x45, 0x35, 0x07, 0x75,
383 0x6E, 0x69, 0x45, 0x30, 0x45, 0x36, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x45, 0x37, 0x07, 0x75,
384 0x6E, 0x69, 0x45, 0x30, 0x45, 0x38, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x45, 0x39, 0x07, 0x75,
385 0x6E, 0x69, 0x45, 0x30, 0x45, 0x46, 0x07, 0x75, 0x6E, 0x69, 0x45, 0x30, 0x46, 0x30, 0x00, 0x00,
386 0x00, 0x01, 0x00, 0x01, 0xFF, 0xFF, 0x00, 0x0F,
194}}; 387}};
195 388
196} // namespace FileSys::SystemArchive::SharedFontData 389} // namespace FileSys::SystemArchive::SharedFontData
diff --git a/src/core/file_sys/system_archive/data/font_nintendo_extended.h b/src/core/file_sys/system_archive/data/font_nintendo_extended.h
index 2089f3db9..edb9df914 100644
--- a/src/core/file_sys/system_archive/data/font_nintendo_extended.h
+++ b/src/core/file_sys/system_archive/data/font_nintendo_extended.h
@@ -8,6 +8,6 @@
8 8
9namespace FileSys::SystemArchive::SharedFontData { 9namespace FileSys::SystemArchive::SharedFontData {
10 10
11extern const std::array<unsigned char, 2932> FONT_NINTENDO_EXTENDED; 11extern const std::array<unsigned char, 6024> FONT_NINTENDO_EXTENDED;
12 12
13} // namespace FileSys::SystemArchive::SharedFontData 13} // namespace FileSys::SystemArchive::SharedFontData
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp
index b2f026b6d..f497e9396 100644
--- a/src/core/file_sys/vfs.cpp
+++ b/src/core/file_sys/vfs.cpp
@@ -203,7 +203,7 @@ std::string VfsFile::GetFullPath() const {
203 return GetContainingDirectory()->GetFullPath() + "/" + GetName(); 203 return GetContainingDirectory()->GetFullPath() + "/" + GetName();
204} 204}
205 205
206std::shared_ptr<VfsFile> VfsDirectory::GetFileRelative(std::string_view path) const { 206VirtualFile VfsDirectory::GetFileRelative(std::string_view path) const {
207 auto vec = Common::FS::SplitPathComponents(path); 207 auto vec = Common::FS::SplitPathComponents(path);
208 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), 208 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }),
209 vec.end()); 209 vec.end());
@@ -231,7 +231,7 @@ std::shared_ptr<VfsFile> VfsDirectory::GetFileRelative(std::string_view path) co
231 return dir->GetFile(vec.back()); 231 return dir->GetFile(vec.back());
232} 232}
233 233
234std::shared_ptr<VfsFile> VfsDirectory::GetFileAbsolute(std::string_view path) const { 234VirtualFile VfsDirectory::GetFileAbsolute(std::string_view path) const {
235 if (IsRoot()) { 235 if (IsRoot()) {
236 return GetFileRelative(path); 236 return GetFileRelative(path);
237 } 237 }
@@ -239,7 +239,7 @@ std::shared_ptr<VfsFile> VfsDirectory::GetFileAbsolute(std::string_view path) co
239 return GetParentDirectory()->GetFileAbsolute(path); 239 return GetParentDirectory()->GetFileAbsolute(path);
240} 240}
241 241
242std::shared_ptr<VfsDirectory> VfsDirectory::GetDirectoryRelative(std::string_view path) const { 242VirtualDir VfsDirectory::GetDirectoryRelative(std::string_view path) const {
243 auto vec = Common::FS::SplitPathComponents(path); 243 auto vec = Common::FS::SplitPathComponents(path);
244 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), 244 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }),
245 vec.end()); 245 vec.end());
@@ -261,7 +261,7 @@ std::shared_ptr<VfsDirectory> VfsDirectory::GetDirectoryRelative(std::string_vie
261 return dir; 261 return dir;
262} 262}
263 263
264std::shared_ptr<VfsDirectory> VfsDirectory::GetDirectoryAbsolute(std::string_view path) const { 264VirtualDir VfsDirectory::GetDirectoryAbsolute(std::string_view path) const {
265 if (IsRoot()) { 265 if (IsRoot()) {
266 return GetDirectoryRelative(path); 266 return GetDirectoryRelative(path);
267 } 267 }
@@ -269,14 +269,14 @@ std::shared_ptr<VfsDirectory> VfsDirectory::GetDirectoryAbsolute(std::string_vie
269 return GetParentDirectory()->GetDirectoryAbsolute(path); 269 return GetParentDirectory()->GetDirectoryAbsolute(path);
270} 270}
271 271
272std::shared_ptr<VfsFile> VfsDirectory::GetFile(std::string_view name) const { 272VirtualFile VfsDirectory::GetFile(std::string_view name) const {
273 const auto& files = GetFiles(); 273 const auto& files = GetFiles();
274 const auto iter = std::find_if(files.begin(), files.end(), 274 const auto iter = std::find_if(files.begin(), files.end(),
275 [&name](const auto& file1) { return name == file1->GetName(); }); 275 [&name](const auto& file1) { return name == file1->GetName(); });
276 return iter == files.end() ? nullptr : *iter; 276 return iter == files.end() ? nullptr : *iter;
277} 277}
278 278
279std::shared_ptr<VfsDirectory> VfsDirectory::GetSubdirectory(std::string_view name) const { 279VirtualDir VfsDirectory::GetSubdirectory(std::string_view name) const {
280 const auto& subs = GetSubdirectories(); 280 const auto& subs = GetSubdirectories();
281 const auto iter = std::find_if(subs.begin(), subs.end(), 281 const auto iter = std::find_if(subs.begin(), subs.end(),
282 [&name](const auto& file1) { return name == file1->GetName(); }); 282 [&name](const auto& file1) { return name == file1->GetName(); });
@@ -301,7 +301,7 @@ std::size_t VfsDirectory::GetSize() const {
301 return file_total + subdir_total; 301 return file_total + subdir_total;
302} 302}
303 303
304std::shared_ptr<VfsFile> VfsDirectory::CreateFileRelative(std::string_view path) { 304VirtualFile VfsDirectory::CreateFileRelative(std::string_view path) {
305 auto vec = Common::FS::SplitPathComponents(path); 305 auto vec = Common::FS::SplitPathComponents(path);
306 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), 306 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }),
307 vec.end()); 307 vec.end());
@@ -324,7 +324,7 @@ std::shared_ptr<VfsFile> VfsDirectory::CreateFileRelative(std::string_view path)
324 return dir->CreateFileRelative(Common::FS::GetPathWithoutTop(path)); 324 return dir->CreateFileRelative(Common::FS::GetPathWithoutTop(path));
325} 325}
326 326
327std::shared_ptr<VfsFile> VfsDirectory::CreateFileAbsolute(std::string_view path) { 327VirtualFile VfsDirectory::CreateFileAbsolute(std::string_view path) {
328 if (IsRoot()) { 328 if (IsRoot()) {
329 return CreateFileRelative(path); 329 return CreateFileRelative(path);
330 } 330 }
@@ -332,7 +332,7 @@ std::shared_ptr<VfsFile> VfsDirectory::CreateFileAbsolute(std::string_view path)
332 return GetParentDirectory()->CreateFileAbsolute(path); 332 return GetParentDirectory()->CreateFileAbsolute(path);
333} 333}
334 334
335std::shared_ptr<VfsDirectory> VfsDirectory::CreateDirectoryRelative(std::string_view path) { 335VirtualDir VfsDirectory::CreateDirectoryRelative(std::string_view path) {
336 auto vec = Common::FS::SplitPathComponents(path); 336 auto vec = Common::FS::SplitPathComponents(path);
337 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }), 337 vec.erase(std::remove_if(vec.begin(), vec.end(), [](const auto& str) { return str.empty(); }),
338 vec.end()); 338 vec.end());
@@ -355,7 +355,7 @@ std::shared_ptr<VfsDirectory> VfsDirectory::CreateDirectoryRelative(std::string_
355 return dir->CreateDirectoryRelative(Common::FS::GetPathWithoutTop(path)); 355 return dir->CreateDirectoryRelative(Common::FS::GetPathWithoutTop(path));
356} 356}
357 357
358std::shared_ptr<VfsDirectory> VfsDirectory::CreateDirectoryAbsolute(std::string_view path) { 358VirtualDir VfsDirectory::CreateDirectoryAbsolute(std::string_view path) {
359 if (IsRoot()) { 359 if (IsRoot()) {
360 return CreateDirectoryRelative(path); 360 return CreateDirectoryRelative(path);
361 } 361 }
@@ -446,27 +446,27 @@ bool ReadOnlyVfsDirectory::IsReadable() const {
446 return true; 446 return true;
447} 447}
448 448
449std::shared_ptr<VfsDirectory> ReadOnlyVfsDirectory::CreateSubdirectory(std::string_view name) { 449VirtualDir ReadOnlyVfsDirectory::CreateSubdirectory(std::string_view name) {
450 return nullptr; 450 return nullptr;
451} 451}
452 452
453std::shared_ptr<VfsFile> ReadOnlyVfsDirectory::CreateFile(std::string_view name) { 453VirtualFile ReadOnlyVfsDirectory::CreateFile(std::string_view name) {
454 return nullptr; 454 return nullptr;
455} 455}
456 456
457std::shared_ptr<VfsFile> ReadOnlyVfsDirectory::CreateFileAbsolute(std::string_view path) { 457VirtualFile ReadOnlyVfsDirectory::CreateFileAbsolute(std::string_view path) {
458 return nullptr; 458 return nullptr;
459} 459}
460 460
461std::shared_ptr<VfsFile> ReadOnlyVfsDirectory::CreateFileRelative(std::string_view path) { 461VirtualFile ReadOnlyVfsDirectory::CreateFileRelative(std::string_view path) {
462 return nullptr; 462 return nullptr;
463} 463}
464 464
465std::shared_ptr<VfsDirectory> ReadOnlyVfsDirectory::CreateDirectoryAbsolute(std::string_view path) { 465VirtualDir ReadOnlyVfsDirectory::CreateDirectoryAbsolute(std::string_view path) {
466 return nullptr; 466 return nullptr;
467} 467}
468 468
469std::shared_ptr<VfsDirectory> ReadOnlyVfsDirectory::CreateDirectoryRelative(std::string_view path) { 469VirtualDir ReadOnlyVfsDirectory::CreateDirectoryRelative(std::string_view path) {
470 return nullptr; 470 return nullptr;
471} 471}
472 472
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h
index 954094772..afd64e95c 100644
--- a/src/core/file_sys/vfs.h
+++ b/src/core/file_sys/vfs.h
@@ -91,7 +91,7 @@ public:
91 // Resizes the file to new_size. Returns whether or not the operation was successful. 91 // Resizes the file to new_size. Returns whether or not the operation was successful.
92 virtual bool Resize(std::size_t new_size) = 0; 92 virtual bool Resize(std::size_t new_size) = 0;
93 // Gets a pointer to the directory containing this file, returning nullptr if there is none. 93 // Gets a pointer to the directory containing this file, returning nullptr if there is none.
94 virtual std::shared_ptr<VfsDirectory> GetContainingDirectory() const = 0; 94 virtual VirtualDir GetContainingDirectory() const = 0;
95 95
96 // Returns whether or not the file can be written to. 96 // Returns whether or not the file can be written to.
97 virtual bool IsWritable() const = 0; 97 virtual bool IsWritable() const = 0;
@@ -183,27 +183,27 @@ public:
183 183
184 // Retrives the file located at path as if the current directory was root. Returns nullptr if 184 // Retrives the file located at path as if the current directory was root. Returns nullptr if
185 // not found. 185 // not found.
186 virtual std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const; 186 virtual VirtualFile GetFileRelative(std::string_view path) const;
187 // Calls GetFileRelative(path) on the root of the current directory. 187 // Calls GetFileRelative(path) on the root of the current directory.
188 virtual std::shared_ptr<VfsFile> GetFileAbsolute(std::string_view path) const; 188 virtual VirtualFile GetFileAbsolute(std::string_view path) const;
189 189
190 // Retrives the directory located at path as if the current directory was root. Returns nullptr 190 // Retrives the directory located at path as if the current directory was root. Returns nullptr
191 // if not found. 191 // if not found.
192 virtual std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const; 192 virtual VirtualDir GetDirectoryRelative(std::string_view path) const;
193 // Calls GetDirectoryRelative(path) on the root of the current directory. 193 // Calls GetDirectoryRelative(path) on the root of the current directory.
194 virtual std::shared_ptr<VfsDirectory> GetDirectoryAbsolute(std::string_view path) const; 194 virtual VirtualDir GetDirectoryAbsolute(std::string_view path) const;
195 195
196 // Returns a vector containing all of the files in this directory. 196 // Returns a vector containing all of the files in this directory.
197 virtual std::vector<std::shared_ptr<VfsFile>> GetFiles() const = 0; 197 virtual std::vector<VirtualFile> GetFiles() const = 0;
198 // Returns the file with filename matching name. Returns nullptr if directory dosen't have a 198 // Returns the file with filename matching name. Returns nullptr if directory dosen't have a
199 // file with name. 199 // file with name.
200 virtual std::shared_ptr<VfsFile> GetFile(std::string_view name) const; 200 virtual VirtualFile GetFile(std::string_view name) const;
201 201
202 // Returns a vector containing all of the subdirectories in this directory. 202 // Returns a vector containing all of the subdirectories in this directory.
203 virtual std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const = 0; 203 virtual std::vector<VirtualDir> GetSubdirectories() const = 0;
204 // Returns the directory with name matching name. Returns nullptr if directory dosen't have a 204 // Returns the directory with name matching name. Returns nullptr if directory dosen't have a
205 // directory with name. 205 // directory with name.
206 virtual std::shared_ptr<VfsDirectory> GetSubdirectory(std::string_view name) const; 206 virtual VirtualDir GetSubdirectory(std::string_view name) const;
207 207
208 // Returns whether or not the directory can be written to. 208 // Returns whether or not the directory can be written to.
209 virtual bool IsWritable() const = 0; 209 virtual bool IsWritable() const = 0;
@@ -219,31 +219,31 @@ public:
219 virtual std::size_t GetSize() const; 219 virtual std::size_t GetSize() const;
220 // Returns the parent directory of this directory. Returns nullptr if this directory is root or 220 // Returns the parent directory of this directory. Returns nullptr if this directory is root or
221 // has no parent. 221 // has no parent.
222 virtual std::shared_ptr<VfsDirectory> GetParentDirectory() const = 0; 222 virtual VirtualDir GetParentDirectory() const = 0;
223 223
224 // Creates a new subdirectory with name name. Returns a pointer to the new directory or nullptr 224 // Creates a new subdirectory with name name. Returns a pointer to the new directory or nullptr
225 // if the operation failed. 225 // if the operation failed.
226 virtual std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) = 0; 226 virtual VirtualDir CreateSubdirectory(std::string_view name) = 0;
227 // Creates a new file with name name. Returns a pointer to the new file or nullptr if the 227 // Creates a new file with name name. Returns a pointer to the new file or nullptr if the
228 // operation failed. 228 // operation failed.
229 virtual std::shared_ptr<VfsFile> CreateFile(std::string_view name) = 0; 229 virtual VirtualFile CreateFile(std::string_view name) = 0;
230 230
231 // Creates a new file at the path relative to this directory. Also creates directories if 231 // Creates a new file at the path relative to this directory. Also creates directories if
232 // they do not exist and is supported by this implementation. Returns nullptr on any failure. 232 // they do not exist and is supported by this implementation. Returns nullptr on any failure.
233 virtual std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path); 233 virtual VirtualFile CreateFileRelative(std::string_view path);
234 234
235 // Creates a new file at the path relative to root of this directory. Also creates directories 235 // Creates a new file at the path relative to root of this directory. Also creates directories
236 // if they do not exist and is supported by this implementation. Returns nullptr on any failure. 236 // if they do not exist and is supported by this implementation. Returns nullptr on any failure.
237 virtual std::shared_ptr<VfsFile> CreateFileAbsolute(std::string_view path); 237 virtual VirtualFile CreateFileAbsolute(std::string_view path);
238 238
239 // Creates a new directory at the path relative to this directory. Also creates directories if 239 // Creates a new directory at the path relative to this directory. Also creates directories if
240 // they do not exist and is supported by this implementation. Returns nullptr on any failure. 240 // they do not exist and is supported by this implementation. Returns nullptr on any failure.
241 virtual std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path); 241 virtual VirtualDir CreateDirectoryRelative(std::string_view path);
242 242
243 // Creates a new directory at the path relative to root of this directory. Also creates 243 // Creates a new directory at the path relative to root of this directory. Also creates
244 // directories if they do not exist and is supported by this implementation. Returns nullptr on 244 // directories if they do not exist and is supported by this implementation. Returns nullptr on
245 // any failure. 245 // any failure.
246 virtual std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path); 246 virtual VirtualDir CreateDirectoryAbsolute(std::string_view path);
247 247
248 // Deletes the subdirectory with the given name and returns true on success. 248 // Deletes the subdirectory with the given name and returns true on success.
249 virtual bool DeleteSubdirectory(std::string_view name) = 0; 249 virtual bool DeleteSubdirectory(std::string_view name) = 0;
@@ -280,12 +280,12 @@ class ReadOnlyVfsDirectory : public VfsDirectory {
280public: 280public:
281 bool IsWritable() const override; 281 bool IsWritable() const override;
282 bool IsReadable() const override; 282 bool IsReadable() const override;
283 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; 283 VirtualDir CreateSubdirectory(std::string_view name) override;
284 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; 284 VirtualFile CreateFile(std::string_view name) override;
285 std::shared_ptr<VfsFile> CreateFileAbsolute(std::string_view path) override; 285 VirtualFile CreateFileAbsolute(std::string_view path) override;
286 std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path) override; 286 VirtualFile CreateFileRelative(std::string_view path) override;
287 std::shared_ptr<VfsDirectory> CreateDirectoryAbsolute(std::string_view path) override; 287 VirtualDir CreateDirectoryAbsolute(std::string_view path) override;
288 std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path) override; 288 VirtualDir CreateDirectoryRelative(std::string_view path) override;
289 bool DeleteSubdirectory(std::string_view name) override; 289 bool DeleteSubdirectory(std::string_view name) override;
290 bool DeleteSubdirectoryRecursive(std::string_view name) override; 290 bool DeleteSubdirectoryRecursive(std::string_view name) override;
291 bool CleanSubdirectoryRecursive(std::string_view name) override; 291 bool CleanSubdirectoryRecursive(std::string_view name) override;
diff --git a/src/core/file_sys/vfs_concat.cpp b/src/core/file_sys/vfs_concat.cpp
index e0ff70174..3c5a7d87a 100644
--- a/src/core/file_sys/vfs_concat.cpp
+++ b/src/core/file_sys/vfs_concat.cpp
@@ -46,7 +46,7 @@ VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(std::vector<VirtualFile> f
46 if (files.size() == 1) 46 if (files.size() == 1)
47 return files[0]; 47 return files[0];
48 48
49 return std::shared_ptr<VfsFile>(new ConcatenatedVfsFile(std::move(files), std::move(name))); 49 return VirtualFile(new ConcatenatedVfsFile(std::move(files), std::move(name)));
50} 50}
51 51
52VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(u8 filler_byte, 52VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(u8 filler_byte,
@@ -71,20 +71,23 @@ VirtualFile ConcatenatedVfsFile::MakeConcatenatedFile(u8 filler_byte,
71 if (files.begin()->first != 0) 71 if (files.begin()->first != 0)
72 files.emplace(0, std::make_shared<StaticVfsFile>(filler_byte, files.begin()->first)); 72 files.emplace(0, std::make_shared<StaticVfsFile>(filler_byte, files.begin()->first));
73 73
74 return std::shared_ptr<VfsFile>(new ConcatenatedVfsFile(std::move(files), std::move(name))); 74 return VirtualFile(new ConcatenatedVfsFile(std::move(files), std::move(name)));
75} 75}
76 76
77std::string ConcatenatedVfsFile::GetName() const { 77std::string ConcatenatedVfsFile::GetName() const {
78 if (files.empty()) 78 if (files.empty()) {
79 return ""; 79 return "";
80 if (!name.empty()) 80 }
81 if (!name.empty()) {
81 return name; 82 return name;
83 }
82 return files.begin()->second->GetName(); 84 return files.begin()->second->GetName();
83} 85}
84 86
85std::size_t ConcatenatedVfsFile::GetSize() const { 87std::size_t ConcatenatedVfsFile::GetSize() const {
86 if (files.empty()) 88 if (files.empty()) {
87 return 0; 89 return 0;
90 }
88 return files.rbegin()->first + files.rbegin()->second->GetSize(); 91 return files.rbegin()->first + files.rbegin()->second->GetSize();
89} 92}
90 93
@@ -92,9 +95,10 @@ bool ConcatenatedVfsFile::Resize(std::size_t new_size) {
92 return false; 95 return false;
93} 96}
94 97
95std::shared_ptr<VfsDirectory> ConcatenatedVfsFile::GetContainingDirectory() const { 98VirtualDir ConcatenatedVfsFile::GetContainingDirectory() const {
96 if (files.empty()) 99 if (files.empty()) {
97 return nullptr; 100 return nullptr;
101 }
98 return files.begin()->second->GetContainingDirectory(); 102 return files.begin()->second->GetContainingDirectory();
99} 103}
100 104
diff --git a/src/core/file_sys/vfs_concat.h b/src/core/file_sys/vfs_concat.h
index 7a26343c0..287c72555 100644
--- a/src/core/file_sys/vfs_concat.h
+++ b/src/core/file_sys/vfs_concat.h
@@ -31,7 +31,7 @@ public:
31 std::string GetName() const override; 31 std::string GetName() const override;
32 std::size_t GetSize() const override; 32 std::size_t GetSize() const override;
33 bool Resize(std::size_t new_size) override; 33 bool Resize(std::size_t new_size) override;
34 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; 34 VirtualDir GetContainingDirectory() const override;
35 bool IsWritable() const override; 35 bool IsWritable() const override;
36 bool IsReadable() const override; 36 bool IsReadable() const override;
37 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override; 37 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override;
diff --git a/src/core/file_sys/vfs_layered.cpp b/src/core/file_sys/vfs_layered.cpp
index 338e398da..434b03cec 100644
--- a/src/core/file_sys/vfs_layered.cpp
+++ b/src/core/file_sys/vfs_layered.cpp
@@ -20,10 +20,10 @@ VirtualDir LayeredVfsDirectory::MakeLayeredDirectory(std::vector<VirtualDir> dir
20 if (dirs.size() == 1) 20 if (dirs.size() == 1)
21 return dirs[0]; 21 return dirs[0];
22 22
23 return std::shared_ptr<VfsDirectory>(new LayeredVfsDirectory(std::move(dirs), std::move(name))); 23 return VirtualDir(new LayeredVfsDirectory(std::move(dirs), std::move(name)));
24} 24}
25 25
26std::shared_ptr<VfsFile> LayeredVfsDirectory::GetFileRelative(std::string_view path) const { 26VirtualFile LayeredVfsDirectory::GetFileRelative(std::string_view path) const {
27 for (const auto& layer : dirs) { 27 for (const auto& layer : dirs) {
28 const auto file = layer->GetFileRelative(path); 28 const auto file = layer->GetFileRelative(path);
29 if (file != nullptr) 29 if (file != nullptr)
@@ -33,23 +33,23 @@ std::shared_ptr<VfsFile> LayeredVfsDirectory::GetFileRelative(std::string_view p
33 return nullptr; 33 return nullptr;
34} 34}
35 35
36std::shared_ptr<VfsDirectory> LayeredVfsDirectory::GetDirectoryRelative( 36VirtualDir LayeredVfsDirectory::GetDirectoryRelative(std::string_view path) const {
37 std::string_view path) const {
38 std::vector<VirtualDir> out; 37 std::vector<VirtualDir> out;
39 for (const auto& layer : dirs) { 38 for (const auto& layer : dirs) {
40 auto dir = layer->GetDirectoryRelative(path); 39 auto dir = layer->GetDirectoryRelative(path);
41 if (dir != nullptr) 40 if (dir != nullptr) {
42 out.push_back(std::move(dir)); 41 out.push_back(std::move(dir));
42 }
43 } 43 }
44 44
45 return MakeLayeredDirectory(std::move(out)); 45 return MakeLayeredDirectory(std::move(out));
46} 46}
47 47
48std::shared_ptr<VfsFile> LayeredVfsDirectory::GetFile(std::string_view name) const { 48VirtualFile LayeredVfsDirectory::GetFile(std::string_view name) const {
49 return GetFileRelative(name); 49 return GetFileRelative(name);
50} 50}
51 51
52std::shared_ptr<VfsDirectory> LayeredVfsDirectory::GetSubdirectory(std::string_view name) const { 52VirtualDir LayeredVfsDirectory::GetSubdirectory(std::string_view name) const {
53 return GetDirectoryRelative(name); 53 return GetDirectoryRelative(name);
54} 54}
55 55
@@ -57,7 +57,7 @@ std::string LayeredVfsDirectory::GetFullPath() const {
57 return dirs[0]->GetFullPath(); 57 return dirs[0]->GetFullPath();
58} 58}
59 59
60std::vector<std::shared_ptr<VfsFile>> LayeredVfsDirectory::GetFiles() const { 60std::vector<VirtualFile> LayeredVfsDirectory::GetFiles() const {
61 std::vector<VirtualFile> out; 61 std::vector<VirtualFile> out;
62 for (const auto& layer : dirs) { 62 for (const auto& layer : dirs) {
63 for (const auto& file : layer->GetFiles()) { 63 for (const auto& file : layer->GetFiles()) {
@@ -72,7 +72,7 @@ std::vector<std::shared_ptr<VfsFile>> LayeredVfsDirectory::GetFiles() const {
72 return out; 72 return out;
73} 73}
74 74
75std::vector<std::shared_ptr<VfsDirectory>> LayeredVfsDirectory::GetSubdirectories() const { 75std::vector<VirtualDir> LayeredVfsDirectory::GetSubdirectories() const {
76 std::vector<std::string> names; 76 std::vector<std::string> names;
77 for (const auto& layer : dirs) { 77 for (const auto& layer : dirs) {
78 for (const auto& sd : layer->GetSubdirectories()) { 78 for (const auto& sd : layer->GetSubdirectories()) {
@@ -101,15 +101,15 @@ std::string LayeredVfsDirectory::GetName() const {
101 return name.empty() ? dirs[0]->GetName() : name; 101 return name.empty() ? dirs[0]->GetName() : name;
102} 102}
103 103
104std::shared_ptr<VfsDirectory> LayeredVfsDirectory::GetParentDirectory() const { 104VirtualDir LayeredVfsDirectory::GetParentDirectory() const {
105 return dirs[0]->GetParentDirectory(); 105 return dirs[0]->GetParentDirectory();
106} 106}
107 107
108std::shared_ptr<VfsDirectory> LayeredVfsDirectory::CreateSubdirectory(std::string_view name) { 108VirtualDir LayeredVfsDirectory::CreateSubdirectory(std::string_view name) {
109 return nullptr; 109 return nullptr;
110} 110}
111 111
112std::shared_ptr<VfsFile> LayeredVfsDirectory::CreateFile(std::string_view name) { 112VirtualFile LayeredVfsDirectory::CreateFile(std::string_view name) {
113 return nullptr; 113 return nullptr;
114} 114}
115 115
diff --git a/src/core/file_sys/vfs_layered.h b/src/core/file_sys/vfs_layered.h
index 8a25c3428..6d7513ac6 100644
--- a/src/core/file_sys/vfs_layered.h
+++ b/src/core/file_sys/vfs_layered.h
@@ -21,20 +21,20 @@ public:
21 /// Wrapper function to allow for more efficient handling of dirs.size() == 0, 1 cases. 21 /// Wrapper function to allow for more efficient handling of dirs.size() == 0, 1 cases.
22 static VirtualDir MakeLayeredDirectory(std::vector<VirtualDir> dirs, std::string name = ""); 22 static VirtualDir MakeLayeredDirectory(std::vector<VirtualDir> dirs, std::string name = "");
23 23
24 std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const override; 24 VirtualFile GetFileRelative(std::string_view path) const override;
25 std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const override; 25 VirtualDir GetDirectoryRelative(std::string_view path) const override;
26 std::shared_ptr<VfsFile> GetFile(std::string_view name) const override; 26 VirtualFile GetFile(std::string_view name) const override;
27 std::shared_ptr<VfsDirectory> GetSubdirectory(std::string_view name) const override; 27 VirtualDir GetSubdirectory(std::string_view name) const override;
28 std::string GetFullPath() const override; 28 std::string GetFullPath() const override;
29 29
30 std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; 30 std::vector<VirtualFile> GetFiles() const override;
31 std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; 31 std::vector<VirtualDir> GetSubdirectories() const override;
32 bool IsWritable() const override; 32 bool IsWritable() const override;
33 bool IsReadable() const override; 33 bool IsReadable() const override;
34 std::string GetName() const override; 34 std::string GetName() const override;
35 std::shared_ptr<VfsDirectory> GetParentDirectory() const override; 35 VirtualDir GetParentDirectory() const override;
36 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; 36 VirtualDir CreateSubdirectory(std::string_view name) override;
37 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; 37 VirtualFile CreateFile(std::string_view name) override;
38 bool DeleteSubdirectory(std::string_view name) override; 38 bool DeleteSubdirectory(std::string_view name) override;
39 bool DeleteFile(std::string_view name) override; 39 bool DeleteFile(std::string_view name) override;
40 bool Rename(std::string_view name) override; 40 bool Rename(std::string_view name) override;
diff --git a/src/core/file_sys/vfs_offset.cpp b/src/core/file_sys/vfs_offset.cpp
index 7714d3de5..056737b54 100644
--- a/src/core/file_sys/vfs_offset.cpp
+++ b/src/core/file_sys/vfs_offset.cpp
@@ -9,7 +9,7 @@
9 9
10namespace FileSys { 10namespace FileSys {
11 11
12OffsetVfsFile::OffsetVfsFile(std::shared_ptr<VfsFile> file_, std::size_t size_, std::size_t offset_, 12OffsetVfsFile::OffsetVfsFile(VirtualFile file_, std::size_t size_, std::size_t offset_,
13 std::string name_, VirtualDir parent_) 13 std::string name_, VirtualDir parent_)
14 : file(file_), offset(offset_), size(size_), name(std::move(name_)), 14 : file(file_), offset(offset_), size(size_), name(std::move(name_)),
15 parent(parent_ == nullptr ? file->GetContainingDirectory() : std::move(parent_)) {} 15 parent(parent_ == nullptr ? file->GetContainingDirectory() : std::move(parent_)) {}
@@ -37,7 +37,7 @@ bool OffsetVfsFile::Resize(std::size_t new_size) {
37 return true; 37 return true;
38} 38}
39 39
40std::shared_ptr<VfsDirectory> OffsetVfsFile::GetContainingDirectory() const { 40VirtualDir OffsetVfsFile::GetContainingDirectory() const {
41 return parent; 41 return parent;
42} 42}
43 43
diff --git a/src/core/file_sys/vfs_offset.h b/src/core/file_sys/vfs_offset.h
index f7b7a3256..b2ccc5c7b 100644
--- a/src/core/file_sys/vfs_offset.h
+++ b/src/core/file_sys/vfs_offset.h
@@ -17,14 +17,14 @@ namespace FileSys {
17// the size of this wrapper. 17// the size of this wrapper.
18class OffsetVfsFile : public VfsFile { 18class OffsetVfsFile : public VfsFile {
19public: 19public:
20 OffsetVfsFile(std::shared_ptr<VfsFile> file, std::size_t size, std::size_t offset = 0, 20 OffsetVfsFile(VirtualFile file, std::size_t size, std::size_t offset = 0,
21 std::string new_name = "", VirtualDir new_parent = nullptr); 21 std::string new_name = "", VirtualDir new_parent = nullptr);
22 ~OffsetVfsFile() override; 22 ~OffsetVfsFile() override;
23 23
24 std::string GetName() const override; 24 std::string GetName() const override;
25 std::size_t GetSize() const override; 25 std::size_t GetSize() const override;
26 bool Resize(std::size_t new_size) override; 26 bool Resize(std::size_t new_size) override;
27 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; 27 VirtualDir GetContainingDirectory() const override;
28 bool IsWritable() const override; 28 bool IsWritable() const override;
29 bool IsReadable() const override; 29 bool IsReadable() const override;
30 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override; 30 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override;
@@ -42,7 +42,7 @@ public:
42private: 42private:
43 std::size_t TrimToFit(std::size_t r_size, std::size_t r_offset) const; 43 std::size_t TrimToFit(std::size_t r_size, std::size_t r_offset) const;
44 44
45 std::shared_ptr<VfsFile> file; 45 VirtualFile file;
46 std::size_t offset; 46 std::size_t offset;
47 std::size_t size; 47 std::size_t size;
48 std::string name; 48 std::string name;
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp
index 488687ba9..a287eebe3 100644
--- a/src/core/file_sys/vfs_real.cpp
+++ b/src/core/file_sys/vfs_real.cpp
@@ -263,7 +263,7 @@ bool RealVfsFile::Resize(std::size_t new_size) {
263 return backing->Resize(new_size); 263 return backing->Resize(new_size);
264} 264}
265 265
266std::shared_ptr<VfsDirectory> RealVfsFile::GetContainingDirectory() const { 266VirtualDir RealVfsFile::GetContainingDirectory() const {
267 return base.OpenDirectory(parent_path, perms); 267 return base.OpenDirectory(parent_path, perms);
268} 268}
269 269
@@ -352,7 +352,7 @@ RealVfsDirectory::RealVfsDirectory(RealVfsFilesystem& base_, const std::string&
352 352
353RealVfsDirectory::~RealVfsDirectory() = default; 353RealVfsDirectory::~RealVfsDirectory() = default;
354 354
355std::shared_ptr<VfsFile> RealVfsDirectory::GetFileRelative(std::string_view path) const { 355VirtualFile RealVfsDirectory::GetFileRelative(std::string_view path) const {
356 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path)); 356 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path));
357 if (!FS::Exists(full_path) || FS::IsDirectory(full_path)) { 357 if (!FS::Exists(full_path) || FS::IsDirectory(full_path)) {
358 return nullptr; 358 return nullptr;
@@ -360,7 +360,7 @@ std::shared_ptr<VfsFile> RealVfsDirectory::GetFileRelative(std::string_view path
360 return base.OpenFile(full_path, perms); 360 return base.OpenFile(full_path, perms);
361} 361}
362 362
363std::shared_ptr<VfsDirectory> RealVfsDirectory::GetDirectoryRelative(std::string_view path) const { 363VirtualDir RealVfsDirectory::GetDirectoryRelative(std::string_view path) const {
364 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path)); 364 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path));
365 if (!FS::Exists(full_path) || !FS::IsDirectory(full_path)) { 365 if (!FS::Exists(full_path) || !FS::IsDirectory(full_path)) {
366 return nullptr; 366 return nullptr;
@@ -368,20 +368,20 @@ std::shared_ptr<VfsDirectory> RealVfsDirectory::GetDirectoryRelative(std::string
368 return base.OpenDirectory(full_path, perms); 368 return base.OpenDirectory(full_path, perms);
369} 369}
370 370
371std::shared_ptr<VfsFile> RealVfsDirectory::GetFile(std::string_view name) const { 371VirtualFile RealVfsDirectory::GetFile(std::string_view name) const {
372 return GetFileRelative(name); 372 return GetFileRelative(name);
373} 373}
374 374
375std::shared_ptr<VfsDirectory> RealVfsDirectory::GetSubdirectory(std::string_view name) const { 375VirtualDir RealVfsDirectory::GetSubdirectory(std::string_view name) const {
376 return GetDirectoryRelative(name); 376 return GetDirectoryRelative(name);
377} 377}
378 378
379std::shared_ptr<VfsFile> RealVfsDirectory::CreateFileRelative(std::string_view path) { 379VirtualFile RealVfsDirectory::CreateFileRelative(std::string_view path) {
380 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path)); 380 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path));
381 return base.CreateFile(full_path, perms); 381 return base.CreateFile(full_path, perms);
382} 382}
383 383
384std::shared_ptr<VfsDirectory> RealVfsDirectory::CreateDirectoryRelative(std::string_view path) { 384VirtualDir RealVfsDirectory::CreateDirectoryRelative(std::string_view path) {
385 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path)); 385 const auto full_path = FS::SanitizePath(this->path + DIR_SEP + std::string(path));
386 return base.CreateDirectory(full_path, perms); 386 return base.CreateDirectory(full_path, perms);
387} 387}
@@ -391,11 +391,11 @@ bool RealVfsDirectory::DeleteSubdirectoryRecursive(std::string_view name) {
391 return base.DeleteDirectory(full_path); 391 return base.DeleteDirectory(full_path);
392} 392}
393 393
394std::vector<std::shared_ptr<VfsFile>> RealVfsDirectory::GetFiles() const { 394std::vector<VirtualFile> RealVfsDirectory::GetFiles() const {
395 return IterateEntries<RealVfsFile, VfsFile>(); 395 return IterateEntries<RealVfsFile, VfsFile>();
396} 396}
397 397
398std::vector<std::shared_ptr<VfsDirectory>> RealVfsDirectory::GetSubdirectories() const { 398std::vector<VirtualDir> RealVfsDirectory::GetSubdirectories() const {
399 return IterateEntries<RealVfsDirectory, VfsDirectory>(); 399 return IterateEntries<RealVfsDirectory, VfsDirectory>();
400} 400}
401 401
@@ -411,7 +411,7 @@ std::string RealVfsDirectory::GetName() const {
411 return path_components.back(); 411 return path_components.back();
412} 412}
413 413
414std::shared_ptr<VfsDirectory> RealVfsDirectory::GetParentDirectory() const { 414VirtualDir RealVfsDirectory::GetParentDirectory() const {
415 if (path_components.size() <= 1) { 415 if (path_components.size() <= 1) {
416 return nullptr; 416 return nullptr;
417 } 417 }
@@ -419,12 +419,12 @@ std::shared_ptr<VfsDirectory> RealVfsDirectory::GetParentDirectory() const {
419 return base.OpenDirectory(parent_path, perms); 419 return base.OpenDirectory(parent_path, perms);
420} 420}
421 421
422std::shared_ptr<VfsDirectory> RealVfsDirectory::CreateSubdirectory(std::string_view name) { 422VirtualDir RealVfsDirectory::CreateSubdirectory(std::string_view name) {
423 const std::string subdir_path = (path + DIR_SEP).append(name); 423 const std::string subdir_path = (path + DIR_SEP).append(name);
424 return base.CreateDirectory(subdir_path, perms); 424 return base.CreateDirectory(subdir_path, perms);
425} 425}
426 426
427std::shared_ptr<VfsFile> RealVfsDirectory::CreateFile(std::string_view name) { 427VirtualFile RealVfsDirectory::CreateFile(std::string_view name) {
428 const std::string file_path = (path + DIR_SEP).append(name); 428 const std::string file_path = (path + DIR_SEP).append(name);
429 return base.CreateFile(file_path, perms); 429 return base.CreateFile(file_path, perms);
430} 430}
diff --git a/src/core/file_sys/vfs_real.h b/src/core/file_sys/vfs_real.h
index 0b537b22c..23e99865e 100644
--- a/src/core/file_sys/vfs_real.h
+++ b/src/core/file_sys/vfs_real.h
@@ -50,7 +50,7 @@ public:
50 std::string GetName() const override; 50 std::string GetName() const override;
51 std::size_t GetSize() const override; 51 std::size_t GetSize() const override;
52 bool Resize(std::size_t new_size) override; 52 bool Resize(std::size_t new_size) override;
53 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; 53 VirtualDir GetContainingDirectory() const override;
54 bool IsWritable() const override; 54 bool IsWritable() const override;
55 bool IsReadable() const override; 55 bool IsReadable() const override;
56 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override; 56 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override;
@@ -79,21 +79,21 @@ class RealVfsDirectory : public VfsDirectory {
79public: 79public:
80 ~RealVfsDirectory() override; 80 ~RealVfsDirectory() override;
81 81
82 std::shared_ptr<VfsFile> GetFileRelative(std::string_view path) const override; 82 VirtualFile GetFileRelative(std::string_view path) const override;
83 std::shared_ptr<VfsDirectory> GetDirectoryRelative(std::string_view path) const override; 83 VirtualDir GetDirectoryRelative(std::string_view path) const override;
84 std::shared_ptr<VfsFile> GetFile(std::string_view name) const override; 84 VirtualFile GetFile(std::string_view name) const override;
85 std::shared_ptr<VfsDirectory> GetSubdirectory(std::string_view name) const override; 85 VirtualDir GetSubdirectory(std::string_view name) const override;
86 std::shared_ptr<VfsFile> CreateFileRelative(std::string_view path) override; 86 VirtualFile CreateFileRelative(std::string_view path) override;
87 std::shared_ptr<VfsDirectory> CreateDirectoryRelative(std::string_view path) override; 87 VirtualDir CreateDirectoryRelative(std::string_view path) override;
88 bool DeleteSubdirectoryRecursive(std::string_view name) override; 88 bool DeleteSubdirectoryRecursive(std::string_view name) override;
89 std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; 89 std::vector<VirtualFile> GetFiles() const override;
90 std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; 90 std::vector<VirtualDir> GetSubdirectories() const override;
91 bool IsWritable() const override; 91 bool IsWritable() const override;
92 bool IsReadable() const override; 92 bool IsReadable() const override;
93 std::string GetName() const override; 93 std::string GetName() const override;
94 std::shared_ptr<VfsDirectory> GetParentDirectory() const override; 94 VirtualDir GetParentDirectory() const override;
95 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; 95 VirtualDir CreateSubdirectory(std::string_view name) override;
96 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; 96 VirtualFile CreateFile(std::string_view name) override;
97 bool DeleteSubdirectory(std::string_view name) override; 97 bool DeleteSubdirectory(std::string_view name) override;
98 bool DeleteFile(std::string_view name) override; 98 bool DeleteFile(std::string_view name) override;
99 bool Rename(std::string_view name) override; 99 bool Rename(std::string_view name) override;
diff --git a/src/core/file_sys/vfs_static.h b/src/core/file_sys/vfs_static.h
index 8b27c30fa..c840b24b9 100644
--- a/src/core/file_sys/vfs_static.h
+++ b/src/core/file_sys/vfs_static.h
@@ -31,7 +31,7 @@ public:
31 return true; 31 return true;
32 } 32 }
33 33
34 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override { 34 VirtualDir GetContainingDirectory() const override {
35 return parent; 35 return parent;
36 } 36 }
37 37
diff --git a/src/core/file_sys/vfs_vector.cpp b/src/core/file_sys/vfs_vector.cpp
index 75fc04302..c1ec1e645 100644
--- a/src/core/file_sys/vfs_vector.cpp
+++ b/src/core/file_sys/vfs_vector.cpp
@@ -25,7 +25,7 @@ bool VectorVfsFile::Resize(size_t new_size) {
25 return true; 25 return true;
26} 26}
27 27
28std::shared_ptr<VfsDirectory> VectorVfsFile::GetContainingDirectory() const { 28VirtualDir VectorVfsFile::GetContainingDirectory() const {
29 return parent; 29 return parent;
30} 30}
31 31
@@ -68,11 +68,11 @@ VectorVfsDirectory::VectorVfsDirectory(std::vector<VirtualFile> files_,
68 68
69VectorVfsDirectory::~VectorVfsDirectory() = default; 69VectorVfsDirectory::~VectorVfsDirectory() = default;
70 70
71std::vector<std::shared_ptr<VfsFile>> VectorVfsDirectory::GetFiles() const { 71std::vector<VirtualFile> VectorVfsDirectory::GetFiles() const {
72 return files; 72 return files;
73} 73}
74 74
75std::vector<std::shared_ptr<VfsDirectory>> VectorVfsDirectory::GetSubdirectories() const { 75std::vector<VirtualDir> VectorVfsDirectory::GetSubdirectories() const {
76 return dirs; 76 return dirs;
77} 77}
78 78
@@ -88,7 +88,7 @@ std::string VectorVfsDirectory::GetName() const {
88 return name; 88 return name;
89} 89}
90 90
91std::shared_ptr<VfsDirectory> VectorVfsDirectory::GetParentDirectory() const { 91VirtualDir VectorVfsDirectory::GetParentDirectory() const {
92 return parent; 92 return parent;
93} 93}
94 94
@@ -116,11 +116,11 @@ bool VectorVfsDirectory::Rename(std::string_view name_) {
116 return true; 116 return true;
117} 117}
118 118
119std::shared_ptr<VfsDirectory> VectorVfsDirectory::CreateSubdirectory(std::string_view name) { 119VirtualDir VectorVfsDirectory::CreateSubdirectory(std::string_view name) {
120 return nullptr; 120 return nullptr;
121} 121}
122 122
123std::shared_ptr<VfsFile> VectorVfsDirectory::CreateFile(std::string_view name) { 123VirtualFile VectorVfsDirectory::CreateFile(std::string_view name) {
124 return nullptr; 124 return nullptr;
125} 125}
126 126
diff --git a/src/core/file_sys/vfs_vector.h b/src/core/file_sys/vfs_vector.h
index 95d3da2f2..2aff9ca34 100644
--- a/src/core/file_sys/vfs_vector.h
+++ b/src/core/file_sys/vfs_vector.h
@@ -17,9 +17,9 @@ namespace FileSys {
17template <std::size_t size> 17template <std::size_t size>
18class ArrayVfsFile : public VfsFile { 18class ArrayVfsFile : public VfsFile {
19public: 19public:
20 explicit ArrayVfsFile(const std::array<u8, size>& data, std::string name = "", 20 explicit ArrayVfsFile(const std::array<u8, size>& data_, std::string name_ = "",
21 VirtualDir parent = nullptr) 21 VirtualDir parent_ = nullptr)
22 : data(data), name(std::move(name)), parent(std::move(parent)) {} 22 : data(data_), name(std::move(name_)), parent(std::move(parent_)) {}
23 23
24 std::string GetName() const override { 24 std::string GetName() const override {
25 return name; 25 return name;
@@ -33,7 +33,7 @@ public:
33 return false; 33 return false;
34 } 34 }
35 35
36 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override { 36 VirtualDir GetContainingDirectory() const override {
37 return parent; 37 return parent;
38 } 38 }
39 39
@@ -51,12 +51,12 @@ public:
51 return read; 51 return read;
52 } 52 }
53 53
54 std::size_t Write(const u8* data, std::size_t length, std::size_t offset) override { 54 std::size_t Write(const u8* data_, std::size_t length, std::size_t offset) override {
55 return 0; 55 return 0;
56 } 56 }
57 57
58 bool Rename(std::string_view name) override { 58 bool Rename(std::string_view new_name) override {
59 this->name = name; 59 name = new_name;
60 return true; 60 return true;
61 } 61 }
62 62
@@ -82,7 +82,7 @@ public:
82 std::string GetName() const override; 82 std::string GetName() const override;
83 std::size_t GetSize() const override; 83 std::size_t GetSize() const override;
84 bool Resize(std::size_t new_size) override; 84 bool Resize(std::size_t new_size) override;
85 std::shared_ptr<VfsDirectory> GetContainingDirectory() const override; 85 VirtualDir GetContainingDirectory() const override;
86 bool IsWritable() const override; 86 bool IsWritable() const override;
87 bool IsReadable() const override; 87 bool IsReadable() const override;
88 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override; 88 std::size_t Read(u8* data, std::size_t length, std::size_t offset) const override;
@@ -106,17 +106,17 @@ public:
106 VirtualDir parent = nullptr); 106 VirtualDir parent = nullptr);
107 ~VectorVfsDirectory() override; 107 ~VectorVfsDirectory() override;
108 108
109 std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; 109 std::vector<VirtualFile> GetFiles() const override;
110 std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; 110 std::vector<VirtualDir> GetSubdirectories() const override;
111 bool IsWritable() const override; 111 bool IsWritable() const override;
112 bool IsReadable() const override; 112 bool IsReadable() const override;
113 std::string GetName() const override; 113 std::string GetName() const override;
114 std::shared_ptr<VfsDirectory> GetParentDirectory() const override; 114 VirtualDir GetParentDirectory() const override;
115 bool DeleteSubdirectory(std::string_view name) override; 115 bool DeleteSubdirectory(std::string_view name) override;
116 bool DeleteFile(std::string_view name) override; 116 bool DeleteFile(std::string_view name) override;
117 bool Rename(std::string_view name) override; 117 bool Rename(std::string_view name) override;
118 std::shared_ptr<VfsDirectory> CreateSubdirectory(std::string_view name) override; 118 VirtualDir CreateSubdirectory(std::string_view name) override;
119 std::shared_ptr<VfsFile> CreateFile(std::string_view name) override; 119 VirtualFile CreateFile(std::string_view name) override;
120 120
121 virtual void AddFile(VirtualFile file); 121 virtual void AddFile(VirtualFile file);
122 virtual void AddDirectory(VirtualDir dir); 122 virtual void AddDirectory(VirtualDir dir);
diff --git a/src/core/file_sys/xts_archive.cpp b/src/core/file_sys/xts_archive.cpp
index 24c58e7ae..814fd5680 100644
--- a/src/core/file_sys/xts_archive.cpp
+++ b/src/core/file_sys/xts_archive.cpp
@@ -152,11 +152,11 @@ NAXContentType NAX::GetContentType() const {
152 return type; 152 return type;
153} 153}
154 154
155std::vector<std::shared_ptr<VfsFile>> NAX::GetFiles() const { 155std::vector<VirtualFile> NAX::GetFiles() const {
156 return {dec_file}; 156 return {dec_file};
157} 157}
158 158
159std::vector<std::shared_ptr<VfsDirectory>> NAX::GetSubdirectories() const { 159std::vector<VirtualDir> NAX::GetSubdirectories() const {
160 return {}; 160 return {};
161} 161}
162 162
@@ -164,7 +164,7 @@ std::string NAX::GetName() const {
164 return file->GetName(); 164 return file->GetName();
165} 165}
166 166
167std::shared_ptr<VfsDirectory> NAX::GetParentDirectory() const { 167VirtualDir NAX::GetParentDirectory() const {
168 return file->GetContainingDirectory(); 168 return file->GetContainingDirectory();
169} 169}
170 170
diff --git a/src/core/file_sys/xts_archive.h b/src/core/file_sys/xts_archive.h
index c472e226e..63a032b68 100644
--- a/src/core/file_sys/xts_archive.h
+++ b/src/core/file_sys/xts_archive.h
@@ -47,13 +47,13 @@ public:
47 47
48 NAXContentType GetContentType() const; 48 NAXContentType GetContentType() const;
49 49
50 std::vector<std::shared_ptr<VfsFile>> GetFiles() const override; 50 std::vector<VirtualFile> GetFiles() const override;
51 51
52 std::vector<std::shared_ptr<VfsDirectory>> GetSubdirectories() const override; 52 std::vector<VirtualDir> GetSubdirectories() const override;
53 53
54 std::string GetName() const override; 54 std::string GetName() const override;
55 55
56 std::shared_ptr<VfsDirectory> GetParentDirectory() const override; 56 VirtualDir GetParentDirectory() const override;
57 57
58private: 58private:
59 Loader::ResultStatus Parse(std::string_view path); 59 Loader::ResultStatus Parse(std::string_view path);
diff --git a/src/core/frontend/applets/error.cpp b/src/core/frontend/applets/error.cpp
index 4002a9211..dceb20ff8 100644
--- a/src/core/frontend/applets/error.cpp
+++ b/src/core/frontend/applets/error.cpp
@@ -2,6 +2,7 @@
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#include "common/logging/log.h"
5#include "core/frontend/applets/error.h" 6#include "core/frontend/applets/error.h"
6 7
7namespace Core::Frontend { 8namespace Core::Frontend {
@@ -10,7 +11,7 @@ ErrorApplet::~ErrorApplet() = default;
10 11
11void DefaultErrorApplet::ShowError(ResultCode error, std::function<void()> finished) const { 12void DefaultErrorApplet::ShowError(ResultCode error, std::function<void()> finished) const {
12 LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})", 13 LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})",
13 static_cast<u32>(error.module.Value()), error.description.Value(), error.raw); 14 error.module.Value(), error.description.Value(), error.raw);
14} 15}
15 16
16void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, 17void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time,
@@ -18,7 +19,7 @@ void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode error, std::chrono::s
18 LOG_CRITICAL( 19 LOG_CRITICAL(
19 Service_Fatal, 20 Service_Fatal,
20 "Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}", 21 "Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}",
21 static_cast<u32>(error.module.Value()), error.description.Value(), error.raw, time.count()); 22 error.module.Value(), error.description.Value(), error.raw, time.count());
22} 23}
23 24
24void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_text, 25void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_text,
@@ -26,7 +27,7 @@ void DefaultErrorApplet::ShowCustomErrorText(ResultCode error, std::string main_
26 std::function<void()> finished) const { 27 std::function<void()> finished) const {
27 LOG_CRITICAL(Service_Fatal, 28 LOG_CRITICAL(Service_Fatal,
28 "Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})", 29 "Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})",
29 static_cast<u32>(error.module.Value()), error.description.Value(), error.raw); 30 error.module.Value(), error.description.Value(), error.raw);
30 LOG_CRITICAL(Service_Fatal, " Main Text: {}", main_text); 31 LOG_CRITICAL(Service_Fatal, " Main Text: {}", main_text);
31 LOG_CRITICAL(Service_Fatal, " Detail Text: {}", detail_text); 32 LOG_CRITICAL(Service_Fatal, " Detail Text: {}", detail_text);
32} 33}
diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h
index d57776ce9..56cc911d1 100644
--- a/src/core/hle/ipc_helpers.h
+++ b/src/core/hle/ipc_helpers.h
@@ -166,8 +166,23 @@ public:
166 ValidateHeader(); 166 ValidateHeader();
167 } 167 }
168 168
169 void PushImpl(s8 value);
170 void PushImpl(s16 value);
171 void PushImpl(s32 value);
172 void PushImpl(s64 value);
173 void PushImpl(u8 value);
174 void PushImpl(u16 value);
175 void PushImpl(u32 value);
176 void PushImpl(u64 value);
177 void PushImpl(float value);
178 void PushImpl(double value);
179 void PushImpl(bool value);
180 void PushImpl(ResultCode value);
181
169 template <typename T> 182 template <typename T>
170 void Push(T value); 183 void Push(T value) {
184 return PushImpl(value);
185 }
171 186
172 template <typename First, typename... Other> 187 template <typename First, typename... Other>
173 void Push(const First& first_value, const Other&... other_values); 188 void Push(const First& first_value, const Other&... other_values);
@@ -215,13 +230,11 @@ private:
215 230
216/// Push /// 231/// Push ///
217 232
218template <> 233inline void ResponseBuilder::PushImpl(s32 value) {
219inline void ResponseBuilder::Push(s32 value) {
220 cmdbuf[index++] = static_cast<u32>(value); 234 cmdbuf[index++] = static_cast<u32>(value);
221} 235}
222 236
223template <> 237inline void ResponseBuilder::PushImpl(u32 value) {
224inline void ResponseBuilder::Push(u32 value) {
225 cmdbuf[index++] = value; 238 cmdbuf[index++] = value;
226} 239}
227 240
@@ -233,62 +246,52 @@ void ResponseBuilder::PushRaw(const T& value) {
233 index += (sizeof(T) + 3) / 4; // round up to word length 246 index += (sizeof(T) + 3) / 4; // round up to word length
234} 247}
235 248
236template <> 249inline void ResponseBuilder::PushImpl(ResultCode value) {
237inline void ResponseBuilder::Push(ResultCode value) {
238 // Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded. 250 // Result codes are actually 64-bit in the IPC buffer, but only the high part is discarded.
239 Push(value.raw); 251 Push(value.raw);
240 Push<u32>(0); 252 Push<u32>(0);
241} 253}
242 254
243template <> 255inline void ResponseBuilder::PushImpl(s8 value) {
244inline void ResponseBuilder::Push(s8 value) {
245 PushRaw(value); 256 PushRaw(value);
246} 257}
247 258
248template <> 259inline void ResponseBuilder::PushImpl(s16 value) {
249inline void ResponseBuilder::Push(s16 value) {
250 PushRaw(value); 260 PushRaw(value);
251} 261}
252 262
253template <> 263inline void ResponseBuilder::PushImpl(s64 value) {
254inline void ResponseBuilder::Push(s64 value) { 264 PushImpl(static_cast<u32>(value));
255 Push(static_cast<u32>(value)); 265 PushImpl(static_cast<u32>(value >> 32));
256 Push(static_cast<u32>(value >> 32));
257} 266}
258 267
259template <> 268inline void ResponseBuilder::PushImpl(u8 value) {
260inline void ResponseBuilder::Push(u8 value) {
261 PushRaw(value); 269 PushRaw(value);
262} 270}
263 271
264template <> 272inline void ResponseBuilder::PushImpl(u16 value) {
265inline void ResponseBuilder::Push(u16 value) {
266 PushRaw(value); 273 PushRaw(value);
267} 274}
268 275
269template <> 276inline void ResponseBuilder::PushImpl(u64 value) {
270inline void ResponseBuilder::Push(u64 value) { 277 PushImpl(static_cast<u32>(value));
271 Push(static_cast<u32>(value)); 278 PushImpl(static_cast<u32>(value >> 32));
272 Push(static_cast<u32>(value >> 32));
273} 279}
274 280
275template <> 281inline void ResponseBuilder::PushImpl(float value) {
276inline void ResponseBuilder::Push(float value) {
277 u32 integral; 282 u32 integral;
278 std::memcpy(&integral, &value, sizeof(u32)); 283 std::memcpy(&integral, &value, sizeof(u32));
279 Push(integral); 284 PushImpl(integral);
280} 285}
281 286
282template <> 287inline void ResponseBuilder::PushImpl(double value) {
283inline void ResponseBuilder::Push(double value) {
284 u64 integral; 288 u64 integral;
285 std::memcpy(&integral, &value, sizeof(u64)); 289 std::memcpy(&integral, &value, sizeof(u64));
286 Push(integral); 290 PushImpl(integral);
287} 291}
288 292
289template <> 293inline void ResponseBuilder::PushImpl(bool value) {
290inline void ResponseBuilder::Push(bool value) { 294 PushImpl(static_cast<u8>(value));
291 Push(static_cast<u8>(value));
292} 295}
293 296
294template <typename First, typename... Other> 297template <typename First, typename... Other>
diff --git a/src/core/hle/kernel/memory/memory_block.h b/src/core/hle/kernel/memory/memory_block.h
index 9d7839d08..37fe19916 100644
--- a/src/core/hle/kernel/memory/memory_block.h
+++ b/src/core/hle/kernel/memory/memory_block.h
@@ -222,9 +222,9 @@ public:
222 222
223public: 223public:
224 constexpr MemoryBlock() = default; 224 constexpr MemoryBlock() = default;
225 constexpr MemoryBlock(VAddr addr, std::size_t num_pages, MemoryState state, 225 constexpr MemoryBlock(VAddr addr_, std::size_t num_pages_, MemoryState state_,
226 MemoryPermission perm, MemoryAttribute attribute) 226 MemoryPermission perm_, MemoryAttribute attribute_)
227 : addr{addr}, num_pages(num_pages), state{state}, perm{perm}, attribute{attribute} {} 227 : addr{addr_}, num_pages(num_pages_), state{state_}, perm{perm_}, attribute{attribute_} {}
228 228
229 constexpr VAddr GetAddress() const { 229 constexpr VAddr GetAddress() const {
230 return addr; 230 return addr;
diff --git a/src/core/hle/kernel/memory/memory_block_manager.h b/src/core/hle/kernel/memory/memory_block_manager.h
index 6e1d41075..f57d1bbcc 100644
--- a/src/core/hle/kernel/memory/memory_block_manager.h
+++ b/src/core/hle/kernel/memory/memory_block_manager.h
@@ -57,8 +57,8 @@ public:
57private: 57private:
58 void MergeAdjacent(iterator it, iterator& next_it); 58 void MergeAdjacent(iterator it, iterator& next_it);
59 59
60 const VAddr start_addr; 60 [[maybe_unused]] const VAddr start_addr;
61 const VAddr end_addr; 61 [[maybe_unused]] const VAddr end_addr;
62 62
63 MemoryBlockTree memory_block_tree; 63 MemoryBlockTree memory_block_tree;
64}; 64};
diff --git a/src/core/hle/kernel/physical_core.h b/src/core/hle/kernel/physical_core.h
index b4d3c15de..f2b0911aa 100644
--- a/src/core/hle/kernel/physical_core.h
+++ b/src/core/hle/kernel/physical_core.h
@@ -36,7 +36,7 @@ public:
36 PhysicalCore& operator=(const PhysicalCore&) = delete; 36 PhysicalCore& operator=(const PhysicalCore&) = delete;
37 37
38 PhysicalCore(PhysicalCore&&) = default; 38 PhysicalCore(PhysicalCore&&) = default;
39 PhysicalCore& operator=(PhysicalCore&&) = default; 39 PhysicalCore& operator=(PhysicalCore&&) = delete;
40 40
41 /// Initialize the core for the specified parameters. 41 /// Initialize the core for the specified parameters.
42 void Initialize(bool is_64_bit); 42 void Initialize(bool is_64_bit);
diff --git a/src/core/hle/kernel/process_capability.cpp b/src/core/hle/kernel/process_capability.cpp
index 63880f13d..0f128c586 100644
--- a/src/core/hle/kernel/process_capability.cpp
+++ b/src/core/hle/kernel/process_capability.cpp
@@ -199,7 +199,7 @@ ResultCode ProcessCapabilities::ParseSingleFlagCapability(u32& set_flags, u32& s
199 break; 199 break;
200 } 200 }
201 201
202 LOG_ERROR(Kernel, "Invalid capability type! type={}", static_cast<u32>(type)); 202 LOG_ERROR(Kernel, "Invalid capability type! type={}", type);
203 return ERR_INVALID_CAPABILITY_DESCRIPTOR; 203 return ERR_INVALID_CAPABILITY_DESCRIPTOR;
204} 204}
205 205
diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp
index 212e442f4..7bf50339d 100644
--- a/src/core/hle/kernel/resource_limit.cpp
+++ b/src/core/hle/kernel/resource_limit.cpp
@@ -65,8 +65,8 @@ ResultCode ResourceLimit::SetLimitValue(ResourceType resource, s64 value) {
65 limit[index] = value; 65 limit[index] = value;
66 return RESULT_SUCCESS; 66 return RESULT_SUCCESS;
67 } else { 67 } else {
68 LOG_ERROR(Kernel, "Limit value is too large! resource={}, value={}, index={}", 68 LOG_ERROR(Kernel, "Limit value is too large! resource={}, value={}, index={}", resource,
69 static_cast<u32>(resource), value, index); 69 value, index);
70 return ERR_INVALID_STATE; 70 return ERR_INVALID_STATE;
71 } 71 }
72} 72}
diff --git a/src/core/hle/kernel/server_session.cpp b/src/core/hle/kernel/server_session.cpp
index 78e41b13e..a35c8aa4b 100644
--- a/src/core/hle/kernel/server_session.cpp
+++ b/src/core/hle/kernel/server_session.cpp
@@ -130,8 +130,7 @@ ResultCode ServerSession::HandleDomainSyncRequest(Kernel::HLERequestContext& con
130 } 130 }
131 } 131 }
132 132
133 LOG_CRITICAL(IPC, "Unknown domain command={}", 133 LOG_CRITICAL(IPC, "Unknown domain command={}", domain_message_header.command.Value());
134 static_cast<int>(domain_message_header.command.Value()));
135 ASSERT(false); 134 ASSERT(false);
136 return RESULT_SUCCESS; 135 return RESULT_SUCCESS;
137} 136}
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 30d60aeb6..2d225392f 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -235,8 +235,7 @@ static ResultCode SetMemoryAttribute(Core::System& system, VAddr address, u64 si
235 235
236static ResultCode SetMemoryAttribute32(Core::System& system, u32 address, u32 size, u32 mask, 236static ResultCode SetMemoryAttribute32(Core::System& system, u32 address, u32 size, u32 mask,
237 u32 attribute) { 237 u32 attribute) {
238 return SetMemoryAttribute(system, static_cast<VAddr>(address), static_cast<std::size_t>(size), 238 return SetMemoryAttribute(system, address, size, mask, attribute);
239 mask, attribute);
240} 239}
241 240
242/// Maps a memory range into a different range. 241/// Maps a memory range into a different range.
@@ -256,8 +255,7 @@ static ResultCode MapMemory(Core::System& system, VAddr dst_addr, VAddr src_addr
256} 255}
257 256
258static ResultCode MapMemory32(Core::System& system, u32 dst_addr, u32 src_addr, u32 size) { 257static ResultCode MapMemory32(Core::System& system, u32 dst_addr, u32 src_addr, u32 size) {
259 return MapMemory(system, static_cast<VAddr>(dst_addr), static_cast<VAddr>(src_addr), 258 return MapMemory(system, dst_addr, src_addr, size);
260 static_cast<std::size_t>(size));
261} 259}
262 260
263/// Unmaps a region that was previously mapped with svcMapMemory 261/// Unmaps a region that was previously mapped with svcMapMemory
@@ -277,8 +275,7 @@ static ResultCode UnmapMemory(Core::System& system, VAddr dst_addr, VAddr src_ad
277} 275}
278 276
279static ResultCode UnmapMemory32(Core::System& system, u32 dst_addr, u32 src_addr, u32 size) { 277static ResultCode UnmapMemory32(Core::System& system, u32 dst_addr, u32 src_addr, u32 size) {
280 return UnmapMemory(system, static_cast<VAddr>(dst_addr), static_cast<VAddr>(src_addr), 278 return UnmapMemory(system, dst_addr, src_addr, size);
281 static_cast<std::size_t>(size));
282} 279}
283 280
284/// Connect to an OS service given the port name, returns the handle to the port to out 281/// Connect to an OS service given the port name, returns the handle to the port to out
@@ -533,8 +530,7 @@ static ResultCode ArbitrateLock(Core::System& system, Handle holding_thread_hand
533 530
534static ResultCode ArbitrateLock32(Core::System& system, Handle holding_thread_handle, 531static ResultCode ArbitrateLock32(Core::System& system, Handle holding_thread_handle,
535 u32 mutex_addr, Handle requesting_thread_handle) { 532 u32 mutex_addr, Handle requesting_thread_handle) {
536 return ArbitrateLock(system, holding_thread_handle, static_cast<VAddr>(mutex_addr), 533 return ArbitrateLock(system, holding_thread_handle, mutex_addr, requesting_thread_handle);
537 requesting_thread_handle);
538} 534}
539 535
540/// Unlock a mutex 536/// Unlock a mutex
@@ -557,7 +553,7 @@ static ResultCode ArbitrateUnlock(Core::System& system, VAddr mutex_addr) {
557} 553}
558 554
559static ResultCode ArbitrateUnlock32(Core::System& system, u32 mutex_addr) { 555static ResultCode ArbitrateUnlock32(Core::System& system, u32 mutex_addr) {
560 return ArbitrateUnlock(system, static_cast<VAddr>(mutex_addr)); 556 return ArbitrateUnlock(system, mutex_addr);
561} 557}
562 558
563enum class BreakType : u32 { 559enum class BreakType : u32 {
@@ -674,7 +670,7 @@ static void Break(Core::System& system, u32 reason, u64 info1, u64 info2) {
674} 670}
675 671
676static void Break32(Core::System& system, u32 reason, u32 info1, u32 info2) { 672static void Break32(Core::System& system, u32 reason, u32 info1, u32 info2) {
677 Break(system, reason, static_cast<u64>(info1), static_cast<u64>(info2)); 673 Break(system, reason, info1, info2);
678} 674}
679 675
680/// Used to output a message on a debug hardware unit - does nothing on a retail unit 676/// Used to output a message on a debug hardware unit - does nothing on a retail unit
@@ -945,7 +941,7 @@ static ResultCode GetInfo(Core::System& system, u64* result, u64 info_id, u64 ha
945 941
946static ResultCode GetInfo32(Core::System& system, u32* result_low, u32* result_high, u32 sub_id_low, 942static ResultCode GetInfo32(Core::System& system, u32* result_low, u32* result_high, u32 sub_id_low,
947 u32 info_id, u32 handle, u32 sub_id_high) { 943 u32 info_id, u32 handle, u32 sub_id_high) {
948 const u64 sub_id{static_cast<u64>(sub_id_low | (static_cast<u64>(sub_id_high) << 32))}; 944 const u64 sub_id{u64{sub_id_low} | (u64{sub_id_high} << 32)};
949 u64 res_value{}; 945 u64 res_value{};
950 946
951 const ResultCode result{GetInfo(system, &res_value, info_id, handle, sub_id)}; 947 const ResultCode result{GetInfo(system, &res_value, info_id, handle, sub_id)};
@@ -1006,7 +1002,7 @@ static ResultCode MapPhysicalMemory(Core::System& system, VAddr addr, u64 size)
1006} 1002}
1007 1003
1008static ResultCode MapPhysicalMemory32(Core::System& system, u32 addr, u32 size) { 1004static ResultCode MapPhysicalMemory32(Core::System& system, u32 addr, u32 size) {
1009 return MapPhysicalMemory(system, static_cast<VAddr>(addr), static_cast<std::size_t>(size)); 1005 return MapPhysicalMemory(system, addr, size);
1010} 1006}
1011 1007
1012/// Unmaps memory previously mapped via MapPhysicalMemory 1008/// Unmaps memory previously mapped via MapPhysicalMemory
@@ -1060,7 +1056,7 @@ static ResultCode UnmapPhysicalMemory(Core::System& system, VAddr addr, u64 size
1060} 1056}
1061 1057
1062static ResultCode UnmapPhysicalMemory32(Core::System& system, u32 addr, u32 size) { 1058static ResultCode UnmapPhysicalMemory32(Core::System& system, u32 addr, u32 size) {
1063 return UnmapPhysicalMemory(system, static_cast<VAddr>(addr), static_cast<std::size_t>(size)); 1059 return UnmapPhysicalMemory(system, addr, size);
1064} 1060}
1065 1061
1066/// Sets the thread activity 1062/// Sets the thread activity
@@ -1141,7 +1137,7 @@ static ResultCode GetThreadContext(Core::System& system, VAddr thread_context, H
1141} 1137}
1142 1138
1143static ResultCode GetThreadContext32(Core::System& system, u32 thread_context, Handle handle) { 1139static ResultCode GetThreadContext32(Core::System& system, u32 thread_context, Handle handle) {
1144 return GetThreadContext(system, static_cast<VAddr>(thread_context), handle); 1140 return GetThreadContext(system, thread_context, handle);
1145} 1141}
1146 1142
1147/// Gets the priority for the specified thread 1143/// Gets the priority for the specified thread
@@ -1278,8 +1274,7 @@ static ResultCode MapSharedMemory(Core::System& system, Handle shared_memory_han
1278 1274
1279static ResultCode MapSharedMemory32(Core::System& system, Handle shared_memory_handle, u32 addr, 1275static ResultCode MapSharedMemory32(Core::System& system, Handle shared_memory_handle, u32 addr,
1280 u32 size, u32 permissions) { 1276 u32 size, u32 permissions) {
1281 return MapSharedMemory(system, shared_memory_handle, static_cast<VAddr>(addr), 1277 return MapSharedMemory(system, shared_memory_handle, addr, size, permissions);
1282 static_cast<std::size_t>(size), permissions);
1283} 1278}
1284 1279
1285static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address, 1280static ResultCode QueryProcessMemory(Core::System& system, VAddr memory_info_address,
@@ -1549,8 +1544,7 @@ static ResultCode CreateThread(Core::System& system, Handle* out_handle, VAddr e
1549 1544
1550static ResultCode CreateThread32(Core::System& system, Handle* out_handle, u32 priority, 1545static ResultCode CreateThread32(Core::System& system, Handle* out_handle, u32 priority,
1551 u32 entry_point, u32 arg, u32 stack_top, s32 processor_id) { 1546 u32 entry_point, u32 arg, u32 stack_top, s32 processor_id) {
1552 return CreateThread(system, out_handle, static_cast<VAddr>(entry_point), static_cast<u64>(arg), 1547 return CreateThread(system, out_handle, entry_point, arg, stack_top, priority, processor_id);
1553 static_cast<VAddr>(stack_top), priority, processor_id);
1554} 1548}
1555 1549
1556/// Starts the thread for the provided handle 1550/// Starts the thread for the provided handle
@@ -1621,8 +1615,7 @@ static void SleepThread(Core::System& system, s64 nanoseconds) {
1621} 1615}
1622 1616
1623static void SleepThread32(Core::System& system, u32 nanoseconds_low, u32 nanoseconds_high) { 1617static void SleepThread32(Core::System& system, u32 nanoseconds_low, u32 nanoseconds_high) {
1624 const s64 nanoseconds = static_cast<s64>(static_cast<u64>(nanoseconds_low) | 1618 const auto nanoseconds = static_cast<s64>(u64{nanoseconds_low} | (u64{nanoseconds_high} << 32));
1625 (static_cast<u64>(nanoseconds_high) << 32));
1626 SleepThread(system, nanoseconds); 1619 SleepThread(system, nanoseconds);
1627} 1620}
1628 1621
@@ -1708,10 +1701,8 @@ static ResultCode WaitProcessWideKeyAtomic(Core::System& system, VAddr mutex_add
1708static ResultCode WaitProcessWideKeyAtomic32(Core::System& system, u32 mutex_addr, 1701static ResultCode WaitProcessWideKeyAtomic32(Core::System& system, u32 mutex_addr,
1709 u32 condition_variable_addr, Handle thread_handle, 1702 u32 condition_variable_addr, Handle thread_handle,
1710 u32 nanoseconds_low, u32 nanoseconds_high) { 1703 u32 nanoseconds_low, u32 nanoseconds_high) {
1711 const s64 nanoseconds = 1704 const auto nanoseconds = static_cast<s64>(nanoseconds_low | (u64{nanoseconds_high} << 32));
1712 static_cast<s64>(nanoseconds_low | (static_cast<u64>(nanoseconds_high) << 32)); 1705 return WaitProcessWideKeyAtomic(system, mutex_addr, condition_variable_addr, thread_handle,
1713 return WaitProcessWideKeyAtomic(system, static_cast<VAddr>(mutex_addr),
1714 static_cast<VAddr>(condition_variable_addr), thread_handle,
1715 nanoseconds); 1706 nanoseconds);
1716} 1707}
1717 1708
@@ -1817,8 +1808,8 @@ static ResultCode WaitForAddress(Core::System& system, VAddr address, u32 type,
1817 1808
1818static ResultCode WaitForAddress32(Core::System& system, u32 address, u32 type, s32 value, 1809static ResultCode WaitForAddress32(Core::System& system, u32 address, u32 type, s32 value,
1819 u32 timeout_low, u32 timeout_high) { 1810 u32 timeout_low, u32 timeout_high) {
1820 s64 timeout = static_cast<s64>(timeout_low | (static_cast<u64>(timeout_high) << 32)); 1811 const auto timeout = static_cast<s64>(timeout_low | (u64{timeout_high} << 32));
1821 return WaitForAddress(system, static_cast<VAddr>(address), type, value, timeout); 1812 return WaitForAddress(system, address, type, value, timeout);
1822} 1813}
1823 1814
1824// Signals to an address (via Address Arbiter) 1815// Signals to an address (via Address Arbiter)
@@ -1846,7 +1837,7 @@ static ResultCode SignalToAddress(Core::System& system, VAddr address, u32 type,
1846 1837
1847static ResultCode SignalToAddress32(Core::System& system, u32 address, u32 type, s32 value, 1838static ResultCode SignalToAddress32(Core::System& system, u32 address, u32 type, s32 value,
1848 s32 num_to_wake) { 1839 s32 num_to_wake) {
1849 return SignalToAddress(system, static_cast<VAddr>(address), type, value, num_to_wake); 1840 return SignalToAddress(system, address, type, value, num_to_wake);
1850} 1841}
1851 1842
1852static void KernelDebug([[maybe_unused]] Core::System& system, 1843static void KernelDebug([[maybe_unused]] Core::System& system,
@@ -1877,7 +1868,7 @@ static u64 GetSystemTick(Core::System& system) {
1877} 1868}
1878 1869
1879static void GetSystemTick32(Core::System& system, u32* time_low, u32* time_high) { 1870static void GetSystemTick32(Core::System& system, u32* time_low, u32* time_high) {
1880 u64 time = GetSystemTick(system); 1871 const auto time = GetSystemTick(system);
1881 *time_low = static_cast<u32>(time); 1872 *time_low = static_cast<u32>(time);
1882 *time_high = static_cast<u32>(time >> 32); 1873 *time_high = static_cast<u32>(time >> 32);
1883} 1874}
@@ -1968,8 +1959,7 @@ static ResultCode CreateTransferMemory(Core::System& system, Handle* handle, VAd
1968 1959
1969static ResultCode CreateTransferMemory32(Core::System& system, Handle* handle, u32 addr, u32 size, 1960static ResultCode CreateTransferMemory32(Core::System& system, Handle* handle, u32 addr, u32 size,
1970 u32 permissions) { 1961 u32 permissions) {
1971 return CreateTransferMemory(system, handle, static_cast<VAddr>(addr), 1962 return CreateTransferMemory(system, handle, addr, size, permissions);
1972 static_cast<std::size_t>(size), permissions);
1973} 1963}
1974 1964
1975static ResultCode GetThreadCoreMask(Core::System& system, Handle thread_handle, u32* core, 1965static ResultCode GetThreadCoreMask(Core::System& system, Handle thread_handle, u32* core,
@@ -2059,8 +2049,7 @@ static ResultCode SetThreadCoreMask(Core::System& system, Handle thread_handle,
2059 2049
2060static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, u32 core, 2050static ResultCode SetThreadCoreMask32(Core::System& system, Handle thread_handle, u32 core,
2061 u32 affinity_mask_low, u32 affinity_mask_high) { 2051 u32 affinity_mask_low, u32 affinity_mask_high) {
2062 const u64 affinity_mask = 2052 const auto affinity_mask = u64{affinity_mask_low} | (u64{affinity_mask_high} << 32);
2063 static_cast<u64>(affinity_mask_low) | (static_cast<u64>(affinity_mask_high) << 32);
2064 return SetThreadCoreMask(system, thread_handle, core, affinity_mask); 2053 return SetThreadCoreMask(system, thread_handle, core, affinity_mask);
2065} 2054}
2066 2055
@@ -2325,9 +2314,10 @@ static ResultCode GetThreadList(Core::System& system, u32* out_num_threads, VAdd
2325 return RESULT_SUCCESS; 2314 return RESULT_SUCCESS;
2326} 2315}
2327 2316
2328static ResultCode FlushProcessDataCache32(Core::System& system, Handle handle, u32 address, 2317static ResultCode FlushProcessDataCache32([[maybe_unused]] Core::System& system,
2329 u32 size) { 2318 [[maybe_unused]] Handle handle,
2330 // Note(Blinkhawk): For emulation purposes of the data cache this is mostly a nope 2319 [[maybe_unused]] u32 address, [[maybe_unused]] u32 size) {
2320 // Note(Blinkhawk): For emulation purposes of the data cache this is mostly a no-op,
2331 // as all emulation is done in the same cache level in host architecture, thus data cache 2321 // as all emulation is done in the same cache level in host architecture, thus data cache
2332 // does not need flushing. 2322 // does not need flushing.
2333 LOG_DEBUG(Kernel_SVC, "called"); 2323 LOG_DEBUG(Kernel_SVC, "called");
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 38d877f6e..cb13210e5 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1092,14 +1092,14 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
1092 const auto applet_id = rp.PopRaw<Applets::AppletId>(); 1092 const auto applet_id = rp.PopRaw<Applets::AppletId>();
1093 const auto applet_mode = rp.PopRaw<u32>(); 1093 const auto applet_mode = rp.PopRaw<u32>();
1094 1094
1095 LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", 1095 LOG_DEBUG(Service_AM, "called with applet_id={:08X}, applet_mode={:08X}", applet_id,
1096 static_cast<u32>(applet_id), applet_mode); 1096 applet_mode);
1097 1097
1098 const auto& applet_manager{system.GetAppletManager()}; 1098 const auto& applet_manager{system.GetAppletManager()};
1099 const auto applet = applet_manager.GetApplet(applet_id); 1099 const auto applet = applet_manager.GetApplet(applet_id);
1100 1100
1101 if (applet == nullptr) { 1101 if (applet == nullptr) {
1102 LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", static_cast<u32>(applet_id)); 1102 LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id);
1103 1103
1104 IPC::ResponseBuilder rb{ctx, 2}; 1104 IPC::ResponseBuilder rb{ctx, 2};
1105 rb.Push(RESULT_UNKNOWN); 1105 rb.Push(RESULT_UNKNOWN);
@@ -1290,7 +1290,7 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
1290 IPC::RequestParser rp{ctx}; 1290 IPC::RequestParser rp{ctx};
1291 const auto kind = rp.PopEnum<LaunchParameterKind>(); 1291 const auto kind = rp.PopEnum<LaunchParameterKind>();
1292 1292
1293 LOG_DEBUG(Service_AM, "called, kind={:08X}", static_cast<u8>(kind)); 1293 LOG_DEBUG(Service_AM, "called, kind={:08X}", kind);
1294 1294
1295 if (kind == LaunchParameterKind::ApplicationSpecific && !launch_popped_application_specific) { 1295 if (kind == LaunchParameterKind::ApplicationSpecific && !launch_popped_application_specific) {
1296 const auto backend = BCAT::CreateBackendFromSettings(system, [this](u64 tid) { 1296 const auto backend = BCAT::CreateBackendFromSettings(system, [this](u64 tid) {
@@ -1537,8 +1537,8 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
1537 IPC::RequestParser rp{ctx}; 1537 IPC::RequestParser rp{ctx};
1538 const auto [type, user_id] = rp.PopRaw<Parameters>(); 1538 const auto [type, user_id] = rp.PopRaw<Parameters>();
1539 1539
1540 LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", static_cast<u8>(type), 1540 LOG_DEBUG(Service_AM, "called with type={:02X}, user_id={:016X}{:016X}", type, user_id[1],
1541 user_id[1], user_id[0]); 1541 user_id[0]);
1542 1542
1543 const auto size = system.GetFileSystemController().ReadSaveDataSize( 1543 const auto size = system.GetFileSystemController().ReadSaveDataSize(
1544 type, system.CurrentProcess()->GetTitleID(), user_id); 1544 type, system.CurrentProcess()->GetTitleID(), user_id);
diff --git a/src/core/hle/service/am/applets/controller.cpp b/src/core/hle/service/am/applets/controller.cpp
index e8ea4248b..7edfca64e 100644
--- a/src/core/hle/service/am/applets/controller.cpp
+++ b/src/core/hle/service/am/applets/controller.cpp
@@ -29,14 +29,14 @@ static Core::Frontend::ControllerParameters ConvertToFrontendParameters(
29 npad_style_set.raw = private_arg.style_set; 29 npad_style_set.raw = private_arg.style_set;
30 30
31 return { 31 return {
32 .min_players = std::max(s8(1), header.player_count_min), 32 .min_players = std::max(s8{1}, header.player_count_min),
33 .max_players = header.player_count_max, 33 .max_players = header.player_count_max,
34 .keep_controllers_connected = header.enable_take_over_connection, 34 .keep_controllers_connected = header.enable_take_over_connection,
35 .enable_single_mode = header.enable_single_mode, 35 .enable_single_mode = header.enable_single_mode,
36 .enable_border_color = header.enable_identification_color, 36 .enable_border_color = header.enable_identification_color,
37 .border_colors = identification_colors, 37 .border_colors = std::move(identification_colors),
38 .enable_explain_text = enable_text, 38 .enable_explain_text = enable_text,
39 .explain_text = text, 39 .explain_text = std::move(text),
40 .allow_pro_controller = npad_style_set.pro_controller == 1, 40 .allow_pro_controller = npad_style_set.pro_controller == 1,
41 .allow_handheld = npad_style_set.handheld == 1, 41 .allow_handheld = npad_style_set.handheld == 1,
42 .allow_dual_joycons = npad_style_set.joycon_dual == 1, 42 .allow_dual_joycons = npad_style_set.joycon_dual == 1,
@@ -227,15 +227,14 @@ void Controller::ConfigurationComplete() {
227 // If enable_single_mode is enabled, player_count is 1 regardless of any other parameters. 227 // If enable_single_mode is enabled, player_count is 1 regardless of any other parameters.
228 // Otherwise, only count connected players from P1-P8. 228 // Otherwise, only count connected players from P1-P8.
229 result_info.player_count = 229 result_info.player_count =
230 is_single_mode ? 1 230 is_single_mode
231 : static_cast<s8>(std::count_if( 231 ? 1
232 players.begin(), players.end() - 2, 232 : static_cast<s8>(std::count_if(players.begin(), players.end() - 2,
233 [](Settings::PlayerInput player) { return player.connected; })); 233 [](const auto& player) { return player.connected; }));
234 234
235 result_info.selected_id = HID::Controller_NPad::IndexToNPad( 235 result_info.selected_id = HID::Controller_NPad::IndexToNPad(std::distance(
236 std::distance(players.begin(), 236 players.begin(), std::find_if(players.begin(), players.end(),
237 std::find_if(players.begin(), players.end(), 237 [](const auto& player) { return player.connected; })));
238 [](Settings::PlayerInput player) { return player.connected; })));
239 238
240 result_info.result = 0; 239 result_info.result = 0;
241 240
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp
index dcd4b2a35..d85505082 100644
--- a/src/core/hle/service/am/applets/error.cpp
+++ b/src/core/hle/service/am/applets/error.cpp
@@ -125,7 +125,7 @@ void Error::Initialize() {
125 error_code = Decode64BitError(args->error_record.error_code_64); 125 error_code = Decode64BitError(args->error_record.error_code_64);
126 break; 126 break;
127 default: 127 default:
128 UNIMPLEMENTED_MSG("Unimplemented LibAppletError mode={:02X}!", static_cast<u8>(mode)); 128 UNIMPLEMENTED_MSG("Unimplemented LibAppletError mode={:02X}!", mode);
129 } 129 }
130} 130}
131 131
@@ -179,7 +179,7 @@ void Error::Execute() {
179 error_code, std::chrono::seconds{args->error_record.posix_time}, callback); 179 error_code, std::chrono::seconds{args->error_record.posix_time}, callback);
180 break; 180 break;
181 default: 181 default:
182 UNIMPLEMENTED_MSG("Unimplemented LibAppletError mode={:02X}!", static_cast<u8>(mode)); 182 UNIMPLEMENTED_MSG("Unimplemented LibAppletError mode={:02X}!", mode);
183 DisplayCompleted(); 183 DisplayCompleted();
184 } 184 }
185} 185}
diff --git a/src/core/hle/service/am/applets/general_backend.cpp b/src/core/hle/service/am/applets/general_backend.cpp
index bdb6fd464..4d1df5cbe 100644
--- a/src/core/hle/service/am/applets/general_backend.cpp
+++ b/src/core/hle/service/am/applets/general_backend.cpp
@@ -90,7 +90,7 @@ void Auth::Execute() {
90 const auto unimplemented_log = [this] { 90 const auto unimplemented_log = [this] {
91 UNIMPLEMENTED_MSG("Unimplemented Auth applet type for type={:08X}, arg0={:02X}, " 91 UNIMPLEMENTED_MSG("Unimplemented Auth applet type for type={:08X}, arg0={:02X}, "
92 "arg1={:02X}, arg2={:02X}", 92 "arg1={:02X}, arg2={:02X}",
93 static_cast<u32>(type), arg0, arg1, arg2); 93 type, arg0, arg1, arg2);
94 }; 94 };
95 95
96 switch (type) { 96 switch (type) {
@@ -136,7 +136,7 @@ void Auth::Execute() {
136} 136}
137 137
138void Auth::AuthFinished(bool is_successful) { 138void Auth::AuthFinished(bool is_successful) {
139 this->successful = is_successful; 139 successful = is_successful;
140 140
141 struct Return { 141 struct Return {
142 ResultCode result_code; 142 ResultCode result_code;
@@ -193,7 +193,7 @@ void PhotoViewer::Execute() {
193 frontend.ShowAllPhotos(callback); 193 frontend.ShowAllPhotos(callback);
194 break; 194 break;
195 default: 195 default:
196 UNIMPLEMENTED_MSG("Unimplemented PhotoViewer applet mode={:02X}!", static_cast<u8>(mode)); 196 UNIMPLEMENTED_MSG("Unimplemented PhotoViewer applet mode={:02X}!", mode);
197 } 197 }
198} 198}
199 199
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp
index 6abac3f78..23e28565b 100644
--- a/src/core/hle/service/aoc/aoc_u.cpp
+++ b/src/core/hle/service/aoc/aoc_u.cpp
@@ -7,6 +7,7 @@
7#include <vector> 7#include <vector>
8#include "common/logging/log.h" 8#include "common/logging/log.h"
9#include "core/core.h" 9#include "core/core.h"
10#include "core/file_sys/common_funcs.h"
10#include "core/file_sys/content_archive.h" 11#include "core/file_sys/content_archive.h"
11#include "core/file_sys/control_metadata.h" 12#include "core/file_sys/control_metadata.h"
12#include "core/file_sys/nca_metadata.h" 13#include "core/file_sys/nca_metadata.h"
@@ -23,11 +24,8 @@
23 24
24namespace Service::AOC { 25namespace Service::AOC {
25 26
26constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
27constexpr u64 DLC_BASE_TO_AOC_ID = 0x1000;
28
29static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) { 27static bool CheckAOCTitleIDMatchesBase(u64 title_id, u64 base) {
30 return (title_id & DLC_BASE_TITLE_ID_MASK) == base; 28 return FileSys::GetBaseTitleID(title_id) == base;
31} 29}
32 30
33static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) { 31static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) {
@@ -48,6 +46,62 @@ static std::vector<u64> AccumulateAOCTitleIDs(Core::System& system) {
48 return add_on_content; 46 return add_on_content;
49} 47}
50 48
49class IPurchaseEventManager final : public ServiceFramework<IPurchaseEventManager> {
50public:
51 explicit IPurchaseEventManager(Core::System& system_)
52 : ServiceFramework{system_, "IPurchaseEventManager"} {
53 // clang-format off
54 static const FunctionInfo functions[] = {
55 {0, &IPurchaseEventManager::SetDefaultDeliveryTarget, "SetDefaultDeliveryTarget"},
56 {1, &IPurchaseEventManager::SetDeliveryTarget, "SetDeliveryTarget"},
57 {2, &IPurchaseEventManager::GetPurchasedEventReadableHandle, "GetPurchasedEventReadableHandle"},
58 {3, nullptr, "PopPurchasedProductInfo"},
59 {4, nullptr, "PopPurchasedProductInfoWithUid"},
60 };
61 // clang-format on
62
63 RegisterHandlers(functions);
64
65 purchased_event = Kernel::WritableEvent::CreateEventPair(
66 system.Kernel(), "IPurchaseEventManager:PurchasedEvent");
67 }
68
69private:
70 void SetDefaultDeliveryTarget(Kernel::HLERequestContext& ctx) {
71 IPC::RequestParser rp{ctx};
72
73 const auto unknown_1 = rp.Pop<u64>();
74 [[maybe_unused]] const auto unknown_2 = ctx.ReadBuffer();
75
76 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1);
77
78 IPC::ResponseBuilder rb{ctx, 2};
79 rb.Push(RESULT_SUCCESS);
80 }
81
82 void SetDeliveryTarget(Kernel::HLERequestContext& ctx) {
83 IPC::RequestParser rp{ctx};
84
85 const auto unknown_1 = rp.Pop<u64>();
86 [[maybe_unused]] const auto unknown_2 = ctx.ReadBuffer();
87
88 LOG_WARNING(Service_AOC, "(STUBBED) called, unknown_1={}", unknown_1);
89
90 IPC::ResponseBuilder rb{ctx, 2};
91 rb.Push(RESULT_SUCCESS);
92 }
93
94 void GetPurchasedEventReadableHandle(Kernel::HLERequestContext& ctx) {
95 LOG_WARNING(Service_AOC, "called");
96
97 IPC::ResponseBuilder rb{ctx, 2, 1};
98 rb.Push(RESULT_SUCCESS);
99 rb.PushCopyObjects(purchased_event.readable);
100 }
101
102 Kernel::EventPair purchased_event;
103};
104
51AOC_U::AOC_U(Core::System& system_) 105AOC_U::AOC_U(Core::System& system_)
52 : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)} { 106 : ServiceFramework{system_, "aoc:u"}, add_on_content{AccumulateAOCTitleIDs(system)} {
53 // clang-format off 107 // clang-format off
@@ -62,8 +116,8 @@ AOC_U::AOC_U(Core::System& system_)
62 {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"}, 116 {7, &AOC_U::PrepareAddOnContent, "PrepareAddOnContent"},
63 {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"}, 117 {8, &AOC_U::GetAddOnContentListChangedEvent, "GetAddOnContentListChangedEvent"},
64 {9, nullptr, "GetAddOnContentLostErrorCode"}, 118 {9, nullptr, "GetAddOnContentLostErrorCode"},
65 {100, nullptr, "CreateEcPurchasedEventManager"}, 119 {100, &AOC_U::CreateEcPurchasedEventManager, "CreateEcPurchasedEventManager"},
66 {101, nullptr, "CreatePermanentEcPurchasedEventManager"}, 120 {101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"},
67 }; 121 };
68 // clang-format on 122 // clang-format on
69 123
@@ -123,11 +177,11 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
123 const auto& disabled = Settings::values.disabled_addons[current]; 177 const auto& disabled = Settings::values.disabled_addons[current];
124 if (std::find(disabled.begin(), disabled.end(), "DLC") == disabled.end()) { 178 if (std::find(disabled.begin(), disabled.end(), "DLC") == disabled.end()) {
125 for (u64 content_id : add_on_content) { 179 for (u64 content_id : add_on_content) {
126 if ((content_id & DLC_BASE_TITLE_ID_MASK) != current) { 180 if (FileSys::GetBaseTitleID(content_id) != current) {
127 continue; 181 continue;
128 } 182 }
129 183
130 out.push_back(static_cast<u32>(content_id & 0x7FF)); 184 out.push_back(static_cast<u32>(FileSys::GetAOCID(content_id)));
131 } 185 }
132 } 186 }
133 187
@@ -169,7 +223,7 @@ void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
169 223
170 const auto res = pm.GetControlMetadata(); 224 const auto res = pm.GetControlMetadata();
171 if (res.first == nullptr) { 225 if (res.first == nullptr) {
172 rb.Push(title_id + DLC_BASE_TO_AOC_ID); 226 rb.Push(FileSys::GetAOCBaseTitleID(title_id));
173 return; 227 return;
174 } 228 }
175 229
@@ -201,6 +255,22 @@ void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) {
201 rb.PushCopyObjects(aoc_change_event.readable); 255 rb.PushCopyObjects(aoc_change_event.readable);
202} 256}
203 257
258void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
259 LOG_WARNING(Service_AOC, "(STUBBED) called");
260
261 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
262 rb.Push(RESULT_SUCCESS);
263 rb.PushIpcInterface<IPurchaseEventManager>(system);
264}
265
266void AOC_U::CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
267 LOG_WARNING(Service_AOC, "(STUBBED) called");
268
269 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
270 rb.Push(RESULT_SUCCESS);
271 rb.PushIpcInterface<IPurchaseEventManager>(system);
272}
273
204void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) { 274void InstallInterfaces(SM::ServiceManager& service_manager, Core::System& system) {
205 std::make_shared<AOC_U>(system)->InstallAsService(service_manager); 275 std::make_shared<AOC_U>(system)->InstallAsService(service_manager);
206} 276}
diff --git a/src/core/hle/service/aoc/aoc_u.h b/src/core/hle/service/aoc/aoc_u.h
index 7628f4568..26ee51be0 100644
--- a/src/core/hle/service/aoc/aoc_u.h
+++ b/src/core/hle/service/aoc/aoc_u.h
@@ -27,6 +27,8 @@ private:
27 void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx); 27 void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx);
28 void PrepareAddOnContent(Kernel::HLERequestContext& ctx); 28 void PrepareAddOnContent(Kernel::HLERequestContext& ctx);
29 void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx); 29 void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx);
30 void CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
31 void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
30 32
31 std::vector<u64> add_on_content; 33 std::vector<u64> add_on_content;
32 Kernel::EventPair aoc_change_event; 34 Kernel::EventPair aoc_change_event;
diff --git a/src/core/hle/service/apm/controller.cpp b/src/core/hle/service/apm/controller.cpp
index ce993bad3..03636642b 100644
--- a/src/core/hle/service/apm/controller.cpp
+++ b/src/core/hle/service/apm/controller.cpp
@@ -48,8 +48,7 @@ void Controller::SetPerformanceConfiguration(PerformanceMode mode,
48 [config](const auto& entry) { return entry.first == config; }); 48 [config](const auto& entry) { return entry.first == config; });
49 49
50 if (iter == config_to_speed.cend()) { 50 if (iter == config_to_speed.cend()) {
51 LOG_ERROR(Service_APM, "Invalid performance configuration value provided: {}", 51 LOG_ERROR(Service_APM, "Invalid performance configuration value provided: {}", config);
52 static_cast<u32>(config));
53 return; 52 return;
54 } 53 }
55 54
diff --git a/src/core/hle/service/apm/interface.cpp b/src/core/hle/service/apm/interface.cpp
index 89442e21e..298f6d520 100644
--- a/src/core/hle/service/apm/interface.cpp
+++ b/src/core/hle/service/apm/interface.cpp
@@ -28,8 +28,7 @@ private:
28 28
29 const auto mode = rp.PopEnum<PerformanceMode>(); 29 const auto mode = rp.PopEnum<PerformanceMode>();
30 const auto config = rp.PopEnum<PerformanceConfiguration>(); 30 const auto config = rp.PopEnum<PerformanceConfiguration>();
31 LOG_DEBUG(Service_APM, "called mode={} config={}", static_cast<u32>(mode), 31 LOG_DEBUG(Service_APM, "called mode={} config={}", mode, config);
32 static_cast<u32>(config));
33 32
34 controller.SetPerformanceConfiguration(mode, config); 33 controller.SetPerformanceConfiguration(mode, config);
35 34
@@ -41,7 +40,7 @@ private:
41 IPC::RequestParser rp{ctx}; 40 IPC::RequestParser rp{ctx};
42 41
43 const auto mode = rp.PopEnum<PerformanceMode>(); 42 const auto mode = rp.PopEnum<PerformanceMode>();
44 LOG_DEBUG(Service_APM, "called mode={}", static_cast<u32>(mode)); 43 LOG_DEBUG(Service_APM, "called mode={}", mode);
45 44
46 IPC::ResponseBuilder rb{ctx, 3}; 45 IPC::ResponseBuilder rb{ctx, 3};
47 rb.Push(RESULT_SUCCESS); 46 rb.Push(RESULT_SUCCESS);
@@ -111,7 +110,7 @@ void APM_Sys::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
111 IPC::RequestParser rp{ctx}; 110 IPC::RequestParser rp{ctx};
112 const auto mode = rp.PopEnum<CpuBoostMode>(); 111 const auto mode = rp.PopEnum<CpuBoostMode>();
113 112
114 LOG_DEBUG(Service_APM, "called, mode={:08X}", static_cast<u32>(mode)); 113 LOG_DEBUG(Service_APM, "called, mode={:08X}", mode);
115 114
116 controller.SetFromCpuBoostMode(mode); 115 controller.SetFromCpuBoostMode(mode);
117 116
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp
index 3b6f7498e..e43f3f47f 100644
--- a/src/core/hle/service/bcat/backend/boxcat.cpp
+++ b/src/core/hle/service/bcat/backend/boxcat.cpp
@@ -483,7 +483,7 @@ Boxcat::StatusResult Boxcat::GetStatus(std::optional<std::string>& global,
483 global = json["global"].get<std::string>(); 483 global = json["global"].get<std::string>();
484 484
485 if (json["games"].is_array()) { 485 if (json["games"].is_array()) {
486 for (const auto object : json["games"]) { 486 for (const auto& object : json["games"]) {
487 if (object.is_object() && object.find("name") != object.end()) { 487 if (object.is_object() && object.find("name") != object.end()) {
488 EventStatus detail{}; 488 EventStatus detail{};
489 if (object["header"].is_string()) { 489 if (object["header"].is_string()) {
diff --git a/src/core/hle/service/fatal/fatal.cpp b/src/core/hle/service/fatal/fatal.cpp
index 9b7672a91..13147472e 100644
--- a/src/core/hle/service/fatal/fatal.cpp
+++ b/src/core/hle/service/fatal/fatal.cpp
@@ -111,8 +111,9 @@ static void GenerateErrorReport(Core::System& system, ResultCode error_code,
111 111
112static void ThrowFatalError(Core::System& system, ResultCode error_code, FatalType fatal_type, 112static void ThrowFatalError(Core::System& system, ResultCode error_code, FatalType fatal_type,
113 const FatalInfo& info) { 113 const FatalInfo& info) {
114 LOG_ERROR(Service_Fatal, "Threw fatal error type {} with error code 0x{:X}", 114 LOG_ERROR(Service_Fatal, "Threw fatal error type {} with error code 0x{:X}", fatal_type,
115 static_cast<u32>(fatal_type), error_code.raw); 115 error_code.raw);
116
116 switch (fatal_type) { 117 switch (fatal_type) {
117 case FatalType::ErrorReportAndScreen: 118 case FatalType::ErrorReportAndScreen:
118 GenerateErrorReport(system, error_code, info); 119 GenerateErrorReport(system, error_code, info);
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index ca93062cf..b15c737e1 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -298,10 +298,35 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFSCurrentProcess()
298 return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID()); 298 return romfs_factory->OpenCurrentProcess(system.CurrentProcess()->GetTitleID());
299} 299}
300 300
301ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFS(
302 u64 title_id, FileSys::ContentRecordType type) const {
303 LOG_TRACE(Service_FS, "Opening patched RomFS for title_id={:016X}", title_id);
304
305 if (romfs_factory == nullptr) {
306 // TODO: Find a better error code for this
307 return RESULT_UNKNOWN;
308 }
309
310 return romfs_factory->OpenPatchedRomFS(title_id, type);
311}
312
313ResultVal<FileSys::VirtualFile> FileSystemController::OpenPatchedRomFSWithProgramIndex(
314 u64 title_id, u8 program_index, FileSys::ContentRecordType type) const {
315 LOG_TRACE(Service_FS, "Opening patched RomFS for title_id={:016X}, program_index={}", title_id,
316 program_index);
317
318 if (romfs_factory == nullptr) {
319 // TODO: Find a better error code for this
320 return RESULT_UNKNOWN;
321 }
322
323 return romfs_factory->OpenPatchedRomFSWithProgramIndex(title_id, program_index, type);
324}
325
301ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS( 326ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(
302 u64 title_id, FileSys::StorageId storage_id, FileSys::ContentRecordType type) const { 327 u64 title_id, FileSys::StorageId storage_id, FileSys::ContentRecordType type) const {
303 LOG_TRACE(Service_FS, "Opening RomFS for title_id={:016X}, storage_id={:02X}, type={:02X}", 328 LOG_TRACE(Service_FS, "Opening RomFS for title_id={:016X}, storage_id={:02X}, type={:02X}",
304 title_id, static_cast<u8>(storage_id), static_cast<u8>(type)); 329 title_id, storage_id, type);
305 330
306 if (romfs_factory == nullptr) { 331 if (romfs_factory == nullptr) {
307 // TODO(bunnei): Find a better error code for this 332 // TODO(bunnei): Find a better error code for this
@@ -313,8 +338,8 @@ ResultVal<FileSys::VirtualFile> FileSystemController::OpenRomFS(
313 338
314ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData( 339ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData(
315 FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& save_struct) const { 340 FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& save_struct) const {
316 LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", 341 LOG_TRACE(Service_FS, "Creating Save Data for space_id={:01X}, save_struct={}", space,
317 static_cast<u8>(space), save_struct.DebugInfo()); 342 save_struct.DebugInfo());
318 343
319 if (save_data_factory == nullptr) { 344 if (save_data_factory == nullptr) {
320 return FileSys::ERROR_ENTITY_NOT_FOUND; 345 return FileSys::ERROR_ENTITY_NOT_FOUND;
@@ -325,8 +350,8 @@ ResultVal<FileSys::VirtualDir> FileSystemController::CreateSaveData(
325 350
326ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData( 351ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData(
327 FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& attribute) const { 352 FileSys::SaveDataSpaceId space, const FileSys::SaveDataAttribute& attribute) const {
328 LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", 353 LOG_TRACE(Service_FS, "Opening Save Data for space_id={:01X}, save_struct={}", space,
329 static_cast<u8>(space), attribute.DebugInfo()); 354 attribute.DebugInfo());
330 355
331 if (save_data_factory == nullptr) { 356 if (save_data_factory == nullptr) {
332 return FileSys::ERROR_ENTITY_NOT_FOUND; 357 return FileSys::ERROR_ENTITY_NOT_FOUND;
@@ -337,7 +362,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveData(
337 362
338ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace( 363ResultVal<FileSys::VirtualDir> FileSystemController::OpenSaveDataSpace(
339 FileSys::SaveDataSpaceId space) const { 364 FileSys::SaveDataSpaceId space) const {
340 LOG_TRACE(Service_FS, "Opening Save Data Space for space_id={:01X}", static_cast<u8>(space)); 365 LOG_TRACE(Service_FS, "Opening Save Data Space for space_id={:01X}", space);
341 366
342 if (save_data_factory == nullptr) { 367 if (save_data_factory == nullptr) {
343 return FileSys::ERROR_ENTITY_NOT_FOUND; 368 return FileSys::ERROR_ENTITY_NOT_FOUND;
@@ -358,7 +383,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenSDMC() const {
358 383
359ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition( 384ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition(
360 FileSys::BisPartitionId id) const { 385 FileSys::BisPartitionId id) const {
361 LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", static_cast<u32>(id)); 386 LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", id);
362 387
363 if (bis_factory == nullptr) { 388 if (bis_factory == nullptr) {
364 return FileSys::ERROR_ENTITY_NOT_FOUND; 389 return FileSys::ERROR_ENTITY_NOT_FOUND;
@@ -374,7 +399,7 @@ ResultVal<FileSys::VirtualDir> FileSystemController::OpenBISPartition(
374 399
375ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage( 400ResultVal<FileSys::VirtualFile> FileSystemController::OpenBISPartitionStorage(
376 FileSys::BisPartitionId id) const { 401 FileSys::BisPartitionId id) const {
377 LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", static_cast<u32>(id)); 402 LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", id);
378 403
379 if (bis_factory == nullptr) { 404 if (bis_factory == nullptr) {
380 return FileSys::ERROR_ENTITY_NOT_FOUND; 405 return FileSys::ERROR_ENTITY_NOT_FOUND;
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h
index 6dbbf0b2b..7102d3f9a 100644
--- a/src/core/hle/service/filesystem/filesystem.h
+++ b/src/core/hle/service/filesystem/filesystem.h
@@ -66,6 +66,10 @@ public:
66 66
67 void SetPackedUpdate(FileSys::VirtualFile update_raw); 67 void SetPackedUpdate(FileSys::VirtualFile update_raw);
68 ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess() const; 68 ResultVal<FileSys::VirtualFile> OpenRomFSCurrentProcess() const;
69 ResultVal<FileSys::VirtualFile> OpenPatchedRomFS(u64 title_id,
70 FileSys::ContentRecordType type) const;
71 ResultVal<FileSys::VirtualFile> OpenPatchedRomFSWithProgramIndex(
72 u64 title_id, u8 program_index, FileSys::ContentRecordType type) const;
69 ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id, 73 ResultVal<FileSys::VirtualFile> OpenRomFS(u64 title_id, FileSys::StorageId storage_id,
70 FileSys::ContentRecordType type) const; 74 FileSys::ContentRecordType type) const;
71 ResultVal<FileSys::VirtualDir> CreateSaveData( 75 ResultVal<FileSys::VirtualDir> CreateSaveData(
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index b3480494c..9cc260515 100644
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -413,7 +413,7 @@ public:
413 413
414 const auto mode = static_cast<FileSys::Mode>(rp.Pop<u32>()); 414 const auto mode = static_cast<FileSys::Mode>(rp.Pop<u32>());
415 415
416 LOG_DEBUG(Service_FS, "called. file={}, mode={}", name, static_cast<u32>(mode)); 416 LOG_DEBUG(Service_FS, "called. file={}, mode={}", name, mode);
417 417
418 auto result = backend.OpenFile(name, mode); 418 auto result = backend.OpenFile(name, mode);
419 if (result.Failed()) { 419 if (result.Failed()) {
@@ -553,8 +553,7 @@ private:
553 const auto save_root = fsc.OpenSaveDataSpace(space); 553 const auto save_root = fsc.OpenSaveDataSpace(space);
554 554
555 if (save_root.Failed() || *save_root == nullptr) { 555 if (save_root.Failed() || *save_root == nullptr) {
556 LOG_ERROR(Service_FS, "The save root for the space_id={:02X} was invalid!", 556 LOG_ERROR(Service_FS, "The save root for the space_id={:02X} was invalid!", space);
557 static_cast<u8>(space));
558 return; 557 return;
559 } 558 }
560 559
@@ -718,7 +717,7 @@ FSP_SRV::FSP_SRV(Core::System& system_)
718 {202, &FSP_SRV::OpenDataStorageByDataId, "OpenDataStorageByDataId"}, 717 {202, &FSP_SRV::OpenDataStorageByDataId, "OpenDataStorageByDataId"},
719 {203, &FSP_SRV::OpenPatchDataStorageByCurrentProcess, "OpenPatchDataStorageByCurrentProcess"}, 718 {203, &FSP_SRV::OpenPatchDataStorageByCurrentProcess, "OpenPatchDataStorageByCurrentProcess"},
720 {204, nullptr, "OpenDataFileSystemByProgramIndex"}, 719 {204, nullptr, "OpenDataFileSystemByProgramIndex"},
721 {205, nullptr, "OpenDataStorageByProgramIndex"}, 720 {205, &FSP_SRV::OpenDataStorageWithProgramIndex, "OpenDataStorageWithProgramIndex"},
722 {400, nullptr, "OpenDeviceOperator"}, 721 {400, nullptr, "OpenDeviceOperator"},
723 {500, nullptr, "OpenSdCardDetectionEventNotifier"}, 722 {500, nullptr, "OpenSdCardDetectionEventNotifier"},
724 {501, nullptr, "OpenGameCardDetectionEventNotifier"}, 723 {501, nullptr, "OpenGameCardDetectionEventNotifier"},
@@ -795,8 +794,7 @@ void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
795 794
796 const auto type = rp.PopRaw<FileSystemType>(); 795 const auto type = rp.PopRaw<FileSystemType>();
797 const auto title_id = rp.PopRaw<u64>(); 796 const auto title_id = rp.PopRaw<u64>();
798 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", 797 LOG_WARNING(Service_FS, "(STUBBED) called with type={}, title_id={:016X}", type, title_id);
799 static_cast<u8>(type), title_id);
800 798
801 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 799 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
802 rb.Push(RESULT_UNKNOWN); 800 rb.Push(RESULT_UNKNOWN);
@@ -883,7 +881,7 @@ void FSP_SRV::OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx) {
883void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx) { 881void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx) {
884 IPC::RequestParser rp{ctx}; 882 IPC::RequestParser rp{ctx};
885 const auto space = rp.PopRaw<FileSys::SaveDataSpaceId>(); 883 const auto space = rp.PopRaw<FileSys::SaveDataSpaceId>();
886 LOG_INFO(Service_FS, "called, space={}", static_cast<u8>(space)); 884 LOG_INFO(Service_FS, "called, space={}", space);
887 885
888 IPC::ResponseBuilder rb{ctx, 2, 0, 1}; 886 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
889 rb.Push(RESULT_SUCCESS); 887 rb.Push(RESULT_SUCCESS);
@@ -915,10 +913,10 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
915 "(STUBBED) called, flags={}, space_id={}, attribute.title_id={:016X}\n" 913 "(STUBBED) called, flags={}, space_id={}, attribute.title_id={:016X}\n"
916 "attribute.user_id={:016X}{:016X}, attribute.save_id={:016X}\n" 914 "attribute.user_id={:016X}{:016X}, attribute.save_id={:016X}\n"
917 "attribute.type={}, attribute.rank={}, attribute.index={}", 915 "attribute.type={}, attribute.rank={}, attribute.index={}",
918 flags, static_cast<u32>(parameters.space_id), parameters.attribute.title_id, 916 flags, parameters.space_id, parameters.attribute.title_id,
919 parameters.attribute.user_id[1], parameters.attribute.user_id[0], 917 parameters.attribute.user_id[1], parameters.attribute.user_id[0],
920 parameters.attribute.save_id, static_cast<u32>(parameters.attribute.type), 918 parameters.attribute.save_id, parameters.attribute.type, parameters.attribute.rank,
921 static_cast<u32>(parameters.attribute.rank), parameters.attribute.index); 919 parameters.attribute.index);
922 920
923 IPC::ResponseBuilder rb{ctx, 3}; 921 IPC::ResponseBuilder rb{ctx, 3};
924 rb.Push(RESULT_SUCCESS); 922 rb.Push(RESULT_SUCCESS);
@@ -951,7 +949,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
951 const auto title_id = rp.PopRaw<u64>(); 949 const auto title_id = rp.PopRaw<u64>();
952 950
953 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, unknown={:08X}, title_id={:016X}", 951 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, unknown={:08X}, title_id={:016X}",
954 static_cast<u8>(storage_id), unknown, title_id); 952 storage_id, unknown, title_id);
955 953
956 auto data = fsc.OpenRomFS(title_id, storage_id, FileSys::ContentRecordType::Data); 954 auto data = fsc.OpenRomFS(title_id, storage_id, FileSys::ContentRecordType::Data);
957 955
@@ -968,7 +966,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
968 // TODO(DarkLordZach): Find the right error code to use here 966 // TODO(DarkLordZach): Find the right error code to use here
969 LOG_ERROR(Service_FS, 967 LOG_ERROR(Service_FS,
970 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id, 968 "could not open data storage with title_id={:016X}, storage_id={:02X}", title_id,
971 static_cast<u8>(storage_id)); 969 storage_id);
972 IPC::ResponseBuilder rb{ctx, 2}; 970 IPC::ResponseBuilder rb{ctx, 2};
973 rb.Push(RESULT_UNKNOWN); 971 rb.Push(RESULT_UNKNOWN);
974 return; 972 return;
@@ -987,21 +985,46 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
987void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) { 985void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
988 IPC::RequestParser rp{ctx}; 986 IPC::RequestParser rp{ctx};
989 987
990 auto storage_id = rp.PopRaw<FileSys::StorageId>(); 988 const auto storage_id = rp.PopRaw<FileSys::StorageId>();
991 auto title_id = rp.PopRaw<u64>(); 989 const auto title_id = rp.PopRaw<u64>();
992 990
993 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, title_id={:016X}", 991 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, title_id={:016X}", storage_id, title_id);
994 static_cast<u8>(storage_id), title_id);
995 992
996 IPC::ResponseBuilder rb{ctx, 2}; 993 IPC::ResponseBuilder rb{ctx, 2};
997 rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); 994 rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND);
998} 995}
999 996
997void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
998 IPC::RequestParser rp{ctx};
999
1000 const auto program_index = rp.PopRaw<u8>();
1001
1002 LOG_DEBUG(Service_FS, "called, program_index={}", program_index);
1003
1004 auto romfs = fsc.OpenPatchedRomFSWithProgramIndex(
1005 system.CurrentProcess()->GetTitleID(), program_index, FileSys::ContentRecordType::Program);
1006
1007 if (romfs.Failed()) {
1008 // TODO: Find the right error code to use here
1009 LOG_ERROR(Service_FS, "could not open storage with program_index={}", program_index);
1010
1011 IPC::ResponseBuilder rb{ctx, 2};
1012 rb.Push(RESULT_UNKNOWN);
1013 return;
1014 }
1015
1016 auto storage = std::make_shared<IStorage>(system, std::move(romfs.Unwrap()));
1017
1018 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
1019 rb.Push(RESULT_SUCCESS);
1020 rb.PushIpcInterface<IStorage>(std::move(storage));
1021}
1022
1000void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) { 1023void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
1001 IPC::RequestParser rp{ctx}; 1024 IPC::RequestParser rp{ctx};
1002 log_mode = rp.PopEnum<LogMode>(); 1025 log_mode = rp.PopEnum<LogMode>();
1003 1026
1004 LOG_DEBUG(Service_FS, "called, log_mode={:08X}", static_cast<u32>(log_mode)); 1027 LOG_DEBUG(Service_FS, "called, log_mode={:08X}", log_mode);
1005 1028
1006 IPC::ResponseBuilder rb{ctx, 2}; 1029 IPC::ResponseBuilder rb{ctx, 2};
1007 rb.Push(RESULT_SUCCESS); 1030 rb.Push(RESULT_SUCCESS);
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h
index 472286d6e..8ed933279 100644
--- a/src/core/hle/service/filesystem/fsp_srv.h
+++ b/src/core/hle/service/filesystem/fsp_srv.h
@@ -49,6 +49,7 @@ private:
49 void OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); 49 void OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx);
50 void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx); 50 void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx);
51 void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx); 51 void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx);
52 void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx);
52 void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); 53 void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
53 void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx); 54 void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
54 void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx); 55 void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx);
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp
index 40a289594..c5b053c31 100644
--- a/src/core/hle/service/friend/friend.cpp
+++ b/src/core/hle/service/friend/friend.cpp
@@ -229,8 +229,7 @@ private:
229 break; 229 break;
230 default: 230 default:
231 // HOS seems not have an error case for an unknown notification 231 // HOS seems not have an error case for an unknown notification
232 LOG_WARNING(Service_ACC, "Unknown notification {:08X}", 232 LOG_WARNING(Service_ACC, "Unknown notification {:08X}", notification.notification_type);
233 static_cast<u32>(notification.notification_type));
234 break; 233 break;
235 } 234 }
236 235
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 66c4fe60a..f6a0770bf 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -116,6 +116,31 @@ u32 Controller_NPad::IndexToNPad(std::size_t index) {
116 } 116 }
117} 117}
118 118
119bool Controller_NPad::IsNpadIdValid(u32 npad_id) {
120 switch (npad_id) {
121 case 0:
122 case 1:
123 case 2:
124 case 3:
125 case 4:
126 case 5:
127 case 6:
128 case 7:
129 case NPAD_UNKNOWN:
130 case NPAD_HANDHELD:
131 return true;
132 default:
133 LOG_ERROR(Service_HID, "Invalid npad id {}", npad_id);
134 return false;
135 }
136}
137
138bool Controller_NPad::IsDeviceHandleValid(const DeviceHandle& device_handle) {
139 return IsNpadIdValid(device_handle.npad_id) &&
140 device_handle.npad_type < NpadType::MaxNpadType &&
141 device_handle.device_index < DeviceIndex::MaxDeviceIndex;
142}
143
119Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {} 144Controller_NPad::Controller_NPad(Core::System& system) : ControllerBase(system), system(system) {}
120 145
121Controller_NPad::~Controller_NPad() { 146Controller_NPad::~Controller_NPad() {
@@ -742,6 +767,10 @@ bool Controller_NPad::VibrateControllerAtIndex(std::size_t npad_index, std::size
742 767
743void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_handle, 768void Controller_NPad::VibrateController(const DeviceHandle& vibration_device_handle,
744 const VibrationValue& vibration_value) { 769 const VibrationValue& vibration_value) {
770 if (!IsDeviceHandleValid(vibration_device_handle)) {
771 return;
772 }
773
745 if (!Settings::values.vibration_enabled.GetValue() && !permit_vibration_session_enabled) { 774 if (!Settings::values.vibration_enabled.GetValue() && !permit_vibration_session_enabled) {
746 return; 775 return;
747 } 776 }
@@ -798,12 +827,20 @@ void Controller_NPad::VibrateControllers(const std::vector<DeviceHandle>& vibrat
798 827
799Controller_NPad::VibrationValue Controller_NPad::GetLastVibration( 828Controller_NPad::VibrationValue Controller_NPad::GetLastVibration(
800 const DeviceHandle& vibration_device_handle) const { 829 const DeviceHandle& vibration_device_handle) const {
830 if (!IsDeviceHandleValid(vibration_device_handle)) {
831 return {};
832 }
833
801 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id); 834 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id);
802 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index); 835 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
803 return latest_vibration_values[npad_index][device_index]; 836 return latest_vibration_values[npad_index][device_index];
804} 837}
805 838
806void Controller_NPad::InitializeVibrationDevice(const DeviceHandle& vibration_device_handle) { 839void Controller_NPad::InitializeVibrationDevice(const DeviceHandle& vibration_device_handle) {
840 if (!IsDeviceHandleValid(vibration_device_handle)) {
841 return;
842 }
843
807 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id); 844 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id);
808 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index); 845 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
809 InitializeVibrationDeviceAtIndex(npad_index, device_index); 846 InitializeVibrationDeviceAtIndex(npad_index, device_index);
@@ -824,6 +861,10 @@ void Controller_NPad::SetPermitVibrationSession(bool permit_vibration_session) {
824} 861}
825 862
826bool Controller_NPad::IsVibrationDeviceMounted(const DeviceHandle& vibration_device_handle) const { 863bool Controller_NPad::IsVibrationDeviceMounted(const DeviceHandle& vibration_device_handle) const {
864 if (!IsDeviceHandleValid(vibration_device_handle)) {
865 return false;
866 }
867
827 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id); 868 const auto npad_index = NPadIdToIndex(vibration_device_handle.npad_id);
828 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index); 869 const auto device_index = static_cast<std::size_t>(vibration_device_handle.device_index);
829 return vibration_devices_mounted[npad_index][device_index]; 870 return vibration_devices_mounted[npad_index][device_index];
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 96f319294..9fac00231 100644
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -56,12 +56,14 @@ public:
56 JoyconLeft = 6, 56 JoyconLeft = 6,
57 JoyconRight = 7, 57 JoyconRight = 7,
58 Pokeball = 9, 58 Pokeball = 9,
59 MaxNpadType = 10,
59 }; 60 };
60 61
61 enum class DeviceIndex : u8 { 62 enum class DeviceIndex : u8 {
62 Left = 0, 63 Left = 0,
63 Right = 1, 64 Right = 1,
64 None = 2, 65 None = 2,
66 MaxDeviceIndex = 3,
65 }; 67 };
66 68
67 enum class GyroscopeZeroDriftMode : u32 { 69 enum class GyroscopeZeroDriftMode : u32 {
@@ -213,6 +215,8 @@ public:
213 static Settings::ControllerType MapNPadToSettingsType(Controller_NPad::NPadControllerType type); 215 static Settings::ControllerType MapNPadToSettingsType(Controller_NPad::NPadControllerType type);
214 static std::size_t NPadIdToIndex(u32 npad_id); 216 static std::size_t NPadIdToIndex(u32 npad_id);
215 static u32 IndexToNPad(std::size_t index); 217 static u32 IndexToNPad(std::size_t index);
218 static bool IsNpadIdValid(u32 npad_id);
219 static bool IsDeviceHandleValid(const DeviceHandle& device_handle);
216 220
217private: 221private:
218 struct CommonHeader { 222 struct CommonHeader {
diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp
index f884b2735..8e49b068c 100644
--- a/src/core/hle/service/lm/lm.cpp
+++ b/src/core/hle/service/lm/lm.cpp
@@ -68,7 +68,7 @@ private:
68 IPC::RequestParser rp{ctx}; 68 IPC::RequestParser rp{ctx};
69 const auto destination = rp.PopEnum<DestinationFlag>(); 69 const auto destination = rp.PopEnum<DestinationFlag>();
70 70
71 LOG_DEBUG(Service_LM, "called, destination={:08X}", static_cast<u32>(destination)); 71 LOG_DEBUG(Service_LM, "called, destination={:08X}", destination);
72 72
73 manager.SetDestination(destination); 73 manager.SetDestination(destination);
74 74
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp
index b8d627ca8..2dcda16f6 100644
--- a/src/core/hle/service/ncm/ncm.cpp
+++ b/src/core/hle/service/ncm/ncm.cpp
@@ -45,7 +45,7 @@ public:
45 } 45 }
46 46
47private: 47private:
48 FileSys::StorageId storage; 48 [[maybe_unused]] FileSys::StorageId storage;
49}; 49};
50 50
51class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> { 51class IRegisteredLocationResolver final : public ServiceFramework<IRegisteredLocationResolver> {
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp
index d33b26129..d16223064 100644
--- a/src/core/hle/service/nim/nim.cpp
+++ b/src/core/hle/service/nim/nim.cpp
@@ -217,7 +217,7 @@ public:
217 {1, nullptr, "RefreshDebugAvailability"}, 217 {1, nullptr, "RefreshDebugAvailability"},
218 {2, nullptr, "ClearDebugResponse"}, 218 {2, nullptr, "ClearDebugResponse"},
219 {3, nullptr, "RegisterDebugResponse"}, 219 {3, nullptr, "RegisterDebugResponse"},
220 {4, nullptr, "IsLargeResourceAvailable"}, 220 {4, &NIM_ECA::IsLargeResourceAvailable, "IsLargeResourceAvailable"},
221 }; 221 };
222 // clang-format on 222 // clang-format on
223 223
@@ -231,6 +231,18 @@ private:
231 rb.Push(RESULT_SUCCESS); 231 rb.Push(RESULT_SUCCESS);
232 rb.PushIpcInterface<IShopServiceAccessServer>(system); 232 rb.PushIpcInterface<IShopServiceAccessServer>(system);
233 } 233 }
234
235 void IsLargeResourceAvailable(Kernel::HLERequestContext& ctx) {
236 IPC::RequestParser rp{ctx};
237
238 const auto unknown{rp.Pop<u64>()};
239
240 LOG_INFO(Service_NIM, "(STUBBED) called, unknown={}", unknown);
241
242 IPC::ResponseBuilder rb{ctx, 3};
243 rb.Push(RESULT_SUCCESS);
244 rb.Push(false);
245 }
234}; 246};
235 247
236class NIM_SHP final : public ServiceFramework<NIM_SHP> { 248class NIM_SHP final : public ServiceFramework<NIM_SHP> {
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp
index ccc137e40..c8a215845 100644
--- a/src/core/hle/service/ns/pl_u.cpp
+++ b/src/core/hle/service/ns/pl_u.cpp
@@ -182,21 +182,18 @@ PL_U::PL_U(Core::System& system_)
182 } 182 }
183 183
184 if (!romfs) { 184 if (!romfs) {
185 LOG_ERROR(Service_NS, "Failed to find or synthesize {:016X}! Skipping", 185 LOG_ERROR(Service_NS, "Failed to find or synthesize {:016X}! Skipping", font.first);
186 static_cast<u64>(font.first));
187 continue; 186 continue;
188 } 187 }
189 188
190 const auto extracted_romfs = FileSys::ExtractRomFS(romfs); 189 const auto extracted_romfs = FileSys::ExtractRomFS(romfs);
191 if (!extracted_romfs) { 190 if (!extracted_romfs) {
192 LOG_ERROR(Service_NS, "Failed to extract RomFS for {:016X}! Skipping", 191 LOG_ERROR(Service_NS, "Failed to extract RomFS for {:016X}! Skipping", font.first);
193 static_cast<u64>(font.first));
194 continue; 192 continue;
195 } 193 }
196 const auto font_fp = extracted_romfs->GetFile(font.second); 194 const auto font_fp = extracted_romfs->GetFile(font.second);
197 if (!font_fp) { 195 if (!font_fp) {
198 LOG_ERROR(Service_NS, "{:016X} has no file \"{}\"! Skipping", 196 LOG_ERROR(Service_NS, "{:016X} has no file \"{}\"! Skipping", font.first, font.second);
199 static_cast<u64>(font.first), font.second);
200 continue; 197 continue;
201 } 198 }
202 std::vector<u32> font_data_u32(font_fp->GetSize() / sizeof(u32)); 199 std::vector<u32> font_data_u32(font_fp->GetSize() / sizeof(u32));
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h
index ab152bf0e..d9f95ba58 100644
--- a/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h
+++ b/src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.h
@@ -18,39 +18,6 @@ public:
18 explicit nvhost_nvdec_common(Core::System& system, std::shared_ptr<nvmap> nvmap_dev); 18 explicit nvhost_nvdec_common(Core::System& system, std::shared_ptr<nvmap> nvmap_dev);
19 ~nvhost_nvdec_common() override; 19 ~nvhost_nvdec_common() override;
20 20
21 /**
22 * Handles an ioctl1 request.
23 * @param command The ioctl command id.
24 * @param input A buffer containing the input data for the ioctl.
25 * @param output A buffer where the output data will be written to.
26 * @returns The result code of the ioctl.
27 */
28 virtual NvResult Ioctl1(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output,
29 IoctlCtrl& ctrl) = 0;
30
31 /**
32 * Handles an ioctl2 request.
33 * @param command The ioctl command id.
34 * @param input A buffer containing the input data for the ioctl.
35 * @param inline_input A buffer containing the input data for the ioctl which has been inlined.
36 * @param output A buffer where the output data will be written to.
37 * @returns The result code of the ioctl.
38 */
39 virtual NvResult Ioctl2(Ioctl command, const std::vector<u8>& input,
40 const std::vector<u8>& inline_input, std::vector<u8>& output,
41 IoctlCtrl& ctrl) = 0;
42
43 /**
44 * Handles an ioctl3 request.
45 * @param command The ioctl command id.
46 * @param input A buffer containing the input data for the ioctl.
47 * @param output A buffer where the output data will be written to.
48 * @param inline_output A buffer where the inlined output data will be written to.
49 * @returns The result code of the ioctl.
50 */
51 virtual NvResult Ioctl3(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output,
52 std::vector<u8>& inline_output, IoctlCtrl& ctrl) = 0;
53
54protected: 21protected:
55 class BufferMap final { 22 class BufferMap final {
56 public: 23 public:
diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index b89a2d41b..377f47e8e 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -22,10 +22,11 @@ BufferQueue::BufferQueue(Kernel::KernelCore& kernel, u32 id, u64 layer_id)
22BufferQueue::~BufferQueue() = default; 22BufferQueue::~BufferQueue() = default;
23 23
24void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) { 24void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer) {
25 ASSERT(slot < buffer_slots);
25 LOG_WARNING(Service, "Adding graphics buffer {}", slot); 26 LOG_WARNING(Service, "Adding graphics buffer {}", slot);
26 27
27 free_buffers.push_back(slot); 28 free_buffers.push_back(slot);
28 queue.push_back({ 29 buffers[slot] = {
29 .slot = slot, 30 .slot = slot,
30 .status = Buffer::Status::Free, 31 .status = Buffer::Status::Free,
31 .igbp_buffer = igbp_buffer, 32 .igbp_buffer = igbp_buffer,
@@ -33,7 +34,7 @@ void BufferQueue::SetPreallocatedBuffer(u32 slot, const IGBPBuffer& igbp_buffer)
33 .crop_rect = {}, 34 .crop_rect = {},
34 .swap_interval = 0, 35 .swap_interval = 0,
35 .multi_fence = {}, 36 .multi_fence = {},
36 }); 37 };
37 38
38 buffer_wait_event.writable->Signal(); 39 buffer_wait_event.writable->Signal();
39} 40}
@@ -44,73 +45,57 @@ std::optional<std::pair<u32, Service::Nvidia::MultiFence*>> BufferQueue::Dequeue
44 if (free_buffers.empty()) { 45 if (free_buffers.empty()) {
45 return std::nullopt; 46 return std::nullopt;
46 } 47 }
47
48 auto f_itr = free_buffers.begin(); 48 auto f_itr = free_buffers.begin();
49 auto itr = queue.end(); 49 auto slot = buffers.size();
50 50
51 while (f_itr != free_buffers.end()) { 51 while (f_itr != free_buffers.end()) {
52 auto slot = *f_itr; 52 const Buffer& buffer = buffers[*f_itr];
53 itr = std::find_if(queue.begin(), queue.end(), [&](const Buffer& buffer) { 53 if (buffer.status == Buffer::Status::Free && buffer.igbp_buffer.width == width &&
54 // Only consider free buffers. Buffers become free once again after they've been 54 buffer.igbp_buffer.height == height) {
55 // Acquired and Released by the compositor, see the NVFlinger::Compose method. 55 slot = *f_itr;
56 if (buffer.status != Buffer::Status::Free) {
57 return false;
58 }
59
60 if (buffer.slot != slot) {
61 return false;
62 }
63
64 // Make sure that the parameters match.
65 return buffer.igbp_buffer.width == width && buffer.igbp_buffer.height == height;
66 });
67
68 if (itr != queue.end()) {
69 free_buffers.erase(f_itr); 56 free_buffers.erase(f_itr);
70 break; 57 break;
71 } 58 }
72 ++f_itr; 59 ++f_itr;
73 } 60 }
74 61 if (slot == buffers.size()) {
75 if (itr == queue.end()) {
76 return std::nullopt; 62 return std::nullopt;
77 } 63 }
78 64 buffers[slot].status = Buffer::Status::Dequeued;
79 itr->status = Buffer::Status::Dequeued; 65 return {{buffers[slot].slot, &buffers[slot].multi_fence}};
80 return {{itr->slot, &itr->multi_fence}};
81} 66}
82 67
83const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const { 68const IGBPBuffer& BufferQueue::RequestBuffer(u32 slot) const {
84 auto itr = std::find_if(queue.begin(), queue.end(), 69 ASSERT(slot < buffers.size());
85 [&](const Buffer& buffer) { return buffer.slot == slot; }); 70 ASSERT(buffers[slot].status == Buffer::Status::Dequeued);
86 ASSERT(itr != queue.end()); 71 ASSERT(buffers[slot].slot == slot);
87 ASSERT(itr->status == Buffer::Status::Dequeued); 72
88 return itr->igbp_buffer; 73 return buffers[slot].igbp_buffer;
89} 74}
90 75
91void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform, 76void BufferQueue::QueueBuffer(u32 slot, BufferTransformFlags transform,
92 const Common::Rectangle<int>& crop_rect, u32 swap_interval, 77 const Common::Rectangle<int>& crop_rect, u32 swap_interval,
93 Service::Nvidia::MultiFence& multi_fence) { 78 Service::Nvidia::MultiFence& multi_fence) {
94 auto itr = std::find_if(queue.begin(), queue.end(), 79 ASSERT(slot < buffers.size());
95 [&](const Buffer& buffer) { return buffer.slot == slot; }); 80 ASSERT(buffers[slot].status == Buffer::Status::Dequeued);
96 ASSERT(itr != queue.end()); 81 ASSERT(buffers[slot].slot == slot);
97 ASSERT(itr->status == Buffer::Status::Dequeued); 82
98 itr->status = Buffer::Status::Queued; 83 buffers[slot].status = Buffer::Status::Queued;
99 itr->transform = transform; 84 buffers[slot].transform = transform;
100 itr->crop_rect = crop_rect; 85 buffers[slot].crop_rect = crop_rect;
101 itr->swap_interval = swap_interval; 86 buffers[slot].swap_interval = swap_interval;
102 itr->multi_fence = multi_fence; 87 buffers[slot].multi_fence = multi_fence;
103 queue_sequence.push_back(slot); 88 queue_sequence.push_back(slot);
104} 89}
105 90
106void BufferQueue::CancelBuffer(u32 slot, const Service::Nvidia::MultiFence& multi_fence) { 91void BufferQueue::CancelBuffer(u32 slot, const Service::Nvidia::MultiFence& multi_fence) {
107 const auto itr = std::find_if(queue.begin(), queue.end(), 92 ASSERT(slot < buffers.size());
108 [slot](const Buffer& buffer) { return buffer.slot == slot; }); 93 ASSERT(buffers[slot].status != Buffer::Status::Free);
109 ASSERT(itr != queue.end()); 94 ASSERT(buffers[slot].slot == slot);
110 ASSERT(itr->status != Buffer::Status::Free); 95
111 itr->status = Buffer::Status::Free; 96 buffers[slot].status = Buffer::Status::Free;
112 itr->multi_fence = multi_fence; 97 buffers[slot].multi_fence = multi_fence;
113 itr->swap_interval = 0; 98 buffers[slot].swap_interval = 0;
114 99
115 free_buffers.push_back(slot); 100 free_buffers.push_back(slot);
116 101
@@ -118,42 +103,43 @@ void BufferQueue::CancelBuffer(u32 slot, const Service::Nvidia::MultiFence& mult
118} 103}
119 104
120std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() { 105std::optional<std::reference_wrapper<const BufferQueue::Buffer>> BufferQueue::AcquireBuffer() {
121 auto itr = queue.end(); 106 std::size_t buffer_slot = buffers.size();
122 // Iterate to find a queued buffer matching the requested slot. 107 // Iterate to find a queued buffer matching the requested slot.
123 while (itr == queue.end() && !queue_sequence.empty()) { 108 while (buffer_slot == buffers.size() && !queue_sequence.empty()) {
124 const u32 slot = queue_sequence.front(); 109 const auto slot = static_cast<std::size_t>(queue_sequence.front());
125 itr = std::find_if(queue.begin(), queue.end(), [&slot](const Buffer& buffer) { 110 ASSERT(slot < buffers.size());
126 return buffer.status == Buffer::Status::Queued && buffer.slot == slot; 111 if (buffers[slot].status == Buffer::Status::Queued) {
127 }); 112 ASSERT(buffers[slot].slot == slot);
113 buffer_slot = slot;
114 }
128 queue_sequence.pop_front(); 115 queue_sequence.pop_front();
129 } 116 }
130 if (itr == queue.end()) { 117 if (buffer_slot == buffers.size()) {
131 return std::nullopt; 118 return std::nullopt;
132 } 119 }
133 itr->status = Buffer::Status::Acquired; 120 buffers[buffer_slot].status = Buffer::Status::Acquired;
134 return *itr; 121 return {{buffers[buffer_slot]}};
135} 122}
136 123
137void BufferQueue::ReleaseBuffer(u32 slot) { 124void BufferQueue::ReleaseBuffer(u32 slot) {
138 auto itr = std::find_if(queue.begin(), queue.end(), 125 ASSERT(slot < buffers.size());
139 [&](const Buffer& buffer) { return buffer.slot == slot; }); 126 ASSERT(buffers[slot].status == Buffer::Status::Acquired);
140 ASSERT(itr != queue.end()); 127 ASSERT(buffers[slot].slot == slot);
141 ASSERT(itr->status == Buffer::Status::Acquired); 128
142 itr->status = Buffer::Status::Free; 129 buffers[slot].status = Buffer::Status::Free;
143 free_buffers.push_back(slot); 130 free_buffers.push_back(slot);
144 131
145 buffer_wait_event.writable->Signal(); 132 buffer_wait_event.writable->Signal();
146} 133}
147 134
148void BufferQueue::Disconnect() { 135void BufferQueue::Disconnect() {
149 queue.clear(); 136 buffers.fill({});
150 queue_sequence.clear(); 137 queue_sequence.clear();
151 id = 1; 138 buffer_wait_event.writable->Signal();
152 layer_id = 1;
153} 139}
154 140
155u32 BufferQueue::Query(QueryType type) { 141u32 BufferQueue::Query(QueryType type) {
156 LOG_WARNING(Service, "(STUBBED) called type={}", static_cast<u32>(type)); 142 LOG_WARNING(Service, "(STUBBED) called type={}", type);
157 143
158 switch (type) { 144 switch (type) {
159 case QueryType::NativeWindowFormat: 145 case QueryType::NativeWindowFormat:
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index e7517c7e1..e610923cb 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -21,6 +21,7 @@ class KernelCore;
21 21
22namespace Service::NVFlinger { 22namespace Service::NVFlinger {
23 23
24constexpr u32 buffer_slots = 0x40;
24struct IGBPBuffer { 25struct IGBPBuffer {
25 u32_le magic; 26 u32_le magic;
26 u32_le width; 27 u32_le width;
@@ -114,7 +115,7 @@ private:
114 u64 layer_id; 115 u64 layer_id;
115 116
116 std::list<u32> free_buffers; 117 std::list<u32> free_buffers;
117 std::vector<Buffer> queue; 118 std::array<Buffer, buffer_slots> buffers;
118 std::list<u32> queue_sequence; 119 std::list<u32> queue_sequence;
119 Kernel::EventPair buffer_wait_event; 120 Kernel::EventPair buffer_wait_event;
120}; 121};
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp
index 392fda73e..b417624c9 100644
--- a/src/core/hle/service/prepo/prepo.cpp
+++ b/src/core/hle/service/prepo/prepo.cpp
@@ -65,7 +65,7 @@ private:
65 } 65 }
66 66
67 LOG_DEBUG(Service_PREPO, "called, type={:02X}, process_id={:016X}, data1_size={:016X}", 67 LOG_DEBUG(Service_PREPO, "called, type={:02X}, process_id={:016X}, data1_size={:016X}",
68 static_cast<u8>(Type), process_id, data[0].size()); 68 Type, process_id, data[0].size());
69 69
70 const auto& reporter{system.GetReporter()}; 70 const auto& reporter{system.GetReporter()};
71 reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id); 71 reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id);
@@ -92,7 +92,7 @@ private:
92 LOG_DEBUG( 92 LOG_DEBUG(
93 Service_PREPO, 93 Service_PREPO,
94 "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}", 94 "called, type={:02X}, user_id={:016X}{:016X}, process_id={:016X}, data1_size={:016X}",
95 static_cast<u8>(Type), user_id[1], user_id[0], process_id, data[0].size()); 95 Type, user_id[1], user_id[0], process_id, data[0].size());
96 96
97 const auto& reporter{system.GetReporter()}; 97 const auto& reporter{system.GetReporter()};
98 reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id, 98 reporter.SavePlayReport(Type, system.CurrentProcess()->GetTitleID(), data, process_id,
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 360e0bf37..abf3d1ea3 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -181,7 +181,7 @@ ResultCode ServiceFrameworkBase::HandleSyncRequest(Kernel::HLERequestContext& co
181 break; 181 break;
182 } 182 }
183 default: 183 default:
184 UNIMPLEMENTED_MSG("command_type={}", static_cast<int>(context.GetCommandType())); 184 UNIMPLEMENTED_MSG("command_type={}", context.GetCommandType());
185 } 185 }
186 186
187 context.WriteToOutgoingCommandBuffer(context.GetThread()); 187 context.WriteToOutgoingCommandBuffer(context.GetThread());
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp
index 19b8f113d..b58b2c8c5 100644
--- a/src/core/hle/service/set/set_sys.cpp
+++ b/src/core/hle/service/set/set_sys.cpp
@@ -34,9 +34,9 @@ void GetFirmwareVersionImpl(Kernel::HLERequestContext& ctx, GetFirmwareVersionTy
34 // consistence (currently reports as 5.1.0-0.0) 34 // consistence (currently reports as 5.1.0-0.0)
35 const auto archive = FileSys::SystemArchive::SystemVersion(); 35 const auto archive = FileSys::SystemArchive::SystemVersion();
36 36
37 const auto early_exit_failure = [&ctx](const std::string& desc, ResultCode code) { 37 const auto early_exit_failure = [&ctx](std::string_view desc, ResultCode code) {
38 LOG_ERROR(Service_SET, "General failure while attempting to resolve firmware version ({}).", 38 LOG_ERROR(Service_SET, "General failure while attempting to resolve firmware version ({}).",
39 desc.c_str()); 39 desc);
40 IPC::ResponseBuilder rb{ctx, 2}; 40 IPC::ResponseBuilder rb{ctx, 2};
41 rb.Push(code); 41 rb.Push(code);
42 }; 42 };
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp
index a9875b9a6..67b419503 100644
--- a/src/core/hle/service/sockets/bsd.cpp
+++ b/src/core/hle/service/sockets/bsd.cpp
@@ -30,7 +30,7 @@ bool IsConnectionBased(Type type) {
30 case Type::DGRAM: 30 case Type::DGRAM:
31 return false; 31 return false;
32 default: 32 default:
33 UNIMPLEMENTED_MSG("Unimplemented type={}", static_cast<int>(type)); 33 UNIMPLEMENTED_MSG("Unimplemented type={}", type);
34 return false; 34 return false;
35 } 35 }
36} 36}
@@ -489,18 +489,18 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u
489 } 489 }
490 490
491 for (PollFD& pollfd : fds) { 491 for (PollFD& pollfd : fds) {
492 ASSERT(pollfd.revents == 0); 492 ASSERT(False(pollfd.revents));
493 493
494 if (pollfd.fd > static_cast<s32>(MAX_FD) || pollfd.fd < 0) { 494 if (pollfd.fd > static_cast<s32>(MAX_FD) || pollfd.fd < 0) {
495 LOG_ERROR(Service, "File descriptor handle={} is invalid", pollfd.fd); 495 LOG_ERROR(Service, "File descriptor handle={} is invalid", pollfd.fd);
496 pollfd.revents = 0; 496 pollfd.revents = PollEvents{};
497 return {0, Errno::SUCCESS}; 497 return {0, Errno::SUCCESS};
498 } 498 }
499 499
500 const std::optional<FileDescriptor>& descriptor = file_descriptors[pollfd.fd]; 500 const std::optional<FileDescriptor>& descriptor = file_descriptors[pollfd.fd];
501 if (!descriptor) { 501 if (!descriptor) {
502 LOG_ERROR(Service, "File descriptor handle={} is not allocated", pollfd.fd); 502 LOG_ERROR(Service, "File descriptor handle={} is not allocated", pollfd.fd);
503 pollfd.revents = POLL_NVAL; 503 pollfd.revents = PollEvents::Nval;
504 return {0, Errno::SUCCESS}; 504 return {0, Errno::SUCCESS};
505 } 505 }
506 } 506 }
@@ -510,7 +510,7 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u
510 Network::PollFD result; 510 Network::PollFD result;
511 result.socket = file_descriptors[pollfd.fd]->socket.get(); 511 result.socket = file_descriptors[pollfd.fd]->socket.get();
512 result.events = TranslatePollEventsToHost(pollfd.events); 512 result.events = TranslatePollEventsToHost(pollfd.events);
513 result.revents = 0; 513 result.revents = Network::PollEvents{};
514 return result; 514 return result;
515 }); 515 });
516 516
@@ -636,7 +636,7 @@ std::pair<s32, Errno> BSD::FcntlImpl(s32 fd, FcntlCmd cmd, s32 arg) {
636 return {0, Errno::SUCCESS}; 636 return {0, Errno::SUCCESS};
637 } 637 }
638 default: 638 default:
639 UNIMPLEMENTED_MSG("Unimplemented cmd={}", static_cast<int>(cmd)); 639 UNIMPLEMENTED_MSG("Unimplemented cmd={}", cmd);
640 return {-1, Errno::SUCCESS}; 640 return {-1, Errno::SUCCESS};
641 } 641 }
642} 642}
@@ -679,7 +679,7 @@ Errno BSD::SetSockOptImpl(s32 fd, u32 level, OptName optname, size_t optlen, con
679 case OptName::RCVTIMEO: 679 case OptName::RCVTIMEO:
680 return Translate(socket->SetRcvTimeo(value)); 680 return Translate(socket->SetRcvTimeo(value));
681 default: 681 default:
682 UNIMPLEMENTED_MSG("Unimplemented optname={}", static_cast<int>(optname)); 682 UNIMPLEMENTED_MSG("Unimplemented optname={}", optname);
683 return Errno::SUCCESS; 683 return Errno::SUCCESS;
684 } 684 }
685} 685}
diff --git a/src/core/hle/service/sockets/sockets.h b/src/core/hle/service/sockets/sockets.h
index 89a410076..5a65ed2a9 100644
--- a/src/core/hle/service/sockets/sockets.h
+++ b/src/core/hle/service/sockets/sockets.h
@@ -69,10 +69,22 @@ struct SockAddrIn {
69 std::array<u8, 8> zeroes; 69 std::array<u8, 8> zeroes;
70}; 70};
71 71
72enum class PollEvents : u16 {
73 // Using Pascal case because IN is a macro on Windows.
74 In = 1 << 0,
75 Pri = 1 << 1,
76 Out = 1 << 2,
77 Err = 1 << 3,
78 Hup = 1 << 4,
79 Nval = 1 << 5,
80};
81
82DECLARE_ENUM_FLAG_OPERATORS(PollEvents);
83
72struct PollFD { 84struct PollFD {
73 s32 fd; 85 s32 fd;
74 u16 events; 86 PollEvents events;
75 u16 revents; 87 PollEvents revents;
76}; 88};
77 89
78struct Linger { 90struct Linger {
@@ -80,13 +92,6 @@ struct Linger {
80 u32 linger; 92 u32 linger;
81}; 93};
82 94
83constexpr u16 POLL_IN = 0x01;
84constexpr u16 POLL_PRI = 0x02;
85constexpr u16 POLL_OUT = 0x04;
86constexpr u16 POLL_ERR = 0x08;
87constexpr u16 POLL_HUP = 0x10;
88constexpr u16 POLL_NVAL = 0x20;
89
90constexpr u32 FLAG_MSG_DONTWAIT = 0x80; 95constexpr u32 FLAG_MSG_DONTWAIT = 0x80;
91 96
92constexpr u32 FLAG_O_NONBLOCK = 0x800; 97constexpr u32 FLAG_O_NONBLOCK = 0x800;
diff --git a/src/core/hle/service/sockets/sockets_translate.cpp b/src/core/hle/service/sockets/sockets_translate.cpp
index 2e626fd86..c822d21b8 100644
--- a/src/core/hle/service/sockets/sockets_translate.cpp
+++ b/src/core/hle/service/sockets/sockets_translate.cpp
@@ -27,7 +27,7 @@ Errno Translate(Network::Errno value) {
27 case Network::Errno::NOTCONN: 27 case Network::Errno::NOTCONN:
28 return Errno::NOTCONN; 28 return Errno::NOTCONN;
29 default: 29 default:
30 UNIMPLEMENTED_MSG("Unimplemented errno={}", static_cast<int>(value)); 30 UNIMPLEMENTED_MSG("Unimplemented errno={}", value);
31 return Errno::SUCCESS; 31 return Errno::SUCCESS;
32 } 32 }
33} 33}
@@ -41,7 +41,7 @@ Network::Domain Translate(Domain domain) {
41 case Domain::INET: 41 case Domain::INET:
42 return Network::Domain::INET; 42 return Network::Domain::INET;
43 default: 43 default:
44 UNIMPLEMENTED_MSG("Unimplemented domain={}", static_cast<int>(domain)); 44 UNIMPLEMENTED_MSG("Unimplemented domain={}", domain);
45 return {}; 45 return {};
46 } 46 }
47} 47}
@@ -51,7 +51,7 @@ Domain Translate(Network::Domain domain) {
51 case Network::Domain::INET: 51 case Network::Domain::INET:
52 return Domain::INET; 52 return Domain::INET;
53 default: 53 default:
54 UNIMPLEMENTED_MSG("Unimplemented domain={}", static_cast<int>(domain)); 54 UNIMPLEMENTED_MSG("Unimplemented domain={}", domain);
55 return {}; 55 return {};
56 } 56 }
57} 57}
@@ -63,7 +63,7 @@ Network::Type Translate(Type type) {
63 case Type::DGRAM: 63 case Type::DGRAM:
64 return Network::Type::DGRAM; 64 return Network::Type::DGRAM;
65 default: 65 default:
66 UNIMPLEMENTED_MSG("Unimplemented type={}", static_cast<int>(type)); 66 UNIMPLEMENTED_MSG("Unimplemented type={}", type);
67 } 67 }
68} 68}
69 69
@@ -84,48 +84,48 @@ Network::Protocol Translate(Type type, Protocol protocol) {
84 case Protocol::UDP: 84 case Protocol::UDP:
85 return Network::Protocol::UDP; 85 return Network::Protocol::UDP;
86 default: 86 default:
87 UNIMPLEMENTED_MSG("Unimplemented protocol={}", static_cast<int>(protocol)); 87 UNIMPLEMENTED_MSG("Unimplemented protocol={}", protocol);
88 return Network::Protocol::TCP; 88 return Network::Protocol::TCP;
89 } 89 }
90} 90}
91 91
92u16 TranslatePollEventsToHost(u32 flags) { 92Network::PollEvents TranslatePollEventsToHost(PollEvents flags) {
93 u32 result = 0; 93 Network::PollEvents result{};
94 const auto translate = [&result, &flags](u32 from, u32 to) { 94 const auto translate = [&result, &flags](PollEvents from, Network::PollEvents to) {
95 if ((flags & from) != 0) { 95 if (True(flags & from)) {
96 flags &= ~from; 96 flags &= ~from;
97 result |= to; 97 result |= to;
98 } 98 }
99 }; 99 };
100 translate(POLL_IN, Network::POLL_IN); 100 translate(PollEvents::In, Network::PollEvents::In);
101 translate(POLL_PRI, Network::POLL_PRI); 101 translate(PollEvents::Pri, Network::PollEvents::Pri);
102 translate(POLL_OUT, Network::POLL_OUT); 102 translate(PollEvents::Out, Network::PollEvents::Out);
103 translate(POLL_ERR, Network::POLL_ERR); 103 translate(PollEvents::Err, Network::PollEvents::Err);
104 translate(POLL_HUP, Network::POLL_HUP); 104 translate(PollEvents::Hup, Network::PollEvents::Hup);
105 translate(POLL_NVAL, Network::POLL_NVAL); 105 translate(PollEvents::Nval, Network::PollEvents::Nval);
106 106
107 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); 107 UNIMPLEMENTED_IF_MSG((u16)flags != 0, "Unimplemented flags={}", (u16)flags);
108 return static_cast<u16>(result); 108 return result;
109} 109}
110 110
111u16 TranslatePollEventsToGuest(u32 flags) { 111PollEvents TranslatePollEventsToGuest(Network::PollEvents flags) {
112 u32 result = 0; 112 PollEvents result{};
113 const auto translate = [&result, &flags](u32 from, u32 to) { 113 const auto translate = [&result, &flags](Network::PollEvents from, PollEvents to) {
114 if ((flags & from) != 0) { 114 if (True(flags & from)) {
115 flags &= ~from; 115 flags &= ~from;
116 result |= to; 116 result |= to;
117 } 117 }
118 }; 118 };
119 119
120 translate(Network::POLL_IN, POLL_IN); 120 translate(Network::PollEvents::In, PollEvents::In);
121 translate(Network::POLL_PRI, POLL_PRI); 121 translate(Network::PollEvents::Pri, PollEvents::Pri);
122 translate(Network::POLL_OUT, POLL_OUT); 122 translate(Network::PollEvents::Out, PollEvents::Out);
123 translate(Network::POLL_ERR, POLL_ERR); 123 translate(Network::PollEvents::Err, PollEvents::Err);
124 translate(Network::POLL_HUP, POLL_HUP); 124 translate(Network::PollEvents::Hup, PollEvents::Hup);
125 translate(Network::POLL_NVAL, POLL_NVAL); 125 translate(Network::PollEvents::Nval, PollEvents::Nval);
126 126
127 UNIMPLEMENTED_IF_MSG(flags != 0, "Unimplemented flags={}", flags); 127 UNIMPLEMENTED_IF_MSG((u16)flags != 0, "Unimplemented flags={}", (u16)flags);
128 return static_cast<u16>(result); 128 return result;
129} 129}
130 130
131Network::SockAddrIn Translate(SockAddrIn value) { 131Network::SockAddrIn Translate(SockAddrIn value) {
@@ -157,7 +157,7 @@ Network::ShutdownHow Translate(ShutdownHow how) {
157 case ShutdownHow::RDWR: 157 case ShutdownHow::RDWR:
158 return Network::ShutdownHow::RDWR; 158 return Network::ShutdownHow::RDWR;
159 default: 159 default:
160 UNIMPLEMENTED_MSG("Unimplemented how={}", static_cast<int>(how)); 160 UNIMPLEMENTED_MSG("Unimplemented how={}", how);
161 return {}; 161 return {};
162 } 162 }
163} 163}
diff --git a/src/core/hle/service/sockets/sockets_translate.h b/src/core/hle/service/sockets/sockets_translate.h
index e498913d4..057d1ff22 100644
--- a/src/core/hle/service/sockets/sockets_translate.h
+++ b/src/core/hle/service/sockets/sockets_translate.h
@@ -31,10 +31,10 @@ Network::Type Translate(Type type);
31Network::Protocol Translate(Type type, Protocol protocol); 31Network::Protocol Translate(Type type, Protocol protocol);
32 32
33/// Translate abstract poll event flags to guest poll event flags 33/// Translate abstract poll event flags to guest poll event flags
34u16 TranslatePollEventsToHost(u32 flags); 34Network::PollEvents TranslatePollEventsToHost(PollEvents flags);
35 35
36/// Translate guest poll event flags to abstract poll event flags 36/// Translate guest poll event flags to abstract poll event flags
37u16 TranslatePollEventsToGuest(u32 flags); 37PollEvents TranslatePollEventsToGuest(Network::PollEvents flags);
38 38
39/// Translate guest socket address structure to abstract socket address structure 39/// Translate guest socket address structure to abstract socket address structure
40Network::SockAddrIn Translate(SockAddrIn value); 40Network::SockAddrIn Translate(SockAddrIn value);
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp
index af5b8b0b9..45cfffe06 100644
--- a/src/core/hle/service/vi/vi.cpp
+++ b/src/core/hle/service/vi/vi.cpp
@@ -282,18 +282,24 @@ public:
282 void DeserializeData() override { 282 void DeserializeData() override {
283 [[maybe_unused]] const std::u16string token = ReadInterfaceToken(); 283 [[maybe_unused]] const std::u16string token = ReadInterfaceToken();
284 data = Read<Data>(); 284 data = Read<Data>();
285 buffer = Read<NVFlinger::IGBPBuffer>(); 285 if (data.contains_object != 0) {
286 buffer_container = Read<BufferContainer>();
287 }
286 } 288 }
287 289
288 struct Data { 290 struct Data {
289 u32_le slot; 291 u32_le slot;
290 INSERT_PADDING_WORDS(1); 292 u32_le contains_object;
293 };
294
295 struct BufferContainer {
291 u32_le graphic_buffer_length; 296 u32_le graphic_buffer_length;
292 INSERT_PADDING_WORDS(1); 297 INSERT_PADDING_WORDS(1);
298 NVFlinger::IGBPBuffer buffer{};
293 }; 299 };
294 300
295 Data data; 301 Data data{};
296 NVFlinger::IGBPBuffer buffer; 302 BufferContainer buffer_container{};
297}; 303};
298 304
299class IGBPSetPreallocatedBufferResponseParcel : public Parcel { 305class IGBPSetPreallocatedBufferResponseParcel : public Parcel {
@@ -528,7 +534,7 @@ private:
528 const u32 flags = rp.Pop<u32>(); 534 const u32 flags = rp.Pop<u32>();
529 535
530 LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id, 536 LOG_DEBUG(Service_VI, "called. id=0x{:08X} transaction={:X}, flags=0x{:08X}", id,
531 static_cast<u32>(transaction), flags); 537 transaction, flags);
532 538
533 const auto guard = nv_flinger.Lock(); 539 const auto guard = nv_flinger.Lock();
534 auto& buffer_queue = nv_flinger.FindBufferQueue(id); 540 auto& buffer_queue = nv_flinger.FindBufferQueue(id);
@@ -547,7 +553,7 @@ private:
547 case TransactionId::SetPreallocatedBuffer: { 553 case TransactionId::SetPreallocatedBuffer: {
548 IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()}; 554 IGBPSetPreallocatedBufferRequestParcel request{ctx.ReadBuffer()};
549 555
550 buffer_queue.SetPreallocatedBuffer(request.data.slot, request.buffer); 556 buffer_queue.SetPreallocatedBuffer(request.data.slot, request.buffer_container.buffer);
551 557
552 IGBPSetPreallocatedBufferResponseParcel response{}; 558 IGBPSetPreallocatedBufferResponseParcel response{};
553 ctx.WriteBuffer(response.Serialize()); 559 ctx.WriteBuffer(response.Serialize());
@@ -1066,8 +1072,8 @@ private:
1066 const auto scaling_mode = rp.PopEnum<NintendoScaleMode>(); 1072 const auto scaling_mode = rp.PopEnum<NintendoScaleMode>();
1067 const u64 unknown = rp.Pop<u64>(); 1073 const u64 unknown = rp.Pop<u64>();
1068 1074
1069 LOG_DEBUG(Service_VI, "called. scaling_mode=0x{:08X}, unknown=0x{:016X}", 1075 LOG_DEBUG(Service_VI, "called. scaling_mode=0x{:08X}, unknown=0x{:016X}", scaling_mode,
1070 static_cast<u32>(scaling_mode), unknown); 1076 unknown);
1071 1077
1072 IPC::ResponseBuilder rb{ctx, 2}; 1078 IPC::ResponseBuilder rb{ctx, 2};
1073 1079
@@ -1210,7 +1216,7 @@ private:
1210 void ConvertScalingMode(Kernel::HLERequestContext& ctx) { 1216 void ConvertScalingMode(Kernel::HLERequestContext& ctx) {
1211 IPC::RequestParser rp{ctx}; 1217 IPC::RequestParser rp{ctx};
1212 const auto mode = rp.PopEnum<NintendoScaleMode>(); 1218 const auto mode = rp.PopEnum<NintendoScaleMode>();
1213 LOG_DEBUG(Service_VI, "called mode={}", static_cast<u32>(mode)); 1219 LOG_DEBUG(Service_VI, "called mode={}", mode);
1214 1220
1215 const auto converted_mode = ConvertScalingModeImpl(mode); 1221 const auto converted_mode = ConvertScalingModeImpl(mode);
1216 1222
@@ -1230,8 +1236,8 @@ private:
1230 const auto height = rp.Pop<u64>(); 1236 const auto height = rp.Pop<u64>();
1231 LOG_DEBUG(Service_VI, "called width={}, height={}", width, height); 1237 LOG_DEBUG(Service_VI, "called width={}, height={}", width, height);
1232 1238
1233 constexpr std::size_t base_size = 0x20000; 1239 constexpr u64 base_size = 0x20000;
1234 constexpr std::size_t alignment = 0x1000; 1240 constexpr u64 alignment = 0x1000;
1235 const auto texture_size = width * height * 4; 1241 const auto texture_size = width * height * 4;
1236 const auto out_size = (texture_size + base_size - 1) / base_size * base_size; 1242 const auto out_size = (texture_size + base_size - 1) / base_size * base_size;
1237 1243
@@ -1311,7 +1317,7 @@ void detail::GetDisplayServiceImpl(Kernel::HLERequestContext& ctx, Core::System&
1311 const auto policy = rp.PopEnum<Policy>(); 1317 const auto policy = rp.PopEnum<Policy>();
1312 1318
1313 if (!IsValidServiceAccess(permission, policy)) { 1319 if (!IsValidServiceAccess(permission, policy)) {
1314 LOG_ERROR(Service_VI, "Permission denied for policy {}", static_cast<u32>(policy)); 1320 LOG_ERROR(Service_VI, "Permission denied for policy {}", policy);
1315 IPC::ResponseBuilder rb{ctx, 2}; 1321 IPC::ResponseBuilder rb{ctx, 2};
1316 rb.Push(ERR_PERMISSION_DENIED); 1322 rb.Push(ERR_PERMISSION_DENIED);
1317 return; 1323 return;
diff --git a/src/core/loader/deconstructed_rom_directory.h b/src/core/loader/deconstructed_rom_directory.h
index 35d340317..3c968580f 100644
--- a/src/core/loader/deconstructed_rom_directory.h
+++ b/src/core/loader/deconstructed_rom_directory.h
@@ -32,7 +32,7 @@ public:
32 32
33 /** 33 /**
34 * Returns the type of the file 34 * Returns the type of the file
35 * @param file std::shared_ptr<VfsFile> open file 35 * @param file open file
36 * @return FileType found, or FileType::Error if this loader doesn't know it 36 * @return FileType found, or FileType::Error if this loader doesn't know it
37 */ 37 */
38 static FileType IdentifyType(const FileSys::VirtualFile& file); 38 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h
index 3527933ad..2067932c7 100644
--- a/src/core/loader/elf.h
+++ b/src/core/loader/elf.h
@@ -21,7 +21,7 @@ public:
21 21
22 /** 22 /**
23 * Returns the type of the file 23 * Returns the type of the file
24 * @param file std::shared_ptr<VfsFile> open file 24 * @param file open file
25 * @return FileType found, or FileType::Error if this loader doesn't know it 25 * @return FileType found, or FileType::Error if this loader doesn't know it
26 */ 26 */
27 static FileType IdentifyType(const FileSys::VirtualFile& file); 27 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/kip.h b/src/core/loader/kip.h
index dee05a7b5..14a85e295 100644
--- a/src/core/loader/kip.h
+++ b/src/core/loader/kip.h
@@ -23,7 +23,7 @@ public:
23 23
24 /** 24 /**
25 * Returns the type of the file 25 * Returns the type of the file
26 * @param file std::shared_ptr<VfsFile> open file 26 * @param file open file
27 * @return FileType found, or FileType::Error if this loader doesn't know it 27 * @return FileType found, or FileType::Error if this loader doesn't know it
28 */ 28 */
29 static FileType IdentifyType(const FileSys::VirtualFile& file); 29 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/nax.h b/src/core/loader/nax.h
index c2b7722b5..a5b5e2ae1 100644
--- a/src/core/loader/nax.h
+++ b/src/core/loader/nax.h
@@ -28,7 +28,7 @@ public:
28 28
29 /** 29 /**
30 * Returns the type of the file 30 * Returns the type of the file
31 * @param file std::shared_ptr<VfsFile> open file 31 * @param file open file
32 * @return FileType found, or FileType::Error if this loader doesn't know it 32 * @return FileType found, or FileType::Error if this loader doesn't know it
33 */ 33 */
34 static FileType IdentifyType(const FileSys::VirtualFile& file); 34 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/nca.h b/src/core/loader/nca.h
index 711070294..918792800 100644
--- a/src/core/loader/nca.h
+++ b/src/core/loader/nca.h
@@ -28,7 +28,7 @@ public:
28 28
29 /** 29 /**
30 * Returns the type of the file 30 * Returns the type of the file
31 * @param file std::shared_ptr<VfsFile> open file 31 * @param file open file
32 * @return FileType found, or FileType::Error if this loader doesn't know it 32 * @return FileType found, or FileType::Error if this loader doesn't know it
33 */ 33 */
34 static FileType IdentifyType(const FileSys::VirtualFile& file); 34 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/nro.h b/src/core/loader/nro.h
index a2aab2ecc..a82b66221 100644
--- a/src/core/loader/nro.h
+++ b/src/core/loader/nro.h
@@ -32,7 +32,7 @@ public:
32 32
33 /** 33 /**
34 * Returns the type of the file 34 * Returns the type of the file
35 * @param file std::shared_ptr<VfsFile> open file 35 * @param file open file
36 * @return FileType found, or FileType::Error if this loader doesn't know it 36 * @return FileType found, or FileType::Error if this loader doesn't know it
37 */ 37 */
38 static FileType IdentifyType(const FileSys::VirtualFile& file); 38 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/nso.h b/src/core/loader/nso.h
index d331096ae..3af461b5f 100644
--- a/src/core/loader/nso.h
+++ b/src/core/loader/nso.h
@@ -75,7 +75,7 @@ public:
75 75
76 /** 76 /**
77 * Returns the type of the file 77 * Returns the type of the file
78 * @param file std::shared_ptr<VfsFile> open file 78 * @param file open file
79 * @return FileType found, or FileType::Error if this loader doesn't know it 79 * @return FileType found, or FileType::Error if this loader doesn't know it
80 */ 80 */
81 static FileType IdentifyType(const FileSys::VirtualFile& file); 81 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/nsp.h b/src/core/loader/nsp.h
index f0518ac47..d48d87f2c 100644
--- a/src/core/loader/nsp.h
+++ b/src/core/loader/nsp.h
@@ -34,7 +34,7 @@ public:
34 34
35 /** 35 /**
36 * Returns the type of the file 36 * Returns the type of the file
37 * @param file std::shared_ptr<VfsFile> open file 37 * @param file open file
38 * @return FileType found, or FileType::Error if this loader doesn't know it 38 * @return FileType found, or FileType::Error if this loader doesn't know it
39 */ 39 */
40 static FileType IdentifyType(const FileSys::VirtualFile& file); 40 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/loader/xci.h b/src/core/loader/xci.h
index 764dc8328..9f0ceb5ef 100644
--- a/src/core/loader/xci.h
+++ b/src/core/loader/xci.h
@@ -34,7 +34,7 @@ public:
34 34
35 /** 35 /**
36 * Returns the type of the file 36 * Returns the type of the file
37 * @param file std::shared_ptr<VfsFile> open file 37 * @param file open file
38 * @return FileType found, or FileType::Error if this loader doesn't know it 38 * @return FileType found, or FileType::Error if this loader doesn't know it
39 */ 39 */
40 static FileType IdentifyType(const FileSys::VirtualFile& file); 40 static FileType IdentifyType(const FileSys::VirtualFile& file);
diff --git a/src/core/memory.cpp b/src/core/memory.cpp
index b88aa5c40..b7f21698f 100644
--- a/src/core/memory.cpp
+++ b/src/core/memory.cpp
@@ -667,8 +667,6 @@ struct Memory::Impl {
667 * @tparam T The data type to write to memory. This type *must* be 667 * @tparam T The data type to write to memory. This type *must* be
668 * trivially copyable, otherwise the behavior of this function 668 * trivially copyable, otherwise the behavior of this function
669 * is undefined. 669 * is undefined.
670 *
671 * @returns The instance of T write to the specified virtual address.
672 */ 670 */
673 template <typename T> 671 template <typename T>
674 void Write(const VAddr vaddr, const T data) { 672 void Write(const VAddr vaddr, const T data) {
diff --git a/src/core/network/network.cpp b/src/core/network/network.cpp
index 5ef2e8511..681e93468 100644
--- a/src/core/network/network.cpp
+++ b/src/core/network/network.cpp
@@ -11,7 +11,7 @@
11#ifdef _WIN32 11#ifdef _WIN32
12#define _WINSOCK_DEPRECATED_NO_WARNINGS // gethostname 12#define _WINSOCK_DEPRECATED_NO_WARNINGS // gethostname
13#include <winsock2.h> 13#include <winsock2.h>
14#elif __unix__ 14#elif YUZU_UNIX
15#include <errno.h> 15#include <errno.h>
16#include <fcntl.h> 16#include <fcntl.h>
17#include <netdb.h> 17#include <netdb.h>
@@ -54,7 +54,7 @@ constexpr IPv4Address TranslateIPv4(in_addr addr) {
54sockaddr TranslateFromSockAddrIn(SockAddrIn input) { 54sockaddr TranslateFromSockAddrIn(SockAddrIn input) {
55 sockaddr_in result; 55 sockaddr_in result;
56 56
57#ifdef __unix__ 57#if YUZU_UNIX
58 result.sin_len = sizeof(result); 58 result.sin_len = sizeof(result);
59#endif 59#endif
60 60
@@ -63,7 +63,7 @@ sockaddr TranslateFromSockAddrIn(SockAddrIn input) {
63 result.sin_family = AF_INET; 63 result.sin_family = AF_INET;
64 break; 64 break;
65 default: 65 default:
66 UNIMPLEMENTED_MSG("Unhandled sockaddr family={}", static_cast<int>(input.family)); 66 UNIMPLEMENTED_MSG("Unhandled sockaddr family={}", input.family);
67 result.sin_family = AF_INET; 67 result.sin_family = AF_INET;
68 break; 68 break;
69 } 69 }
@@ -99,7 +99,7 @@ bool EnableNonBlock(SOCKET fd, bool enable) {
99 return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR; 99 return ioctlsocket(fd, FIONBIO, &value) != SOCKET_ERROR;
100} 100}
101 101
102#elif __unix__ // ^ _WIN32 v __unix__ 102#elif YUZU_UNIX // ^ _WIN32 v YUZU_UNIX
103 103
104using SOCKET = int; 104using SOCKET = int;
105using WSAPOLLFD = pollfd; 105using WSAPOLLFD = pollfd;
@@ -133,7 +133,7 @@ sockaddr TranslateFromSockAddrIn(SockAddrIn input) {
133 result.sin_family = AF_INET; 133 result.sin_family = AF_INET;
134 break; 134 break;
135 default: 135 default:
136 UNIMPLEMENTED_MSG("Unhandled sockaddr family={}", static_cast<int>(input.family)); 136 UNIMPLEMENTED_MSG("Unhandled sockaddr family={}", input.family);
137 result.sin_family = AF_INET; 137 result.sin_family = AF_INET;
138 break; 138 break;
139 } 139 }
@@ -186,7 +186,7 @@ int TranslateDomain(Domain domain) {
186 case Domain::INET: 186 case Domain::INET:
187 return AF_INET; 187 return AF_INET;
188 default: 188 default:
189 UNIMPLEMENTED_MSG("Unimplemented domain={}", static_cast<int>(domain)); 189 UNIMPLEMENTED_MSG("Unimplemented domain={}", domain);
190 return 0; 190 return 0;
191 } 191 }
192} 192}
@@ -198,7 +198,7 @@ int TranslateType(Type type) {
198 case Type::DGRAM: 198 case Type::DGRAM:
199 return SOCK_DGRAM; 199 return SOCK_DGRAM;
200 default: 200 default:
201 UNIMPLEMENTED_MSG("Unimplemented type={}", static_cast<int>(type)); 201 UNIMPLEMENTED_MSG("Unimplemented type={}", type);
202 return 0; 202 return 0;
203 } 203 }
204} 204}
@@ -210,7 +210,7 @@ int TranslateProtocol(Protocol protocol) {
210 case Protocol::UDP: 210 case Protocol::UDP:
211 return IPPROTO_UDP; 211 return IPPROTO_UDP;
212 default: 212 default:
213 UNIMPLEMENTED_MSG("Unimplemented protocol={}", static_cast<int>(protocol)); 213 UNIMPLEMENTED_MSG("Unimplemented protocol={}", protocol);
214 return 0; 214 return 0;
215 } 215 }
216} 216}
@@ -238,49 +238,49 @@ SockAddrIn TranslateToSockAddrIn(sockaddr input_) {
238 return result; 238 return result;
239} 239}
240 240
241u16 TranslatePollEvents(u32 events) { 241short TranslatePollEvents(PollEvents events) {
242 u32 result = 0; 242 short result = 0;
243 243
244 if ((events & POLL_IN) != 0) { 244 if (True(events & PollEvents::In)) {
245 events &= ~POLL_IN; 245 events &= ~PollEvents::In;
246 result |= POLLIN; 246 result |= POLLIN;
247 } 247 }
248 if ((events & POLL_PRI) != 0) { 248 if (True(events & PollEvents::Pri)) {
249 events &= ~POLL_PRI; 249 events &= ~PollEvents::Pri;
250#ifdef _WIN32 250#ifdef _WIN32
251 LOG_WARNING(Service, "Winsock doesn't support POLLPRI"); 251 LOG_WARNING(Service, "Winsock doesn't support POLLPRI");
252#else 252#else
253 result |= POLL_PRI; 253 result |= POLLPRI;
254#endif 254#endif
255 } 255 }
256 if ((events & POLL_OUT) != 0) { 256 if (True(events & PollEvents::Out)) {
257 events &= ~POLL_OUT; 257 events &= ~PollEvents::Out;
258 result |= POLLOUT; 258 result |= POLLOUT;
259 } 259 }
260 260
261 UNIMPLEMENTED_IF_MSG(events != 0, "Unhandled guest events=0x{:x}", events); 261 UNIMPLEMENTED_IF_MSG((u16)events != 0, "Unhandled guest events=0x{:x}", (u16)events);
262 262
263 return static_cast<u16>(result); 263 return result;
264} 264}
265 265
266u16 TranslatePollRevents(u32 revents) { 266PollEvents TranslatePollRevents(short revents) {
267 u32 result = 0; 267 PollEvents result{};
268 const auto translate = [&result, &revents](u32 host, u32 guest) { 268 const auto translate = [&result, &revents](short host, PollEvents guest) {
269 if ((revents & host) != 0) { 269 if ((revents & host) != 0) {
270 revents &= ~host; 270 revents &= static_cast<short>(~host);
271 result |= guest; 271 result |= guest;
272 } 272 }
273 }; 273 };
274 274
275 translate(POLLIN, POLL_IN); 275 translate(POLLIN, PollEvents::In);
276 translate(POLLPRI, POLL_PRI); 276 translate(POLLPRI, PollEvents::Pri);
277 translate(POLLOUT, POLL_OUT); 277 translate(POLLOUT, PollEvents::Out);
278 translate(POLLERR, POLL_ERR); 278 translate(POLLERR, PollEvents::Err);
279 translate(POLLHUP, POLL_HUP); 279 translate(POLLHUP, PollEvents::Hup);
280 280
281 UNIMPLEMENTED_IF_MSG(revents != 0, "Unhandled host revents=0x{:x}", revents); 281 UNIMPLEMENTED_IF_MSG(revents != 0, "Unhandled host revents=0x{:x}", revents);
282 282
283 return static_cast<u16>(result); 283 return result;
284} 284}
285 285
286template <typename T> 286template <typename T>
@@ -350,7 +350,7 @@ std::pair<s32, Errno> Poll(std::vector<PollFD>& pollfds, s32 timeout) {
350 } 350 }
351 351
352 for (size_t i = 0; i < num; ++i) { 352 for (size_t i = 0; i < num; ++i) {
353 pollfds[i].revents = TranslatePollRevents(static_cast<u32>(host_pollfds[i].revents)); 353 pollfds[i].revents = TranslatePollRevents(host_pollfds[i].revents);
354 } 354 }
355 355
356 if (result > 0) { 356 if (result > 0) {
@@ -482,7 +482,7 @@ Errno Socket::Shutdown(ShutdownHow how) {
482 host_how = SD_BOTH; 482 host_how = SD_BOTH;
483 break; 483 break;
484 default: 484 default:
485 UNIMPLEMENTED_MSG("Unimplemented flag how={}", static_cast<int>(how)); 485 UNIMPLEMENTED_MSG("Unimplemented flag how={}", how);
486 return Errno::SUCCESS; 486 return Errno::SUCCESS;
487 } 487 }
488 if (shutdown(fd, host_how) != SOCKET_ERROR) { 488 if (shutdown(fd, host_how) != SOCKET_ERROR) {
diff --git a/src/core/network/network.h b/src/core/network/network.h
index 0622e4593..76b2821f2 100644
--- a/src/core/network/network.h
+++ b/src/core/network/network.h
@@ -61,19 +61,25 @@ struct SockAddrIn {
61}; 61};
62 62
63/// Cross-platform poll fd structure 63/// Cross-platform poll fd structure
64
65enum class PollEvents : u16 {
66 // Using Pascal case because IN is a macro on Windows.
67 In = 1 << 0,
68 Pri = 1 << 1,
69 Out = 1 << 2,
70 Err = 1 << 3,
71 Hup = 1 << 4,
72 Nval = 1 << 5,
73};
74
75DECLARE_ENUM_FLAG_OPERATORS(PollEvents);
76
64struct PollFD { 77struct PollFD {
65 Socket* socket; 78 Socket* socket;
66 u16 events; 79 PollEvents events;
67 u16 revents; 80 PollEvents revents;
68}; 81};
69 82
70constexpr u16 POLL_IN = 1 << 0;
71constexpr u16 POLL_PRI = 1 << 1;
72constexpr u16 POLL_OUT = 1 << 2;
73constexpr u16 POLL_ERR = 1 << 3;
74constexpr u16 POLL_HUP = 1 << 4;
75constexpr u16 POLL_NVAL = 1 << 5;
76
77class NetworkInstance { 83class NetworkInstance {
78public: 84public:
79 explicit NetworkInstance(); 85 explicit NetworkInstance();
diff --git a/src/core/network/sockets.h b/src/core/network/sockets.h
index 7bdff0fe4..a44393325 100644
--- a/src/core/network/sockets.h
+++ b/src/core/network/sockets.h
@@ -9,7 +9,7 @@
9 9
10#if defined(_WIN32) 10#if defined(_WIN32)
11#include <winsock.h> 11#include <winsock.h>
12#elif !defined(__unix__) 12#elif !YUZU_UNIX
13#error "Platform not implemented" 13#error "Platform not implemented"
14#endif 14#endif
15 15
@@ -84,7 +84,7 @@ public:
84 84
85#if defined(_WIN32) 85#if defined(_WIN32)
86 SOCKET fd = INVALID_SOCKET; 86 SOCKET fd = INVALID_SOCKET;
87#elif defined(__unix__) 87#elif YUZU_UNIX
88 int fd = -1; 88 int fd = -1;
89#endif 89#endif
90}; 90};
diff --git a/src/core/settings.cpp b/src/core/settings.cpp
index e9997a263..47d9ecf9a 100644
--- a/src/core/settings.cpp
+++ b/src/core/settings.cpp
@@ -72,8 +72,6 @@ void LogSettings() {
72 log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd); 72 log_setting("DataStorage_UseVirtualSd", values.use_virtual_sd);
73 log_setting("DataStorage_NandDir", Common::FS::GetUserPath(Common::FS::UserPath::NANDDir)); 73 log_setting("DataStorage_NandDir", Common::FS::GetUserPath(Common::FS::UserPath::NANDDir));
74 log_setting("DataStorage_SdmcDir", Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir)); 74 log_setting("DataStorage_SdmcDir", Common::FS::GetUserPath(Common::FS::UserPath::SDMCDir));
75 log_setting("Debugging_UseGdbstub", values.use_gdbstub);
76 log_setting("Debugging_GdbstubPort", values.gdbstub_port);
77 log_setting("Debugging_ProgramArgs", values.program_args); 75 log_setting("Debugging_ProgramArgs", values.program_args);
78 log_setting("Services_BCATBackend", values.bcat_backend); 76 log_setting("Services_BCATBackend", values.bcat_backend);
79 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local); 77 log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local);
diff --git a/src/core/settings.h b/src/core/settings.h
index 8e076f7ef..d5f8d2b7e 100644
--- a/src/core/settings.h
+++ b/src/core/settings.h
@@ -180,6 +180,8 @@ struct Values {
180 std::string motion_device; 180 std::string motion_device;
181 std::string udp_input_servers; 181 std::string udp_input_servers;
182 182
183 bool emulate_analog_keyboard;
184
183 bool mouse_enabled; 185 bool mouse_enabled;
184 std::string mouse_device; 186 std::string mouse_device;
185 MouseButtonsRaw mouse_buttons; 187 MouseButtonsRaw mouse_buttons;
diff --git a/src/input_common/analog_from_button.cpp b/src/input_common/analog_from_button.cpp
index d748c1c04..40b516f85 100755
--- a/src/input_common/analog_from_button.cpp
+++ b/src/input_common/analog_from_button.cpp
@@ -6,6 +6,7 @@
6#include <cmath> 6#include <cmath>
7#include <thread> 7#include <thread>
8#include "common/math_util.h" 8#include "common/math_util.h"
9#include "core/settings.h"
9#include "input_common/analog_from_button.h" 10#include "input_common/analog_from_button.h"
10 11
11namespace InputCommon { 12namespace InputCommon {
@@ -112,7 +113,26 @@ public:
112 } 113 }
113 114
114 std::tuple<float, float> GetStatus() const override { 115 std::tuple<float, float> GetStatus() const override {
115 return std::make_tuple(std::cos(angle) * amplitude, std::sin(angle) * amplitude); 116 if (Settings::values.emulate_analog_keyboard) {
117 return std::make_tuple(std::cos(angle) * amplitude, std::sin(angle) * amplitude);
118 }
119 constexpr float SQRT_HALF = 0.707106781f;
120 int x = 0, y = 0;
121 if (right->GetStatus()) {
122 ++x;
123 }
124 if (left->GetStatus()) {
125 --x;
126 }
127 if (up->GetStatus()) {
128 ++y;
129 }
130 if (down->GetStatus()) {
131 --y;
132 }
133 const float coef = modifier->GetStatus() ? modifier_scale : 1.0f;
134 return std::make_tuple(static_cast<float>(x) * coef * (y == 0 ? 1.0f : SQRT_HALF),
135 static_cast<float>(y) * coef * (x == 0 ? 1.0f : SQRT_HALF));
116 } 136 }
117 137
118 bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override { 138 bool GetAnalogDirectionStatus(Input::AnalogDirection direction) const override {
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index abcee2a1c..a021d61f5 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -297,13 +297,20 @@ if (ENABLE_NSIGHT_AFTERMATH)
297endif() 297endif()
298 298
299if (MSVC) 299if (MSVC)
300 target_compile_options(video_core PRIVATE /we4267) 300 target_compile_options(video_core PRIVATE
301 /we4267 # 'var' : conversion from 'size_t' to 'type', possible loss of data
302 /we4456 # Declaration of 'identifier' hides previous local declaration
303 /we4457 # Declaration of 'identifier' hides function parameter
304 /we4458 # Declaration of 'identifier' hides class member
305 /we4459 # Declaration of 'identifier' hides global declaration
306 )
301else() 307else()
302 target_compile_options(video_core PRIVATE 308 target_compile_options(video_core PRIVATE
303 -Werror=conversion 309 -Werror=conversion
304 -Wno-error=sign-conversion 310 -Wno-error=sign-conversion
305 -Werror=pessimizing-move 311 -Werror=pessimizing-move
306 -Werror=redundant-move 312 -Werror=redundant-move
313 -Werror=shadow
307 -Werror=switch 314 -Werror=switch
308 -Werror=type-limits 315 -Werror=type-limits
309 -Werror=unused-variable 316 -Werror=unused-variable
diff --git a/src/video_core/buffer_cache/buffer_block.h b/src/video_core/buffer_cache/buffer_block.h
index e64170e66..e9306194a 100644
--- a/src/video_core/buffer_cache/buffer_block.h
+++ b/src/video_core/buffer_cache/buffer_block.h
@@ -4,34 +4,29 @@
4 4
5#pragma once 5#pragma once
6 6
7#include <unordered_set>
8#include <utility>
9
10#include "common/alignment.h"
11#include "common/common_types.h" 7#include "common/common_types.h"
12#include "video_core/gpu.h"
13 8
14namespace VideoCommon { 9namespace VideoCommon {
15 10
16class BufferBlock { 11class BufferBlock {
17public: 12public:
18 bool Overlaps(VAddr start, VAddr end) const { 13 [[nodiscard]] bool Overlaps(VAddr start, VAddr end) const {
19 return (cpu_addr < end) && (cpu_addr_end > start); 14 return (cpu_addr < end) && (cpu_addr_end > start);
20 } 15 }
21 16
22 bool IsInside(VAddr other_start, VAddr other_end) const { 17 [[nodiscard]] bool IsInside(VAddr other_start, VAddr other_end) const {
23 return cpu_addr <= other_start && other_end <= cpu_addr_end; 18 return cpu_addr <= other_start && other_end <= cpu_addr_end;
24 } 19 }
25 20
26 std::size_t Offset(VAddr in_addr) const { 21 [[nodiscard]] std::size_t Offset(VAddr in_addr) const {
27 return static_cast<std::size_t>(in_addr - cpu_addr); 22 return static_cast<std::size_t>(in_addr - cpu_addr);
28 } 23 }
29 24
30 VAddr CpuAddr() const { 25 [[nodiscard]] VAddr CpuAddr() const {
31 return cpu_addr; 26 return cpu_addr;
32 } 27 }
33 28
34 VAddr CpuAddrEnd() const { 29 [[nodiscard]] VAddr CpuAddrEnd() const {
35 return cpu_addr_end; 30 return cpu_addr_end;
36 } 31 }
37 32
@@ -40,11 +35,11 @@ public:
40 cpu_addr_end = new_addr + size; 35 cpu_addr_end = new_addr + size;
41 } 36 }
42 37
43 std::size_t Size() const { 38 [[nodiscard]] std::size_t Size() const {
44 return size; 39 return size;
45 } 40 }
46 41
47 u64 Epoch() const { 42 [[nodiscard]] u64 Epoch() const {
48 return epoch; 43 return epoch;
49 } 44 }
50 45
diff --git a/src/video_core/buffer_cache/buffer_cache.h b/src/video_core/buffer_cache/buffer_cache.h
index e7edd733f..38961f3fd 100644
--- a/src/video_core/buffer_cache/buffer_cache.h
+++ b/src/video_core/buffer_cache/buffer_cache.h
@@ -545,7 +545,7 @@ private:
545 bool IsRegionWritten(VAddr start, VAddr end) const { 545 bool IsRegionWritten(VAddr start, VAddr end) const {
546 const u64 page_end = end >> WRITE_PAGE_BIT; 546 const u64 page_end = end >> WRITE_PAGE_BIT;
547 for (u64 page_start = start >> WRITE_PAGE_BIT; page_start <= page_end; ++page_start) { 547 for (u64 page_start = start >> WRITE_PAGE_BIT; page_start <= page_end; ++page_start) {
548 if (written_pages.count(page_start) > 0) { 548 if (written_pages.contains(page_start)) {
549 return true; 549 return true;
550 } 550 }
551 } 551 }
diff --git a/src/video_core/buffer_cache/map_interval.h b/src/video_core/buffer_cache/map_interval.h
index fe0bcd1d8..ef974b08a 100644
--- a/src/video_core/buffer_cache/map_interval.h
+++ b/src/video_core/buffer_cache/map_interval.h
@@ -84,9 +84,10 @@ private:
84 void FillFreeList(Chunk& chunk); 84 void FillFreeList(Chunk& chunk);
85 85
86 std::vector<MapInterval*> free_list; 86 std::vector<MapInterval*> free_list;
87 std::unique_ptr<Chunk>* new_chunk = &first_chunk.next;
88 87
89 Chunk first_chunk; 88 Chunk first_chunk;
89
90 std::unique_ptr<Chunk>* new_chunk = &first_chunk.next;
90}; 91};
91 92
92} // namespace VideoCommon 93} // namespace VideoCommon
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp
index f547f5bd4..39bc923a5 100644
--- a/src/video_core/command_classes/codecs/codec.cpp
+++ b/src/video_core/command_classes/codecs/codec.cpp
@@ -44,7 +44,7 @@ Codec::~Codec() {
44} 44}
45 45
46void Codec::SetTargetCodec(NvdecCommon::VideoCodec codec) { 46void Codec::SetTargetCodec(NvdecCommon::VideoCodec codec) {
47 LOG_INFO(Service_NVDRV, "NVDEC video codec initialized to {}", static_cast<u32>(codec)); 47 LOG_INFO(Service_NVDRV, "NVDEC video codec initialized to {}", codec);
48 current_codec = codec; 48 current_codec = codec;
49} 49}
50 50
@@ -62,7 +62,7 @@ void Codec::Decode() {
62 } else if (current_codec == NvdecCommon::VideoCodec::Vp9) { 62 } else if (current_codec == NvdecCommon::VideoCodec::Vp9) {
63 av_codec = avcodec_find_decoder(AV_CODEC_ID_VP9); 63 av_codec = avcodec_find_decoder(AV_CODEC_ID_VP9);
64 } else { 64 } else {
65 LOG_ERROR(Service_NVDRV, "Unknown video codec {}", static_cast<u32>(current_codec)); 65 LOG_ERROR(Service_NVDRV, "Unknown video codec {}", current_codec);
66 return; 66 return;
67 } 67 }
68 68
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp
index 6cfc193fa..66e21ce9c 100644
--- a/src/video_core/command_classes/vic.cpp
+++ b/src/video_core/command_classes/vic.cpp
@@ -27,7 +27,7 @@ void Vic::VicStateWrite(u32 offset, u32 arguments) {
27} 27}
28 28
29void Vic::ProcessMethod(Method method, const std::vector<u32>& arguments) { 29void Vic::ProcessMethod(Method method, const std::vector<u32>& arguments) {
30 LOG_DEBUG(HW_GPU, "Vic method 0x{:X}", static_cast<u32>(method)); 30 LOG_DEBUG(HW_GPU, "Vic method 0x{:X}", method);
31 VicStateWrite(static_cast<u32>(method), arguments[0]); 31 VicStateWrite(static_cast<u32>(method), arguments[0]);
32 const u64 arg = static_cast<u64>(arguments[0]) << 8; 32 const u64 arg = static_cast<u64>(arguments[0]) << 8;
33 switch (method) { 33 switch (method) {
diff --git a/src/video_core/dirty_flags.cpp b/src/video_core/dirty_flags.cpp
index e16075993..2faa6ef0e 100644
--- a/src/video_core/dirty_flags.cpp
+++ b/src/video_core/dirty_flags.cpp
@@ -9,7 +9,7 @@
9#include "video_core/dirty_flags.h" 9#include "video_core/dirty_flags.h"
10 10
11#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name) 11#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
12#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / sizeof(u32)) 12#define NUM(field_name) (sizeof(::Tegra::Engines::Maxwell3D::Regs::field_name) / (sizeof(u32)))
13 13
14namespace VideoCommon::Dirty { 14namespace VideoCommon::Dirty {
15 15
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp
index 9409c4075..4293d676c 100644
--- a/src/video_core/engines/fermi_2d.cpp
+++ b/src/video_core/engines/fermi_2d.cpp
@@ -48,8 +48,7 @@ static std::pair<u32, u32> DelimitLine(u32 src_1, u32 src_2, u32 dst_1, u32 dst_
48} 48}
49 49
50void Fermi2D::HandleSurfaceCopy() { 50void Fermi2D::HandleSurfaceCopy() {
51 LOG_DEBUG(HW_GPU, "Requested a surface copy with operation {}", 51 LOG_DEBUG(HW_GPU, "Requested a surface copy with operation {}", regs.operation);
52 static_cast<u32>(regs.operation));
53 52
54 // TODO(Subv): Only raw copies are implemented. 53 // TODO(Subv): Only raw copies are implemented.
55 ASSERT(regs.operation == Operation::SrcCopy); 54 ASSERT(regs.operation == Operation::SrcCopy);
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 6287df633..761962ed0 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -359,7 +359,7 @@ void Maxwell3D::CallMethodFromMME(u32 method, u32 method_argument) {
359} 359}
360 360
361void Maxwell3D::FlushMMEInlineDraw() { 361void Maxwell3D::FlushMMEInlineDraw() {
362 LOG_TRACE(HW_GPU, "called, topology={}, count={}", static_cast<u32>(regs.draw.topology.Value()), 362 LOG_TRACE(HW_GPU, "called, topology={}, count={}", regs.draw.topology.Value(),
363 regs.vertex_buffer.count); 363 regs.vertex_buffer.count);
364 ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?"); 364 ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
365 ASSERT(mme_draw.instance_count == mme_draw.gl_end_count); 365 ASSERT(mme_draw.instance_count == mme_draw.gl_end_count);
@@ -504,8 +504,7 @@ void Maxwell3D::ProcessCounterReset() {
504 rasterizer->ResetCounter(QueryType::SamplesPassed); 504 rasterizer->ResetCounter(QueryType::SamplesPassed);
505 break; 505 break;
506 default: 506 default:
507 LOG_DEBUG(Render_OpenGL, "Unimplemented counter reset={}", 507 LOG_DEBUG(Render_OpenGL, "Unimplemented counter reset={}", regs.counter_reset);
508 static_cast<int>(regs.counter_reset));
509 break; 508 break;
510 } 509 }
511} 510}
@@ -520,7 +519,7 @@ void Maxwell3D::ProcessSyncPoint() {
520} 519}
521 520
522void Maxwell3D::DrawArrays() { 521void Maxwell3D::DrawArrays() {
523 LOG_TRACE(HW_GPU, "called, topology={}, count={}", static_cast<u32>(regs.draw.topology.Value()), 522 LOG_TRACE(HW_GPU, "called, topology={}, count={}", regs.draw.topology.Value(),
524 regs.vertex_buffer.count); 523 regs.vertex_buffer.count);
525 ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?"); 524 ASSERT_MSG(!(regs.index_array.count && regs.vertex_buffer.count), "Both indexed and direct?");
526 525
@@ -558,12 +557,12 @@ std::optional<u64> Maxwell3D::GetQueryResult() {
558 return 0; 557 return 0;
559 case Regs::QuerySelect::SamplesPassed: 558 case Regs::QuerySelect::SamplesPassed:
560 // Deferred. 559 // Deferred.
561 rasterizer->Query(regs.query.QueryAddress(), VideoCore::QueryType::SamplesPassed, 560 rasterizer->Query(regs.query.QueryAddress(), QueryType::SamplesPassed,
562 system.GPU().GetTicks()); 561 system.GPU().GetTicks());
563 return std::nullopt; 562 return std::nullopt;
564 default: 563 default:
565 LOG_DEBUG(HW_GPU, "Unimplemented query select type {}", 564 LOG_DEBUG(HW_GPU, "Unimplemented query select type {}",
566 static_cast<u32>(regs.query.query_get.select.Value())); 565 regs.query.query_get.select.Value());
567 return 1; 566 return 1;
568 } 567 }
569} 568}
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h
index b0d9559d0..564acbc53 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -1473,39 +1473,6 @@ private:
1473 1473
1474 void ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argument, bool is_last_call); 1474 void ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argument, bool is_last_call);
1475 1475
1476 Core::System& system;
1477 MemoryManager& memory_manager;
1478
1479 VideoCore::RasterizerInterface* rasterizer = nullptr;
1480
1481 /// Start offsets of each macro in macro_memory
1482 std::array<u32, 0x80> macro_positions = {};
1483
1484 std::array<bool, Regs::NUM_REGS> mme_inline{};
1485
1486 /// Macro method that is currently being executed / being fed parameters.
1487 u32 executing_macro = 0;
1488 /// Parameters that have been submitted to the macro call so far.
1489 std::vector<u32> macro_params;
1490
1491 /// Interpreter for the macro codes uploaded to the GPU.
1492 std::unique_ptr<MacroEngine> macro_engine;
1493
1494 static constexpr u32 null_cb_data = 0xFFFFFFFF;
1495 struct {
1496 std::array<std::array<u32, 0x4000>, 16> buffer;
1497 u32 current{null_cb_data};
1498 u32 id{null_cb_data};
1499 u32 start_pos{};
1500 u32 counter{};
1501 } cb_data_state;
1502
1503 Upload::State upload_state;
1504
1505 bool execute_on{true};
1506
1507 std::array<u8, Regs::NUM_REGS> dirty_pointers{};
1508
1509 /// Retrieves information about a specific TIC entry from the TIC buffer. 1476 /// Retrieves information about a specific TIC entry from the TIC buffer.
1510 Texture::TICEntry GetTICEntry(u32 tic_index) const; 1477 Texture::TICEntry GetTICEntry(u32 tic_index) const;
1511 1478
@@ -1514,8 +1481,8 @@ private:
1514 1481
1515 /** 1482 /**
1516 * Call a macro on this engine. 1483 * Call a macro on this engine.
1484 *
1517 * @param method Method to call 1485 * @param method Method to call
1518 * @param num_parameters Number of arguments
1519 * @param parameters Arguments to the method call 1486 * @param parameters Arguments to the method call
1520 */ 1487 */
1521 void CallMacroMethod(u32 method, const std::vector<u32>& parameters); 1488 void CallMacroMethod(u32 method, const std::vector<u32>& parameters);
@@ -1564,6 +1531,38 @@ private:
1564 1531
1565 /// Returns a query's value or an empty object if the value will be deferred through a cache. 1532 /// Returns a query's value or an empty object if the value will be deferred through a cache.
1566 std::optional<u64> GetQueryResult(); 1533 std::optional<u64> GetQueryResult();
1534
1535 Core::System& system;
1536 MemoryManager& memory_manager;
1537
1538 VideoCore::RasterizerInterface* rasterizer = nullptr;
1539
1540 /// Start offsets of each macro in macro_memory
1541 std::array<u32, 0x80> macro_positions{};
1542
1543 std::array<bool, Regs::NUM_REGS> mme_inline{};
1544
1545 /// Macro method that is currently being executed / being fed parameters.
1546 u32 executing_macro = 0;
1547 /// Parameters that have been submitted to the macro call so far.
1548 std::vector<u32> macro_params;
1549
1550 /// Interpreter for the macro codes uploaded to the GPU.
1551 std::unique_ptr<MacroEngine> macro_engine;
1552
1553 static constexpr u32 null_cb_data = 0xFFFFFFFF;
1554 struct CBDataState {
1555 std::array<std::array<u32, 0x4000>, 16> buffer;
1556 u32 current{null_cb_data};
1557 u32 id{null_cb_data};
1558 u32 start_pos{};
1559 u32 counter{};
1560 };
1561 CBDataState cb_data_state;
1562
1563 Upload::State upload_state;
1564
1565 bool execute_on{true};
1567}; 1566};
1568 1567
1569#define ASSERT_REG_POSITION(field_name, position) \ 1568#define ASSERT_REG_POSITION(field_name, position) \
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h
index 17bd280c4..3c59eeb13 100644
--- a/src/video_core/engines/maxwell_dma.h
+++ b/src/video_core/engines/maxwell_dma.h
@@ -72,11 +72,13 @@ public:
72 72
73 struct RenderEnable { 73 struct RenderEnable {
74 enum class Mode : u32 { 74 enum class Mode : u32 {
75 FALSE = 0, 75 // Note: This uses Pascal case in order to avoid the identifiers
76 TRUE = 1, 76 // FALSE and TRUE, which are reserved on Darwin.
77 CONDITIONAL = 2, 77 False = 0,
78 RENDER_IF_EQUAL = 3, 78 True = 1,
79 RENDER_IF_NOT_EQUAL = 4, 79 Conditional = 2,
80 RenderIfEqual = 3,
81 RenderIfNotEqual = 4,
80 }; 82 };
81 83
82 PackedGPUVAddr address; 84 PackedGPUVAddr address;
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h
index 37d17efdc..8b45f1b62 100644
--- a/src/video_core/engines/shader_bytecode.h
+++ b/src/video_core/engines/shader_bytecode.h
@@ -1437,8 +1437,7 @@ union Instruction {
1437 return TextureType::TextureCube; 1437 return TextureType::TextureCube;
1438 } 1438 }
1439 1439
1440 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}", 1440 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}", texture_info.Value());
1441 static_cast<u32>(texture_info.Value()));
1442 UNREACHABLE(); 1441 UNREACHABLE();
1443 return TextureType::Texture1D; 1442 return TextureType::Texture1D;
1444 } 1443 }
@@ -1533,8 +1532,7 @@ union Instruction {
1533 return TextureType::Texture3D; 1532 return TextureType::Texture3D;
1534 } 1533 }
1535 1534
1536 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}", 1535 LOG_CRITICAL(HW_GPU, "Unhandled texture_info: {}", texture_info.Value());
1537 static_cast<u32>(texture_info.Value()));
1538 UNREACHABLE(); 1536 UNREACHABLE();
1539 return TextureType::Texture1D; 1537 return TextureType::Texture1D;
1540 } 1538 }
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 964b3f3dc..e2512a7f2 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -299,8 +299,7 @@ void GPU::CallPullerMethod(const MethodCall& method_call) {
299 break; 299 break;
300 } 300 }
301 default: 301 default:
302 LOG_ERROR(HW_GPU, "Special puller engine method {:X} not implemented", 302 LOG_ERROR(HW_GPU, "Special puller engine method {:X} not implemented", method);
303 static_cast<u32>(method));
304 break; 303 break;
305 } 304 }
306} 305}
@@ -379,7 +378,7 @@ void GPU::ProcessBindMethod(const MethodCall& method_call) {
379 dma_pusher->BindSubchannel(kepler_memory.get(), method_call.subchannel); 378 dma_pusher->BindSubchannel(kepler_memory.get(), method_call.subchannel);
380 break; 379 break;
381 default: 380 default:
382 UNIMPLEMENTED_MSG("Unimplemented engine {:04X}", static_cast<u32>(engine_id)); 381 UNIMPLEMENTED_MSG("Unimplemented engine {:04X}", engine_id);
383 } 382 }
384} 383}
385 384
@@ -392,8 +391,7 @@ void GPU::ProcessFenceActionMethod() {
392 IncrementSyncPoint(regs.fence_action.syncpoint_id); 391 IncrementSyncPoint(regs.fence_action.syncpoint_id);
393 break; 392 break;
394 default: 393 default:
395 UNIMPLEMENTED_MSG("Unimplemented operation {}", 394 UNIMPLEMENTED_MSG("Unimplemented operation {}", regs.fence_action.op.Value());
396 static_cast<u32>(regs.fence_action.op.Value()));
397 } 395 }
398} 396}
399 397
diff --git a/src/video_core/macro/macro_interpreter.cpp b/src/video_core/macro/macro_interpreter.cpp
index 44a71aa6c..8da26fd59 100644
--- a/src/video_core/macro/macro_interpreter.cpp
+++ b/src/video_core/macro/macro_interpreter.cpp
@@ -133,8 +133,7 @@ bool MacroInterpreterImpl::Step(bool is_delay_slot) {
133 break; 133 break;
134 } 134 }
135 default: 135 default:
136 UNIMPLEMENTED_MSG("Unimplemented macro operation {}", 136 UNIMPLEMENTED_MSG("Unimplemented macro operation {}", opcode.operation.Value());
137 static_cast<u32>(opcode.operation.Value()));
138 } 137 }
139 138
140 // An instruction with the Exit flag will not actually 139 // An instruction with the Exit flag will not actually
@@ -182,7 +181,7 @@ u32 MacroInterpreterImpl::GetALUResult(Macro::ALUOperation operation, u32 src_a,
182 return ~(src_a & src_b); 181 return ~(src_a & src_b);
183 182
184 default: 183 default:
185 UNIMPLEMENTED_MSG("Unimplemented ALU operation {}", static_cast<u32>(operation)); 184 UNIMPLEMENTED_MSG("Unimplemented ALU operation {}", operation);
186 return 0; 185 return 0;
187 } 186 }
188} 187}
@@ -230,7 +229,7 @@ void MacroInterpreterImpl::ProcessResult(Macro::ResultOperation operation, u32 r
230 Send((result >> 12) & 0b111111); 229 Send((result >> 12) & 0b111111);
231 break; 230 break;
232 default: 231 default:
233 UNIMPLEMENTED_MSG("Unimplemented result operation {}", static_cast<u32>(operation)); 232 UNIMPLEMENTED_MSG("Unimplemented result operation {}", operation);
234 } 233 }
235} 234}
236 235
diff --git a/src/video_core/macro/macro_jit_x64.cpp b/src/video_core/macro/macro_jit_x64.cpp
index c82bb987f..c6b2b2109 100644
--- a/src/video_core/macro/macro_jit_x64.cpp
+++ b/src/video_core/macro/macro_jit_x64.cpp
@@ -165,8 +165,7 @@ void MacroJITx64Impl::Compile_ALU(Macro::Opcode opcode) {
165 } 165 }
166 break; 166 break;
167 default: 167 default:
168 UNIMPLEMENTED_MSG("Unimplemented ALU operation {}", 168 UNIMPLEMENTED_MSG("Unimplemented ALU operation {}", opcode.alu_operation.Value());
169 static_cast<std::size_t>(opcode.alu_operation.Value()));
170 break; 169 break;
171 } 170 }
172 Compile_ProcessResult(opcode.result_operation, opcode.dst); 171 Compile_ProcessResult(opcode.result_operation, opcode.dst);
@@ -604,7 +603,7 @@ void MacroJITx64Impl::Compile_ProcessResult(Macro::ResultOperation operation, u3
604 Compile_Send(RESULT); 603 Compile_Send(RESULT);
605 break; 604 break;
606 default: 605 default:
607 UNIMPLEMENTED_MSG("Unimplemented macro operation {}", static_cast<std::size_t>(operation)); 606 UNIMPLEMENTED_MSG("Unimplemented macro operation {}", operation);
608 } 607 }
609} 608}
610 609
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h
index fc54ca0ef..203f2af05 100644
--- a/src/video_core/query_cache.h
+++ b/src/video_core/query_cache.h
@@ -28,8 +28,8 @@ namespace VideoCommon {
28template <class QueryCache, class HostCounter> 28template <class QueryCache, class HostCounter>
29class CounterStreamBase { 29class CounterStreamBase {
30public: 30public:
31 explicit CounterStreamBase(QueryCache& cache, VideoCore::QueryType type) 31 explicit CounterStreamBase(QueryCache& cache_, VideoCore::QueryType type_)
32 : cache{cache}, type{type} {} 32 : cache{cache_}, type{type_} {}
33 33
34 /// Updates the state of the stream, enabling or disabling as needed. 34 /// Updates the state of the stream, enabling or disabling as needed.
35 void Update(bool enabled) { 35 void Update(bool enabled) {
@@ -334,8 +334,8 @@ private:
334template <class HostCounter> 334template <class HostCounter>
335class CachedQueryBase { 335class CachedQueryBase {
336public: 336public:
337 explicit CachedQueryBase(VAddr cpu_addr, u8* host_ptr) 337 explicit CachedQueryBase(VAddr cpu_addr_, u8* host_ptr_)
338 : cpu_addr{cpu_addr}, host_ptr{host_ptr} {} 338 : cpu_addr{cpu_addr_}, host_ptr{host_ptr_} {}
339 virtual ~CachedQueryBase() = default; 339 virtual ~CachedQueryBase() = default;
340 340
341 CachedQueryBase(CachedQueryBase&&) noexcept = default; 341 CachedQueryBase(CachedQueryBase&&) noexcept = default;
diff --git a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
index 5378c398e..3e4d88c30 100644
--- a/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_arb_decompiler.cpp
@@ -71,7 +71,7 @@ std::string_view GetInputFlags(PixelImap attribute) {
71 case PixelImap::Unused: 71 case PixelImap::Unused:
72 break; 72 break;
73 } 73 }
74 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", static_cast<int>(attribute)); 74 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", attribute);
75 return {}; 75 return {};
76} 76}
77 77
@@ -123,7 +123,7 @@ std::string_view PrimitiveDescription(Tegra::Engines::Maxwell3D::Regs::Primitive
123 case Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::TriangleStripAdjacency: 123 case Tegra::Engines::Maxwell3D::Regs::PrimitiveTopology::TriangleStripAdjacency:
124 return "TRIANGLES_ADJACENCY"; 124 return "TRIANGLES_ADJACENCY";
125 default: 125 default:
126 UNIMPLEMENTED_MSG("topology={}", static_cast<int>(topology)); 126 UNIMPLEMENTED_MSG("topology={}", topology);
127 return "POINTS"; 127 return "POINTS";
128 } 128 }
129} 129}
@@ -137,7 +137,7 @@ std::string_view TopologyName(Tegra::Shader::OutputTopology topology) {
137 case Tegra::Shader::OutputTopology::TriangleStrip: 137 case Tegra::Shader::OutputTopology::TriangleStrip:
138 return "TRIANGLE_STRIP"; 138 return "TRIANGLE_STRIP";
139 default: 139 default:
140 UNIMPLEMENTED_MSG("Unknown output topology: {}", static_cast<u32>(topology)); 140 UNIMPLEMENTED_MSG("Unknown output topology: {}", topology);
141 return "points"; 141 return "points";
142 } 142 }
143} 143}
@@ -1351,7 +1351,7 @@ std::string ARBDecompiler::Visit(const Node& node) {
1351 GetGenericAttributeIndex(index), swizzle); 1351 GetGenericAttributeIndex(index), swizzle);
1352 } 1352 }
1353 } 1353 }
1354 UNIMPLEMENTED_MSG("Unimplemented input attribute={}", static_cast<int>(index)); 1354 UNIMPLEMENTED_MSG("Unimplemented input attribute={}", index);
1355 break; 1355 break;
1356 } 1356 }
1357 return "{0, 0, 0, 0}.x"; 1357 return "{0, 0, 0, 0}.x";
@@ -1485,9 +1485,7 @@ void ARBDecompiler::Exit() {
1485 } 1485 }
1486 1486
1487 const auto safe_get_register = [this](u32 reg) -> std::string { 1487 const auto safe_get_register = [this](u32 reg) -> std::string {
1488 // TODO(Rodrigo): Replace with contains once C++20 releases 1488 if (ir.GetRegisters().contains(reg)) {
1489 const auto& used_registers = ir.GetRegisters();
1490 if (used_registers.find(reg) != used_registers.end()) {
1491 return fmt::format("R{}.x", reg); 1489 return fmt::format("R{}.x", reg);
1492 } 1490 }
1493 return "{0, 0, 0, 0}.x"; 1491 return "{0, 0, 0, 0}.x";
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.cpp b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
index b1c4cd62f..60735d502 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.cpp
@@ -22,11 +22,11 @@ using Maxwell = Tegra::Engines::Maxwell3D::Regs;
22 22
23MICROPROFILE_DEFINE(OpenGL_Buffer_Download, "OpenGL", "Buffer Download", MP_RGB(192, 192, 128)); 23MICROPROFILE_DEFINE(OpenGL_Buffer_Download, "OpenGL", "Buffer Download", MP_RGB(192, 192, 128));
24 24
25Buffer::Buffer(const Device& device, VAddr cpu_addr, std::size_t size) 25Buffer::Buffer(const Device& device_, VAddr cpu_addr_, std::size_t size_)
26 : VideoCommon::BufferBlock{cpu_addr, size} { 26 : BufferBlock{cpu_addr_, size_} {
27 gl_buffer.Create(); 27 gl_buffer.Create();
28 glNamedBufferData(gl_buffer.handle, static_cast<GLsizeiptr>(size), nullptr, GL_DYNAMIC_DRAW); 28 glNamedBufferData(gl_buffer.handle, static_cast<GLsizeiptr>(size_), nullptr, GL_DYNAMIC_DRAW);
29 if (device.UseAssemblyShaders() || device.HasVertexBufferUnifiedMemory()) { 29 if (device_.UseAssemblyShaders() || device_.HasVertexBufferUnifiedMemory()) {
30 glMakeNamedBufferResidentNV(gl_buffer.handle, GL_READ_WRITE); 30 glMakeNamedBufferResidentNV(gl_buffer.handle, GL_READ_WRITE);
31 glGetNamedBufferParameterui64vNV(gl_buffer.handle, GL_BUFFER_GPU_ADDRESS_NV, &gpu_address); 31 glGetNamedBufferParameterui64vNV(gl_buffer.handle, GL_BUFFER_GPU_ADDRESS_NV, &gpu_address);
32 } 32 }
@@ -34,14 +34,14 @@ Buffer::Buffer(const Device& device, VAddr cpu_addr, std::size_t size)
34 34
35Buffer::~Buffer() = default; 35Buffer::~Buffer() = default;
36 36
37void Buffer::Upload(std::size_t offset, std::size_t size, const u8* data) { 37void Buffer::Upload(std::size_t offset, std::size_t data_size, const u8* data) {
38 glNamedBufferSubData(Handle(), static_cast<GLintptr>(offset), static_cast<GLsizeiptr>(size), 38 glNamedBufferSubData(Handle(), static_cast<GLintptr>(offset),
39 data); 39 static_cast<GLsizeiptr>(data_size), data);
40} 40}
41 41
42void Buffer::Download(std::size_t offset, std::size_t size, u8* data) { 42void Buffer::Download(std::size_t offset, std::size_t data_size, u8* data) {
43 MICROPROFILE_SCOPE(OpenGL_Buffer_Download); 43 MICROPROFILE_SCOPE(OpenGL_Buffer_Download);
44 const GLsizeiptr gl_size = static_cast<GLsizeiptr>(size); 44 const GLsizeiptr gl_size = static_cast<GLsizeiptr>(data_size);
45 const GLintptr gl_offset = static_cast<GLintptr>(offset); 45 const GLintptr gl_offset = static_cast<GLintptr>(offset);
46 if (read_buffer.handle == 0) { 46 if (read_buffer.handle == 0) {
47 read_buffer.Create(); 47 read_buffer.Create();
@@ -54,16 +54,16 @@ void Buffer::Download(std::size_t offset, std::size_t size, u8* data) {
54} 54}
55 55
56void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset, 56void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset,
57 std::size_t size) { 57 std::size_t copy_size) {
58 glCopyNamedBufferSubData(src.Handle(), Handle(), static_cast<GLintptr>(src_offset), 58 glCopyNamedBufferSubData(src.Handle(), Handle(), static_cast<GLintptr>(src_offset),
59 static_cast<GLintptr>(dst_offset), static_cast<GLsizeiptr>(size)); 59 static_cast<GLintptr>(dst_offset), static_cast<GLsizeiptr>(copy_size));
60} 60}
61 61
62OGLBufferCache::OGLBufferCache(VideoCore::RasterizerInterface& rasterizer, 62OGLBufferCache::OGLBufferCache(VideoCore::RasterizerInterface& rasterizer_,
63 Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, 63 Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_,
64 const Device& device_, std::size_t stream_size) 64 const Device& device_, std::size_t stream_size_)
65 : GenericBufferCache{rasterizer, gpu_memory, cpu_memory, 65 : GenericBufferCache{rasterizer_, gpu_memory_, cpu_memory_,
66 std::make_unique<OGLStreamBuffer>(device_, stream_size, true)}, 66 std::make_unique<OGLStreamBuffer>(device_, stream_size_, true)},
67 device{device_} { 67 device{device_} {
68 if (!device.HasFastBufferSubData()) { 68 if (!device.HasFastBufferSubData()) {
69 return; 69 return;
diff --git a/src/video_core/renderer_opengl/gl_buffer_cache.h b/src/video_core/renderer_opengl/gl_buffer_cache.h
index f75b32e31..95251e26b 100644
--- a/src/video_core/renderer_opengl/gl_buffer_cache.h
+++ b/src/video_core/renderer_opengl/gl_buffer_cache.h
@@ -25,15 +25,15 @@ class RasterizerOpenGL;
25 25
26class Buffer : public VideoCommon::BufferBlock { 26class Buffer : public VideoCommon::BufferBlock {
27public: 27public:
28 explicit Buffer(const Device& device, VAddr cpu_addr, std::size_t size); 28 explicit Buffer(const Device& device_, VAddr cpu_addr_, std::size_t size_);
29 ~Buffer(); 29 ~Buffer();
30 30
31 void Upload(std::size_t offset, std::size_t size, const u8* data); 31 void Upload(std::size_t offset, std::size_t data_size, const u8* data);
32 32
33 void Download(std::size_t offset, std::size_t size, u8* data); 33 void Download(std::size_t offset, std::size_t data_size, u8* data);
34 34
35 void CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset, 35 void CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset,
36 std::size_t size); 36 std::size_t copy_size);
37 37
38 GLuint Handle() const noexcept { 38 GLuint Handle() const noexcept {
39 return gl_buffer.handle; 39 return gl_buffer.handle;
@@ -52,9 +52,9 @@ private:
52using GenericBufferCache = VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuffer>; 52using GenericBufferCache = VideoCommon::BufferCache<Buffer, GLuint, OGLStreamBuffer>;
53class OGLBufferCache final : public GenericBufferCache { 53class OGLBufferCache final : public GenericBufferCache {
54public: 54public:
55 explicit OGLBufferCache(VideoCore::RasterizerInterface& rasterizer, 55 explicit OGLBufferCache(VideoCore::RasterizerInterface& rasterizer_,
56 Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, 56 Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_,
57 const Device& device, std::size_t stream_size); 57 const Device& device_, std::size_t stream_size_);
58 ~OGLBufferCache(); 58 ~OGLBufferCache();
59 59
60 BufferInfo GetEmptyBuffer(std::size_t) override; 60 BufferInfo GetEmptyBuffer(std::size_t) override;
diff --git a/src/video_core/renderer_opengl/gl_query_cache.cpp b/src/video_core/renderer_opengl/gl_query_cache.cpp
index bcc37471f..acebbf5f4 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_query_cache.cpp
@@ -30,11 +30,9 @@ constexpr GLenum GetTarget(VideoCore::QueryType type) {
30 30
31} // Anonymous namespace 31} // Anonymous namespace
32 32
33QueryCache::QueryCache(RasterizerOpenGL& rasterizer, Tegra::Engines::Maxwell3D& maxwell3d, 33QueryCache::QueryCache(RasterizerOpenGL& rasterizer_, Tegra::Engines::Maxwell3D& maxwell3d_,
34 Tegra::MemoryManager& gpu_memory) 34 Tegra::MemoryManager& gpu_memory_)
35 : VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream, HostCounter>( 35 : QueryCacheBase(rasterizer_, maxwell3d_, gpu_memory_), gl_rasterizer{rasterizer_} {}
36 rasterizer, maxwell3d, gpu_memory),
37 gl_rasterizer{rasterizer} {}
38 36
39QueryCache::~QueryCache() = default; 37QueryCache::~QueryCache() = default;
40 38
@@ -59,10 +57,11 @@ bool QueryCache::AnyCommandQueued() const noexcept {
59 return gl_rasterizer.AnyCommandQueued(); 57 return gl_rasterizer.AnyCommandQueued();
60} 58}
61 59
62HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency, 60HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
63 VideoCore::QueryType type_) 61 VideoCore::QueryType type_)
64 : HostCounterBase<QueryCache, HostCounter>{std::move(dependency)}, cache{cache_}, type{type_}, 62 : HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_}, query{
65 query{cache.AllocateQuery(type)} { 63 cache.AllocateQuery(
64 type)} {
66 glBeginQuery(GetTarget(type), query.handle); 65 glBeginQuery(GetTarget(type), query.handle);
67} 66}
68 67
@@ -86,14 +85,14 @@ u64 HostCounter::BlockingQuery() const {
86 return static_cast<u64>(value); 85 return static_cast<u64>(value);
87} 86}
88 87
89CachedQuery::CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr, 88CachedQuery::CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr_,
90 u8* host_ptr) 89 u8* host_ptr_)
91 : CachedQueryBase<HostCounter>{cpu_addr, host_ptr}, cache{&cache_}, type{type_} {} 90 : CachedQueryBase{cpu_addr_, host_ptr_}, cache{&cache_}, type{type_} {}
92 91
93CachedQuery::~CachedQuery() = default; 92CachedQuery::~CachedQuery() = default;
94 93
95CachedQuery::CachedQuery(CachedQuery&& rhs) noexcept 94CachedQuery::CachedQuery(CachedQuery&& rhs) noexcept
96 : CachedQueryBase<HostCounter>(std::move(rhs)), cache{rhs.cache}, type{rhs.type} {} 95 : CachedQueryBase(std::move(rhs)), cache{rhs.cache}, type{rhs.type} {}
97 96
98CachedQuery& CachedQuery::operator=(CachedQuery&& rhs) noexcept { 97CachedQuery& CachedQuery::operator=(CachedQuery&& rhs) noexcept {
99 cache = rhs.cache; 98 cache = rhs.cache;
diff --git a/src/video_core/renderer_opengl/gl_query_cache.h b/src/video_core/renderer_opengl/gl_query_cache.h
index d9851e880..7bbe5cfe9 100644
--- a/src/video_core/renderer_opengl/gl_query_cache.h
+++ b/src/video_core/renderer_opengl/gl_query_cache.h
@@ -29,8 +29,8 @@ using CounterStream = VideoCommon::CounterStreamBase<QueryCache, HostCounter>;
29class QueryCache final 29class QueryCache final
30 : public VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream, HostCounter> { 30 : public VideoCommon::QueryCacheBase<QueryCache, CachedQuery, CounterStream, HostCounter> {
31public: 31public:
32 explicit QueryCache(RasterizerOpenGL& rasterizer, Tegra::Engines::Maxwell3D& maxwell3d, 32 explicit QueryCache(RasterizerOpenGL& rasterizer_, Tegra::Engines::Maxwell3D& maxwell3d_,
33 Tegra::MemoryManager& gpu_memory); 33 Tegra::MemoryManager& gpu_memory_);
34 ~QueryCache(); 34 ~QueryCache();
35 35
36 OGLQuery AllocateQuery(VideoCore::QueryType type); 36 OGLQuery AllocateQuery(VideoCore::QueryType type);
@@ -46,7 +46,7 @@ private:
46 46
47class HostCounter final : public VideoCommon::HostCounterBase<QueryCache, HostCounter> { 47class HostCounter final : public VideoCommon::HostCounterBase<QueryCache, HostCounter> {
48public: 48public:
49 explicit HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency, 49 explicit HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
50 VideoCore::QueryType type_); 50 VideoCore::QueryType type_);
51 ~HostCounter(); 51 ~HostCounter();
52 52
@@ -62,8 +62,8 @@ private:
62 62
63class CachedQuery final : public VideoCommon::CachedQueryBase<HostCounter> { 63class CachedQuery final : public VideoCommon::CachedQueryBase<HostCounter> {
64public: 64public:
65 explicit CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr, 65 explicit CachedQuery(QueryCache& cache_, VideoCore::QueryType type_, VAddr cpu_addr_,
66 u8* host_ptr); 66 u8* host_ptr_);
67 ~CachedQuery() override; 67 ~CachedQuery() override;
68 68
69 CachedQuery(CachedQuery&& rhs) noexcept; 69 CachedQuery(CachedQuery&& rhs) noexcept;
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index cfddbde5d..e58e84759 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -131,7 +131,7 @@ std::pair<GLint, GLint> TransformFeedbackEnum(u8 location) {
131 case 43: 131 case 43:
132 return {GL_BACK_SECONDARY_COLOR_NV, 0}; 132 return {GL_BACK_SECONDARY_COLOR_NV, 0};
133 } 133 }
134 UNIMPLEMENTED_MSG("index={}", static_cast<int>(index)); 134 UNIMPLEMENTED_MSG("index={}", index);
135 return {GL_POSITION, 0}; 135 return {GL_POSITION, 0};
136} 136}
137 137
@@ -149,19 +149,19 @@ void UpdateBindlessSSBOs(GLenum target, const BindlessSSBO* ssbos, size_t num_ss
149 149
150} // Anonymous namespace 150} // Anonymous namespace
151 151
152RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& emu_window, Tegra::GPU& gpu_, 152RasterizerOpenGL::RasterizerOpenGL(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_,
153 Core::Memory::Memory& cpu_memory, const Device& device_, 153 Core::Memory::Memory& cpu_memory_, const Device& device_,
154 ScreenInfo& screen_info_, ProgramManager& program_manager_, 154 ScreenInfo& screen_info_, ProgramManager& program_manager_,
155 StateTracker& state_tracker_) 155 StateTracker& state_tracker_)
156 : RasterizerAccelerated{cpu_memory}, gpu(gpu_), maxwell3d(gpu.Maxwell3D()), 156 : RasterizerAccelerated{cpu_memory_}, gpu(gpu_), maxwell3d(gpu.Maxwell3D()),
157 kepler_compute(gpu.KeplerCompute()), gpu_memory(gpu.MemoryManager()), device(device_), 157 kepler_compute(gpu.KeplerCompute()), gpu_memory(gpu.MemoryManager()), device(device_),
158 screen_info(screen_info_), program_manager(program_manager_), state_tracker(state_tracker_), 158 screen_info(screen_info_), program_manager(program_manager_), state_tracker(state_tracker_),
159 texture_cache(*this, maxwell3d, gpu_memory, device, state_tracker), 159 texture_cache(*this, maxwell3d, gpu_memory, device, state_tracker),
160 shader_cache(*this, emu_window, gpu, maxwell3d, kepler_compute, gpu_memory, device), 160 shader_cache(*this, emu_window_, gpu, maxwell3d, kepler_compute, gpu_memory, device),
161 query_cache(*this, maxwell3d, gpu_memory), 161 query_cache(*this, maxwell3d, gpu_memory),
162 buffer_cache(*this, gpu_memory, cpu_memory, device, STREAM_BUFFER_SIZE), 162 buffer_cache(*this, gpu_memory, cpu_memory_, device, STREAM_BUFFER_SIZE),
163 fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache), 163 fence_manager(*this, gpu, texture_cache, buffer_cache, query_cache),
164 async_shaders(emu_window) { 164 async_shaders(emu_window_) {
165 CheckExtensions(); 165 CheckExtensions();
166 166
167 unified_uniform_buffer.Create(); 167 unified_uniform_buffer.Create();
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 1d0f585fa..de28cff15 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -62,10 +62,10 @@ static_assert(sizeof(BindlessSSBO) * CHAR_BIT == 128);
62 62
63class RasterizerOpenGL : public VideoCore::RasterizerAccelerated { 63class RasterizerOpenGL : public VideoCore::RasterizerAccelerated {
64public: 64public:
65 explicit RasterizerOpenGL(Core::Frontend::EmuWindow& emu_window, Tegra::GPU& gpu, 65 explicit RasterizerOpenGL(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_,
66 Core::Memory::Memory& cpu_memory, const Device& device, 66 Core::Memory::Memory& cpu_memory_, const Device& device_,
67 ScreenInfo& screen_info, ProgramManager& program_manager, 67 ScreenInfo& screen_info_, ProgramManager& program_manager_,
68 StateTracker& state_tracker); 68 StateTracker& state_tracker_);
69 ~RasterizerOpenGL() override; 69 ~RasterizerOpenGL() override;
70 70
71 void Draw(bool is_indexed, bool is_instanced) override; 71 void Draw(bool is_indexed, bool is_instanced) override;
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp
index 9f2c0a222..eabfdea5d 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp
@@ -318,14 +318,13 @@ std::unique_ptr<Shader> Shader::CreateFromCache(const ShaderParameters& params,
318 precompiled_shader.registry, precompiled_shader.entries, precompiled_shader.program)); 318 precompiled_shader.registry, precompiled_shader.entries, precompiled_shader.program));
319} 319}
320 320
321ShaderCacheOpenGL::ShaderCacheOpenGL(RasterizerOpenGL& rasterizer, 321ShaderCacheOpenGL::ShaderCacheOpenGL(RasterizerOpenGL& rasterizer_,
322 Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_, 322 Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_,
323 Tegra::Engines::Maxwell3D& maxwell3d_, 323 Tegra::Engines::Maxwell3D& maxwell3d_,
324 Tegra::Engines::KeplerCompute& kepler_compute_, 324 Tegra::Engines::KeplerCompute& kepler_compute_,
325 Tegra::MemoryManager& gpu_memory_, const Device& device_) 325 Tegra::MemoryManager& gpu_memory_, const Device& device_)
326 : VideoCommon::ShaderCache<Shader>{rasterizer}, emu_window{emu_window_}, gpu{gpu_}, 326 : ShaderCache{rasterizer_}, emu_window{emu_window_}, gpu{gpu_}, gpu_memory{gpu_memory_},
327 gpu_memory{gpu_memory_}, maxwell3d{maxwell3d_}, 327 maxwell3d{maxwell3d_}, kepler_compute{kepler_compute_}, device{device_} {}
328 kepler_compute{kepler_compute_}, device{device_} {}
329 328
330ShaderCacheOpenGL::~ShaderCacheOpenGL() = default; 329ShaderCacheOpenGL::~ShaderCacheOpenGL() = default;
331 330
@@ -460,7 +459,7 @@ void ShaderCacheOpenGL::LoadDiskCache(u64 title_id, const std::atomic_bool& stop
460ProgramSharedPtr ShaderCacheOpenGL::GeneratePrecompiledProgram( 459ProgramSharedPtr ShaderCacheOpenGL::GeneratePrecompiledProgram(
461 const ShaderDiskCacheEntry& entry, const ShaderDiskCachePrecompiled& precompiled_entry, 460 const ShaderDiskCacheEntry& entry, const ShaderDiskCachePrecompiled& precompiled_entry,
462 const std::unordered_set<GLenum>& supported_formats) { 461 const std::unordered_set<GLenum>& supported_formats) {
463 if (supported_formats.find(precompiled_entry.binary_format) == supported_formats.end()) { 462 if (!supported_formats.contains(precompiled_entry.binary_format)) {
464 LOG_INFO(Render_OpenGL, "Precompiled cache entry with unsupported format, removing"); 463 LOG_INFO(Render_OpenGL, "Precompiled cache entry with unsupported format, removing");
465 return {}; 464 return {};
466 } 465 }
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.h b/src/video_core/renderer_opengl/gl_shader_cache.h
index ab5374fac..2aed0697e 100644
--- a/src/video_core/renderer_opengl/gl_shader_cache.h
+++ b/src/video_core/renderer_opengl/gl_shader_cache.h
@@ -119,10 +119,11 @@ private:
119 119
120class ShaderCacheOpenGL final : public VideoCommon::ShaderCache<Shader> { 120class ShaderCacheOpenGL final : public VideoCommon::ShaderCache<Shader> {
121public: 121public:
122 explicit ShaderCacheOpenGL(RasterizerOpenGL& rasterizer, Core::Frontend::EmuWindow& emu_window, 122 explicit ShaderCacheOpenGL(RasterizerOpenGL& rasterizer_,
123 Tegra::GPU& gpu, Tegra::Engines::Maxwell3D& maxwell3d, 123 Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu,
124 Tegra::Engines::KeplerCompute& kepler_compute, 124 Tegra::Engines::Maxwell3D& maxwell3d_,
125 Tegra::MemoryManager& gpu_memory, const Device& device); 125 Tegra::Engines::KeplerCompute& kepler_compute_,
126 Tegra::MemoryManager& gpu_memory_, const Device& device_);
126 ~ShaderCacheOpenGL() override; 127 ~ShaderCacheOpenGL() override;
127 128
128 /// Loads disk cache for the current game 129 /// Loads disk cache for the current game
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
index 0940969ba..ccbdfe967 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.cpp
@@ -316,7 +316,7 @@ std::pair<const char*, u32> GetPrimitiveDescription(Maxwell::PrimitiveTopology t
316 case Maxwell::PrimitiveTopology::TriangleStripAdjacency: 316 case Maxwell::PrimitiveTopology::TriangleStripAdjacency:
317 return {"triangles_adjacency", 6}; 317 return {"triangles_adjacency", 6};
318 default: 318 default:
319 UNIMPLEMENTED_MSG("topology={}", static_cast<int>(topology)); 319 UNIMPLEMENTED_MSG("topology={}", topology);
320 return {"points", 1}; 320 return {"points", 1};
321 } 321 }
322} 322}
@@ -342,7 +342,7 @@ std::string GetTopologyName(Tegra::Shader::OutputTopology topology) {
342 case Tegra::Shader::OutputTopology::TriangleStrip: 342 case Tegra::Shader::OutputTopology::TriangleStrip:
343 return "triangle_strip"; 343 return "triangle_strip";
344 default: 344 default:
345 UNIMPLEMENTED_MSG("Unknown output topology: {}", static_cast<u32>(topology)); 345 UNIMPLEMENTED_MSG("Unknown output topology: {}", topology);
346 return "points"; 346 return "points";
347 } 347 }
348} 348}
@@ -745,7 +745,7 @@ private:
745 case PixelImap::Unused: 745 case PixelImap::Unused:
746 break; 746 break;
747 } 747 }
748 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", static_cast<int>(attribute)); 748 UNIMPLEMENTED_MSG("Unknown attribute usage index={}", attribute);
749 return {}; 749 return {};
750 } 750 }
751 751
@@ -878,7 +878,7 @@ private:
878 } 878 }
879 879
880 u32 binding = device.GetBaseBindings(stage).uniform_buffer; 880 u32 binding = device.GetBaseBindings(stage).uniform_buffer;
881 for (const auto [index, info] : ir.GetConstantBuffers()) { 881 for (const auto& [index, info] : ir.GetConstantBuffers()) {
882 const u32 num_elements = Common::AlignUp(info.GetSize(), 4) / 4; 882 const u32 num_elements = Common::AlignUp(info.GetSize(), 4) / 4;
883 const u32 size = info.IsIndirect() ? MAX_CONSTBUFFER_ELEMENTS : num_elements; 883 const u32 size = info.IsIndirect() ? MAX_CONSTBUFFER_ELEMENTS : num_elements;
884 code.AddLine("layout (std140, binding = {}) uniform {} {{", binding++, 884 code.AddLine("layout (std140, binding = {}) uniform {} {{", binding++,
@@ -1252,7 +1252,7 @@ private:
1252 } 1252 }
1253 break; 1253 break;
1254 } 1254 }
1255 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", static_cast<u32>(attribute)); 1255 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", attribute);
1256 return {"0", Type::Int}; 1256 return {"0", Type::Int};
1257 } 1257 }
1258 1258
@@ -1332,7 +1332,7 @@ private:
1332 GetSwizzle(element)), 1332 GetSwizzle(element)),
1333 Type::Float}}; 1333 Type::Float}};
1334 } 1334 }
1335 UNIMPLEMENTED_MSG("Unhandled output attribute: {}", static_cast<u32>(attribute)); 1335 UNIMPLEMENTED_MSG("Unhandled output attribute: {}", attribute);
1336 return std::nullopt; 1336 return std::nullopt;
1337 } 1337 }
1338 } 1338 }
diff --git a/src/video_core/renderer_opengl/gl_shader_decompiler.h b/src/video_core/renderer_opengl/gl_shader_decompiler.h
index f5a5249f2..c4ff47875 100644
--- a/src/video_core/renderer_opengl/gl_shader_decompiler.h
+++ b/src/video_core/renderer_opengl/gl_shader_decompiler.h
@@ -25,8 +25,8 @@ using ImageEntry = VideoCommon::Shader::Image;
25 25
26class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer { 26class ConstBufferEntry : public VideoCommon::Shader::ConstBuffer {
27public: 27public:
28 explicit ConstBufferEntry(u32 max_offset, bool is_indirect, u32 index_) 28 explicit ConstBufferEntry(u32 max_offset_, bool is_indirect_, u32 index_)
29 : ConstBuffer{max_offset, is_indirect}, index{index_} {} 29 : ConstBuffer{max_offset_, is_indirect_}, index{index_} {}
30 30
31 u32 GetIndex() const { 31 u32 GetIndex() const {
32 return index; 32 return index;
diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
index 70dd0c3c6..955b2abc4 100644
--- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp
@@ -343,7 +343,7 @@ void ShaderDiskCacheOpenGL::SaveEntry(const ShaderDiskCacheEntry& entry) {
343 } 343 }
344 344
345 const u64 id = entry.unique_identifier; 345 const u64 id = entry.unique_identifier;
346 if (stored_transferable.find(id) != stored_transferable.end()) { 346 if (stored_transferable.contains(id)) {
347 // The shader already exists 347 // The shader already exists
348 return; 348 return;
349 } 349 }
diff --git a/src/video_core/renderer_opengl/gl_state_tracker.cpp b/src/video_core/renderer_opengl/gl_state_tracker.cpp
index 6bcf831f2..45f4fc565 100644
--- a/src/video_core/renderer_opengl/gl_state_tracker.cpp
+++ b/src/video_core/renderer_opengl/gl_state_tracker.cpp
@@ -13,7 +13,7 @@
13#include "video_core/renderer_opengl/gl_state_tracker.h" 13#include "video_core/renderer_opengl/gl_state_tracker.h"
14 14
15#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name) 15#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
16#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32)) 16#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
17 17
18namespace OpenGL { 18namespace OpenGL {
19 19
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp
index a59fe853e..daf352b50 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.cpp
+++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp
@@ -347,14 +347,14 @@ void CachedSurface::UploadTextureMipmap(u32 level, const std::vector<u8>& stagin
347 internal_format, image_size, buffer); 347 internal_format, image_size, buffer);
348 break; 348 break;
349 case SurfaceTarget::TextureCubemap: { 349 case SurfaceTarget::TextureCubemap: {
350 const std::size_t layer_size{params.GetHostLayerSize(level)}; 350 const std::size_t host_layer_size{params.GetHostLayerSize(level)};
351 for (std::size_t face = 0; face < params.depth; ++face) { 351 for (std::size_t face = 0; face < params.depth; ++face) {
352 glCompressedTextureSubImage3D(texture.handle, level, 0, 0, static_cast<GLint>(face), 352 glCompressedTextureSubImage3D(texture.handle, level, 0, 0, static_cast<GLint>(face),
353 static_cast<GLsizei>(params.GetMipWidth(level)), 353 static_cast<GLsizei>(params.GetMipWidth(level)),
354 static_cast<GLsizei>(params.GetMipHeight(level)), 1, 354 static_cast<GLsizei>(params.GetMipHeight(level)), 1,
355 internal_format, static_cast<GLsizei>(layer_size), 355 internal_format,
356 buffer); 356 static_cast<GLsizei>(host_layer_size), buffer);
357 buffer += layer_size; 357 buffer += host_layer_size;
358 } 358 }
359 break; 359 break;
360 } 360 }
@@ -532,12 +532,12 @@ OGLTextureView CachedSurfaceView::CreateTextureView() const {
532 return texture_view; 532 return texture_view;
533} 533}
534 534
535TextureCacheOpenGL::TextureCacheOpenGL(VideoCore::RasterizerInterface& rasterizer, 535TextureCacheOpenGL::TextureCacheOpenGL(VideoCore::RasterizerInterface& rasterizer_,
536 Tegra::Engines::Maxwell3D& maxwell3d, 536 Tegra::Engines::Maxwell3D& maxwell3d_,
537 Tegra::MemoryManager& gpu_memory, const Device& device, 537 Tegra::MemoryManager& gpu_memory_, const Device& device_,
538 StateTracker& state_tracker_) 538 StateTracker& state_tracker_)
539 : TextureCacheBase{rasterizer, maxwell3d, gpu_memory, device.HasASTC()}, state_tracker{ 539 : TextureCacheBase{rasterizer_, maxwell3d_, gpu_memory_, device_.HasASTC()},
540 state_tracker_} { 540 state_tracker{state_tracker_} {
541 src_framebuffer.Create(); 541 src_framebuffer.Create();
542 dst_framebuffer.Create(); 542 dst_framebuffer.Create();
543} 543}
@@ -689,8 +689,7 @@ void TextureCacheOpenGL::BufferCopy(Surface& src_surface, Surface& dst_surface)
689 dest_format.format, dest_format.type, nullptr); 689 dest_format.format, dest_format.type, nullptr);
690 break; 690 break;
691 default: 691 default:
692 LOG_CRITICAL(Render_OpenGL, "Unimplemented surface target={}", 692 LOG_CRITICAL(Render_OpenGL, "Unimplemented surface target={}", dst_params.target);
693 static_cast<u32>(dst_params.target));
694 UNREACHABLE(); 693 UNREACHABLE();
695 } 694 }
696 } 695 }
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.h b/src/video_core/renderer_opengl/gl_texture_cache.h
index 76a7b2316..72b284fab 100644
--- a/src/video_core/renderer_opengl/gl_texture_cache.h
+++ b/src/video_core/renderer_opengl/gl_texture_cache.h
@@ -130,9 +130,9 @@ private:
130 130
131class TextureCacheOpenGL final : public TextureCacheBase { 131class TextureCacheOpenGL final : public TextureCacheBase {
132public: 132public:
133 explicit TextureCacheOpenGL(VideoCore::RasterizerInterface& rasterizer, 133 explicit TextureCacheOpenGL(VideoCore::RasterizerInterface& rasterizer_,
134 Tegra::Engines::Maxwell3D& maxwell3d, 134 Tegra::Engines::Maxwell3D& maxwell3d_,
135 Tegra::MemoryManager& gpu_memory, const Device& device, 135 Tegra::MemoryManager& gpu_memory_, const Device& device_,
136 StateTracker& state_tracker); 136 StateTracker& state_tracker);
137 ~TextureCacheOpenGL(); 137 ~TextureCacheOpenGL();
138 138
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index a8be2aa37..dd4ee3361 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -107,7 +107,7 @@ inline GLenum IndexFormat(Maxwell::IndexFormat index_format) {
107 case Maxwell::IndexFormat::UnsignedInt: 107 case Maxwell::IndexFormat::UnsignedInt:
108 return GL_UNSIGNED_INT; 108 return GL_UNSIGNED_INT;
109 } 109 }
110 UNREACHABLE_MSG("Invalid index_format={}", static_cast<u32>(index_format)); 110 UNREACHABLE_MSG("Invalid index_format={}", index_format);
111 return {}; 111 return {};
112} 112}
113 113
@@ -144,7 +144,7 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
144 case Maxwell::PrimitiveTopology::Patches: 144 case Maxwell::PrimitiveTopology::Patches:
145 return GL_PATCHES; 145 return GL_PATCHES;
146 } 146 }
147 UNREACHABLE_MSG("Invalid topology={}", static_cast<int>(topology)); 147 UNREACHABLE_MSG("Invalid topology={}", topology);
148 return GL_POINTS; 148 return GL_POINTS;
149} 149}
150 150
@@ -172,8 +172,8 @@ inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode,
172 } 172 }
173 break; 173 break;
174 } 174 }
175 UNREACHABLE_MSG("Invalid texture filter mode={} and mipmap filter mode={}", 175 UNREACHABLE_MSG("Invalid texture filter mode={} and mipmap filter mode={}", filter_mode,
176 static_cast<u32>(filter_mode), static_cast<u32>(mipmap_filter_mode)); 176 mipmap_filter_mode);
177 return GL_NEAREST; 177 return GL_NEAREST;
178} 178}
179 179
@@ -204,7 +204,7 @@ inline GLenum WrapMode(Tegra::Texture::WrapMode wrap_mode) {
204 return GL_MIRROR_CLAMP_TO_EDGE; 204 return GL_MIRROR_CLAMP_TO_EDGE;
205 } 205 }
206 } 206 }
207 UNIMPLEMENTED_MSG("Unimplemented texture wrap mode={}", static_cast<u32>(wrap_mode)); 207 UNIMPLEMENTED_MSG("Unimplemented texture wrap mode={}", wrap_mode);
208 return GL_REPEAT; 208 return GL_REPEAT;
209} 209}
210 210
@@ -227,7 +227,7 @@ inline GLenum DepthCompareFunc(Tegra::Texture::DepthCompareFunc func) {
227 case Tegra::Texture::DepthCompareFunc::Always: 227 case Tegra::Texture::DepthCompareFunc::Always:
228 return GL_ALWAYS; 228 return GL_ALWAYS;
229 } 229 }
230 UNIMPLEMENTED_MSG("Unimplemented texture depth compare function={}", static_cast<u32>(func)); 230 UNIMPLEMENTED_MSG("Unimplemented texture depth compare function={}", func);
231 return GL_GREATER; 231 return GL_GREATER;
232} 232}
233 233
@@ -249,7 +249,7 @@ inline GLenum BlendEquation(Maxwell::Blend::Equation equation) {
249 case Maxwell::Blend::Equation::MaxGL: 249 case Maxwell::Blend::Equation::MaxGL:
250 return GL_MAX; 250 return GL_MAX;
251 } 251 }
252 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", static_cast<u32>(equation)); 252 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", equation);
253 return GL_FUNC_ADD; 253 return GL_FUNC_ADD;
254} 254}
255 255
@@ -313,7 +313,7 @@ inline GLenum BlendFunc(Maxwell::Blend::Factor factor) {
313 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL: 313 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL:
314 return GL_ONE_MINUS_CONSTANT_ALPHA; 314 return GL_ONE_MINUS_CONSTANT_ALPHA;
315 } 315 }
316 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", static_cast<u32>(factor)); 316 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", factor);
317 return GL_ZERO; 317 return GL_ZERO;
318} 318}
319 319
@@ -333,7 +333,7 @@ inline GLenum SwizzleSource(Tegra::Texture::SwizzleSource source) {
333 case Tegra::Texture::SwizzleSource::OneFloat: 333 case Tegra::Texture::SwizzleSource::OneFloat:
334 return GL_ONE; 334 return GL_ONE;
335 } 335 }
336 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", static_cast<u32>(source)); 336 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", source);
337 return GL_ZERO; 337 return GL_ZERO;
338} 338}
339 339
@@ -364,7 +364,7 @@ inline GLenum ComparisonOp(Maxwell::ComparisonOp comparison) {
364 case Maxwell::ComparisonOp::AlwaysOld: 364 case Maxwell::ComparisonOp::AlwaysOld:
365 return GL_ALWAYS; 365 return GL_ALWAYS;
366 } 366 }
367 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", static_cast<u32>(comparison)); 367 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", comparison);
368 return GL_ALWAYS; 368 return GL_ALWAYS;
369} 369}
370 370
@@ -395,7 +395,7 @@ inline GLenum StencilOp(Maxwell::StencilOp stencil) {
395 case Maxwell::StencilOp::DecrWrapOGL: 395 case Maxwell::StencilOp::DecrWrapOGL:
396 return GL_DECR_WRAP; 396 return GL_DECR_WRAP;
397 } 397 }
398 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", static_cast<u32>(stencil)); 398 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", stencil);
399 return GL_KEEP; 399 return GL_KEEP;
400} 400}
401 401
@@ -406,7 +406,7 @@ inline GLenum FrontFace(Maxwell::FrontFace front_face) {
406 case Maxwell::FrontFace::CounterClockWise: 406 case Maxwell::FrontFace::CounterClockWise:
407 return GL_CCW; 407 return GL_CCW;
408 } 408 }
409 UNIMPLEMENTED_MSG("Unimplemented front face cull={}", static_cast<u32>(front_face)); 409 UNIMPLEMENTED_MSG("Unimplemented front face cull={}", front_face);
410 return GL_CCW; 410 return GL_CCW;
411} 411}
412 412
@@ -419,7 +419,7 @@ inline GLenum CullFace(Maxwell::CullFace cull_face) {
419 case Maxwell::CullFace::FrontAndBack: 419 case Maxwell::CullFace::FrontAndBack:
420 return GL_FRONT_AND_BACK; 420 return GL_FRONT_AND_BACK;
421 } 421 }
422 UNIMPLEMENTED_MSG("Unimplemented cull face={}", static_cast<u32>(cull_face)); 422 UNIMPLEMENTED_MSG("Unimplemented cull face={}", cull_face);
423 return GL_BACK; 423 return GL_BACK;
424} 424}
425 425
@@ -458,7 +458,7 @@ inline GLenum LogicOp(Maxwell::LogicOperation operation) {
458 case Maxwell::LogicOperation::Set: 458 case Maxwell::LogicOperation::Set:
459 return GL_SET; 459 return GL_SET;
460 } 460 }
461 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", static_cast<u32>(operation)); 461 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", operation);
462 return GL_COPY; 462 return GL_COPY;
463} 463}
464 464
@@ -471,7 +471,7 @@ inline GLenum PolygonMode(Maxwell::PolygonMode polygon_mode) {
471 case Maxwell::PolygonMode::Fill: 471 case Maxwell::PolygonMode::Fill:
472 return GL_FILL; 472 return GL_FILL;
473 } 473 }
474 UNREACHABLE_MSG("Invalid polygon mode={}", static_cast<int>(polygon_mode)); 474 UNREACHABLE_MSG("Invalid polygon mode={}", polygon_mode);
475 return GL_FILL; 475 return GL_FILL;
476} 476}
477 477
diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp
index 1523cd6fa..cbfaaa99c 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.cpp
+++ b/src/video_core/renderer_opengl/renderer_opengl.cpp
@@ -130,8 +130,8 @@ void APIENTRY DebugHandler(GLenum source, GLenum type, GLuint id, GLenum severit
130RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_, 130RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_,
131 Core::Frontend::EmuWindow& emu_window_, 131 Core::Frontend::EmuWindow& emu_window_,
132 Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_, 132 Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_,
133 std::unique_ptr<Core::Frontend::GraphicsContext> context) 133 std::unique_ptr<Core::Frontend::GraphicsContext> context_)
134 : RendererBase{emu_window_, std::move(context)}, telemetry_session{telemetry_session_}, 134 : RendererBase{emu_window_, std::move(context_)}, telemetry_session{telemetry_session_},
135 emu_window{emu_window_}, cpu_memory{cpu_memory_}, gpu{gpu_}, program_manager{device} {} 135 emu_window{emu_window_}, cpu_memory{cpu_memory_}, gpu{gpu_}, program_manager{device} {}
136 136
137RendererOpenGL::~RendererOpenGL() = default; 137RendererOpenGL::~RendererOpenGL() = default;
@@ -348,7 +348,7 @@ void RendererOpenGL::DrawScreen(const Layout::FramebufferLayout& layout) {
348 } else { 348 } else {
349 // Other transformations are unsupported 349 // Other transformations are unsupported
350 LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}", 350 LOG_CRITICAL(Render_OpenGL, "Unsupported framebuffer_transform_flags={}",
351 static_cast<u32>(framebuffer_transform_flags)); 351 framebuffer_transform_flags);
352 UNIMPLEMENTED(); 352 UNIMPLEMENTED();
353 } 353 }
354 } 354 }
diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h
index 9ef181f95..376f88766 100644
--- a/src/video_core/renderer_opengl/renderer_opengl.h
+++ b/src/video_core/renderer_opengl/renderer_opengl.h
@@ -57,10 +57,10 @@ struct ScreenInfo {
57 57
58class RendererOpenGL final : public VideoCore::RendererBase { 58class RendererOpenGL final : public VideoCore::RendererBase {
59public: 59public:
60 explicit RendererOpenGL(Core::TelemetrySession& telemetry_session, 60 explicit RendererOpenGL(Core::TelemetrySession& telemetry_session_,
61 Core::Frontend::EmuWindow& emu_window, Core::Memory::Memory& cpu_memory, 61 Core::Frontend::EmuWindow& emu_window_,
62 Tegra::GPU& gpu, 62 Core::Memory::Memory& cpu_memory_, Tegra::GPU& gpu_,
63 std::unique_ptr<Core::Frontend::GraphicsContext> context); 63 std::unique_ptr<Core::Frontend::GraphicsContext> context_);
64 ~RendererOpenGL() override; 64 ~RendererOpenGL() override;
65 65
66 bool Init() override; 66 bool Init() override;
diff --git a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
index d22de1d81..58e117eb3 100644
--- a/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
+++ b/src/video_core/renderer_vulkan/maxwell_to_vk.cpp
@@ -26,7 +26,7 @@ VkFilter Filter(Tegra::Texture::TextureFilter filter) {
26 case Tegra::Texture::TextureFilter::Linear: 26 case Tegra::Texture::TextureFilter::Linear:
27 return VK_FILTER_LINEAR; 27 return VK_FILTER_LINEAR;
28 } 28 }
29 UNREACHABLE_MSG("Invalid sampler filter={}", static_cast<u32>(filter)); 29 UNREACHABLE_MSG("Invalid sampler filter={}", filter);
30 return {}; 30 return {};
31} 31}
32 32
@@ -43,7 +43,7 @@ VkSamplerMipmapMode MipmapMode(Tegra::Texture::TextureMipmapFilter mipmap_filter
43 case Tegra::Texture::TextureMipmapFilter::Linear: 43 case Tegra::Texture::TextureMipmapFilter::Linear:
44 return VK_SAMPLER_MIPMAP_MODE_LINEAR; 44 return VK_SAMPLER_MIPMAP_MODE_LINEAR;
45 } 45 }
46 UNREACHABLE_MSG("Invalid sampler mipmap mode={}", static_cast<u32>(mipmap_filter)); 46 UNREACHABLE_MSG("Invalid sampler mipmap mode={}", mipmap_filter);
47 return {}; 47 return {};
48} 48}
49 49
@@ -79,7 +79,7 @@ VkSamplerAddressMode WrapMode(const VKDevice& device, Tegra::Texture::WrapMode w
79 UNIMPLEMENTED(); 79 UNIMPLEMENTED();
80 return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE; 80 return VK_SAMPLER_ADDRESS_MODE_MIRROR_CLAMP_TO_EDGE;
81 default: 81 default:
82 UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", static_cast<u32>(wrap_mode)); 82 UNIMPLEMENTED_MSG("Unimplemented wrap mode={}", wrap_mode);
83 return {}; 83 return {};
84 } 84 }
85} 85}
@@ -103,8 +103,7 @@ VkCompareOp DepthCompareFunction(Tegra::Texture::DepthCompareFunc depth_compare_
103 case Tegra::Texture::DepthCompareFunc::Always: 103 case Tegra::Texture::DepthCompareFunc::Always:
104 return VK_COMPARE_OP_ALWAYS; 104 return VK_COMPARE_OP_ALWAYS;
105 } 105 }
106 UNIMPLEMENTED_MSG("Unimplemented sampler depth compare function={}", 106 UNIMPLEMENTED_MSG("Unimplemented sampler depth compare function={}", depth_compare_func);
107 static_cast<u32>(depth_compare_func));
108 return {}; 107 return {};
109} 108}
110 109
@@ -228,8 +227,7 @@ FormatInfo SurfaceFormat(const VKDevice& device, FormatType format_type, PixelFo
228 227
229 auto tuple = tex_format_tuples[static_cast<std::size_t>(pixel_format)]; 228 auto tuple = tex_format_tuples[static_cast<std::size_t>(pixel_format)];
230 if (tuple.format == VK_FORMAT_UNDEFINED) { 229 if (tuple.format == VK_FORMAT_UNDEFINED) {
231 UNIMPLEMENTED_MSG("Unimplemented texture format with pixel format={}", 230 UNIMPLEMENTED_MSG("Unimplemented texture format with pixel format={}", pixel_format);
232 static_cast<u32>(pixel_format));
233 return {VK_FORMAT_A8B8G8R8_UNORM_PACK32, true, true}; 231 return {VK_FORMAT_A8B8G8R8_UNORM_PACK32, true, true};
234 } 232 }
235 233
@@ -275,7 +273,7 @@ VkShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage) {
275 case Tegra::Engines::ShaderType::Compute: 273 case Tegra::Engines::ShaderType::Compute:
276 return VK_SHADER_STAGE_COMPUTE_BIT; 274 return VK_SHADER_STAGE_COMPUTE_BIT;
277 } 275 }
278 UNIMPLEMENTED_MSG("Unimplemented shader stage={}", static_cast<u32>(stage)); 276 UNIMPLEMENTED_MSG("Unimplemented shader stage={}", stage);
279 return {}; 277 return {};
280} 278}
281 279
@@ -300,7 +298,7 @@ VkPrimitiveTopology PrimitiveTopology([[maybe_unused]] const VKDevice& device,
300 case Maxwell::PrimitiveTopology::Patches: 298 case Maxwell::PrimitiveTopology::Patches:
301 return VK_PRIMITIVE_TOPOLOGY_PATCH_LIST; 299 return VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
302 default: 300 default:
303 UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology)); 301 UNIMPLEMENTED_MSG("Unimplemented topology={}", topology);
304 return {}; 302 return {};
305 } 303 }
306} 304}
@@ -490,8 +488,7 @@ VkFormat VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttrib
490 } 488 }
491 break; 489 break;
492 } 490 }
493 UNIMPLEMENTED_MSG("Unimplemented vertex format of type={} and size={}", static_cast<u32>(type), 491 UNIMPLEMENTED_MSG("Unimplemented vertex format of type={} and size={}", type, size);
494 static_cast<u32>(size));
495 return {}; 492 return {};
496} 493}
497 494
@@ -522,7 +519,7 @@ VkCompareOp ComparisonOp(Maxwell::ComparisonOp comparison) {
522 case Maxwell::ComparisonOp::AlwaysOld: 519 case Maxwell::ComparisonOp::AlwaysOld:
523 return VK_COMPARE_OP_ALWAYS; 520 return VK_COMPARE_OP_ALWAYS;
524 } 521 }
525 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", static_cast<u32>(comparison)); 522 UNIMPLEMENTED_MSG("Unimplemented comparison op={}", comparison);
526 return {}; 523 return {};
527} 524}
528 525
@@ -539,7 +536,7 @@ VkIndexType IndexFormat(const VKDevice& device, Maxwell::IndexFormat index_forma
539 case Maxwell::IndexFormat::UnsignedInt: 536 case Maxwell::IndexFormat::UnsignedInt:
540 return VK_INDEX_TYPE_UINT32; 537 return VK_INDEX_TYPE_UINT32;
541 } 538 }
542 UNIMPLEMENTED_MSG("Unimplemented index_format={}", static_cast<u32>(index_format)); 539 UNIMPLEMENTED_MSG("Unimplemented index_format={}", index_format);
543 return {}; 540 return {};
544} 541}
545 542
@@ -570,7 +567,7 @@ VkStencilOp StencilOp(Maxwell::StencilOp stencil_op) {
570 case Maxwell::StencilOp::DecrWrapOGL: 567 case Maxwell::StencilOp::DecrWrapOGL:
571 return VK_STENCIL_OP_DECREMENT_AND_WRAP; 568 return VK_STENCIL_OP_DECREMENT_AND_WRAP;
572 } 569 }
573 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", static_cast<u32>(stencil_op)); 570 UNIMPLEMENTED_MSG("Unimplemented stencil op={}", stencil_op);
574 return {}; 571 return {};
575} 572}
576 573
@@ -592,7 +589,7 @@ VkBlendOp BlendEquation(Maxwell::Blend::Equation equation) {
592 case Maxwell::Blend::Equation::MaxGL: 589 case Maxwell::Blend::Equation::MaxGL:
593 return VK_BLEND_OP_MAX; 590 return VK_BLEND_OP_MAX;
594 } 591 }
595 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", static_cast<u32>(equation)); 592 UNIMPLEMENTED_MSG("Unimplemented blend equation={}", equation);
596 return {}; 593 return {};
597} 594}
598 595
@@ -656,7 +653,7 @@ VkBlendFactor BlendFactor(Maxwell::Blend::Factor factor) {
656 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL: 653 case Maxwell::Blend::Factor::OneMinusConstantAlphaGL:
657 return VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA; 654 return VK_BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA;
658 } 655 }
659 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", static_cast<u32>(factor)); 656 UNIMPLEMENTED_MSG("Unimplemented blend factor={}", factor);
660 return {}; 657 return {};
661} 658}
662 659
@@ -667,7 +664,7 @@ VkFrontFace FrontFace(Maxwell::FrontFace front_face) {
667 case Maxwell::FrontFace::CounterClockWise: 664 case Maxwell::FrontFace::CounterClockWise:
668 return VK_FRONT_FACE_COUNTER_CLOCKWISE; 665 return VK_FRONT_FACE_COUNTER_CLOCKWISE;
669 } 666 }
670 UNIMPLEMENTED_MSG("Unimplemented front face={}", static_cast<u32>(front_face)); 667 UNIMPLEMENTED_MSG("Unimplemented front face={}", front_face);
671 return {}; 668 return {};
672} 669}
673 670
@@ -680,7 +677,7 @@ VkCullModeFlags CullFace(Maxwell::CullFace cull_face) {
680 case Maxwell::CullFace::FrontAndBack: 677 case Maxwell::CullFace::FrontAndBack:
681 return VK_CULL_MODE_FRONT_AND_BACK; 678 return VK_CULL_MODE_FRONT_AND_BACK;
682 } 679 }
683 UNIMPLEMENTED_MSG("Unimplemented cull face={}", static_cast<u32>(cull_face)); 680 UNIMPLEMENTED_MSG("Unimplemented cull face={}", cull_face);
684 return {}; 681 return {};
685} 682}
686 683
@@ -700,7 +697,7 @@ VkComponentSwizzle SwizzleSource(Tegra::Texture::SwizzleSource swizzle) {
700 case Tegra::Texture::SwizzleSource::OneFloat: 697 case Tegra::Texture::SwizzleSource::OneFloat:
701 return VK_COMPONENT_SWIZZLE_ONE; 698 return VK_COMPONENT_SWIZZLE_ONE;
702 } 699 }
703 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", static_cast<u32>(swizzle)); 700 UNIMPLEMENTED_MSG("Unimplemented swizzle source={}", swizzle);
704 return {}; 701 return {};
705} 702}
706 703
@@ -723,7 +720,7 @@ VkViewportCoordinateSwizzleNV ViewportSwizzle(Maxwell::ViewportSwizzle swizzle)
723 case Maxwell::ViewportSwizzle::NegativeW: 720 case Maxwell::ViewportSwizzle::NegativeW:
724 return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV; 721 return VK_VIEWPORT_COORDINATE_SWIZZLE_NEGATIVE_W_NV;
725 } 722 }
726 UNREACHABLE_MSG("Invalid swizzle={}", static_cast<int>(swizzle)); 723 UNREACHABLE_MSG("Invalid swizzle={}", swizzle);
727 return {}; 724 return {};
728} 725}
729 726
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
index d9d3da9ea..444d3fb93 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.cpp
@@ -38,13 +38,13 @@ std::unique_ptr<VKStreamBuffer> CreateStreamBuffer(const VKDevice& device, VKSch
38} // Anonymous namespace 38} // Anonymous namespace
39 39
40Buffer::Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKScheduler& scheduler_, 40Buffer::Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKScheduler& scheduler_,
41 VKStagingBufferPool& staging_pool_, VAddr cpu_addr, std::size_t size) 41 VKStagingBufferPool& staging_pool_, VAddr cpu_addr_, std::size_t size_)
42 : BufferBlock{cpu_addr, size}, scheduler{scheduler_}, staging_pool{staging_pool_} { 42 : BufferBlock{cpu_addr_, size_}, scheduler{scheduler_}, staging_pool{staging_pool_} {
43 const VkBufferCreateInfo ci{ 43 const VkBufferCreateInfo ci{
44 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO, 44 .sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
45 .pNext = nullptr, 45 .pNext = nullptr,
46 .flags = 0, 46 .flags = 0,
47 .size = static_cast<VkDeviceSize>(size), 47 .size = static_cast<VkDeviceSize>(size_),
48 .usage = BUFFER_USAGE | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT, 48 .usage = BUFFER_USAGE | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
49 .sharingMode = VK_SHARING_MODE_EXCLUSIVE, 49 .sharingMode = VK_SHARING_MODE_EXCLUSIVE,
50 .queueFamilyIndexCount = 0, 50 .queueFamilyIndexCount = 0,
@@ -57,69 +57,71 @@ Buffer::Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKSchedu
57 57
58Buffer::~Buffer() = default; 58Buffer::~Buffer() = default;
59 59
60void Buffer::Upload(std::size_t offset, std::size_t size, const u8* data) { 60void Buffer::Upload(std::size_t offset, std::size_t data_size, const u8* data) {
61 const auto& staging = staging_pool.GetUnusedBuffer(size, true); 61 const auto& staging = staging_pool.GetUnusedBuffer(data_size, true);
62 std::memcpy(staging.commit->Map(size), data, size); 62 std::memcpy(staging.commit->Map(data_size), data, data_size);
63 63
64 scheduler.RequestOutsideRenderPassOperationContext(); 64 scheduler.RequestOutsideRenderPassOperationContext();
65 65
66 const VkBuffer handle = Handle(); 66 const VkBuffer handle = Handle();
67 scheduler.Record([staging = *staging.handle, handle, offset, size](vk::CommandBuffer cmdbuf) { 67 scheduler.Record(
68 cmdbuf.CopyBuffer(staging, handle, VkBufferCopy{0, offset, size}); 68 [staging = *staging.handle, handle, offset, data_size](vk::CommandBuffer cmdbuf) {
69 69 cmdbuf.CopyBuffer(staging, handle, VkBufferCopy{0, offset, data_size});
70 const VkBufferMemoryBarrier barrier{ 70
71 .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, 71 const VkBufferMemoryBarrier barrier{
72 .pNext = nullptr, 72 .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
73 .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT, 73 .pNext = nullptr,
74 .dstAccessMask = UPLOAD_ACCESS_BARRIERS, 74 .srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT,
75 .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, 75 .dstAccessMask = UPLOAD_ACCESS_BARRIERS,
76 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, 76 .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
77 .buffer = handle, 77 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
78 .offset = offset, 78 .buffer = handle,
79 .size = size, 79 .offset = offset,
80 }; 80 .size = data_size,
81 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, UPLOAD_PIPELINE_STAGE, 0, {}, 81 };
82 barrier, {}); 82 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, UPLOAD_PIPELINE_STAGE, 0, {},
83 }); 83 barrier, {});
84 });
84} 85}
85 86
86void Buffer::Download(std::size_t offset, std::size_t size, u8* data) { 87void Buffer::Download(std::size_t offset, std::size_t data_size, u8* data) {
87 const auto& staging = staging_pool.GetUnusedBuffer(size, true); 88 const auto& staging = staging_pool.GetUnusedBuffer(data_size, true);
88 scheduler.RequestOutsideRenderPassOperationContext(); 89 scheduler.RequestOutsideRenderPassOperationContext();
89 90
90 const VkBuffer handle = Handle(); 91 const VkBuffer handle = Handle();
91 scheduler.Record([staging = *staging.handle, handle, offset, size](vk::CommandBuffer cmdbuf) { 92 scheduler.Record(
92 const VkBufferMemoryBarrier barrier{ 93 [staging = *staging.handle, handle, offset, data_size](vk::CommandBuffer cmdbuf) {
93 .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER, 94 const VkBufferMemoryBarrier barrier{
94 .pNext = nullptr, 95 .sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
95 .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT, 96 .pNext = nullptr,
96 .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT, 97 .srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT,
97 .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, 98 .dstAccessMask = VK_ACCESS_TRANSFER_READ_BIT,
98 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED, 99 .srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
99 .buffer = handle, 100 .dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
100 .offset = offset, 101 .buffer = handle,
101 .size = size, 102 .offset = offset,
102 }; 103 .size = data_size,
103 104 };
104 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | 105
105 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | 106 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_VERTEX_SHADER_BIT |
106 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, 107 VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT |
107 VK_PIPELINE_STAGE_TRANSFER_BIT, 0, {}, barrier, {}); 108 VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
108 cmdbuf.CopyBuffer(handle, staging, VkBufferCopy{offset, 0, size}); 109 VK_PIPELINE_STAGE_TRANSFER_BIT, 0, {}, barrier, {});
109 }); 110 cmdbuf.CopyBuffer(handle, staging, VkBufferCopy{offset, 0, data_size});
111 });
110 scheduler.Finish(); 112 scheduler.Finish();
111 113
112 std::memcpy(data, staging.commit->Map(size), size); 114 std::memcpy(data, staging.commit->Map(data_size), data_size);
113} 115}
114 116
115void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset, 117void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset,
116 std::size_t size) { 118 std::size_t copy_size) {
117 scheduler.RequestOutsideRenderPassOperationContext(); 119 scheduler.RequestOutsideRenderPassOperationContext();
118 120
119 const VkBuffer dst_buffer = Handle(); 121 const VkBuffer dst_buffer = Handle();
120 scheduler.Record([src_buffer = src.Handle(), dst_buffer, src_offset, dst_offset, 122 scheduler.Record([src_buffer = src.Handle(), dst_buffer, src_offset, dst_offset,
121 size](vk::CommandBuffer cmdbuf) { 123 copy_size](vk::CommandBuffer cmdbuf) {
122 cmdbuf.CopyBuffer(src_buffer, dst_buffer, VkBufferCopy{src_offset, dst_offset, size}); 124 cmdbuf.CopyBuffer(src_buffer, dst_buffer, VkBufferCopy{src_offset, dst_offset, copy_size});
123 125
124 std::array<VkBufferMemoryBarrier, 2> barriers; 126 std::array<VkBufferMemoryBarrier, 2> barriers;
125 barriers[0].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; 127 barriers[0].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
@@ -130,7 +132,7 @@ void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst
130 barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 132 barriers[0].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
131 barriers[0].buffer = src_buffer; 133 barriers[0].buffer = src_buffer;
132 barriers[0].offset = src_offset; 134 barriers[0].offset = src_offset;
133 barriers[0].size = size; 135 barriers[0].size = copy_size;
134 barriers[1].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER; 136 barriers[1].sType = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER;
135 barriers[1].pNext = nullptr; 137 barriers[1].pNext = nullptr;
136 barriers[1].srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT; 138 barriers[1].srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
@@ -139,19 +141,17 @@ void Buffer::CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst
139 barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED; 141 barriers[1].dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
140 barriers[1].buffer = dst_buffer; 142 barriers[1].buffer = dst_buffer;
141 barriers[1].offset = dst_offset; 143 barriers[1].offset = dst_offset;
142 barriers[1].size = size; 144 barriers[1].size = copy_size;
143 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, UPLOAD_PIPELINE_STAGE, 0, {}, 145 cmdbuf.PipelineBarrier(VK_PIPELINE_STAGE_TRANSFER_BIT, UPLOAD_PIPELINE_STAGE, 0, {},
144 barriers, {}); 146 barriers, {});
145 }); 147 });
146} 148}
147 149
148VKBufferCache::VKBufferCache(VideoCore::RasterizerInterface& rasterizer, 150VKBufferCache::VKBufferCache(VideoCore::RasterizerInterface& rasterizer_,
149 Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, 151 Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_,
150 const VKDevice& device_, VKMemoryManager& memory_manager_, 152 const VKDevice& device_, VKMemoryManager& memory_manager_,
151 VKScheduler& scheduler_, VKStagingBufferPool& staging_pool_) 153 VKScheduler& scheduler_, VKStagingBufferPool& staging_pool_)
152 : VideoCommon::BufferCache<Buffer, VkBuffer, VKStreamBuffer>{rasterizer, gpu_memory, cpu_memory, 154 : BufferCache{rasterizer_, gpu_memory_, cpu_memory_, CreateStreamBuffer(device_, scheduler_)},
153 CreateStreamBuffer(device_,
154 scheduler_)},
155 device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_}, staging_pool{ 155 device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_}, staging_pool{
156 staging_pool_} {} 156 staging_pool_} {}
157 157
diff --git a/src/video_core/renderer_vulkan/vk_buffer_cache.h b/src/video_core/renderer_vulkan/vk_buffer_cache.h
index 7fb5ceedf..6008b8373 100644
--- a/src/video_core/renderer_vulkan/vk_buffer_cache.h
+++ b/src/video_core/renderer_vulkan/vk_buffer_cache.h
@@ -22,15 +22,15 @@ class VKScheduler;
22class Buffer final : public VideoCommon::BufferBlock { 22class Buffer final : public VideoCommon::BufferBlock {
23public: 23public:
24 explicit Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKScheduler& scheduler, 24 explicit Buffer(const VKDevice& device, VKMemoryManager& memory_manager, VKScheduler& scheduler,
25 VKStagingBufferPool& staging_pool, VAddr cpu_addr, std::size_t size); 25 VKStagingBufferPool& staging_pool, VAddr cpu_addr_, std::size_t size_);
26 ~Buffer(); 26 ~Buffer();
27 27
28 void Upload(std::size_t offset, std::size_t size, const u8* data); 28 void Upload(std::size_t offset, std::size_t data_size, const u8* data);
29 29
30 void Download(std::size_t offset, std::size_t size, u8* data); 30 void Download(std::size_t offset, std::size_t data_size, u8* data);
31 31
32 void CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset, 32 void CopyFrom(const Buffer& src, std::size_t src_offset, std::size_t dst_offset,
33 std::size_t size); 33 std::size_t copy_size);
34 34
35 VkBuffer Handle() const { 35 VkBuffer Handle() const {
36 return *buffer.handle; 36 return *buffer.handle;
@@ -49,10 +49,10 @@ private:
49 49
50class VKBufferCache final : public VideoCommon::BufferCache<Buffer, VkBuffer, VKStreamBuffer> { 50class VKBufferCache final : public VideoCommon::BufferCache<Buffer, VkBuffer, VKStreamBuffer> {
51public: 51public:
52 explicit VKBufferCache(VideoCore::RasterizerInterface& rasterizer, 52 explicit VKBufferCache(VideoCore::RasterizerInterface& rasterizer_,
53 Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, 53 Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_,
54 const VKDevice& device, VKMemoryManager& memory_manager, 54 const VKDevice& device_, VKMemoryManager& memory_manager_,
55 VKScheduler& scheduler, VKStagingBufferPool& staging_pool); 55 VKScheduler& scheduler_, VKStagingBufferPool& staging_pool_);
56 ~VKBufferCache(); 56 ~VKBufferCache();
57 57
58 BufferInfo GetEmptyBuffer(std::size_t size) override; 58 BufferInfo GetEmptyBuffer(std::size_t size) override;
diff --git a/src/video_core/renderer_vulkan/vk_command_pool.cpp b/src/video_core/renderer_vulkan/vk_command_pool.cpp
index 256a39148..8f7d6410e 100644
--- a/src/video_core/renderer_vulkan/vk_command_pool.cpp
+++ b/src/video_core/renderer_vulkan/vk_command_pool.cpp
@@ -17,8 +17,8 @@ struct CommandPool::Pool {
17 vk::CommandBuffers cmdbufs; 17 vk::CommandBuffers cmdbufs;
18}; 18};
19 19
20CommandPool::CommandPool(MasterSemaphore& master_semaphore, const VKDevice& device_) 20CommandPool::CommandPool(MasterSemaphore& master_semaphore_, const VKDevice& device_)
21 : ResourcePool(master_semaphore, COMMAND_BUFFER_POOL_SIZE), device{device_} {} 21 : ResourcePool(master_semaphore_, COMMAND_BUFFER_POOL_SIZE), device{device_} {}
22 22
23CommandPool::~CommandPool() = default; 23CommandPool::~CommandPool() = default;
24 24
diff --git a/src/video_core/renderer_vulkan/vk_command_pool.h b/src/video_core/renderer_vulkan/vk_command_pool.h
index 33655eca4..62a7ce3f1 100644
--- a/src/video_core/renderer_vulkan/vk_command_pool.h
+++ b/src/video_core/renderer_vulkan/vk_command_pool.h
@@ -17,7 +17,7 @@ class VKDevice;
17 17
18class CommandPool final : public ResourcePool { 18class CommandPool final : public ResourcePool {
19public: 19public:
20 explicit CommandPool(MasterSemaphore& master_semaphore, const VKDevice& device_); 20 explicit CommandPool(MasterSemaphore& master_semaphore_, const VKDevice& device_);
21 ~CommandPool() override; 21 ~CommandPool() override;
22 22
23 void Allocate(size_t begin, size_t end) override; 23 void Allocate(size_t begin, size_t end) override;
diff --git a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
index f8a1bcf34..970979fa1 100644
--- a/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
+++ b/src/video_core/renderer_vulkan/vk_graphics_pipeline.cpp
@@ -230,7 +230,7 @@ vk::Pipeline VKGraphicsPipeline::CreatePipeline(const RenderPassParams& renderpa
230 if (!attribute.enabled) { 230 if (!attribute.enabled) {
231 continue; 231 continue;
232 } 232 }
233 if (input_attributes.find(static_cast<u32>(index)) == input_attributes.end()) { 233 if (!input_attributes.contains(static_cast<u32>(index))) {
234 // Skip attributes not used by the vertex shaders. 234 // Skip attributes not used by the vertex shaders.
235 continue; 235 continue;
236 } 236 }
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
index df7e8c864..3fb264d03 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp
@@ -75,7 +75,7 @@ ShaderType GetShaderType(Maxwell::ShaderProgram program) {
75 case Maxwell::ShaderProgram::Fragment: 75 case Maxwell::ShaderProgram::Fragment:
76 return ShaderType::Fragment; 76 return ShaderType::Fragment;
77 default: 77 default:
78 UNIMPLEMENTED_MSG("program={}", static_cast<u32>(program)); 78 UNIMPLEMENTED_MSG("program={}", program);
79 return ShaderType::Vertex; 79 return ShaderType::Vertex;
80 } 80 }
81} 81}
@@ -136,26 +136,25 @@ bool ComputePipelineCacheKey::operator==(const ComputePipelineCacheKey& rhs) con
136 return std::memcmp(&rhs, this, sizeof *this) == 0; 136 return std::memcmp(&rhs, this, sizeof *this) == 0;
137} 137}
138 138
139Shader::Shader(Tegra::Engines::ConstBufferEngineInterface& engine, Tegra::Engines::ShaderType stage, 139Shader::Shader(Tegra::Engines::ConstBufferEngineInterface& engine_, ShaderType stage_,
140 GPUVAddr gpu_addr_, VAddr cpu_addr, VideoCommon::Shader::ProgramCode program_code_, 140 GPUVAddr gpu_addr_, VAddr cpu_addr_, ProgramCode program_code_, u32 main_offset_)
141 u32 main_offset) 141 : gpu_addr(gpu_addr_), program_code(std::move(program_code_)), registry(stage_, engine_),
142 : gpu_addr(gpu_addr_), program_code(std::move(program_code_)), registry(stage, engine), 142 shader_ir(program_code, main_offset_, compiler_settings, registry),
143 shader_ir(program_code, main_offset, compiler_settings, registry),
144 entries(GenerateShaderEntries(shader_ir)) {} 143 entries(GenerateShaderEntries(shader_ir)) {}
145 144
146Shader::~Shader() = default; 145Shader::~Shader() = default;
147 146
148VKPipelineCache::VKPipelineCache(RasterizerVulkan& rasterizer, Tegra::GPU& gpu_, 147VKPipelineCache::VKPipelineCache(RasterizerVulkan& rasterizer_, Tegra::GPU& gpu_,
149 Tegra::Engines::Maxwell3D& maxwell3d_, 148 Tegra::Engines::Maxwell3D& maxwell3d_,
150 Tegra::Engines::KeplerCompute& kepler_compute_, 149 Tegra::Engines::KeplerCompute& kepler_compute_,
151 Tegra::MemoryManager& gpu_memory_, const VKDevice& device_, 150 Tegra::MemoryManager& gpu_memory_, const VKDevice& device_,
152 VKScheduler& scheduler_, VKDescriptorPool& descriptor_pool_, 151 VKScheduler& scheduler_, VKDescriptorPool& descriptor_pool_,
153 VKUpdateDescriptorQueue& update_descriptor_queue_, 152 VKUpdateDescriptorQueue& update_descriptor_queue_,
154 VKRenderPassCache& renderpass_cache_) 153 VKRenderPassCache& renderpass_cache_)
155 : VideoCommon::ShaderCache<Shader>{rasterizer}, gpu{gpu_}, maxwell3d{maxwell3d_}, 154 : ShaderCache{rasterizer_}, gpu{gpu_}, maxwell3d{maxwell3d_}, kepler_compute{kepler_compute_},
156 kepler_compute{kepler_compute_}, gpu_memory{gpu_memory_}, device{device_}, 155 gpu_memory{gpu_memory_}, device{device_}, scheduler{scheduler_},
157 scheduler{scheduler_}, descriptor_pool{descriptor_pool_}, 156 descriptor_pool{descriptor_pool_}, update_descriptor_queue{update_descriptor_queue_},
158 update_descriptor_queue{update_descriptor_queue_}, renderpass_cache{renderpass_cache_} {} 157 renderpass_cache{renderpass_cache_} {}
159 158
160VKPipelineCache::~VKPipelineCache() = default; 159VKPipelineCache::~VKPipelineCache() = default;
161 160
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.h b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
index e558e6658..9e1f8fcbb 100644
--- a/src/video_core/renderer_vulkan/vk_pipeline_cache.h
+++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.h
@@ -84,9 +84,9 @@ namespace Vulkan {
84 84
85class Shader { 85class Shader {
86public: 86public:
87 explicit Shader(Tegra::Engines::ConstBufferEngineInterface& engine, 87 explicit Shader(Tegra::Engines::ConstBufferEngineInterface& engine_,
88 Tegra::Engines::ShaderType stage, GPUVAddr gpu_addr, VAddr cpu_addr, 88 Tegra::Engines::ShaderType stage_, GPUVAddr gpu_addr, VAddr cpu_addr_,
89 VideoCommon::Shader::ProgramCode program_code, u32 main_offset); 89 VideoCommon::Shader::ProgramCode program_code, u32 main_offset_);
90 ~Shader(); 90 ~Shader();
91 91
92 GPUVAddr GetGpuAddr() const { 92 GPUVAddr GetGpuAddr() const {
@@ -119,13 +119,13 @@ private:
119 119
120class VKPipelineCache final : public VideoCommon::ShaderCache<Shader> { 120class VKPipelineCache final : public VideoCommon::ShaderCache<Shader> {
121public: 121public:
122 explicit VKPipelineCache(RasterizerVulkan& rasterizer, Tegra::GPU& gpu, 122 explicit VKPipelineCache(RasterizerVulkan& rasterizer_, Tegra::GPU& gpu_,
123 Tegra::Engines::Maxwell3D& maxwell3d, 123 Tegra::Engines::Maxwell3D& maxwell3d_,
124 Tegra::Engines::KeplerCompute& kepler_compute, 124 Tegra::Engines::KeplerCompute& kepler_compute_,
125 Tegra::MemoryManager& gpu_memory, const VKDevice& device, 125 Tegra::MemoryManager& gpu_memory_, const VKDevice& device_,
126 VKScheduler& scheduler, VKDescriptorPool& descriptor_pool, 126 VKScheduler& scheduler_, VKDescriptorPool& descriptor_pool_,
127 VKUpdateDescriptorQueue& update_descriptor_queue, 127 VKUpdateDescriptorQueue& update_descriptor_queue_,
128 VKRenderPassCache& renderpass_cache); 128 VKRenderPassCache& renderpass_cache_);
129 ~VKPipelineCache() override; 129 ~VKPipelineCache() override;
130 130
131 std::array<Shader*, Maxwell::MaxShaderProgram> GetShaders(); 131 std::array<Shader*, Maxwell::MaxShaderProgram> GetShaders();
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp
index 6fa071737..038760de3 100644
--- a/src/video_core/renderer_vulkan/vk_query_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp
@@ -69,12 +69,10 @@ void QueryPool::Reserve(std::pair<VkQueryPool, u32> query) {
69VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer_, 69VKQueryCache::VKQueryCache(VideoCore::RasterizerInterface& rasterizer_,
70 Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_, 70 Tegra::Engines::Maxwell3D& maxwell3d_, Tegra::MemoryManager& gpu_memory_,
71 const VKDevice& device_, VKScheduler& scheduler_) 71 const VKDevice& device_, VKScheduler& scheduler_)
72 : QueryCacheBase<VKQueryCache, CachedQuery, CounterStream, HostCounter>{rasterizer_, maxwell3d_, 72 : QueryCacheBase{rasterizer_, maxwell3d_, gpu_memory_}, device{device_}, scheduler{scheduler_},
73 gpu_memory_}, 73 query_pools{
74 device{device_}, scheduler{scheduler_}, query_pools{ 74 QueryPool{device_, scheduler_, QueryType::SamplesPassed},
75 QueryPool{device_, scheduler_, 75 } {}
76 QueryType::SamplesPassed},
77 } {}
78 76
79VKQueryCache::~VKQueryCache() { 77VKQueryCache::~VKQueryCache() {
80 // TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class 78 // TODO(Rodrigo): This is a hack to destroy all HostCounter instances before the base class
@@ -97,8 +95,8 @@ void VKQueryCache::Reserve(QueryType type, std::pair<VkQueryPool, u32> query) {
97 95
98HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_, 96HostCounter::HostCounter(VKQueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
99 QueryType type_) 97 QueryType type_)
100 : HostCounterBase<VKQueryCache, HostCounter>{std::move(dependency_)}, cache{cache_}, 98 : HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_},
101 type{type_}, query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} { 99 query{cache_.AllocateQuery(type_)}, tick{cache_.Scheduler().CurrentTick()} {
102 const vk::Device* logical = &cache_.Device().GetLogical(); 100 const vk::Device* logical = &cache_.Device().GetLogical();
103 cache_.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { 101 cache_.Scheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) {
104 logical->ResetQueryPoolEXT(query.first, query.second, 1); 102 logical->ResetQueryPoolEXT(query.first, query.second, 1);
@@ -119,18 +117,20 @@ u64 HostCounter::BlockingQuery() const {
119 if (tick >= cache.Scheduler().CurrentTick()) { 117 if (tick >= cache.Scheduler().CurrentTick()) {
120 cache.Scheduler().Flush(); 118 cache.Scheduler().Flush();
121 } 119 }
120
122 u64 data; 121 u64 data;
123 const VkResult result = cache.Device().GetLogical().GetQueryResults( 122 const VkResult query_result = cache.Device().GetLogical().GetQueryResults(
124 query.first, query.second, 1, sizeof(data), &data, sizeof(data), 123 query.first, query.second, 1, sizeof(data), &data, sizeof(data),
125 VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT); 124 VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
126 switch (result) { 125
126 switch (query_result) {
127 case VK_SUCCESS: 127 case VK_SUCCESS:
128 return data; 128 return data;
129 case VK_ERROR_DEVICE_LOST: 129 case VK_ERROR_DEVICE_LOST:
130 cache.Device().ReportLoss(); 130 cache.Device().ReportLoss();
131 [[fallthrough]]; 131 [[fallthrough]];
132 default: 132 default:
133 throw vk::Exception(result); 133 throw vk::Exception(query_result);
134 } 134 }
135} 135}
136 136
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.h b/src/video_core/renderer_vulkan/vk_query_cache.h
index 201fca888..837fe9ebf 100644
--- a/src/video_core/renderer_vulkan/vk_query_cache.h
+++ b/src/video_core/renderer_vulkan/vk_query_cache.h
@@ -95,8 +95,8 @@ private:
95 95
96class CachedQuery : public VideoCommon::CachedQueryBase<HostCounter> { 96class CachedQuery : public VideoCommon::CachedQueryBase<HostCounter> {
97public: 97public:
98 explicit CachedQuery(VKQueryCache&, VideoCore::QueryType, VAddr cpu_addr, u8* host_ptr) 98 explicit CachedQuery(VKQueryCache&, VideoCore::QueryType, VAddr cpu_addr_, u8* host_ptr_)
99 : VideoCommon::CachedQueryBase<HostCounter>{cpu_addr, host_ptr} {} 99 : CachedQueryBase{cpu_addr_, host_ptr_} {}
100}; 100};
101 101
102} // namespace Vulkan 102} // namespace Vulkan
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
index 560386081..f93986aab 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp
@@ -128,12 +128,12 @@ Tegra::Texture::FullTextureInfo GetTextureInfo(const Engine& engine, const Entry
128 const u32 offset_2 = entry.secondary_offset; 128 const u32 offset_2 = entry.secondary_offset;
129 const u32 handle_1 = engine.AccessConstBuffer32(stage_type, buffer_1, offset_1); 129 const u32 handle_1 = engine.AccessConstBuffer32(stage_type, buffer_1, offset_1);
130 const u32 handle_2 = engine.AccessConstBuffer32(stage_type, buffer_2, offset_2); 130 const u32 handle_2 = engine.AccessConstBuffer32(stage_type, buffer_2, offset_2);
131 return engine.GetTextureInfo(handle_1 | handle_2); 131 return engine.GetTextureInfo(Tegra::Texture::TextureHandle{handle_1 | handle_2});
132 } 132 }
133 } 133 }
134 if (entry.is_bindless) { 134 if (entry.is_bindless) {
135 const auto tex_handle = engine.AccessConstBuffer32(stage_type, entry.buffer, entry.offset); 135 const auto tex_handle = engine.AccessConstBuffer32(stage_type, entry.buffer, entry.offset);
136 return engine.GetTextureInfo(tex_handle); 136 return engine.GetTextureInfo(Tegra::Texture::TextureHandle{tex_handle});
137 } 137 }
138 const auto& gpu_profile = engine.AccessGuestDriverProfile(); 138 const auto& gpu_profile = engine.AccessGuestDriverProfile();
139 const u32 entry_offset = static_cast<u32>(index * gpu_profile.GetTextureHandlerSize()); 139 const u32 entry_offset = static_cast<u32>(index * gpu_profile.GetTextureHandlerSize());
@@ -380,12 +380,12 @@ void RasterizerVulkan::DrawParameters::Draw(vk::CommandBuffer cmdbuf) const {
380 } 380 }
381} 381}
382 382
383RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window, Tegra::GPU& gpu_, 383RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_,
384 Tegra::MemoryManager& gpu_memory_, 384 Tegra::MemoryManager& gpu_memory_,
385 Core::Memory::Memory& cpu_memory, VKScreenInfo& screen_info_, 385 Core::Memory::Memory& cpu_memory_, VKScreenInfo& screen_info_,
386 const VKDevice& device_, VKMemoryManager& memory_manager_, 386 const VKDevice& device_, VKMemoryManager& memory_manager_,
387 StateTracker& state_tracker_, VKScheduler& scheduler_) 387 StateTracker& state_tracker_, VKScheduler& scheduler_)
388 : RasterizerAccelerated(cpu_memory), gpu(gpu_), gpu_memory(gpu_memory_), 388 : RasterizerAccelerated(cpu_memory_), gpu(gpu_), gpu_memory(gpu_memory_),
389 maxwell3d(gpu.Maxwell3D()), kepler_compute(gpu.KeplerCompute()), screen_info(screen_info_), 389 maxwell3d(gpu.Maxwell3D()), kepler_compute(gpu.KeplerCompute()), screen_info(screen_info_),
390 device(device_), memory_manager(memory_manager_), state_tracker(state_tracker_), 390 device(device_), memory_manager(memory_manager_), state_tracker(state_tracker_),
391 scheduler(scheduler_), staging_pool(device, memory_manager, scheduler), 391 scheduler(scheduler_), staging_pool(device, memory_manager, scheduler),
@@ -397,11 +397,11 @@ RasterizerVulkan::RasterizerVulkan(Core::Frontend::EmuWindow& emu_window, Tegra:
397 texture_cache(*this, maxwell3d, gpu_memory, device, memory_manager, scheduler, staging_pool), 397 texture_cache(*this, maxwell3d, gpu_memory, device, memory_manager, scheduler, staging_pool),
398 pipeline_cache(*this, gpu, maxwell3d, kepler_compute, gpu_memory, device, scheduler, 398 pipeline_cache(*this, gpu, maxwell3d, kepler_compute, gpu_memory, device, scheduler,
399 descriptor_pool, update_descriptor_queue, renderpass_cache), 399 descriptor_pool, update_descriptor_queue, renderpass_cache),
400 buffer_cache(*this, gpu_memory, cpu_memory, device, memory_manager, scheduler, staging_pool), 400 buffer_cache(*this, gpu_memory, cpu_memory_, device, memory_manager, scheduler, staging_pool),
401 sampler_cache(device), query_cache(*this, maxwell3d, gpu_memory, device, scheduler), 401 sampler_cache(device), query_cache(*this, maxwell3d, gpu_memory, device, scheduler),
402 fence_manager(*this, gpu, gpu_memory, texture_cache, buffer_cache, query_cache, device, 402 fence_manager(*this, gpu, gpu_memory, texture_cache, buffer_cache, query_cache, device,
403 scheduler), 403 scheduler),
404 wfi_event(device.GetLogical().CreateEvent()), async_shaders(emu_window) { 404 wfi_event(device.GetLogical().CreateEvent()), async_shaders(emu_window_) {
405 scheduler.SetQueryCache(query_cache); 405 scheduler.SetQueryCache(query_cache);
406 if (device.UseAsynchronousShaders()) { 406 if (device.UseAsynchronousShaders()) {
407 async_shaders.AllocateWorkers(); 407 async_shaders.AllocateWorkers();
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h
index 1789fb285..30ec58eb4 100644
--- a/src/video_core/renderer_vulkan/vk_rasterizer.h
+++ b/src/video_core/renderer_vulkan/vk_rasterizer.h
@@ -105,11 +105,11 @@ struct ImageView {
105 105
106class RasterizerVulkan final : public VideoCore::RasterizerAccelerated { 106class RasterizerVulkan final : public VideoCore::RasterizerAccelerated {
107public: 107public:
108 explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window, Tegra::GPU& gpu, 108 explicit RasterizerVulkan(Core::Frontend::EmuWindow& emu_window_, Tegra::GPU& gpu_,
109 Tegra::MemoryManager& gpu_memory, Core::Memory::Memory& cpu_memory, 109 Tegra::MemoryManager& gpu_memory_, Core::Memory::Memory& cpu_memory_,
110 VKScreenInfo& screen_info, const VKDevice& device, 110 VKScreenInfo& screen_info_, const VKDevice& device_,
111 VKMemoryManager& memory_manager, StateTracker& state_tracker, 111 VKMemoryManager& memory_manager_, StateTracker& state_tracker_,
112 VKScheduler& scheduler); 112 VKScheduler& scheduler_);
113 ~RasterizerVulkan() override; 113 ~RasterizerVulkan() override;
114 114
115 void Draw(bool is_indexed, bool is_instanced) override; 115 void Draw(bool is_indexed, bool is_instanced) override;
diff --git a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
index 7b0169acd..ca12b3793 100644
--- a/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
+++ b/src/video_core/renderer_vulkan/vk_shader_decompiler.cpp
@@ -114,7 +114,7 @@ spv::Dim GetSamplerDim(const Sampler& sampler) {
114 case Tegra::Shader::TextureType::TextureCube: 114 case Tegra::Shader::TextureType::TextureCube:
115 return spv::Dim::Cube; 115 return spv::Dim::Cube;
116 default: 116 default:
117 UNIMPLEMENTED_MSG("Unimplemented sampler type={}", static_cast<int>(sampler.type)); 117 UNIMPLEMENTED_MSG("Unimplemented sampler type={}", sampler.type);
118 return spv::Dim::Dim2D; 118 return spv::Dim::Dim2D;
119 } 119 }
120} 120}
@@ -134,7 +134,7 @@ std::pair<spv::Dim, bool> GetImageDim(const Image& image) {
134 case Tegra::Shader::ImageType::Texture3D: 134 case Tegra::Shader::ImageType::Texture3D:
135 return {spv::Dim::Dim3D, false}; 135 return {spv::Dim::Dim3D, false};
136 default: 136 default:
137 UNIMPLEMENTED_MSG("Unimplemented image type={}", static_cast<int>(image.type)); 137 UNIMPLEMENTED_MSG("Unimplemented image type={}", image.type);
138 return {spv::Dim::Dim2D, false}; 138 return {spv::Dim::Dim2D, false};
139 } 139 }
140} 140}
@@ -1254,7 +1254,7 @@ private:
1254 const Id pointer = ArrayPass(type_descriptor.scalar, attribute_id, elements); 1254 const Id pointer = ArrayPass(type_descriptor.scalar, attribute_id, elements);
1255 return {OpLoad(GetTypeDefinition(type), pointer), type}; 1255 return {OpLoad(GetTypeDefinition(type), pointer), type};
1256 } 1256 }
1257 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", static_cast<u32>(attribute)); 1257 UNIMPLEMENTED_MSG("Unhandled input attribute: {}", attribute);
1258 return {v_float_zero, Type::Float}; 1258 return {v_float_zero, Type::Float};
1259 } 1259 }
1260 1260
@@ -1890,7 +1890,7 @@ private:
1890 case Tegra::Shader::TextureType::Texture3D: 1890 case Tegra::Shader::TextureType::Texture3D:
1891 return 3; 1891 return 3;
1892 default: 1892 default:
1893 UNREACHABLE_MSG("Invalid texture type={}", static_cast<int>(type)); 1893 UNREACHABLE_MSG("Invalid texture type={}", type);
1894 return 2; 1894 return 2;
1895 } 1895 }
1896 }(); 1896 }();
@@ -2125,8 +2125,7 @@ private:
2125 OpStore(z_pointer, depth); 2125 OpStore(z_pointer, depth);
2126 } 2126 }
2127 if (stage == ShaderType::Fragment) { 2127 if (stage == ShaderType::Fragment) {
2128 const auto SafeGetRegister = [&](u32 reg) { 2128 const auto SafeGetRegister = [this](u32 reg) {
2129 // TODO(Rodrigo): Replace with contains once C++20 releases
2130 if (const auto it = registers.find(reg); it != registers.end()) { 2129 if (const auto it = registers.find(reg); it != registers.end()) {
2131 return OpLoad(t_float, it->second); 2130 return OpLoad(t_float, it->second);
2132 } 2131 }
diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp
index 5d2c4a796..50164cc08 100644
--- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp
+++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp
@@ -14,7 +14,7 @@
14#include "video_core/renderer_vulkan/vk_state_tracker.h" 14#include "video_core/renderer_vulkan/vk_state_tracker.h"
15 15
16#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name) 16#define OFF(field_name) MAXWELL3D_REG_INDEX(field_name)
17#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32)) 17#define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / (sizeof(u32)))
18 18
19namespace Vulkan { 19namespace Vulkan {
20 20
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
index 64649699f..ae2e3322c 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp
@@ -52,7 +52,7 @@ VkImageType SurfaceTargetToImage(SurfaceTarget target) {
52 UNREACHABLE(); 52 UNREACHABLE();
53 return {}; 53 return {};
54 } 54 }
55 UNREACHABLE_MSG("Unknown texture target={}", static_cast<u32>(target)); 55 UNREACHABLE_MSG("Unknown texture target={}", target);
56 return {}; 56 return {};
57} 57}
58 58
@@ -64,7 +64,7 @@ VkImageAspectFlags PixelFormatToImageAspect(PixelFormat pixel_format) {
64 } else if (pixel_format < PixelFormat::MaxDepthStencilFormat) { 64 } else if (pixel_format < PixelFormat::MaxDepthStencilFormat) {
65 return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT; 65 return VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT;
66 } else { 66 } else {
67 UNREACHABLE_MSG("Invalid pixel format={}", static_cast<int>(pixel_format)); 67 UNREACHABLE_MSG("Invalid pixel format={}", pixel_format);
68 return VK_IMAGE_ASPECT_COLOR_BIT; 68 return VK_IMAGE_ASPECT_COLOR_BIT;
69 } 69 }
70} 70}
@@ -489,12 +489,12 @@ VkImageView CachedSurfaceView::GetAttachment() {
489 return *render_target; 489 return *render_target;
490} 490}
491 491
492VKTextureCache::VKTextureCache(VideoCore::RasterizerInterface& rasterizer, 492VKTextureCache::VKTextureCache(VideoCore::RasterizerInterface& rasterizer_,
493 Tegra::Engines::Maxwell3D& maxwell3d, 493 Tegra::Engines::Maxwell3D& maxwell3d_,
494 Tegra::MemoryManager& gpu_memory, const VKDevice& device_, 494 Tegra::MemoryManager& gpu_memory_, const VKDevice& device_,
495 VKMemoryManager& memory_manager_, VKScheduler& scheduler_, 495 VKMemoryManager& memory_manager_, VKScheduler& scheduler_,
496 VKStagingBufferPool& staging_pool_) 496 VKStagingBufferPool& staging_pool_)
497 : TextureCache(rasterizer, maxwell3d, gpu_memory, device_.IsOptimalAstcSupported()), 497 : TextureCache(rasterizer_, maxwell3d_, gpu_memory_, device_.IsOptimalAstcSupported()),
498 device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_}, staging_pool{ 498 device{device_}, memory_manager{memory_manager_}, scheduler{scheduler_}, staging_pool{
499 staging_pool_} {} 499 staging_pool_} {}
500 500
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.h b/src/video_core/renderer_vulkan/vk_texture_cache.h
index 06880f228..b0be4cb0f 100644
--- a/src/video_core/renderer_vulkan/vk_texture_cache.h
+++ b/src/video_core/renderer_vulkan/vk_texture_cache.h
@@ -82,7 +82,7 @@ public:
82 } 82 }
83 83
84protected: 84protected:
85 void DecorateSurfaceName(); 85 void DecorateSurfaceName() override;
86 86
87 View CreateView(const ViewParams& view_params) override; 87 View CreateView(const ViewParams& view_params) override;
88 88
@@ -193,10 +193,11 @@ private:
193 193
194class VKTextureCache final : public TextureCacheBase { 194class VKTextureCache final : public TextureCacheBase {
195public: 195public:
196 explicit VKTextureCache(VideoCore::RasterizerInterface& rasterizer, 196 explicit VKTextureCache(VideoCore::RasterizerInterface& rasterizer_,
197 Tegra::Engines::Maxwell3D& maxwell3d, Tegra::MemoryManager& gpu_memory, 197 Tegra::Engines::Maxwell3D& maxwell3d_,
198 const VKDevice& device, VKMemoryManager& memory_manager, 198 Tegra::MemoryManager& gpu_memory_, const VKDevice& device_,
199 VKScheduler& scheduler, VKStagingBufferPool& staging_pool); 199 VKMemoryManager& memory_manager_, VKScheduler& scheduler_,
200 VKStagingBufferPool& staging_pool_);
200 ~VKTextureCache(); 201 ~VKTextureCache();
201 202
202private: 203private:
diff --git a/src/video_core/shader/ast.cpp b/src/video_core/shader/ast.cpp
index 3f96d9076..db11144c7 100644
--- a/src/video_core/shader/ast.cpp
+++ b/src/video_core/shader/ast.cpp
@@ -212,16 +212,15 @@ public:
212 } 212 }
213 213
214 void operator()(const ExprPredicate& expr) { 214 void operator()(const ExprPredicate& expr) {
215 inner += "P" + std::to_string(expr.predicate); 215 inner += fmt::format("P{}", expr.predicate);
216 } 216 }
217 217
218 void operator()(const ExprCondCode& expr) { 218 void operator()(const ExprCondCode& expr) {
219 u32 cc = static_cast<u32>(expr.cc); 219 inner += fmt::format("CC{}", expr.cc);
220 inner += "CC" + std::to_string(cc);
221 } 220 }
222 221
223 void operator()(const ExprVar& expr) { 222 void operator()(const ExprVar& expr) {
224 inner += "V" + std::to_string(expr.var_index); 223 inner += fmt::format("V{}", expr.var_index);
225 } 224 }
226 225
227 void operator()(const ExprBoolean& expr) { 226 void operator()(const ExprBoolean& expr) {
@@ -229,7 +228,7 @@ public:
229 } 228 }
230 229
231 void operator()(const ExprGprEqual& expr) { 230 void operator()(const ExprGprEqual& expr) {
232 inner += "( gpr_" + std::to_string(expr.gpr) + " == " + std::to_string(expr.value) + ')'; 231 inner += fmt::format("(gpr_{} == {})", expr.gpr, expr.value);
233 } 232 }
234 233
235 const std::string& GetResult() const { 234 const std::string& GetResult() const {
@@ -374,8 +373,8 @@ std::string ASTManager::Print() const {
374 return printer.GetResult(); 373 return printer.GetResult();
375} 374}
376 375
377ASTManager::ASTManager(bool full_decompile, bool disable_else_derivation) 376ASTManager::ASTManager(bool do_full_decompile, bool disable_else_derivation_)
378 : full_decompile{full_decompile}, disable_else_derivation{disable_else_derivation} {}; 377 : full_decompile{do_full_decompile}, disable_else_derivation{disable_else_derivation_} {}
379 378
380ASTManager::~ASTManager() { 379ASTManager::~ASTManager() {
381 Clear(); 380 Clear();
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h
index 8e5a22ab3..dc49b369e 100644
--- a/src/video_core/shader/ast.h
+++ b/src/video_core/shader/ast.h
@@ -76,7 +76,7 @@ public:
76 76
77class ASTIfThen { 77class ASTIfThen {
78public: 78public:
79 explicit ASTIfThen(Expr condition) : condition{std::move(condition)} {} 79 explicit ASTIfThen(Expr condition_) : condition{std::move(condition_)} {}
80 Expr condition; 80 Expr condition;
81 ASTZipper nodes{}; 81 ASTZipper nodes{};
82}; 82};
@@ -88,63 +88,68 @@ public:
88 88
89class ASTBlockEncoded { 89class ASTBlockEncoded {
90public: 90public:
91 explicit ASTBlockEncoded(u32 start, u32 end) : start{start}, end{end} {} 91 explicit ASTBlockEncoded(u32 start_, u32 _) : start{start_}, end{_} {}
92 u32 start; 92 u32 start;
93 u32 end; 93 u32 end;
94}; 94};
95 95
96class ASTBlockDecoded { 96class ASTBlockDecoded {
97public: 97public:
98 explicit ASTBlockDecoded(NodeBlock&& new_nodes) : nodes(std::move(new_nodes)) {} 98 explicit ASTBlockDecoded(NodeBlock&& new_nodes_) : nodes(std::move(new_nodes_)) {}
99 NodeBlock nodes; 99 NodeBlock nodes;
100}; 100};
101 101
102class ASTVarSet { 102class ASTVarSet {
103public: 103public:
104 explicit ASTVarSet(u32 index, Expr condition) : index{index}, condition{std::move(condition)} {} 104 explicit ASTVarSet(u32 index_, Expr condition_)
105 : index{index_}, condition{std::move(condition_)} {}
106
105 u32 index; 107 u32 index;
106 Expr condition; 108 Expr condition;
107}; 109};
108 110
109class ASTLabel { 111class ASTLabel {
110public: 112public:
111 explicit ASTLabel(u32 index) : index{index} {} 113 explicit ASTLabel(u32 index_) : index{index_} {}
112 u32 index; 114 u32 index;
113 bool unused{}; 115 bool unused{};
114}; 116};
115 117
116class ASTGoto { 118class ASTGoto {
117public: 119public:
118 explicit ASTGoto(Expr condition, u32 label) : condition{std::move(condition)}, label{label} {} 120 explicit ASTGoto(Expr condition_, u32 label_)
121 : condition{std::move(condition_)}, label{label_} {}
122
119 Expr condition; 123 Expr condition;
120 u32 label; 124 u32 label;
121}; 125};
122 126
123class ASTDoWhile { 127class ASTDoWhile {
124public: 128public:
125 explicit ASTDoWhile(Expr condition) : condition{std::move(condition)} {} 129 explicit ASTDoWhile(Expr condition_) : condition{std::move(condition_)} {}
126 Expr condition; 130 Expr condition;
127 ASTZipper nodes{}; 131 ASTZipper nodes{};
128}; 132};
129 133
130class ASTReturn { 134class ASTReturn {
131public: 135public:
132 explicit ASTReturn(Expr condition, bool kills) 136 explicit ASTReturn(Expr condition_, bool kills_)
133 : condition{std::move(condition)}, kills{kills} {} 137 : condition{std::move(condition_)}, kills{kills_} {}
138
134 Expr condition; 139 Expr condition;
135 bool kills; 140 bool kills;
136}; 141};
137 142
138class ASTBreak { 143class ASTBreak {
139public: 144public:
140 explicit ASTBreak(Expr condition) : condition{std::move(condition)} {} 145 explicit ASTBreak(Expr condition_) : condition{std::move(condition_)} {}
141 Expr condition; 146 Expr condition;
142}; 147};
143 148
144class ASTBase { 149class ASTBase {
145public: 150public:
146 explicit ASTBase(ASTNode parent, ASTData data) 151 explicit ASTBase(ASTNode parent_, ASTData data_)
147 : data{std::move(data)}, parent{std::move(parent)} {} 152 : data{std::move(data_)}, parent{std::move(parent_)} {}
148 153
149 template <class U, class... Args> 154 template <class U, class... Args>
150 static ASTNode Make(ASTNode parent, Args&&... args) { 155 static ASTNode Make(ASTNode parent, Args&&... args) {
@@ -300,7 +305,7 @@ private:
300 305
301class ASTManager final { 306class ASTManager final {
302public: 307public:
303 ASTManager(bool full_decompile, bool disable_else_derivation); 308 explicit ASTManager(bool do_full_decompile, bool disable_else_derivation_);
304 ~ASTManager(); 309 ~ASTManager();
305 310
306 ASTManager(const ASTManager& o) = delete; 311 ASTManager(const ASTManager& o) = delete;
diff --git a/src/video_core/shader/async_shaders.cpp b/src/video_core/shader/async_shaders.cpp
index 6920afdf2..78245473c 100644
--- a/src/video_core/shader/async_shaders.cpp
+++ b/src/video_core/shader/async_shaders.cpp
@@ -13,7 +13,7 @@
13 13
14namespace VideoCommon::Shader { 14namespace VideoCommon::Shader {
15 15
16AsyncShaders::AsyncShaders(Core::Frontend::EmuWindow& emu_window) : emu_window(emu_window) {} 16AsyncShaders::AsyncShaders(Core::Frontend::EmuWindow& emu_window_) : emu_window(emu_window_) {}
17 17
18AsyncShaders::~AsyncShaders() { 18AsyncShaders::~AsyncShaders() {
19 KillWorkers(); 19 KillWorkers();
diff --git a/src/video_core/shader/async_shaders.h b/src/video_core/shader/async_shaders.h
index 7a99e1dc5..5a7216019 100644
--- a/src/video_core/shader/async_shaders.h
+++ b/src/video_core/shader/async_shaders.h
@@ -66,7 +66,7 @@ public:
66 Tegra::Engines::ShaderType shader_type; 66 Tegra::Engines::ShaderType shader_type;
67 }; 67 };
68 68
69 explicit AsyncShaders(Core::Frontend::EmuWindow& emu_window); 69 explicit AsyncShaders(Core::Frontend::EmuWindow& emu_window_);
70 ~AsyncShaders(); 70 ~AsyncShaders();
71 71
72 /// Start up shader worker threads 72 /// Start up shader worker threads
diff --git a/src/video_core/shader/control_flow.cpp b/src/video_core/shader/control_flow.cpp
index d656e0668..43d965f2f 100644
--- a/src/video_core/shader/control_flow.cpp
+++ b/src/video_core/shader/control_flow.cpp
@@ -66,8 +66,8 @@ struct BlockInfo {
66}; 66};
67 67
68struct CFGRebuildState { 68struct CFGRebuildState {
69 explicit CFGRebuildState(const ProgramCode& program_code, u32 start, Registry& registry) 69 explicit CFGRebuildState(const ProgramCode& program_code_, u32 start_, Registry& registry_)
70 : program_code{program_code}, registry{registry}, start{start} {} 70 : program_code{program_code_}, registry{registry_}, start{start_} {}
71 71
72 const ProgramCode& program_code; 72 const ProgramCode& program_code;
73 Registry& registry; 73 Registry& registry;
@@ -257,7 +257,7 @@ std::pair<ParseResult, ParseInfo> ParseCode(CFGRebuildState& state, u32 address)
257 single_branch.ignore = false; 257 single_branch.ignore = false;
258 break; 258 break;
259 } 259 }
260 if (state.registered.count(offset) != 0) { 260 if (state.registered.contains(offset)) {
261 single_branch.address = offset; 261 single_branch.address = offset;
262 single_branch.ignore = true; 262 single_branch.ignore = true;
263 break; 263 break;
@@ -632,12 +632,12 @@ void DecompileShader(CFGRebuildState& state) {
632 for (auto label : state.labels) { 632 for (auto label : state.labels) {
633 state.manager->DeclareLabel(label); 633 state.manager->DeclareLabel(label);
634 } 634 }
635 for (auto& block : state.block_info) { 635 for (const auto& block : state.block_info) {
636 if (state.labels.count(block.start) != 0) { 636 if (state.labels.contains(block.start)) {
637 state.manager->InsertLabel(block.start); 637 state.manager->InsertLabel(block.start);
638 } 638 }
639 const bool ignore = BlockBranchIsIgnored(block.branch); 639 const bool ignore = BlockBranchIsIgnored(block.branch);
640 u32 end = ignore ? block.end + 1 : block.end; 640 const u32 end = ignore ? block.end + 1 : block.end;
641 state.manager->InsertBlock(block.start, end); 641 state.manager->InsertBlock(block.start, end);
642 if (!ignore) { 642 if (!ignore) {
643 InsertBranch(*state.manager, block.branch); 643 InsertBranch(*state.manager, block.branch);
@@ -737,7 +737,7 @@ std::unique_ptr<ShaderCharacteristics> ScanFlow(const ProgramCode& program_code,
737 auto back = result_out->blocks.begin(); 737 auto back = result_out->blocks.begin();
738 auto next = std::next(back); 738 auto next = std::next(back);
739 while (next != result_out->blocks.end()) { 739 while (next != result_out->blocks.end()) {
740 if (state.labels.count(next->start) == 0 && next->start == back->end + 1) { 740 if (!state.labels.contains(next->start) && next->start == back->end + 1) {
741 back->end = next->end; 741 back->end = next->end;
742 next = result_out->blocks.erase(next); 742 next = result_out->blocks.erase(next);
743 continue; 743 continue;
diff --git a/src/video_core/shader/control_flow.h b/src/video_core/shader/control_flow.h
index 62a3510d8..37bf96492 100644
--- a/src/video_core/shader/control_flow.h
+++ b/src/video_core/shader/control_flow.h
@@ -42,10 +42,10 @@ struct Condition {
42class SingleBranch { 42class SingleBranch {
43public: 43public:
44 SingleBranch() = default; 44 SingleBranch() = default;
45 SingleBranch(Condition condition, s32 address, bool kill, bool is_sync, bool is_brk, 45 explicit SingleBranch(Condition condition_, s32 address_, bool kill_, bool is_sync_,
46 bool ignore) 46 bool is_brk_, bool ignore_)
47 : condition{condition}, address{address}, kill{kill}, is_sync{is_sync}, is_brk{is_brk}, 47 : condition{condition_}, address{address_}, kill{kill_}, is_sync{is_sync_}, is_brk{is_brk_},
48 ignore{ignore} {} 48 ignore{ignore_} {}
49 49
50 bool operator==(const SingleBranch& b) const { 50 bool operator==(const SingleBranch& b) const {
51 return std::tie(condition, address, kill, is_sync, is_brk, ignore) == 51 return std::tie(condition, address, kill, is_sync, is_brk, ignore) ==
@@ -65,15 +65,15 @@ public:
65}; 65};
66 66
67struct CaseBranch { 67struct CaseBranch {
68 CaseBranch(u32 cmp_value, u32 address) : cmp_value{cmp_value}, address{address} {} 68 explicit CaseBranch(u32 cmp_value_, u32 address_) : cmp_value{cmp_value_}, address{address_} {}
69 u32 cmp_value; 69 u32 cmp_value;
70 u32 address; 70 u32 address;
71}; 71};
72 72
73class MultiBranch { 73class MultiBranch {
74public: 74public:
75 MultiBranch(u32 gpr, std::vector<CaseBranch>&& branches) 75 explicit MultiBranch(u32 gpr_, std::vector<CaseBranch>&& branches_)
76 : gpr{gpr}, branches{std::move(branches)} {} 76 : gpr{gpr_}, branches{std::move(branches_)} {}
77 77
78 u32 gpr{}; 78 u32 gpr{};
79 std::vector<CaseBranch> branches{}; 79 std::vector<CaseBranch> branches{};
diff --git a/src/video_core/shader/decode.cpp b/src/video_core/shader/decode.cpp
index eeac328a6..ab14c1aa3 100644
--- a/src/video_core/shader/decode.cpp
+++ b/src/video_core/shader/decode.cpp
@@ -66,7 +66,7 @@ std::optional<u32> TryDeduceSamplerSize(const Sampler& sampler_to_deduce,
66 66
67class ASTDecoder { 67class ASTDecoder {
68public: 68public:
69 ASTDecoder(ShaderIR& ir) : ir(ir) {} 69 explicit ASTDecoder(ShaderIR& ir_) : ir(ir_) {}
70 70
71 void operator()(ASTProgram& ast) { 71 void operator()(ASTProgram& ast) {
72 ASTNode current = ast.nodes.GetFirst(); 72 ASTNode current = ast.nodes.GetFirst();
@@ -153,8 +153,8 @@ void ShaderIR::Decode() {
153 const auto& blocks = shader_info.blocks; 153 const auto& blocks = shader_info.blocks;
154 NodeBlock current_block; 154 NodeBlock current_block;
155 u32 current_label = static_cast<u32>(exit_branch); 155 u32 current_label = static_cast<u32>(exit_branch);
156 for (auto& block : blocks) { 156 for (const auto& block : blocks) {
157 if (shader_info.labels.count(block.start) != 0) { 157 if (shader_info.labels.contains(block.start)) {
158 insert_block(current_block, current_label); 158 insert_block(current_block, current_label);
159 current_block.clear(); 159 current_block.clear();
160 current_label = block.start; 160 current_label = block.start;
diff --git a/src/video_core/shader/decode/arithmetic.cpp b/src/video_core/shader/decode/arithmetic.cpp
index afef5948d..15eb700e7 100644
--- a/src/video_core/shader/decode/arithmetic.cpp
+++ b/src/video_core/shader/decode/arithmetic.cpp
@@ -110,8 +110,7 @@ u32 ShaderIR::DecodeArithmetic(NodeBlock& bb, u32 pc) {
110 case SubOp::Sqrt: 110 case SubOp::Sqrt:
111 return Operation(OperationCode::FSqrt, PRECISE, op_a); 111 return Operation(OperationCode::FSqrt, PRECISE, op_a);
112 default: 112 default:
113 UNIMPLEMENTED_MSG("Unhandled MUFU sub op={0:x}", 113 UNIMPLEMENTED_MSG("Unhandled MUFU sub op={0:x}", instr.sub_op.Value());
114 static_cast<unsigned>(instr.sub_op.Value()));
115 return Immediate(0); 114 return Immediate(0);
116 } 115 }
117 }(); 116 }();
diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp
index 73155966f..7b5bb7003 100644
--- a/src/video_core/shader/decode/arithmetic_integer.cpp
+++ b/src/video_core/shader/decode/arithmetic_integer.cpp
@@ -83,7 +83,7 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
83 case IAdd3Height::UpperHalfWord: 83 case IAdd3Height::UpperHalfWord:
84 return BitfieldExtract(value, 16, 16); 84 return BitfieldExtract(value, 16, 16);
85 default: 85 default:
86 UNIMPLEMENTED_MSG("Unhandled IADD3 height: {}", static_cast<u32>(height)); 86 UNIMPLEMENTED_MSG("Unhandled IADD3 height: {}", height);
87 return Immediate(0); 87 return Immediate(0);
88 } 88 }
89 }; 89 };
@@ -258,7 +258,7 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
258 case OpCode::Id::LEA_IMM: 258 case OpCode::Id::LEA_IMM:
259 case OpCode::Id::LEA_RZ: 259 case OpCode::Id::LEA_RZ:
260 case OpCode::Id::LEA_HI: { 260 case OpCode::Id::LEA_HI: {
261 auto [op_a, op_b, op_c] = [&]() -> std::tuple<Node, Node, Node> { 261 auto [op_a_, op_b_, op_c_] = [&]() -> std::tuple<Node, Node, Node> {
262 switch (opcode->get().GetId()) { 262 switch (opcode->get().GetId()) {
263 case OpCode::Id::LEA_R2: { 263 case OpCode::Id::LEA_R2: {
264 return {GetRegister(instr.gpr20), GetRegister(instr.gpr39), 264 return {GetRegister(instr.gpr20), GetRegister(instr.gpr39),
@@ -294,8 +294,9 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) {
294 UNIMPLEMENTED_IF_MSG(instr.lea.pred48 != static_cast<u64>(Pred::UnusedIndex), 294 UNIMPLEMENTED_IF_MSG(instr.lea.pred48 != static_cast<u64>(Pred::UnusedIndex),
295 "Unhandled LEA Predicate"); 295 "Unhandled LEA Predicate");
296 296
297 Node value = Operation(OperationCode::ILogicalShiftLeft, std::move(op_a), std::move(op_c)); 297 Node value =
298 value = Operation(OperationCode::IAdd, std::move(op_b), std::move(value)); 298 Operation(OperationCode::ILogicalShiftLeft, std::move(op_a_), std::move(op_c_));
299 value = Operation(OperationCode::IAdd, std::move(op_b_), std::move(value));
299 SetRegister(bb, instr.gpr0, std::move(value)); 300 SetRegister(bb, instr.gpr0, std::move(value));
300 301
301 break; 302 break;
diff --git a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
index 2a30aab2b..73580277a 100644
--- a/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
+++ b/src/video_core/shader/decode/arithmetic_integer_immediate.cpp
@@ -72,7 +72,7 @@ void ShaderIR::WriteLogicOperation(NodeBlock& bb, Register dest, LogicOperation
72 case LogicOperation::PassB: 72 case LogicOperation::PassB:
73 return op_b; 73 return op_b;
74 default: 74 default:
75 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", static_cast<u32>(logic_op)); 75 UNIMPLEMENTED_MSG("Unimplemented logic operation={}", logic_op);
76 return Immediate(0); 76 return Immediate(0);
77 } 77 }
78 }(); 78 }();
@@ -92,8 +92,7 @@ void ShaderIR::WriteLogicOperation(NodeBlock& bb, Register dest, LogicOperation
92 break; 92 break;
93 } 93 }
94 default: 94 default:
95 UNIMPLEMENTED_MSG("Unimplemented predicate result mode: {}", 95 UNIMPLEMENTED_MSG("Unimplemented predicate result mode: {}", predicate_mode);
96 static_cast<u32>(predicate_mode));
97 } 96 }
98} 97}
99 98
diff --git a/src/video_core/shader/decode/conversion.cpp b/src/video_core/shader/decode/conversion.cpp
index b9989c88c..fea7a54df 100644
--- a/src/video_core/shader/decode/conversion.cpp
+++ b/src/video_core/shader/decode/conversion.cpp
@@ -244,7 +244,7 @@ u32 ShaderIR::DecodeConversion(NodeBlock& bb, u32 pc) {
244 return Operation(OperationCode::FTrunc, value); 244 return Operation(OperationCode::FTrunc, value);
245 default: 245 default:
246 UNIMPLEMENTED_MSG("Unimplemented F2F rounding mode {}", 246 UNIMPLEMENTED_MSG("Unimplemented F2F rounding mode {}",
247 static_cast<u32>(instr.conversion.f2f.rounding.Value())); 247 instr.conversion.f2f.rounding.Value());
248 return value; 248 return value;
249 } 249 }
250 }(); 250 }();
@@ -300,7 +300,7 @@ u32 ShaderIR::DecodeConversion(NodeBlock& bb, u32 pc) {
300 return Operation(OperationCode::FTrunc, PRECISE, value); 300 return Operation(OperationCode::FTrunc, PRECISE, value);
301 default: 301 default:
302 UNIMPLEMENTED_MSG("Unimplemented F2I rounding mode {}", 302 UNIMPLEMENTED_MSG("Unimplemented F2I rounding mode {}",
303 static_cast<u32>(instr.conversion.f2i.rounding.Value())); 303 instr.conversion.f2i.rounding.Value());
304 return Immediate(0); 304 return Immediate(0);
305 } 305 }
306 }(); 306 }();
diff --git a/src/video_core/shader/decode/memory.cpp b/src/video_core/shader/decode/memory.cpp
index e2bba88dd..50f4e7d35 100644
--- a/src/video_core/shader/decode/memory.cpp
+++ b/src/video_core/shader/decode/memory.cpp
@@ -47,7 +47,7 @@ OperationCode GetAtomOperation(AtomicOp op) {
47 case AtomicOp::Exch: 47 case AtomicOp::Exch:
48 return OperationCode::AtomicIExchange; 48 return OperationCode::AtomicIExchange;
49 default: 49 default:
50 UNIMPLEMENTED_MSG("op={}", static_cast<int>(op)); 50 UNIMPLEMENTED_MSG("op={}", op);
51 return OperationCode::AtomicIAdd; 51 return OperationCode::AtomicIAdd;
52 } 52 }
53} 53}
@@ -83,7 +83,7 @@ u32 GetMemorySize(Tegra::Shader::UniformType uniform_type) {
83 case Tegra::Shader::UniformType::UnsignedQuad: 83 case Tegra::Shader::UniformType::UnsignedQuad:
84 return 128; 84 return 128;
85 default: 85 default:
86 UNIMPLEMENTED_MSG("Unimplemented size={}!", static_cast<u32>(uniform_type)); 86 UNIMPLEMENTED_MSG("Unimplemented size={}!", uniform_type);
87 return 32; 87 return 32;
88 } 88 }
89} 89}
@@ -175,12 +175,12 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
175 break; 175 break;
176 } 176 }
177 default: 177 default:
178 UNIMPLEMENTED_MSG("Unhandled type: {}", static_cast<unsigned>(instr.ld_c.type.Value())); 178 UNIMPLEMENTED_MSG("Unhandled type: {}", instr.ld_c.type.Value());
179 } 179 }
180 break; 180 break;
181 } 181 }
182 case OpCode::Id::LD_L: 182 case OpCode::Id::LD_L:
183 LOG_DEBUG(HW_GPU, "LD_L cache management mode: {}", static_cast<u64>(instr.ld_l.unknown)); 183 LOG_DEBUG(HW_GPU, "LD_L cache management mode: {}", instr.ld_l.unknown);
184 [[fallthrough]]; 184 [[fallthrough]];
185 case OpCode::Id::LD_S: { 185 case OpCode::Id::LD_S: {
186 const auto GetAddress = [&](s32 offset) { 186 const auto GetAddress = [&](s32 offset) {
@@ -224,7 +224,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
224 } 224 }
225 default: 225 default:
226 UNIMPLEMENTED_MSG("{} Unhandled type: {}", opcode->get().GetName(), 226 UNIMPLEMENTED_MSG("{} Unhandled type: {}", opcode->get().GetName(),
227 static_cast<u32>(instr.ldst_sl.type.Value())); 227 instr.ldst_sl.type.Value());
228 } 228 }
229 break; 229 break;
230 } 230 }
@@ -306,8 +306,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
306 break; 306 break;
307 } 307 }
308 case OpCode::Id::ST_L: 308 case OpCode::Id::ST_L:
309 LOG_DEBUG(HW_GPU, "ST_L cache management mode: {}", 309 LOG_DEBUG(HW_GPU, "ST_L cache management mode: {}", instr.st_l.cache_management.Value());
310 static_cast<u64>(instr.st_l.cache_management.Value()));
311 [[fallthrough]]; 310 [[fallthrough]];
312 case OpCode::Id::ST_S: { 311 case OpCode::Id::ST_S: {
313 const auto GetAddress = [&](s32 offset) { 312 const auto GetAddress = [&](s32 offset) {
@@ -340,7 +339,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
340 } 339 }
341 default: 340 default:
342 UNIMPLEMENTED_MSG("{} unhandled type: {}", opcode->get().GetName(), 341 UNIMPLEMENTED_MSG("{} unhandled type: {}", opcode->get().GetName(),
343 static_cast<u32>(instr.ldst_sl.type.Value())); 342 instr.ldst_sl.type.Value());
344 } 343 }
345 break; 344 break;
346 } 345 }
@@ -387,7 +386,7 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
387 } 386 }
388 case OpCode::Id::RED: { 387 case OpCode::Id::RED: {
389 UNIMPLEMENTED_IF_MSG(instr.red.type != GlobalAtomicType::U32, "type={}", 388 UNIMPLEMENTED_IF_MSG(instr.red.type != GlobalAtomicType::U32, "type={}",
390 static_cast<int>(instr.red.type.Value())); 389 instr.red.type.Value());
391 const auto [real_address, base_address, descriptor] = 390 const auto [real_address, base_address, descriptor] =
392 TrackGlobalMemory(bb, instr, true, true); 391 TrackGlobalMemory(bb, instr, true, true);
393 if (!real_address || !base_address) { 392 if (!real_address || !base_address) {
@@ -403,12 +402,12 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
403 UNIMPLEMENTED_IF_MSG(instr.atom.operation == AtomicOp::Inc || 402 UNIMPLEMENTED_IF_MSG(instr.atom.operation == AtomicOp::Inc ||
404 instr.atom.operation == AtomicOp::Dec || 403 instr.atom.operation == AtomicOp::Dec ||
405 instr.atom.operation == AtomicOp::SafeAdd, 404 instr.atom.operation == AtomicOp::SafeAdd,
406 "operation={}", static_cast<int>(instr.atom.operation.Value())); 405 "operation={}", instr.atom.operation.Value());
407 UNIMPLEMENTED_IF_MSG(instr.atom.type == GlobalAtomicType::S64 || 406 UNIMPLEMENTED_IF_MSG(instr.atom.type == GlobalAtomicType::S64 ||
408 instr.atom.type == GlobalAtomicType::U64 || 407 instr.atom.type == GlobalAtomicType::U64 ||
409 instr.atom.type == GlobalAtomicType::F16x2_FTZ_RN || 408 instr.atom.type == GlobalAtomicType::F16x2_FTZ_RN ||
410 instr.atom.type == GlobalAtomicType::F32_FTZ_RN, 409 instr.atom.type == GlobalAtomicType::F32_FTZ_RN,
411 "type={}", static_cast<int>(instr.atom.type.Value())); 410 "type={}", instr.atom.type.Value());
412 411
413 const auto [real_address, base_address, descriptor] = 412 const auto [real_address, base_address, descriptor] =
414 TrackGlobalMemory(bb, instr, true, true); 413 TrackGlobalMemory(bb, instr, true, true);
@@ -428,10 +427,10 @@ u32 ShaderIR::DecodeMemory(NodeBlock& bb, u32 pc) {
428 case OpCode::Id::ATOMS: { 427 case OpCode::Id::ATOMS: {
429 UNIMPLEMENTED_IF_MSG(instr.atoms.operation == AtomicOp::Inc || 428 UNIMPLEMENTED_IF_MSG(instr.atoms.operation == AtomicOp::Inc ||
430 instr.atoms.operation == AtomicOp::Dec, 429 instr.atoms.operation == AtomicOp::Dec,
431 "operation={}", static_cast<int>(instr.atoms.operation.Value())); 430 "operation={}", instr.atoms.operation.Value());
432 UNIMPLEMENTED_IF_MSG(instr.atoms.type == AtomicType::S64 || 431 UNIMPLEMENTED_IF_MSG(instr.atoms.type == AtomicType::S64 ||
433 instr.atoms.type == AtomicType::U64, 432 instr.atoms.type == AtomicType::U64,
434 "type={}", static_cast<int>(instr.atoms.type.Value())); 433 "type={}", instr.atoms.type.Value());
435 const bool is_signed = 434 const bool is_signed =
436 instr.atoms.type == AtomicType::S32 || instr.atoms.type == AtomicType::S64; 435 instr.atoms.type == AtomicType::S32 || instr.atoms.type == AtomicType::S64;
437 const s32 offset = instr.atoms.GetImmediateOffset(); 436 const s32 offset = instr.atoms.GetImmediateOffset();
diff --git a/src/video_core/shader/decode/other.cpp b/src/video_core/shader/decode/other.cpp
index 1db500bc4..d3ea07aac 100644
--- a/src/video_core/shader/decode/other.cpp
+++ b/src/video_core/shader/decode/other.cpp
@@ -34,14 +34,13 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
34 break; 34 break;
35 } 35 }
36 case OpCode::Id::EXIT: { 36 case OpCode::Id::EXIT: {
37 const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; 37 const ConditionCode cc = instr.flow_condition_code;
38 UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "EXIT condition code used: {}", 38 UNIMPLEMENTED_IF_MSG(cc != ConditionCode::T, "EXIT condition code used: {}", cc);
39 static_cast<u32>(cc));
40 39
41 switch (instr.flow.cond) { 40 switch (instr.flow.cond) {
42 case Tegra::Shader::FlowCondition::Always: 41 case Tegra::Shader::FlowCondition::Always:
43 bb.push_back(Operation(OperationCode::Exit)); 42 bb.push_back(Operation(OperationCode::Exit));
44 if (instr.pred.pred_index == static_cast<u64>(Tegra::Shader::Pred::UnusedIndex)) { 43 if (instr.pred.pred_index == static_cast<u64>(Pred::UnusedIndex)) {
45 // If this is an unconditional exit then just end processing here, 44 // If this is an unconditional exit then just end processing here,
46 // otherwise we have to account for the possibility of the condition 45 // otherwise we have to account for the possibility of the condition
47 // not being met, so continue processing the next instruction. 46 // not being met, so continue processing the next instruction.
@@ -56,17 +55,15 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
56 break; 55 break;
57 56
58 default: 57 default:
59 UNIMPLEMENTED_MSG("Unhandled flow condition: {}", 58 UNIMPLEMENTED_MSG("Unhandled flow condition: {}", instr.flow.cond.Value());
60 static_cast<u32>(instr.flow.cond.Value()));
61 } 59 }
62 break; 60 break;
63 } 61 }
64 case OpCode::Id::KIL: { 62 case OpCode::Id::KIL: {
65 UNIMPLEMENTED_IF(instr.flow.cond != Tegra::Shader::FlowCondition::Always); 63 UNIMPLEMENTED_IF(instr.flow.cond != Tegra::Shader::FlowCondition::Always);
66 64
67 const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; 65 const ConditionCode cc = instr.flow_condition_code;
68 UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "KIL condition code used: {}", 66 UNIMPLEMENTED_IF_MSG(cc != ConditionCode::T, "KIL condition code used: {}", cc);
69 static_cast<u32>(cc));
70 67
71 bb.push_back(Operation(OperationCode::Discard)); 68 bb.push_back(Operation(OperationCode::Discard));
72 break; 69 break;
@@ -130,8 +127,7 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
130 return Immediate(0u); 127 return Immediate(0u);
131 } 128 }
132 default: 129 default:
133 UNIMPLEMENTED_MSG("Unhandled system move: {}", 130 UNIMPLEMENTED_MSG("Unhandled system move: {}", instr.sys20.Value());
134 static_cast<u32>(instr.sys20.Value()));
135 return Immediate(0u); 131 return Immediate(0u);
136 } 132 }
137 }(); 133 }();
@@ -181,8 +177,8 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
181 } 177 }
182 const Node branch = Operation(OperationCode::BranchIndirect, operand); 178 const Node branch = Operation(OperationCode::BranchIndirect, operand);
183 179
184 const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; 180 const ConditionCode cc = instr.flow_condition_code;
185 if (cc != Tegra::Shader::ConditionCode::T) { 181 if (cc != ConditionCode::T) {
186 bb.push_back(Conditional(GetConditionCode(cc), {branch})); 182 bb.push_back(Conditional(GetConditionCode(cc), {branch}));
187 } else { 183 } else {
188 bb.push_back(branch); 184 bb.push_back(branch);
@@ -218,9 +214,8 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
218 break; 214 break;
219 } 215 }
220 case OpCode::Id::SYNC: { 216 case OpCode::Id::SYNC: {
221 const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; 217 const ConditionCode cc = instr.flow_condition_code;
222 UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "SYNC condition code used: {}", 218 UNIMPLEMENTED_IF_MSG(cc != ConditionCode::T, "SYNC condition code used: {}", cc);
223 static_cast<u32>(cc));
224 219
225 if (decompiled) { 220 if (decompiled) {
226 break; 221 break;
@@ -231,9 +226,8 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
231 break; 226 break;
232 } 227 }
233 case OpCode::Id::BRK: { 228 case OpCode::Id::BRK: {
234 const Tegra::Shader::ConditionCode cc = instr.flow_condition_code; 229 const ConditionCode cc = instr.flow_condition_code;
235 UNIMPLEMENTED_IF_MSG(cc != Tegra::Shader::ConditionCode::T, "BRK condition code used: {}", 230 UNIMPLEMENTED_IF_MSG(cc != ConditionCode::T, "BRK condition code used: {}", cc);
236 static_cast<u32>(cc));
237 if (decompiled) { 231 if (decompiled) {
238 break; 232 break;
239 } 233 }
@@ -306,7 +300,7 @@ u32 ShaderIR::DecodeOther(NodeBlock& bb, u32 pc) {
306 case Tegra::Shader::MembarType::GL: 300 case Tegra::Shader::MembarType::GL:
307 return OperationCode::MemoryBarrierGlobal; 301 return OperationCode::MemoryBarrierGlobal;
308 default: 302 default:
309 UNIMPLEMENTED_MSG("MEMBAR type={}", static_cast<int>(instr.membar.type.Value())); 303 UNIMPLEMENTED_MSG("MEMBAR type={}", instr.membar.type.Value());
310 return OperationCode::MemoryBarrierGlobal; 304 return OperationCode::MemoryBarrierGlobal;
311 } 305 }
312 }(); 306 }();
diff --git a/src/video_core/shader/decode/shift.cpp b/src/video_core/shader/decode/shift.cpp
index d4ffa8014..a53819c15 100644
--- a/src/video_core/shader/decode/shift.cpp
+++ b/src/video_core/shader/decode/shift.cpp
@@ -125,7 +125,7 @@ u32 ShaderIR::DecodeShift(NodeBlock& bb, u32 pc) {
125 case OpCode::Id::SHF_LEFT_IMM: { 125 case OpCode::Id::SHF_LEFT_IMM: {
126 UNIMPLEMENTED_IF(instr.generates_cc); 126 UNIMPLEMENTED_IF(instr.generates_cc);
127 UNIMPLEMENTED_IF_MSG(instr.shf.xmode != ShfXmode::None, "xmode={}", 127 UNIMPLEMENTED_IF_MSG(instr.shf.xmode != ShfXmode::None, "xmode={}",
128 static_cast<int>(instr.shf.xmode.Value())); 128 instr.shf.xmode.Value());
129 129
130 if (instr.is_b_imm) { 130 if (instr.is_b_imm) {
131 op_b = Immediate(static_cast<u32>(instr.shf.immediate)); 131 op_b = Immediate(static_cast<u32>(instr.shf.immediate));
diff --git a/src/video_core/shader/decode/texture.cpp b/src/video_core/shader/decode/texture.cpp
index 02fdccd86..fb18f631f 100644
--- a/src/video_core/shader/decode/texture.cpp
+++ b/src/video_core/shader/decode/texture.cpp
@@ -34,7 +34,7 @@ static std::size_t GetCoordCount(TextureType texture_type) {
34 case TextureType::TextureCube: 34 case TextureType::TextureCube:
35 return 3; 35 return 3;
36 default: 36 default:
37 UNIMPLEMENTED_MSG("Unhandled texture type: {}", static_cast<u32>(texture_type)); 37 UNIMPLEMENTED_MSG("Unhandled texture type: {}", texture_type);
38 return 0; 38 return 0;
39 } 39 }
40} 40}
@@ -255,8 +255,7 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
255 break; 255 break;
256 } 256 }
257 default: 257 default:
258 UNIMPLEMENTED_MSG("Unhandled texture query type: {}", 258 UNIMPLEMENTED_MSG("Unhandled texture query type: {}", instr.txq.query_type.Value());
259 static_cast<u32>(instr.txq.query_type.Value()));
260 } 259 }
261 break; 260 break;
262 } 261 }
@@ -302,7 +301,7 @@ u32 ShaderIR::DecodeTexture(NodeBlock& bb, u32 pc) {
302 case TextureType::TextureCube: 301 case TextureType::TextureCube:
303 return 3; 302 return 3;
304 default: 303 default:
305 UNIMPLEMENTED_MSG("Unhandled texture type {}", static_cast<int>(texture_type)); 304 UNIMPLEMENTED_MSG("Unhandled texture type {}", texture_type);
306 return 2; 305 return 2;
307 } 306 }
308 }(); 307 }();
@@ -595,7 +594,7 @@ Node4 ShaderIR::GetTextureCode(Instruction instr, TextureType texture_type,
595 lod = GetRegister(instr.gpr20.Value() + bias_offset); 594 lod = GetRegister(instr.gpr20.Value() + bias_offset);
596 break; 595 break;
597 default: 596 default:
598 UNIMPLEMENTED_MSG("Unimplemented process mode={}", static_cast<u32>(process_mode)); 597 UNIMPLEMENTED_MSG("Unimplemented process mode={}", process_mode);
599 break; 598 break;
600 } 599 }
601 600
diff --git a/src/video_core/shader/decode/warp.cpp b/src/video_core/shader/decode/warp.cpp
index 11b77f795..37433d783 100644
--- a/src/video_core/shader/decode/warp.cpp
+++ b/src/video_core/shader/decode/warp.cpp
@@ -27,7 +27,7 @@ OperationCode GetOperationCode(VoteOperation vote_op) {
27 case VoteOperation::Eq: 27 case VoteOperation::Eq:
28 return OperationCode::VoteEqual; 28 return OperationCode::VoteEqual;
29 default: 29 default:
30 UNREACHABLE_MSG("Invalid vote operation={}", static_cast<u64>(vote_op)); 30 UNREACHABLE_MSG("Invalid vote operation={}", vote_op);
31 return OperationCode::VoteAll; 31 return OperationCode::VoteAll;
32 } 32 }
33} 33}
diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h
index 4e8264367..cda284c72 100644
--- a/src/video_core/shader/expr.h
+++ b/src/video_core/shader/expr.h
@@ -76,7 +76,7 @@ public:
76 76
77class ExprPredicate final { 77class ExprPredicate final {
78public: 78public:
79 explicit ExprPredicate(u32 predicate) : predicate{predicate} {} 79 explicit ExprPredicate(u32 predicate_) : predicate{predicate_} {}
80 80
81 bool operator==(const ExprPredicate& b) const { 81 bool operator==(const ExprPredicate& b) const {
82 return predicate == b.predicate; 82 return predicate == b.predicate;
@@ -91,7 +91,7 @@ public:
91 91
92class ExprCondCode final { 92class ExprCondCode final {
93public: 93public:
94 explicit ExprCondCode(ConditionCode cc) : cc{cc} {} 94 explicit ExprCondCode(ConditionCode condition_code) : cc{condition_code} {}
95 95
96 bool operator==(const ExprCondCode& b) const { 96 bool operator==(const ExprCondCode& b) const {
97 return cc == b.cc; 97 return cc == b.cc;
@@ -121,7 +121,7 @@ public:
121 121
122class ExprGprEqual final { 122class ExprGprEqual final {
123public: 123public:
124 ExprGprEqual(u32 gpr, u32 value) : gpr{gpr}, value{value} {} 124 explicit ExprGprEqual(u32 gpr_, u32 value_) : gpr{gpr_}, value{value_} {}
125 125
126 bool operator==(const ExprGprEqual& b) const { 126 bool operator==(const ExprGprEqual& b) const {
127 return gpr == b.gpr && value == b.value; 127 return gpr == b.gpr && value == b.value;
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h
index a1e2c4d8e..8db9e1de7 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -290,18 +290,18 @@ struct Sampler {
290 is_buffer{is_buffer_}, is_indexed{is_indexed_} {} 290 is_buffer{is_buffer_}, is_indexed{is_indexed_} {}
291 291
292 /// Separate sampler constructor 292 /// Separate sampler constructor
293 constexpr explicit Sampler(u32 index_, std::pair<u32, u32> offsets, std::pair<u32, u32> buffers, 293 constexpr explicit Sampler(u32 index_, std::pair<u32, u32> offsets_,
294 Tegra::Shader::TextureType type, bool is_array_, bool is_shadow_, 294 std::pair<u32, u32> buffers_, Tegra::Shader::TextureType type_,
295 bool is_buffer_) 295 bool is_array_, bool is_shadow_, bool is_buffer_)
296 : index{index_}, offset{offsets.first}, secondary_offset{offsets.second}, 296 : index{index_}, offset{offsets_.first}, secondary_offset{offsets_.second},
297 buffer{buffers.first}, secondary_buffer{buffers.second}, type{type}, is_array{is_array_}, 297 buffer{buffers_.first}, secondary_buffer{buffers_.second}, type{type_},
298 is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_separated{true} {} 298 is_array{is_array_}, is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_separated{true} {}
299 299
300 /// Bindless samplers constructor 300 /// Bindless samplers constructor
301 constexpr explicit Sampler(u32 index_, u32 offset_, u32 buffer_, 301 constexpr explicit Sampler(u32 index_, u32 offset_, u32 buffer_,
302 Tegra::Shader::TextureType type, bool is_array_, bool is_shadow_, 302 Tegra::Shader::TextureType type_, bool is_array_, bool is_shadow_,
303 bool is_buffer_, bool is_indexed_) 303 bool is_buffer_, bool is_indexed_)
304 : index{index_}, offset{offset_}, buffer{buffer_}, type{type}, is_array{is_array_}, 304 : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_array{is_array_},
305 is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_bindless{true}, is_indexed{is_indexed_} { 305 is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_bindless{true}, is_indexed{is_indexed_} {
306 } 306 }
307 307
diff --git a/src/video_core/shader/node_helper.cpp b/src/video_core/shader/node_helper.cpp
index 7bf4ff387..6a5b6940d 100644
--- a/src/video_core/shader/node_helper.cpp
+++ b/src/video_core/shader/node_helper.cpp
@@ -107,7 +107,7 @@ OperationCode SignedToUnsignedCode(OperationCode operation_code, bool is_signed)
107 UNREACHABLE_MSG("Can't apply absolute to an unsigned integer"); 107 UNREACHABLE_MSG("Can't apply absolute to an unsigned integer");
108 return {}; 108 return {};
109 default: 109 default:
110 UNREACHABLE_MSG("Unknown signed operation with code={}", static_cast<u32>(operation_code)); 110 UNREACHABLE_MSG("Unknown signed operation with code={}", operation_code);
111 return {}; 111 return {};
112 } 112 }
113} 113}
diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp
index 29d794b34..a4987ffc6 100644
--- a/src/video_core/shader/shader_ir.cpp
+++ b/src/video_core/shader/shader_ir.cpp
@@ -25,9 +25,10 @@ using Tegra::Shader::PredCondition;
25using Tegra::Shader::PredOperation; 25using Tegra::Shader::PredOperation;
26using Tegra::Shader::Register; 26using Tegra::Shader::Register;
27 27
28ShaderIR::ShaderIR(const ProgramCode& program_code, u32 main_offset, CompilerSettings settings, 28ShaderIR::ShaderIR(const ProgramCode& program_code_, u32 main_offset_, CompilerSettings settings_,
29 Registry& registry) 29 Registry& registry_)
30 : program_code{program_code}, main_offset{main_offset}, settings{settings}, registry{registry} { 30 : program_code{program_code_}, main_offset{main_offset_}, settings{settings_}, registry{
31 registry_} {
31 Decode(); 32 Decode();
32 PostDecode(); 33 PostDecode();
33} 34}
@@ -170,7 +171,7 @@ Node ShaderIR::ConvertIntegerSize(Node value, Register::Size size, bool is_signe
170 // Default - do nothing 171 // Default - do nothing
171 return value; 172 return value;
172 default: 173 default:
173 UNREACHABLE_MSG("Unimplemented conversion size: {}", static_cast<u32>(size)); 174 UNREACHABLE_MSG("Unimplemented conversion size: {}", size);
174 return value; 175 return value;
175 } 176 }
176} 177}
@@ -335,15 +336,15 @@ OperationCode ShaderIR::GetPredicateCombiner(PredOperation operation) {
335 return operation_table[index]; 336 return operation_table[index];
336} 337}
337 338
338Node ShaderIR::GetConditionCode(Tegra::Shader::ConditionCode cc) const { 339Node ShaderIR::GetConditionCode(ConditionCode cc) const {
339 switch (cc) { 340 switch (cc) {
340 case Tegra::Shader::ConditionCode::NEU: 341 case ConditionCode::NEU:
341 return GetInternalFlag(InternalFlag::Zero, true); 342 return GetInternalFlag(InternalFlag::Zero, true);
342 case Tegra::Shader::ConditionCode::FCSM_TR: 343 case ConditionCode::FCSM_TR:
343 UNIMPLEMENTED_MSG("EXIT.FCSM_TR is not implemented"); 344 UNIMPLEMENTED_MSG("EXIT.FCSM_TR is not implemented");
344 return MakeNode<PredicateNode>(Pred::NeverExecute, false); 345 return MakeNode<PredicateNode>(Pred::NeverExecute, false);
345 default: 346 default:
346 UNIMPLEMENTED_MSG("Unimplemented condition code: {}", static_cast<u32>(cc)); 347 UNIMPLEMENTED_MSG("Unimplemented condition code: {}", cc);
347 return MakeNode<PredicateNode>(Pred::NeverExecute, false); 348 return MakeNode<PredicateNode>(Pred::NeverExecute, false);
348 } 349 }
349} 350}
@@ -451,8 +452,8 @@ void ShaderIR::MarkAttributeUsage(Attribute::Index index, u64 element) {
451} 452}
452 453
453std::size_t ShaderIR::DeclareAmend(Node new_amend) { 454std::size_t ShaderIR::DeclareAmend(Node new_amend) {
454 const std::size_t id = amend_code.size(); 455 const auto id = amend_code.size();
455 amend_code.push_back(new_amend); 456 amend_code.push_back(std::move(new_amend));
456 return id; 457 return id;
457} 458}
458 459
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index 3a98b2104..6aae14e34 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -29,8 +29,8 @@ struct ShaderBlock;
29constexpr u32 MAX_PROGRAM_LENGTH = 0x1000; 29constexpr u32 MAX_PROGRAM_LENGTH = 0x1000;
30 30
31struct ConstBuffer { 31struct ConstBuffer {
32 constexpr explicit ConstBuffer(u32 max_offset, bool is_indirect) 32 constexpr explicit ConstBuffer(u32 max_offset_, bool is_indirect_)
33 : max_offset{max_offset}, is_indirect{is_indirect} {} 33 : max_offset{max_offset_}, is_indirect{is_indirect_} {}
34 34
35 constexpr ConstBuffer() = default; 35 constexpr ConstBuffer() = default;
36 36
@@ -66,8 +66,8 @@ struct GlobalMemoryUsage {
66 66
67class ShaderIR final { 67class ShaderIR final {
68public: 68public:
69 explicit ShaderIR(const ProgramCode& program_code, u32 main_offset, CompilerSettings settings, 69 explicit ShaderIR(const ProgramCode& program_code_, u32 main_offset_,
70 Registry& registry); 70 CompilerSettings settings_, Registry& registry_);
71 ~ShaderIR(); 71 ~ShaderIR();
72 72
73 const std::map<u32, NodeBlock>& GetBasicBlocks() const { 73 const std::map<u32, NodeBlock>& GetBasicBlocks() const {
diff --git a/src/video_core/surface.cpp b/src/video_core/surface.cpp
index 1688267bb..937e29d1e 100644
--- a/src/video_core/surface.cpp
+++ b/src/video_core/surface.cpp
@@ -28,7 +28,7 @@ SurfaceTarget SurfaceTargetFromTextureType(Tegra::Texture::TextureType texture_t
28 case Tegra::Texture::TextureType::Texture2DArray: 28 case Tegra::Texture::TextureType::Texture2DArray:
29 return SurfaceTarget::Texture2DArray; 29 return SurfaceTarget::Texture2DArray;
30 default: 30 default:
31 LOG_CRITICAL(HW_GPU, "Unimplemented texture_type={}", static_cast<u32>(texture_type)); 31 LOG_CRITICAL(HW_GPU, "Unimplemented texture_type={}", texture_type);
32 UNREACHABLE(); 32 UNREACHABLE();
33 return SurfaceTarget::Texture2D; 33 return SurfaceTarget::Texture2D;
34 } 34 }
@@ -47,7 +47,7 @@ bool SurfaceTargetIsLayered(SurfaceTarget target) {
47 case SurfaceTarget::TextureCubeArray: 47 case SurfaceTarget::TextureCubeArray:
48 return true; 48 return true;
49 default: 49 default:
50 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target)); 50 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target);
51 UNREACHABLE(); 51 UNREACHABLE();
52 return false; 52 return false;
53 } 53 }
@@ -66,7 +66,7 @@ bool SurfaceTargetIsArray(SurfaceTarget target) {
66 case SurfaceTarget::TextureCubeArray: 66 case SurfaceTarget::TextureCubeArray:
67 return true; 67 return true;
68 default: 68 default:
69 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target)); 69 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target);
70 UNREACHABLE(); 70 UNREACHABLE();
71 return false; 71 return false;
72 } 72 }
@@ -85,7 +85,7 @@ PixelFormat PixelFormatFromDepthFormat(Tegra::DepthFormat format) {
85 case Tegra::DepthFormat::D32_FLOAT_S8X24_UINT: 85 case Tegra::DepthFormat::D32_FLOAT_S8X24_UINT:
86 return PixelFormat::D32_FLOAT_S8_UINT; 86 return PixelFormat::D32_FLOAT_S8_UINT;
87 default: 87 default:
88 UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast<u32>(format)); 88 UNIMPLEMENTED_MSG("Unimplemented format={}", format);
89 return PixelFormat::S8_UINT_D24_UNORM; 89 return PixelFormat::S8_UINT_D24_UNORM;
90 } 90 }
91} 91}
@@ -183,7 +183,7 @@ PixelFormat PixelFormatFromRenderTargetFormat(Tegra::RenderTargetFormat format)
183 case Tegra::RenderTargetFormat::R8_UINT: 183 case Tegra::RenderTargetFormat::R8_UINT:
184 return PixelFormat::R8_UINT; 184 return PixelFormat::R8_UINT;
185 default: 185 default:
186 UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast<int>(format)); 186 UNIMPLEMENTED_MSG("Unimplemented format={}", format);
187 return PixelFormat::A8B8G8R8_UNORM; 187 return PixelFormat::A8B8G8R8_UNORM;
188 } 188 }
189} 189}
@@ -197,7 +197,7 @@ PixelFormat PixelFormatFromGPUPixelFormat(Tegra::FramebufferConfig::PixelFormat
197 case Tegra::FramebufferConfig::PixelFormat::B8G8R8A8_UNORM: 197 case Tegra::FramebufferConfig::PixelFormat::B8G8R8A8_UNORM:
198 return PixelFormat::B8G8R8A8_UNORM; 198 return PixelFormat::B8G8R8A8_UNORM;
199 default: 199 default:
200 UNIMPLEMENTED_MSG("Unimplemented format={}", static_cast<u32>(format)); 200 UNIMPLEMENTED_MSG("Unimplemented format={}", format);
201 return PixelFormat::A8B8G8R8_UNORM; 201 return PixelFormat::A8B8G8R8_UNORM;
202 } 202 }
203} 203}
diff --git a/src/video_core/texture_cache/copy_params.h b/src/video_core/texture_cache/copy_params.h
index 9c21a0649..5b475fe06 100644
--- a/src/video_core/texture_cache/copy_params.h
+++ b/src/video_core/texture_cache/copy_params.h
@@ -9,16 +9,16 @@
9namespace VideoCommon { 9namespace VideoCommon {
10 10
11struct CopyParams { 11struct CopyParams {
12 constexpr CopyParams(u32 source_x, u32 source_y, u32 source_z, u32 dest_x, u32 dest_y, 12 constexpr CopyParams(u32 source_x_, u32 source_y_, u32 source_z_, u32 dest_x_, u32 dest_y_,
13 u32 dest_z, u32 source_level, u32 dest_level, u32 width, u32 height, 13 u32 dest_z_, u32 source_level_, u32 dest_level_, u32 width_, u32 height_,
14 u32 depth) 14 u32 depth_)
15 : source_x{source_x}, source_y{source_y}, source_z{source_z}, dest_x{dest_x}, 15 : source_x{source_x_}, source_y{source_y_}, source_z{source_z_}, dest_x{dest_x_},
16 dest_y{dest_y}, dest_z{dest_z}, source_level{source_level}, 16 dest_y{dest_y_}, dest_z{dest_z_}, source_level{source_level_},
17 dest_level{dest_level}, width{width}, height{height}, depth{depth} {} 17 dest_level{dest_level_}, width{width_}, height{height_}, depth{depth_} {}
18 18
19 constexpr CopyParams(u32 width, u32 height, u32 depth, u32 level) 19 constexpr CopyParams(u32 width_, u32 height_, u32 depth_, u32 level_)
20 : source_x{}, source_y{}, source_z{}, dest_x{}, dest_y{}, dest_z{}, source_level{level}, 20 : source_x{}, source_y{}, source_z{}, dest_x{}, dest_y{}, dest_z{}, source_level{level_},
21 dest_level{level}, width{width}, height{height}, depth{depth} {} 21 dest_level{level_}, width{width_}, height{height_}, depth{depth_} {}
22 22
23 u32 source_x; 23 u32 source_x;
24 u32 source_y; 24 u32 source_y;
diff --git a/src/video_core/texture_cache/format_lookup_table.cpp b/src/video_core/texture_cache/format_lookup_table.cpp
index 7d5a75648..7938d71eb 100644
--- a/src/video_core/texture_cache/format_lookup_table.cpp
+++ b/src/video_core/texture_cache/format_lookup_table.cpp
@@ -24,12 +24,12 @@ constexpr bool C = false; // Normal color
24constexpr bool S = true; // Srgb 24constexpr bool S = true; // Srgb
25 25
26struct Table { 26struct Table {
27 constexpr Table(TextureFormat texture_format, bool is_srgb, ComponentType red_component, 27 constexpr Table(TextureFormat texture_format_, bool is_srgb_, ComponentType red_component_,
28 ComponentType green_component, ComponentType blue_component, 28 ComponentType green_component_, ComponentType blue_component_,
29 ComponentType alpha_component, PixelFormat pixel_format) 29 ComponentType alpha_component_, PixelFormat pixel_format_)
30 : texture_format{texture_format}, pixel_format{pixel_format}, red_component{red_component}, 30 : texture_format{texture_format_}, pixel_format{pixel_format_},
31 green_component{green_component}, blue_component{blue_component}, 31 red_component{red_component_}, green_component{green_component_},
32 alpha_component{alpha_component}, is_srgb{is_srgb} {} 32 blue_component{blue_component_}, alpha_component{alpha_component_}, is_srgb{is_srgb_} {}
33 33
34 TextureFormat texture_format; 34 TextureFormat texture_format;
35 PixelFormat pixel_format; 35 PixelFormat pixel_format;
diff --git a/src/video_core/texture_cache/surface_base.cpp b/src/video_core/texture_cache/surface_base.cpp
index 42a1c0c6f..efbcf6723 100644
--- a/src/video_core/texture_cache/surface_base.cpp
+++ b/src/video_core/texture_cache/surface_base.cpp
@@ -25,11 +25,11 @@ StagingCache::StagingCache() = default;
25 25
26StagingCache::~StagingCache() = default; 26StagingCache::~StagingCache() = default;
27 27
28SurfaceBaseImpl::SurfaceBaseImpl(GPUVAddr gpu_addr, const SurfaceParams& params, 28SurfaceBaseImpl::SurfaceBaseImpl(GPUVAddr gpu_addr_, const SurfaceParams& params_,
29 bool is_astc_supported) 29 bool is_astc_supported_)
30 : params{params}, gpu_addr{gpu_addr}, mipmap_sizes(params.num_levels), 30 : params{params_}, gpu_addr{gpu_addr_}, mipmap_sizes(params_.num_levels),
31 mipmap_offsets(params.num_levels) { 31 mipmap_offsets(params.num_levels) {
32 is_converted = IsPixelFormatASTC(params.pixel_format) && !is_astc_supported; 32 is_converted = IsPixelFormatASTC(params.pixel_format) && !is_astc_supported_;
33 host_memory_size = params.GetHostSizeInBytes(is_converted); 33 host_memory_size = params.GetHostSizeInBytes(is_converted);
34 34
35 std::size_t offset = 0; 35 std::size_t offset = 0;
diff --git a/src/video_core/texture_cache/surface_base.h b/src/video_core/texture_cache/surface_base.h
index cfcfa5b3a..b57135fe4 100644
--- a/src/video_core/texture_cache/surface_base.h
+++ b/src/video_core/texture_cache/surface_base.h
@@ -148,8 +148,8 @@ public:
148 } 148 }
149 149
150protected: 150protected:
151 explicit SurfaceBaseImpl(GPUVAddr gpu_addr, const SurfaceParams& params, 151 explicit SurfaceBaseImpl(GPUVAddr gpu_addr_, const SurfaceParams& params_,
152 bool is_astc_supported); 152 bool is_astc_supported_);
153 ~SurfaceBaseImpl() = default; 153 ~SurfaceBaseImpl() = default;
154 154
155 virtual void DecorateSurfaceName() = 0; 155 virtual void DecorateSurfaceName() = 0;
@@ -297,9 +297,9 @@ public:
297 } 297 }
298 298
299protected: 299protected:
300 explicit SurfaceBase(const GPUVAddr gpu_addr, const SurfaceParams& params, 300 explicit SurfaceBase(const GPUVAddr gpu_addr_, const SurfaceParams& params_,
301 bool is_astc_supported) 301 bool is_astc_supported_)
302 : SurfaceBaseImpl(gpu_addr, params, is_astc_supported) {} 302 : SurfaceBaseImpl{gpu_addr_, params_, is_astc_supported_} {}
303 303
304 ~SurfaceBase() = default; 304 ~SurfaceBase() = default;
305 305
diff --git a/src/video_core/texture_cache/surface_params.cpp b/src/video_core/texture_cache/surface_params.cpp
index 305297719..96f93246d 100644
--- a/src/video_core/texture_cache/surface_params.cpp
+++ b/src/video_core/texture_cache/surface_params.cpp
@@ -398,9 +398,9 @@ std::string SurfaceParams::TargetName() const {
398 case SurfaceTarget::TextureCubeArray: 398 case SurfaceTarget::TextureCubeArray:
399 return "CubeArray"; 399 return "CubeArray";
400 default: 400 default:
401 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", static_cast<u32>(target)); 401 LOG_CRITICAL(HW_GPU, "Unimplemented surface_target={}", target);
402 UNREACHABLE(); 402 UNREACHABLE();
403 return fmt::format("TUK({})", static_cast<u32>(target)); 403 return fmt::format("TUK({})", target);
404 } 404 }
405} 405}
406 406
diff --git a/src/video_core/texture_cache/surface_view.h b/src/video_core/texture_cache/surface_view.h
index 90a8bb0ae..199f72732 100644
--- a/src/video_core/texture_cache/surface_view.h
+++ b/src/video_core/texture_cache/surface_view.h
@@ -13,10 +13,10 @@
13namespace VideoCommon { 13namespace VideoCommon {
14 14
15struct ViewParams { 15struct ViewParams {
16 constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target, u32 base_layer, 16 constexpr explicit ViewParams(VideoCore::Surface::SurfaceTarget target_, u32 base_layer_,
17 u32 num_layers, u32 base_level, u32 num_levels) 17 u32 num_layers_, u32 base_level_, u32 num_levels_)
18 : target{target}, base_layer{base_layer}, num_layers{num_layers}, base_level{base_level}, 18 : target{target_}, base_layer{base_layer_}, num_layers{num_layers_},
19 num_levels{num_levels} {} 19 base_level{base_level_}, num_levels{num_levels_} {}
20 20
21 std::size_t Hash() const; 21 std::size_t Hash() const;
22 22
@@ -44,7 +44,7 @@ struct ViewParams {
44 44
45class ViewBase { 45class ViewBase {
46public: 46public:
47 constexpr explicit ViewBase(const ViewParams& params) : params{params} {} 47 constexpr explicit ViewBase(const ViewParams& view_params) : params{view_params} {}
48 48
49 constexpr const ViewParams& GetViewParams() const { 49 constexpr const ViewParams& GetViewParams() const {
50 return params; 50 return params;
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h
index ea835c59f..581d8dd5b 100644
--- a/src/video_core/texture_cache/texture_cache.h
+++ b/src/video_core/texture_cache/texture_cache.h
@@ -1191,9 +1191,8 @@ private:
1191 const SurfaceParams& src_params = src->GetSurfaceParams(); 1191 const SurfaceParams& src_params = src->GetSurfaceParams();
1192 const SurfaceParams& dst_params = dst->GetSurfaceParams(); 1192 const SurfaceParams& dst_params = dst->GetSurfaceParams();
1193 if (!format_compatibility.TestCopy(src_params.pixel_format, dst_params.pixel_format)) { 1193 if (!format_compatibility.TestCopy(src_params.pixel_format, dst_params.pixel_format)) {
1194 LOG_ERROR(HW_GPU, "Illegal copy between formats={{{}, {}}}", 1194 LOG_ERROR(HW_GPU, "Illegal copy between formats={{{}, {}}}", dst_params.pixel_format,
1195 static_cast<int>(dst_params.pixel_format), 1195 src_params.pixel_format);
1196 static_cast<int>(src_params.pixel_format));
1197 return; 1196 return;
1198 } 1197 }
1199 ImageCopy(src, dst, copy); 1198 ImageCopy(src, dst, copy);
diff --git a/src/video_core/textures/convert.cpp b/src/video_core/textures/convert.cpp
index 962921483..bd1aebf02 100644
--- a/src/video_core/textures/convert.cpp
+++ b/src/video_core/textures/convert.cpp
@@ -82,7 +82,7 @@ void ConvertFromHostToGuest(u8* data, PixelFormat pixel_format, u32 width, u32 h
82 bool convert_astc, bool convert_s8z24) { 82 bool convert_astc, bool convert_s8z24) {
83 if (convert_astc && IsPixelFormatASTC(pixel_format)) { 83 if (convert_astc && IsPixelFormatASTC(pixel_format)) {
84 LOG_CRITICAL(HW_GPU, "Conversion of format {} after texture flushing is not implemented", 84 LOG_CRITICAL(HW_GPU, "Conversion of format {} after texture flushing is not implemented",
85 static_cast<u32>(pixel_format)); 85 pixel_format);
86 UNREACHABLE(); 86 UNREACHABLE();
87 87
88 } else if (convert_s8z24 && pixel_format == PixelFormat::S8_UINT_D24_UNORM) { 88 } else if (convert_s8z24 && pixel_format == PixelFormat::S8_UINT_D24_UNORM) {
diff --git a/src/video_core/textures/texture.h b/src/video_core/textures/texture.h
index 0574fef12..bbc7e3eaf 100644
--- a/src/video_core/textures/texture.h
+++ b/src/video_core/textures/texture.h
@@ -146,7 +146,7 @@ enum class MsaaMode : u32 {
146}; 146};
147 147
148union TextureHandle { 148union TextureHandle {
149 TextureHandle(u32 raw) : raw{raw} {} 149 /* implicit */ TextureHandle(u32 raw_) : raw{raw_} {}
150 150
151 u32 raw; 151 u32 raw;
152 BitField<0, 20, u32> tic_id; 152 BitField<0, 20, u32> tic_id;
diff --git a/src/yuzu/applets/controller.cpp b/src/yuzu/applets/controller.cpp
index 6944478f3..a15e8ca2a 100644
--- a/src/yuzu/applets/controller.cpp
+++ b/src/yuzu/applets/controller.cpp
@@ -660,8 +660,8 @@ QtControllerSelector::QtControllerSelector(GMainWindow& parent) {
660QtControllerSelector::~QtControllerSelector() = default; 660QtControllerSelector::~QtControllerSelector() = default;
661 661
662void QtControllerSelector::ReconfigureControllers( 662void QtControllerSelector::ReconfigureControllers(
663 std::function<void()> callback, const Core::Frontend::ControllerParameters& parameters) const { 663 std::function<void()> callback_, const Core::Frontend::ControllerParameters& parameters) const {
664 this->callback = std::move(callback); 664 callback = std::move(callback_);
665 emit MainWindowReconfigureControllers(parameters); 665 emit MainWindowReconfigureControllers(parameters);
666} 666}
667 667
diff --git a/src/yuzu/applets/controller.h b/src/yuzu/applets/controller.h
index 7a421d856..3518eed56 100644
--- a/src/yuzu/applets/controller.h
+++ b/src/yuzu/applets/controller.h
@@ -147,7 +147,7 @@ public:
147 ~QtControllerSelector() override; 147 ~QtControllerSelector() override;
148 148
149 void ReconfigureControllers( 149 void ReconfigureControllers(
150 std::function<void()> callback, 150 std::function<void()> callback_,
151 const Core::Frontend::ControllerParameters& parameters) const override; 151 const Core::Frontend::ControllerParameters& parameters) const override;
152 152
153signals: 153signals:
diff --git a/src/yuzu/applets/error.cpp b/src/yuzu/applets/error.cpp
index 08ed57355..53a993cf6 100644
--- a/src/yuzu/applets/error.cpp
+++ b/src/yuzu/applets/error.cpp
@@ -17,7 +17,7 @@ QtErrorDisplay::QtErrorDisplay(GMainWindow& parent) {
17QtErrorDisplay::~QtErrorDisplay() = default; 17QtErrorDisplay::~QtErrorDisplay() = default;
18 18
19void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const { 19void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished) const {
20 this->callback = std::move(finished); 20 callback = std::move(finished);
21 emit MainWindowDisplayError( 21 emit MainWindowDisplayError(
22 tr("An error has occured.\nPlease try again or contact the developer of the " 22 tr("An error has occured.\nPlease try again or contact the developer of the "
23 "software.\n\nError Code: %1-%2 (0x%3)") 23 "software.\n\nError Code: %1-%2 (0x%3)")
@@ -28,7 +28,7 @@ void QtErrorDisplay::ShowError(ResultCode error, std::function<void()> finished)
28 28
29void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time, 29void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::seconds time,
30 std::function<void()> finished) const { 30 std::function<void()> finished) const {
31 this->callback = std::move(finished); 31 callback = std::move(finished);
32 32
33 const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count()); 33 const QDateTime date_time = QDateTime::fromSecsSinceEpoch(time.count());
34 emit MainWindowDisplayError( 34 emit MainWindowDisplayError(
@@ -44,7 +44,7 @@ void QtErrorDisplay::ShowErrorWithTimestamp(ResultCode error, std::chrono::secon
44void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text, 44void QtErrorDisplay::ShowCustomErrorText(ResultCode error, std::string dialog_text,
45 std::string fullscreen_text, 45 std::string fullscreen_text,
46 std::function<void()> finished) const { 46 std::function<void()> finished) const {
47 this->callback = std::move(finished); 47 callback = std::move(finished);
48 emit MainWindowDisplayError( 48 emit MainWindowDisplayError(
49 tr("An error has occured.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5") 49 tr("An error has occured.\nError Code: %1-%2 (0x%3)\n\n%4\n\n%5")
50 .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0')) 50 .arg(static_cast<u32>(error.module.Value()) + 2000, 4, 10, QChar::fromLatin1('0'))
diff --git a/src/yuzu/applets/profile_select.cpp b/src/yuzu/applets/profile_select.cpp
index c9a2f8601..4bf2bfd40 100644
--- a/src/yuzu/applets/profile_select.cpp
+++ b/src/yuzu/applets/profile_select.cpp
@@ -150,8 +150,8 @@ QtProfileSelector::QtProfileSelector(GMainWindow& parent) {
150QtProfileSelector::~QtProfileSelector() = default; 150QtProfileSelector::~QtProfileSelector() = default;
151 151
152void QtProfileSelector::SelectProfile( 152void QtProfileSelector::SelectProfile(
153 std::function<void(std::optional<Common::UUID>)> callback) const { 153 std::function<void(std::optional<Common::UUID>)> callback_) const {
154 this->callback = std::move(callback); 154 callback = std::move(callback_);
155 emit MainWindowSelectProfile(); 155 emit MainWindowSelectProfile();
156} 156}
157 157
diff --git a/src/yuzu/applets/profile_select.h b/src/yuzu/applets/profile_select.h
index 29c33cca0..4e9037488 100644
--- a/src/yuzu/applets/profile_select.h
+++ b/src/yuzu/applets/profile_select.h
@@ -60,7 +60,7 @@ public:
60 explicit QtProfileSelector(GMainWindow& parent); 60 explicit QtProfileSelector(GMainWindow& parent);
61 ~QtProfileSelector() override; 61 ~QtProfileSelector() override;
62 62
63 void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback) const override; 63 void SelectProfile(std::function<void(std::optional<Common::UUID>)> callback_) const override;
64 64
65signals: 65signals:
66 void MainWindowSelectProfile() const; 66 void MainWindowSelectProfile() const;
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index af36f07c6..ab8cfd8ee 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -135,8 +135,8 @@ void QtSoftwareKeyboard::RequestText(std::function<void(std::optional<std::u16st
135} 135}
136 136
137void QtSoftwareKeyboard::SendTextCheckDialog(std::u16string error_message, 137void QtSoftwareKeyboard::SendTextCheckDialog(std::u16string error_message,
138 std::function<void()> finished_check) const { 138 std::function<void()> finished_check_) const {
139 this->finished_check = std::move(finished_check); 139 finished_check = std::move(finished_check_);
140 emit MainWindowTextCheckDialog(error_message); 140 emit MainWindowTextCheckDialog(error_message);
141} 141}
142 142
diff --git a/src/yuzu/applets/software_keyboard.h b/src/yuzu/applets/software_keyboard.h
index 44bcece75..9e1094cce 100644
--- a/src/yuzu/applets/software_keyboard.h
+++ b/src/yuzu/applets/software_keyboard.h
@@ -61,7 +61,7 @@ public:
61 void RequestText(std::function<void(std::optional<std::u16string>)> out, 61 void RequestText(std::function<void(std::optional<std::u16string>)> out,
62 Core::Frontend::SoftwareKeyboardParameters parameters) const override; 62 Core::Frontend::SoftwareKeyboardParameters parameters) const override;
63 void SendTextCheckDialog(std::u16string error_message, 63 void SendTextCheckDialog(std::u16string error_message,
64 std::function<void()> finished_check) const override; 64 std::function<void()> finished_check_) const override;
65 65
66signals: 66signals:
67 void MainWindowGetText(Core::Frontend::SoftwareKeyboardParameters parameters) const; 67 void MainWindowGetText(Core::Frontend::SoftwareKeyboardParameters parameters) const;
diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp
index 33f1c385d..9fd8d6326 100644
--- a/src/yuzu/applets/web_browser.cpp
+++ b/src/yuzu/applets/web_browser.cpp
@@ -87,10 +87,10 @@ QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
87 87
88QtWebBrowser::~QtWebBrowser() = default; 88QtWebBrowser::~QtWebBrowser() = default;
89 89
90void QtWebBrowser::OpenPageLocal(std::string_view url, std::function<void()> unpack_romfs_callback, 90void QtWebBrowser::OpenPageLocal(std::string_view url, std::function<void()> unpack_romfs_callback_,
91 std::function<void()> finished_callback) { 91 std::function<void()> finished_callback_) {
92 this->unpack_romfs_callback = std::move(unpack_romfs_callback); 92 unpack_romfs_callback = std::move(unpack_romfs_callback_);
93 this->finished_callback = std::move(finished_callback); 93 finished_callback = std::move(finished_callback_);
94 94
95 const auto index = url.find('?'); 95 const auto index = url.find('?');
96 if (index == std::string::npos) { 96 if (index == std::string::npos) {
diff --git a/src/yuzu/applets/web_browser.h b/src/yuzu/applets/web_browser.h
index b38437e46..f801846cf 100644
--- a/src/yuzu/applets/web_browser.h
+++ b/src/yuzu/applets/web_browser.h
@@ -37,8 +37,8 @@ public:
37 explicit QtWebBrowser(GMainWindow& main_window); 37 explicit QtWebBrowser(GMainWindow& main_window);
38 ~QtWebBrowser() override; 38 ~QtWebBrowser() override;
39 39
40 void OpenPageLocal(std::string_view url, std::function<void()> unpack_romfs_callback, 40 void OpenPageLocal(std::string_view url, std::function<void()> unpack_romfs_callback_,
41 std::function<void()> finished_callback) override; 41 std::function<void()> finished_callback_) override;
42 42
43signals: 43signals:
44 void MainWindowOpenPage(std::string_view filename, std::string_view additional_args) const; 44 void MainWindowOpenPage(std::string_view filename, std::string_view additional_args) const;
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index fcc38b3af..9fb254986 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -511,6 +511,9 @@ void Config::ReadControlValues() {
511 ReadTouchscreenValues(); 511 ReadTouchscreenValues();
512 ReadMotionTouchValues(); 512 ReadMotionTouchValues();
513 513
514 Settings::values.emulate_analog_keyboard =
515 ReadSetting(QStringLiteral("emulate_analog_keyboard"), false).toBool();
516
514 ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), false); 517 ReadSettingGlobal(Settings::values.use_docked_mode, QStringLiteral("use_docked_mode"), false);
515 ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"), 518 ReadSettingGlobal(Settings::values.vibration_enabled, QStringLiteral("vibration_enabled"),
516 true); 519 true);
@@ -634,8 +637,6 @@ void Config::ReadDebuggingValues() {
634 // Intentionally not using the QT default setting as this is intended to be changed in the ini 637 // Intentionally not using the QT default setting as this is intended to be changed in the ini
635 Settings::values.record_frame_times = 638 Settings::values.record_frame_times =
636 qt_config->value(QStringLiteral("record_frame_times"), false).toBool(); 639 qt_config->value(QStringLiteral("record_frame_times"), false).toBool();
637 Settings::values.use_gdbstub = ReadSetting(QStringLiteral("use_gdbstub"), false).toBool();
638 Settings::values.gdbstub_port = ReadSetting(QStringLiteral("gdbstub_port"), 24689).toInt();
639 Settings::values.program_args = 640 Settings::values.program_args =
640 ReadSetting(QStringLiteral("program_args"), QString{}).toString().toStdString(); 641 ReadSetting(QStringLiteral("program_args"), QString{}).toString().toStdString();
641 Settings::values.dump_exefs = ReadSetting(QStringLiteral("dump_exefs"), false).toBool(); 642 Settings::values.dump_exefs = ReadSetting(QStringLiteral("dump_exefs"), false).toBool();
@@ -1186,6 +1187,8 @@ void Config::SaveControlValues() {
1186 QString::fromStdString(Settings::values.touch_device), 1187 QString::fromStdString(Settings::values.touch_device),
1187 QStringLiteral("engine:emu_window")); 1188 QStringLiteral("engine:emu_window"));
1188 WriteSetting(QStringLiteral("keyboard_enabled"), Settings::values.keyboard_enabled, false); 1189 WriteSetting(QStringLiteral("keyboard_enabled"), Settings::values.keyboard_enabled, false);
1190 WriteSetting(QStringLiteral("emulate_analog_keyboard"),
1191 Settings::values.emulate_analog_keyboard, false);
1189 1192
1190 qt_config->endGroup(); 1193 qt_config->endGroup();
1191} 1194}
@@ -1231,8 +1234,6 @@ void Config::SaveDebuggingValues() {
1231 1234
1232 // Intentionally not using the QT default setting as this is intended to be changed in the ini 1235 // Intentionally not using the QT default setting as this is intended to be changed in the ini
1233 qt_config->setValue(QStringLiteral("record_frame_times"), Settings::values.record_frame_times); 1236 qt_config->setValue(QStringLiteral("record_frame_times"), Settings::values.record_frame_times);
1234 WriteSetting(QStringLiteral("use_gdbstub"), Settings::values.use_gdbstub, false);
1235 WriteSetting(QStringLiteral("gdbstub_port"), Settings::values.gdbstub_port, 24689);
1236 WriteSetting(QStringLiteral("program_args"), 1237 WriteSetting(QStringLiteral("program_args"),
1237 QString::fromStdString(Settings::values.program_args), QString{}); 1238 QString::fromStdString(Settings::values.program_args), QString{});
1238 WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false); 1239 WriteSetting(QStringLiteral("dump_exefs"), Settings::values.dump_exefs, false);
diff --git a/src/yuzu/configuration/configure_debug.cpp b/src/yuzu/configuration/configure_debug.cpp
index 027099ab7..121873f95 100644
--- a/src/yuzu/configuration/configure_debug.cpp
+++ b/src/yuzu/configuration/configure_debug.cpp
@@ -28,9 +28,6 @@ ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::Co
28ConfigureDebug::~ConfigureDebug() = default; 28ConfigureDebug::~ConfigureDebug() = default;
29 29
30void ConfigureDebug::SetConfiguration() { 30void ConfigureDebug::SetConfiguration() {
31 ui->toggle_gdbstub->setChecked(Settings::values.use_gdbstub);
32 ui->gdbport_spinbox->setEnabled(Settings::values.use_gdbstub);
33 ui->gdbport_spinbox->setValue(Settings::values.gdbstub_port);
34 ui->toggle_console->setEnabled(!Core::System::GetInstance().IsPoweredOn()); 31 ui->toggle_console->setEnabled(!Core::System::GetInstance().IsPoweredOn());
35 ui->toggle_console->setChecked(UISettings::values.show_console); 32 ui->toggle_console->setChecked(UISettings::values.show_console);
36 ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter)); 33 ui->log_filter_edit->setText(QString::fromStdString(Settings::values.log_filter));
@@ -45,8 +42,6 @@ void ConfigureDebug::SetConfiguration() {
45} 42}
46 43
47void ConfigureDebug::ApplyConfiguration() { 44void ConfigureDebug::ApplyConfiguration() {
48 Settings::values.use_gdbstub = ui->toggle_gdbstub->isChecked();
49 Settings::values.gdbstub_port = ui->gdbport_spinbox->value();
50 UISettings::values.show_console = ui->toggle_console->isChecked(); 45 UISettings::values.show_console = ui->toggle_console->isChecked();
51 Settings::values.log_filter = ui->log_filter_edit->text().toStdString(); 46 Settings::values.log_filter = ui->log_filter_edit->text().toStdString();
52 Settings::values.program_args = ui->homebrew_args_edit->text().toStdString(); 47 Settings::values.program_args = ui->homebrew_args_edit->text().toStdString();
diff --git a/src/yuzu/configuration/configure_debug.ui b/src/yuzu/configuration/configure_debug.ui
index 6f94fe304..9186aa732 100644
--- a/src/yuzu/configuration/configure_debug.ui
+++ b/src/yuzu/configuration/configure_debug.ui
@@ -7,7 +7,7 @@
7 <x>0</x> 7 <x>0</x>
8 <y>0</y> 8 <y>0</y>
9 <width>400</width> 9 <width>400</width>
10 <height>467</height> 10 <height>486</height>
11 </rect> 11 </rect>
12 </property> 12 </property>
13 <property name="windowTitle"> 13 <property name="windowTitle">
@@ -15,57 +15,6 @@
15 </property> 15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_1"> 16 <layout class="QVBoxLayout" name="verticalLayout_1">
17 <item> 17 <item>
18 <layout class="QVBoxLayout" name="verticalLayout_2">
19 <item>
20 <widget class="QGroupBox" name="groupBox">
21 <property name="title">
22 <string>GDB</string>
23 </property>
24 <layout class="QVBoxLayout" name="verticalLayout_3">
25 <item>
26 <layout class="QHBoxLayout" name="horizontalLayout_1">
27 <item>
28 <widget class="QCheckBox" name="toggle_gdbstub">
29 <property name="text">
30 <string>Enable GDB Stub</string>
31 </property>
32 </widget>
33 </item>
34 <item>
35 <spacer name="horizontalSpacer">
36 <property name="orientation">
37 <enum>Qt::Horizontal</enum>
38 </property>
39 <property name="sizeHint" stdset="0">
40 <size>
41 <width>40</width>
42 <height>20</height>
43 </size>
44 </property>
45 </spacer>
46 </item>
47 <item>
48 <widget class="QLabel" name="label_1">
49 <property name="text">
50 <string>Port:</string>
51 </property>
52 </widget>
53 </item>
54 <item>
55 <widget class="QSpinBox" name="gdbport_spinbox">
56 <property name="maximum">
57 <number>65536</number>
58 </property>
59 </widget>
60 </item>
61 </layout>
62 </item>
63 </layout>
64 </widget>
65 </item>
66 </layout>
67 </item>
68 <item>
69 <widget class="QGroupBox" name="groupBox_2"> 18 <widget class="QGroupBox" name="groupBox_2">
70 <property name="title"> 19 <property name="title">
71 <string>Logging</string> 20 <string>Logging</string>
@@ -258,8 +207,6 @@
258 </layout> 207 </layout>
259 </widget> 208 </widget>
260 <tabstops> 209 <tabstops>
261 <tabstop>toggle_gdbstub</tabstop>
262 <tabstop>gdbport_spinbox</tabstop>
263 <tabstop>log_filter_edit</tabstop> 210 <tabstop>log_filter_edit</tabstop>
264 <tabstop>toggle_console</tabstop> 211 <tabstop>toggle_console</tabstop>
265 <tabstop>open_log_button</tabstop> 212 <tabstop>open_log_button</tabstop>
@@ -269,22 +216,5 @@
269 <tabstop>quest_flag</tabstop> 216 <tabstop>quest_flag</tabstop>
270 </tabstops> 217 </tabstops>
271 <resources/> 218 <resources/>
272 <connections> 219 <connections/>
273 <connection>
274 <sender>toggle_gdbstub</sender>
275 <signal>toggled(bool)</signal>
276 <receiver>gdbport_spinbox</receiver>
277 <slot>setEnabled(bool)</slot>
278 <hints>
279 <hint type="sourcelabel">
280 <x>84</x>
281 <y>157</y>
282 </hint>
283 <hint type="destinationlabel">
284 <x>342</x>
285 <y>158</y>
286 </hint>
287 </hints>
288 </connection>
289 </connections>
290</ui> 220</ui>
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp
index abaf03630..4e557bc6f 100644
--- a/src/yuzu/configuration/configure_input_advanced.cpp
+++ b/src/yuzu/configuration/configure_input_advanced.cpp
@@ -121,6 +121,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() {
121 Settings::values.debug_pad_enabled = ui->debug_enabled->isChecked(); 121 Settings::values.debug_pad_enabled = ui->debug_enabled->isChecked();
122 Settings::values.mouse_enabled = ui->mouse_enabled->isChecked(); 122 Settings::values.mouse_enabled = ui->mouse_enabled->isChecked();
123 Settings::values.keyboard_enabled = ui->keyboard_enabled->isChecked(); 123 Settings::values.keyboard_enabled = ui->keyboard_enabled->isChecked();
124 Settings::values.emulate_analog_keyboard = ui->emulate_analog_keyboard->isChecked();
124 Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked(); 125 Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked();
125} 126}
126 127
@@ -147,6 +148,7 @@ void ConfigureInputAdvanced::LoadConfiguration() {
147 ui->debug_enabled->setChecked(Settings::values.debug_pad_enabled); 148 ui->debug_enabled->setChecked(Settings::values.debug_pad_enabled);
148 ui->mouse_enabled->setChecked(Settings::values.mouse_enabled); 149 ui->mouse_enabled->setChecked(Settings::values.mouse_enabled);
149 ui->keyboard_enabled->setChecked(Settings::values.keyboard_enabled); 150 ui->keyboard_enabled->setChecked(Settings::values.keyboard_enabled);
151 ui->emulate_analog_keyboard->setChecked(Settings::values.emulate_analog_keyboard);
150 ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled); 152 ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled);
151 153
152 UpdateUIEnabled(); 154 UpdateUIEnabled();
diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui
index a880a7c68..f207e5d3b 100644
--- a/src/yuzu/configuration/configure_input_advanced.ui
+++ b/src/yuzu/configuration/configure_input_advanced.ui
@@ -2546,14 +2546,27 @@
2546 </property> 2546 </property>
2547 </widget> 2547 </widget>
2548 </item> 2548 </item>
2549 <item row="4" column="2"> 2549 <item row="1" column="0">
2550 <widget class="QCheckBox" name="emulate_analog_keyboard">
2551 <property name="minimumSize">
2552 <size>
2553 <width>0</width>
2554 <height>23</height>
2555 </size>
2556 </property>
2557 <property name="text">
2558 <string>Emulate Analog with Keyboard Input</string>
2559 </property>
2560 </widget>
2561 </item>
2562 <item row="5" column="2">
2550 <widget class="QPushButton" name="touchscreen_advanced"> 2563 <widget class="QPushButton" name="touchscreen_advanced">
2551 <property name="text"> 2564 <property name="text">
2552 <string>Advanced</string> 2565 <string>Advanced</string>
2553 </property> 2566 </property>
2554 </widget> 2567 </widget>
2555 </item> 2568 </item>
2556 <item row="1" column="1"> 2569 <item row="2" column="1">
2557 <spacer name="horizontalSpacer_8"> 2570 <spacer name="horizontalSpacer_8">
2558 <property name="orientation"> 2571 <property name="orientation">
2559 <enum>Qt::Horizontal</enum> 2572 <enum>Qt::Horizontal</enum>
@@ -2569,21 +2582,21 @@
2569 </property> 2582 </property>
2570 </spacer> 2583 </spacer>
2571 </item> 2584 </item>
2572 <item row="1" column="2"> 2585 <item row="2" column="2">
2573 <widget class="QPushButton" name="mouse_advanced"> 2586 <widget class="QPushButton" name="mouse_advanced">
2574 <property name="text"> 2587 <property name="text">
2575 <string>Advanced</string> 2588 <string>Advanced</string>
2576 </property> 2589 </property>
2577 </widget> 2590 </widget>
2578 </item> 2591 </item>
2579 <item row="4" column="0"> 2592 <item row="5" column="0">
2580 <widget class="QCheckBox" name="touchscreen_enabled"> 2593 <widget class="QCheckBox" name="touchscreen_enabled">
2581 <property name="text"> 2594 <property name="text">
2582 <string>Touchscreen</string> 2595 <string>Touchscreen</string>
2583 </property> 2596 </property>
2584 </widget> 2597 </widget>
2585 </item> 2598 </item>
2586 <item row="1" column="0"> 2599 <item row="2" column="0">
2587 <widget class="QCheckBox" name="mouse_enabled"> 2600 <widget class="QCheckBox" name="mouse_enabled">
2588 <property name="minimumSize"> 2601 <property name="minimumSize">
2589 <size> 2602 <size>
@@ -2596,28 +2609,28 @@
2596 </property> 2609 </property>
2597 </widget> 2610 </widget>
2598 </item> 2611 </item>
2599 <item row="6" column="0"> 2612 <item row="7" column="0">
2600 <widget class="QLabel" name="motion_touch"> 2613 <widget class="QLabel" name="motion_touch">
2601 <property name="text"> 2614 <property name="text">
2602 <string>Motion / Touch</string> 2615 <string>Motion / Touch</string>
2603 </property> 2616 </property>
2604 </widget> 2617 </widget>
2605 </item> 2618 </item>
2606 <item row="6" column="2"> 2619 <item row="7" column="2">
2607 <widget class="QPushButton" name="buttonMotionTouch"> 2620 <widget class="QPushButton" name="buttonMotionTouch">
2608 <property name="text"> 2621 <property name="text">
2609 <string>Configure</string> 2622 <string>Configure</string>
2610 </property> 2623 </property>
2611 </widget> 2624 </widget>
2612 </item> 2625 </item>
2613 <item row="5" column="0"> 2626 <item row="6" column="0">
2614 <widget class="QCheckBox" name="debug_enabled"> 2627 <widget class="QCheckBox" name="debug_enabled">
2615 <property name="text"> 2628 <property name="text">
2616 <string>Debug Controller</string> 2629 <string>Debug Controller</string>
2617 </property> 2630 </property>
2618 </widget> 2631 </widget>
2619 </item> 2632 </item>
2620 <item row="5" column="2"> 2633 <item row="6" column="2">
2621 <widget class="QPushButton" name="debug_configure"> 2634 <widget class="QPushButton" name="debug_configure">
2622 <property name="text"> 2635 <property name="text">
2623 <string>Configure</string> 2636 <string>Configure</string>
diff --git a/src/yuzu/configuration/configure_motion_touch.cpp b/src/yuzu/configuration/configure_motion_touch.cpp
index 2afac591a..c2a7113da 100644
--- a/src/yuzu/configuration/configure_motion_touch.cpp
+++ b/src/yuzu/configuration/configure_motion_touch.cpp
@@ -183,8 +183,8 @@ void ConfigureMotionTouch::ConnectEvents() {
183} 183}
184 184
185void ConfigureMotionTouch::OnUDPAddServer() { 185void ConfigureMotionTouch::OnUDPAddServer() {
186 QRegExp re(tr("^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[" 186 QRegExp re(tr(R"re(^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4]"
187 "0-9][0-9]?)$")); // a valid ip address 187 "[0-9]|[01]?[0-9][0-9]?)$)re")); // a valid ip address
188 bool ok; 188 bool ok;
189 QString port_text = ui->udp_port->text(); 189 QString port_text = ui->udp_port->text();
190 QString server_text = ui->udp_server->text(); 190 QString server_text = ui->udp_server->text();
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index 248855aff..df935022d 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -174,7 +174,8 @@ public:
174 } 174 }
175 175
176 bool operator<(const QStandardItem& other) const override { 176 bool operator<(const QStandardItem& other) const override {
177 return data(CompatNumberRole) < other.data(CompatNumberRole); 177 return data(CompatNumberRole).value<QString>() <
178 other.data(CompatNumberRole).value<QString>();
178 } 179 }
179}; 180};
180 181
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 26f5e42ed..3461fa675 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -83,6 +83,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
83#include "core/core.h" 83#include "core/core.h"
84#include "core/crypto/key_manager.h" 84#include "core/crypto/key_manager.h"
85#include "core/file_sys/card_image.h" 85#include "core/file_sys/card_image.h"
86#include "core/file_sys/common_funcs.h"
86#include "core/file_sys/content_archive.h" 87#include "core/file_sys/content_archive.h"
87#include "core/file_sys/control_metadata.h" 88#include "core/file_sys/control_metadata.h"
88#include "core/file_sys/patch_manager.h" 89#include "core/file_sys/patch_manager.h"
@@ -148,8 +149,6 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
148 149
149constexpr int default_mouse_timeout = 2500; 150constexpr int default_mouse_timeout = 2500;
150 151
151constexpr u64 DLC_BASE_TITLE_ID_MASK = 0xFFFFFFFFFFFFE000;
152
153/** 152/**
154 * "Callouts" are one-time instructional messages shown to the user. In the config settings, there 153 * "Callouts" are one-time instructional messages shown to the user. In the config settings, there
155 * is a bitfield "callout_flags" options, used to track if a message has already been shown to the 154 * is a bitfield "callout_flags" options, used to track if a message has already been shown to the
@@ -1529,7 +1528,7 @@ void GMainWindow::RemoveAddOnContent(u64 program_id, const QString& entry_type)
1529 FileSys::TitleType::AOC, FileSys::ContentRecordType::Data); 1528 FileSys::TitleType::AOC, FileSys::ContentRecordType::Data);
1530 1529
1531 for (const auto& entry : dlc_entries) { 1530 for (const auto& entry : dlc_entries) {
1532 if ((entry.title_id & DLC_BASE_TITLE_ID_MASK) == program_id) { 1531 if (FileSys::GetBaseTitleID(entry.title_id) == program_id) {
1533 const auto res = 1532 const auto res =
1534 fs_controller.GetUserNANDContents()->RemoveExistingEntry(entry.title_id) || 1533 fs_controller.GetUserNANDContents()->RemoveExistingEntry(entry.title_id) ||
1535 fs_controller.GetSDMCContents()->RemoveExistingEntry(entry.title_id); 1534 fs_controller.GetSDMCContents()->RemoveExistingEntry(entry.title_id);
@@ -2709,7 +2708,7 @@ std::optional<u64> GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProv
2709 dlc_match.reserve(dlc_entries.size()); 2708 dlc_match.reserve(dlc_entries.size());
2710 std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match), 2709 std::copy_if(dlc_entries.begin(), dlc_entries.end(), std::back_inserter(dlc_match),
2711 [&program_id, &installed](const FileSys::ContentProviderEntry& entry) { 2710 [&program_id, &installed](const FileSys::ContentProviderEntry& entry) {
2712 return (entry.title_id & DLC_BASE_TITLE_ID_MASK) == program_id && 2711 return FileSys::GetBaseTitleID(entry.title_id) == program_id &&
2713 installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success; 2712 installed.GetEntry(entry)->GetStatus() == Loader::ResultStatus::Success;
2714 }); 2713 });
2715 2714
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp
index 34c9673bc..38075c345 100644
--- a/src/yuzu_cmd/config.cpp
+++ b/src/yuzu_cmd/config.cpp
@@ -345,7 +345,6 @@ void Config::ReadValues() {
345 // System 345 // System
346 Settings::values.use_docked_mode.SetValue( 346 Settings::values.use_docked_mode.SetValue(
347 sdl2_config->GetBoolean("System", "use_docked_mode", false)); 347 sdl2_config->GetBoolean("System", "use_docked_mode", false));
348 const auto size = sdl2_config->GetInteger("System", "users_size", 0);
349 348
350 Settings::values.current_user = std::clamp<int>( 349 Settings::values.current_user = std::clamp<int>(
351 sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1); 350 sdl2_config->GetInteger("System", "current_user", 0), 0, Service::Account::MAX_USERS - 1);
@@ -430,9 +429,6 @@ void Config::ReadValues() {
430 // Debugging 429 // Debugging
431 Settings::values.record_frame_times = 430 Settings::values.record_frame_times =
432 sdl2_config->GetBoolean("Debugging", "record_frame_times", false); 431 sdl2_config->GetBoolean("Debugging", "record_frame_times", false);
433 Settings::values.use_gdbstub = sdl2_config->GetBoolean("Debugging", "use_gdbstub", false);
434 Settings::values.gdbstub_port =
435 static_cast<u16>(sdl2_config->GetInteger("Debugging", "gdbstub_port", 24689));
436 Settings::values.program_args = sdl2_config->Get("Debugging", "program_args", ""); 432 Settings::values.program_args = sdl2_config->Get("Debugging", "program_args", "");
437 Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false); 433 Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false);
438 Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false); 434 Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false);
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h
index bcbbcd4ca..2d4b98d9a 100644
--- a/src/yuzu_cmd/default_ini.h
+++ b/src/yuzu_cmd/default_ini.h
@@ -318,9 +318,6 @@ log_filter = *:Trace
318[Debugging] 318[Debugging]
319# Record frame time data, can be found in the log directory. Boolean value 319# Record frame time data, can be found in the log directory. Boolean value
320record_frame_times = 320record_frame_times =
321# Port for listening to GDB connections.
322use_gdbstub=false
323gdbstub_port=24689
324# Determines whether or not yuzu will dump the ExeFS of all games it attempts to load while loading them 321# Determines whether or not yuzu will dump the ExeFS of all games it attempts to load while loading them
325dump_exefs=false 322dump_exefs=false
326# Determines whether or not yuzu will dump all NSOs it attempts to load while loading them 323# Determines whether or not yuzu will dump all NSOs it attempts to load while loading them
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index c2efe1ee6..1ebc04af5 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -64,7 +64,6 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
64static void PrintHelp(const char* argv0) { 64static void PrintHelp(const char* argv0) {
65 std::cout << "Usage: " << argv0 65 std::cout << "Usage: " << argv0
66 << " [options] <filename>\n" 66 << " [options] <filename>\n"
67 "-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n"
68 "-f, --fullscreen Start in fullscreen mode\n" 67 "-f, --fullscreen Start in fullscreen mode\n"
69 "-h, --help Display this help and exit\n" 68 "-h, --help Display this help and exit\n"
70 "-v, --version Output version information and exit\n" 69 "-v, --version Output version information and exit\n"
@@ -96,8 +95,6 @@ int main(int argc, char** argv) {
96 Config config; 95 Config config;
97 96
98 int option_index = 0; 97 int option_index = 0;
99 bool use_gdbstub = Settings::values.use_gdbstub;
100 u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port);
101 98
102 InitializeLogging(); 99 InitializeLogging();
103 100
@@ -116,26 +113,17 @@ int main(int argc, char** argv) {
116 bool fullscreen = false; 113 bool fullscreen = false;
117 114
118 static struct option long_options[] = { 115 static struct option long_options[] = {
119 {"gdbport", required_argument, 0, 'g'}, {"fullscreen", no_argument, 0, 'f'}, 116 {"fullscreen", no_argument, 0, 'f'},
120 {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'v'}, 117 {"help", no_argument, 0, 'h'},
121 {"program", optional_argument, 0, 'p'}, {0, 0, 0, 0}, 118 {"version", no_argument, 0, 'v'},
119 {"program", optional_argument, 0, 'p'},
120 {0, 0, 0, 0},
122 }; 121 };
123 122
124 while (optind < argc) { 123 while (optind < argc) {
125 int arg = getopt_long(argc, argv, "g:fhvp::", long_options, &option_index); 124 int arg = getopt_long(argc, argv, "g:fhvp::", long_options, &option_index);
126 if (arg != -1) { 125 if (arg != -1) {
127 switch (static_cast<char>(arg)) { 126 switch (static_cast<char>(arg)) {
128 case 'g':
129 errno = 0;
130 gdb_port = strtoul(optarg, &endarg, 0);
131 use_gdbstub = true;
132 if (endarg == optarg)
133 errno = EINVAL;
134 if (errno != 0) {
135 perror("--gdbport");
136 exit(1);
137 }
138 break;
139 case 'f': 127 case 'f':
140 fullscreen = true; 128 fullscreen = true;
141 LOG_INFO(Frontend, "Starting in fullscreen mode..."); 129 LOG_INFO(Frontend, "Starting in fullscreen mode...");
@@ -177,8 +165,6 @@ int main(int argc, char** argv) {
177 InputCommon::InputSubsystem input_subsystem; 165 InputCommon::InputSubsystem input_subsystem;
178 166
179 // Apply the command line arguments 167 // Apply the command line arguments
180 Settings::values.gdbstub_port = gdb_port;
181 Settings::values.use_gdbstub = use_gdbstub;
182 Settings::Apply(system); 168 Settings::Apply(system);
183 169
184 std::unique_ptr<EmuWindow_SDL2> emu_window; 170 std::unique_ptr<EmuWindow_SDL2> emu_window;
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp
index b6cdc7c1c..91684e96e 100644
--- a/src/yuzu_tester/config.cpp
+++ b/src/yuzu_tester/config.cpp
@@ -158,7 +158,6 @@ void Config::ReadValues() {
158 Settings::values.use_dev_keys = sdl2_config->GetBoolean("Miscellaneous", "use_dev_keys", false); 158 Settings::values.use_dev_keys = sdl2_config->GetBoolean("Miscellaneous", "use_dev_keys", false);
159 159
160 // Debugging 160 // Debugging
161 Settings::values.use_gdbstub = false;
162 Settings::values.program_args = ""; 161 Settings::values.program_args = "";
163 Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false); 162 Settings::values.dump_exefs = sdl2_config->GetBoolean("Debugging", "dump_exefs", false);
164 Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false); 163 Settings::values.dump_nso = sdl2_config->GetBoolean("Debugging", "dump_nso", false);
diff --git a/src/yuzu_tester/yuzu.cpp b/src/yuzu_tester/yuzu.cpp
index 50bd7ae41..6435ffabb 100644
--- a/src/yuzu_tester/yuzu.cpp
+++ b/src/yuzu_tester/yuzu.cpp
@@ -162,7 +162,6 @@ int main(int argc, char** argv) {
162 162
163 Core::System& system{Core::System::GetInstance()}; 163 Core::System& system{Core::System::GetInstance()};
164 164
165 Settings::values.use_gdbstub = false;
166 Settings::Apply(system); 165 Settings::Apply(system);
167 166
168 const auto emu_window{std::make_unique<EmuWindow_SDL2_Hide>()}; 167 const auto emu_window{std::make_unique<EmuWindow_SDL2_Hide>()};