|
|
@ -2,6 +2,8 @@
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "common/logging/log.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "core/file_sys/file_backend.h"
|
|
|
|
#include "core/file_sys/file_backend.h"
|
|
|
|
#include "core/hle/service/fs/archive.h"
|
|
|
|
#include "core/hle/service/fs/archive.h"
|
|
|
|
#include "core/hle/service/ptm/ptm.h"
|
|
|
|
#include "core/hle/service/ptm/ptm.h"
|
|
|
@ -23,20 +25,56 @@ static bool shell_open;
|
|
|
|
|
|
|
|
|
|
|
|
static bool battery_is_charging;
|
|
|
|
static bool battery_is_charging;
|
|
|
|
|
|
|
|
|
|
|
|
u32 GetAdapterState() {
|
|
|
|
void GetAdapterState(Service::Interface* self) {
|
|
|
|
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
return battery_is_charging ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
|
|
|
|
cmd_buff[2] = battery_is_charging ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_PTM, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
u32 GetShellState() {
|
|
|
|
void GetShellState(Service::Interface* self) {
|
|
|
|
return shell_open ? 1 : 0;
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
|
|
|
|
cmd_buff[2] = shell_open ? 1 : 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
ChargeLevels GetBatteryLevel() {
|
|
|
|
void GetBatteryLevel(Service::Interface* self) {
|
|
|
|
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
return ChargeLevels::CompletelyFull; // Set to a completely full battery
|
|
|
|
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
|
|
|
|
cmd_buff[2] = static_cast<u32>(ChargeLevels::CompletelyFull); // Set to a completely full battery
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_PTM, "(STUBBED) called");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void GetBatteryChargeState(Service::Interface* self) {
|
|
|
|
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO(purpasmart96): This function is only a stub,
|
|
|
|
|
|
|
|
// it returns a valid result without implementing full functionality.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
|
|
|
|
cmd_buff[2] = battery_is_charging ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_PTM, "(STUBBED) called");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void IsLegacyPowerOff(Service::Interface* self) {
|
|
|
|
|
|
|
|
u32* cmd_buff = Kernel::GetCommandBuffer();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cmd_buff[1] = RESULT_SUCCESS.raw;
|
|
|
|
|
|
|
|
cmd_buff[2] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOG_WARNING(Service_PTM, "(STUBBED) called");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Init() {
|
|
|
|
void Init() {
|
|
|
|