diff options
Diffstat (limited to 'src/core')
19 files changed, 128 insertions, 47 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp index 435ef6793..bd5f11d53 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp | |||
| @@ -242,7 +242,7 @@ struct System::Impl { | |||
| 242 | void Run() { | 242 | void Run() { |
| 243 | std::unique_lock<std::mutex> lk(suspend_guard); | 243 | std::unique_lock<std::mutex> lk(suspend_guard); |
| 244 | 244 | ||
| 245 | kernel.SuspendApplication(false); | 245 | kernel.SuspendEmulation(false); |
| 246 | core_timing.SyncPause(false); | 246 | core_timing.SyncPause(false); |
| 247 | is_paused.store(false, std::memory_order_relaxed); | 247 | is_paused.store(false, std::memory_order_relaxed); |
| 248 | } | 248 | } |
| @@ -251,7 +251,7 @@ struct System::Impl { | |||
| 251 | std::unique_lock<std::mutex> lk(suspend_guard); | 251 | std::unique_lock<std::mutex> lk(suspend_guard); |
| 252 | 252 | ||
| 253 | core_timing.SyncPause(true); | 253 | core_timing.SyncPause(true); |
| 254 | kernel.SuspendApplication(true); | 254 | kernel.SuspendEmulation(true); |
| 255 | is_paused.store(true, std::memory_order_relaxed); | 255 | is_paused.store(true, std::memory_order_relaxed); |
| 256 | } | 256 | } |
| 257 | 257 | ||
| @@ -261,7 +261,7 @@ struct System::Impl { | |||
| 261 | 261 | ||
| 262 | std::unique_lock<std::mutex> StallApplication() { | 262 | std::unique_lock<std::mutex> StallApplication() { |
| 263 | std::unique_lock<std::mutex> lk(suspend_guard); | 263 | std::unique_lock<std::mutex> lk(suspend_guard); |
| 264 | kernel.SuspendApplication(true); | 264 | kernel.SuspendEmulation(true); |
| 265 | core_timing.SyncPause(true); | 265 | core_timing.SyncPause(true); |
| 266 | return lk; | 266 | return lk; |
| 267 | } | 267 | } |
| @@ -269,7 +269,7 @@ struct System::Impl { | |||
| 269 | void UnstallApplication() { | 269 | void UnstallApplication() { |
| 270 | if (!IsPaused()) { | 270 | if (!IsPaused()) { |
| 271 | core_timing.SyncPause(false); | 271 | core_timing.SyncPause(false); |
| 272 | kernel.SuspendApplication(false); | 272 | kernel.SuspendEmulation(false); |
| 273 | } | 273 | } |
| 274 | } | 274 | } |
| 275 | 275 | ||
| @@ -459,7 +459,7 @@ struct System::Impl { | |||
| 459 | } | 459 | } |
| 460 | 460 | ||
| 461 | Network::CancelPendingSocketOperations(); | 461 | Network::CancelPendingSocketOperations(); |
| 462 | kernel.SuspendApplication(true); | 462 | kernel.SuspendEmulation(true); |
| 463 | if (services) { | 463 | if (services) { |
| 464 | services->KillNVNFlinger(); | 464 | services->KillNVNFlinger(); |
| 465 | } | 465 | } |
diff --git a/src/core/file_sys/control_metadata.h b/src/core/file_sys/control_metadata.h index 555b9d8f7..667efbbab 100644 --- a/src/core/file_sys/control_metadata.h +++ b/src/core/file_sys/control_metadata.h | |||
| @@ -64,8 +64,8 @@ struct RawNACP { | |||
| 64 | u64_le cache_storage_size; | 64 | u64_le cache_storage_size; |
| 65 | u64_le cache_storage_journal_size; | 65 | u64_le cache_storage_journal_size; |
| 66 | u64_le cache_storage_data_and_journal_max_size; | 66 | u64_le cache_storage_data_and_journal_max_size; |
| 67 | u64_le cache_storage_max_index; | 67 | u16_le cache_storage_max_index; |
| 68 | INSERT_PADDING_BYTES(0xE70); | 68 | INSERT_PADDING_BYTES(0xE76); |
| 69 | }; | 69 | }; |
| 70 | static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size."); | 70 | static_assert(sizeof(RawNACP) == 0x4000, "RawNACP has incorrect size."); |
| 71 | 71 | ||
diff --git a/src/core/hle/kernel/k_thread.h b/src/core/hle/kernel/k_thread.h index f13e232b2..e928cfebc 100644 --- a/src/core/hle/kernel/k_thread.h +++ b/src/core/hle/kernel/k_thread.h | |||
| @@ -66,6 +66,7 @@ enum class SuspendType : u32 { | |||
| 66 | Debug = 2, | 66 | Debug = 2, |
| 67 | Backtrace = 3, | 67 | Backtrace = 3, |
| 68 | Init = 4, | 68 | Init = 4, |
| 69 | System = 5, | ||
| 69 | 70 | ||
| 70 | Count, | 71 | Count, |
| 71 | }; | 72 | }; |
| @@ -84,8 +85,9 @@ enum class ThreadState : u16 { | |||
| 84 | DebugSuspended = (1 << (2 + SuspendShift)), | 85 | DebugSuspended = (1 << (2 + SuspendShift)), |
| 85 | BacktraceSuspended = (1 << (3 + SuspendShift)), | 86 | BacktraceSuspended = (1 << (3 + SuspendShift)), |
| 86 | InitSuspended = (1 << (4 + SuspendShift)), | 87 | InitSuspended = (1 << (4 + SuspendShift)), |
| 88 | SystemSuspended = (1 << (5 + SuspendShift)), | ||
| 87 | 89 | ||
| 88 | SuspendFlagMask = ((1 << 5) - 1) << SuspendShift, | 90 | SuspendFlagMask = ((1 << 6) - 1) << SuspendShift, |
| 89 | }; | 91 | }; |
| 90 | DECLARE_ENUM_FLAG_OPERATORS(ThreadState); | 92 | DECLARE_ENUM_FLAG_OPERATORS(ThreadState); |
| 91 | 93 | ||
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 34b25be66..4f4b02fac 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp | |||
| @@ -1204,39 +1204,48 @@ const Kernel::KSharedMemory& KernelCore::GetHidBusSharedMem() const { | |||
| 1204 | return *impl->hidbus_shared_mem; | 1204 | return *impl->hidbus_shared_mem; |
| 1205 | } | 1205 | } |
| 1206 | 1206 | ||
| 1207 | void KernelCore::SuspendApplication(bool suspended) { | 1207 | void KernelCore::SuspendEmulation(bool suspended) { |
| 1208 | const bool should_suspend{exception_exited || suspended}; | 1208 | const bool should_suspend{exception_exited || suspended}; |
| 1209 | const auto activity = | 1209 | auto processes = GetProcessList(); |
| 1210 | should_suspend ? Svc::ProcessActivity::Paused : Svc::ProcessActivity::Runnable; | ||
| 1211 | 1210 | ||
| 1212 | // Get the application process. | 1211 | for (auto& process : processes) { |
| 1213 | KScopedAutoObject<KProcess> process = ApplicationProcess(); | 1212 | KScopedLightLock ll{process->GetListLock()}; |
| 1214 | if (process.IsNull()) { | 1213 | |
| 1215 | return; | 1214 | for (auto& thread : process->GetThreadList()) { |
| 1215 | if (should_suspend) { | ||
| 1216 | thread.RequestSuspend(SuspendType::System); | ||
| 1217 | } else { | ||
| 1218 | thread.Resume(SuspendType::System); | ||
| 1219 | } | ||
| 1220 | } | ||
| 1216 | } | 1221 | } |
| 1217 | 1222 | ||
| 1218 | // Set the new activity. | 1223 | if (!should_suspend) { |
| 1219 | process->SetActivity(activity); | 1224 | return; |
| 1225 | } | ||
| 1220 | 1226 | ||
| 1221 | // Wait for process execution to stop. | 1227 | // Wait for process execution to stop. |
| 1222 | bool must_wait{should_suspend}; | 1228 | // KernelCore::SuspendEmulation must be called from locked context, |
| 1223 | 1229 | // or we could race another call, interfering with waiting. | |
| 1224 | // KernelCore::SuspendApplication must be called from locked context, | 1230 | const auto TryWait = [&]() { |
| 1225 | // or we could race another call to SetActivity, interfering with waiting. | ||
| 1226 | while (must_wait) { | ||
| 1227 | KScopedSchedulerLock sl{*this}; | 1231 | KScopedSchedulerLock sl{*this}; |
| 1228 | 1232 | ||
| 1229 | // Assume that all threads have finished running. | 1233 | for (auto& process : processes) { |
| 1230 | must_wait = false; | 1234 | for (auto i = 0; i < static_cast<s32>(Core::Hardware::NUM_CPU_CORES); ++i) { |
| 1231 | 1235 | if (Scheduler(i).GetSchedulerCurrentThread()->GetOwnerProcess() == | |
| 1232 | for (auto i = 0; i < static_cast<s32>(Core::Hardware::NUM_CPU_CORES); ++i) { | 1236 | process.GetPointerUnsafe()) { |
| 1233 | if (Scheduler(i).GetSchedulerCurrentThread()->GetOwnerProcess() == | 1237 | // A thread has not finished running yet. |
| 1234 | process.GetPointerUnsafe()) { | 1238 | // Continue waiting. |
| 1235 | // A thread has not finished running yet. | 1239 | return false; |
| 1236 | // Continue waiting. | 1240 | } |
| 1237 | must_wait = true; | ||
| 1238 | } | 1241 | } |
| 1239 | } | 1242 | } |
| 1243 | |||
| 1244 | return true; | ||
| 1245 | }; | ||
| 1246 | |||
| 1247 | while (!TryWait()) { | ||
| 1248 | // ... | ||
| 1240 | } | 1249 | } |
| 1241 | } | 1250 | } |
| 1242 | 1251 | ||
| @@ -1260,7 +1269,7 @@ bool KernelCore::IsShuttingDown() const { | |||
| 1260 | 1269 | ||
| 1261 | void KernelCore::ExceptionalExitApplication() { | 1270 | void KernelCore::ExceptionalExitApplication() { |
| 1262 | exception_exited = true; | 1271 | exception_exited = true; |
| 1263 | SuspendApplication(true); | 1272 | SuspendEmulation(true); |
| 1264 | } | 1273 | } |
| 1265 | 1274 | ||
| 1266 | void KernelCore::EnterSVCProfile() { | 1275 | void KernelCore::EnterSVCProfile() { |
diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 8ea5bed1c..57182c0c8 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h | |||
| @@ -258,8 +258,8 @@ public: | |||
| 258 | /// Gets the shared memory object for HIDBus services. | 258 | /// Gets the shared memory object for HIDBus services. |
| 259 | const Kernel::KSharedMemory& GetHidBusSharedMem() const; | 259 | const Kernel::KSharedMemory& GetHidBusSharedMem() const; |
| 260 | 260 | ||
| 261 | /// Suspend/unsuspend application process. | 261 | /// Suspend/unsuspend emulated processes. |
| 262 | void SuspendApplication(bool suspend); | 262 | void SuspendEmulation(bool suspend); |
| 263 | 263 | ||
| 264 | /// Exceptional exit application process. | 264 | /// Exceptional exit application process. |
| 265 | void ExceptionalExitApplication(); | 265 | void ExceptionalExitApplication(); |
diff --git a/src/core/hle/service/acc/profile_manager.cpp b/src/core/hle/service/acc/profile_manager.cpp index 29a10ad13..ee9795532 100644 --- a/src/core/hle/service/acc/profile_manager.cpp +++ b/src/core/hle/service/acc/profile_manager.cpp | |||
| @@ -329,9 +329,8 @@ bool ProfileManager::GetProfileBaseAndData(const ProfileInfo& user, ProfileBase& | |||
| 329 | 329 | ||
| 330 | /// Returns if the system is allowing user registrations or not | 330 | /// Returns if the system is allowing user registrations or not |
| 331 | bool ProfileManager::CanSystemRegisterUser() const { | 331 | bool ProfileManager::CanSystemRegisterUser() const { |
| 332 | return false; // TODO(ogniK): Games shouldn't have | 332 | // TODO: Both games and applets can register users. Determine when this condition is not meet. |
| 333 | // access to user registration, when we | 333 | return true; |
| 334 | // emulate qlaunch. Update this to dynamically change. | ||
| 335 | } | 334 | } |
| 336 | 335 | ||
| 337 | bool ProfileManager::RemoveUser(UUID uuid) { | 336 | bool ProfileManager::RemoveUser(UUID uuid) { |
diff --git a/src/core/hle/service/am/applet_manager.cpp b/src/core/hle/service/am/applet_manager.cpp index 4c7266f89..2e109181d 100644 --- a/src/core/hle/service/am/applet_manager.cpp +++ b/src/core/hle/service/am/applet_manager.cpp | |||
| @@ -35,6 +35,21 @@ AppletStorageChannel& InitializeFakeCallerApplet(Core::System& system, | |||
| 35 | return applet->caller_applet_broker->GetInData(); | 35 | return applet->caller_applet_broker->GetInData(); |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | void PushInShowQlaunch(Core::System& system, AppletStorageChannel& channel) { | ||
| 39 | const CommonArguments arguments{ | ||
| 40 | .arguments_version = CommonArgumentVersion::Version3, | ||
| 41 | .size = CommonArgumentSize::Version3, | ||
| 42 | .library_version = 0, | ||
| 43 | .theme_color = ThemeColor::BasicBlack, | ||
| 44 | .play_startup_sound = true, | ||
| 45 | .system_tick = system.CoreTiming().GetClockTicks(), | ||
| 46 | }; | ||
| 47 | |||
| 48 | std::vector<u8> argument_data(sizeof(arguments)); | ||
| 49 | std::memcpy(argument_data.data(), &arguments, sizeof(arguments)); | ||
| 50 | channel.Push(std::make_shared<IStorage>(system, std::move(argument_data))); | ||
| 51 | } | ||
| 52 | |||
| 38 | void PushInShowAlbum(Core::System& system, AppletStorageChannel& channel) { | 53 | void PushInShowAlbum(Core::System& system, AppletStorageChannel& channel) { |
| 39 | const CommonArguments arguments{ | 54 | const CommonArguments arguments{ |
| 40 | .arguments_version = CommonArgumentVersion::Version3, | 55 | .arguments_version = CommonArgumentVersion::Version3, |
| @@ -284,6 +299,9 @@ void AppletManager::CreateAndInsertByFrontendAppletParameters( | |||
| 284 | 299 | ||
| 285 | // Starting from frontend, some applets require input data. | 300 | // Starting from frontend, some applets require input data. |
| 286 | switch (applet->applet_id) { | 301 | switch (applet->applet_id) { |
| 302 | case AppletId::QLaunch: | ||
| 303 | PushInShowQlaunch(m_system, InitializeFakeCallerApplet(m_system, applet)); | ||
| 304 | break; | ||
| 287 | case AppletId::Cabinet: | 305 | case AppletId::Cabinet: |
| 288 | PushInShowCabinetData(m_system, InitializeFakeCallerApplet(m_system, applet)); | 306 | PushInShowCabinetData(m_system, InitializeFakeCallerApplet(m_system, applet)); |
| 289 | break; | 307 | break; |
diff --git a/src/core/hle/service/am/service/application_functions.cpp b/src/core/hle/service/am/service/application_functions.cpp index b788fddd4..63dd12a47 100644 --- a/src/core/hle/service/am/service/application_functions.cpp +++ b/src/core/hle/service/am/service/application_functions.cpp | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include "core/hle/service/cmif_serialization.h" | 15 | #include "core/hle/service/cmif_serialization.h" |
| 16 | #include "core/hle/service/filesystem/filesystem.h" | 16 | #include "core/hle/service/filesystem/filesystem.h" |
| 17 | #include "core/hle/service/filesystem/save_data_controller.h" | 17 | #include "core/hle/service/filesystem/save_data_controller.h" |
| 18 | #include "core/hle/service/glue/glue_manager.h" | ||
| 18 | #include "core/hle/service/ns/ns.h" | 19 | #include "core/hle/service/ns/ns.h" |
| 19 | #include "core/hle/service/sm/sm.h" | 20 | #include "core/hle/service/sm/sm.h" |
| 20 | 21 | ||
| @@ -40,7 +41,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_, std::shared_ | |||
| 40 | {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, | 41 | {26, D<&IApplicationFunctions::GetSaveDataSize>, "GetSaveDataSize"}, |
| 41 | {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, | 42 | {27, D<&IApplicationFunctions::CreateCacheStorage>, "CreateCacheStorage"}, |
| 42 | {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, | 43 | {28, D<&IApplicationFunctions::GetSaveDataSizeMax>, "GetSaveDataSizeMax"}, |
| 43 | {29, nullptr, "GetCacheStorageMax"}, | 44 | {29, D<&IApplicationFunctions::GetCacheStorageMax>, "GetCacheStorageMax"}, |
| 44 | {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, | 45 | {30, D<&IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed>, "BeginBlockingHomeButtonShortAndLongPressed"}, |
| 45 | {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, | 46 | {31, D<&IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed>, "EndBlockingHomeButtonShortAndLongPressed"}, |
| 46 | {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, | 47 | {32, D<&IApplicationFunctions::BeginBlockingHomeButton>, "BeginBlockingHomeButton"}, |
| @@ -267,6 +268,22 @@ Result IApplicationFunctions::GetSaveDataSizeMax(Out<u64> out_max_normal_size, | |||
| 267 | R_SUCCEED(); | 268 | R_SUCCEED(); |
| 268 | } | 269 | } |
| 269 | 270 | ||
| 271 | Result IApplicationFunctions::GetCacheStorageMax(Out<u32> out_cache_storage_index_max, | ||
| 272 | Out<u64> out_max_journal_size) { | ||
| 273 | LOG_DEBUG(Service_AM, "called"); | ||
| 274 | |||
| 275 | std::vector<u8> nacp; | ||
| 276 | R_TRY(system.GetARPManager().GetControlProperty(&nacp, m_applet->program_id)); | ||
| 277 | |||
| 278 | auto raw_nacp = std::make_unique<FileSys::RawNACP>(); | ||
| 279 | std::memcpy(raw_nacp.get(), nacp.data(), std::min(sizeof(*raw_nacp), nacp.size())); | ||
| 280 | |||
| 281 | *out_cache_storage_index_max = static_cast<u32>(raw_nacp->cache_storage_max_index); | ||
| 282 | *out_max_journal_size = static_cast<u64>(raw_nacp->cache_storage_data_and_journal_max_size); | ||
| 283 | |||
| 284 | R_SUCCEED(); | ||
| 285 | } | ||
| 286 | |||
| 270 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { | 287 | Result IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(s64 unused) { |
| 271 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 288 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 272 | 289 | ||
diff --git a/src/core/hle/service/am/service/application_functions.h b/src/core/hle/service/am/service/application_functions.h index 3548202f8..10025a152 100644 --- a/src/core/hle/service/am/service/application_functions.h +++ b/src/core/hle/service/am/service/application_functions.h | |||
| @@ -40,6 +40,7 @@ private: | |||
| 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, | 40 | Result CreateCacheStorage(Out<u32> out_target_media, Out<u64> out_required_size, u16 index, |
| 41 | u64 normal_size, u64 journal_size); | 41 | u64 normal_size, u64 journal_size); |
| 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); | 42 | Result GetSaveDataSizeMax(Out<u64> out_max_normal_size, Out<u64> out_max_journal_size); |
| 43 | Result GetCacheStorageMax(Out<u32> out_cache_storage_index_max, Out<u64> out_max_journal_size); | ||
| 43 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); | 44 | Result BeginBlockingHomeButtonShortAndLongPressed(s64 unused); |
| 44 | Result EndBlockingHomeButtonShortAndLongPressed(); | 45 | Result EndBlockingHomeButtonShortAndLongPressed(); |
| 45 | Result BeginBlockingHomeButton(s64 timeout_ns); | 46 | Result BeginBlockingHomeButton(s64 timeout_ns); |
diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.cpp b/src/core/hle/service/am/service/library_applet_self_accessor.cpp index 7a3a86e88..94bd4dae6 100644 --- a/src/core/hle/service/am/service/library_applet_self_accessor.cpp +++ b/src/core/hle/service/am/service/library_applet_self_accessor.cpp | |||
| @@ -284,17 +284,17 @@ Result ILibraryAppletSelfAccessor::GetCurrentApplicationId(Out<u64> out_applicat | |||
| 284 | } | 284 | } |
| 285 | 285 | ||
| 286 | Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( | 286 | Result ILibraryAppletSelfAccessor::GetMainAppletAvailableUsers( |
| 287 | Out<bool> out_no_users_available, Out<s32> out_users_count, | 287 | Out<bool> out_can_select_any_user, Out<s32> out_users_count, |
| 288 | OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) { | 288 | OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users) { |
| 289 | const Service::Account::ProfileManager manager{}; | 289 | const Service::Account::ProfileManager manager{}; |
| 290 | 290 | ||
| 291 | *out_no_users_available = true; | 291 | *out_can_select_any_user = false; |
| 292 | *out_users_count = -1; | 292 | *out_users_count = -1; |
| 293 | 293 | ||
| 294 | LOG_INFO(Service_AM, "called"); | 294 | LOG_INFO(Service_AM, "called"); |
| 295 | 295 | ||
| 296 | if (manager.GetUserCount() > 0) { | 296 | if (manager.GetUserCount() > 0) { |
| 297 | *out_no_users_available = false; | 297 | *out_can_select_any_user = true; |
| 298 | *out_users_count = static_cast<s32>(manager.GetUserCount()); | 298 | *out_users_count = static_cast<s32>(manager.GetUserCount()); |
| 299 | 299 | ||
| 300 | const auto users = manager.GetAllUsers(); | 300 | const auto users = manager.GetAllUsers(); |
diff --git a/src/core/hle/service/am/service/library_applet_self_accessor.h b/src/core/hle/service/am/service/library_applet_self_accessor.h index a9743569f..3e60393c2 100644 --- a/src/core/hle/service/am/service/library_applet_self_accessor.h +++ b/src/core/hle/service/am/service/library_applet_self_accessor.h | |||
| @@ -71,7 +71,7 @@ private: | |||
| 71 | ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context); | 71 | ErrorCode error_code, InLargeData<ErrorContext, BufferAttr_HipcMapAlias> error_context); |
| 72 | Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language); | 72 | Result GetMainAppletApplicationDesiredLanguage(Out<u64> out_desired_language); |
| 73 | Result GetCurrentApplicationId(Out<u64> out_application_id); | 73 | Result GetCurrentApplicationId(Out<u64> out_application_id); |
| 74 | Result GetMainAppletAvailableUsers(Out<bool> out_no_users_available, Out<s32> out_users_count, | 74 | Result GetMainAppletAvailableUsers(Out<bool> out_can_select_any_user, Out<s32> out_users_count, |
| 75 | OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users); | 75 | OutArray<Common::UUID, BufferAttr_HipcMapAlias> out_users); |
| 76 | Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually); | 76 | Result ShouldSetGpuTimeSliceManually(Out<bool> out_should_set_gpu_time_slice_manually); |
| 77 | Result Cmd160(Out<u64> out_unknown0); | 77 | Result Cmd160(Out<u64> out_unknown0); |
diff --git a/src/core/hle/service/caps/caps_a.cpp b/src/core/hle/service/caps/caps_a.cpp index 47ff072c5..52228b830 100644 --- a/src/core/hle/service/caps/caps_a.cpp +++ b/src/core/hle/service/caps/caps_a.cpp | |||
| @@ -16,7 +16,7 @@ IAlbumAccessorService::IAlbumAccessorService(Core::System& system_, | |||
| 16 | // clang-format off | 16 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 17 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "GetAlbumFileCount"}, | 18 | {0, nullptr, "GetAlbumFileCount"}, |
| 19 | {1, nullptr, "GetAlbumFileList"}, | 19 | {1, C<&IAlbumAccessorService::GetAlbumFileList>, "GetAlbumFileList"}, |
| 20 | {2, nullptr, "LoadAlbumFile"}, | 20 | {2, nullptr, "LoadAlbumFile"}, |
| 21 | {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, | 21 | {3, C<&IAlbumAccessorService::DeleteAlbumFile>, "DeleteAlbumFile"}, |
| 22 | {4, nullptr, "StorageCopyAlbumFile"}, | 22 | {4, nullptr, "StorageCopyAlbumFile"}, |
| @@ -62,6 +62,15 @@ IAlbumAccessorService::IAlbumAccessorService(Core::System& system_, | |||
| 62 | 62 | ||
| 63 | IAlbumAccessorService::~IAlbumAccessorService() = default; | 63 | IAlbumAccessorService::~IAlbumAccessorService() = default; |
| 64 | 64 | ||
| 65 | Result IAlbumAccessorService::GetAlbumFileList( | ||
| 66 | Out<u64> out_count, AlbumStorage storage, | ||
| 67 | OutArray<AlbumEntry, BufferAttr_HipcMapAlias> out_entries) { | ||
| 68 | LOG_INFO(Service_Capture, "called, storage={}", storage); | ||
| 69 | |||
| 70 | const Result result = manager->GetAlbumFileList(out_entries, *out_count, storage, 0); | ||
| 71 | R_RETURN(TranslateResult(result)); | ||
| 72 | } | ||
| 73 | |||
| 65 | Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) { | 74 | Result IAlbumAccessorService::DeleteAlbumFile(AlbumFileId file_id) { |
| 66 | LOG_INFO(Service_Capture, "called, application_id=0x{:0x}, storage={}, type={}", | 75 | LOG_INFO(Service_Capture, "called, application_id=0x{:0x}, storage={}, type={}", |
| 67 | file_id.application_id, file_id.storage, file_id.type); | 76 | file_id.application_id, file_id.storage, file_id.type); |
diff --git a/src/core/hle/service/caps/caps_a.h b/src/core/hle/service/caps/caps_a.h index 2cb9b4547..c7a5208e3 100644 --- a/src/core/hle/service/caps/caps_a.h +++ b/src/core/hle/service/caps/caps_a.h | |||
| @@ -21,6 +21,9 @@ public: | |||
| 21 | ~IAlbumAccessorService() override; | 21 | ~IAlbumAccessorService() override; |
| 22 | 22 | ||
| 23 | private: | 23 | private: |
| 24 | Result GetAlbumFileList(Out<u64> out_count, AlbumStorage storage, | ||
| 25 | OutArray<AlbumEntry, BufferAttr_HipcMapAlias> out_entries); | ||
| 26 | |||
| 24 | Result DeleteAlbumFile(AlbumFileId file_id); | 27 | Result DeleteAlbumFile(AlbumFileId file_id); |
| 25 | 28 | ||
| 26 | Result IsAlbumMounted(Out<bool> out_is_mounted, AlbumStorage storage); | 29 | Result IsAlbumMounted(Out<bool> out_is_mounted, AlbumStorage storage); |
diff --git a/src/core/hle/service/erpt/erpt.cpp b/src/core/hle/service/erpt/erpt.cpp index 3ea862fad..39ae3a723 100644 --- a/src/core/hle/service/erpt/erpt.cpp +++ b/src/core/hle/service/erpt/erpt.cpp | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #include <memory> | 4 | #include <memory> |
| 5 | 5 | ||
| 6 | #include "common/logging/log.h" | ||
| 7 | #include "core/hle/service/cmif_serialization.h" | ||
| 6 | #include "core/hle/service/erpt/erpt.h" | 8 | #include "core/hle/service/erpt/erpt.h" |
| 7 | #include "core/hle/service/server_manager.h" | 9 | #include "core/hle/service/server_manager.h" |
| 8 | #include "core/hle/service/service.h" | 10 | #include "core/hle/service/service.h" |
| @@ -15,7 +17,7 @@ public: | |||
| 15 | explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} { | 17 | explicit ErrorReportContext(Core::System& system_) : ServiceFramework{system_, "erpt:c"} { |
| 16 | // clang-format off | 18 | // clang-format off |
| 17 | static const FunctionInfo functions[] = { | 19 | static const FunctionInfo functions[] = { |
| 18 | {0, nullptr, "SubmitContext"}, | 20 | {0, C<&ErrorReportContext::SubmitContext>, "SubmitContext"}, |
| 19 | {1, nullptr, "CreateReportV0"}, | 21 | {1, nullptr, "CreateReportV0"}, |
| 20 | {2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, | 22 | {2, nullptr, "SetInitialLaunchSettingsCompletionTime"}, |
| 21 | {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, | 23 | {3, nullptr, "ClearInitialLaunchSettingsCompletionTime"}, |
| @@ -36,6 +38,14 @@ public: | |||
| 36 | 38 | ||
| 37 | RegisterHandlers(functions); | 39 | RegisterHandlers(functions); |
| 38 | } | 40 | } |
| 41 | |||
| 42 | private: | ||
| 43 | Result SubmitContext(InBuffer<BufferAttr_HipcMapAlias> buffer_a, | ||
| 44 | InBuffer<BufferAttr_HipcMapAlias> buffer_b) { | ||
| 45 | LOG_WARNING(Service_SET, "(STUBBED) called, buffer_a_size={}, buffer_b_size={}", | ||
| 46 | buffer_a.size(), buffer_b.size()); | ||
| 47 | R_SUCCEED(); | ||
| 48 | } | ||
| 39 | }; | 49 | }; |
| 40 | 50 | ||
| 41 | class ErrorReportSession final : public ServiceFramework<ErrorReportSession> { | 51 | class ErrorReportSession final : public ServiceFramework<ErrorReportSession> { |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index 63c2d3a58..2d49f30c8 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp | |||
| @@ -336,7 +336,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) | |||
| 336 | {1012, nullptr, "GetFsStackUsage"}, | 336 | {1012, nullptr, "GetFsStackUsage"}, |
| 337 | {1013, nullptr, "UnsetSaveDataRootPath"}, | 337 | {1013, nullptr, "UnsetSaveDataRootPath"}, |
| 338 | {1014, nullptr, "OutputMultiProgramTagAccessLog"}, | 338 | {1014, nullptr, "OutputMultiProgramTagAccessLog"}, |
| 339 | {1016, nullptr, "FlushAccessLogOnSdCard"}, | 339 | {1016, &FSP_SRV::FlushAccessLogOnSdCard, "FlushAccessLogOnSdCard"}, |
| 340 | {1017, nullptr, "OutputApplicationInfoAccessLog"}, | 340 | {1017, nullptr, "OutputApplicationInfoAccessLog"}, |
| 341 | {1018, nullptr, "SetDebugOption"}, | 341 | {1018, nullptr, "SetDebugOption"}, |
| 342 | {1019, nullptr, "UnsetDebugOption"}, | 342 | {1019, nullptr, "UnsetDebugOption"}, |
| @@ -706,6 +706,13 @@ void FSP_SRV::GetProgramIndexForAccessLog(HLERequestContext& ctx) { | |||
| 706 | rb.Push(access_log_program_index); | 706 | rb.Push(access_log_program_index); |
| 707 | } | 707 | } |
| 708 | 708 | ||
| 709 | void FSP_SRV::FlushAccessLogOnSdCard(HLERequestContext& ctx) { | ||
| 710 | LOG_DEBUG(Service_FS, "(STUBBED) called"); | ||
| 711 | |||
| 712 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 713 | rb.Push(ResultSuccess); | ||
| 714 | } | ||
| 715 | |||
| 709 | void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) { | 716 | void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) { |
| 710 | IPC::RequestParser rp{ctx}; | 717 | IPC::RequestParser rp{ctx}; |
| 711 | const auto index{rp.Pop<s32>()}; | 718 | const auto index{rp.Pop<s32>()}; |
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index 26980af99..59406e6f9 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h | |||
| @@ -58,6 +58,7 @@ private: | |||
| 58 | void SetGlobalAccessLogMode(HLERequestContext& ctx); | 58 | void SetGlobalAccessLogMode(HLERequestContext& ctx); |
| 59 | void GetGlobalAccessLogMode(HLERequestContext& ctx); | 59 | void GetGlobalAccessLogMode(HLERequestContext& ctx); |
| 60 | void OutputAccessLogToSdCard(HLERequestContext& ctx); | 60 | void OutputAccessLogToSdCard(HLERequestContext& ctx); |
| 61 | void FlushAccessLogOnSdCard(HLERequestContext& ctx); | ||
| 61 | void GetProgramIndexForAccessLog(HLERequestContext& ctx); | 62 | void GetProgramIndexForAccessLog(HLERequestContext& ctx); |
| 62 | void OpenMultiCommitManager(HLERequestContext& ctx); | 63 | void OpenMultiCommitManager(HLERequestContext& ctx); |
| 63 | void GetCacheStorageSize(HLERequestContext& ctx); | 64 | void GetCacheStorageSize(HLERequestContext& ctx); |
diff --git a/src/core/hle/service/glue/time/manager.cpp b/src/core/hle/service/glue/time/manager.cpp index cad755fa7..059ac3fc9 100644 --- a/src/core/hle/service/glue/time/manager.cpp +++ b/src/core/hle/service/glue/time/manager.cpp | |||
| @@ -186,6 +186,10 @@ TimeManager::TimeManager(Core::System& system) | |||
| 186 | } | 186 | } |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | TimeManager::~TimeManager() { | ||
| 190 | ResetTimeZoneBinary(); | ||
| 191 | } | ||
| 192 | |||
| 189 | Result TimeManager::SetupStandardSteadyClockCore() { | 193 | Result TimeManager::SetupStandardSteadyClockCore() { |
| 190 | Common::UUID external_clock_source_id{}; | 194 | Common::UUID external_clock_source_id{}; |
| 191 | auto res = m_set_sys->GetExternalSteadyClockSourceId(&external_clock_source_id); | 195 | auto res = m_set_sys->GetExternalSteadyClockSourceId(&external_clock_source_id); |
diff --git a/src/core/hle/service/glue/time/manager.h b/src/core/hle/service/glue/time/manager.h index 1de93f8f9..bb4b65049 100644 --- a/src/core/hle/service/glue/time/manager.h +++ b/src/core/hle/service/glue/time/manager.h | |||
| @@ -26,6 +26,7 @@ namespace Service::Glue::Time { | |||
| 26 | class TimeManager { | 26 | class TimeManager { |
| 27 | public: | 27 | public: |
| 28 | explicit TimeManager(Core::System& system); | 28 | explicit TimeManager(Core::System& system); |
| 29 | ~TimeManager(); | ||
| 29 | 30 | ||
| 30 | std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys; | 31 | std::shared_ptr<Service::Set::ISystemSettingsServer> m_set_sys; |
| 31 | 32 | ||
diff --git a/src/core/memory/cheat_engine.cpp b/src/core/memory/cheat_engine.cpp index b84b57d92..d8921e565 100644 --- a/src/core/memory/cheat_engine.cpp +++ b/src/core/memory/cheat_engine.cpp | |||
| @@ -117,9 +117,9 @@ bool StandardVmCallbacks::IsAddressInRange(VAddr in) const { | |||
| 117 | (in < metadata.heap_extents.base || | 117 | (in < metadata.heap_extents.base || |
| 118 | in >= metadata.heap_extents.base + metadata.heap_extents.size) && | 118 | in >= metadata.heap_extents.base + metadata.heap_extents.size) && |
| 119 | (in < metadata.alias_extents.base || | 119 | (in < metadata.alias_extents.base || |
| 120 | in >= metadata.heap_extents.base + metadata.alias_extents.size) && | 120 | in >= metadata.alias_extents.base + metadata.alias_extents.size) && |
| 121 | (in < metadata.aslr_extents.base || | 121 | (in < metadata.aslr_extents.base || |
| 122 | in >= metadata.heap_extents.base + metadata.aslr_extents.size)) { | 122 | in >= metadata.aslr_extents.base + metadata.aslr_extents.size)) { |
| 123 | LOG_DEBUG(CheatEngine, | 123 | LOG_DEBUG(CheatEngine, |
| 124 | "Cheat attempting to access memory at invalid address={:016X}, if this " | 124 | "Cheat attempting to access memory at invalid address={:016X}, if this " |
| 125 | "persists, " | 125 | "persists, " |