summaryrefslogtreecommitdiff
path: root/src/core/hle/service/ptm
diff options
context:
space:
mode:
authorGravatar Lectem2016-12-28 17:11:14 +0100
committerGravatar Lectem2017-03-18 10:44:01 +0100
commit501e23ce59a84cb0b0ef3db5b1c84939fa732811 (patch)
tree00f79bb33e874da62310fc334e35434b2a446366 /src/core/hle/service/ptm
parentMerge pull request #2497 from wwylele/input-2 (diff)
downloadyuzu-501e23ce59a84cb0b0ef3db5b1c84939fa732811.tar.gz
yuzu-501e23ce59a84cb0b0ef3db5b1c84939fa732811.tar.xz
yuzu-501e23ce59a84cb0b0ef3db5b1c84939fa732811.zip
refactor APT service to use the new IPC helpers
Diffstat (limited to 'src/core/hle/service/ptm')
-rw-r--r--src/core/hle/service/ptm/ptm.cpp12
-rw-r--r--src/core/hle/service/ptm/ptm.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp
index 8ff808fd9..016ac8d4f 100644
--- a/src/core/hle/service/ptm/ptm.cpp
+++ b/src/core/hle/service/ptm/ptm.cpp
@@ -92,8 +92,7 @@ void GetSoftwareClosedFlag(Service::Interface* self) {
92 LOG_WARNING(Service_PTM, "(STUBBED) called"); 92 LOG_WARNING(Service_PTM, "(STUBBED) called");
93} 93}
94 94
95void CheckNew3DS(Service::Interface* self) { 95void CheckNew3DS(IPC::RequestBuilder& rb) {
96 u32* cmd_buff = Kernel::GetCommandBuffer();
97 const bool is_new_3ds = Settings::values.is_new_3ds; 96 const bool is_new_3ds = Settings::values.is_new_3ds;
98 97
99 if (is_new_3ds) { 98 if (is_new_3ds) {
@@ -101,12 +100,17 @@ void CheckNew3DS(Service::Interface* self) {
101 "settings. Citra does not fully support New 3DS emulation yet!"); 100 "settings. Citra does not fully support New 3DS emulation yet!");
102 } 101 }
103 102
104 cmd_buff[1] = RESULT_SUCCESS.raw; 103 rb.Push(RESULT_SUCCESS);
105 cmd_buff[2] = is_new_3ds ? 1 : 0; 104 rb.Push(u32(is_new_3ds ? 1 : 0));
106 105
107 LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x%08x", static_cast<u32>(is_new_3ds)); 106 LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x%08x", static_cast<u32>(is_new_3ds));
108} 107}
109 108
109void CheckNew3DS(Service::Interface* self) {
110 IPC::RequestBuilder rb(Kernel::GetCommandBuffer(), 0x040A0000);
111 CheckNew3DS(rb);
112}
113
110void Init() { 114void Init() {
111 AddService(new PTM_Gets); 115 AddService(new PTM_Gets);
112 AddService(new PTM_Play); 116 AddService(new PTM_Play);
diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h
index a1a628012..683fb445b 100644
--- a/src/core/hle/service/ptm/ptm.h
+++ b/src/core/hle/service/ptm/ptm.h
@@ -5,6 +5,7 @@
5#pragma once 5#pragma once
6 6
7#include "common/common_types.h" 7#include "common/common_types.h"
8#include "core/hle/ipc_helpers.h"
8 9
9namespace Service { 10namespace Service {
10 11
@@ -97,6 +98,7 @@ void GetSoftwareClosedFlag(Interface* self);
97 * 2: u8 output: 0 = Old3DS, 1 = New3DS. 98 * 2: u8 output: 0 = Old3DS, 1 = New3DS.
98 */ 99 */
99void CheckNew3DS(Interface* self); 100void CheckNew3DS(Interface* self);
101void CheckNew3DS(IPC::RequestBuilder& rb);
100 102
101/// Initialize the PTM service 103/// Initialize the PTM service
102void Init(); 104void Init();