summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/param_package.cpp6
-rw-r--r--src/core/cpu_manager.cpp3
-rw-r--r--src/core/cpu_manager.h5
-rw-r--r--src/core/hle/kernel/svc.cpp3
-rw-r--r--src/core/hle/service/am/am.cpp12
-rw-r--r--src/core/hle/service/am/am.h13
-rw-r--r--src/yuzu/bootmanager.cpp3
-rw-r--r--src/yuzu_cmd/yuzu.cpp8
8 files changed, 48 insertions, 5 deletions
diff --git a/src/common/param_package.cpp b/src/common/param_package.cpp
index bbf20f5eb..462502e34 100644
--- a/src/common/param_package.cpp
+++ b/src/common/param_package.cpp
@@ -76,7 +76,7 @@ std::string ParamPackage::Serialize() const {
76std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const { 76std::string ParamPackage::Get(const std::string& key, const std::string& default_value) const {
77 auto pair = data.find(key); 77 auto pair = data.find(key);
78 if (pair == data.end()) { 78 if (pair == data.end()) {
79 LOG_DEBUG(Common, "key '{}' not found", key); 79 LOG_TRACE(Common, "key '{}' not found", key);
80 return default_value; 80 return default_value;
81 } 81 }
82 82
@@ -86,7 +86,7 @@ std::string ParamPackage::Get(const std::string& key, const std::string& default
86int ParamPackage::Get(const std::string& key, int default_value) const { 86int ParamPackage::Get(const std::string& key, int default_value) const {
87 auto pair = data.find(key); 87 auto pair = data.find(key);
88 if (pair == data.end()) { 88 if (pair == data.end()) {
89 LOG_DEBUG(Common, "key '{}' not found", key); 89 LOG_TRACE(Common, "key '{}' not found", key);
90 return default_value; 90 return default_value;
91 } 91 }
92 92
@@ -101,7 +101,7 @@ int ParamPackage::Get(const std::string& key, int default_value) const {
101float ParamPackage::Get(const std::string& key, float default_value) const { 101float ParamPackage::Get(const std::string& key, float default_value) const {
102 auto pair = data.find(key); 102 auto pair = data.find(key);
103 if (pair == data.end()) { 103 if (pair == data.end()) {
104 LOG_DEBUG(Common, "key {} not found", key); 104 LOG_TRACE(Common, "key {} not found", key);
105 return default_value; 105 return default_value;
106 } 106 }
107 107
diff --git a/src/core/cpu_manager.cpp b/src/core/cpu_manager.cpp
index 1c07dc90e..d69b2602a 100644
--- a/src/core/cpu_manager.cpp
+++ b/src/core/cpu_manager.cpp
@@ -26,6 +26,7 @@ void CpuManager::ThreadStart(std::stop_token stop_token, CpuManager& cpu_manager
26 26
27void CpuManager::Initialize() { 27void CpuManager::Initialize() {
28 num_cores = is_multicore ? Core::Hardware::NUM_CPU_CORES : 1; 28 num_cores = is_multicore ? Core::Hardware::NUM_CPU_CORES : 1;
29 gpu_barrier = std::make_unique<Common::Barrier>(num_cores + 1);
29 30
30 for (std::size_t core = 0; core < num_cores; core++) { 31 for (std::size_t core = 0; core < num_cores; core++) {
31 core_data[core].host_thread = std::jthread(ThreadStart, std::ref(*this), core); 32 core_data[core].host_thread = std::jthread(ThreadStart, std::ref(*this), core);
@@ -230,6 +231,8 @@ void CpuManager::RunThread(std::size_t core) {
230 }); 231 });
231 232
232 // Running 233 // Running
234 gpu_barrier->Sync();
235
233 if (!is_async_gpu && !is_multicore) { 236 if (!is_async_gpu && !is_multicore) {
234 system.GPU().ObtainContext(); 237 system.GPU().ObtainContext();
235 } 238 }
diff --git a/src/core/cpu_manager.h b/src/core/cpu_manager.h
index 681bdaf19..f0751fc58 100644
--- a/src/core/cpu_manager.h
+++ b/src/core/cpu_manager.h
@@ -43,6 +43,10 @@ public:
43 is_async_gpu = is_async; 43 is_async_gpu = is_async;
44 } 44 }
45 45
46 void OnGpuReady() {
47 gpu_barrier->Sync();
48 }
49
46 void Initialize(); 50 void Initialize();
47 void Shutdown(); 51 void Shutdown();
48 52
@@ -81,6 +85,7 @@ private:
81 std::jthread host_thread; 85 std::jthread host_thread;
82 }; 86 };
83 87
88 std::unique_ptr<Common::Barrier> gpu_barrier{};
84 std::array<CoreData, Core::Hardware::NUM_CPU_CORES> core_data{}; 89 std::array<CoreData, Core::Hardware::NUM_CPU_CORES> core_data{};
85 90
86 bool is_async_gpu{}; 91 bool is_async_gpu{};
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index 47db0bacf..2ff6d5fa6 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -1726,11 +1726,12 @@ static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_ha
1726/// Exits the current process 1726/// Exits the current process
1727static void ExitProcess(Core::System& system) { 1727static void ExitProcess(Core::System& system) {
1728 auto* current_process = system.Kernel().CurrentProcess(); 1728 auto* current_process = system.Kernel().CurrentProcess();
1729 UNIMPLEMENTED();
1730 1729
1731 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID()); 1730 LOG_INFO(Kernel_SVC, "Process {} exiting", current_process->GetProcessID());
1732 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running, 1731 ASSERT_MSG(current_process->GetStatus() == ProcessStatus::Running,
1733 "Process has already exited"); 1732 "Process has already exited");
1733
1734 system.Exit();
1734} 1735}
1735 1736
1736static void ExitProcess32(Core::System& system) { 1737static void ExitProcess32(Core::System& system) {
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 4657bdabc..c4a93e524 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -686,7 +686,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_,
686 {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, 686 {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"},
687 {67, nullptr, "CancelCpuBoostMode"}, 687 {67, nullptr, "CancelCpuBoostMode"},
688 {68, nullptr, "GetBuiltInDisplayType"}, 688 {68, nullptr, "GetBuiltInDisplayType"},
689 {80, nullptr, "PerformSystemButtonPressingIfInFocus"}, 689 {80, &ICommonStateGetter::PerformSystemButtonPressingIfInFocus, "PerformSystemButtonPressingIfInFocus"},
690 {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, 690 {90, nullptr, "SetPerformanceConfigurationChangedNotification"},
691 {91, nullptr, "GetCurrentPerformanceConfiguration"}, 691 {91, nullptr, "GetCurrentPerformanceConfiguration"},
692 {100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"}, 692 {100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"},
@@ -826,6 +826,16 @@ void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
826 apm_sys->SetCpuBoostMode(ctx); 826 apm_sys->SetCpuBoostMode(ctx);
827} 827}
828 828
829void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(Kernel::HLERequestContext& ctx) {
830 IPC::RequestParser rp{ctx};
831 const auto system_button{rp.PopEnum<SystemButtonType>()};
832
833 LOG_WARNING(Service_AM, "(STUBBED) called, system_button={}", system_button);
834
835 IPC::ResponseBuilder rb{ctx, 2};
836 rb.Push(ResultSuccess);
837}
838
829void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled( 839void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(
830 Kernel::HLERequestContext& ctx) { 840 Kernel::HLERequestContext& ctx) {
831 LOG_WARNING(Service_AM, "(STUBBED) called"); 841 LOG_WARNING(Service_AM, "(STUBBED) called");
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 06f13aa09..988ead215 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -220,6 +220,18 @@ private:
220 Docked = 1, 220 Docked = 1,
221 }; 221 };
222 222
223 // This is nn::am::service::SystemButtonType
224 enum class SystemButtonType {
225 None,
226 HomeButtonShortPressing,
227 HomeButtonLongPressing,
228 PowerButtonShortPressing,
229 PowerButtonLongPressing,
230 ShutdownSystem,
231 CaptureButtonShortPressing,
232 CaptureButtonLongPressing,
233 };
234
223 void GetEventHandle(Kernel::HLERequestContext& ctx); 235 void GetEventHandle(Kernel::HLERequestContext& ctx);
224 void ReceiveMessage(Kernel::HLERequestContext& ctx); 236 void ReceiveMessage(Kernel::HLERequestContext& ctx);
225 void GetCurrentFocusState(Kernel::HLERequestContext& ctx); 237 void GetCurrentFocusState(Kernel::HLERequestContext& ctx);
@@ -234,6 +246,7 @@ private:
234 void EndVrModeEx(Kernel::HLERequestContext& ctx); 246 void EndVrModeEx(Kernel::HLERequestContext& ctx);
235 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx); 247 void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
236 void SetCpuBoostMode(Kernel::HLERequestContext& ctx); 248 void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
249 void PerformSystemButtonPressingIfInFocus(Kernel::HLERequestContext& ctx);
237 void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(Kernel::HLERequestContext& ctx); 250 void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(Kernel::HLERequestContext& ctx);
238 251
239 std::shared_ptr<AppletMessageQueue> msg_queue; 252 std::shared_ptr<AppletMessageQueue> msg_queue;
diff --git a/src/yuzu/bootmanager.cpp b/src/yuzu/bootmanager.cpp
index cbe4e2daa..01acda22b 100644
--- a/src/yuzu/bootmanager.cpp
+++ b/src/yuzu/bootmanager.cpp
@@ -29,6 +29,7 @@
29#include "common/scm_rev.h" 29#include "common/scm_rev.h"
30#include "common/settings.h" 30#include "common/settings.h"
31#include "core/core.h" 31#include "core/core.h"
32#include "core/cpu_manager.h"
32#include "core/frontend/framebuffer_layout.h" 33#include "core/frontend/framebuffer_layout.h"
33#include "input_common/drivers/keyboard.h" 34#include "input_common/drivers/keyboard.h"
34#include "input_common/drivers/mouse.h" 35#include "input_common/drivers/mouse.h"
@@ -73,6 +74,8 @@ void EmuThread::run() {
73 74
74 gpu.ReleaseContext(); 75 gpu.ReleaseContext();
75 76
77 system.GetCpuManager().OnGpuReady();
78
76 // Holds whether the cpu was running during the last iteration, 79 // Holds whether the cpu was running during the last iteration,
77 // so that the DebugModeLeft signal can be emitted before the 80 // so that the DebugModeLeft signal can be emitted before the
78 // next execution step 81 // next execution step
diff --git a/src/yuzu_cmd/yuzu.cpp b/src/yuzu_cmd/yuzu.cpp
index 0dce5e274..cb301e78b 100644
--- a/src/yuzu_cmd/yuzu.cpp
+++ b/src/yuzu_cmd/yuzu.cpp
@@ -21,6 +21,7 @@
21#include "common/string_util.h" 21#include "common/string_util.h"
22#include "common/telemetry.h" 22#include "common/telemetry.h"
23#include "core/core.h" 23#include "core/core.h"
24#include "core/cpu_manager.h"
24#include "core/crypto/key_manager.h" 25#include "core/crypto/key_manager.h"
25#include "core/file_sys/registered_cache.h" 26#include "core/file_sys/registered_cache.h"
26#include "core/file_sys/vfs_real.h" 27#include "core/file_sys/vfs_real.h"
@@ -138,6 +139,12 @@ int main(int argc, char** argv) {
138 139
139 Config config{config_path}; 140 Config config{config_path};
140 141
142 // apply the log_filter setting
143 // the logger was initialized before and doesn't pick up the filter on its own
144 Common::Log::Filter filter;
145 filter.ParseFilterString(Settings::values.log_filter.GetValue());
146 Common::Log::SetGlobalFilter(filter);
147
141 if (!program_args.empty()) { 148 if (!program_args.empty()) {
142 Settings::values.program_args = program_args; 149 Settings::values.program_args = program_args;
143 } 150 }
@@ -210,6 +217,7 @@ int main(int argc, char** argv) {
210 217
211 // Core is loaded, start the GPU (makes the GPU contexts current to this thread) 218 // Core is loaded, start the GPU (makes the GPU contexts current to this thread)
212 system.GPU().Start(); 219 system.GPU().Start();
220 system.GetCpuManager().OnGpuReady();
213 221
214 if (Settings::values.use_disk_shader_cache.GetValue()) { 222 if (Settings::values.use_disk_shader_cache.GetValue()) {
215 system.Renderer().ReadRasterizer()->LoadDiskResources( 223 system.Renderer().ReadRasterizer()->LoadDiskResources(