2015-02-27 02:13:08 +00:00
|
|
|
// Copyright 2015 Citra Emulator Project
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-02-02 06:17:41 +00:00
|
|
|
#include "common/common_types.h"
|
2016-12-28 16:11:14 +00:00
|
|
|
#include "core/hle/ipc_helpers.h"
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
namespace Service {
|
2016-02-02 06:17:41 +00:00
|
|
|
|
|
|
|
class Interface;
|
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
namespace PTM {
|
|
|
|
|
|
|
|
/// Charge levels used by PTM functions
|
|
|
|
enum class ChargeLevels : u32 {
|
2016-09-18 00:38:01 +00:00
|
|
|
CriticalBattery = 1,
|
|
|
|
LowBattery = 2,
|
|
|
|
HalfFull = 3,
|
|
|
|
MostlyFull = 4,
|
|
|
|
CompletelyFull = 5,
|
2015-02-27 02:13:08 +00:00
|
|
|
};
|
|
|
|
|
2015-05-25 18:34:09 +00:00
|
|
|
/**
|
2015-02-27 02:13:08 +00:00
|
|
|
* Represents the gamecoin file structure in the SharedExtData archive
|
2016-09-18 00:38:01 +00:00
|
|
|
* More information in 3dbrew
|
|
|
|
* (http://www.3dbrew.org/wiki/Extdata#Shared_Extdata_0xf000000b_gamecoin.dat)
|
2015-02-27 02:13:08 +00:00
|
|
|
*/
|
|
|
|
struct GameCoin {
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 magic; ///< Magic number: 0x4F00
|
|
|
|
u16 total_coins; ///< Total Play Coins
|
2015-02-27 02:13:08 +00:00
|
|
|
u16 total_coins_on_date; ///< Total Play Coins obtained on the date stored below.
|
2016-09-18 00:38:01 +00:00
|
|
|
u32 step_count; ///< Total step count at the time a new Play Coin was obtained.
|
|
|
|
u32 last_step_count; ///< Step count for the day the last Play Coin was obtained
|
2015-02-27 02:13:08 +00:00
|
|
|
u16 year;
|
|
|
|
u8 month;
|
|
|
|
u8 day;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* It is unknown if GetAdapterState is the same as GetBatteryChargeState,
|
|
|
|
* it is likely to just be a duplicate function of GetBatteryChargeState
|
|
|
|
* that controls another part of the HW.
|
2015-04-30 20:13:22 +00:00
|
|
|
* PTM::GetAdapterState service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Output of function, 0 = not charging, 1 = charging.
|
2015-02-27 02:13:08 +00:00
|
|
|
*/
|
2015-04-30 20:13:22 +00:00
|
|
|
void GetAdapterState(Interface* self);
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2015-04-30 20:13:22 +00:00
|
|
|
* PTM::GetShellState service function.
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Whether the 3DS's physical shell casing is open (1) or closed (0)
|
2015-02-27 02:13:08 +00:00
|
|
|
*/
|
2015-04-30 20:13:22 +00:00
|
|
|
void GetShellState(Interface* self);
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
/**
|
2015-04-30 20:13:22 +00:00
|
|
|
* PTM::GetBatteryLevel service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Battery level, 5 = completely full battery, 4 = mostly full battery,
|
|
|
|
* 3 = half full battery, 2 = low battery, 1 = critical battery.
|
2015-02-27 02:13:08 +00:00
|
|
|
*/
|
2015-04-30 20:13:22 +00:00
|
|
|
void GetBatteryLevel(Interface* self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* PTM::GetBatteryChargeState service function
|
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Output of function, 0 = not charging, 1 = charging.
|
|
|
|
*/
|
|
|
|
void GetBatteryChargeState(Interface* self);
|
|
|
|
|
2015-10-23 21:50:51 +00:00
|
|
|
/**
|
2015-10-24 11:17:04 +00:00
|
|
|
* PTM::GetTotalStepCount service function
|
2015-10-23 21:50:51 +00:00
|
|
|
* Outputs:
|
|
|
|
* 1 : Result of function, 0 on success, otherwise error code
|
|
|
|
* 2 : Output of function, * = total step count
|
|
|
|
*/
|
|
|
|
void GetTotalStepCount(Interface* self);
|
|
|
|
|
2015-04-30 20:13:22 +00:00
|
|
|
/**
|
2016-12-08 05:02:00 +00:00
|
|
|
* PTM::GetSoftwareClosedFlag service function
|
2015-04-30 20:13:22 +00:00
|
|
|
* Outputs:
|
|
|
|
* 1: Result code, 0 on success, otherwise error code
|
2016-12-08 05:02:00 +00:00
|
|
|
* 2: Whether or not the "software closed" dialog was requested by the last FIRM
|
|
|
|
* and should be displayed.
|
2015-04-30 20:13:22 +00:00
|
|
|
*/
|
2016-12-08 05:02:00 +00:00
|
|
|
void GetSoftwareClosedFlag(Interface* self);
|
2015-02-27 02:13:08 +00:00
|
|
|
|
2016-04-20 10:12:05 +00:00
|
|
|
/**
|
|
|
|
* PTM::CheckNew3DS service function
|
|
|
|
* Outputs:
|
|
|
|
* 1: Result code, 0 on success, otherwise error code
|
|
|
|
* 2: u8 output: 0 = Old3DS, 1 = New3DS.
|
|
|
|
*/
|
|
|
|
void CheckNew3DS(Interface* self);
|
2016-12-28 16:11:14 +00:00
|
|
|
void CheckNew3DS(IPC::RequestBuilder& rb);
|
2016-04-20 10:12:05 +00:00
|
|
|
|
2015-02-27 02:13:08 +00:00
|
|
|
/// Initialize the PTM service
|
2015-03-08 01:54:16 +00:00
|
|
|
void Init();
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
/// Shutdown the PTM service
|
2015-03-08 01:54:16 +00:00
|
|
|
void Shutdown();
|
2015-02-27 02:13:08 +00:00
|
|
|
|
|
|
|
} // namespace PTM
|
|
|
|
} // namespace Service
|