refactor APT service to use the new IPC helpers

This commit is contained in:
Lectem 2016-12-28 17:11:14 +01:00
parent 423ab5e2bc
commit 501e23ce59
4 changed files with 254 additions and 191 deletions

View file

@ -92,8 +92,7 @@ void GetSoftwareClosedFlag(Service::Interface* self) {
LOG_WARNING(Service_PTM, "(STUBBED) called");
}
void CheckNew3DS(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
void CheckNew3DS(IPC::RequestBuilder& rb) {
const bool is_new_3ds = Settings::values.is_new_3ds;
if (is_new_3ds) {
@ -101,12 +100,17 @@ void CheckNew3DS(Service::Interface* self) {
"settings. Citra does not fully support New 3DS emulation yet!");
}
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = is_new_3ds ? 1 : 0;
rb.Push(RESULT_SUCCESS);
rb.Push(u32(is_new_3ds ? 1 : 0));
LOG_WARNING(Service_PTM, "(STUBBED) called isNew3DS = 0x%08x", static_cast<u32>(is_new_3ds));
}
void CheckNew3DS(Service::Interface* self) {
IPC::RequestBuilder rb(Kernel::GetCommandBuffer(), 0x040A0000);
CheckNew3DS(rb);
}
void Init() {
AddService(new PTM_Gets);
AddService(new PTM_Play);

View file

@ -5,6 +5,7 @@
#pragma once
#include "common/common_types.h"
#include "core/hle/ipc_helpers.h"
namespace Service {
@ -97,6 +98,7 @@ void GetSoftwareClosedFlag(Interface* self);
* 2: u8 output: 0 = Old3DS, 1 = New3DS.
*/
void CheckNew3DS(Interface* self);
void CheckNew3DS(IPC::RequestBuilder& rb);
/// Initialize the PTM service
void Init();