diff options
Diffstat (limited to 'src')
39 files changed, 348 insertions, 60 deletions
diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index 1245a5086..26d4e76dc 100644 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h | |||
| @@ -23,6 +23,7 @@ public: | |||
| 23 | buffer{Common::make_unique_for_overwrite<T[]>(initial_capacity)} {} | 23 | buffer{Common::make_unique_for_overwrite<T[]>(initial_capacity)} {} |
| 24 | 24 | ||
| 25 | ~ScratchBuffer() = default; | 25 | ~ScratchBuffer() = default; |
| 26 | ScratchBuffer(ScratchBuffer&&) = default; | ||
| 26 | 27 | ||
| 27 | /// This will only grow the buffer's capacity if size is greater than the current capacity. | 28 | /// This will only grow the buffer's capacity if size is greater than the current capacity. |
| 28 | /// The previously held data will remain intact. | 29 | /// The previously held data will remain intact. |
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 749ac213f..84955030b 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -59,6 +59,7 @@ void LogSettings() { | |||
| 59 | values.use_asynchronous_gpu_emulation.GetValue()); | 59 | values.use_asynchronous_gpu_emulation.GetValue()); |
| 60 | log_setting("Renderer_NvdecEmulation", values.nvdec_emulation.GetValue()); | 60 | log_setting("Renderer_NvdecEmulation", values.nvdec_emulation.GetValue()); |
| 61 | log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue()); | 61 | log_setting("Renderer_AccelerateASTC", values.accelerate_astc.GetValue()); |
| 62 | log_setting("Renderer_AsyncASTC", values.async_astc.GetValue()); | ||
| 62 | log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); | 63 | log_setting("Renderer_UseVsync", values.use_vsync.GetValue()); |
| 63 | log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue()); | 64 | log_setting("Renderer_ShaderBackend", values.shader_backend.GetValue()); |
| 64 | log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); | 65 | log_setting("Renderer_UseAsynchronousShaders", values.use_asynchronous_shaders.GetValue()); |
| @@ -219,6 +220,7 @@ void RestoreGlobalState(bool is_powered_on) { | |||
| 219 | values.use_asynchronous_gpu_emulation.SetGlobal(true); | 220 | values.use_asynchronous_gpu_emulation.SetGlobal(true); |
| 220 | values.nvdec_emulation.SetGlobal(true); | 221 | values.nvdec_emulation.SetGlobal(true); |
| 221 | values.accelerate_astc.SetGlobal(true); | 222 | values.accelerate_astc.SetGlobal(true); |
| 223 | values.async_astc.SetGlobal(true); | ||
| 222 | values.use_vsync.SetGlobal(true); | 224 | values.use_vsync.SetGlobal(true); |
| 223 | values.shader_backend.SetGlobal(true); | 225 | values.shader_backend.SetGlobal(true); |
| 224 | values.use_asynchronous_shaders.SetGlobal(true); | 226 | values.use_asynchronous_shaders.SetGlobal(true); |
diff --git a/src/common/settings.h b/src/common/settings.h index 6d27dd5ee..512ecff69 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -453,6 +453,7 @@ struct Values { | |||
| 453 | SwitchableSetting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; | 453 | SwitchableSetting<bool> use_asynchronous_gpu_emulation{true, "use_asynchronous_gpu_emulation"}; |
| 454 | SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; | 454 | SwitchableSetting<NvdecEmulation> nvdec_emulation{NvdecEmulation::GPU, "nvdec_emulation"}; |
| 455 | SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; | 455 | SwitchableSetting<bool> accelerate_astc{true, "accelerate_astc"}; |
| 456 | SwitchableSetting<bool> async_astc{false, "async_astc"}; | ||
| 456 | SwitchableSetting<bool> use_vsync{true, "use_vsync"}; | 457 | SwitchableSetting<bool> use_vsync{true, "use_vsync"}; |
| 457 | SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL, | 458 | SwitchableSetting<ShaderBackend, true> shader_backend{ShaderBackend::GLSL, ShaderBackend::GLSL, |
| 458 | ShaderBackend::SPIRV, "shader_backend"}; | 459 | ShaderBackend::SPIRV, "shader_backend"}; |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index ff5502d87..70fa1edf5 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -861,3 +861,7 @@ endif() | |||
| 861 | if (YUZU_USE_PRECOMPILED_HEADERS) | 861 | if (YUZU_USE_PRECOMPILED_HEADERS) |
| 862 | target_precompile_headers(core PRIVATE precompiled_headers.h) | 862 | target_precompile_headers(core PRIVATE precompiled_headers.h) |
| 863 | endif() | 863 | endif() |
| 864 | |||
| 865 | if (YUZU_ENABLE_LTO) | ||
| 866 | set_property(TARGET core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
| 867 | endif() | ||
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp index 6d5a3dead..a29c9a6f8 100644 --- a/src/core/hid/emulated_controller.cpp +++ b/src/core/hid/emulated_controller.cpp | |||
| @@ -363,7 +363,17 @@ void EmulatedController::ReloadInput() { | |||
| 363 | SetMotion(callback, index); | 363 | SetMotion(callback, index); |
| 364 | }, | 364 | }, |
| 365 | }); | 365 | }); |
| 366 | motion_devices[index]->ForceUpdate(); | 366 | |
| 367 | // Restore motion state | ||
| 368 | auto& emulated_motion = controller.motion_values[index].emulated; | ||
| 369 | auto& motion = controller.motion_state[index]; | ||
| 370 | emulated_motion.ResetRotations(); | ||
| 371 | emulated_motion.ResetQuaternion(); | ||
| 372 | motion.accel = emulated_motion.GetAcceleration(); | ||
| 373 | motion.gyro = emulated_motion.GetGyroscope(); | ||
| 374 | motion.rotation = emulated_motion.GetRotations(); | ||
| 375 | motion.orientation = emulated_motion.GetOrientation(); | ||
| 376 | motion.is_at_rest = !emulated_motion.IsMoving(motion_sensitivity); | ||
| 367 | } | 377 | } |
| 368 | 378 | ||
| 369 | for (std::size_t index = 0; index < camera_devices.size(); ++index) { | 379 | for (std::size_t index = 0; index < camera_devices.size(); ++index) { |
diff --git a/src/core/hid/motion_input.cpp b/src/core/hid/motion_input.cpp index eef6edf4b..0dd66c1cc 100644 --- a/src/core/hid/motion_input.cpp +++ b/src/core/hid/motion_input.cpp | |||
| @@ -10,6 +10,8 @@ MotionInput::MotionInput() { | |||
| 10 | // Initialize PID constants with default values | 10 | // Initialize PID constants with default values |
| 11 | SetPID(0.3f, 0.005f, 0.0f); | 11 | SetPID(0.3f, 0.005f, 0.0f); |
| 12 | SetGyroThreshold(ThresholdStandard); | 12 | SetGyroThreshold(ThresholdStandard); |
| 13 | ResetQuaternion(); | ||
| 14 | ResetRotations(); | ||
| 13 | } | 15 | } |
| 14 | 16 | ||
| 15 | void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { | 17 | void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { |
| @@ -20,11 +22,19 @@ void MotionInput::SetPID(f32 new_kp, f32 new_ki, f32 new_kd) { | |||
| 20 | 22 | ||
| 21 | void MotionInput::SetAcceleration(const Common::Vec3f& acceleration) { | 23 | void MotionInput::SetAcceleration(const Common::Vec3f& acceleration) { |
| 22 | accel = acceleration; | 24 | accel = acceleration; |
| 25 | |||
| 26 | accel.x = std::clamp(accel.x, -AccelMaxValue, AccelMaxValue); | ||
| 27 | accel.y = std::clamp(accel.y, -AccelMaxValue, AccelMaxValue); | ||
| 28 | accel.z = std::clamp(accel.z, -AccelMaxValue, AccelMaxValue); | ||
| 23 | } | 29 | } |
| 24 | 30 | ||
| 25 | void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { | 31 | void MotionInput::SetGyroscope(const Common::Vec3f& gyroscope) { |
| 26 | gyro = gyroscope - gyro_bias; | 32 | gyro = gyroscope - gyro_bias; |
| 27 | 33 | ||
| 34 | gyro.x = std::clamp(gyro.x, -GyroMaxValue, GyroMaxValue); | ||
| 35 | gyro.y = std::clamp(gyro.y, -GyroMaxValue, GyroMaxValue); | ||
| 36 | gyro.z = std::clamp(gyro.z, -GyroMaxValue, GyroMaxValue); | ||
| 37 | |||
| 28 | // Auto adjust drift to minimize drift | 38 | // Auto adjust drift to minimize drift |
| 29 | if (!IsMoving(IsAtRestRelaxed)) { | 39 | if (!IsMoving(IsAtRestRelaxed)) { |
| 30 | gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); | 40 | gyro_bias = (gyro_bias * 0.9999f) + (gyroscope * 0.0001f); |
| @@ -61,6 +71,10 @@ void MotionInput::ResetRotations() { | |||
| 61 | rotations = {}; | 71 | rotations = {}; |
| 62 | } | 72 | } |
| 63 | 73 | ||
| 74 | void MotionInput::ResetQuaternion() { | ||
| 75 | quat = {{0.0f, 0.0f, -1.0f}, 0.0f}; | ||
| 76 | } | ||
| 77 | |||
| 64 | bool MotionInput::IsMoving(f32 sensitivity) const { | 78 | bool MotionInput::IsMoving(f32 sensitivity) const { |
| 65 | return gyro.Length() >= sensitivity || accel.Length() <= 0.9f || accel.Length() >= 1.1f; | 79 | return gyro.Length() >= sensitivity || accel.Length() <= 0.9f || accel.Length() >= 1.1f; |
| 66 | } | 80 | } |
diff --git a/src/core/hid/motion_input.h b/src/core/hid/motion_input.h index 9180bb9aa..e2c1bbf95 100644 --- a/src/core/hid/motion_input.h +++ b/src/core/hid/motion_input.h | |||
| @@ -20,6 +20,9 @@ public: | |||
| 20 | static constexpr float IsAtRestStandard = 0.01f; | 20 | static constexpr float IsAtRestStandard = 0.01f; |
| 21 | static constexpr float IsAtRestThight = 0.005f; | 21 | static constexpr float IsAtRestThight = 0.005f; |
| 22 | 22 | ||
| 23 | static constexpr float GyroMaxValue = 5.0f; | ||
| 24 | static constexpr float AccelMaxValue = 7.0f; | ||
| 25 | |||
| 23 | explicit MotionInput(); | 26 | explicit MotionInput(); |
| 24 | 27 | ||
| 25 | MotionInput(const MotionInput&) = default; | 28 | MotionInput(const MotionInput&) = default; |
| @@ -40,6 +43,7 @@ public: | |||
| 40 | 43 | ||
| 41 | void EnableReset(bool reset); | 44 | void EnableReset(bool reset); |
| 42 | void ResetRotations(); | 45 | void ResetRotations(); |
| 46 | void ResetQuaternion(); | ||
| 43 | 47 | ||
| 44 | void UpdateRotation(u64 elapsed_time); | 48 | void UpdateRotation(u64 elapsed_time); |
| 45 | void UpdateOrientation(u64 elapsed_time); | 49 | void UpdateOrientation(u64 elapsed_time); |
| @@ -69,7 +73,7 @@ private: | |||
| 69 | Common::Vec3f derivative_error; | 73 | Common::Vec3f derivative_error; |
| 70 | 74 | ||
| 71 | // Quaternion containing the device orientation | 75 | // Quaternion containing the device orientation |
| 72 | Common::Quaternion<f32> quat{{0.0f, 0.0f, -1.0f}, 0.0f}; | 76 | Common::Quaternion<f32> quat; |
| 73 | 77 | ||
| 74 | // Number of full rotations in each axis | 78 | // Number of full rotations in each axis |
| 75 | Common::Vec3f rotations; | 79 | Common::Vec3f rotations; |
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 1495d64de..1241fcdff 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -76,6 +76,8 @@ public: | |||
| 76 | {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ | 76 | {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ |
| 77 | {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ | 77 | {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ |
| 78 | {150, nullptr, "CreateAuthorizationRequest"}, | 78 | {150, nullptr, "CreateAuthorizationRequest"}, |
| 79 | {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, | ||
| 80 | {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, | ||
| 79 | }; | 81 | }; |
| 80 | // clang-format on | 82 | // clang-format on |
| 81 | 83 | ||
| @@ -136,7 +138,10 @@ public: | |||
| 136 | {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ | 138 | {140, nullptr, "GetNetworkServiceLicenseCache"}, // 5.0.0+ |
| 137 | {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ | 139 | {141, nullptr, "RefreshNetworkServiceLicenseCacheAsync"}, // 5.0.0+ |
| 138 | {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ | 140 | {142, nullptr, "RefreshNetworkServiceLicenseCacheAsyncIfSecondsElapsed"}, // 5.0.0+ |
| 141 | {143, nullptr, "GetNetworkServiceLicenseCacheEx"}, | ||
| 139 | {150, nullptr, "CreateAuthorizationRequest"}, | 142 | {150, nullptr, "CreateAuthorizationRequest"}, |
| 143 | {160, nullptr, "RequiresUpdateNetworkServiceAccountIdTokenCache"}, | ||
| 144 | {161, nullptr, "RequireReauthenticationOfNetworkServiceAccount"}, | ||
| 140 | {200, nullptr, "IsRegistered"}, | 145 | {200, nullptr, "IsRegistered"}, |
| 141 | {201, nullptr, "RegisterAsync"}, | 146 | {201, nullptr, "RegisterAsync"}, |
| 142 | {202, nullptr, "UnregisterAsync"}, | 147 | {202, nullptr, "UnregisterAsync"}, |
| @@ -242,6 +247,7 @@ public: | |||
| 242 | {100, nullptr, "GetRequestWithTheme"}, | 247 | {100, nullptr, "GetRequestWithTheme"}, |
| 243 | {101, nullptr, "IsNetworkServiceAccountReplaced"}, | 248 | {101, nullptr, "IsNetworkServiceAccountReplaced"}, |
| 244 | {199, nullptr, "GetUrlForIntroductionOfExtraMembership"}, // 2.0.0 - 5.1.0 | 249 | {199, nullptr, "GetUrlForIntroductionOfExtraMembership"}, // 2.0.0 - 5.1.0 |
| 250 | {200, nullptr, "ApplyAsyncWithAuthorizedToken"}, | ||
| 245 | }; | 251 | }; |
| 246 | // clang-format on | 252 | // clang-format on |
| 247 | 253 | ||
| @@ -647,9 +653,11 @@ public: | |||
| 647 | {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, | 653 | {0, nullptr, "EnsureAuthenticationTokenCacheAsync"}, |
| 648 | {1, nullptr, "LoadAuthenticationTokenCache"}, | 654 | {1, nullptr, "LoadAuthenticationTokenCache"}, |
| 649 | {2, nullptr, "InvalidateAuthenticationTokenCache"}, | 655 | {2, nullptr, "InvalidateAuthenticationTokenCache"}, |
| 656 | {3, nullptr, "IsDeviceAuthenticationTokenCacheAvailable"}, | ||
| 650 | {10, nullptr, "EnsureEdgeTokenCacheAsync"}, | 657 | {10, nullptr, "EnsureEdgeTokenCacheAsync"}, |
| 651 | {11, nullptr, "LoadEdgeTokenCache"}, | 658 | {11, nullptr, "LoadEdgeTokenCache"}, |
| 652 | {12, nullptr, "InvalidateEdgeTokenCache"}, | 659 | {12, nullptr, "InvalidateEdgeTokenCache"}, |
| 660 | {13, nullptr, "IsEdgeTokenCacheAvailable"}, | ||
| 653 | {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, | 661 | {20, nullptr, "EnsureApplicationAuthenticationCacheAsync"}, |
| 654 | {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, | 662 | {21, nullptr, "LoadApplicationAuthenticationTokenCache"}, |
| 655 | {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, | 663 | {22, nullptr, "LoadApplicationNetworkServiceClientConfigCache"}, |
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp index b6bfd6155..d9882ecd3 100644 --- a/src/core/hle/service/acc/acc_su.cpp +++ b/src/core/hle/service/acc/acc_su.cpp | |||
| @@ -55,6 +55,10 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module_, std::shared_ptr<ProfileManager> | |||
| 55 | {290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, | 55 | {290, nullptr, "ProxyProcedureForGuestLoginWithNintendoAccount"}, |
| 56 | {291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, | 56 | {291, nullptr, "ProxyProcedureForFloatingRegistrationWithNintendoAccount"}, |
| 57 | {299, nullptr, "SuspendBackgroundDaemon"}, | 57 | {299, nullptr, "SuspendBackgroundDaemon"}, |
| 58 | {900, nullptr, "SetUserUnqualifiedForDebug"}, | ||
| 59 | {901, nullptr, "UnsetUserUnqualifiedForDebug"}, | ||
| 60 | {902, nullptr, "ListUsersUnqualifiedForDebug"}, | ||
| 61 | {910, nullptr, "RefreshFirmwareSettingsForDebug"}, | ||
| 58 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, | 62 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, |
| 59 | {998, nullptr, "DebugSetUserStateClose"}, | 63 | {998, nullptr, "DebugSetUserStateClose"}, |
| 60 | {999, nullptr, "DebugSetUserStateOpen"}, | 64 | {999, nullptr, "DebugSetUserStateOpen"}, |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index adb482941..9a7316e27 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -226,6 +226,8 @@ IDebugFunctions::IDebugFunctions(Core::System& system_) | |||
| 226 | {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, | 226 | {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, |
| 227 | {31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, | 227 | {31, nullptr, "RequestLaunchApplicationByApplicationLaunchInfoForDebug"}, |
| 228 | {40, nullptr, "GetAppletResourceUsageInfo"}, | 228 | {40, nullptr, "GetAppletResourceUsageInfo"}, |
| 229 | {50, nullptr, "AddSystemProgramIdAndAppletIdForDebug"}, | ||
| 230 | {51, nullptr, "AddOperationConfirmedLibraryAppletIdForDebug"}, | ||
| 229 | {100, nullptr, "SetCpuBoostModeForApplet"}, | 231 | {100, nullptr, "SetCpuBoostModeForApplet"}, |
| 230 | {101, nullptr, "CancelCpuBoostModeForApplet"}, | 232 | {101, nullptr, "CancelCpuBoostModeForApplet"}, |
| 231 | {110, nullptr, "PushToAppletBoundChannelForDebug"}, | 233 | {110, nullptr, "PushToAppletBoundChannelForDebug"}, |
| @@ -237,6 +239,8 @@ IDebugFunctions::IDebugFunctions(Core::System& system_) | |||
| 237 | {131, nullptr, "FriendInvitationClearApplicationParameter"}, | 239 | {131, nullptr, "FriendInvitationClearApplicationParameter"}, |
| 238 | {132, nullptr, "FriendInvitationPushApplicationParameter"}, | 240 | {132, nullptr, "FriendInvitationPushApplicationParameter"}, |
| 239 | {140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, | 241 | {140, nullptr, "RestrictPowerOperationForSecureLaunchModeForDebug"}, |
| 242 | {200, nullptr, "CreateFloatingLibraryAppletAccepterForDebug"}, | ||
| 243 | {300, nullptr, "TerminateAllRunningApplicationsForDebug"}, | ||
| 240 | {900, nullptr, "GetGrcProcessLaunchedSystemEvent"}, | 244 | {900, nullptr, "GetGrcProcessLaunchedSystemEvent"}, |
| 241 | }; | 245 | }; |
| 242 | // clang-format on | 246 | // clang-format on |
| @@ -1853,6 +1857,8 @@ IHomeMenuFunctions::IHomeMenuFunctions(Core::System& system_) | |||
| 1853 | {31, nullptr, "GetWriterLockAccessorEx"}, | 1857 | {31, nullptr, "GetWriterLockAccessorEx"}, |
| 1854 | {40, nullptr, "IsSleepEnabled"}, | 1858 | {40, nullptr, "IsSleepEnabled"}, |
| 1855 | {41, nullptr, "IsRebootEnabled"}, | 1859 | {41, nullptr, "IsRebootEnabled"}, |
| 1860 | {50, nullptr, "LaunchSystemApplet"}, | ||
| 1861 | {51, nullptr, "LaunchStarter"}, | ||
| 1856 | {100, nullptr, "PopRequestLaunchApplicationForDebug"}, | 1862 | {100, nullptr, "PopRequestLaunchApplicationForDebug"}, |
| 1857 | {110, nullptr, "IsForceTerminateApplicationDisabledForDebug"}, | 1863 | {110, nullptr, "IsForceTerminateApplicationDisabledForDebug"}, |
| 1858 | {200, nullptr, "LaunchDevMenu"}, | 1864 | {200, nullptr, "LaunchDevMenu"}, |
diff --git a/src/core/hle/service/aoc/aoc_u.cpp b/src/core/hle/service/aoc/aoc_u.cpp index 7264f23f9..1bbf057cb 100644 --- a/src/core/hle/service/aoc/aoc_u.cpp +++ b/src/core/hle/service/aoc/aoc_u.cpp | |||
| @@ -129,6 +129,9 @@ AOC_U::AOC_U(Core::System& system_) | |||
| 129 | {101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"}, | 129 | {101, &AOC_U::CreatePermanentEcPurchasedEventManager, "CreatePermanentEcPurchasedEventManager"}, |
| 130 | {110, nullptr, "CreateContentsServiceManager"}, | 130 | {110, nullptr, "CreateContentsServiceManager"}, |
| 131 | {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, | 131 | {200, nullptr, "SetRequiredAddOnContentsOnContentsAvailabilityTransition"}, |
| 132 | {300, nullptr, "SetupHostAddOnContent"}, | ||
| 133 | {301, nullptr, "GetRegisteredAddOnContentPath"}, | ||
| 134 | {302, nullptr, "UpdateCachedList"}, | ||
| 132 | }; | 135 | }; |
| 133 | // clang-format on | 136 | // clang-format on |
| 134 | 137 | ||
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index e01f87356..3db3fe188 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp | |||
| @@ -362,6 +362,8 @@ HwOpus::HwOpus(Core::System& system_) : ServiceFramework{system_, "hwopus"} { | |||
| 362 | {5, &HwOpus::GetWorkBufferSizeEx, "GetWorkBufferSizeEx"}, | 362 | {5, &HwOpus::GetWorkBufferSizeEx, "GetWorkBufferSizeEx"}, |
| 363 | {6, nullptr, "OpenHardwareOpusDecoderForMultiStreamEx"}, | 363 | {6, nullptr, "OpenHardwareOpusDecoderForMultiStreamEx"}, |
| 364 | {7, &HwOpus::GetWorkBufferSizeForMultiStreamEx, "GetWorkBufferSizeForMultiStreamEx"}, | 364 | {7, &HwOpus::GetWorkBufferSizeForMultiStreamEx, "GetWorkBufferSizeForMultiStreamEx"}, |
| 365 | {8, nullptr, "GetWorkBufferSizeExEx"}, | ||
| 366 | {9, nullptr, "GetWorkBufferSizeForMultiStreamExEx"}, | ||
| 365 | }; | 367 | }; |
| 366 | RegisterHandlers(functions); | 368 | RegisterHandlers(functions); |
| 367 | } | 369 | } |
diff --git a/src/core/hle/service/btm/btm.cpp b/src/core/hle/service/btm/btm.cpp index eebf85e03..419da36c4 100644 --- a/src/core/hle/service/btm/btm.cpp +++ b/src/core/hle/service/btm/btm.cpp | |||
| @@ -72,32 +72,36 @@ private: | |||
| 72 | void AcquireBleScanEvent(Kernel::HLERequestContext& ctx) { | 72 | void AcquireBleScanEvent(Kernel::HLERequestContext& ctx) { |
| 73 | LOG_WARNING(Service_BTM, "(STUBBED) called"); | 73 | LOG_WARNING(Service_BTM, "(STUBBED) called"); |
| 74 | 74 | ||
| 75 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 75 | IPC::ResponseBuilder rb{ctx, 3, 1}; |
| 76 | rb.Push(ResultSuccess); | 76 | rb.Push(ResultSuccess); |
| 77 | rb.Push(true); | ||
| 77 | rb.PushCopyObjects(scan_event->GetReadableEvent()); | 78 | rb.PushCopyObjects(scan_event->GetReadableEvent()); |
| 78 | } | 79 | } |
| 79 | 80 | ||
| 80 | void AcquireBleConnectionEvent(Kernel::HLERequestContext& ctx) { | 81 | void AcquireBleConnectionEvent(Kernel::HLERequestContext& ctx) { |
| 81 | LOG_WARNING(Service_BTM, "(STUBBED) called"); | 82 | LOG_WARNING(Service_BTM, "(STUBBED) called"); |
| 82 | 83 | ||
| 83 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 84 | IPC::ResponseBuilder rb{ctx, 3, 1}; |
| 84 | rb.Push(ResultSuccess); | 85 | rb.Push(ResultSuccess); |
| 86 | rb.Push(true); | ||
| 85 | rb.PushCopyObjects(connection_event->GetReadableEvent()); | 87 | rb.PushCopyObjects(connection_event->GetReadableEvent()); |
| 86 | } | 88 | } |
| 87 | 89 | ||
| 88 | void AcquireBleServiceDiscoveryEvent(Kernel::HLERequestContext& ctx) { | 90 | void AcquireBleServiceDiscoveryEvent(Kernel::HLERequestContext& ctx) { |
| 89 | LOG_WARNING(Service_BTM, "(STUBBED) called"); | 91 | LOG_WARNING(Service_BTM, "(STUBBED) called"); |
| 90 | 92 | ||
| 91 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 93 | IPC::ResponseBuilder rb{ctx, 3, 1}; |
| 92 | rb.Push(ResultSuccess); | 94 | rb.Push(ResultSuccess); |
| 95 | rb.Push(true); | ||
| 93 | rb.PushCopyObjects(service_discovery_event->GetReadableEvent()); | 96 | rb.PushCopyObjects(service_discovery_event->GetReadableEvent()); |
| 94 | } | 97 | } |
| 95 | 98 | ||
| 96 | void AcquireBleMtuConfigEvent(Kernel::HLERequestContext& ctx) { | 99 | void AcquireBleMtuConfigEvent(Kernel::HLERequestContext& ctx) { |
| 97 | LOG_WARNING(Service_BTM, "(STUBBED) called"); | 100 | LOG_WARNING(Service_BTM, "(STUBBED) called"); |
| 98 | 101 | ||
| 99 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 102 | IPC::ResponseBuilder rb{ctx, 3, 1}; |
| 100 | rb.Push(ResultSuccess); | 103 | rb.Push(ResultSuccess); |
| 104 | rb.Push(true); | ||
| 101 | rb.PushCopyObjects(config_event->GetReadableEvent()); | 105 | rb.PushCopyObjects(config_event->GetReadableEvent()); |
| 102 | } | 106 | } |
| 103 | 107 | ||
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 48f7bbf95..0da67235f 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -63,6 +63,7 @@ IAppletResource::IAppletResource(Core::System& system_, | |||
| 63 | MakeControllerWithServiceContext<Controller_NPad>(HidController::NPad, shared_memory); | 63 | MakeControllerWithServiceContext<Controller_NPad>(HidController::NPad, shared_memory); |
| 64 | MakeController<Controller_Gesture>(HidController::Gesture, shared_memory); | 64 | MakeController<Controller_Gesture>(HidController::Gesture, shared_memory); |
| 65 | MakeController<Controller_ConsoleSixAxis>(HidController::ConsoleSixAxisSensor, shared_memory); | 65 | MakeController<Controller_ConsoleSixAxis>(HidController::ConsoleSixAxisSensor, shared_memory); |
| 66 | MakeController<Controller_Stubbed>(HidController::DebugMouse, shared_memory); | ||
| 66 | MakeControllerWithServiceContext<Controller_Palma>(HidController::Palma, shared_memory); | 67 | MakeControllerWithServiceContext<Controller_Palma>(HidController::Palma, shared_memory); |
| 67 | 68 | ||
| 68 | // Homebrew doesn't try to activate some controllers, so we activate them by default | 69 | // Homebrew doesn't try to activate some controllers, so we activate them by default |
| @@ -74,6 +75,7 @@ IAppletResource::IAppletResource(Core::System& system_, | |||
| 74 | GetController<Controller_Stubbed>(HidController::CaptureButton).SetCommonHeaderOffset(0x5000); | 75 | GetController<Controller_Stubbed>(HidController::CaptureButton).SetCommonHeaderOffset(0x5000); |
| 75 | GetController<Controller_Stubbed>(HidController::InputDetector).SetCommonHeaderOffset(0x5200); | 76 | GetController<Controller_Stubbed>(HidController::InputDetector).SetCommonHeaderOffset(0x5200); |
| 76 | GetController<Controller_Stubbed>(HidController::UniquePad).SetCommonHeaderOffset(0x5A00); | 77 | GetController<Controller_Stubbed>(HidController::UniquePad).SetCommonHeaderOffset(0x5A00); |
| 78 | GetController<Controller_Stubbed>(HidController::DebugMouse).SetCommonHeaderOffset(0x3DC00); | ||
| 77 | 79 | ||
| 78 | // Register update callbacks | 80 | // Register update callbacks |
| 79 | npad_update_event = Core::Timing::CreateEvent( | 81 | npad_update_event = Core::Timing::CreateEvent( |
| @@ -236,6 +238,7 @@ Hid::Hid(Core::System& system_) | |||
| 236 | {1, &Hid::ActivateDebugPad, "ActivateDebugPad"}, | 238 | {1, &Hid::ActivateDebugPad, "ActivateDebugPad"}, |
| 237 | {11, &Hid::ActivateTouchScreen, "ActivateTouchScreen"}, | 239 | {11, &Hid::ActivateTouchScreen, "ActivateTouchScreen"}, |
| 238 | {21, &Hid::ActivateMouse, "ActivateMouse"}, | 240 | {21, &Hid::ActivateMouse, "ActivateMouse"}, |
| 241 | {26, nullptr, "ActivateDebugMouse"}, | ||
| 239 | {31, &Hid::ActivateKeyboard, "ActivateKeyboard"}, | 242 | {31, &Hid::ActivateKeyboard, "ActivateKeyboard"}, |
| 240 | {32, &Hid::SendKeyboardLockKeyEvent, "SendKeyboardLockKeyEvent"}, | 243 | {32, &Hid::SendKeyboardLockKeyEvent, "SendKeyboardLockKeyEvent"}, |
| 241 | {40, nullptr, "AcquireXpadIdEventHandle"}, | 244 | {40, nullptr, "AcquireXpadIdEventHandle"}, |
| @@ -2379,6 +2382,8 @@ public: | |||
| 2379 | {20, nullptr, "DeactivateMouse"}, | 2382 | {20, nullptr, "DeactivateMouse"}, |
| 2380 | {21, nullptr, "SetMouseAutoPilotState"}, | 2383 | {21, nullptr, "SetMouseAutoPilotState"}, |
| 2381 | {22, nullptr, "UnsetMouseAutoPilotState"}, | 2384 | {22, nullptr, "UnsetMouseAutoPilotState"}, |
| 2385 | {25, nullptr, "SetDebugMouseAutoPilotState"}, | ||
| 2386 | {26, nullptr, "UnsetDebugMouseAutoPilotState"}, | ||
| 2382 | {30, nullptr, "DeactivateKeyboard"}, | 2387 | {30, nullptr, "DeactivateKeyboard"}, |
| 2383 | {31, nullptr, "SetKeyboardAutoPilotState"}, | 2388 | {31, nullptr, "SetKeyboardAutoPilotState"}, |
| 2384 | {32, nullptr, "UnsetKeyboardAutoPilotState"}, | 2389 | {32, nullptr, "UnsetKeyboardAutoPilotState"}, |
| @@ -2494,6 +2499,7 @@ public: | |||
| 2494 | {2000, nullptr, "DeactivateDigitizer"}, | 2499 | {2000, nullptr, "DeactivateDigitizer"}, |
| 2495 | {2001, nullptr, "SetDigitizerAutoPilotState"}, | 2500 | {2001, nullptr, "SetDigitizerAutoPilotState"}, |
| 2496 | {2002, nullptr, "UnsetDigitizerAutoPilotState"}, | 2501 | {2002, nullptr, "UnsetDigitizerAutoPilotState"}, |
| 2502 | {2002, nullptr, "ReloadFirmwareDebugSettings"}, | ||
| 2497 | }; | 2503 | }; |
| 2498 | // clang-format on | 2504 | // clang-format on |
| 2499 | 2505 | ||
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index a397012a5..9ace83129 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -33,6 +33,7 @@ enum class HidController : std::size_t { | |||
| 33 | NPad, | 33 | NPad, |
| 34 | Gesture, | 34 | Gesture, |
| 35 | ConsoleSixAxisSensor, | 35 | ConsoleSixAxisSensor, |
| 36 | DebugMouse, | ||
| 36 | Palma, | 37 | Palma, |
| 37 | 38 | ||
| 38 | MaxControllers, | 39 | MaxControllers, |
diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp index da1c8415c..07199d5d5 100644 --- a/src/core/hle/service/hid/hidbus.cpp +++ b/src/core/hle/service/hid/hidbus.cpp | |||
| @@ -91,7 +91,7 @@ std::optional<std::size_t> HidBus::GetDeviceIndexFromHandle(BusHandle handle) co | |||
| 91 | if (handle.abstracted_pad_id == device_handle.abstracted_pad_id && | 91 | if (handle.abstracted_pad_id == device_handle.abstracted_pad_id && |
| 92 | handle.internal_index == device_handle.internal_index && | 92 | handle.internal_index == device_handle.internal_index && |
| 93 | handle.player_number == device_handle.player_number && | 93 | handle.player_number == device_handle.player_number && |
| 94 | handle.bus_type == device_handle.bus_type && | 94 | handle.bus_type_id == device_handle.bus_type_id && |
| 95 | handle.is_valid == device_handle.is_valid) { | 95 | handle.is_valid == device_handle.is_valid) { |
| 96 | return i; | 96 | return i; |
| 97 | } | 97 | } |
| @@ -123,7 +123,7 @@ void HidBus::GetBusHandle(Kernel::HLERequestContext& ctx) { | |||
| 123 | continue; | 123 | continue; |
| 124 | } | 124 | } |
| 125 | if (static_cast<Core::HID::NpadIdType>(handle.player_number) == parameters.npad_id && | 125 | if (static_cast<Core::HID::NpadIdType>(handle.player_number) == parameters.npad_id && |
| 126 | handle.bus_type == parameters.bus_type) { | 126 | handle.bus_type_id == static_cast<u8>(parameters.bus_type)) { |
| 127 | is_handle_found = true; | 127 | is_handle_found = true; |
| 128 | handle_index = i; | 128 | handle_index = i; |
| 129 | break; | 129 | break; |
| @@ -140,7 +140,7 @@ void HidBus::GetBusHandle(Kernel::HLERequestContext& ctx) { | |||
| 140 | .abstracted_pad_id = static_cast<u8>(i), | 140 | .abstracted_pad_id = static_cast<u8>(i), |
| 141 | .internal_index = static_cast<u8>(i), | 141 | .internal_index = static_cast<u8>(i), |
| 142 | .player_number = static_cast<u8>(parameters.npad_id), | 142 | .player_number = static_cast<u8>(parameters.npad_id), |
| 143 | .bus_type = parameters.bus_type, | 143 | .bus_type_id = static_cast<u8>(parameters.bus_type), |
| 144 | .is_valid = true, | 144 | .is_valid = true, |
| 145 | }; | 145 | }; |
| 146 | handle_index = i; | 146 | handle_index = i; |
| @@ -172,7 +172,7 @@ void HidBus::IsExternalDeviceConnected(Kernel::HLERequestContext& ctx) { | |||
| 172 | LOG_INFO(Service_HID, | 172 | LOG_INFO(Service_HID, |
| 173 | "Called, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 173 | "Called, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 174 | "player_number={}, is_valid={}", | 174 | "player_number={}, is_valid={}", |
| 175 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 175 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 176 | bus_handle_.player_number, bus_handle_.is_valid); | 176 | bus_handle_.player_number, bus_handle_.is_valid); |
| 177 | 177 | ||
| 178 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 178 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -201,7 +201,7 @@ void HidBus::Initialize(Kernel::HLERequestContext& ctx) { | |||
| 201 | LOG_INFO(Service_HID, | 201 | LOG_INFO(Service_HID, |
| 202 | "called, abstracted_pad_id={} bus_type={} internal_index={} " | 202 | "called, abstracted_pad_id={} bus_type={} internal_index={} " |
| 203 | "player_number={} is_valid={}, applet_resource_user_id={}", | 203 | "player_number={} is_valid={}, applet_resource_user_id={}", |
| 204 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 204 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 205 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); | 205 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); |
| 206 | 206 | ||
| 207 | is_hidbus_enabled = true; | 207 | is_hidbus_enabled = true; |
| @@ -253,7 +253,7 @@ void HidBus::Finalize(Kernel::HLERequestContext& ctx) { | |||
| 253 | LOG_INFO(Service_HID, | 253 | LOG_INFO(Service_HID, |
| 254 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 254 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 255 | "player_number={}, is_valid={}, applet_resource_user_id={}", | 255 | "player_number={}, is_valid={}, applet_resource_user_id={}", |
| 256 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 256 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 257 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); | 257 | bus_handle_.player_number, bus_handle_.is_valid, applet_resource_user_id); |
| 258 | 258 | ||
| 259 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 259 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -301,7 +301,7 @@ void HidBus::EnableExternalDevice(Kernel::HLERequestContext& ctx) { | |||
| 301 | "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 301 | "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 302 | "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}", | 302 | "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}", |
| 303 | parameters.enable, parameters.bus_handle.abstracted_pad_id, | 303 | parameters.enable, parameters.bus_handle.abstracted_pad_id, |
| 304 | parameters.bus_handle.bus_type, parameters.bus_handle.internal_index, | 304 | parameters.bus_handle.bus_type_id, parameters.bus_handle.internal_index, |
| 305 | parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval, | 305 | parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval, |
| 306 | parameters.applet_resource_user_id); | 306 | parameters.applet_resource_user_id); |
| 307 | 307 | ||
| @@ -329,7 +329,7 @@ void HidBus::GetExternalDeviceId(Kernel::HLERequestContext& ctx) { | |||
| 329 | LOG_DEBUG(Service_HID, | 329 | LOG_DEBUG(Service_HID, |
| 330 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 330 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 331 | "is_valid={}", | 331 | "is_valid={}", |
| 332 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 332 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 333 | bus_handle_.player_number, bus_handle_.is_valid); | 333 | bus_handle_.player_number, bus_handle_.is_valid); |
| 334 | 334 | ||
| 335 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 335 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -357,7 +357,7 @@ void HidBus::SendCommandAsync(Kernel::HLERequestContext& ctx) { | |||
| 357 | LOG_DEBUG(Service_HID, | 357 | LOG_DEBUG(Service_HID, |
| 358 | "called, data_size={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " | 358 | "called, data_size={}, abstracted_pad_id={}, bus_type={}, internal_index={}, " |
| 359 | "player_number={}, is_valid={}", | 359 | "player_number={}, is_valid={}", |
| 360 | data.size(), bus_handle_.abstracted_pad_id, bus_handle_.bus_type, | 360 | data.size(), bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, |
| 361 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); | 361 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); |
| 362 | 362 | ||
| 363 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 363 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -384,7 +384,7 @@ void HidBus::GetSendCommandAsynceResult(Kernel::HLERequestContext& ctx) { | |||
| 384 | LOG_DEBUG(Service_HID, | 384 | LOG_DEBUG(Service_HID, |
| 385 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 385 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 386 | "is_valid={}", | 386 | "is_valid={}", |
| 387 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 387 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 388 | bus_handle_.player_number, bus_handle_.is_valid); | 388 | bus_handle_.player_number, bus_handle_.is_valid); |
| 389 | 389 | ||
| 390 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 390 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -413,7 +413,7 @@ void HidBus::SetEventForSendCommandAsycResult(Kernel::HLERequestContext& ctx) { | |||
| 413 | LOG_INFO(Service_HID, | 413 | LOG_INFO(Service_HID, |
| 414 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 414 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 415 | "is_valid={}", | 415 | "is_valid={}", |
| 416 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 416 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 417 | bus_handle_.player_number, bus_handle_.is_valid); | 417 | bus_handle_.player_number, bus_handle_.is_valid); |
| 418 | 418 | ||
| 419 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 419 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -464,7 +464,7 @@ void HidBus::EnableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) { | |||
| 464 | LOG_INFO(Service_HID, | 464 | LOG_INFO(Service_HID, |
| 465 | "called, t_mem_handle=0x{:08X}, polling_mode={}, abstracted_pad_id={}, bus_type={}, " | 465 | "called, t_mem_handle=0x{:08X}, polling_mode={}, abstracted_pad_id={}, bus_type={}, " |
| 466 | "internal_index={}, player_number={}, is_valid={}", | 466 | "internal_index={}, player_number={}, is_valid={}", |
| 467 | t_mem_handle, polling_mode_, bus_handle_.abstracted_pad_id, bus_handle_.bus_type, | 467 | t_mem_handle, polling_mode_, bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, |
| 468 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); | 468 | bus_handle_.internal_index, bus_handle_.player_number, bus_handle_.is_valid); |
| 469 | 469 | ||
| 470 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 470 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
| @@ -492,7 +492,7 @@ void HidBus::DisableJoyPollingReceiveMode(Kernel::HLERequestContext& ctx) { | |||
| 492 | LOG_INFO(Service_HID, | 492 | LOG_INFO(Service_HID, |
| 493 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " | 493 | "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, " |
| 494 | "is_valid={}", | 494 | "is_valid={}", |
| 495 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index, | 495 | bus_handle_.abstracted_pad_id, bus_handle_.bus_type_id, bus_handle_.internal_index, |
| 496 | bus_handle_.player_number, bus_handle_.is_valid); | 496 | bus_handle_.player_number, bus_handle_.is_valid); |
| 497 | 497 | ||
| 498 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); | 498 | const auto device_index = GetDeviceIndexFromHandle(bus_handle_); |
diff --git a/src/core/hle/service/hid/hidbus.h b/src/core/hle/service/hid/hidbus.h index 9a4702021..85ed96e2e 100644 --- a/src/core/hle/service/hid/hidbus.h +++ b/src/core/hle/service/hid/hidbus.h | |||
| @@ -41,7 +41,7 @@ private: | |||
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | // This is nn::hidbus::BusType | 43 | // This is nn::hidbus::BusType |
| 44 | enum class BusType : u8 { | 44 | enum class BusType : u32 { |
| 45 | LeftJoyRail, | 45 | LeftJoyRail, |
| 46 | RightJoyRail, | 46 | RightJoyRail, |
| 47 | InternalBus, // Lark microphone | 47 | InternalBus, // Lark microphone |
| @@ -54,7 +54,7 @@ private: | |||
| 54 | u32 abstracted_pad_id; | 54 | u32 abstracted_pad_id; |
| 55 | u8 internal_index; | 55 | u8 internal_index; |
| 56 | u8 player_number; | 56 | u8 player_number; |
| 57 | BusType bus_type; | 57 | u8 bus_type_id; |
| 58 | bool is_valid; | 58 | bool is_valid; |
| 59 | }; | 59 | }; |
| 60 | static_assert(sizeof(BusHandle) == 0x8, "BusHandle is an invalid size"); | 60 | static_assert(sizeof(BusHandle) == 0x8, "BusHandle is an invalid size"); |
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 68210a108..4c66cfeba 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp | |||
| @@ -124,6 +124,7 @@ public: | |||
| 124 | {12, nullptr, "InactivateContentMetaDatabase"}, | 124 | {12, nullptr, "InactivateContentMetaDatabase"}, |
| 125 | {13, nullptr, "InvalidateRightsIdCache"}, | 125 | {13, nullptr, "InvalidateRightsIdCache"}, |
| 126 | {14, nullptr, "GetMemoryReport"}, | 126 | {14, nullptr, "GetMemoryReport"}, |
| 127 | {15, nullptr, "ActivateFsContentStorage"}, | ||
| 127 | }; | 128 | }; |
| 128 | // clang-format on | 129 | // clang-format on |
| 129 | 130 | ||
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index f59a1a63d..e53bdde52 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -159,6 +159,8 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ | |||
| 159 | {606, nullptr, "GetContentMetaStorage"}, | 159 | {606, nullptr, "GetContentMetaStorage"}, |
| 160 | {607, nullptr, "ListAvailableAddOnContent"}, | 160 | {607, nullptr, "ListAvailableAddOnContent"}, |
| 161 | {609, nullptr, "ListAvailabilityAssuredAddOnContent"}, | 161 | {609, nullptr, "ListAvailabilityAssuredAddOnContent"}, |
| 162 | {610, nullptr, "GetInstalledContentMetaStorage"}, | ||
| 163 | {611, nullptr, "PrepareAddOnContent"}, | ||
| 162 | {700, nullptr, "PushDownloadTaskList"}, | 164 | {700, nullptr, "PushDownloadTaskList"}, |
| 163 | {701, nullptr, "ClearTaskStatusList"}, | 165 | {701, nullptr, "ClearTaskStatusList"}, |
| 164 | {702, nullptr, "RequestDownloadTaskList"}, | 166 | {702, nullptr, "RequestDownloadTaskList"}, |
| @@ -228,6 +230,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ | |||
| 228 | {1900, nullptr, "IsActiveAccount"}, | 230 | {1900, nullptr, "IsActiveAccount"}, |
| 229 | {1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, | 231 | {1901, nullptr, "RequestDownloadApplicationPrepurchasedRights"}, |
| 230 | {1902, nullptr, "GetApplicationTicketInfo"}, | 232 | {1902, nullptr, "GetApplicationTicketInfo"}, |
| 233 | {1903, nullptr, "RequestDownloadApplicationPrepurchasedRightsForAccount"}, | ||
| 231 | {2000, nullptr, "GetSystemDeliveryInfo"}, | 234 | {2000, nullptr, "GetSystemDeliveryInfo"}, |
| 232 | {2001, nullptr, "SelectLatestSystemDeliveryInfo"}, | 235 | {2001, nullptr, "SelectLatestSystemDeliveryInfo"}, |
| 233 | {2002, nullptr, "VerifyDeliveryProtocolVersion"}, | 236 | {2002, nullptr, "VerifyDeliveryProtocolVersion"}, |
| @@ -276,8 +279,11 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ | |||
| 276 | {2352, nullptr, "RequestResolveNoDownloadRightsError"}, | 279 | {2352, nullptr, "RequestResolveNoDownloadRightsError"}, |
| 277 | {2353, nullptr, "GetApplicationDownloadTaskInfo"}, | 280 | {2353, nullptr, "GetApplicationDownloadTaskInfo"}, |
| 278 | {2354, nullptr, "PrioritizeApplicationBackgroundTask"}, | 281 | {2354, nullptr, "PrioritizeApplicationBackgroundTask"}, |
| 279 | {2355, nullptr, "Unknown2355"}, | 282 | {2355, nullptr, "PreferStorageEfficientUpdate"}, |
| 280 | {2356, nullptr, "Unknown2356"}, | 283 | {2356, nullptr, "RequestStorageEfficientUpdatePreferable"}, |
| 284 | {2357, nullptr, "EnableMultiCoreDownload"}, | ||
| 285 | {2358, nullptr, "DisableMultiCoreDownload"}, | ||
| 286 | {2359, nullptr, "IsMultiCoreDownloadEnabled"}, | ||
| 281 | {2400, nullptr, "GetPromotionInfo"}, | 287 | {2400, nullptr, "GetPromotionInfo"}, |
| 282 | {2401, nullptr, "CountPromotionInfo"}, | 288 | {2401, nullptr, "CountPromotionInfo"}, |
| 283 | {2402, nullptr, "ListPromotionInfo"}, | 289 | {2402, nullptr, "ListPromotionInfo"}, |
| @@ -295,6 +301,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ | |||
| 295 | {2519, nullptr, "IsQualificationTransitionSupported"}, | 301 | {2519, nullptr, "IsQualificationTransitionSupported"}, |
| 296 | {2520, nullptr, "IsQualificationTransitionSupportedByProcessId"}, | 302 | {2520, nullptr, "IsQualificationTransitionSupportedByProcessId"}, |
| 297 | {2521, nullptr, "GetRightsUserChangedEvent"}, | 303 | {2521, nullptr, "GetRightsUserChangedEvent"}, |
| 304 | {2522, nullptr, "IsRomRedirectionAvailable"}, | ||
| 298 | {2800, nullptr, "GetApplicationIdOfPreomia"}, | 305 | {2800, nullptr, "GetApplicationIdOfPreomia"}, |
| 299 | {3000, nullptr, "RegisterDeviceLockKey"}, | 306 | {3000, nullptr, "RegisterDeviceLockKey"}, |
| 300 | {3001, nullptr, "UnregisterDeviceLockKey"}, | 307 | {3001, nullptr, "UnregisterDeviceLockKey"}, |
| @@ -311,6 +318,7 @@ IApplicationManagerInterface::IApplicationManagerInterface(Core::System& system_ | |||
| 311 | {3012, nullptr, "IsApplicationTitleHidden"}, | 318 | {3012, nullptr, "IsApplicationTitleHidden"}, |
| 312 | {3013, nullptr, "IsGameCardEnabled"}, | 319 | {3013, nullptr, "IsGameCardEnabled"}, |
| 313 | {3014, nullptr, "IsLocalContentShareEnabled"}, | 320 | {3014, nullptr, "IsLocalContentShareEnabled"}, |
| 321 | {3050, nullptr, "ListAssignELicenseTaskResult"}, | ||
| 314 | {9999, nullptr, "GetApplicationCertificate"}, | 322 | {9999, nullptr, "GetApplicationCertificate"}, |
| 315 | }; | 323 | }; |
| 316 | // clang-format on | 324 | // clang-format on |
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index bdb499268..330a66409 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp | |||
| @@ -954,6 +954,9 @@ BSDCFG::BSDCFG(Core::System& system_) : ServiceFramework{system_, "bsdcfg"} { | |||
| 954 | {10, nullptr, "ClearArpEntries"}, | 954 | {10, nullptr, "ClearArpEntries"}, |
| 955 | {11, nullptr, "ClearArpEntries2"}, | 955 | {11, nullptr, "ClearArpEntries2"}, |
| 956 | {12, nullptr, "PrintArpEntries"}, | 956 | {12, nullptr, "PrintArpEntries"}, |
| 957 | {13, nullptr, "Unknown13"}, | ||
| 958 | {14, nullptr, "Unknown14"}, | ||
| 959 | {15, nullptr, "Unknown15"}, | ||
| 957 | }; | 960 | }; |
| 958 | // clang-format on | 961 | // clang-format on |
| 959 | 962 | ||
diff --git a/src/core/hle/service/ssl/ssl.cpp b/src/core/hle/service/ssl/ssl.cpp index dcf47083f..015208593 100644 --- a/src/core/hle/service/ssl/ssl.cpp +++ b/src/core/hle/service/ssl/ssl.cpp | |||
| @@ -46,6 +46,14 @@ public: | |||
| 46 | {25, nullptr, "GetCipherInfo"}, | 46 | {25, nullptr, "GetCipherInfo"}, |
| 47 | {26, nullptr, "SetNextAlpnProto"}, | 47 | {26, nullptr, "SetNextAlpnProto"}, |
| 48 | {27, nullptr, "GetNextAlpnProto"}, | 48 | {27, nullptr, "GetNextAlpnProto"}, |
| 49 | {28, nullptr, "SetDtlsSocketDescriptor"}, | ||
| 50 | {29, nullptr, "GetDtlsHandshakeTimeout"}, | ||
| 51 | {30, nullptr, "SetPrivateOption"}, | ||
| 52 | {31, nullptr, "SetSrtpCiphers"}, | ||
| 53 | {32, nullptr, "GetSrtpCipher"}, | ||
| 54 | {33, nullptr, "ExportKeyingMaterial"}, | ||
| 55 | {34, nullptr, "SetIoTimeout"}, | ||
| 56 | {35, nullptr, "GetIoTimeout"}, | ||
| 49 | }; | 57 | }; |
| 50 | // clang-format on | 58 | // clang-format on |
| 51 | 59 | ||
| @@ -69,6 +77,8 @@ public: | |||
| 69 | {9, nullptr, "AddPolicyOid"}, | 77 | {9, nullptr, "AddPolicyOid"}, |
| 70 | {10, nullptr, "ImportCrl"}, | 78 | {10, nullptr, "ImportCrl"}, |
| 71 | {11, nullptr, "RemoveCrl"}, | 79 | {11, nullptr, "RemoveCrl"}, |
| 80 | {12, nullptr, "ImportClientCertKeyPki"}, | ||
| 81 | {13, nullptr, "GeneratePrivateKeyAndCert"}, | ||
| 72 | }; | 82 | }; |
| 73 | RegisterHandlers(functions); | 83 | RegisterHandlers(functions); |
| 74 | } | 84 | } |
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 2fb631183..0915785d2 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -249,6 +249,9 @@ public: | |||
| 249 | {2053, nullptr, "DestroyIndirectProducerEndPoint"}, | 249 | {2053, nullptr, "DestroyIndirectProducerEndPoint"}, |
| 250 | {2054, nullptr, "CreateIndirectConsumerEndPoint"}, | 250 | {2054, nullptr, "CreateIndirectConsumerEndPoint"}, |
| 251 | {2055, nullptr, "DestroyIndirectConsumerEndPoint"}, | 251 | {2055, nullptr, "DestroyIndirectConsumerEndPoint"}, |
| 252 | {2060, nullptr, "CreateWatermarkCompositor"}, | ||
| 253 | {2062, nullptr, "SetWatermarkText"}, | ||
| 254 | {2063, nullptr, "SetWatermarkLayerStacks"}, | ||
| 252 | {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, | 255 | {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, |
| 253 | {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, | 256 | {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, |
| 254 | {2302, nullptr, "GetDisplayHotplugEvent"}, | 257 | {2302, nullptr, "GetDisplayHotplugEvent"}, |
| @@ -279,6 +282,8 @@ public: | |||
| 279 | {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, | 282 | {6011, nullptr, "EnableLayerAutoClearTransitionBuffer"}, |
| 280 | {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, | 283 | {6012, nullptr, "DisableLayerAutoClearTransitionBuffer"}, |
| 281 | {6013, nullptr, "SetLayerOpacity"}, | 284 | {6013, nullptr, "SetLayerOpacity"}, |
| 285 | {6014, nullptr, "AttachLayerWatermarkCompositor"}, | ||
| 286 | {6015, nullptr, "DetachLayerWatermarkCompositor"}, | ||
| 282 | {7000, nullptr, "SetContentVisibility"}, | 287 | {7000, nullptr, "SetContentVisibility"}, |
| 283 | {8000, nullptr, "SetConductorLayer"}, | 288 | {8000, nullptr, "SetConductorLayer"}, |
| 284 | {8001, nullptr, "SetTimestampTracking"}, | 289 | {8001, nullptr, "SetTimestampTracking"}, |
diff --git a/src/core/hle/service/vi/vi_m.cpp b/src/core/hle/service/vi/vi_m.cpp index 1ab7fe4ab..7ca44354b 100644 --- a/src/core/hle/service/vi/vi_m.cpp +++ b/src/core/hle/service/vi/vi_m.cpp | |||
| @@ -14,6 +14,10 @@ VI_M::VI_M(Core::System& system_, NVFlinger::NVFlinger& nv_flinger_, | |||
| 14 | static const FunctionInfo functions[] = { | 14 | static const FunctionInfo functions[] = { |
| 15 | {2, &VI_M::GetDisplayService, "GetDisplayService"}, | 15 | {2, &VI_M::GetDisplayService, "GetDisplayService"}, |
| 16 | {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, | 16 | {3, nullptr, "GetDisplayServiceWithProxyNameExchange"}, |
| 17 | {100, nullptr, "PrepareFatal"}, | ||
| 18 | {101, nullptr, "ShowFatal"}, | ||
| 19 | {102, nullptr, "DrawFatalRectangle"}, | ||
| 20 | {103, nullptr, "DrawFatalText32"}, | ||
| 17 | }; | 21 | }; |
| 18 | RegisterHandlers(functions); | 22 | RegisterHandlers(functions); |
| 19 | } | 23 | } |
diff --git a/src/input_common/drivers/mouse.cpp b/src/input_common/drivers/mouse.cpp index da50e0a24..8b7f9aee9 100644 --- a/src/input_common/drivers/mouse.cpp +++ b/src/input_common/drivers/mouse.cpp | |||
| @@ -10,17 +10,25 @@ | |||
| 10 | #include "input_common/drivers/mouse.h" | 10 | #include "input_common/drivers/mouse.h" |
| 11 | 11 | ||
| 12 | namespace InputCommon { | 12 | namespace InputCommon { |
| 13 | constexpr int update_time = 10; | ||
| 14 | constexpr float default_stick_sensitivity = 0.022f; | ||
| 15 | constexpr float default_motion_sensitivity = 0.008f; | ||
| 13 | constexpr int mouse_axis_x = 0; | 16 | constexpr int mouse_axis_x = 0; |
| 14 | constexpr int mouse_axis_y = 1; | 17 | constexpr int mouse_axis_y = 1; |
| 15 | constexpr int wheel_axis_x = 2; | 18 | constexpr int wheel_axis_x = 2; |
| 16 | constexpr int wheel_axis_y = 3; | 19 | constexpr int wheel_axis_y = 3; |
| 17 | constexpr int motion_wheel_y = 4; | ||
| 18 | constexpr PadIdentifier identifier = { | 20 | constexpr PadIdentifier identifier = { |
| 19 | .guid = Common::UUID{}, | 21 | .guid = Common::UUID{}, |
| 20 | .port = 0, | 22 | .port = 0, |
| 21 | .pad = 0, | 23 | .pad = 0, |
| 22 | }; | 24 | }; |
| 23 | 25 | ||
| 26 | constexpr PadIdentifier motion_identifier = { | ||
| 27 | .guid = Common::UUID{}, | ||
| 28 | .port = 0, | ||
| 29 | .pad = 1, | ||
| 30 | }; | ||
| 31 | |||
| 24 | constexpr PadIdentifier real_mouse_identifier = { | 32 | constexpr PadIdentifier real_mouse_identifier = { |
| 25 | .guid = Common::UUID{}, | 33 | .guid = Common::UUID{}, |
| 26 | .port = 1, | 34 | .port = 1, |
| @@ -37,47 +45,87 @@ Mouse::Mouse(std::string input_engine_) : InputEngine(std::move(input_engine_)) | |||
| 37 | PreSetController(identifier); | 45 | PreSetController(identifier); |
| 38 | PreSetController(real_mouse_identifier); | 46 | PreSetController(real_mouse_identifier); |
| 39 | PreSetController(touch_identifier); | 47 | PreSetController(touch_identifier); |
| 48 | PreSetController(motion_identifier); | ||
| 40 | 49 | ||
| 41 | // Initialize all mouse axis | 50 | // Initialize all mouse axis |
| 42 | PreSetAxis(identifier, mouse_axis_x); | 51 | PreSetAxis(identifier, mouse_axis_x); |
| 43 | PreSetAxis(identifier, mouse_axis_y); | 52 | PreSetAxis(identifier, mouse_axis_y); |
| 44 | PreSetAxis(identifier, wheel_axis_x); | 53 | PreSetAxis(identifier, wheel_axis_x); |
| 45 | PreSetAxis(identifier, wheel_axis_y); | 54 | PreSetAxis(identifier, wheel_axis_y); |
| 46 | PreSetAxis(identifier, motion_wheel_y); | ||
| 47 | PreSetAxis(real_mouse_identifier, mouse_axis_x); | 55 | PreSetAxis(real_mouse_identifier, mouse_axis_x); |
| 48 | PreSetAxis(real_mouse_identifier, mouse_axis_y); | 56 | PreSetAxis(real_mouse_identifier, mouse_axis_y); |
| 49 | PreSetAxis(touch_identifier, mouse_axis_x); | 57 | PreSetAxis(touch_identifier, mouse_axis_x); |
| 50 | PreSetAxis(touch_identifier, mouse_axis_y); | 58 | PreSetAxis(touch_identifier, mouse_axis_y); |
| 59 | |||
| 60 | // Initialize variables | ||
| 61 | mouse_origin = {}; | ||
| 62 | last_mouse_position = {}; | ||
| 63 | wheel_position = {}; | ||
| 64 | last_mouse_change = {}; | ||
| 65 | last_motion_change = {}; | ||
| 66 | |||
| 51 | update_thread = std::jthread([this](std::stop_token stop_token) { UpdateThread(stop_token); }); | 67 | update_thread = std::jthread([this](std::stop_token stop_token) { UpdateThread(stop_token); }); |
| 52 | } | 68 | } |
| 53 | 69 | ||
| 54 | void Mouse::UpdateThread(std::stop_token stop_token) { | 70 | void Mouse::UpdateThread(std::stop_token stop_token) { |
| 55 | Common::SetCurrentThreadName("Mouse"); | 71 | Common::SetCurrentThreadName("Mouse"); |
| 56 | constexpr int update_time = 10; | ||
| 57 | while (!stop_token.stop_requested()) { | ||
| 58 | if (Settings::values.mouse_panning) { | ||
| 59 | // Slow movement by 4% | ||
| 60 | last_mouse_change *= 0.96f; | ||
| 61 | const float sensitivity = | ||
| 62 | Settings::values.mouse_panning_sensitivity.GetValue() * 0.022f; | ||
| 63 | SetAxis(identifier, mouse_axis_x, last_mouse_change.x * sensitivity); | ||
| 64 | SetAxis(identifier, mouse_axis_y, -last_mouse_change.y * sensitivity); | ||
| 65 | } | ||
| 66 | 72 | ||
| 67 | SetAxis(identifier, motion_wheel_y, 0.0f); | 73 | while (!stop_token.stop_requested()) { |
| 74 | UpdateStickInput(); | ||
| 75 | UpdateMotionInput(); | ||
| 68 | 76 | ||
| 69 | if (mouse_panning_timout++ > 20) { | 77 | if (mouse_panning_timeout++ > 20) { |
| 70 | StopPanning(); | 78 | StopPanning(); |
| 71 | } | 79 | } |
| 72 | std::this_thread::sleep_for(std::chrono::milliseconds(update_time)); | 80 | std::this_thread::sleep_for(std::chrono::milliseconds(update_time)); |
| 73 | } | 81 | } |
| 74 | } | 82 | } |
| 75 | 83 | ||
| 84 | void Mouse::UpdateStickInput() { | ||
| 85 | if (!Settings::values.mouse_panning) { | ||
| 86 | return; | ||
| 87 | } | ||
| 88 | |||
| 89 | const float sensitivity = | ||
| 90 | Settings::values.mouse_panning_sensitivity.GetValue() * default_stick_sensitivity; | ||
| 91 | |||
| 92 | // Slow movement by 4% | ||
| 93 | last_mouse_change *= 0.96f; | ||
| 94 | SetAxis(identifier, mouse_axis_x, last_mouse_change.x * sensitivity); | ||
| 95 | SetAxis(identifier, mouse_axis_y, -last_mouse_change.y * sensitivity); | ||
| 96 | } | ||
| 97 | |||
| 98 | void Mouse::UpdateMotionInput() { | ||
| 99 | const float sensitivity = | ||
| 100 | Settings::values.mouse_panning_sensitivity.GetValue() * default_motion_sensitivity; | ||
| 101 | |||
| 102 | // Slow movement by 7% | ||
| 103 | if (Settings::values.mouse_panning) { | ||
| 104 | last_motion_change *= 0.93f; | ||
| 105 | } else { | ||
| 106 | last_motion_change.z *= 0.93f; | ||
| 107 | } | ||
| 108 | |||
| 109 | const BasicMotion motion_data{ | ||
| 110 | .gyro_x = last_motion_change.x * sensitivity, | ||
| 111 | .gyro_y = last_motion_change.y * sensitivity, | ||
| 112 | .gyro_z = last_motion_change.z * sensitivity, | ||
| 113 | .accel_x = 0, | ||
| 114 | .accel_y = 0, | ||
| 115 | .accel_z = 0, | ||
| 116 | .delta_timestamp = update_time * 1000, | ||
| 117 | }; | ||
| 118 | |||
| 119 | SetMotion(motion_identifier, 0, motion_data); | ||
| 120 | } | ||
| 121 | |||
| 76 | void Mouse::Move(int x, int y, int center_x, int center_y) { | 122 | void Mouse::Move(int x, int y, int center_x, int center_y) { |
| 77 | if (Settings::values.mouse_panning) { | 123 | if (Settings::values.mouse_panning) { |
| 124 | mouse_panning_timeout = 0; | ||
| 125 | |||
| 78 | auto mouse_change = | 126 | auto mouse_change = |
| 79 | (Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y)).Cast<float>(); | 127 | (Common::MakeVec(x, y) - Common::MakeVec(center_x, center_y)).Cast<float>(); |
| 80 | mouse_panning_timout = 0; | 128 | Common::Vec3<float> motion_change{-mouse_change.y, -mouse_change.x, last_motion_change.z}; |
| 81 | 129 | ||
| 82 | const auto move_distance = mouse_change.Length(); | 130 | const auto move_distance = mouse_change.Length(); |
| 83 | if (move_distance == 0) { | 131 | if (move_distance == 0) { |
| @@ -93,6 +141,7 @@ void Mouse::Move(int x, int y, int center_x, int center_y) { | |||
| 93 | 141 | ||
| 94 | // Average mouse movements | 142 | // Average mouse movements |
| 95 | last_mouse_change = (last_mouse_change * 0.91f) + (mouse_change * 0.09f); | 143 | last_mouse_change = (last_mouse_change * 0.91f) + (mouse_change * 0.09f); |
| 144 | last_motion_change = (last_motion_change * 0.69f) + (motion_change * 0.31f); | ||
| 96 | 145 | ||
| 97 | const auto last_move_distance = last_mouse_change.Length(); | 146 | const auto last_move_distance = last_mouse_change.Length(); |
| 98 | 147 | ||
| @@ -116,6 +165,12 @@ void Mouse::Move(int x, int y, int center_x, int center_y) { | |||
| 116 | const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue() * 0.0012f; | 165 | const float sensitivity = Settings::values.mouse_panning_sensitivity.GetValue() * 0.0012f; |
| 117 | SetAxis(identifier, mouse_axis_x, static_cast<float>(mouse_move.x) * sensitivity); | 166 | SetAxis(identifier, mouse_axis_x, static_cast<float>(mouse_move.x) * sensitivity); |
| 118 | SetAxis(identifier, mouse_axis_y, static_cast<float>(-mouse_move.y) * sensitivity); | 167 | SetAxis(identifier, mouse_axis_y, static_cast<float>(-mouse_move.y) * sensitivity); |
| 168 | |||
| 169 | last_motion_change = { | ||
| 170 | static_cast<float>(-mouse_move.y) / 50.0f, | ||
| 171 | static_cast<float>(-mouse_move.x) / 50.0f, | ||
| 172 | last_motion_change.z, | ||
| 173 | }; | ||
| 119 | } | 174 | } |
| 120 | } | 175 | } |
| 121 | 176 | ||
| @@ -157,15 +212,19 @@ void Mouse::ReleaseButton(MouseButton button) { | |||
| 157 | SetAxis(identifier, mouse_axis_x, 0); | 212 | SetAxis(identifier, mouse_axis_x, 0); |
| 158 | SetAxis(identifier, mouse_axis_y, 0); | 213 | SetAxis(identifier, mouse_axis_y, 0); |
| 159 | } | 214 | } |
| 215 | |||
| 216 | last_motion_change.x = 0; | ||
| 217 | last_motion_change.y = 0; | ||
| 218 | |||
| 160 | button_pressed = false; | 219 | button_pressed = false; |
| 161 | } | 220 | } |
| 162 | 221 | ||
| 163 | void Mouse::MouseWheelChange(int x, int y) { | 222 | void Mouse::MouseWheelChange(int x, int y) { |
| 164 | wheel_position.x += x; | 223 | wheel_position.x += x; |
| 165 | wheel_position.y += y; | 224 | wheel_position.y += y; |
| 225 | last_motion_change.z += static_cast<f32>(y) / 100.0f; | ||
| 166 | SetAxis(identifier, wheel_axis_x, static_cast<f32>(wheel_position.x)); | 226 | SetAxis(identifier, wheel_axis_x, static_cast<f32>(wheel_position.x)); |
| 167 | SetAxis(identifier, wheel_axis_y, static_cast<f32>(wheel_position.y)); | 227 | SetAxis(identifier, wheel_axis_y, static_cast<f32>(wheel_position.y)); |
| 168 | SetAxis(identifier, motion_wheel_y, static_cast<f32>(y) / 100.0f); | ||
| 169 | } | 228 | } |
| 170 | 229 | ||
| 171 | void Mouse::ReleaseAllButtons() { | 230 | void Mouse::ReleaseAllButtons() { |
| @@ -234,6 +293,9 @@ Common::Input::ButtonNames Mouse::GetUIName(const Common::ParamPackage& params) | |||
| 234 | if (params.Has("axis_x") && params.Has("axis_y") && params.Has("axis_z")) { | 293 | if (params.Has("axis_x") && params.Has("axis_y") && params.Has("axis_z")) { |
| 235 | return Common::Input::ButtonNames::Engine; | 294 | return Common::Input::ButtonNames::Engine; |
| 236 | } | 295 | } |
| 296 | if (params.Has("motion")) { | ||
| 297 | return Common::Input::ButtonNames::Engine; | ||
| 298 | } | ||
| 237 | 299 | ||
| 238 | return Common::Input::ButtonNames::Invalid; | 300 | return Common::Input::ButtonNames::Invalid; |
| 239 | } | 301 | } |
diff --git a/src/input_common/drivers/mouse.h b/src/input_common/drivers/mouse.h index f3b65bdd1..b872c7a0f 100644 --- a/src/input_common/drivers/mouse.h +++ b/src/input_common/drivers/mouse.h | |||
| @@ -96,6 +96,8 @@ public: | |||
| 96 | 96 | ||
| 97 | private: | 97 | private: |
| 98 | void UpdateThread(std::stop_token stop_token); | 98 | void UpdateThread(std::stop_token stop_token); |
| 99 | void UpdateStickInput(); | ||
| 100 | void UpdateMotionInput(); | ||
| 99 | void StopPanning(); | 101 | void StopPanning(); |
| 100 | 102 | ||
| 101 | Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const; | 103 | Common::Input::ButtonNames GetUIButtonName(const Common::ParamPackage& params) const; |
| @@ -103,9 +105,10 @@ private: | |||
| 103 | Common::Vec2<int> mouse_origin; | 105 | Common::Vec2<int> mouse_origin; |
| 104 | Common::Vec2<int> last_mouse_position; | 106 | Common::Vec2<int> last_mouse_position; |
| 105 | Common::Vec2<float> last_mouse_change; | 107 | Common::Vec2<float> last_mouse_change; |
| 108 | Common::Vec3<float> last_motion_change; | ||
| 106 | Common::Vec2<int> wheel_position; | 109 | Common::Vec2<int> wheel_position; |
| 107 | bool button_pressed; | 110 | bool button_pressed; |
| 108 | int mouse_panning_timout{}; | 111 | int mouse_panning_timeout{}; |
| 109 | std::jthread update_thread; | 112 | std::jthread update_thread; |
| 110 | }; | 113 | }; |
| 111 | 114 | ||
diff --git a/src/input_common/input_mapping.cpp b/src/input_common/input_mapping.cpp index 6990a86b9..2ff480ff9 100644 --- a/src/input_common/input_mapping.cpp +++ b/src/input_common/input_mapping.cpp | |||
| @@ -142,14 +142,10 @@ void MappingFactory::RegisterMotion(const MappingData& data) { | |||
| 142 | new_input.Set("port", static_cast<int>(data.pad.port)); | 142 | new_input.Set("port", static_cast<int>(data.pad.port)); |
| 143 | new_input.Set("pad", static_cast<int>(data.pad.pad)); | 143 | new_input.Set("pad", static_cast<int>(data.pad.pad)); |
| 144 | 144 | ||
| 145 | // If engine is mouse map the mouse position as 3 axis motion | 145 | // If engine is mouse map it automatically to mouse motion |
| 146 | if (data.engine == "mouse") { | 146 | if (data.engine == "mouse") { |
| 147 | new_input.Set("axis_x", 1); | 147 | new_input.Set("motion", 0); |
| 148 | new_input.Set("invert_x", "-"); | 148 | new_input.Set("pad", 1); |
| 149 | new_input.Set("axis_y", 0); | ||
| 150 | new_input.Set("axis_z", 4); | ||
| 151 | new_input.Set("range", 1.0f); | ||
| 152 | new_input.Set("deadzone", 0.0f); | ||
| 153 | input_queue.Push(new_input); | 149 | input_queue.Push(new_input); |
| 154 | return; | 150 | return; |
| 155 | } | 151 | } |
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 4742bcbe9..e904573d7 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -330,3 +330,7 @@ endif() | |||
| 330 | if (YUZU_USE_PRECOMPILED_HEADERS) | 330 | if (YUZU_USE_PRECOMPILED_HEADERS) |
| 331 | target_precompile_headers(video_core PRIVATE precompiled_headers.h) | 331 | target_precompile_headers(video_core PRIVATE precompiled_headers.h) |
| 332 | endif() | 332 | endif() |
| 333 | |||
| 334 | if (YUZU_ENABLE_LTO) | ||
| 335 | set_property(TARGET video_core PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) | ||
| 336 | endif() | ||
diff --git a/src/video_core/renderer_opengl/gl_texture_cache.cpp b/src/video_core/renderer_opengl/gl_texture_cache.cpp index eb6e43a08..b047e7b3d 100644 --- a/src/video_core/renderer_opengl/gl_texture_cache.cpp +++ b/src/video_core/renderer_opengl/gl_texture_cache.cpp | |||
| @@ -228,8 +228,9 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 228 | 228 | ||
| 229 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, | 229 | [[nodiscard]] bool CanBeAccelerated(const TextureCacheRuntime& runtime, |
| 230 | const VideoCommon::ImageInfo& info) { | 230 | const VideoCommon::ImageInfo& info) { |
| 231 | if (IsPixelFormatASTC(info.format)) { | 231 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { |
| 232 | return !runtime.HasNativeASTC() && Settings::values.accelerate_astc.GetValue(); | 232 | return Settings::values.accelerate_astc.GetValue() && |
| 233 | !Settings::values.async_astc.GetValue(); | ||
| 233 | } | 234 | } |
| 234 | // Disable other accelerated uploads for now as they don't implement swizzled uploads | 235 | // Disable other accelerated uploads for now as they don't implement swizzled uploads |
| 235 | return false; | 236 | return false; |
| @@ -258,6 +259,14 @@ void ApplySwizzle(GLuint handle, PixelFormat format, std::array<SwizzleSource, 4 | |||
| 258 | return format_info.compatibility_class == store_class; | 259 | return format_info.compatibility_class == store_class; |
| 259 | } | 260 | } |
| 260 | 261 | ||
| 262 | [[nodiscard]] bool CanBeDecodedAsync(const TextureCacheRuntime& runtime, | ||
| 263 | const VideoCommon::ImageInfo& info) { | ||
| 264 | if (IsPixelFormatASTC(info.format) && !runtime.HasNativeASTC()) { | ||
| 265 | return Settings::values.async_astc.GetValue(); | ||
| 266 | } | ||
| 267 | return false; | ||
| 268 | } | ||
| 269 | |||
| 261 | [[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset, | 270 | [[nodiscard]] CopyOrigin MakeCopyOrigin(VideoCommon::Offset3D offset, |
| 262 | VideoCommon::SubresourceLayers subresource, GLenum target) { | 271 | VideoCommon::SubresourceLayers subresource, GLenum target) { |
| 263 | switch (target) { | 272 | switch (target) { |
| @@ -721,7 +730,9 @@ std::optional<size_t> TextureCacheRuntime::StagingBuffers::FindBuffer(size_t req | |||
| 721 | Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, GPUVAddr gpu_addr_, | 730 | Image::Image(TextureCacheRuntime& runtime_, const VideoCommon::ImageInfo& info_, GPUVAddr gpu_addr_, |
| 722 | VAddr cpu_addr_) | 731 | VAddr cpu_addr_) |
| 723 | : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), runtime{&runtime_} { | 732 | : VideoCommon::ImageBase(info_, gpu_addr_, cpu_addr_), runtime{&runtime_} { |
| 724 | if (CanBeAccelerated(*runtime, info)) { | 733 | if (CanBeDecodedAsync(*runtime, info)) { |
| 734 | flags |= ImageFlagBits::AsynchronousDecode; | ||
| 735 | } else if (CanBeAccelerated(*runtime, info)) { | ||
| 725 | flags |= ImageFlagBits::AcceleratedUpload; | 736 | flags |= ImageFlagBits::AcceleratedUpload; |
| 726 | } | 737 | } |
| 727 | if (IsConverted(runtime->device, info.format, info.type)) { | 738 | if (IsConverted(runtime->device, info.format, info.type)) { |
diff --git a/src/video_core/renderer_vulkan/vk_texture_cache.cpp b/src/video_core/renderer_vulkan/vk_texture_cache.cpp index 9b85dfb5e..80adb70eb 100644 --- a/src/video_core/renderer_vulkan/vk_texture_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_texture_cache.cpp | |||
| @@ -1256,11 +1256,12 @@ Image::Image(TextureCacheRuntime& runtime_, const ImageInfo& info_, GPUVAddr gpu | |||
| 1256 | commit(runtime_.memory_allocator.Commit(original_image, MemoryUsage::DeviceLocal)), | 1256 | commit(runtime_.memory_allocator.Commit(original_image, MemoryUsage::DeviceLocal)), |
| 1257 | aspect_mask(ImageAspectMask(info.format)) { | 1257 | aspect_mask(ImageAspectMask(info.format)) { |
| 1258 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { | 1258 | if (IsPixelFormatASTC(info.format) && !runtime->device.IsOptimalAstcSupported()) { |
| 1259 | if (Settings::values.accelerate_astc.GetValue()) { | 1259 | if (Settings::values.async_astc.GetValue()) { |
| 1260 | flags |= VideoCommon::ImageFlagBits::AsynchronousDecode; | ||
| 1261 | } else if (Settings::values.accelerate_astc.GetValue()) { | ||
| 1260 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; | 1262 | flags |= VideoCommon::ImageFlagBits::AcceleratedUpload; |
| 1261 | } else { | ||
| 1262 | flags |= VideoCommon::ImageFlagBits::Converted; | ||
| 1263 | } | 1263 | } |
| 1264 | flags |= VideoCommon::ImageFlagBits::Converted; | ||
| 1264 | flags |= VideoCommon::ImageFlagBits::CostlyLoad; | 1265 | flags |= VideoCommon::ImageFlagBits::CostlyLoad; |
| 1265 | } | 1266 | } |
| 1266 | if (runtime->device.HasDebuggingToolAttached()) { | 1267 | if (runtime->device.HasDebuggingToolAttached()) { |
diff --git a/src/video_core/texture_cache/image_base.h b/src/video_core/texture_cache/image_base.h index 620565684..e8fa592d2 100644 --- a/src/video_core/texture_cache/image_base.h +++ b/src/video_core/texture_cache/image_base.h | |||
| @@ -38,6 +38,9 @@ enum class ImageFlagBits : u32 { | |||
| 38 | Rescaled = 1 << 13, | 38 | Rescaled = 1 << 13, |
| 39 | CheckingRescalable = 1 << 14, | 39 | CheckingRescalable = 1 << 14, |
| 40 | IsRescalable = 1 << 15, | 40 | IsRescalable = 1 << 15, |
| 41 | |||
| 42 | AsynchronousDecode = 1 << 16, | ||
| 43 | IsDecoding = 1 << 17, ///< Is currently being decoded asynchornously. | ||
| 41 | }; | 44 | }; |
| 42 | DECLARE_ENUM_FLAG_OPERATORS(ImageFlagBits) | 45 | DECLARE_ENUM_FLAG_OPERATORS(ImageFlagBits) |
| 43 | 46 | ||
diff --git a/src/video_core/texture_cache/texture_cache.h b/src/video_core/texture_cache/texture_cache.h index 3e2cbb0b0..9dd152fbe 100644 --- a/src/video_core/texture_cache/texture_cache.h +++ b/src/video_core/texture_cache/texture_cache.h | |||
| @@ -85,6 +85,11 @@ void TextureCache<P>::RunGarbageCollector() { | |||
| 85 | } | 85 | } |
| 86 | --num_iterations; | 86 | --num_iterations; |
| 87 | auto& image = slot_images[image_id]; | 87 | auto& image = slot_images[image_id]; |
| 88 | if (True(image.flags & ImageFlagBits::IsDecoding)) { | ||
| 89 | // This image is still being decoded, deleting it will invalidate the slot | ||
| 90 | // used by the async decoder thread. | ||
| 91 | return false; | ||
| 92 | } | ||
| 88 | const bool must_download = | 93 | const bool must_download = |
| 89 | image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); | 94 | image.IsSafeDownload() && False(image.flags & ImageFlagBits::BadOverlap); |
| 90 | if (!high_priority_mode && | 95 | if (!high_priority_mode && |
| @@ -133,6 +138,8 @@ void TextureCache<P>::TickFrame() { | |||
| 133 | sentenced_images.Tick(); | 138 | sentenced_images.Tick(); |
| 134 | sentenced_framebuffers.Tick(); | 139 | sentenced_framebuffers.Tick(); |
| 135 | sentenced_image_view.Tick(); | 140 | sentenced_image_view.Tick(); |
| 141 | TickAsyncDecode(); | ||
| 142 | |||
| 136 | runtime.TickFrame(); | 143 | runtime.TickFrame(); |
| 137 | critical_gc = 0; | 144 | critical_gc = 0; |
| 138 | ++frame_tick; | 145 | ++frame_tick; |
| @@ -777,6 +784,10 @@ void TextureCache<P>::RefreshContents(Image& image, ImageId image_id) { | |||
| 777 | LOG_WARNING(HW_GPU, "MSAA image uploads are not implemented"); | 784 | LOG_WARNING(HW_GPU, "MSAA image uploads are not implemented"); |
| 778 | return; | 785 | return; |
| 779 | } | 786 | } |
| 787 | if (True(image.flags & ImageFlagBits::AsynchronousDecode)) { | ||
| 788 | QueueAsyncDecode(image, image_id); | ||
| 789 | return; | ||
| 790 | } | ||
| 780 | auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); | 791 | auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); |
| 781 | UploadImageContents(image, staging); | 792 | UploadImageContents(image, staging); |
| 782 | runtime.InsertUploadMemoryBarrier(); | 793 | runtime.InsertUploadMemoryBarrier(); |
| @@ -990,6 +1001,65 @@ u64 TextureCache<P>::GetScaledImageSizeBytes(const ImageBase& image) { | |||
| 990 | } | 1001 | } |
| 991 | 1002 | ||
| 992 | template <class P> | 1003 | template <class P> |
| 1004 | void TextureCache<P>::QueueAsyncDecode(Image& image, ImageId image_id) { | ||
| 1005 | UNIMPLEMENTED_IF(False(image.flags & ImageFlagBits::Converted)); | ||
| 1006 | LOG_INFO(HW_GPU, "Queuing async texture decode"); | ||
| 1007 | |||
| 1008 | image.flags |= ImageFlagBits::IsDecoding; | ||
| 1009 | auto decode = std::make_unique<AsyncDecodeContext>(); | ||
| 1010 | auto* decode_ptr = decode.get(); | ||
| 1011 | decode->image_id = image_id; | ||
| 1012 | async_decodes.push_back(std::move(decode)); | ||
| 1013 | |||
| 1014 | Common::ScratchBuffer<u8> local_unswizzle_data_buffer(image.unswizzled_size_bytes); | ||
| 1015 | const size_t guest_size_bytes = image.guest_size_bytes; | ||
| 1016 | swizzle_data_buffer.resize_destructive(guest_size_bytes); | ||
| 1017 | gpu_memory->ReadBlockUnsafe(image.gpu_addr, swizzle_data_buffer.data(), guest_size_bytes); | ||
| 1018 | auto copies = UnswizzleImage(*gpu_memory, image.gpu_addr, image.info, swizzle_data_buffer, | ||
| 1019 | local_unswizzle_data_buffer); | ||
| 1020 | const size_t out_size = MapSizeBytes(image); | ||
| 1021 | |||
| 1022 | auto func = [out_size, copies, info = image.info, | ||
| 1023 | input = std::move(local_unswizzle_data_buffer), | ||
| 1024 | async_decode = decode_ptr]() mutable { | ||
| 1025 | async_decode->decoded_data.resize_destructive(out_size); | ||
| 1026 | std::span copies_span{copies.data(), copies.size()}; | ||
| 1027 | ConvertImage(input, info, async_decode->decoded_data, copies_span); | ||
| 1028 | |||
| 1029 | // TODO: Do we need this lock? | ||
| 1030 | std::unique_lock lock{async_decode->mutex}; | ||
| 1031 | async_decode->copies = std::move(copies); | ||
| 1032 | async_decode->complete = true; | ||
| 1033 | }; | ||
| 1034 | texture_decode_worker.QueueWork(std::move(func)); | ||
| 1035 | } | ||
| 1036 | |||
| 1037 | template <class P> | ||
| 1038 | void TextureCache<P>::TickAsyncDecode() { | ||
| 1039 | bool has_uploads{}; | ||
| 1040 | auto i = async_decodes.begin(); | ||
| 1041 | while (i != async_decodes.end()) { | ||
| 1042 | auto* async_decode = i->get(); | ||
| 1043 | std::unique_lock lock{async_decode->mutex}; | ||
| 1044 | if (!async_decode->complete) { | ||
| 1045 | ++i; | ||
| 1046 | continue; | ||
| 1047 | } | ||
| 1048 | Image& image = slot_images[async_decode->image_id]; | ||
| 1049 | auto staging = runtime.UploadStagingBuffer(MapSizeBytes(image)); | ||
| 1050 | std::memcpy(staging.mapped_span.data(), async_decode->decoded_data.data(), | ||
| 1051 | async_decode->decoded_data.size()); | ||
| 1052 | image.UploadMemory(staging, async_decode->copies); | ||
| 1053 | image.flags &= ~ImageFlagBits::IsDecoding; | ||
| 1054 | has_uploads = true; | ||
| 1055 | i = async_decodes.erase(i); | ||
| 1056 | } | ||
| 1057 | if (has_uploads) { | ||
| 1058 | runtime.InsertUploadMemoryBarrier(); | ||
| 1059 | } | ||
| 1060 | } | ||
| 1061 | |||
| 1062 | template <class P> | ||
| 993 | bool TextureCache<P>::ScaleUp(Image& image) { | 1063 | bool TextureCache<P>::ScaleUp(Image& image) { |
| 994 | const bool has_copy = image.HasScaled(); | 1064 | const bool has_copy = image.HasScaled(); |
| 995 | const bool rescaled = image.ScaleUp(); | 1065 | const bool rescaled = image.ScaleUp(); |
diff --git a/src/video_core/texture_cache/texture_cache_base.h b/src/video_core/texture_cache/texture_cache_base.h index 485eaabaa..013836933 100644 --- a/src/video_core/texture_cache/texture_cache_base.h +++ b/src/video_core/texture_cache/texture_cache_base.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #pragma once | 4 | #pragma once |
| 5 | 5 | ||
| 6 | #include <atomic> | ||
| 6 | #include <deque> | 7 | #include <deque> |
| 7 | #include <limits> | 8 | #include <limits> |
| 8 | #include <mutex> | 9 | #include <mutex> |
| @@ -18,6 +19,7 @@ | |||
| 18 | #include "common/lru_cache.h" | 19 | #include "common/lru_cache.h" |
| 19 | #include "common/polyfill_ranges.h" | 20 | #include "common/polyfill_ranges.h" |
| 20 | #include "common/scratch_buffer.h" | 21 | #include "common/scratch_buffer.h" |
| 22 | #include "common/thread_worker.h" | ||
| 21 | #include "video_core/compatible_formats.h" | 23 | #include "video_core/compatible_formats.h" |
| 22 | #include "video_core/control/channel_state_cache.h" | 24 | #include "video_core/control/channel_state_cache.h" |
| 23 | #include "video_core/delayed_destruction_ring.h" | 25 | #include "video_core/delayed_destruction_ring.h" |
| @@ -54,6 +56,14 @@ struct ImageViewInOut { | |||
| 54 | ImageViewId id{}; | 56 | ImageViewId id{}; |
| 55 | }; | 57 | }; |
| 56 | 58 | ||
| 59 | struct AsyncDecodeContext { | ||
| 60 | ImageId image_id; | ||
| 61 | Common::ScratchBuffer<u8> decoded_data; | ||
| 62 | std::vector<BufferImageCopy> copies; | ||
| 63 | std::mutex mutex; | ||
| 64 | std::atomic_bool complete; | ||
| 65 | }; | ||
| 66 | |||
| 57 | using TextureCacheGPUMap = std::unordered_map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>; | 67 | using TextureCacheGPUMap = std::unordered_map<u64, std::vector<ImageId>, Common::IdentityHash<u64>>; |
| 58 | 68 | ||
| 59 | class TextureCacheChannelInfo : public ChannelInfo { | 69 | class TextureCacheChannelInfo : public ChannelInfo { |
| @@ -377,6 +387,9 @@ private: | |||
| 377 | bool ScaleDown(Image& image); | 387 | bool ScaleDown(Image& image); |
| 378 | u64 GetScaledImageSizeBytes(const ImageBase& image); | 388 | u64 GetScaledImageSizeBytes(const ImageBase& image); |
| 379 | 389 | ||
| 390 | void QueueAsyncDecode(Image& image, ImageId image_id); | ||
| 391 | void TickAsyncDecode(); | ||
| 392 | |||
| 380 | Runtime& runtime; | 393 | Runtime& runtime; |
| 381 | 394 | ||
| 382 | VideoCore::RasterizerInterface& rasterizer; | 395 | VideoCore::RasterizerInterface& rasterizer; |
| @@ -430,6 +443,9 @@ private: | |||
| 430 | 443 | ||
| 431 | u64 modification_tick = 0; | 444 | u64 modification_tick = 0; |
| 432 | u64 frame_tick = 0; | 445 | u64 frame_tick = 0; |
| 446 | |||
| 447 | Common::ThreadWorker texture_decode_worker{1, "TextureDecoder"}; | ||
| 448 | std::vector<std::unique_ptr<AsyncDecodeContext>> async_decodes; | ||
| 433 | }; | 449 | }; |
| 434 | 450 | ||
| 435 | } // namespace VideoCommon | 451 | } // namespace VideoCommon |
diff --git a/src/video_core/textures/astc.cpp b/src/video_core/textures/astc.cpp index e8d7c7863..4381eed1d 100644 --- a/src/video_core/textures/astc.cpp +++ b/src/video_core/textures/astc.cpp | |||
| @@ -1656,8 +1656,8 @@ void Decompress(std::span<const uint8_t> data, uint32_t width, uint32_t height, | |||
| 1656 | const u32 rows = Common::DivideUp(height, block_height); | 1656 | const u32 rows = Common::DivideUp(height, block_height); |
| 1657 | const u32 cols = Common::DivideUp(width, block_width); | 1657 | const u32 cols = Common::DivideUp(width, block_width); |
| 1658 | 1658 | ||
| 1659 | Common::ThreadWorker workers{std::max(std::thread::hardware_concurrency(), 2U) / 2, | 1659 | static Common::ThreadWorker workers{std::max(std::thread::hardware_concurrency(), 2U) / 2, |
| 1660 | "ASTCDecompress"}; | 1660 | "ASTCDecompress"}; |
| 1661 | 1661 | ||
| 1662 | for (u32 z = 0; z < depth; ++z) { | 1662 | for (u32 z = 0; z < depth; ++z) { |
| 1663 | const u32 depth_offset = z * height * width * 4; | 1663 | const u32 depth_offset = z * height * width * 4; |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index db68ed259..bb731276e 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -707,6 +707,7 @@ void Config::ReadRendererValues() { | |||
| 707 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); | 707 | ReadGlobalSetting(Settings::values.use_asynchronous_gpu_emulation); |
| 708 | ReadGlobalSetting(Settings::values.nvdec_emulation); | 708 | ReadGlobalSetting(Settings::values.nvdec_emulation); |
| 709 | ReadGlobalSetting(Settings::values.accelerate_astc); | 709 | ReadGlobalSetting(Settings::values.accelerate_astc); |
| 710 | ReadGlobalSetting(Settings::values.async_astc); | ||
| 710 | ReadGlobalSetting(Settings::values.use_vsync); | 711 | ReadGlobalSetting(Settings::values.use_vsync); |
| 711 | ReadGlobalSetting(Settings::values.shader_backend); | 712 | ReadGlobalSetting(Settings::values.shader_backend); |
| 712 | ReadGlobalSetting(Settings::values.use_asynchronous_shaders); | 713 | ReadGlobalSetting(Settings::values.use_asynchronous_shaders); |
| @@ -1312,9 +1313,7 @@ void Config::SaveRendererValues() { | |||
| 1312 | static_cast<u32>(Settings::values.renderer_backend.GetValue(global)), | 1313 | static_cast<u32>(Settings::values.renderer_backend.GetValue(global)), |
| 1313 | static_cast<u32>(Settings::values.renderer_backend.GetDefault()), | 1314 | static_cast<u32>(Settings::values.renderer_backend.GetDefault()), |
| 1314 | Settings::values.renderer_backend.UsingGlobal()); | 1315 | Settings::values.renderer_backend.UsingGlobal()); |
| 1315 | WriteSetting(QString::fromStdString(Settings::values.renderer_force_max_clock.GetLabel()), | 1316 | WriteGlobalSetting(Settings::values.renderer_force_max_clock); |
| 1316 | static_cast<u32>(Settings::values.renderer_force_max_clock.GetValue(global)), | ||
| 1317 | static_cast<u32>(Settings::values.renderer_force_max_clock.GetDefault())); | ||
| 1318 | WriteGlobalSetting(Settings::values.vulkan_device); | 1317 | WriteGlobalSetting(Settings::values.vulkan_device); |
| 1319 | WriteSetting(QString::fromStdString(Settings::values.fullscreen_mode.GetLabel()), | 1318 | WriteSetting(QString::fromStdString(Settings::values.fullscreen_mode.GetLabel()), |
| 1320 | static_cast<u32>(Settings::values.fullscreen_mode.GetValue(global)), | 1319 | static_cast<u32>(Settings::values.fullscreen_mode.GetValue(global)), |
| @@ -1350,6 +1349,7 @@ void Config::SaveRendererValues() { | |||
| 1350 | static_cast<u32>(Settings::values.nvdec_emulation.GetDefault()), | 1349 | static_cast<u32>(Settings::values.nvdec_emulation.GetDefault()), |
| 1351 | Settings::values.nvdec_emulation.UsingGlobal()); | 1350 | Settings::values.nvdec_emulation.UsingGlobal()); |
| 1352 | WriteGlobalSetting(Settings::values.accelerate_astc); | 1351 | WriteGlobalSetting(Settings::values.accelerate_astc); |
| 1352 | WriteGlobalSetting(Settings::values.async_astc); | ||
| 1353 | WriteGlobalSetting(Settings::values.use_vsync); | 1353 | WriteGlobalSetting(Settings::values.use_vsync); |
| 1354 | WriteSetting(QString::fromStdString(Settings::values.shader_backend.GetLabel()), | 1354 | WriteSetting(QString::fromStdString(Settings::values.shader_backend.GetLabel()), |
| 1355 | static_cast<u32>(Settings::values.shader_backend.GetValue(global)), | 1355 | static_cast<u32>(Settings::values.shader_backend.GetValue(global)), |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index cc0155a2c..59fb1b334 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -23,11 +23,13 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 23 | const bool runtime_lock = !system.IsPoweredOn(); | 23 | const bool runtime_lock = !system.IsPoweredOn(); |
| 24 | ui->use_vsync->setEnabled(runtime_lock); | 24 | ui->use_vsync->setEnabled(runtime_lock); |
| 25 | ui->renderer_force_max_clock->setEnabled(runtime_lock); | 25 | ui->renderer_force_max_clock->setEnabled(runtime_lock); |
| 26 | ui->async_astc->setEnabled(runtime_lock); | ||
| 26 | ui->use_asynchronous_shaders->setEnabled(runtime_lock); | 27 | ui->use_asynchronous_shaders->setEnabled(runtime_lock); |
| 27 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); | 28 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); |
| 28 | 29 | ||
| 29 | ui->renderer_force_max_clock->setChecked(Settings::values.renderer_force_max_clock.GetValue()); | 30 | ui->renderer_force_max_clock->setChecked(Settings::values.renderer_force_max_clock.GetValue()); |
| 30 | ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue()); | 31 | ui->use_vsync->setChecked(Settings::values.use_vsync.GetValue()); |
| 32 | ui->async_astc->setChecked(Settings::values.async_astc.GetValue()); | ||
| 31 | ui->use_asynchronous_shaders->setChecked(Settings::values.use_asynchronous_shaders.GetValue()); | 33 | ui->use_asynchronous_shaders->setChecked(Settings::values.use_asynchronous_shaders.GetValue()); |
| 32 | ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue()); | 34 | ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time.GetValue()); |
| 33 | ui->use_pessimistic_flushes->setChecked(Settings::values.use_pessimistic_flushes.GetValue()); | 35 | ui->use_pessimistic_flushes->setChecked(Settings::values.use_pessimistic_flushes.GetValue()); |
| @@ -45,8 +47,6 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 45 | &Settings::values.max_anisotropy); | 47 | &Settings::values.max_anisotropy); |
| 46 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, | 48 | ConfigurationShared::SetHighlight(ui->label_gpu_accuracy, |
| 47 | !Settings::values.gpu_accuracy.UsingGlobal()); | 49 | !Settings::values.gpu_accuracy.UsingGlobal()); |
| 48 | ConfigurationShared::SetHighlight(ui->renderer_force_max_clock, | ||
| 49 | !Settings::values.renderer_force_max_clock.UsingGlobal()); | ||
| 50 | ConfigurationShared::SetHighlight(ui->af_label, | 50 | ConfigurationShared::SetHighlight(ui->af_label, |
| 51 | !Settings::values.max_anisotropy.UsingGlobal()); | 51 | !Settings::values.max_anisotropy.UsingGlobal()); |
| 52 | } | 52 | } |
| @@ -60,6 +60,8 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() { | |||
| 60 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, | 60 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.max_anisotropy, |
| 61 | ui->anisotropic_filtering_combobox); | 61 | ui->anisotropic_filtering_combobox); |
| 62 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, use_vsync); | 62 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_vsync, ui->use_vsync, use_vsync); |
| 63 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.async_astc, ui->async_astc, | ||
| 64 | async_astc); | ||
| 63 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, | 65 | ConfigurationShared::ApplyPerGameSetting(&Settings::values.use_asynchronous_shaders, |
| 64 | ui->use_asynchronous_shaders, | 66 | ui->use_asynchronous_shaders, |
| 65 | use_asynchronous_shaders); | 67 | use_asynchronous_shaders); |
| @@ -91,6 +93,7 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { | |||
| 91 | ui->renderer_force_max_clock->setEnabled( | 93 | ui->renderer_force_max_clock->setEnabled( |
| 92 | Settings::values.renderer_force_max_clock.UsingGlobal()); | 94 | Settings::values.renderer_force_max_clock.UsingGlobal()); |
| 93 | ui->use_vsync->setEnabled(Settings::values.use_vsync.UsingGlobal()); | 95 | ui->use_vsync->setEnabled(Settings::values.use_vsync.UsingGlobal()); |
| 96 | ui->async_astc->setEnabled(Settings::values.async_astc.UsingGlobal()); | ||
| 94 | ui->use_asynchronous_shaders->setEnabled( | 97 | ui->use_asynchronous_shaders->setEnabled( |
| 95 | Settings::values.use_asynchronous_shaders.UsingGlobal()); | 98 | Settings::values.use_asynchronous_shaders.UsingGlobal()); |
| 96 | ui->use_fast_gpu_time->setEnabled(Settings::values.use_fast_gpu_time.UsingGlobal()); | 99 | ui->use_fast_gpu_time->setEnabled(Settings::values.use_fast_gpu_time.UsingGlobal()); |
| @@ -108,6 +111,8 @@ void ConfigureGraphicsAdvanced::SetupPerGameUI() { | |||
| 108 | Settings::values.renderer_force_max_clock, | 111 | Settings::values.renderer_force_max_clock, |
| 109 | renderer_force_max_clock); | 112 | renderer_force_max_clock); |
| 110 | ConfigurationShared::SetColoredTristate(ui->use_vsync, Settings::values.use_vsync, use_vsync); | 113 | ConfigurationShared::SetColoredTristate(ui->use_vsync, Settings::values.use_vsync, use_vsync); |
| 114 | ConfigurationShared::SetColoredTristate(ui->async_astc, Settings::values.async_astc, | ||
| 115 | async_astc); | ||
| 111 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_shaders, | 116 | ConfigurationShared::SetColoredTristate(ui->use_asynchronous_shaders, |
| 112 | Settings::values.use_asynchronous_shaders, | 117 | Settings::values.use_asynchronous_shaders, |
| 113 | use_asynchronous_shaders); | 118 | use_asynchronous_shaders); |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.h b/src/yuzu/configuration/configure_graphics_advanced.h index df557d585..bf1b04749 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.h +++ b/src/yuzu/configuration/configure_graphics_advanced.h | |||
| @@ -38,6 +38,7 @@ private: | |||
| 38 | 38 | ||
| 39 | ConfigurationShared::CheckState renderer_force_max_clock; | 39 | ConfigurationShared::CheckState renderer_force_max_clock; |
| 40 | ConfigurationShared::CheckState use_vsync; | 40 | ConfigurationShared::CheckState use_vsync; |
| 41 | ConfigurationShared::CheckState async_astc; | ||
| 41 | ConfigurationShared::CheckState use_asynchronous_shaders; | 42 | ConfigurationShared::CheckState use_asynchronous_shaders; |
| 42 | ConfigurationShared::CheckState use_fast_gpu_time; | 43 | ConfigurationShared::CheckState use_fast_gpu_time; |
| 43 | ConfigurationShared::CheckState use_pessimistic_flushes; | 44 | ConfigurationShared::CheckState use_pessimistic_flushes; |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui index 061885e30..a7dbdc18c 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.ui +++ b/src/yuzu/configuration/configure_graphics_advanced.ui | |||
| @@ -90,6 +90,16 @@ | |||
| 90 | </widget> | 90 | </widget> |
| 91 | </item> | 91 | </item> |
| 92 | <item> | 92 | <item> |
| 93 | <widget class="QCheckBox" name="async_astc"> | ||
| 94 | <property name="toolTip"> | ||
| 95 | <string>Enables asynchronous ASTC texture decoding, which may reduce load time stutter. This feature is experimental.</string> | ||
| 96 | </property> | ||
| 97 | <property name="text"> | ||
| 98 | <string>Decode ASTC textures asynchronously (Hack)</string> | ||
| 99 | </property> | ||
| 100 | </widget> | ||
| 101 | </item> | ||
| 102 | <item> | ||
| 93 | <widget class="QCheckBox" name="use_asynchronous_shaders"> | 103 | <widget class="QCheckBox" name="use_asynchronous_shaders"> |
| 94 | <property name="toolTip"> | 104 | <property name="toolTip"> |
| 95 | <string>Enables asynchronous shader compilation, which may reduce shader stutter. This feature is experimental.</string> | 105 | <string>Enables asynchronous shader compilation, which may reduce shader stutter. This feature is experimental.</string> |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 3b6dce296..464da3231 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -324,6 +324,7 @@ void Config::ReadValues() { | |||
| 324 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); | 324 | ReadSetting("Renderer", Settings::values.use_asynchronous_shaders); |
| 325 | ReadSetting("Renderer", Settings::values.nvdec_emulation); | 325 | ReadSetting("Renderer", Settings::values.nvdec_emulation); |
| 326 | ReadSetting("Renderer", Settings::values.accelerate_astc); | 326 | ReadSetting("Renderer", Settings::values.accelerate_astc); |
| 327 | ReadSetting("Renderer", Settings::values.async_astc); | ||
| 327 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); | 328 | ReadSetting("Renderer", Settings::values.use_fast_gpu_time); |
| 328 | ReadSetting("Renderer", Settings::values.use_pessimistic_flushes); | 329 | ReadSetting("Renderer", Settings::values.use_pessimistic_flushes); |
| 329 | ReadSetting("Renderer", Settings::values.use_vulkan_driver_pipeline_cache); | 330 | ReadSetting("Renderer", Settings::values.use_vulkan_driver_pipeline_cache); |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index cf3cc4c4e..20e403400 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -342,6 +342,10 @@ nvdec_emulation = | |||
| 342 | # 0: Off, 1 (default): On | 342 | # 0: Off, 1 (default): On |
| 343 | accelerate_astc = | 343 | accelerate_astc = |
| 344 | 344 | ||
| 345 | # Decode ASTC textures asynchronously. | ||
| 346 | # 0 (default): Off, 1: On | ||
| 347 | async_astc = | ||
| 348 | |||
| 345 | # Turns on the speed limiter, which will limit the emulation speed to the desired speed limit value | 349 | # Turns on the speed limiter, which will limit the emulation speed to the desired speed limit value |
| 346 | # 0: Off, 1: On (default) | 350 | # 0: Off, 1: On (default) |
| 347 | use_speed_limit = | 351 | use_speed_limit = |