diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 25 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 1 |
2 files changed, 19 insertions, 7 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 33cebb48b..aef494476 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -270,7 +270,7 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger | |||
| 270 | {70, nullptr, "ReportMultimediaError"}, | 270 | {70, nullptr, "ReportMultimediaError"}, |
| 271 | {71, nullptr, "GetCurrentIlluminanceEx"}, | 271 | {71, nullptr, "GetCurrentIlluminanceEx"}, |
| 272 | {80, nullptr, "SetWirelessPriorityMode"}, | 272 | {80, nullptr, "SetWirelessPriorityMode"}, |
| 273 | {90, nullptr, "GetAccumulatedSuspendedTickValue"}, | 273 | {90, &ISelfController::GetAccumulatedSuspendedTickValue, "GetAccumulatedSuspendedTickValue"}, |
| 274 | {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"}, | 274 | {91, &ISelfController::GetAccumulatedSuspendedTickChangedEvent, "GetAccumulatedSuspendedTickChangedEvent"}, |
| 275 | {100, nullptr, "SetAlbumImageTakenNotificationEnabled"}, | 275 | {100, nullptr, "SetAlbumImageTakenNotificationEnabled"}, |
| 276 | {1000, nullptr, "GetDebugStorageChannel"}, | 276 | {1000, nullptr, "GetDebugStorageChannel"}, |
| @@ -283,10 +283,13 @@ ISelfController::ISelfController(std::shared_ptr<NVFlinger::NVFlinger> nvflinger | |||
| 283 | launchable_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, | 283 | launchable_event = Kernel::WritableEvent::CreateEventPair(kernel, Kernel::ResetType::Manual, |
| 284 | "ISelfController:LaunchableEvent"); | 284 | "ISelfController:LaunchableEvent"); |
| 285 | 285 | ||
| 286 | // TODO(ogniK): Figure out where, when and why this event gets signalled | 286 | // This event is created by AM on the first time GetAccumulatedSuspendedTickChangedEvent() is called. |
| 287 | // Yuzu can just create it unconditionally, since it doesn't need to support multiple ISelfControllers. | ||
| 288 | // The event is signaled on creation, and on transition from suspended -> not suspended if the event has | ||
| 289 | // previously been created by a call to GetAccumulatedSuspendedTickChangedEvent. | ||
| 287 | accumulated_suspended_tick_changed_event = Kernel::WritableEvent::CreateEventPair( | 290 | accumulated_suspended_tick_changed_event = Kernel::WritableEvent::CreateEventPair( |
| 288 | kernel, Kernel::ResetType::Manual, "ISelfController:AccumulatedSuspendedTickChangedEvent"); | 291 | kernel, Kernel::ResetType::Manual, "ISelfController:AccumulatedSuspendedTickChangedEvent"); |
| 289 | accumulated_suspended_tick_changed_event.writable->Signal(); // Is signalled on creation | 292 | accumulated_suspended_tick_changed_event.writable->Signal(); |
| 290 | } | 293 | } |
| 291 | 294 | ||
| 292 | ISelfController::~ISelfController() = default; | 295 | ISelfController::~ISelfController() = default; |
| @@ -449,11 +452,19 @@ void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& c | |||
| 449 | rb.Push<u32>(idle_time_detection_extension); | 452 | rb.Push<u32>(idle_time_detection_extension); |
| 450 | } | 453 | } |
| 451 | 454 | ||
| 455 | void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) { | ||
| 456 | LOG_DEBUG(Service_AM, "called."); | ||
| 457 | |||
| 458 | // This command returns the total number of system ticks since ISelfController creation | ||
| 459 | // where the game was suspended. Since Yuzu doesn't implement game suspension, this command | ||
| 460 | // can just always return 0 ticks. | ||
| 461 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 462 | rb.Push(RESULT_SUCCESS); | ||
| 463 | rb.Push<u64>(0); | ||
| 464 | } | ||
| 465 | |||
| 452 | void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx) { | 466 | void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx) { |
| 453 | // The implementation of this function is fine as is, the reason we're labelling it as stubbed | 467 | LOG_DEBUG(Service_AM, "called."); |
| 454 | // is because we're currently unsure when and where accumulated_suspended_tick_changed_event is | ||
| 455 | // actually signalled for the time being. | ||
| 456 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 457 | 468 | ||
| 458 | IPC::ResponseBuilder rb{ctx, 2, 1}; | 469 | IPC::ResponseBuilder rb{ctx, 2, 1}; |
| 459 | rb.Push(RESULT_SUCCESS); | 470 | rb.Push(RESULT_SUCCESS); |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index 4ea609d23..49ff20959 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -133,6 +133,7 @@ private: | |||
| 133 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); | 133 | void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx); |
| 134 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 134 | void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
| 135 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); | 135 | void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx); |
| 136 | void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx); | ||
| 136 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); | 137 | void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx); |
| 137 | 138 | ||
| 138 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger; | 139 | std::shared_ptr<NVFlinger::NVFlinger> nvflinger; |