diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/apt_u.cpp | 56 |
1 files changed, 39 insertions, 17 deletions
diff --git a/src/core/hle/service/apt_u.cpp b/src/core/hle/service/apt_u.cpp index 4997a681e..9cac9aef9 100644 --- a/src/core/hle/service/apt_u.cpp +++ b/src/core/hle/service/apt_u.cpp | |||
| @@ -78,6 +78,25 @@ void InquireNotification(Service::Interface* self) { | |||
| 78 | WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X", app_id); | 78 | WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X", app_id); |
| 79 | } | 79 | } |
| 80 | 80 | ||
| 81 | /** | ||
| 82 | * APT_U::ReceiveParameter service function. This returns the current parameter data from NS state, | ||
| 83 | * from the source process which set the parameters. Once finished, NS will clear a flag in the NS | ||
| 84 | * state so that this command will return an error if this command is used again if parameters were | ||
| 85 | * not set again. This is called when the second Initialize event is triggered. It returns a signal | ||
| 86 | * type indicating why it was triggered. | ||
| 87 | * Inputs: | ||
| 88 | * 1 : AppID | ||
| 89 | * 2 : Parameter buffer size, max size is 0x1000 | ||
| 90 | * Outputs: | ||
| 91 | * 1 : Result of function, 0 on success, otherwise error code | ||
| 92 | * 2 : Unknown, for now assume AppID of the process which sent these parameters | ||
| 93 | * 3 : Unknown, for now assume Signal type | ||
| 94 | * 4 : Actual parameter buffer size, this is <= to the the input size | ||
| 95 | * 5 : Value | ||
| 96 | * 6 : Handle from the source process which set the parameters, likely used for shared memory | ||
| 97 | * 7 : Size | ||
| 98 | * 8 : Output parameter buffer ptr | ||
| 99 | */ | ||
| 81 | void ReceiveParameter(Service::Interface* self) { | 100 | void ReceiveParameter(Service::Interface* self) { |
| 82 | u32* cmd_buff = Service::GetCommandBuffer(); | 101 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 83 | u32 app_id = cmd_buff[1]; | 102 | u32 app_id = cmd_buff[1]; |
| @@ -85,7 +104,7 @@ void ReceiveParameter(Service::Interface* self) { | |||
| 85 | cmd_buff[1] = 0; // No error | 104 | cmd_buff[1] = 0; // No error |
| 86 | cmd_buff[2] = 0; | 105 | cmd_buff[2] = 0; |
| 87 | cmd_buff[3] = static_cast<u32>(SignalType::AppJustStarted); // Signal type | 106 | cmd_buff[3] = static_cast<u32>(SignalType::AppJustStarted); // Signal type |
| 88 | cmd_buff[4] = 0x10; | 107 | cmd_buff[4] = 0x10; // Parameter buffer size (16) |
| 89 | cmd_buff[5] = 0; | 108 | cmd_buff[5] = 0; |
| 90 | cmd_buff[6] = 0; | 109 | cmd_buff[6] = 0; |
| 91 | cmd_buff[7] = 0; | 110 | cmd_buff[7] = 0; |
| @@ -93,32 +112,35 @@ void ReceiveParameter(Service::Interface* self) { | |||
| 93 | } | 112 | } |
| 94 | 113 | ||
| 95 | /** | 114 | /** |
| 96 | * APT_U::GlanceParameter service function | 115 | * APT_U::GlanceParameter service function. This is exactly the same as APT_U::ReceiveParameter |
| 97 | * Inputs: | 116 | * (except for the word value prior to the output handle), except this will not clear the flag |
| 98 | * 1 : AppID | 117 | * (except when responseword[3]==8 || responseword[3]==9) in NS state. |
| 99 | * 2 : Parameter buffer size, max size is 0x1000 | 118 | * Inputs: |
| 100 | * Outputs: | 119 | * 1 : AppID |
| 101 | * 1 : Result of function, 0 on success, otherwise error code | 120 | * 2 : Parameter buffer size, max size is 0x1000 |
| 102 | * 2 : Unknown, for now assume AppID of the process which sent these parameters | 121 | * Outputs: |
| 103 | * 3 : Unknown, for now assume Signal type | 122 | * 1 : Result of function, 0 on success, otherwise error code |
| 104 | * 4 : Actual parameter buffer size, this is <= to the the input size | 123 | * 2 : Unknown, for now assume AppID of the process which sent these parameters |
| 105 | * 5 : Value | 124 | * 3 : Unknown, for now assume Signal type |
| 106 | * 6 : Handle from the source process which set the parameters, likely used for shared memory | 125 | * 4 : Actual parameter buffer size, this is <= to the the input size |
| 107 | * 7 : Size | 126 | * 5 : Value |
| 108 | * 8 : Output parameter buffer ptr | 127 | * 6 : Handle from the source process which set the parameters, likely used for shared memory |
| 109 | */ | 128 | * 7 : Size |
| 129 | * 8 : Output parameter buffer ptr | ||
| 130 | */ | ||
| 110 | void GlanceParameter(Service::Interface* self) { | 131 | void GlanceParameter(Service::Interface* self) { |
| 111 | u32* cmd_buff = Service::GetCommandBuffer(); | 132 | u32* cmd_buff = Service::GetCommandBuffer(); |
| 112 | u32 app_id = cmd_buff[1]; | 133 | u32 app_id = cmd_buff[1]; |
| 113 | u32 buffer_size = cmd_buff[2]; | 134 | u32 buffer_size = cmd_buff[2]; |
| 135 | |||
| 114 | cmd_buff[1] = 0; // No error | 136 | cmd_buff[1] = 0; // No error |
| 115 | cmd_buff[2] = 0; | 137 | cmd_buff[2] = 0; |
| 116 | cmd_buff[3] = static_cast<u32>(SignalType::AppJustStarted); // Signal type | 138 | cmd_buff[3] = static_cast<u32>(SignalType::AppJustStarted); // Signal type |
| 117 | cmd_buff[4] = 0; | 139 | cmd_buff[4] = 0x10; // Parameter buffer size (16) |
| 118 | cmd_buff[5] = 0; | 140 | cmd_buff[5] = 0; |
| 119 | cmd_buff[6] = 0; | 141 | cmd_buff[6] = 0; |
| 120 | cmd_buff[7] = 0; | 142 | cmd_buff[7] = 0; |
| 121 | cmd_buff[8] = 0; | 143 | |
| 122 | WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); | 144 | WARN_LOG(KERNEL, "(STUBBED) called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); |
| 123 | } | 145 | } |
| 124 | 146 | ||