diff options
Diffstat (limited to 'src/core')
40 files changed, 512 insertions, 277 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 1a243c515..69a1aa0a5 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -147,8 +147,8 @@ struct System::Impl { | |||
| 147 | 147 | ||
| 148 | device_memory = std::make_unique<Core::DeviceMemory>(system); | 148 | device_memory = std::make_unique<Core::DeviceMemory>(system); |
| 149 | 149 | ||
| 150 | is_multicore = Settings::values.use_multi_core; | 150 | is_multicore = Settings::values.use_multi_core.GetValue(); |
| 151 | is_async_gpu = is_multicore || Settings::values.use_asynchronous_gpu_emulation; | 151 | is_async_gpu = is_multicore || Settings::values.use_asynchronous_gpu_emulation.GetValue(); |
| 152 | 152 | ||
| 153 | kernel.SetMulticore(is_multicore); | 153 | kernel.SetMulticore(is_multicore); |
| 154 | cpu_manager.SetMulticore(is_multicore); | 154 | cpu_manager.SetMulticore(is_multicore); |
| @@ -162,7 +162,7 @@ struct System::Impl { | |||
| 162 | const auto current_time = std::chrono::duration_cast<std::chrono::seconds>( | 162 | const auto current_time = std::chrono::duration_cast<std::chrono::seconds>( |
| 163 | std::chrono::system_clock::now().time_since_epoch()); | 163 | std::chrono::system_clock::now().time_since_epoch()); |
| 164 | Settings::values.custom_rtc_differential = | 164 | Settings::values.custom_rtc_differential = |
| 165 | Settings::values.custom_rtc.value_or(current_time) - current_time; | 165 | Settings::values.custom_rtc.GetValue().value_or(current_time) - current_time; |
| 166 | 166 | ||
| 167 | // Create a default fs if one doesn't already exist. | 167 | // Create a default fs if one doesn't already exist. |
| 168 | if (virtual_filesystem == nullptr) | 168 | if (virtual_filesystem == nullptr) |
diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 5c83c41a4..a63e60461 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp | |||
| @@ -172,7 +172,7 @@ void CoreTiming::ClearPendingEvents() { | |||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) { | 174 | void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) { |
| 175 | basic_lock.lock(); | 175 | std::scoped_lock lock{basic_lock}; |
| 176 | 176 | ||
| 177 | const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) { | 177 | const auto itr = std::remove_if(event_queue.begin(), event_queue.end(), [&](const Event& e) { |
| 178 | return e.type.lock().get() == event_type.get(); | 178 | return e.type.lock().get() == event_type.get(); |
| @@ -183,12 +183,10 @@ void CoreTiming::RemoveEvent(const std::shared_ptr<EventType>& event_type) { | |||
| 183 | event_queue.erase(itr, event_queue.end()); | 183 | event_queue.erase(itr, event_queue.end()); |
| 184 | std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>()); | 184 | std::make_heap(event_queue.begin(), event_queue.end(), std::greater<>()); |
| 185 | } | 185 | } |
| 186 | basic_lock.unlock(); | ||
| 187 | } | 186 | } |
| 188 | 187 | ||
| 189 | std::optional<s64> CoreTiming::Advance() { | 188 | std::optional<s64> CoreTiming::Advance() { |
| 190 | std::scoped_lock advance_scope{advance_lock}; | 189 | std::scoped_lock lock{advance_lock, basic_lock}; |
| 191 | std::scoped_lock basic_scope{basic_lock}; | ||
| 192 | global_timer = GetGlobalTimeNs().count(); | 190 | global_timer = GetGlobalTimeNs().count(); |
| 193 | 191 | ||
| 194 | while (!event_queue.empty() && event_queue.front().time <= global_timer) { | 192 | while (!event_queue.empty() && event_queue.front().time <= global_timer) { |
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp index 8997c7082..f87fe0abc 100644 --- a/src/core/crypto/key_manager.cpp +++ b/src/core/crypto/key_manager.cpp | |||
| @@ -695,8 +695,9 @@ void KeyManager::WriteKeyToFile(KeyCategory category, std::string_view keyname, | |||
| 695 | } | 695 | } |
| 696 | 696 | ||
| 697 | void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) { | 697 | void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) { |
| 698 | if (s128_keys.find({id, field1, field2}) != s128_keys.end()) | 698 | if (s128_keys.find({id, field1, field2}) != s128_keys.end() || key == Key128{}) { |
| 699 | return; | 699 | return; |
| 700 | } | ||
| 700 | if (id == S128KeyType::Titlekey) { | 701 | if (id == S128KeyType::Titlekey) { |
| 701 | Key128 rights_id; | 702 | Key128 rights_id; |
| 702 | std::memcpy(rights_id.data(), &field2, sizeof(u64)); | 703 | std::memcpy(rights_id.data(), &field2, sizeof(u64)); |
| @@ -716,8 +717,9 @@ void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) { | |||
| 716 | return std::tie(elem.second.type, elem.second.field1, elem.second.field2) == | 717 | return std::tie(elem.second.type, elem.second.field1, elem.second.field2) == |
| 717 | std::tie(id, field1, field2); | 718 | std::tie(id, field1, field2); |
| 718 | }); | 719 | }); |
| 719 | if (iter2 != s128_file_id.end()) | 720 | if (iter2 != s128_file_id.end()) { |
| 720 | WriteKeyToFile(category, iter2->first, key); | 721 | WriteKeyToFile(category, iter2->first, key); |
| 722 | } | ||
| 721 | 723 | ||
| 722 | // Variable cases | 724 | // Variable cases |
| 723 | if (id == S128KeyType::KeyArea) { | 725 | if (id == S128KeyType::KeyArea) { |
| @@ -745,16 +747,18 @@ void KeyManager::SetKey(S128KeyType id, Key128 key, u64 field1, u64 field2) { | |||
| 745 | } | 747 | } |
| 746 | 748 | ||
| 747 | void KeyManager::SetKey(S256KeyType id, Key256 key, u64 field1, u64 field2) { | 749 | void KeyManager::SetKey(S256KeyType id, Key256 key, u64 field1, u64 field2) { |
| 748 | if (s256_keys.find({id, field1, field2}) != s256_keys.end()) | 750 | if (s256_keys.find({id, field1, field2}) != s256_keys.end() || key == Key256{}) { |
| 749 | return; | 751 | return; |
| 752 | } | ||
| 750 | const auto iter = std::find_if( | 753 | const auto iter = std::find_if( |
| 751 | s256_file_id.begin(), s256_file_id.end(), | 754 | s256_file_id.begin(), s256_file_id.end(), |
| 752 | [&id, &field1, &field2](const std::pair<std::string, KeyIndex<S256KeyType>> elem) { | 755 | [&id, &field1, &field2](const std::pair<std::string, KeyIndex<S256KeyType>> elem) { |
| 753 | return std::tie(elem.second.type, elem.second.field1, elem.second.field2) == | 756 | return std::tie(elem.second.type, elem.second.field1, elem.second.field2) == |
| 754 | std::tie(id, field1, field2); | 757 | std::tie(id, field1, field2); |
| 755 | }); | 758 | }); |
| 756 | if (iter != s256_file_id.end()) | 759 | if (iter != s256_file_id.end()) { |
| 757 | WriteKeyToFile(KeyCategory::Standard, iter->first, key); | 760 | WriteKeyToFile(KeyCategory::Standard, iter->first, key); |
| 761 | } | ||
| 758 | s256_keys[{id, field1, field2}] = key; | 762 | s256_keys[{id, field1, field2}] = key; |
| 759 | } | 763 | } |
| 760 | 764 | ||
diff --git a/src/core/frontend/framebuffer_layout.cpp b/src/core/frontend/framebuffer_layout.cpp index d0c43447c..c1fbc235b 100644 --- a/src/core/frontend/framebuffer_layout.cpp +++ b/src/core/frontend/framebuffer_layout.cpp | |||
| @@ -29,7 +29,7 @@ FramebufferLayout DefaultFrameLayout(u32 width, u32 height) { | |||
| 29 | 29 | ||
| 30 | const float window_aspect_ratio = static_cast<float>(height) / width; | 30 | const float window_aspect_ratio = static_cast<float>(height) / width; |
| 31 | const float emulation_aspect_ratio = EmulationAspectRatio( | 31 | const float emulation_aspect_ratio = EmulationAspectRatio( |
| 32 | static_cast<AspectRatio>(Settings::values.aspect_ratio), window_aspect_ratio); | 32 | static_cast<AspectRatio>(Settings::values.aspect_ratio.GetValue()), window_aspect_ratio); |
| 33 | 33 | ||
| 34 | const Common::Rectangle<u32> screen_window_area{0, 0, width, height}; | 34 | const Common::Rectangle<u32> screen_window_area{0, 0, width, height}; |
| 35 | Common::Rectangle<u32> screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); | 35 | Common::Rectangle<u32> screen = MaxRectangle(screen_window_area, emulation_aspect_ratio); |
diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index f9d7c024d..c6fcb56ad 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp | |||
| @@ -123,7 +123,7 @@ std::shared_ptr<Process> Process::Create(Core::System& system, std::string name, | |||
| 123 | : kernel.CreateNewUserProcessID(); | 123 | : kernel.CreateNewUserProcessID(); |
| 124 | process->capabilities.InitializeForMetadatalessProcess(); | 124 | process->capabilities.InitializeForMetadatalessProcess(); |
| 125 | 125 | ||
| 126 | std::mt19937 rng(Settings::values.rng_seed.value_or(0)); | 126 | std::mt19937 rng(Settings::values.rng_seed.GetValue().value_or(0)); |
| 127 | std::uniform_int_distribution<u64> distribution; | 127 | std::uniform_int_distribution<u64> distribution; |
| 128 | std::generate(process->random_entropy.begin(), process->random_entropy.end(), | 128 | std::generate(process->random_entropy.begin(), process->random_entropy.end(), |
| 129 | [&] { return distribution(rng); }); | 129 | [&] { return distribution(rng); }); |
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 2b12c0dbf..7b929781c 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | // licensed under GPLv2 or later under exception provided by the author. | 6 | // licensed under GPLv2 or later under exception provided by the author. |
| 7 | 7 | ||
| 8 | #include <algorithm> | 8 | #include <algorithm> |
| 9 | #include <mutex> | ||
| 9 | #include <set> | 10 | #include <set> |
| 10 | #include <unordered_set> | 11 | #include <unordered_set> |
| 11 | #include <utility> | 12 | #include <utility> |
| @@ -31,22 +32,20 @@ GlobalScheduler::GlobalScheduler(KernelCore& kernel) : kernel{kernel} {} | |||
| 31 | GlobalScheduler::~GlobalScheduler() = default; | 32 | GlobalScheduler::~GlobalScheduler() = default; |
| 32 | 33 | ||
| 33 | void GlobalScheduler::AddThread(std::shared_ptr<Thread> thread) { | 34 | void GlobalScheduler::AddThread(std::shared_ptr<Thread> thread) { |
| 34 | global_list_guard.lock(); | 35 | std::scoped_lock lock{global_list_guard}; |
| 35 | thread_list.push_back(std::move(thread)); | 36 | thread_list.push_back(std::move(thread)); |
| 36 | global_list_guard.unlock(); | ||
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void GlobalScheduler::RemoveThread(std::shared_ptr<Thread> thread) { | 39 | void GlobalScheduler::RemoveThread(std::shared_ptr<Thread> thread) { |
| 40 | global_list_guard.lock(); | 40 | std::scoped_lock lock{global_list_guard}; |
| 41 | thread_list.erase(std::remove(thread_list.begin(), thread_list.end(), thread), | 41 | thread_list.erase(std::remove(thread_list.begin(), thread_list.end(), thread), |
| 42 | thread_list.end()); | 42 | thread_list.end()); |
| 43 | global_list_guard.unlock(); | ||
| 44 | } | 43 | } |
| 45 | 44 | ||
| 46 | u32 GlobalScheduler::SelectThreads() { | 45 | u32 GlobalScheduler::SelectThreads() { |
| 47 | ASSERT(is_locked); | 46 | ASSERT(is_locked); |
| 48 | const auto update_thread = [](Thread* thread, Scheduler& sched) { | 47 | const auto update_thread = [](Thread* thread, Scheduler& sched) { |
| 49 | sched.guard.lock(); | 48 | std::scoped_lock lock{sched.guard}; |
| 50 | if (thread != sched.selected_thread_set.get()) { | 49 | if (thread != sched.selected_thread_set.get()) { |
| 51 | if (thread == nullptr) { | 50 | if (thread == nullptr) { |
| 52 | ++sched.idle_selection_count; | 51 | ++sched.idle_selection_count; |
| @@ -57,7 +56,6 @@ u32 GlobalScheduler::SelectThreads() { | |||
| 57 | sched.is_context_switch_pending || (sched.selected_thread_set != sched.current_thread); | 56 | sched.is_context_switch_pending || (sched.selected_thread_set != sched.current_thread); |
| 58 | sched.is_context_switch_pending = reschedule_pending; | 57 | sched.is_context_switch_pending = reschedule_pending; |
| 59 | std::atomic_thread_fence(std::memory_order_seq_cst); | 58 | std::atomic_thread_fence(std::memory_order_seq_cst); |
| 60 | sched.guard.unlock(); | ||
| 61 | return reschedule_pending; | 59 | return reschedule_pending; |
| 62 | }; | 60 | }; |
| 63 | if (!is_reselection_pending.load()) { | 61 | if (!is_reselection_pending.load()) { |
| @@ -757,11 +755,12 @@ void Scheduler::OnSwitch(void* this_scheduler) { | |||
| 757 | 755 | ||
| 758 | void Scheduler::SwitchToCurrent() { | 756 | void Scheduler::SwitchToCurrent() { |
| 759 | while (true) { | 757 | while (true) { |
| 760 | guard.lock(); | 758 | { |
| 761 | selected_thread = selected_thread_set; | 759 | std::scoped_lock lock{guard}; |
| 762 | current_thread = selected_thread; | 760 | selected_thread = selected_thread_set; |
| 763 | is_context_switch_pending = false; | 761 | current_thread = selected_thread; |
| 764 | guard.unlock(); | 762 | is_context_switch_pending = false; |
| 763 | } | ||
| 765 | while (!is_context_switch_pending) { | 764 | while (!is_context_switch_pending) { |
| 766 | if (current_thread != nullptr && !current_thread->IsHLEThread()) { | 765 | if (current_thread != nullptr && !current_thread->IsHLEThread()) { |
| 767 | current_thread->context_guard.lock(); | 766 | current_thread->context_guard.lock(); |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 32fad35f3..4e7a0bec9 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -272,7 +272,7 @@ ISelfController::ISelfController(Core::System& system, | |||
| 272 | {41, nullptr, "IsSystemBufferSharingEnabled"}, | 272 | {41, nullptr, "IsSystemBufferSharingEnabled"}, |
| 273 | {42, nullptr, "GetSystemSharedLayerHandle"}, | 273 | {42, nullptr, "GetSystemSharedLayerHandle"}, |
| 274 | {43, nullptr, "GetSystemSharedBufferHandle"}, | 274 | {43, nullptr, "GetSystemSharedBufferHandle"}, |
| 275 | {44, nullptr, "CreateManagedDisplaySeparableLayer"}, | 275 | {44, &ISelfController::CreateManagedDisplaySeparableLayer, "CreateManagedDisplaySeparableLayer"}, |
| 276 | {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, | 276 | {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, |
| 277 | {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"}, | 277 | {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"}, |
| 278 | {51, nullptr, "ApproveToDisplay"}, | 278 | {51, nullptr, "ApproveToDisplay"}, |
| @@ -462,6 +462,24 @@ void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) | |||
| 462 | rb.Push(*layer_id); | 462 | rb.Push(*layer_id); |
| 463 | } | 463 | } |
| 464 | 464 | ||
| 465 | void ISelfController::CreateManagedDisplaySeparableLayer(Kernel::HLERequestContext& ctx) { | ||
| 466 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 467 | |||
| 468 | // TODO(Subv): Find out how AM determines the display to use, for now just | ||
| 469 | // create the layer in the Default display. | ||
| 470 | // This calls nn::vi::CreateRecordingLayer() which creates another layer. | ||
| 471 | // Currently we do not support more than 1 layer per display, output 1 layer id for now. | ||
| 472 | // Outputting 1 layer id instead of the expected 2 has not been observed to cause any adverse | ||
| 473 | // side effects. | ||
| 474 | // TODO: Support multiple layers | ||
| 475 | const auto display_id = nvflinger->OpenDisplay("Default"); | ||
| 476 | const auto layer_id = nvflinger->CreateLayer(*display_id); | ||
| 477 | |||
| 478 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 479 | rb.Push(RESULT_SUCCESS); | ||
| 480 | rb.Push(*layer_id); | ||
| 481 | } | ||
| 482 | |||
| 465 | void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) { | 483 | void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) { |
| 466 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 484 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 467 | 485 | ||
| @@ -731,14 +749,14 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& | |||
| 731 | 749 | ||
| 732 | if (Settings::values.use_docked_mode) { | 750 | if (Settings::values.use_docked_mode) { |
| 733 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * | 751 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * |
| 734 | static_cast<u32>(Settings::values.resolution_factor)); | 752 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 735 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) * | 753 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) * |
| 736 | static_cast<u32>(Settings::values.resolution_factor)); | 754 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 737 | } else { | 755 | } else { |
| 738 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * | 756 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * |
| 739 | static_cast<u32>(Settings::values.resolution_factor)); | 757 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 740 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) * | 758 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) * |
| 741 | static_cast<u32>(Settings::values.resolution_factor)); | 759 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 742 | } | 760 | } |
| 743 | } | 761 | } |
| 744 | 762 | ||
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 2f69466ec..6cfb11b48 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -140,6 +140,7 @@ private: | |||
| 140 | void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx); | 140 | void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx); |
| 141 | void SetAlbumImageOrientation(Kernel::HLERequestContext& ctx); | 141 | void SetAlbumImageOrientation(Kernel::HLERequestContext& ctx); |
| 142 | void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx); | 142 | void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx); |
| 143 | void CreateManagedDisplaySeparableLayer(Kernel::HLERequestContext& ctx); | ||
| 143 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); | 144 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); |
| 144 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 145 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
| 145 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 146 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index f19affce7..11aa74828 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp | |||
| @@ -121,11 +121,83 @@ public: | |||
| 121 | {39, nullptr, "PrepareShutdown"}, | 121 | {39, nullptr, "PrepareShutdown"}, |
| 122 | {40, nullptr, "ListApplyDeltaTask"}, | 122 | {40, nullptr, "ListApplyDeltaTask"}, |
| 123 | {41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, | 123 | {41, nullptr, "ClearNotEnoughSpaceStateOfApplyDeltaTask"}, |
| 124 | {42, nullptr, "Unknown1"}, | 124 | {42, nullptr, "Unknown42"}, |
| 125 | {43, nullptr, "Unknown2"}, | 125 | {43, nullptr, "Unknown43"}, |
| 126 | {44, nullptr, "Unknown3"}, | 126 | {44, nullptr, "Unknown44"}, |
| 127 | {45, nullptr, "Unknown4"}, | 127 | {45, nullptr, "Unknown45"}, |
| 128 | {46, nullptr, "Unknown5"}, | 128 | {46, nullptr, "Unknown46"}, |
| 129 | {47, nullptr, "Unknown47"}, | ||
| 130 | {48, nullptr, "Unknown48"}, | ||
| 131 | {49, nullptr, "Unknown49"}, | ||
| 132 | {50, nullptr, "Unknown50"}, | ||
| 133 | {51, nullptr, "Unknown51"}, | ||
| 134 | {52, nullptr, "Unknown52"}, | ||
| 135 | {53, nullptr, "Unknown53"}, | ||
| 136 | {54, nullptr, "Unknown54"}, | ||
| 137 | {55, nullptr, "Unknown55"}, | ||
| 138 | {56, nullptr, "Unknown56"}, | ||
| 139 | {57, nullptr, "Unknown57"}, | ||
| 140 | {58, nullptr, "Unknown58"}, | ||
| 141 | {59, nullptr, "Unknown59"}, | ||
| 142 | {60, nullptr, "Unknown60"}, | ||
| 143 | {61, nullptr, "Unknown61"}, | ||
| 144 | {62, nullptr, "Unknown62"}, | ||
| 145 | {63, nullptr, "Unknown63"}, | ||
| 146 | {64, nullptr, "Unknown64"}, | ||
| 147 | {65, nullptr, "Unknown65"}, | ||
| 148 | {66, nullptr, "Unknown66"}, | ||
| 149 | {67, nullptr, "Unknown67"}, | ||
| 150 | {68, nullptr, "Unknown68"}, | ||
| 151 | {69, nullptr, "Unknown69"}, | ||
| 152 | {70, nullptr, "Unknown70"}, | ||
| 153 | {71, nullptr, "Unknown71"}, | ||
| 154 | {72, nullptr, "Unknown72"}, | ||
| 155 | {73, nullptr, "Unknown73"}, | ||
| 156 | {74, nullptr, "Unknown74"}, | ||
| 157 | {75, nullptr, "Unknown75"}, | ||
| 158 | {76, nullptr, "Unknown76"}, | ||
| 159 | {77, nullptr, "Unknown77"}, | ||
| 160 | {78, nullptr, "Unknown78"}, | ||
| 161 | {79, nullptr, "Unknown79"}, | ||
| 162 | {80, nullptr, "Unknown80"}, | ||
| 163 | {81, nullptr, "Unknown81"}, | ||
| 164 | {82, nullptr, "Unknown82"}, | ||
| 165 | {83, nullptr, "Unknown83"}, | ||
| 166 | {84, nullptr, "Unknown84"}, | ||
| 167 | {85, nullptr, "Unknown85"}, | ||
| 168 | {86, nullptr, "Unknown86"}, | ||
| 169 | {87, nullptr, "Unknown87"}, | ||
| 170 | {88, nullptr, "Unknown88"}, | ||
| 171 | {89, nullptr, "Unknown89"}, | ||
| 172 | {90, nullptr, "Unknown90"}, | ||
| 173 | {91, nullptr, "Unknown91"}, | ||
| 174 | {92, nullptr, "Unknown92"}, | ||
| 175 | {93, nullptr, "Unknown93"}, | ||
| 176 | {94, nullptr, "Unknown94"}, | ||
| 177 | {95, nullptr, "Unknown95"}, | ||
| 178 | {96, nullptr, "Unknown96"}, | ||
| 179 | {97, nullptr, "Unknown97"}, | ||
| 180 | {98, nullptr, "Unknown98"}, | ||
| 181 | {99, nullptr, "Unknown99"}, | ||
| 182 | {100, nullptr, "Unknown100"}, | ||
| 183 | {101, nullptr, "Unknown101"}, | ||
| 184 | {102, nullptr, "Unknown102"}, | ||
| 185 | {103, nullptr, "Unknown103"}, | ||
| 186 | {104, nullptr, "Unknown104"}, | ||
| 187 | {105, nullptr, "Unknown105"}, | ||
| 188 | {106, nullptr, "Unknown106"}, | ||
| 189 | {107, nullptr, "Unknown107"}, | ||
| 190 | {108, nullptr, "Unknown108"}, | ||
| 191 | {109, nullptr, "Unknown109"}, | ||
| 192 | {110, nullptr, "Unknown110"}, | ||
| 193 | {111, nullptr, "Unknown111"}, | ||
| 194 | {112, nullptr, "Unknown112"}, | ||
| 195 | {113, nullptr, "Unknown113"}, | ||
| 196 | {114, nullptr, "Unknown114"}, | ||
| 197 | {115, nullptr, "Unknown115"}, | ||
| 198 | {116, nullptr, "Unknown116"}, | ||
| 199 | {117, nullptr, "Unknown117"}, | ||
| 200 | {118, nullptr, "Unknown118"}, | ||
| 129 | }; | 201 | }; |
| 130 | // clang-format on | 202 | // clang-format on |
| 131 | 203 | ||
| @@ -142,6 +214,7 @@ public: | |||
| 142 | {1, nullptr, "RefreshDebugAvailability"}, | 214 | {1, nullptr, "RefreshDebugAvailability"}, |
| 143 | {2, nullptr, "ClearDebugResponse"}, | 215 | {2, nullptr, "ClearDebugResponse"}, |
| 144 | {3, nullptr, "RegisterDebugResponse"}, | 216 | {3, nullptr, "RegisterDebugResponse"}, |
| 217 | {4, nullptr, "IsLargeResourceAvailable"}, | ||
| 145 | }; | 218 | }; |
| 146 | // clang-format on | 219 | // clang-format on |
| 147 | 220 | ||
| @@ -164,6 +237,8 @@ public: | |||
| 164 | static const FunctionInfo functions[] = { | 237 | static const FunctionInfo functions[] = { |
| 165 | {0, nullptr, "RequestDeviceAuthenticationToken"}, | 238 | {0, nullptr, "RequestDeviceAuthenticationToken"}, |
| 166 | {1, nullptr, "RequestCachedDeviceAuthenticationToken"}, | 239 | {1, nullptr, "RequestCachedDeviceAuthenticationToken"}, |
| 240 | {2, nullptr, "RequestEdgeToken"}, | ||
| 241 | {3, nullptr, "RequestCachedEdgeToken"}, | ||
| 167 | {100, nullptr, "RequestRegisterDeviceAccount"}, | 242 | {100, nullptr, "RequestRegisterDeviceAccount"}, |
| 168 | {101, nullptr, "RequestUnregisterDeviceAccount"}, | 243 | {101, nullptr, "RequestUnregisterDeviceAccount"}, |
| 169 | {102, nullptr, "RequestDeviceAccountStatus"}, | 244 | {102, nullptr, "RequestDeviceAccountStatus"}, |
| @@ -181,7 +256,8 @@ public: | |||
| 181 | {305, nullptr, "RequestCreateVirtualAccount"}, | 256 | {305, nullptr, "RequestCreateVirtualAccount"}, |
| 182 | {306, nullptr, "RequestDeviceLinkStatus"}, | 257 | {306, nullptr, "RequestDeviceLinkStatus"}, |
| 183 | {400, nullptr, "GetAccountByVirtualAccount"}, | 258 | {400, nullptr, "GetAccountByVirtualAccount"}, |
| 184 | {500, nullptr, "RequestSyncTicket"}, | 259 | {401, nullptr, "GetVirtualAccount"}, |
| 260 | {500, nullptr, "RequestSyncTicketLegacy"}, | ||
| 185 | {501, nullptr, "RequestDownloadTicket"}, | 261 | {501, nullptr, "RequestDownloadTicket"}, |
| 186 | {502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, | 262 | {502, nullptr, "RequestDownloadTicketForPrepurchasedContents"}, |
| 187 | {503, nullptr, "RequestSyncTicket"}, | 263 | {503, nullptr, "RequestSyncTicket"}, |
diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp index f38d01084..8fa16fb08 100644 --- a/src/core/hle/service/npns/npns.cpp +++ b/src/core/hle/service/npns/npns.cpp | |||
| @@ -30,6 +30,7 @@ public: | |||
| 30 | {23, nullptr, "DestroyToken"}, | 30 | {23, nullptr, "DestroyToken"}, |
| 31 | {24, nullptr, "DestroyTokenWithApplicationId"}, | 31 | {24, nullptr, "DestroyTokenWithApplicationId"}, |
| 32 | {25, nullptr, "QueryIsTokenValid"}, | 32 | {25, nullptr, "QueryIsTokenValid"}, |
| 33 | {26, nullptr, "ListenToMyApplicationId"}, | ||
| 33 | {31, nullptr, "UploadTokenToBaaS"}, | 34 | {31, nullptr, "UploadTokenToBaaS"}, |
| 34 | {32, nullptr, "DestroyTokenForBaaS"}, | 35 | {32, nullptr, "DestroyTokenForBaaS"}, |
| 35 | {33, nullptr, "CreateTokenForBaaS"}, | 36 | {33, nullptr, "CreateTokenForBaaS"}, |
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index 7e5ceccdb..886450be2 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -104,7 +104,7 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 104 | {94, nullptr, "LaunchApplication"}, | 104 | {94, nullptr, "LaunchApplication"}, |
| 105 | {95, nullptr, "GetApplicationLaunchInfo"}, | 105 | {95, nullptr, "GetApplicationLaunchInfo"}, |
| 106 | {96, nullptr, "AcquireApplicationLaunchInfo"}, | 106 | {96, nullptr, "AcquireApplicationLaunchInfo"}, |
| 107 | {97, nullptr, "GetMainApplicationProgramIndex2"}, | 107 | {97, nullptr, "GetMainApplicationProgramIndexByApplicationLaunchInfo"}, |
| 108 | {98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, | 108 | {98, nullptr, "EnableApplicationAllThreadDumpOnCrash"}, |
| 109 | {99, nullptr, "LaunchDevMenu"}, | 109 | {99, nullptr, "LaunchDevMenu"}, |
| 110 | {100, nullptr, "ResetToFactorySettings"}, | 110 | {100, nullptr, "ResetToFactorySettings"}, |
| @@ -254,7 +254,7 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 254 | {2170, nullptr, "GetRightsEnvironmentStatus"}, | 254 | {2170, nullptr, "GetRightsEnvironmentStatus"}, |
| 255 | {2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, | 255 | {2171, nullptr, "GetRightsEnvironmentStatusChangedEvent"}, |
| 256 | {2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, | 256 | {2180, nullptr, "RequestExtendRightsInRightsEnvironment"}, |
| 257 | {2181, nullptr, "GetLastResultOfExtendRightsInRightsEnvironment"}, | 257 | {2181, nullptr, "GetResultOfExtendRightsInRightsEnvironment"}, |
| 258 | {2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, | 258 | {2182, nullptr, "SetActiveRightsContextUsingStateToRightsEnvironment"}, |
| 259 | {2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, | 259 | {2190, nullptr, "GetRightsEnvironmentHandleForApplication"}, |
| 260 | {2199, nullptr, "GetRightsEnvironmentCountForDebug"}, | 260 | {2199, nullptr, "GetRightsEnvironmentCountForDebug"}, |
| @@ -366,7 +366,8 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 366 | LOG_DEBUG(Service_NS, "called with supported_languages={:08X}", supported_languages); | 366 | LOG_DEBUG(Service_NS, "called with supported_languages={:08X}", supported_languages); |
| 367 | 367 | ||
| 368 | // Get language code from settings | 368 | // Get language code from settings |
| 369 | const auto language_code = Set::GetLanguageCodeFromIndex(Settings::values.language_index); | 369 | const auto language_code = |
| 370 | Set::GetLanguageCodeFromIndex(Settings::values.language_index.GetValue()); | ||
| 370 | 371 | ||
| 371 | // Convert to application language, get priority list | 372 | // Convert to application language, get priority list |
| 372 | const auto application_language = ConvertToApplicationLanguage(language_code); | 373 | const auto application_language = ConvertToApplicationLanguage(language_code); |
| @@ -445,8 +446,8 @@ IApplicationVersionInterface::IApplicationVersionInterface() | |||
| 445 | 446 | ||
| 446 | IApplicationVersionInterface::~IApplicationVersionInterface() = default; | 447 | IApplicationVersionInterface::~IApplicationVersionInterface() = default; |
| 447 | 448 | ||
| 448 | IContentManagerInterface::IContentManagerInterface() | 449 | IContentManagementInterface::IContentManagementInterface() |
| 449 | : ServiceFramework{"IContentManagerInterface"} { | 450 | : ServiceFramework{"IContentManagementInterface"} { |
| 450 | // clang-format off | 451 | // clang-format off |
| 451 | static const FunctionInfo functions[] = { | 452 | static const FunctionInfo functions[] = { |
| 452 | {11, nullptr, "CalculateApplicationOccupiedSize"}, | 453 | {11, nullptr, "CalculateApplicationOccupiedSize"}, |
| @@ -463,7 +464,7 @@ IContentManagerInterface::IContentManagerInterface() | |||
| 463 | RegisterHandlers(functions); | 464 | RegisterHandlers(functions); |
| 464 | } | 465 | } |
| 465 | 466 | ||
| 466 | IContentManagerInterface::~IContentManagerInterface() = default; | 467 | IContentManagementInterface::~IContentManagementInterface() = default; |
| 467 | 468 | ||
| 468 | IDocumentInterface::IDocumentInterface() : ServiceFramework{"IDocumentInterface"} { | 469 | IDocumentInterface::IDocumentInterface() : ServiceFramework{"IDocumentInterface"} { |
| 469 | // clang-format off | 470 | // clang-format off |
| @@ -545,7 +546,7 @@ NS::NS(const char* name) : ServiceFramework{name} { | |||
| 545 | {7995, &NS::PushInterface<IAccountProxyInterface>, "GetAccountProxyInterface"}, | 546 | {7995, &NS::PushInterface<IAccountProxyInterface>, "GetAccountProxyInterface"}, |
| 546 | {7996, &NS::PushInterface<IApplicationManagerInterface>, "GetApplicationManagerInterface"}, | 547 | {7996, &NS::PushInterface<IApplicationManagerInterface>, "GetApplicationManagerInterface"}, |
| 547 | {7997, &NS::PushInterface<IDownloadTaskInterface>, "GetDownloadTaskInterface"}, | 548 | {7997, &NS::PushInterface<IDownloadTaskInterface>, "GetDownloadTaskInterface"}, |
| 548 | {7998, &NS::PushInterface<IContentManagerInterface>, "GetContentManagementInterface"}, | 549 | {7998, &NS::PushInterface<IContentManagementInterface>, "GetContentManagementInterface"}, |
| 549 | {7999, &NS::PushInterface<IDocumentInterface>, "GetDocumentInterface"}, | 550 | {7999, &NS::PushInterface<IDocumentInterface>, "GetDocumentInterface"}, |
| 550 | }; | 551 | }; |
| 551 | // clang-format on | 552 | // clang-format on |
| @@ -572,9 +573,9 @@ public: | |||
| 572 | {6, nullptr, "TerminateApplication"}, | 573 | {6, nullptr, "TerminateApplication"}, |
| 573 | {7, nullptr, "PrepareLaunchProgramFromHost"}, | 574 | {7, nullptr, "PrepareLaunchProgramFromHost"}, |
| 574 | {8, nullptr, "LaunchApplication"}, | 575 | {8, nullptr, "LaunchApplication"}, |
| 575 | {9, nullptr, "LaunchApplicationWithStorageId"}, | 576 | {9, nullptr, "LaunchApplicationWithStorageIdForDevelop"}, |
| 576 | {10, nullptr, "TerminateApplication2"}, | 577 | {10, nullptr, "IsSystemMemoryResourceLimitBoosted"}, |
| 577 | {11, nullptr, "GetRunningApplicationProcessId"}, | 578 | {11, nullptr, "GetRunningApplicationProcessIdForDevelop"}, |
| 578 | {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActive"}, | 579 | {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActive"}, |
| 579 | {13, nullptr, "CreateApplicationResourceForDevelop"}, | 580 | {13, nullptr, "CreateApplicationResourceForDevelop"}, |
| 580 | {14, nullptr, "IsPreomiaForDevelop"}, | 581 | {14, nullptr, "IsPreomiaForDevelop"}, |
| @@ -636,6 +637,10 @@ public: | |||
| 636 | {9, nullptr, "GetSystemUpdateNotificationEventForContentDelivery"}, | 637 | {9, nullptr, "GetSystemUpdateNotificationEventForContentDelivery"}, |
| 637 | {10, nullptr, "NotifySystemUpdateForContentDelivery"}, | 638 | {10, nullptr, "NotifySystemUpdateForContentDelivery"}, |
| 638 | {11, nullptr, "PrepareShutdown"}, | 639 | {11, nullptr, "PrepareShutdown"}, |
| 640 | {12, nullptr, "Unknown12"}, | ||
| 641 | {13, nullptr, "Unknown13"}, | ||
| 642 | {14, nullptr, "Unknown14"}, | ||
| 643 | {15, nullptr, "Unknown15"}, | ||
| 639 | {16, nullptr, "DestroySystemUpdateTask"}, | 644 | {16, nullptr, "DestroySystemUpdateTask"}, |
| 640 | {17, nullptr, "RequestSendSystemUpdate"}, | 645 | {17, nullptr, "RequestSendSystemUpdate"}, |
| 641 | {18, nullptr, "GetSendSystemUpdateProgress"}, | 646 | {18, nullptr, "GetSendSystemUpdateProgress"}, |
diff --git a/src/core/hle/service/ns/ns.h b/src/core/hle/service/ns/ns.h index 13a64ad88..c2554b878 100644 --- a/src/core/hle/service/ns/ns.h +++ b/src/core/hle/service/ns/ns.h | |||
| @@ -40,10 +40,10 @@ public: | |||
| 40 | ~IApplicationVersionInterface() override; | 40 | ~IApplicationVersionInterface() override; |
| 41 | }; | 41 | }; |
| 42 | 42 | ||
| 43 | class IContentManagerInterface final : public ServiceFramework<IContentManagerInterface> { | 43 | class IContentManagementInterface final : public ServiceFramework<IContentManagementInterface> { |
| 44 | public: | 44 | public: |
| 45 | explicit IContentManagerInterface(); | 45 | explicit IContentManagementInterface(); |
| 46 | ~IContentManagerInterface() override; | 46 | ~IContentManagementInterface() override; |
| 47 | }; | 47 | }; |
| 48 | 48 | ||
| 49 | class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { | 49 | class IDocumentInterface final : public ServiceFramework<IDocumentInterface> { |
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index 6efdf1606..40838a225 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -163,7 +163,7 @@ PL_U::PL_U(Core::System& system) | |||
| 163 | {5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"}, | 163 | {5, &PL_U::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"}, |
| 164 | {6, nullptr, "GetSharedFontInOrderOfPriorityForSystem"}, | 164 | {6, nullptr, "GetSharedFontInOrderOfPriorityForSystem"}, |
| 165 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, | 165 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, |
| 166 | {101, nullptr, "RequestApplicationFunctionAuthorizationForSystem"}, | 166 | {101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, |
| 167 | {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, | 167 | {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, |
| 168 | {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, | 168 | {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, |
| 169 | {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, | 169 | {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, |
diff --git a/src/core/hle/service/nvdrv/interface.cpp b/src/core/hle/service/nvdrv/interface.cpp index c8ea6c661..deaf0808b 100644 --- a/src/core/hle/service/nvdrv/interface.cpp +++ b/src/core/hle/service/nvdrv/interface.cpp | |||
| @@ -144,7 +144,7 @@ void NVDRV::QueryEvent(Kernel::HLERequestContext& ctx) { | |||
| 144 | } | 144 | } |
| 145 | } | 145 | } |
| 146 | 146 | ||
| 147 | void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { | 147 | void NVDRV::SetAruid(Kernel::HLERequestContext& ctx) { |
| 148 | IPC::RequestParser rp{ctx}; | 148 | IPC::RequestParser rp{ctx}; |
| 149 | pid = rp.Pop<u64>(); | 149 | pid = rp.Pop<u64>(); |
| 150 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid); | 150 | LOG_WARNING(Service_NVDRV, "(STUBBED) called, pid=0x{:X}", pid); |
| @@ -154,7 +154,7 @@ void NVDRV::SetClientPID(Kernel::HLERequestContext& ctx) { | |||
| 154 | rb.Push<u32>(0); | 154 | rb.Push<u32>(0); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | void NVDRV::FinishInitialize(Kernel::HLERequestContext& ctx) { | 157 | void NVDRV::SetGraphicsFirmwareMemoryMarginEnabled(Kernel::HLERequestContext& ctx) { |
| 158 | LOG_WARNING(Service_NVDRV, "(STUBBED) called"); | 158 | LOG_WARNING(Service_NVDRV, "(STUBBED) called"); |
| 159 | 159 | ||
| 160 | IPC::ResponseBuilder rb{ctx, 2}; | 160 | IPC::ResponseBuilder rb{ctx, 2}; |
| @@ -187,13 +187,14 @@ NVDRV::NVDRV(std::shared_ptr<Module> nvdrv, const char* name) | |||
| 187 | {4, &NVDRV::QueryEvent, "QueryEvent"}, | 187 | {4, &NVDRV::QueryEvent, "QueryEvent"}, |
| 188 | {5, nullptr, "MapSharedMem"}, | 188 | {5, nullptr, "MapSharedMem"}, |
| 189 | {6, &NVDRV::GetStatus, "GetStatus"}, | 189 | {6, &NVDRV::GetStatus, "GetStatus"}, |
| 190 | {7, nullptr, "ForceSetClientPID"}, | 190 | {7, nullptr, "SetAruidForTest"}, |
| 191 | {8, &NVDRV::SetClientPID, "SetClientPID"}, | 191 | {8, &NVDRV::SetAruid, "SetAruid"}, |
| 192 | {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, | 192 | {9, &NVDRV::DumpGraphicsMemoryInfo, "DumpGraphicsMemoryInfo"}, |
| 193 | {10, nullptr, "InitializeDevtools"}, | 193 | {10, nullptr, "InitializeDevtools"}, |
| 194 | {11, &NVDRV::Ioctl2, "Ioctl2"}, | 194 | {11, &NVDRV::Ioctl2, "Ioctl2"}, |
| 195 | {12, &NVDRV::Ioctl3, "Ioctl3"}, | 195 | {12, &NVDRV::Ioctl3, "Ioctl3"}, |
| 196 | {13, &NVDRV::FinishInitialize, "FinishInitialize"}, | 196 | {13, &NVDRV::SetGraphicsFirmwareMemoryMarginEnabled, |
| 197 | "SetGraphicsFirmwareMemoryMarginEnabled"}, | ||
| 197 | }; | 198 | }; |
| 198 | RegisterHandlers(functions); | 199 | RegisterHandlers(functions); |
| 199 | } | 200 | } |
diff --git a/src/core/hle/service/nvdrv/interface.h b/src/core/hle/service/nvdrv/interface.h index 9269ce00c..72e17a728 100644 --- a/src/core/hle/service/nvdrv/interface.h +++ b/src/core/hle/service/nvdrv/interface.h | |||
| @@ -29,8 +29,8 @@ private: | |||
| 29 | void Close(Kernel::HLERequestContext& ctx); | 29 | void Close(Kernel::HLERequestContext& ctx); |
| 30 | void Initialize(Kernel::HLERequestContext& ctx); | 30 | void Initialize(Kernel::HLERequestContext& ctx); |
| 31 | void QueryEvent(Kernel::HLERequestContext& ctx); | 31 | void QueryEvent(Kernel::HLERequestContext& ctx); |
| 32 | void SetClientPID(Kernel::HLERequestContext& ctx); | 32 | void SetAruid(Kernel::HLERequestContext& ctx); |
| 33 | void FinishInitialize(Kernel::HLERequestContext& ctx); | 33 | void SetGraphicsFirmwareMemoryMarginEnabled(Kernel::HLERequestContext& ctx); |
| 34 | void GetStatus(Kernel::HLERequestContext& ctx); | 34 | void GetStatus(Kernel::HLERequestContext& ctx); |
| 35 | void DumpGraphicsMemoryInfo(Kernel::HLERequestContext& ctx); | 35 | void DumpGraphicsMemoryInfo(Kernel::HLERequestContext& ctx); |
| 36 | void IoctlBase(Kernel::HLERequestContext& ctx, IoctlVersion version); | 36 | void IoctlBase(Kernel::HLERequestContext& ctx, IoctlVersion version); |
diff --git a/src/core/hle/service/nvdrv/nvmemp.cpp b/src/core/hle/service/nvdrv/nvmemp.cpp index b7b8b7a1b..73b37e805 100644 --- a/src/core/hle/service/nvdrv/nvmemp.cpp +++ b/src/core/hle/service/nvdrv/nvmemp.cpp | |||
| @@ -10,19 +10,19 @@ namespace Service::Nvidia { | |||
| 10 | 10 | ||
| 11 | NVMEMP::NVMEMP() : ServiceFramework("nvmemp") { | 11 | NVMEMP::NVMEMP() : ServiceFramework("nvmemp") { |
| 12 | static const FunctionInfo functions[] = { | 12 | static const FunctionInfo functions[] = { |
| 13 | {0, &NVMEMP::Cmd0, "Cmd0"}, | 13 | {0, &NVMEMP::Open, "Open"}, |
| 14 | {1, &NVMEMP::Cmd1, "Cmd1"}, | 14 | {1, &NVMEMP::GetAruid, "GetAruid"}, |
| 15 | }; | 15 | }; |
| 16 | RegisterHandlers(functions); | 16 | RegisterHandlers(functions); |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | NVMEMP::~NVMEMP() = default; | 19 | NVMEMP::~NVMEMP() = default; |
| 20 | 20 | ||
| 21 | void NVMEMP::Cmd0(Kernel::HLERequestContext& ctx) { | 21 | void NVMEMP::Open(Kernel::HLERequestContext& ctx) { |
| 22 | UNIMPLEMENTED(); | 22 | UNIMPLEMENTED(); |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void NVMEMP::Cmd1(Kernel::HLERequestContext& ctx) { | 25 | void NVMEMP::GetAruid(Kernel::HLERequestContext& ctx) { |
| 26 | UNIMPLEMENTED(); | 26 | UNIMPLEMENTED(); |
| 27 | } | 27 | } |
| 28 | 28 | ||
diff --git a/src/core/hle/service/nvdrv/nvmemp.h b/src/core/hle/service/nvdrv/nvmemp.h index 6eafb1346..c453ee4db 100644 --- a/src/core/hle/service/nvdrv/nvmemp.h +++ b/src/core/hle/service/nvdrv/nvmemp.h | |||
| @@ -14,8 +14,8 @@ public: | |||
| 14 | ~NVMEMP() override; | 14 | ~NVMEMP() override; |
| 15 | 15 | ||
| 16 | private: | 16 | private: |
| 17 | void Cmd0(Kernel::HLERequestContext& ctx); | 17 | void Open(Kernel::HLERequestContext& ctx); |
| 18 | void Cmd1(Kernel::HLERequestContext& ctx); | 18 | void GetAruid(Kernel::HLERequestContext& ctx); |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | } // namespace Service::Nvidia | 21 | } // namespace Service::Nvidia |
diff --git a/src/core/hle/service/pcie/pcie.cpp b/src/core/hle/service/pcie/pcie.cpp index 39cf05eba..c568a0adc 100644 --- a/src/core/hle/service/pcie/pcie.cpp +++ b/src/core/hle/service/pcie/pcie.cpp | |||
| @@ -36,6 +36,9 @@ public: | |||
| 36 | {18, nullptr, "ReleaseIrq"}, | 36 | {18, nullptr, "ReleaseIrq"}, |
| 37 | {19, nullptr, "SetIrqEnable"}, | 37 | {19, nullptr, "SetIrqEnable"}, |
| 38 | {20, nullptr, "SetAspmEnable"}, | 38 | {20, nullptr, "SetAspmEnable"}, |
| 39 | {21, nullptr, "SetResetUponResumeEnable"}, | ||
| 40 | {22, nullptr, "Unknown22"}, | ||
| 41 | {23, nullptr, "Unknown23"}, | ||
| 39 | }; | 42 | }; |
| 40 | // clang-format on | 43 | // clang-format on |
| 41 | 44 | ||
diff --git a/src/core/hle/service/pcv/pcv.cpp b/src/core/hle/service/pcv/pcv.cpp index d6891a659..8bfc0276e 100644 --- a/src/core/hle/service/pcv/pcv.cpp +++ b/src/core/hle/service/pcv/pcv.cpp | |||
| @@ -42,6 +42,9 @@ public: | |||
| 42 | {24, nullptr, "GetModuleStateTable"}, | 42 | {24, nullptr, "GetModuleStateTable"}, |
| 43 | {25, nullptr, "GetPowerDomainStateTable"}, | 43 | {25, nullptr, "GetPowerDomainStateTable"}, |
| 44 | {26, nullptr, "GetFuseInfo"}, | 44 | {26, nullptr, "GetFuseInfo"}, |
| 45 | {27, nullptr, "GetDramId"}, | ||
| 46 | {28, nullptr, "IsPoweredOn"}, | ||
| 47 | {29, nullptr, "GetVoltage"}, | ||
| 45 | }; | 48 | }; |
| 46 | // clang-format on | 49 | // clang-format on |
| 47 | 50 | ||
diff --git a/src/core/hle/service/pm/pm.cpp b/src/core/hle/service/pm/pm.cpp index 809eca0ab..f43122ad2 100644 --- a/src/core/hle/service/pm/pm.cpp +++ b/src/core/hle/service/pm/pm.cpp | |||
| @@ -78,13 +78,13 @@ public: | |||
| 78 | : ServiceFramework{"pm:dmnt"}, kernel(kernel) { | 78 | : ServiceFramework{"pm:dmnt"}, kernel(kernel) { |
| 79 | // clang-format off | 79 | // clang-format off |
| 80 | static const FunctionInfo functions[] = { | 80 | static const FunctionInfo functions[] = { |
| 81 | {0, nullptr, "GetDebugProcesses"}, | 81 | {0, nullptr, "GetJitDebugProcessIdList"}, |
| 82 | {1, nullptr, "StartDebugProcess"}, | 82 | {1, nullptr, "StartProcess"}, |
| 83 | {2, &DebugMonitor::GetTitlePid, "GetTitlePid"}, | 83 | {2, &DebugMonitor::GetProcessId, "GetProcessId"}, |
| 84 | {3, nullptr, "EnableDebugForTitleId"}, | 84 | {3, nullptr, "HookToCreateProcess"}, |
| 85 | {4, &DebugMonitor::GetApplicationPid, "GetApplicationPid"}, | 85 | {4, &DebugMonitor::GetApplicationProcessId, "GetApplicationProcessId"}, |
| 86 | {5, nullptr, "EnableDebugForApplication"}, | 86 | {5, nullptr, "HookToCreateApplicationProgress"}, |
| 87 | {6, nullptr, "DisableDebug"}, | 87 | {6, nullptr, "ClearHook"}, |
| 88 | }; | 88 | }; |
| 89 | // clang-format on | 89 | // clang-format on |
| 90 | 90 | ||
| @@ -92,7 +92,7 @@ public: | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | private: | 94 | private: |
| 95 | void GetTitlePid(Kernel::HLERequestContext& ctx) { | 95 | void GetProcessId(Kernel::HLERequestContext& ctx) { |
| 96 | IPC::RequestParser rp{ctx}; | 96 | IPC::RequestParser rp{ctx}; |
| 97 | const auto title_id = rp.PopRaw<u64>(); | 97 | const auto title_id = rp.PopRaw<u64>(); |
| 98 | 98 | ||
| @@ -114,7 +114,7 @@ private: | |||
| 114 | rb.Push((*process)->GetProcessID()); | 114 | rb.Push((*process)->GetProcessID()); |
| 115 | } | 115 | } |
| 116 | 116 | ||
| 117 | void GetApplicationPid(Kernel::HLERequestContext& ctx) { | 117 | void GetApplicationProcessId(Kernel::HLERequestContext& ctx) { |
| 118 | LOG_DEBUG(Service_PM, "called"); | 118 | LOG_DEBUG(Service_PM, "called"); |
| 119 | GetApplicationPidGeneric(ctx, kernel.GetProcessList()); | 119 | GetApplicationPidGeneric(ctx, kernel.GetProcessList()); |
| 120 | } | 120 | } |
| @@ -163,15 +163,15 @@ public: | |||
| 163 | : ServiceFramework{"pm:shell"}, kernel(kernel) { | 163 | : ServiceFramework{"pm:shell"}, kernel(kernel) { |
| 164 | // clang-format off | 164 | // clang-format off |
| 165 | static const FunctionInfo functions[] = { | 165 | static const FunctionInfo functions[] = { |
| 166 | {0, nullptr, "LaunchProcess"}, | 166 | {0, nullptr, "LaunchProgram"}, |
| 167 | {1, nullptr, "TerminateProcessByPid"}, | 167 | {1, nullptr, "TerminateProcess"}, |
| 168 | {2, nullptr, "TerminateProcessByTitleId"}, | 168 | {2, nullptr, "TerminateProgram"}, |
| 169 | {3, nullptr, "GetProcessEventWaiter"}, | 169 | {3, nullptr, "GetProcessEventHandle"}, |
| 170 | {4, nullptr, "GetProcessEventType"}, | 170 | {4, nullptr, "GetProcessEventInfo"}, |
| 171 | {5, nullptr, "NotifyBootFinished"}, | 171 | {5, nullptr, "NotifyBootFinished"}, |
| 172 | {6, &Shell::GetApplicationPid, "GetApplicationPid"}, | 172 | {6, &Shell::GetApplicationProcessIdForShell, "GetApplicationProcessIdForShell"}, |
| 173 | {7, nullptr, "BoostSystemMemoryResourceLimit"}, | 173 | {7, nullptr, "BoostSystemMemoryResourceLimit"}, |
| 174 | {8, nullptr, "EnableAdditionalSystemThreads"}, | 174 | {8, nullptr, "BoostApplicationThreadResourceLimit"}, |
| 175 | {9, nullptr, "GetBootFinishedEventHandle"}, | 175 | {9, nullptr, "GetBootFinishedEventHandle"}, |
| 176 | }; | 176 | }; |
| 177 | // clang-format on | 177 | // clang-format on |
| @@ -180,7 +180,7 @@ public: | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | private: | 182 | private: |
| 183 | void GetApplicationPid(Kernel::HLERequestContext& ctx) { | 183 | void GetApplicationProcessIdForShell(Kernel::HLERequestContext& ctx) { |
| 184 | LOG_DEBUG(Service_PM, "called"); | 184 | LOG_DEBUG(Service_PM, "called"); |
| 185 | GetApplicationPidGeneric(ctx, kernel.GetProcessList()); | 185 | GetApplicationPidGeneric(ctx, kernel.GetProcessList()); |
| 186 | } | 186 | } |
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 67833d9af..cde3312da 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp | |||
| @@ -42,6 +42,11 @@ public: | |||
| 42 | {40101, nullptr, "SetUserAgreementCheckEnabled"}, | 42 | {40101, nullptr, "SetUserAgreementCheckEnabled"}, |
| 43 | {50100, nullptr, "ReadAllApplicationReportFiles"}, | 43 | {50100, nullptr, "ReadAllApplicationReportFiles"}, |
| 44 | {90100, nullptr, "ReadAllReportFiles"}, | 44 | {90100, nullptr, "ReadAllReportFiles"}, |
| 45 | {90101, nullptr, "Unknown90101"}, | ||
| 46 | {90102, nullptr, "Unknown90102"}, | ||
| 47 | {90200, nullptr, "GetStatistics"}, | ||
| 48 | {90201, nullptr, "GetThroughputHistory"}, | ||
| 49 | {90300, nullptr, "GetLastUploadError"}, | ||
| 45 | }; | 50 | }; |
| 46 | // clang-format on | 51 | // clang-format on |
| 47 | 52 | ||
diff --git a/src/core/hle/service/psc/psc.cpp b/src/core/hle/service/psc/psc.cpp index 53ec6b031..99e1c9042 100644 --- a/src/core/hle/service/psc/psc.cpp +++ b/src/core/hle/service/psc/psc.cpp | |||
| @@ -24,6 +24,8 @@ public: | |||
| 24 | {4, nullptr, "Cancel"}, | 24 | {4, nullptr, "Cancel"}, |
| 25 | {5, nullptr, "PrintModuleInformation"}, | 25 | {5, nullptr, "PrintModuleInformation"}, |
| 26 | {6, nullptr, "GetModuleInformation"}, | 26 | {6, nullptr, "GetModuleInformation"}, |
| 27 | {10, nullptr, "Unknown10"}, | ||
| 28 | {11, nullptr, "Unknown11"}, | ||
| 27 | }; | 29 | }; |
| 28 | // clang-format on | 30 | // clang-format on |
| 29 | 31 | ||
diff --git a/src/core/hle/service/ptm/psm.cpp b/src/core/hle/service/ptm/psm.cpp index 12d154ecf..6d9e6bd09 100644 --- a/src/core/hle/service/ptm/psm.cpp +++ b/src/core/hle/service/ptm/psm.cpp | |||
| @@ -35,6 +35,7 @@ public: | |||
| 35 | {15, nullptr, "GetBatteryAgePercentage"}, | 35 | {15, nullptr, "GetBatteryAgePercentage"}, |
| 36 | {16, nullptr, "GetBatteryChargeInfoEvent"}, | 36 | {16, nullptr, "GetBatteryChargeInfoEvent"}, |
| 37 | {17, nullptr, "GetBatteryChargeInfoFields"}, | 37 | {17, nullptr, "GetBatteryChargeInfoFields"}, |
| 38 | {18, nullptr, "GetBatteryChargeCalibratedEvent"}, | ||
| 38 | }; | 39 | }; |
| 39 | // clang-format on | 40 | // clang-format on |
| 40 | 41 | ||
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index e5cfd2101..34fe2fd82 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -91,7 +91,7 @@ void GetAvailableLanguageCodesImpl(Kernel::HLERequestContext& ctx, std::size_t m | |||
| 91 | } | 91 | } |
| 92 | 92 | ||
| 93 | void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) { | 93 | void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) { |
| 94 | const auto language_code = available_language_codes[Settings::values.language_index]; | 94 | const auto language_code = available_language_codes[Settings::values.language_index.GetValue()]; |
| 95 | const auto key_code = | 95 | const auto key_code = |
| 96 | std::find_if(language_to_layout.cbegin(), language_to_layout.cend(), | 96 | std::find_if(language_to_layout.cbegin(), language_to_layout.cend(), |
| 97 | [=](const auto& element) { return element.first == language_code; }); | 97 | [=](const auto& element) { return element.first == language_code; }); |
| @@ -99,7 +99,7 @@ void GetKeyCodeMapImpl(Kernel::HLERequestContext& ctx) { | |||
| 99 | if (key_code == language_to_layout.cend()) { | 99 | if (key_code == language_to_layout.cend()) { |
| 100 | LOG_ERROR(Service_SET, | 100 | LOG_ERROR(Service_SET, |
| 101 | "Could not find keyboard layout for language index {}, defaulting to English us", | 101 | "Could not find keyboard layout for language index {}, defaulting to English us", |
| 102 | Settings::values.language_index); | 102 | Settings::values.language_index.GetValue()); |
| 103 | } else { | 103 | } else { |
| 104 | layout = key_code->second; | 104 | layout = key_code->second; |
| 105 | } | 105 | } |
| @@ -163,11 +163,11 @@ void SET::GetQuestFlag(Kernel::HLERequestContext& ctx) { | |||
| 163 | } | 163 | } |
| 164 | 164 | ||
| 165 | void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) { | 165 | void SET::GetLanguageCode(Kernel::HLERequestContext& ctx) { |
| 166 | LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index); | 166 | LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue()); |
| 167 | 167 | ||
| 168 | IPC::ResponseBuilder rb{ctx, 4}; | 168 | IPC::ResponseBuilder rb{ctx, 4}; |
| 169 | rb.Push(RESULT_SUCCESS); | 169 | rb.Push(RESULT_SUCCESS); |
| 170 | rb.PushEnum(available_language_codes[Settings::values.language_index]); | 170 | rb.PushEnum(available_language_codes[Settings::values.language_index.GetValue()]); |
| 171 | } | 171 | } |
| 172 | 172 | ||
| 173 | void SET::GetRegionCode(Kernel::HLERequestContext& ctx) { | 173 | void SET::GetRegionCode(Kernel::HLERequestContext& ctx) { |
| @@ -175,7 +175,7 @@ void SET::GetRegionCode(Kernel::HLERequestContext& ctx) { | |||
| 175 | 175 | ||
| 176 | IPC::ResponseBuilder rb{ctx, 3}; | 176 | IPC::ResponseBuilder rb{ctx, 3}; |
| 177 | rb.Push(RESULT_SUCCESS); | 177 | rb.Push(RESULT_SUCCESS); |
| 178 | rb.Push(Settings::values.region_index); | 178 | rb.Push(Settings::values.region_index.GetValue()); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | void SET::GetKeyCodeMap(Kernel::HLERequestContext& ctx) { | 181 | void SET::GetKeyCodeMap(Kernel::HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/sm/controller.cpp b/src/core/hle/service/sm/controller.cpp index 9cca84b31..972aaa6d9 100644 --- a/src/core/hle/service/sm/controller.cpp +++ b/src/core/hle/service/sm/controller.cpp | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | 12 | ||
| 13 | namespace Service::SM { | 13 | namespace Service::SM { |
| 14 | 14 | ||
| 15 | void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { | 15 | void Controller::ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx) { |
| 16 | ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain"); | 16 | ASSERT_MSG(ctx.Session()->IsSession(), "Session is already a domain"); |
| 17 | LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetObjectId()); | 17 | LOG_DEBUG(Service, "called, server_session={}", ctx.Session()->GetObjectId()); |
| 18 | ctx.Session()->ConvertToDomain(); | 18 | ctx.Session()->ConvertToDomain(); |
| @@ -22,7 +22,7 @@ void Controller::ConvertSessionToDomain(Kernel::HLERequestContext& ctx) { | |||
| 22 | rb.Push<u32>(1); // Converted sessions start with 1 request handler | 22 | rb.Push<u32>(1); // Converted sessions start with 1 request handler |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { | 25 | void Controller::CloneCurrentObject(Kernel::HLERequestContext& ctx) { |
| 26 | // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong | 26 | // TODO(bunnei): This is just creating a new handle to the same Session. I assume this is wrong |
| 27 | // and that we probably want to actually make an entirely new Session, but we still need to | 27 | // and that we probably want to actually make an entirely new Session, but we still need to |
| 28 | // verify this on hardware. | 28 | // verify this on hardware. |
| @@ -33,10 +33,10 @@ void Controller::DuplicateSession(Kernel::HLERequestContext& ctx) { | |||
| 33 | rb.PushMoveObjects(ctx.Session()->GetParent()->Client()); | 33 | rb.PushMoveObjects(ctx.Session()->GetParent()->Client()); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | void Controller::DuplicateSessionEx(Kernel::HLERequestContext& ctx) { | 36 | void Controller::CloneCurrentObjectEx(Kernel::HLERequestContext& ctx) { |
| 37 | LOG_WARNING(Service, "(STUBBED) called, using DuplicateSession"); | 37 | LOG_WARNING(Service, "(STUBBED) called, using CloneCurrentObject"); |
| 38 | 38 | ||
| 39 | DuplicateSession(ctx); | 39 | CloneCurrentObject(ctx); |
| 40 | } | 40 | } |
| 41 | 41 | ||
| 42 | void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { | 42 | void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { |
| @@ -47,13 +47,14 @@ void Controller::QueryPointerBufferSize(Kernel::HLERequestContext& ctx) { | |||
| 47 | rb.Push<u16>(0x1000); | 47 | rb.Push<u16>(0x1000); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | // https://switchbrew.org/wiki/IPC_Marshalling | ||
| 50 | Controller::Controller() : ServiceFramework("IpcController") { | 51 | Controller::Controller() : ServiceFramework("IpcController") { |
| 51 | static const FunctionInfo functions[] = { | 52 | static const FunctionInfo functions[] = { |
| 52 | {0x00000000, &Controller::ConvertSessionToDomain, "ConvertSessionToDomain"}, | 53 | {0, &Controller::ConvertCurrentObjectToDomain, "ConvertCurrentObjectToDomain"}, |
| 53 | {0x00000001, nullptr, "ConvertDomainToSession"}, | 54 | {1, nullptr, "CopyFromCurrentDomain"}, |
| 54 | {0x00000002, &Controller::DuplicateSession, "DuplicateSession"}, | 55 | {2, &Controller::CloneCurrentObject, "CloneCurrentObject"}, |
| 55 | {0x00000003, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, | 56 | {3, &Controller::QueryPointerBufferSize, "QueryPointerBufferSize"}, |
| 56 | {0x00000004, &Controller::DuplicateSessionEx, "DuplicateSessionEx"}, | 57 | {4, &Controller::CloneCurrentObjectEx, "CloneCurrentObjectEx"}, |
| 57 | }; | 58 | }; |
| 58 | RegisterHandlers(functions); | 59 | RegisterHandlers(functions); |
| 59 | } | 60 | } |
diff --git a/src/core/hle/service/sm/controller.h b/src/core/hle/service/sm/controller.h index dc66c9e37..180c6da50 100644 --- a/src/core/hle/service/sm/controller.h +++ b/src/core/hle/service/sm/controller.h | |||
| @@ -14,9 +14,9 @@ public: | |||
| 14 | ~Controller() override; | 14 | ~Controller() override; |
| 15 | 15 | ||
| 16 | private: | 16 | private: |
| 17 | void ConvertSessionToDomain(Kernel::HLERequestContext& ctx); | 17 | void ConvertCurrentObjectToDomain(Kernel::HLERequestContext& ctx); |
| 18 | void DuplicateSession(Kernel::HLERequestContext& ctx); | 18 | void CloneCurrentObject(Kernel::HLERequestContext& ctx); |
| 19 | void DuplicateSessionEx(Kernel::HLERequestContext& ctx); | 19 | void CloneCurrentObjectEx(Kernel::HLERequestContext& ctx); |
| 20 | void QueryPointerBufferSize(Kernel::HLERequestContext& ctx); | 20 | void QueryPointerBufferSize(Kernel::HLERequestContext& ctx); |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index dc70fd6fe..40d781124 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp | |||
| @@ -14,6 +14,7 @@ NSD::NSD(const char* name) : ServiceFramework(name) { | |||
| 14 | {12, nullptr, "GetDeviceId"}, | 14 | {12, nullptr, "GetDeviceId"}, |
| 15 | {13, nullptr, "DeleteSettings"}, | 15 | {13, nullptr, "DeleteSettings"}, |
| 16 | {14, nullptr, "ImportSettings"}, | 16 | {14, nullptr, "ImportSettings"}, |
| 17 | {15, nullptr, "SetChangeEnvironmentIdentifierDisabled"}, | ||
| 17 | {20, nullptr, "Resolve"}, | 18 | {20, nullptr, "Resolve"}, |
| 18 | {21, nullptr, "ResolveEx"}, | 19 | {21, nullptr, "ResolveEx"}, |
| 19 | {30, nullptr, "GetNasServiceSetting"}, | 20 | {30, nullptr, "GetNasServiceSetting"}, |
| @@ -28,6 +29,11 @@ NSD::NSD(const char* name) : ServiceFramework(name) { | |||
| 28 | {60, nullptr, "ReadSaveDataFromFsForTest"}, | 29 | {60, nullptr, "ReadSaveDataFromFsForTest"}, |
| 29 | {61, nullptr, "WriteSaveDataToFsForTest"}, | 30 | {61, nullptr, "WriteSaveDataToFsForTest"}, |
| 30 | {62, nullptr, "DeleteSaveDataOfFsForTest"}, | 31 | {62, nullptr, "DeleteSaveDataOfFsForTest"}, |
| 32 | {63, nullptr, "IsChangeEnvironmentIdentifierDisabled"}, | ||
| 33 | {64, nullptr, "SetWithoutDomainExchangeFqdns"}, | ||
| 34 | {100, nullptr, "GetApplicationServerEnvironmentType"}, | ||
| 35 | {101, nullptr, "SetApplicationServerEnvironmentType"}, | ||
| 36 | {102, nullptr, "DeleteApplicationServerEnvironmentType"}, | ||
| 31 | }; | 37 | }; |
| 32 | // clang-format on | 38 | // clang-format on |
| 33 | 39 | ||
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index 852e71e4b..e3017451f 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::Sockets { | 8 | namespace Service::Sockets { |
| 9 | 9 | ||
| 10 | void SFDNSRES::GetAddrInfo(Kernel::HLERequestContext& ctx) { | 10 | void SFDNSRES::GetAddrInfoRequest(Kernel::HLERequestContext& ctx) { |
| 11 | struct Parameters { | 11 | struct Parameters { |
| 12 | u8 use_nsd_resolve; | 12 | u8 use_nsd_resolve; |
| 13 | u32 unknown; | 13 | u32 unknown; |
| @@ -29,15 +29,20 @@ SFDNSRES::SFDNSRES() : ServiceFramework("sfdnsres") { | |||
| 29 | static const FunctionInfo functions[] = { | 29 | static const FunctionInfo functions[] = { |
| 30 | {0, nullptr, "SetDnsAddressesPrivate"}, | 30 | {0, nullptr, "SetDnsAddressesPrivate"}, |
| 31 | {1, nullptr, "GetDnsAddressPrivate"}, | 31 | {1, nullptr, "GetDnsAddressPrivate"}, |
| 32 | {2, nullptr, "GetHostByName"}, | 32 | {2, nullptr, "GetHostByNameRequest"}, |
| 33 | {3, nullptr, "GetHostByAddr"}, | 33 | {3, nullptr, "GetHostByAddrRequest"}, |
| 34 | {4, nullptr, "GetHostStringError"}, | 34 | {4, nullptr, "GetHostStringErrorRequest"}, |
| 35 | {5, nullptr, "GetGaiStringError"}, | 35 | {5, nullptr, "GetGaiStringErrorRequest"}, |
| 36 | {6, &SFDNSRES::GetAddrInfo, "GetAddrInfo"}, | 36 | {6, &SFDNSRES::GetAddrInfoRequest, "GetAddrInfoRequest"}, |
| 37 | {7, nullptr, "GetNameInfo"}, | 37 | {7, nullptr, "GetNameInfoRequest"}, |
| 38 | {8, nullptr, "RequestCancelHandle"}, | 38 | {8, nullptr, "RequestCancelHandleRequest"}, |
| 39 | {9, nullptr, "CancelSocketCall"}, | 39 | {9, nullptr, "CancelRequest"}, |
| 40 | {11, nullptr, "ClearDnsIpServerAddressArray"}, | 40 | {10, nullptr, "GetHostByNameRequestWithOptions"}, |
| 41 | {11, nullptr, "GetHostByAddrRequestWithOptions"}, | ||
| 42 | {12, nullptr, "GetAddrInfoRequestWithOptions"}, | ||
| 43 | {13, nullptr, "GetNameInfoRequestWithOptions"}, | ||
| 44 | {14, nullptr, "ResolverSetOptionRequest"}, | ||
| 45 | {15, nullptr, "ResolverGetOptionRequest"}, | ||
| 41 | }; | 46 | }; |
| 42 | RegisterHandlers(functions); | 47 | RegisterHandlers(functions); |
| 43 | } | 48 | } |
diff --git a/src/core/hle/service/sockets/sfdnsres.h b/src/core/hle/service/sockets/sfdnsres.h index eda432903..acd3647bb 100644 --- a/src/core/hle/service/sockets/sfdnsres.h +++ b/src/core/hle/service/sockets/sfdnsres.h | |||
| @@ -15,7 +15,7 @@ public: | |||
| 15 | ~SFDNSRES() override; | 15 | ~SFDNSRES() override; |
| 16 | 16 | ||
| 17 | private: | 17 | private: |
| 18 | void GetAddrInfo(Kernel::HLERequestContext& ctx); | 18 | void GetAddrInfoRequest(Kernel::HLERequestContext& ctx); |
| 19 | }; | 19 | }; |
| 20 | 20 | ||
| 21 | } // namespace Service::Sockets | 21 | } // namespace Service::Sockets |
diff --git a/src/core/hle/service/spl/module.cpp b/src/core/hle/service/spl/module.cpp index e724d4ab8..865ed3b91 100644 --- a/src/core/hle/service/spl/module.cpp +++ b/src/core/hle/service/spl/module.cpp | |||
| @@ -19,7 +19,7 @@ namespace Service::SPL { | |||
| 19 | 19 | ||
| 20 | Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) | 20 | Module::Interface::Interface(std::shared_ptr<Module> module, const char* name) |
| 21 | : ServiceFramework(name), module(std::move(module)), | 21 | : ServiceFramework(name), module(std::move(module)), |
| 22 | rng(Settings::values.rng_seed.value_or(std::time(nullptr))) {} | 22 | rng(Settings::values.rng_seed.GetValue().value_or(std::time(nullptr))) {} |
| 23 | 23 | ||
| 24 | Module::Interface::~Interface() = default; | 24 | Module::Interface::~Interface() = default; |
| 25 | 25 | ||
diff --git a/src/core/hle/service/spl/spl.cpp b/src/core/hle/service/spl/spl.cpp index 70cb41905..773551464 100644 --- a/src/core/hle/service/spl/spl.cpp +++ b/src/core/hle/service/spl/spl.cpp | |||
| @@ -9,35 +9,36 @@ namespace Service::SPL { | |||
| 9 | SPL::SPL(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "spl:") { | 9 | SPL::SPL(std::shared_ptr<Module> module) : Module::Interface(std::move(module), "spl:") { |
| 10 | static const FunctionInfo functions[] = { | 10 | static const FunctionInfo functions[] = { |
| 11 | {0, nullptr, "GetConfig"}, | 11 | {0, nullptr, "GetConfig"}, |
| 12 | {1, nullptr, "UserExpMod"}, | 12 | {1, nullptr, "ModularExponentiate"}, |
| 13 | {2, nullptr, "GenerateAesKek"}, | 13 | {2, nullptr, "GenerateAesKek"}, |
| 14 | {3, nullptr, "LoadAesKey"}, | 14 | {3, nullptr, "LoadAesKey"}, |
| 15 | {4, nullptr, "GenerateAesKey"}, | 15 | {4, nullptr, "GenerateAesKey"}, |
| 16 | {5, nullptr, "SetConfig"}, | 16 | {5, nullptr, "SetConfig"}, |
| 17 | {7, &SPL::GetRandomBytes, "GetRandomBytes"}, | 17 | {7, &SPL::GetRandomBytes, "GetRandomBytes"}, |
| 18 | {9, nullptr, "LoadSecureExpModKey"}, | 18 | {9, nullptr, "ImportLotusKey"}, |
| 19 | {10, nullptr, "SecureExpMod"}, | 19 | {10, nullptr, "DecryptLotusMessage"}, |
| 20 | {11, nullptr, "IsDevelopment"}, | 20 | {11, nullptr, "IsDevelopment"}, |
| 21 | {12, nullptr, "GenerateSpecificAesKey"}, | 21 | {12, nullptr, "GenerateSpecificAesKey"}, |
| 22 | {13, nullptr, "DecryptPrivk"}, | 22 | {13, nullptr, "DecryptDeviceUniqueData"}, |
| 23 | {14, nullptr, "DecryptAesKey"}, | 23 | {14, nullptr, "DecryptAesKey"}, |
| 24 | {15, nullptr, "DecryptAesCtr"}, | 24 | {15, nullptr, "CryptAesCtr"}, |
| 25 | {16, nullptr, "ComputeCmac"}, | 25 | {16, nullptr, "ComputeCmac"}, |
| 26 | {17, nullptr, "LoadRsaOaepKey"}, | 26 | {17, nullptr, "ImportEsKey"}, |
| 27 | {18, nullptr, "UnwrapRsaOaepWrappedTitleKey"}, | 27 | {18, nullptr, "UnwrapTitleKey"}, |
| 28 | {19, nullptr, "LoadTitleKey"}, | 28 | {19, nullptr, "LoadTitleKey"}, |
| 29 | {20, nullptr, "UnwrapAesWrappedTitleKey"}, | 29 | {20, nullptr, "PrepareEsCommonKey"}, |
| 30 | {21, nullptr, "LockAesEngine"}, | 30 | {21, nullptr, "AllocateAesKeyslot"}, |
| 31 | {22, nullptr, "UnlockAesEngine"}, | 31 | {22, nullptr, "DeallocateAesKeySlot"}, |
| 32 | {23, nullptr, "GetSplWaitEvent"}, | 32 | {23, nullptr, "GetAesKeyslotAvailableEvent"}, |
| 33 | {24, nullptr, "SetSharedData"}, | 33 | {24, nullptr, "SetBootReason"}, |
| 34 | {25, nullptr, "GetSharedData"}, | 34 | {25, nullptr, "GetBootReason"}, |
| 35 | {26, nullptr, "ImportSslRsaKey"}, | 35 | {26, nullptr, "DecryptAndStoreSslClientCertKey"}, |
| 36 | {27, nullptr, "SecureExpModWithSslKey"}, | 36 | {27, nullptr, "ModularExponentiateWithSslClientCertKey"}, |
| 37 | {28, nullptr, "ImportEsRsaKey"}, | 37 | {28, nullptr, "DecryptAndStoreDrmDeviceCertKey"}, |
| 38 | {29, nullptr, "SecureExpModWithEsKey"}, | 38 | {29, nullptr, "ModularExponentiateWithDrmDeviceCertKey"}, |
| 39 | {30, nullptr, "EncryptManuRsaKeyForImport"}, | 39 | {30, nullptr, "ReencryptDeviceUniqueData "}, |
| 40 | {31, nullptr, "GetPackage2Hash"}, | 40 | {31, nullptr, "PrepareEsArchiveKey"}, // This is also GetPackage2Hash? |
| 41 | {32, nullptr, "LoadPreparedAesKey"}, | ||
| 41 | }; | 42 | }; |
| 42 | RegisterHandlers(functions); | 43 | RegisterHandlers(functions); |
| 43 | } | 44 | } |
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 4cf58a61a..13e4b3818 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp | |||
| @@ -90,6 +90,13 @@ public: | |||
| 90 | : ServiceFramework("ISteadyClock"), clock_core{clock_core}, system{system} { | 90 | : ServiceFramework("ISteadyClock"), clock_core{clock_core}, system{system} { |
| 91 | static const FunctionInfo functions[] = { | 91 | static const FunctionInfo functions[] = { |
| 92 | {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"}, | 92 | {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"}, |
| 93 | {2, nullptr, "GetTestOffset"}, | ||
| 94 | {3, nullptr, "SetTestOffset"}, | ||
| 95 | {100, nullptr, "GetRtcValue"}, | ||
| 96 | {101, nullptr, "IsRtcResetDetected"}, | ||
| 97 | {102, nullptr, "GetSetupResultValue"}, | ||
| 98 | {200, nullptr, "GetInternalOffset"}, | ||
| 99 | {201, nullptr, "SetInternalOffset"}, | ||
| 93 | }; | 100 | }; |
| 94 | RegisterHandlers(functions); | 101 | RegisterHandlers(functions); |
| 95 | } | 102 | } |
diff --git a/src/core/hle/service/usb/usb.cpp b/src/core/hle/service/usb/usb.cpp index 58a9845fc..d033f8603 100644 --- a/src/core/hle/service/usb/usb.cpp +++ b/src/core/hle/service/usb/usb.cpp | |||
| @@ -20,7 +20,7 @@ public: | |||
| 20 | static const FunctionInfo functions[] = { | 20 | static const FunctionInfo functions[] = { |
| 21 | {0, nullptr, "GetDsEndpoint"}, | 21 | {0, nullptr, "GetDsEndpoint"}, |
| 22 | {1, nullptr, "GetSetupEvent"}, | 22 | {1, nullptr, "GetSetupEvent"}, |
| 23 | {2, nullptr, "Unknown"}, | 23 | {2, nullptr, "Unknown2"}, |
| 24 | {3, nullptr, "EnableInterface"}, | 24 | {3, nullptr, "EnableInterface"}, |
| 25 | {4, nullptr, "DisableInterface"}, | 25 | {4, nullptr, "DisableInterface"}, |
| 26 | {5, nullptr, "CtrlInPostBufferAsync"}, | 26 | {5, nullptr, "CtrlInPostBufferAsync"}, |
| @@ -55,6 +55,7 @@ public: | |||
| 55 | {9, nullptr, "SetBinaryObjectStore"}, | 55 | {9, nullptr, "SetBinaryObjectStore"}, |
| 56 | {10, nullptr, "Enable"}, | 56 | {10, nullptr, "Enable"}, |
| 57 | {11, nullptr, "Disable"}, | 57 | {11, nullptr, "Disable"}, |
| 58 | {12, nullptr, "Unknown12"}, | ||
| 58 | }; | 59 | }; |
| 59 | // clang-format on | 60 | // clang-format on |
| 60 | 61 | ||
| @@ -69,13 +70,13 @@ public: | |||
| 69 | static const FunctionInfo functions[] = { | 70 | static const FunctionInfo functions[] = { |
| 70 | {0, nullptr, "Open"}, | 71 | {0, nullptr, "Open"}, |
| 71 | {1, nullptr, "Close"}, | 72 | {1, nullptr, "Close"}, |
| 72 | {2, nullptr, "Unknown1"}, | 73 | {2, nullptr, "Unknown2"}, |
| 73 | {3, nullptr, "Populate"}, | 74 | {3, nullptr, "Populate"}, |
| 74 | {4, nullptr, "PostBufferAsync"}, | 75 | {4, nullptr, "PostBufferAsync"}, |
| 75 | {5, nullptr, "GetXferReport"}, | 76 | {5, nullptr, "GetXferReport"}, |
| 76 | {6, nullptr, "PostBufferMultiAsync"}, | 77 | {6, nullptr, "PostBufferMultiAsync"}, |
| 77 | {7, nullptr, "Unknown3"}, | 78 | {7, nullptr, "Unknown7"}, |
| 78 | {8, nullptr, "Unknown4"}, | 79 | {8, nullptr, "Unknown8"}, |
| 79 | }; | 80 | }; |
| 80 | // clang-format on | 81 | // clang-format on |
| 81 | 82 | ||
| @@ -88,13 +89,13 @@ public: | |||
| 88 | explicit IClientIfSession() : ServiceFramework{"IClientIfSession"} { | 89 | explicit IClientIfSession() : ServiceFramework{"IClientIfSession"} { |
| 89 | // clang-format off | 90 | // clang-format off |
| 90 | static const FunctionInfo functions[] = { | 91 | static const FunctionInfo functions[] = { |
| 91 | {0, nullptr, "Unknown1"}, | 92 | {0, nullptr, "Unknown0"}, |
| 92 | {1, nullptr, "SetInterface"}, | 93 | {1, nullptr, "SetInterface"}, |
| 93 | {2, nullptr, "GetInterface"}, | 94 | {2, nullptr, "GetInterface"}, |
| 94 | {3, nullptr, "GetAlternateInterface"}, | 95 | {3, nullptr, "GetAlternateInterface"}, |
| 95 | {4, nullptr, "GetCurrentFrame"}, | 96 | {4, nullptr, "GetCurrentFrame"}, |
| 96 | {5, nullptr, "CtrlXferAsync"}, | 97 | {5, nullptr, "CtrlXferAsync"}, |
| 97 | {6, nullptr, "Unknown2"}, | 98 | {6, nullptr, "Unknown6"}, |
| 98 | {7, nullptr, "GetCtrlXferReport"}, | 99 | {7, nullptr, "GetCtrlXferReport"}, |
| 99 | {8, nullptr, "ResetDevice"}, | 100 | {8, nullptr, "ResetDevice"}, |
| 100 | {9, nullptr, "OpenUsbEp"}, | 101 | {9, nullptr, "OpenUsbEp"}, |
| @@ -118,7 +119,7 @@ public: | |||
| 118 | {5, nullptr, "DestroyInterfaceAvailableEvent"}, | 119 | {5, nullptr, "DestroyInterfaceAvailableEvent"}, |
| 119 | {6, nullptr, "GetInterfaceStateChangeEvent"}, | 120 | {6, nullptr, "GetInterfaceStateChangeEvent"}, |
| 120 | {7, nullptr, "AcquireUsbIf"}, | 121 | {7, nullptr, "AcquireUsbIf"}, |
| 121 | {8, nullptr, "Unknown1"}, | 122 | {8, nullptr, "Unknown8"}, |
| 122 | }; | 123 | }; |
| 123 | // clang-format on | 124 | // clang-format on |
| 124 | 125 | ||
| @@ -179,8 +180,8 @@ public: | |||
| 179 | {4, nullptr, "GetFwRevision"}, | 180 | {4, nullptr, "GetFwRevision"}, |
| 180 | {5, nullptr, "GetManufacturerId"}, | 181 | {5, nullptr, "GetManufacturerId"}, |
| 181 | {6, nullptr, "GetDeviceId"}, | 182 | {6, nullptr, "GetDeviceId"}, |
| 182 | {7, nullptr, "Unknown1"}, | 183 | {7, nullptr, "Unknown7"}, |
| 183 | {8, nullptr, "Unknown2"}, | 184 | {8, nullptr, "Unknown8"}, |
| 184 | }; | 185 | }; |
| 185 | // clang-format on | 186 | // clang-format on |
| 186 | 187 | ||
| @@ -215,12 +216,12 @@ public: | |||
| 215 | explicit USB_PM() : ServiceFramework{"usb:pm"} { | 216 | explicit USB_PM() : ServiceFramework{"usb:pm"} { |
| 216 | // clang-format off | 217 | // clang-format off |
| 217 | static const FunctionInfo functions[] = { | 218 | static const FunctionInfo functions[] = { |
| 218 | {0, nullptr, "Unknown1"}, | 219 | {0, nullptr, "Unknown0"}, |
| 219 | {1, nullptr, "Unknown2"}, | 220 | {1, nullptr, "Unknown1"}, |
| 220 | {2, nullptr, "Unknown3"}, | 221 | {2, nullptr, "Unknown2"}, |
| 221 | {3, nullptr, "Unknown4"}, | 222 | {3, nullptr, "Unknown3"}, |
| 222 | {4, nullptr, "Unknown5"}, | 223 | {4, nullptr, "Unknown4"}, |
| 223 | {5, nullptr, "Unknown6"}, | 224 | {5, nullptr, "Unknown5"}, |
| 224 | }; | 225 | }; |
| 225 | // clang-format on | 226 | // clang-format on |
| 226 | 227 | ||
diff --git a/src/core/hle/service/vi/vi.cpp b/src/core/hle/service/vi/vi.cpp index 157092074..ea7b4ae13 100644 --- a/src/core/hle/service/vi/vi.cpp +++ b/src/core/hle/service/vi/vi.cpp | |||
| @@ -519,9 +519,9 @@ private: | |||
| 519 | IGBPConnectRequestParcel request{ctx.ReadBuffer()}; | 519 | IGBPConnectRequestParcel request{ctx.ReadBuffer()}; |
| 520 | IGBPConnectResponseParcel response{ | 520 | IGBPConnectResponseParcel response{ |
| 521 | static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedWidth) * | 521 | static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedWidth) * |
| 522 | Settings::values.resolution_factor), | 522 | Settings::values.resolution_factor.GetValue()), |
| 523 | static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) * | 523 | static_cast<u32>(static_cast<u32>(DisplayResolution::UndockedHeight) * |
| 524 | Settings::values.resolution_factor)}; | 524 | Settings::values.resolution_factor.GetValue())}; |
| 525 | ctx.WriteBuffer(response.Serialize()); | 525 | ctx.WriteBuffer(response.Serialize()); |
| 526 | break; | 526 | break; |
| 527 | } | 527 | } |
| @@ -700,6 +700,7 @@ public: | |||
| 700 | {3215, nullptr, "SetDisplayGamma"}, | 700 | {3215, nullptr, "SetDisplayGamma"}, |
| 701 | {3216, nullptr, "GetDisplayCmuLuma"}, | 701 | {3216, nullptr, "GetDisplayCmuLuma"}, |
| 702 | {3217, nullptr, "SetDisplayCmuLuma"}, | 702 | {3217, nullptr, "SetDisplayCmuLuma"}, |
| 703 | {6013, nullptr, "GetLayerPresentationSubmissionTimestamps"}, | ||
| 703 | {8225, nullptr, "GetSharedBufferMemoryHandleId"}, | 704 | {8225, nullptr, "GetSharedBufferMemoryHandleId"}, |
| 704 | {8250, nullptr, "OpenSharedLayer"}, | 705 | {8250, nullptr, "OpenSharedLayer"}, |
| 705 | {8251, nullptr, "CloseSharedLayer"}, | 706 | {8251, nullptr, "CloseSharedLayer"}, |
| @@ -748,14 +749,14 @@ private: | |||
| 748 | 749 | ||
| 749 | if (Settings::values.use_docked_mode) { | 750 | if (Settings::values.use_docked_mode) { |
| 750 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * | 751 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedWidth) * |
| 751 | static_cast<u32>(Settings::values.resolution_factor)); | 752 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 752 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) * | 753 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::DockedHeight) * |
| 753 | static_cast<u32>(Settings::values.resolution_factor)); | 754 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 754 | } else { | 755 | } else { |
| 755 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * | 756 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedWidth) * |
| 756 | static_cast<u32>(Settings::values.resolution_factor)); | 757 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 757 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) * | 758 | rb.Push(static_cast<u32>(Service::VI::DisplayResolution::UndockedHeight) * |
| 758 | static_cast<u32>(Settings::values.resolution_factor)); | 759 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 759 | } | 760 | } |
| 760 | 761 | ||
| 761 | rb.PushRaw<float>(60.0f); // This wouldn't seem to be correct for 30 fps games. | 762 | rb.PushRaw<float>(60.0f); // This wouldn't seem to be correct for 30 fps games. |
| @@ -785,6 +786,7 @@ public: | |||
| 785 | {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, | 786 | {2300, nullptr, "AcquireLayerTexturePresentingEvent"}, |
| 786 | {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, | 787 | {2301, nullptr, "ReleaseLayerTexturePresentingEvent"}, |
| 787 | {2302, nullptr, "GetDisplayHotplugEvent"}, | 788 | {2302, nullptr, "GetDisplayHotplugEvent"}, |
| 789 | {2303, nullptr, "GetDisplayModeChangedEvent"}, | ||
| 788 | {2402, nullptr, "GetDisplayHotplugState"}, | 790 | {2402, nullptr, "GetDisplayHotplugState"}, |
| 789 | {2501, nullptr, "GetCompositorErrorInfo"}, | 791 | {2501, nullptr, "GetCompositorErrorInfo"}, |
| 790 | {2601, nullptr, "GetDisplayErrorEvent"}, | 792 | {2601, nullptr, "GetDisplayErrorEvent"}, |
| @@ -1029,9 +1031,9 @@ private: | |||
| 1029 | // between docked and undocked dimensions. We take the liberty of applying | 1031 | // between docked and undocked dimensions. We take the liberty of applying |
| 1030 | // the resolution scaling factor here. | 1032 | // the resolution scaling factor here. |
| 1031 | rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) * | 1033 | rb.Push(static_cast<u64>(DisplayResolution::UndockedWidth) * |
| 1032 | static_cast<u32>(Settings::values.resolution_factor)); | 1034 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 1033 | rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) * | 1035 | rb.Push(static_cast<u64>(DisplayResolution::UndockedHeight) * |
| 1034 | static_cast<u32>(Settings::values.resolution_factor)); | 1036 | static_cast<u32>(Settings::values.resolution_factor.GetValue())); |
| 1035 | } | 1037 | } |
| 1036 | 1038 | ||
| 1037 | void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { | 1039 | void SetLayerScalingMode(Kernel::HLERequestContext& ctx) { |
| @@ -1064,8 +1066,8 @@ private: | |||
| 1064 | LOG_WARNING(Service_VI, "(STUBBED) called"); | 1066 | LOG_WARNING(Service_VI, "(STUBBED) called"); |
| 1065 | 1067 | ||
| 1066 | DisplayInfo display_info; | 1068 | DisplayInfo display_info; |
| 1067 | display_info.width *= static_cast<u64>(Settings::values.resolution_factor); | 1069 | display_info.width *= static_cast<u64>(Settings::values.resolution_factor.GetValue()); |
| 1068 | display_info.height *= static_cast<u64>(Settings::values.resolution_factor); | 1070 | display_info.height *= static_cast<u64>(Settings::values.resolution_factor.GetValue()); |
| 1069 | ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); | 1071 | ctx.WriteBuffer(&display_info, sizeof(DisplayInfo)); |
| 1070 | IPC::ResponseBuilder rb{ctx, 4}; | 1072 | IPC::ResponseBuilder rb{ctx, 4}; |
| 1071 | rb.Push(RESULT_SUCCESS); | 1073 | rb.Push(RESULT_SUCCESS); |
diff --git a/src/core/hle/service/vi/vi_u.cpp b/src/core/hle/service/vi/vi_u.cpp index 9d5ceb608..6b7329345 100644 --- a/src/core/hle/service/vi/vi_u.cpp +++ b/src/core/hle/service/vi/vi_u.cpp | |||
| @@ -12,6 +12,7 @@ VI_U::VI_U(std::shared_ptr<NVFlinger::NVFlinger> nv_flinger) | |||
| 12 | : ServiceFramework{"vi:u"}, nv_flinger{std::move(nv_flinger)} { | 12 | : ServiceFramework{"vi:u"}, nv_flinger{std::move(nv_flinger)} { |
| 13 | static const FunctionInfo functions[] = { | 13 | static const FunctionInfo functions[] = { |
| 14 | {0, &VI_U::GetDisplayService, "GetDisplayService"}, | 14 | {0, &VI_U::GetDisplayService, "GetDisplayService"}, |
| 15 | {1, nullptr, "GetDisplayServiceWithProxyNameExchange"}, | ||
| 15 | }; | 16 | }; |
| 16 | RegisterHandlers(functions); | 17 | RegisterHandlers(functions); |
| 17 | } | 18 | } |
diff --git a/src/core/hle/service/wlan/wlan.cpp b/src/core/hle/service/wlan/wlan.cpp index 2654594c1..0260d7dcf 100644 --- a/src/core/hle/service/wlan/wlan.cpp +++ b/src/core/hle/service/wlan/wlan.cpp | |||
| @@ -15,34 +15,37 @@ public: | |||
| 15 | explicit WLANInfra() : ServiceFramework{"wlan:inf"} { | 15 | explicit WLANInfra() : ServiceFramework{"wlan:inf"} { |
| 16 | // clang-format off | 16 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "Unknown1"}, | 18 | {0, nullptr, "OpenMode"}, |
| 19 | {1, nullptr, "Unknown2"}, | 19 | {1, nullptr, "CloseMode"}, |
| 20 | {2, nullptr, "GetMacAddress"}, | 20 | {2, nullptr, "GetMacAddress"}, |
| 21 | {3, nullptr, "StartScan"}, | 21 | {3, nullptr, "StartScan"}, |
| 22 | {4, nullptr, "StopScan"}, | 22 | {4, nullptr, "StopScan"}, |
| 23 | {5, nullptr, "Connect"}, | 23 | {5, nullptr, "Connect"}, |
| 24 | {6, nullptr, "CancelConnect"}, | 24 | {6, nullptr, "CancelConnect"}, |
| 25 | {7, nullptr, "Disconnect"}, | 25 | {7, nullptr, "Disconnect"}, |
| 26 | {8, nullptr, "Unknown3"}, | 26 | {8, nullptr, "GetConnectionEvent"}, |
| 27 | {9, nullptr, "Unknown4"}, | 27 | {9, nullptr, "GetConnectionStatus"}, |
| 28 | {10, nullptr, "GetState"}, | 28 | {10, nullptr, "GetState"}, |
| 29 | {11, nullptr, "GetScanResult"}, | 29 | {11, nullptr, "GetScanResult"}, |
| 30 | {12, nullptr, "GetRssi"}, | 30 | {12, nullptr, "GetRssi"}, |
| 31 | {13, nullptr, "ChangeRxAntenna"}, | 31 | {13, nullptr, "ChangeRxAntenna"}, |
| 32 | {14, nullptr, "Unknown5"}, | 32 | {14, nullptr, "GetFwVersion"}, |
| 33 | {15, nullptr, "Unknown6"}, | 33 | {15, nullptr, "RequestSleep"}, |
| 34 | {16, nullptr, "RequestWakeUp"}, | 34 | {16, nullptr, "RequestWakeUp"}, |
| 35 | {17, nullptr, "RequestIfUpDown"}, | 35 | {17, nullptr, "RequestIfUpDown"}, |
| 36 | {18, nullptr, "Unknown7"}, | 36 | {18, nullptr, "Unknown18"}, |
| 37 | {19, nullptr, "Unknown8"}, | 37 | {19, nullptr, "Unknown19"}, |
| 38 | {20, nullptr, "Unknown9"}, | 38 | {20, nullptr, "Unknown20"}, |
| 39 | {21, nullptr, "Unknown10"}, | 39 | {21, nullptr, "Unknown21"}, |
| 40 | {22, nullptr, "Unknown11"}, | 40 | {22, nullptr, "Unknown22"}, |
| 41 | {23, nullptr, "Unknown12"}, | 41 | {23, nullptr, "Unknown23"}, |
| 42 | {24, nullptr, "Unknown13"}, | 42 | {24, nullptr, "Unknown24"}, |
| 43 | {25, nullptr, "Unknown14"}, | 43 | {25, nullptr, "Unknown25"}, |
| 44 | {26, nullptr, "Unknown15"}, | 44 | {26, nullptr, "Unknown26"}, |
| 45 | {27, nullptr, "Unknown16"}, | 45 | {27, nullptr, "Unknown27"}, |
| 46 | {28, nullptr, "Unknown28"}, | ||
| 47 | {29, nullptr, "Unknown29"}, | ||
| 48 | {30, nullptr, "Unknown30"}, | ||
| 46 | }; | 49 | }; |
| 47 | // clang-format on | 50 | // clang-format on |
| 48 | 51 | ||
| @@ -55,12 +58,12 @@ public: | |||
| 55 | explicit WLANLocal() : ServiceFramework{"wlan:lcl"} { | 58 | explicit WLANLocal() : ServiceFramework{"wlan:lcl"} { |
| 56 | // clang-format off | 59 | // clang-format off |
| 57 | static const FunctionInfo functions[] = { | 60 | static const FunctionInfo functions[] = { |
| 58 | {0, nullptr, "Unknown1"}, | 61 | {0, nullptr, "Unknown0"}, |
| 59 | {1, nullptr, "Unknown2"}, | 62 | {1, nullptr, "Unknown1"}, |
| 60 | {2, nullptr, "Unknown3"}, | 63 | {2, nullptr, "Unknown2"}, |
| 61 | {3, nullptr, "Unknown4"}, | 64 | {3, nullptr, "Unknown3"}, |
| 62 | {4, nullptr, "Unknown5"}, | 65 | {4, nullptr, "Unknown4"}, |
| 63 | {5, nullptr, "Unknown6"}, | 66 | {5, nullptr, "Unknown5"}, |
| 64 | {6, nullptr, "GetMacAddress"}, | 67 | {6, nullptr, "GetMacAddress"}, |
| 65 | {7, nullptr, "CreateBss"}, | 68 | {7, nullptr, "CreateBss"}, |
| 66 | {8, nullptr, "DestroyBss"}, | 69 | {8, nullptr, "DestroyBss"}, |
| @@ -72,38 +75,42 @@ public: | |||
| 72 | {14, nullptr, "CancelJoin"}, | 75 | {14, nullptr, "CancelJoin"}, |
| 73 | {15, nullptr, "Disconnect"}, | 76 | {15, nullptr, "Disconnect"}, |
| 74 | {16, nullptr, "SetBeaconLostCount"}, | 77 | {16, nullptr, "SetBeaconLostCount"}, |
| 75 | {17, nullptr, "Unknown7"}, | 78 | {17, nullptr, "Unknown17"}, |
| 76 | {18, nullptr, "Unknown8"}, | 79 | {18, nullptr, "Unknown18"}, |
| 77 | {19, nullptr, "Unknown9"}, | 80 | {19, nullptr, "Unknown19"}, |
| 78 | {20, nullptr, "GetBssIndicationEvent"}, | 81 | {20, nullptr, "GetBssIndicationEvent"}, |
| 79 | {21, nullptr, "GetBssIndicationInfo"}, | 82 | {21, nullptr, "GetBssIndicationInfo"}, |
| 80 | {22, nullptr, "GetState"}, | 83 | {22, nullptr, "GetState"}, |
| 81 | {23, nullptr, "GetAllowedChannels"}, | 84 | {23, nullptr, "GetAllowedChannels"}, |
| 82 | {24, nullptr, "AddIe"}, | 85 | {24, nullptr, "AddIe"}, |
| 83 | {25, nullptr, "DeleteIe"}, | 86 | {25, nullptr, "DeleteIe"}, |
| 84 | {26, nullptr, "Unknown10"}, | 87 | {26, nullptr, "Unknown26"}, |
| 85 | {27, nullptr, "Unknown11"}, | 88 | {27, nullptr, "Unknown27"}, |
| 86 | {28, nullptr, "CreateRxEntry"}, | 89 | {28, nullptr, "CreateRxEntry"}, |
| 87 | {29, nullptr, "DeleteRxEntry"}, | 90 | {29, nullptr, "DeleteRxEntry"}, |
| 88 | {30, nullptr, "Unknown12"}, | 91 | {30, nullptr, "Unknown30"}, |
| 89 | {31, nullptr, "Unknown13"}, | 92 | {31, nullptr, "Unknown31"}, |
| 90 | {32, nullptr, "AddMatchingDataToRxEntry"}, | 93 | {32, nullptr, "AddMatchingDataToRxEntry"}, |
| 91 | {33, nullptr, "RemoveMatchingDataFromRxEntry"}, | 94 | {33, nullptr, "RemoveMatchingDataFromRxEntry"}, |
| 92 | {34, nullptr, "GetScanResult"}, | 95 | {34, nullptr, "GetScanResult"}, |
| 93 | {35, nullptr, "Unknown14"}, | 96 | {35, nullptr, "Unknown35"}, |
| 94 | {36, nullptr, "SetActionFrameWithBeacon"}, | 97 | {36, nullptr, "SetActionFrameWithBeacon"}, |
| 95 | {37, nullptr, "CancelActionFrameWithBeacon"}, | 98 | {37, nullptr, "CancelActionFrameWithBeacon"}, |
| 96 | {38, nullptr, "CreateRxEntryForActionFrame"}, | 99 | {38, nullptr, "CreateRxEntryForActionFrame"}, |
| 97 | {39, nullptr, "DeleteRxEntryForActionFrame"}, | 100 | {39, nullptr, "DeleteRxEntryForActionFrame"}, |
| 98 | {40, nullptr, "Unknown15"}, | 101 | {40, nullptr, "Unknown40"}, |
| 99 | {41, nullptr, "Unknown16"}, | 102 | {41, nullptr, "Unknown41"}, |
| 100 | {42, nullptr, "CancelGetActionFrame"}, | 103 | {42, nullptr, "CancelGetActionFrame"}, |
| 101 | {43, nullptr, "GetRssi"}, | 104 | {43, nullptr, "GetRssi"}, |
| 102 | {44, nullptr, "Unknown17"}, | 105 | {44, nullptr, "Unknown44"}, |
| 103 | {45, nullptr, "Unknown18"}, | 106 | {45, nullptr, "Unknown45"}, |
| 104 | {46, nullptr, "Unknown19"}, | 107 | {46, nullptr, "Unknown46"}, |
| 105 | {47, nullptr, "Unknown20"}, | 108 | {47, nullptr, "Unknown47"}, |
| 106 | {48, nullptr, "Unknown21"}, | 109 | {48, nullptr, "Unknown48"}, |
| 110 | {49, nullptr, "Unknown49"}, | ||
| 111 | {50, nullptr, "Unknown50"}, | ||
| 112 | {51, nullptr, "Unknown51"}, | ||
| 113 | {52, nullptr, "Unknown52"}, | ||
| 107 | }; | 114 | }; |
| 108 | // clang-format on | 115 | // clang-format on |
| 109 | 116 | ||
| @@ -142,18 +149,19 @@ public: | |||
| 142 | explicit WLANSocketManager() : ServiceFramework{"wlan:soc"} { | 149 | explicit WLANSocketManager() : ServiceFramework{"wlan:soc"} { |
| 143 | // clang-format off | 150 | // clang-format off |
| 144 | static const FunctionInfo functions[] = { | 151 | static const FunctionInfo functions[] = { |
| 145 | {0, nullptr, "Unknown1"}, | 152 | {0, nullptr, "Unknown0"}, |
| 146 | {1, nullptr, "Unknown2"}, | 153 | {1, nullptr, "Unknown1"}, |
| 147 | {2, nullptr, "Unknown3"}, | 154 | {2, nullptr, "Unknown2"}, |
| 148 | {3, nullptr, "Unknown4"}, | 155 | {3, nullptr, "Unknown3"}, |
| 149 | {4, nullptr, "Unknown5"}, | 156 | {4, nullptr, "Unknown4"}, |
| 150 | {5, nullptr, "Unknown6"}, | 157 | {5, nullptr, "Unknown5"}, |
| 151 | {6, nullptr, "GetMacAddress"}, | 158 | {6, nullptr, "GetMacAddress"}, |
| 152 | {7, nullptr, "SwitchTsfTimerFunction"}, | 159 | {7, nullptr, "SwitchTsfTimerFunction"}, |
| 153 | {8, nullptr, "Unknown7"}, | 160 | {8, nullptr, "Unknown8"}, |
| 154 | {9, nullptr, "Unknown8"}, | 161 | {9, nullptr, "Unknown9"}, |
| 155 | {10, nullptr, "Unknown9"}, | 162 | {10, nullptr, "Unknown10"}, |
| 156 | {11, nullptr, "Unknown10"}, | 163 | {11, nullptr, "Unknown11"}, |
| 164 | {12, nullptr, "Unknown12"}, | ||
| 157 | }; | 165 | }; |
| 158 | // clang-format on | 166 | // clang-format on |
| 159 | 167 | ||
diff --git a/src/core/perf_stats.cpp b/src/core/perf_stats.cpp index 9f3a6b811..29339ead7 100644 --- a/src/core/perf_stats.cpp +++ b/src/core/perf_stats.cpp | |||
| @@ -119,13 +119,14 @@ double PerfStats::GetLastFrameTimeScale() { | |||
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { | 121 | void FrameLimiter::DoFrameLimiting(microseconds current_system_time_us) { |
| 122 | if (!Settings::values.use_frame_limit || Settings::values.use_multi_core) { | 122 | if (!Settings::values.use_frame_limit.GetValue() || |
| 123 | Settings::values.use_multi_core.GetValue()) { | ||
| 123 | return; | 124 | return; |
| 124 | } | 125 | } |
| 125 | 126 | ||
| 126 | auto now = Clock::now(); | 127 | auto now = Clock::now(); |
| 127 | 128 | ||
| 128 | const double sleep_scale = Settings::values.frame_limit / 100.0; | 129 | const double sleep_scale = Settings::values.frame_limit.GetValue() / 100.0; |
| 129 | 130 | ||
| 130 | // Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current | 131 | // Max lag caused by slow frames. Shouldn't be more than the length of a frame at the current |
| 131 | // speed percent or it will clamp too much and prevent this from properly limiting to that | 132 | // speed percent or it will clamp too much and prevent this from properly limiting to that |
diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 56df5e925..d3886c4ec 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp | |||
| @@ -62,6 +62,7 @@ const std::array<const char*, NumMouseButtons> mapping = {{ | |||
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | Values values = {}; | 64 | Values values = {}; |
| 65 | bool configuring_global = true; | ||
| 65 | 66 | ||
| 66 | std::string GetTimeZoneString() { | 67 | std::string GetTimeZoneString() { |
| 67 | static constexpr std::array<const char*, 46> timezones{{ | 68 | static constexpr std::array<const char*, 46> timezones{{ |
| @@ -73,9 +74,9 @@ std::string GetTimeZoneString() { | |||
| 73 | "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", | 74 | "UCT", "Universal", "UTC", "W-SU", "WET", "Zulu", |
| 74 | }}; | 75 | }}; |
| 75 | 76 | ||
| 76 | ASSERT(Settings::values.time_zone_index < timezones.size()); | 77 | ASSERT(Settings::values.time_zone_index.GetValue() < timezones.size()); |
| 77 | 78 | ||
| 78 | return timezones[Settings::values.time_zone_index]; | 79 | return timezones[Settings::values.time_zone_index.GetValue()]; |
| 79 | } | 80 | } |
| 80 | 81 | ||
| 81 | void Apply() { | 82 | void Apply() { |
| @@ -97,25 +98,25 @@ void LogSetting(const std::string& name, const T& value) { | |||
| 97 | 98 | ||
| 98 | void LogSettings() { | 99 | void LogSettings() { |
| 99 | LOG_INFO(Config, "yuzu Configuration:"); | 100 | LOG_INFO(Config, "yuzu Configuration:"); |
| 100 | LogSetting("System_UseDockedMode", Settings::values.use_docked_mode); | 101 | LogSetting("Controls_UseDockedMode", Settings::values.use_docked_mode); |
| 101 | LogSetting("System_RngSeed", Settings::values.rng_seed.value_or(0)); | 102 | LogSetting("System_RngSeed", Settings::values.rng_seed.GetValue().value_or(0)); |
| 102 | LogSetting("System_CurrentUser", Settings::values.current_user); | 103 | LogSetting("System_CurrentUser", Settings::values.current_user); |
| 103 | LogSetting("System_LanguageIndex", Settings::values.language_index); | 104 | LogSetting("System_LanguageIndex", Settings::values.language_index.GetValue()); |
| 104 | LogSetting("System_RegionIndex", Settings::values.region_index); | 105 | LogSetting("System_RegionIndex", Settings::values.region_index.GetValue()); |
| 105 | LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index); | 106 | LogSetting("System_TimeZoneIndex", Settings::values.time_zone_index.GetValue()); |
| 106 | LogSetting("Core_UseMultiCore", Settings::values.use_multi_core); | 107 | LogSetting("Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); |
| 107 | LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor); | 108 | LogSetting("Renderer_UseResolutionFactor", Settings::values.resolution_factor.GetValue()); |
| 108 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); | 109 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); |
| 109 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); | 110 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); |
| 110 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); | 111 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache.GetValue()); |
| 111 | LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy); | 112 | LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy.GetValue()); |
| 112 | LogSetting("Renderer_UseAsynchronousGpuEmulation", | 113 | LogSetting("Renderer_UseAsynchronousGpuEmulation", |
| 113 | Settings::values.use_asynchronous_gpu_emulation); | 114 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
| 114 | LogSetting("Renderer_UseVsync", Settings::values.use_vsync); | 115 | LogSetting("Renderer_UseVsync", Settings::values.use_vsync.GetValue()); |
| 115 | LogSetting("Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders); | 116 | LogSetting("Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders.GetValue()); |
| 116 | LogSetting("Renderer_AnisotropicFilteringLevel", Settings::values.max_anisotropy); | 117 | LogSetting("Renderer_AnisotropicFilteringLevel", Settings::values.max_anisotropy.GetValue()); |
| 117 | LogSetting("Audio_OutputEngine", Settings::values.sink_id); | 118 | LogSetting("Audio_OutputEngine", Settings::values.sink_id); |
| 118 | LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching); | 119 | LogSetting("Audio_EnableAudioStretching", Settings::values.enable_audio_stretching.GetValue()); |
| 119 | LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); | 120 | LogSetting("Audio_OutputDevice", Settings::values.audio_device_id); |
| 120 | LogSetting("DataStorage_UseVirtualSd", Settings::values.use_virtual_sd); | 121 | LogSetting("DataStorage_UseVirtualSd", Settings::values.use_virtual_sd); |
| 121 | LogSetting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); | 122 | LogSetting("DataStorage_NandDir", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); |
| @@ -131,15 +132,56 @@ float Volume() { | |||
| 131 | if (values.audio_muted) { | 132 | if (values.audio_muted) { |
| 132 | return 0.0f; | 133 | return 0.0f; |
| 133 | } | 134 | } |
| 134 | return values.volume; | 135 | return values.volume.GetValue(); |
| 135 | } | 136 | } |
| 136 | 137 | ||
| 137 | bool IsGPULevelExtreme() { | 138 | bool IsGPULevelExtreme() { |
| 138 | return values.gpu_accuracy == GPUAccuracy::Extreme; | 139 | return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme; |
| 139 | } | 140 | } |
| 140 | 141 | ||
| 141 | bool IsGPULevelHigh() { | 142 | bool IsGPULevelHigh() { |
| 142 | return values.gpu_accuracy == GPUAccuracy::Extreme || values.gpu_accuracy == GPUAccuracy::High; | 143 | return values.gpu_accuracy.GetValue() == GPUAccuracy::Extreme || |
| 144 | values.gpu_accuracy.GetValue() == GPUAccuracy::High; | ||
| 145 | } | ||
| 146 | |||
| 147 | void RestoreGlobalState() { | ||
| 148 | // If a game is running, DO NOT restore the global settings state | ||
| 149 | if (Core::System::GetInstance().IsPoweredOn()) { | ||
| 150 | return; | ||
| 151 | } | ||
| 152 | |||
| 153 | // Audio | ||
| 154 | values.enable_audio_stretching.SetGlobal(true); | ||
| 155 | values.volume.SetGlobal(true); | ||
| 156 | |||
| 157 | // Core | ||
| 158 | values.use_multi_core.SetGlobal(true); | ||
| 159 | |||
| 160 | // Renderer | ||
| 161 | values.renderer_backend.SetGlobal(true); | ||
| 162 | values.vulkan_device.SetGlobal(true); | ||
| 163 | values.aspect_ratio.SetGlobal(true); | ||
| 164 | values.max_anisotropy.SetGlobal(true); | ||
| 165 | values.use_frame_limit.SetGlobal(true); | ||
| 166 | values.frame_limit.SetGlobal(true); | ||
| 167 | values.use_disk_shader_cache.SetGlobal(true); | ||
| 168 | values.gpu_accuracy.SetGlobal(true); | ||
| 169 | values.use_asynchronous_gpu_emulation.SetGlobal(true); | ||
| 170 | values.use_vsync.SetGlobal(true); | ||
| 171 | values.use_assembly_shaders.SetGlobal(true); | ||
| 172 | values.use_fast_gpu_time.SetGlobal(true); | ||
| 173 | values.force_30fps_mode.SetGlobal(true); | ||
| 174 | values.bg_red.SetGlobal(true); | ||
| 175 | values.bg_green.SetGlobal(true); | ||
| 176 | values.bg_blue.SetGlobal(true); | ||
| 177 | |||
| 178 | // System | ||
| 179 | values.language_index.SetGlobal(true); | ||
| 180 | values.region_index.SetGlobal(true); | ||
| 181 | values.time_zone_index.SetGlobal(true); | ||
| 182 | values.rng_seed.SetGlobal(true); | ||
| 183 | values.custom_rtc.SetGlobal(true); | ||
| 184 | values.sound_index.SetGlobal(true); | ||
| 143 | } | 185 | } |
| 144 | 186 | ||
| 145 | } // namespace Settings | 187 | } // namespace Settings |
diff --git a/src/core/settings.h b/src/core/settings.h index a598ccbc1..850ca4072 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -382,20 +382,85 @@ enum class GPUAccuracy : u32 { | |||
| 382 | Extreme = 2, | 382 | Extreme = 2, |
| 383 | }; | 383 | }; |
| 384 | 384 | ||
| 385 | extern bool configuring_global; | ||
| 386 | |||
| 387 | template <typename Type> | ||
| 388 | class Setting final { | ||
| 389 | public: | ||
| 390 | Setting() = default; | ||
| 391 | explicit Setting(Type val) : global{val} {} | ||
| 392 | ~Setting() = default; | ||
| 393 | void SetGlobal(bool to_global) { | ||
| 394 | use_global = to_global; | ||
| 395 | } | ||
| 396 | bool UsingGlobal() const { | ||
| 397 | return use_global; | ||
| 398 | } | ||
| 399 | Type GetValue(bool need_global = false) const { | ||
| 400 | if (use_global || need_global) { | ||
| 401 | return global; | ||
| 402 | } | ||
| 403 | return local; | ||
| 404 | } | ||
| 405 | void SetValue(const Type& value) { | ||
| 406 | if (use_global) { | ||
| 407 | global = value; | ||
| 408 | } else { | ||
| 409 | local = value; | ||
| 410 | } | ||
| 411 | } | ||
| 412 | |||
| 413 | private: | ||
| 414 | bool use_global = true; | ||
| 415 | Type global{}; | ||
| 416 | Type local{}; | ||
| 417 | }; | ||
| 418 | |||
| 385 | struct Values { | 419 | struct Values { |
| 420 | // Audio | ||
| 421 | std::string audio_device_id; | ||
| 422 | std::string sink_id; | ||
| 423 | bool audio_muted; | ||
| 424 | Setting<bool> enable_audio_stretching; | ||
| 425 | Setting<float> volume; | ||
| 426 | |||
| 427 | // Core | ||
| 428 | Setting<bool> use_multi_core; | ||
| 429 | |||
| 430 | // Renderer | ||
| 431 | Setting<RendererBackend> renderer_backend; | ||
| 432 | bool renderer_debug; | ||
| 433 | Setting<int> vulkan_device; | ||
| 434 | |||
| 435 | Setting<u16> resolution_factor = Setting(static_cast<u16>(1)); | ||
| 436 | Setting<int> aspect_ratio; | ||
| 437 | Setting<int> max_anisotropy; | ||
| 438 | Setting<bool> use_frame_limit; | ||
| 439 | Setting<u16> frame_limit; | ||
| 440 | Setting<bool> use_disk_shader_cache; | ||
| 441 | Setting<GPUAccuracy> gpu_accuracy; | ||
| 442 | Setting<bool> use_asynchronous_gpu_emulation; | ||
| 443 | Setting<bool> use_vsync; | ||
| 444 | Setting<bool> use_assembly_shaders; | ||
| 445 | Setting<bool> force_30fps_mode; | ||
| 446 | Setting<bool> use_fast_gpu_time; | ||
| 447 | |||
| 448 | Setting<float> bg_red; | ||
| 449 | Setting<float> bg_green; | ||
| 450 | Setting<float> bg_blue; | ||
| 451 | |||
| 386 | // System | 452 | // System |
| 387 | bool use_docked_mode; | 453 | Setting<std::optional<u32>> rng_seed; |
| 388 | std::optional<u32> rng_seed; | ||
| 389 | // Measured in seconds since epoch | 454 | // Measured in seconds since epoch |
| 390 | std::optional<std::chrono::seconds> custom_rtc; | 455 | Setting<std::optional<std::chrono::seconds>> custom_rtc; |
| 391 | // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` | 456 | // Set on game boot, reset on stop. Seconds difference between current time and `custom_rtc` |
| 392 | std::chrono::seconds custom_rtc_differential; | 457 | std::chrono::seconds custom_rtc_differential; |
| 393 | 458 | ||
| 394 | s32 current_user; | 459 | s32 current_user; |
| 395 | s32 language_index; | 460 | Setting<s32> language_index; |
| 396 | s32 region_index; | 461 | Setting<s32> region_index; |
| 397 | s32 time_zone_index; | 462 | Setting<s32> time_zone_index; |
| 398 | s32 sound_index; | 463 | Setting<s32> sound_index; |
| 399 | 464 | ||
| 400 | // Controls | 465 | // Controls |
| 401 | std::array<PlayerInput, 10> players; | 466 | std::array<PlayerInput, 10> players; |
| @@ -419,8 +484,7 @@ struct Values { | |||
| 419 | u16 udp_input_port; | 484 | u16 udp_input_port; |
| 420 | u8 udp_pad_index; | 485 | u8 udp_pad_index; |
| 421 | 486 | ||
| 422 | // Core | 487 | bool use_docked_mode; |
| 423 | bool use_multi_core; | ||
| 424 | 488 | ||
| 425 | // Data Storage | 489 | // Data Storage |
| 426 | bool use_virtual_sd; | 490 | bool use_virtual_sd; |
| @@ -432,39 +496,6 @@ struct Values { | |||
| 432 | NANDUserSize nand_user_size; | 496 | NANDUserSize nand_user_size; |
| 433 | SDMCSize sdmc_size; | 497 | SDMCSize sdmc_size; |
| 434 | 498 | ||
| 435 | // Renderer | ||
| 436 | RendererBackend renderer_backend; | ||
| 437 | bool renderer_debug; | ||
| 438 | int vulkan_device; | ||
| 439 | |||
| 440 | u16 resolution_factor{1}; | ||
| 441 | int aspect_ratio; | ||
| 442 | int max_anisotropy; | ||
| 443 | bool use_frame_limit; | ||
| 444 | u16 frame_limit; | ||
| 445 | bool use_disk_shader_cache; | ||
| 446 | GPUAccuracy gpu_accuracy; | ||
| 447 | bool use_asynchronous_gpu_emulation; | ||
| 448 | bool use_vsync; | ||
| 449 | bool use_assembly_shaders; | ||
| 450 | bool force_30fps_mode; | ||
| 451 | bool use_fast_gpu_time; | ||
| 452 | |||
| 453 | float bg_red; | ||
| 454 | float bg_green; | ||
| 455 | float bg_blue; | ||
| 456 | |||
| 457 | std::string log_filter; | ||
| 458 | |||
| 459 | bool use_dev_keys; | ||
| 460 | |||
| 461 | // Audio | ||
| 462 | bool audio_muted; | ||
| 463 | std::string sink_id; | ||
| 464 | bool enable_audio_stretching; | ||
| 465 | std::string audio_device_id; | ||
| 466 | float volume; | ||
| 467 | |||
| 468 | // Debugging | 499 | // Debugging |
| 469 | bool record_frame_times; | 500 | bool record_frame_times; |
| 470 | bool use_gdbstub; | 501 | bool use_gdbstub; |
| @@ -477,7 +508,11 @@ struct Values { | |||
| 477 | bool disable_cpu_opt; | 508 | bool disable_cpu_opt; |
| 478 | bool disable_macro_jit; | 509 | bool disable_macro_jit; |
| 479 | 510 | ||
| 480 | // BCAT | 511 | // Misceallaneous |
| 512 | std::string log_filter; | ||
| 513 | bool use_dev_keys; | ||
| 514 | |||
| 515 | // Services | ||
| 481 | std::string bcat_backend; | 516 | std::string bcat_backend; |
| 482 | bool bcat_boxcat_local; | 517 | bool bcat_boxcat_local; |
| 483 | 518 | ||
| @@ -501,4 +536,7 @@ std::string GetTimeZoneString(); | |||
| 501 | void Apply(); | 536 | void Apply(); |
| 502 | void LogSettings(); | 537 | void LogSettings(); |
| 503 | 538 | ||
| 539 | // Restore the global state of all applicable settings in the Values struct | ||
| 540 | void RestoreGlobalState(); | ||
| 541 | |||
| 504 | } // namespace Settings | 542 | } // namespace Settings |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index c781b3cfc..78915e6db 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -189,19 +189,24 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) { | |||
| 189 | // Log user configuration information | 189 | // Log user configuration information |
| 190 | constexpr auto field_type = Telemetry::FieldType::UserConfig; | 190 | constexpr auto field_type = Telemetry::FieldType::UserConfig; |
| 191 | AddField(field_type, "Audio_SinkId", Settings::values.sink_id); | 191 | AddField(field_type, "Audio_SinkId", Settings::values.sink_id); |
| 192 | AddField(field_type, "Audio_EnableAudioStretching", Settings::values.enable_audio_stretching); | 192 | AddField(field_type, "Audio_EnableAudioStretching", |
| 193 | AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core); | 193 | Settings::values.enable_audio_stretching.GetValue()); |
| 194 | AddField(field_type, "Renderer_Backend", TranslateRenderer(Settings::values.renderer_backend)); | 194 | AddField(field_type, "Core_UseMultiCore", Settings::values.use_multi_core.GetValue()); |
| 195 | AddField(field_type, "Renderer_ResolutionFactor", Settings::values.resolution_factor); | 195 | AddField(field_type, "Renderer_Backend", |
| 196 | AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit); | 196 | TranslateRenderer(Settings::values.renderer_backend.GetValue())); |
| 197 | AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit); | 197 | AddField(field_type, "Renderer_ResolutionFactor", |
| 198 | AddField(field_type, "Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); | 198 | Settings::values.resolution_factor.GetValue()); |
| 199 | AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit.GetValue()); | ||
| 200 | AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit.GetValue()); | ||
| 201 | AddField(field_type, "Renderer_UseDiskShaderCache", | ||
| 202 | Settings::values.use_disk_shader_cache.GetValue()); | ||
| 199 | AddField(field_type, "Renderer_GPUAccuracyLevel", | 203 | AddField(field_type, "Renderer_GPUAccuracyLevel", |
| 200 | TranslateGPUAccuracyLevel(Settings::values.gpu_accuracy)); | 204 | TranslateGPUAccuracyLevel(Settings::values.gpu_accuracy.GetValue())); |
| 201 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", | 205 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", |
| 202 | Settings::values.use_asynchronous_gpu_emulation); | 206 | Settings::values.use_asynchronous_gpu_emulation.GetValue()); |
| 203 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync); | 207 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync.GetValue()); |
| 204 | AddField(field_type, "Renderer_UseAssemblyShaders", Settings::values.use_assembly_shaders); | 208 | AddField(field_type, "Renderer_UseAssemblyShaders", |
| 209 | Settings::values.use_assembly_shaders.GetValue()); | ||
| 205 | AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode); | 210 | AddField(field_type, "System_UseDockedMode", Settings::values.use_docked_mode); |
| 206 | } | 211 | } |
| 207 | 212 | ||