diff options
Diffstat (limited to 'src')
22 files changed, 152 insertions, 30 deletions
diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 84d291787..69f0bd8c0 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp | |||
| @@ -71,6 +71,9 @@ void LogSettings() { | |||
| 71 | log_setting("Debugging_ProgramArgs", values.program_args.GetValue()); | 71 | log_setting("Debugging_ProgramArgs", values.program_args.GetValue()); |
| 72 | log_setting("Services_BCATBackend", values.bcat_backend.GetValue()); | 72 | log_setting("Services_BCATBackend", values.bcat_backend.GetValue()); |
| 73 | log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local.GetValue()); | 73 | log_setting("Services_BCATBoxcatLocal", values.bcat_boxcat_local.GetValue()); |
| 74 | log_setting("Input_EnableMotion", values.motion_enabled.GetValue()); | ||
| 75 | log_setting("Input_EnableVibration", values.vibration_enabled.GetValue()); | ||
| 76 | log_setting("Input_EnableRawInput", values.enable_raw_input.GetValue()); | ||
| 74 | } | 77 | } |
| 75 | 78 | ||
| 76 | bool IsConfiguringGlobal() { | 79 | bool IsConfiguringGlobal() { |
diff --git a/src/common/settings.h b/src/common/settings.h index e73c045cc..b1bddb895 100644 --- a/src/common/settings.h +++ b/src/common/settings.h | |||
| @@ -16,7 +16,6 @@ | |||
| 16 | 16 | ||
| 17 | #include "common/common_types.h" | 17 | #include "common/common_types.h" |
| 18 | #include "common/settings_input.h" | 18 | #include "common/settings_input.h" |
| 19 | #include "input_common/udp/client.h" | ||
| 20 | 19 | ||
| 21 | namespace Settings { | 20 | namespace Settings { |
| 22 | 21 | ||
| @@ -503,14 +502,15 @@ struct Values { | |||
| 503 | 502 | ||
| 504 | Setting<bool> use_docked_mode{true, "use_docked_mode"}; | 503 | Setting<bool> use_docked_mode{true, "use_docked_mode"}; |
| 505 | 504 | ||
| 505 | BasicSetting<bool> enable_raw_input{false, "enable_raw_input"}; | ||
| 506 | |||
| 506 | Setting<bool> vibration_enabled{true, "vibration_enabled"}; | 507 | Setting<bool> vibration_enabled{true, "vibration_enabled"}; |
| 507 | Setting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; | 508 | Setting<bool> enable_accurate_vibrations{false, "enable_accurate_vibrations"}; |
| 508 | 509 | ||
| 509 | Setting<bool> motion_enabled{true, "motion_enabled"}; | 510 | Setting<bool> motion_enabled{true, "motion_enabled"}; |
| 510 | BasicSetting<std::string> motion_device{"engine:motion_emu,update_period:100,sensitivity:0.01", | 511 | BasicSetting<std::string> motion_device{"engine:motion_emu,update_period:100,sensitivity:0.01", |
| 511 | "motion_device"}; | 512 | "motion_device"}; |
| 512 | BasicSetting<std::string> udp_input_servers{InputCommon::CemuhookUDP::DEFAULT_SRV, | 513 | BasicSetting<std::string> udp_input_servers{"127.0.0.1:26760", "udp_input_servers"}; |
| 513 | "udp_input_servers"}; | ||
| 514 | 514 | ||
| 515 | BasicSetting<bool> mouse_panning{false, "mouse_panning"}; | 515 | BasicSetting<bool> mouse_panning{false, "mouse_panning"}; |
| 516 | BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"}; | 516 | BasicRangedSetting<u8> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"}; |
diff --git a/src/core/core.cpp b/src/core/core.cpp index ba4629993..b13350f6e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -83,6 +83,12 @@ FileSys::StorageId GetStorageIdForFrontendSlot( | |||
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | void KProcessDeleter(Kernel::KProcess* process) { | ||
| 87 | process->Destroy(); | ||
| 88 | } | ||
| 89 | |||
| 90 | using KProcessPtr = std::unique_ptr<Kernel::KProcess, decltype(&KProcessDeleter)>; | ||
| 91 | |||
| 86 | } // Anonymous namespace | 92 | } // Anonymous namespace |
| 87 | 93 | ||
| 88 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, | 94 | FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs, |
| @@ -233,8 +239,8 @@ struct System::Impl { | |||
| 233 | } | 239 | } |
| 234 | 240 | ||
| 235 | telemetry_session->AddInitialInfo(*app_loader, fs_controller, *content_provider); | 241 | telemetry_session->AddInitialInfo(*app_loader, fs_controller, *content_provider); |
| 236 | auto main_process = Kernel::KProcess::Create(system.Kernel()); | 242 | main_process = KProcessPtr{Kernel::KProcess::Create(system.Kernel()), KProcessDeleter}; |
| 237 | ASSERT(Kernel::KProcess::Initialize(main_process, system, "main", | 243 | ASSERT(Kernel::KProcess::Initialize(main_process.get(), system, "main", |
| 238 | Kernel::KProcess::ProcessType::Userland) | 244 | Kernel::KProcess::ProcessType::Userland) |
| 239 | .IsSuccess()); | 245 | .IsSuccess()); |
| 240 | main_process->Open(); | 246 | main_process->Open(); |
| @@ -247,7 +253,7 @@ struct System::Impl { | |||
| 247 | static_cast<u32>(load_result)); | 253 | static_cast<u32>(load_result)); |
| 248 | } | 254 | } |
| 249 | AddGlueRegistrationForProcess(*app_loader, *main_process); | 255 | AddGlueRegistrationForProcess(*app_loader, *main_process); |
| 250 | kernel.MakeCurrentProcess(main_process); | 256 | kernel.MakeCurrentProcess(main_process.get()); |
| 251 | kernel.InitializeCores(); | 257 | kernel.InitializeCores(); |
| 252 | 258 | ||
| 253 | // Initialize cheat engine | 259 | // Initialize cheat engine |
| @@ -316,6 +322,8 @@ struct System::Impl { | |||
| 316 | kernel.Shutdown(); | 322 | kernel.Shutdown(); |
| 317 | memory.Reset(); | 323 | memory.Reset(); |
| 318 | applet_manager.ClearAll(); | 324 | applet_manager.ClearAll(); |
| 325 | // TODO: The main process should be freed based on KAutoObject ref counting. | ||
| 326 | main_process.reset(); | ||
| 319 | 327 | ||
| 320 | LOG_DEBUG(Core, "Shutdown OK"); | 328 | LOG_DEBUG(Core, "Shutdown OK"); |
| 321 | } | 329 | } |
| @@ -374,6 +382,7 @@ struct System::Impl { | |||
| 374 | std::unique_ptr<Tegra::GPU> gpu_core; | 382 | std::unique_ptr<Tegra::GPU> gpu_core; |
| 375 | std::unique_ptr<Hardware::InterruptManager> interrupt_manager; | 383 | std::unique_ptr<Hardware::InterruptManager> interrupt_manager; |
| 376 | std::unique_ptr<Core::DeviceMemory> device_memory; | 384 | std::unique_ptr<Core::DeviceMemory> device_memory; |
| 385 | KProcessPtr main_process{nullptr, KProcessDeleter}; | ||
| 377 | Core::Memory::Memory memory; | 386 | Core::Memory::Memory memory; |
| 378 | CpuManager cpu_manager; | 387 | CpuManager cpu_manager; |
| 379 | std::atomic_bool is_powered_on{}; | 388 | std::atomic_bool is_powered_on{}; |
diff --git a/src/core/file_sys/vfs.cpp b/src/core/file_sys/vfs.cpp index 368419eca..f5ad10b15 100644 --- a/src/core/file_sys/vfs.cpp +++ b/src/core/file_sys/vfs.cpp | |||
| @@ -273,6 +273,10 @@ VirtualFile VfsDirectory::GetFile(std::string_view name) const { | |||
| 273 | return iter == files.end() ? nullptr : *iter; | 273 | return iter == files.end() ? nullptr : *iter; |
| 274 | } | 274 | } |
| 275 | 275 | ||
| 276 | FileTimeStampRaw VfsDirectory::GetFileTimeStamp([[maybe_unused]] std::string_view path) const { | ||
| 277 | return {}; | ||
| 278 | } | ||
| 279 | |||
| 276 | VirtualDir VfsDirectory::GetSubdirectory(std::string_view name) const { | 280 | VirtualDir VfsDirectory::GetSubdirectory(std::string_view name) const { |
| 277 | const auto& subs = GetSubdirectories(); | 281 | const auto& subs = GetSubdirectories(); |
| 278 | const auto iter = std::find_if(subs.begin(), subs.end(), | 282 | const auto iter = std::find_if(subs.begin(), subs.end(), |
diff --git a/src/core/file_sys/vfs.h b/src/core/file_sys/vfs.h index afd64e95c..ff6935da6 100644 --- a/src/core/file_sys/vfs.h +++ b/src/core/file_sys/vfs.h | |||
| @@ -199,6 +199,9 @@ public: | |||
| 199 | // file with name. | 199 | // file with name. |
| 200 | virtual VirtualFile GetFile(std::string_view name) const; | 200 | virtual VirtualFile GetFile(std::string_view name) const; |
| 201 | 201 | ||
| 202 | // Returns a struct containing the file's timestamp. | ||
| 203 | virtual FileTimeStampRaw GetFileTimeStamp(std::string_view path) const; | ||
| 204 | |||
| 202 | // Returns a vector containing all of the subdirectories in this directory. | 205 | // Returns a vector containing all of the subdirectories in this directory. |
| 203 | virtual std::vector<VirtualDir> GetSubdirectories() const = 0; | 206 | virtual std::vector<VirtualDir> GetSubdirectories() const = 0; |
| 204 | // Returns the directory with name matching name. Returns nullptr if directory dosen't have a | 207 | // Returns the directory with name matching name. Returns nullptr if directory dosen't have a |
diff --git a/src/core/file_sys/vfs_real.cpp b/src/core/file_sys/vfs_real.cpp index 3dad54f49..f4073b76a 100644 --- a/src/core/file_sys/vfs_real.cpp +++ b/src/core/file_sys/vfs_real.cpp | |||
| @@ -13,6 +13,13 @@ | |||
| 13 | #include "common/logging/log.h" | 13 | #include "common/logging/log.h" |
| 14 | #include "core/file_sys/vfs_real.h" | 14 | #include "core/file_sys/vfs_real.h" |
| 15 | 15 | ||
| 16 | // For FileTimeStampRaw | ||
| 17 | #include <sys/stat.h> | ||
| 18 | |||
| 19 | #ifdef _MSC_VER | ||
| 20 | #define stat _stat64 | ||
| 21 | #endif | ||
| 22 | |||
| 16 | namespace FileSys { | 23 | namespace FileSys { |
| 17 | 24 | ||
| 18 | namespace FS = Common::FS; | 25 | namespace FS = Common::FS; |
| @@ -392,6 +399,28 @@ std::vector<VirtualFile> RealVfsDirectory::GetFiles() const { | |||
| 392 | return IterateEntries<RealVfsFile, VfsFile>(); | 399 | return IterateEntries<RealVfsFile, VfsFile>(); |
| 393 | } | 400 | } |
| 394 | 401 | ||
| 402 | FileTimeStampRaw RealVfsDirectory::GetFileTimeStamp(std::string_view path_) const { | ||
| 403 | const auto full_path = FS::SanitizePath(path + '/' + std::string(path_)); | ||
| 404 | const auto fs_path = std::filesystem::path{FS::ToU8String(full_path)}; | ||
| 405 | struct stat file_status; | ||
| 406 | |||
| 407 | #ifdef _WIN32 | ||
| 408 | const auto stat_result = _wstat64(fs_path.c_str(), &file_status); | ||
| 409 | #else | ||
| 410 | const auto stat_result = stat(fs_path.c_str(), &file_status); | ||
| 411 | #endif | ||
| 412 | |||
| 413 | if (stat_result != 0) { | ||
| 414 | return {}; | ||
| 415 | } | ||
| 416 | |||
| 417 | return { | ||
| 418 | .created{static_cast<u64>(file_status.st_ctime)}, | ||
| 419 | .accessed{static_cast<u64>(file_status.st_atime)}, | ||
| 420 | .modified{static_cast<u64>(file_status.st_mtime)}, | ||
| 421 | }; | ||
| 422 | } | ||
| 423 | |||
| 395 | std::vector<VirtualDir> RealVfsDirectory::GetSubdirectories() const { | 424 | std::vector<VirtualDir> RealVfsDirectory::GetSubdirectories() const { |
| 396 | return IterateEntries<RealVfsDirectory, VfsDirectory>(); | 425 | return IterateEntries<RealVfsDirectory, VfsDirectory>(); |
| 397 | } | 426 | } |
diff --git a/src/core/file_sys/vfs_real.h b/src/core/file_sys/vfs_real.h index e4d1bba79..746e624cb 100644 --- a/src/core/file_sys/vfs_real.h +++ b/src/core/file_sys/vfs_real.h | |||
| @@ -86,6 +86,7 @@ public: | |||
| 86 | VirtualDir CreateDirectoryRelative(std::string_view relative_path) override; | 86 | VirtualDir CreateDirectoryRelative(std::string_view relative_path) override; |
| 87 | bool DeleteSubdirectoryRecursive(std::string_view name) override; | 87 | bool DeleteSubdirectoryRecursive(std::string_view name) override; |
| 88 | std::vector<VirtualFile> GetFiles() const override; | 88 | std::vector<VirtualFile> GetFiles() const override; |
| 89 | FileTimeStampRaw GetFileTimeStamp(std::string_view path) const override; | ||
| 89 | std::vector<VirtualDir> GetSubdirectories() const override; | 90 | std::vector<VirtualDir> GetSubdirectories() const override; |
| 90 | bool IsWritable() const override; | 91 | bool IsWritable() const override; |
| 91 | bool IsReadable() const override; | 92 | bool IsReadable() const override; |
diff --git a/src/core/file_sys/vfs_types.h b/src/core/file_sys/vfs_types.h index 6215ed7af..ed0724717 100644 --- a/src/core/file_sys/vfs_types.h +++ b/src/core/file_sys/vfs_types.h | |||
| @@ -6,6 +6,8 @@ | |||
| 6 | 6 | ||
| 7 | #include <memory> | 7 | #include <memory> |
| 8 | 8 | ||
| 9 | #include "common/common_types.h" | ||
| 10 | |||
| 9 | namespace FileSys { | 11 | namespace FileSys { |
| 10 | 12 | ||
| 11 | class VfsDirectory; | 13 | class VfsDirectory; |
| @@ -18,4 +20,11 @@ using VirtualDir = std::shared_ptr<VfsDirectory>; | |||
| 18 | using VirtualFile = std::shared_ptr<VfsFile>; | 20 | using VirtualFile = std::shared_ptr<VfsFile>; |
| 19 | using VirtualFilesystem = std::shared_ptr<VfsFilesystem>; | 21 | using VirtualFilesystem = std::shared_ptr<VfsFilesystem>; |
| 20 | 22 | ||
| 23 | struct FileTimeStampRaw { | ||
| 24 | u64 created{}; | ||
| 25 | u64 accessed{}; | ||
| 26 | u64 modified{}; | ||
| 27 | u64 padding{}; | ||
| 28 | }; | ||
| 29 | |||
| 21 | } // namespace FileSys | 30 | } // namespace FileSys |
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp index c8d65f328..f8f9e32f7 100644 --- a/src/core/hle/service/filesystem/filesystem.cpp +++ b/src/core/hle/service/filesystem/filesystem.cpp | |||
| @@ -261,6 +261,18 @@ ResultVal<FileSys::EntryType> VfsDirectoryServiceWrapper::GetEntryType( | |||
| 261 | return FileSys::ERROR_PATH_NOT_FOUND; | 261 | return FileSys::ERROR_PATH_NOT_FOUND; |
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | ResultVal<FileSys::FileTimeStampRaw> VfsDirectoryServiceWrapper::GetFileTimeStampRaw( | ||
| 265 | const std::string& path) const { | ||
| 266 | auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); | ||
| 267 | if (dir == nullptr) { | ||
| 268 | return FileSys::ERROR_PATH_NOT_FOUND; | ||
| 269 | } | ||
| 270 | if (GetEntryType(path).Failed()) { | ||
| 271 | return FileSys::ERROR_PATH_NOT_FOUND; | ||
| 272 | } | ||
| 273 | return MakeResult(dir->GetFileTimeStamp(Common::FS::GetFilename(path))); | ||
| 274 | } | ||
| 275 | |||
| 264 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} | 276 | FileSystemController::FileSystemController(Core::System& system_) : system{system_} {} |
| 265 | 277 | ||
| 266 | FileSystemController::~FileSystemController() = default; | 278 | FileSystemController::~FileSystemController() = default; |
diff --git a/src/core/hle/service/filesystem/filesystem.h b/src/core/hle/service/filesystem/filesystem.h index d387af3cb..b155e0811 100644 --- a/src/core/hle/service/filesystem/filesystem.h +++ b/src/core/hle/service/filesystem/filesystem.h | |||
| @@ -240,6 +240,12 @@ public: | |||
| 240 | */ | 240 | */ |
| 241 | ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const; | 241 | ResultVal<FileSys::EntryType> GetEntryType(const std::string& path) const; |
| 242 | 242 | ||
| 243 | /** | ||
| 244 | * Get the timestamp of the specified path | ||
| 245 | * @return The timestamp of the specified path or error code | ||
| 246 | */ | ||
| 247 | ResultVal<FileSys::FileTimeStampRaw> GetFileTimeStampRaw(const std::string& path) const; | ||
| 248 | |||
| 243 | private: | 249 | private: |
| 244 | FileSys::VirtualDir backing; | 250 | FileSys::VirtualDir backing; |
| 245 | }; | 251 | }; |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index db4d44c12..50c788dd6 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -326,7 +326,7 @@ public: | |||
| 326 | {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"}, | 326 | {11, &IFileSystem::GetFreeSpaceSize, "GetFreeSpaceSize"}, |
| 327 | {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"}, | 327 | {12, &IFileSystem::GetTotalSpaceSize, "GetTotalSpaceSize"}, |
| 328 | {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"}, | 328 | {13, &IFileSystem::CleanDirectoryRecursively, "CleanDirectoryRecursively"}, |
| 329 | {14, nullptr, "GetFileTimeStampRaw"}, | 329 | {14, &IFileSystem::GetFileTimeStampRaw, "GetFileTimeStampRaw"}, |
| 330 | {15, nullptr, "QueryEntry"}, | 330 | {15, nullptr, "QueryEntry"}, |
| 331 | }; | 331 | }; |
| 332 | RegisterHandlers(functions); | 332 | RegisterHandlers(functions); |
| @@ -501,6 +501,24 @@ public: | |||
| 501 | rb.Push(size.get_total_size()); | 501 | rb.Push(size.get_total_size()); |
| 502 | } | 502 | } |
| 503 | 503 | ||
| 504 | void GetFileTimeStampRaw(Kernel::HLERequestContext& ctx) { | ||
| 505 | const auto file_buffer = ctx.ReadBuffer(); | ||
| 506 | const std::string name = Common::StringFromBuffer(file_buffer); | ||
| 507 | |||
| 508 | LOG_WARNING(Service_FS, "(Partial Implementation) called. file={}", name); | ||
| 509 | |||
| 510 | auto result = backend.GetFileTimeStampRaw(name); | ||
| 511 | if (result.Failed()) { | ||
| 512 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 513 | rb.Push(result.Code()); | ||
| 514 | return; | ||
| 515 | } | ||
| 516 | |||
| 517 | IPC::ResponseBuilder rb{ctx, 10}; | ||
| 518 | rb.Push(ResultSuccess); | ||
| 519 | rb.PushRaw(*result); | ||
| 520 | } | ||
| 521 | |||
| 504 | private: | 522 | private: |
| 505 | VfsDirectoryServiceWrapper backend; | 523 | VfsDirectoryServiceWrapper backend; |
| 506 | SizeGetter size; | 524 | SizeGetter size; |
diff --git a/src/core/hle/service/ngct/ngct.cpp b/src/core/hle/service/ngct/ngct.cpp index deb3abb28..8ec7d5266 100644 --- a/src/core/hle/service/ngct/ngct.cpp +++ b/src/core/hle/service/ngct/ngct.cpp | |||
| @@ -15,7 +15,7 @@ public: | |||
| 15 | explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} { | 15 | explicit IService(Core::System& system_) : ServiceFramework{system_, "ngct:u"} { |
| 16 | // clang-format off | 16 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "Match"}, | 18 | {0, &IService::Match, "Match"}, |
| 19 | {1, &IService::Filter, "Filter"}, | 19 | {1, &IService::Filter, "Filter"}, |
| 20 | }; | 20 | }; |
| 21 | // clang-format on | 21 | // clang-format on |
| @@ -24,6 +24,19 @@ public: | |||
| 24 | } | 24 | } |
| 25 | 25 | ||
| 26 | private: | 26 | private: |
| 27 | void Match(Kernel::HLERequestContext& ctx) { | ||
| 28 | const auto buffer = ctx.ReadBuffer(); | ||
| 29 | const auto text = Common::StringFromFixedZeroTerminatedBuffer( | ||
| 30 | reinterpret_cast<const char*>(buffer.data()), buffer.size()); | ||
| 31 | |||
| 32 | LOG_WARNING(Service_NGCT, "(STUBBED) called, text={}", text); | ||
| 33 | |||
| 34 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 35 | rb.Push(ResultSuccess); | ||
| 36 | // Return false since we don't censor anything | ||
| 37 | rb.Push(false); | ||
| 38 | } | ||
| 39 | |||
| 27 | void Filter(Kernel::HLERequestContext& ctx) { | 40 | void Filter(Kernel::HLERequestContext& ctx) { |
| 28 | const auto buffer = ctx.ReadBuffer(); | 41 | const auto buffer = ctx.ReadBuffer(); |
| 29 | const auto text = Common::StringFromFixedZeroTerminatedBuffer( | 42 | const auto text = Common::StringFromFixedZeroTerminatedBuffer( |
diff --git a/src/input_common/sdl/sdl_impl.cpp b/src/input_common/sdl/sdl_impl.cpp index f102410d1..03888b7cb 100644 --- a/src/input_common/sdl/sdl_impl.cpp +++ b/src/input_common/sdl/sdl_impl.cpp | |||
| @@ -21,7 +21,7 @@ | |||
| 21 | #include "common/logging/log.h" | 21 | #include "common/logging/log.h" |
| 22 | #include "common/math_util.h" | 22 | #include "common/math_util.h" |
| 23 | #include "common/param_package.h" | 23 | #include "common/param_package.h" |
| 24 | #include "common/settings_input.h" | 24 | #include "common/settings.h" |
| 25 | #include "common/threadsafe_queue.h" | 25 | #include "common/threadsafe_queue.h" |
| 26 | #include "core/frontend/input.h" | 26 | #include "core/frontend/input.h" |
| 27 | #include "input_common/motion_input.h" | 27 | #include "input_common/motion_input.h" |
| @@ -889,8 +889,10 @@ SDLState::SDLState() { | |||
| 889 | RegisterFactory<VibrationDevice>("sdl", vibration_factory); | 889 | RegisterFactory<VibrationDevice>("sdl", vibration_factory); |
| 890 | RegisterFactory<MotionDevice>("sdl", motion_factory); | 890 | RegisterFactory<MotionDevice>("sdl", motion_factory); |
| 891 | 891 | ||
| 892 | // Disable raw input. When enabled this setting causes SDL to die when a web applet opens | 892 | if (!Settings::values.enable_raw_input) { |
| 893 | SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0"); | 893 | // Disable raw input. When enabled this setting causes SDL to die when a web applet opens |
| 894 | SDL_SetHint(SDL_HINT_JOYSTICK_RAWINPUT, "0"); | ||
| 895 | } | ||
| 894 | 896 | ||
| 895 | // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers | 897 | // Enable HIDAPI rumble. This prevents SDL from disabling motion on PS4 and PS5 controllers |
| 896 | SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); | 898 | SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE, "1"); |
| @@ -898,10 +900,10 @@ SDLState::SDLState() { | |||
| 898 | 900 | ||
| 899 | // Tell SDL2 to use the hidapi driver. This will allow joycons to be detected as a | 901 | // Tell SDL2 to use the hidapi driver. This will allow joycons to be detected as a |
| 900 | // GameController and not a generic one | 902 | // GameController and not a generic one |
| 901 | SDL_SetHint("SDL_JOYSTICK_HIDAPI_JOY_CONS", "1"); | 903 | SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_JOY_CONS, "1"); |
| 902 | 904 | ||
| 903 | // Turn off Pro controller home led | 905 | // Turn off Pro controller home led |
| 904 | SDL_SetHint("SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED", "0"); | 906 | SDL_SetHint(SDL_HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED, "0"); |
| 905 | 907 | ||
| 906 | // If the frontend is going to manage the event loop, then we don't start one here | 908 | // If the frontend is going to manage the event loop, then we don't start one here |
| 907 | start_thread = SDL_WasInit(SDL_INIT_JOYSTICK) == 0; | 909 | start_thread = SDL_WasInit(SDL_INIT_JOYSTICK) == 0; |
diff --git a/src/input_common/udp/client.h b/src/input_common/udp/client.h index a11ea3068..380f9bb76 100644 --- a/src/input_common/udp/client.h +++ b/src/input_common/udp/client.h | |||
| @@ -21,8 +21,6 @@ | |||
| 21 | 21 | ||
| 22 | namespace InputCommon::CemuhookUDP { | 22 | namespace InputCommon::CemuhookUDP { |
| 23 | 23 | ||
| 24 | constexpr char DEFAULT_SRV[] = "127.0.0.1:26760"; | ||
| 25 | |||
| 26 | class Socket; | 24 | class Socket; |
| 27 | 25 | ||
| 28 | namespace Response { | 26 | namespace Response { |
diff --git a/src/video_core/renderer_opengl/gl_shader_cache.cpp b/src/video_core/renderer_opengl/gl_shader_cache.cpp index b0e14182e..02682bd76 100644 --- a/src/video_core/renderer_opengl/gl_shader_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_cache.cpp | |||
| @@ -293,6 +293,8 @@ void ShaderCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading, | |||
| 293 | }}; | 293 | }}; |
| 294 | LoadPipelines(stop_loading, shader_cache_filename, CACHE_VERSION, load_compute, load_graphics); | 294 | LoadPipelines(stop_loading, shader_cache_filename, CACHE_VERSION, load_compute, load_graphics); |
| 295 | 295 | ||
| 296 | LOG_INFO(Render_OpenGL, "Total Pipeline Count: {}", state.total); | ||
| 297 | |||
| 296 | std::unique_lock lock{state.mutex}; | 298 | std::unique_lock lock{state.mutex}; |
| 297 | callback(VideoCore::LoadCallbackStage::Build, 0, state.total); | 299 | callback(VideoCore::LoadCallbackStage::Build, 0, state.total); |
| 298 | state.has_loaded = true; | 300 | state.has_loaded = true; |
diff --git a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp index 31bfbcb06..eb8b4e08b 100644 --- a/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_pipeline_cache.cpp | |||
| @@ -447,6 +447,8 @@ void PipelineCache::LoadDiskResources(u64 title_id, std::stop_token stop_loading | |||
| 447 | VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, CACHE_VERSION, load_compute, | 447 | VideoCommon::LoadPipelines(stop_loading, pipeline_cache_filename, CACHE_VERSION, load_compute, |
| 448 | load_graphics); | 448 | load_graphics); |
| 449 | 449 | ||
| 450 | LOG_INFO(Render_Vulkan, "Total Pipeline Count: {}", state.total); | ||
| 451 | |||
| 450 | std::unique_lock lock{state.mutex}; | 452 | std::unique_lock lock{state.mutex}; |
| 451 | callback(VideoCore::LoadCallbackStage::Build, 0, state.total); | 453 | callback(VideoCore::LoadCallbackStage::Build, 0, state.total); |
| 452 | state.has_loaded = true; | 454 | state.has_loaded = true; |
diff --git a/src/video_core/vulkan_common/vulkan_debug_callback.cpp b/src/video_core/vulkan_common/vulkan_debug_callback.cpp index 0f60765bb..cf94e1d39 100644 --- a/src/video_core/vulkan_common/vulkan_debug_callback.cpp +++ b/src/video_core/vulkan_common/vulkan_debug_callback.cpp | |||
| @@ -16,6 +16,7 @@ VkBool32 Callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity, | |||
| 16 | switch (static_cast<u32>(data->messageIdNumber)) { | 16 | switch (static_cast<u32>(data->messageIdNumber)) { |
| 17 | case 0x682a878au: // VUID-vkCmdBindVertexBuffers2EXT-pBuffers-parameter | 17 | case 0x682a878au: // VUID-vkCmdBindVertexBuffers2EXT-pBuffers-parameter |
| 18 | case 0x99fb7dfdu: // UNASSIGNED-RequiredParameter (vkCmdBindVertexBuffers2EXT pBuffers[0]) | 18 | case 0x99fb7dfdu: // UNASSIGNED-RequiredParameter (vkCmdBindVertexBuffers2EXT pBuffers[0]) |
| 19 | case 0xe8616bf2u: // Bound VkDescriptorSet 0x0[] was destroyed. Likely push_descriptor related | ||
| 19 | return VK_FALSE; | 20 | return VK_FALSE; |
| 20 | default: | 21 | default: |
| 21 | break; | 22 | break; |
diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 24fb50db9..c2ec9f76a 100644 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp | |||
| @@ -243,7 +243,6 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 243 | SetupFamilies(surface); | 243 | SetupFamilies(surface); |
| 244 | SetupFeatures(); | 244 | SetupFeatures(); |
| 245 | SetupProperties(); | 245 | SetupProperties(); |
| 246 | CollectTelemetryParameters(); | ||
| 247 | 246 | ||
| 248 | const auto queue_cis = GetDeviceQueueCreateInfos(); | 247 | const auto queue_cis = GetDeviceQueueCreateInfos(); |
| 249 | const std::vector extensions = LoadExtensions(surface != nullptr); | 248 | const std::vector extensions = LoadExtensions(surface != nullptr); |
| @@ -369,20 +368,9 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 369 | }; | 368 | }; |
| 370 | SetNext(next, demote); | 369 | SetNext(next, demote); |
| 371 | 370 | ||
| 372 | if (driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE) { | 371 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8; |
| 373 | const u32 version = properties.driverVersion; | ||
| 374 | // Broken in this driver | ||
| 375 | if (version > VK_MAKE_API_VERSION(0, 2, 0, 193)) { | ||
| 376 | LOG_WARNING(Render_Vulkan, "AMD proprietary driver versions newer than 21.9.1 " | ||
| 377 | "(windows) / 0.2.0.194 (amdvlk) have " | ||
| 378 | "broken VkPhysicalDeviceFloat16Int8FeaturesKHR"); | ||
| 379 | is_int8_supported = false; | ||
| 380 | is_float16_supported = false; | ||
| 381 | } | ||
| 382 | } | ||
| 383 | |||
| 384 | if (is_int8_supported || is_float16_supported) { | 372 | if (is_int8_supported || is_float16_supported) { |
| 385 | VkPhysicalDeviceFloat16Int8FeaturesKHR float16_int8{ | 373 | float16_int8 = { |
| 386 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, | 374 | .sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT16_INT8_FEATURES_KHR, |
| 387 | .pNext = nullptr, | 375 | .pNext = nullptr, |
| 388 | .shaderFloat16 = is_float16_supported, | 376 | .shaderFloat16 = is_float16_supported, |
| @@ -573,6 +561,7 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR | |||
| 573 | logical = vk::Device::Create(physical, queue_cis, extensions, first_next, dld); | 561 | logical = vk::Device::Create(physical, queue_cis, extensions, first_next, dld); |
| 574 | 562 | ||
| 575 | CollectPhysicalMemoryInfo(); | 563 | CollectPhysicalMemoryInfo(); |
| 564 | CollectTelemetryParameters(); | ||
| 576 | CollectToolingInfo(); | 565 | CollectToolingInfo(); |
| 577 | 566 | ||
| 578 | if (driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) { | 567 | if (driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY_KHR) { |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index a99cdf96a..952e96769 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -559,6 +559,7 @@ void Config::ReadControlValues() { | |||
| 559 | ReadTouchscreenValues(); | 559 | ReadTouchscreenValues(); |
| 560 | ReadMotionTouchValues(); | 560 | ReadMotionTouchValues(); |
| 561 | 561 | ||
| 562 | ReadBasicSetting(Settings::values.enable_raw_input); | ||
| 562 | ReadBasicSetting(Settings::values.emulate_analog_keyboard); | 563 | ReadBasicSetting(Settings::values.emulate_analog_keyboard); |
| 563 | Settings::values.mouse_panning = false; | 564 | Settings::values.mouse_panning = false; |
| 564 | ReadBasicSetting(Settings::values.mouse_panning_sensitivity); | 565 | ReadBasicSetting(Settings::values.mouse_panning_sensitivity); |
| @@ -1182,6 +1183,7 @@ void Config::SaveControlValues() { | |||
| 1182 | WriteGlobalSetting(Settings::values.vibration_enabled); | 1183 | WriteGlobalSetting(Settings::values.vibration_enabled); |
| 1183 | WriteGlobalSetting(Settings::values.enable_accurate_vibrations); | 1184 | WriteGlobalSetting(Settings::values.enable_accurate_vibrations); |
| 1184 | WriteGlobalSetting(Settings::values.motion_enabled); | 1185 | WriteGlobalSetting(Settings::values.motion_enabled); |
| 1186 | WriteBasicSetting(Settings::values.enable_raw_input); | ||
| 1185 | WriteBasicSetting(Settings::values.keyboard_enabled); | 1187 | WriteBasicSetting(Settings::values.keyboard_enabled); |
| 1186 | WriteBasicSetting(Settings::values.emulate_analog_keyboard); | 1188 | WriteBasicSetting(Settings::values.emulate_analog_keyboard); |
| 1187 | WriteBasicSetting(Settings::values.mouse_panning_sensitivity); | 1189 | WriteBasicSetting(Settings::values.mouse_panning_sensitivity); |
diff --git a/src/yuzu/configuration/configure_input_advanced.cpp b/src/yuzu/configuration/configure_input_advanced.cpp index 2f1419b5b..d20fd86b6 100644 --- a/src/yuzu/configuration/configure_input_advanced.cpp +++ b/src/yuzu/configuration/configure_input_advanced.cpp | |||
| @@ -126,6 +126,7 @@ void ConfigureInputAdvanced::ApplyConfiguration() { | |||
| 126 | Settings::values.mouse_panning_sensitivity = | 126 | Settings::values.mouse_panning_sensitivity = |
| 127 | static_cast<float>(ui->mouse_panning_sensitivity->value()); | 127 | static_cast<float>(ui->mouse_panning_sensitivity->value()); |
| 128 | Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked(); | 128 | Settings::values.touchscreen.enabled = ui->touchscreen_enabled->isChecked(); |
| 129 | Settings::values.enable_raw_input = ui->enable_raw_input->isChecked(); | ||
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | void ConfigureInputAdvanced::LoadConfiguration() { | 132 | void ConfigureInputAdvanced::LoadConfiguration() { |
| @@ -155,6 +156,7 @@ void ConfigureInputAdvanced::LoadConfiguration() { | |||
| 155 | ui->mouse_panning->setChecked(Settings::values.mouse_panning.GetValue()); | 156 | ui->mouse_panning->setChecked(Settings::values.mouse_panning.GetValue()); |
| 156 | ui->mouse_panning_sensitivity->setValue(Settings::values.mouse_panning_sensitivity.GetValue()); | 157 | ui->mouse_panning_sensitivity->setValue(Settings::values.mouse_panning_sensitivity.GetValue()); |
| 157 | ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled); | 158 | ui->touchscreen_enabled->setChecked(Settings::values.touchscreen.enabled); |
| 159 | ui->enable_raw_input->setChecked(Settings::values.enable_raw_input.GetValue()); | ||
| 158 | 160 | ||
| 159 | UpdateUIEnabled(); | 161 | UpdateUIEnabled(); |
| 160 | } | 162 | } |
diff --git a/src/yuzu/configuration/configure_input_advanced.ui b/src/yuzu/configuration/configure_input_advanced.ui index d3ef5bd06..9095206a0 100644 --- a/src/yuzu/configuration/configure_input_advanced.ui +++ b/src/yuzu/configuration/configure_input_advanced.ui | |||
| @@ -2672,6 +2672,22 @@ | |||
| 2672 | </property> | 2672 | </property> |
| 2673 | </widget> | 2673 | </widget> |
| 2674 | </item> | 2674 | </item> |
| 2675 | <item row="9" column="0"> | ||
| 2676 | <widget class="QCheckBox" name="enable_raw_input"> | ||
| 2677 | <property name="toolTip"> | ||
| 2678 | <string>Requires restarting yuzu</string> | ||
| 2679 | </property> | ||
| 2680 | <property name="minimumSize"> | ||
| 2681 | <size> | ||
| 2682 | <width>0</width> | ||
| 2683 | <height>23</height> | ||
| 2684 | </size> | ||
| 2685 | </property> | ||
| 2686 | <property name="text"> | ||
| 2687 | <string>Enable XInput 8 player support (disables web applet)</string> | ||
| 2688 | </property> | ||
| 2689 | </widget> | ||
| 2690 | </item> | ||
| 2675 | </layout> | 2691 | </layout> |
| 2676 | </widget> | 2692 | </widget> |
| 2677 | </item> | 2693 | </item> |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 77d53e7bc..f4e49001d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -557,7 +557,8 @@ void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url, | |||
| 557 | const std::string& additional_args, bool is_local) { | 557 | const std::string& additional_args, bool is_local) { |
| 558 | #ifdef YUZU_USE_QT_WEB_ENGINE | 558 | #ifdef YUZU_USE_QT_WEB_ENGINE |
| 559 | 559 | ||
| 560 | if (disable_web_applet) { | 560 | // Raw input breaks with the web applet, Disable web applets if enabled |
| 561 | if (disable_web_applet || Settings::values.enable_raw_input) { | ||
| 561 | emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, | 562 | emit WebBrowserClosed(Service::AM::Applets::WebExitReason::WindowClosed, |
| 562 | "http://localhost/"); | 563 | "http://localhost/"); |
| 563 | return; | 564 | return; |