diff options
author | bunnei <bunneidev@gmail.com> | 2015-03-05 03:27:24 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2015-03-05 03:27:24 +0100 |
commit | 8e4e28aacb38b4f80c3ae80167841f4e451f6ef5 (patch) | |
tree | cd4efbdfb0e01e9e2b424f17339f11873c90485c /src/core/hle/service/ptm/ptm.h | |
parent | Merge pull request #625 from lioncash/warn (diff) | |
parent | Services: Moved the PTM and APT services to their own folder (diff) | |
download | yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar.gz yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar.bz2 yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar.lz yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar.xz yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.tar.zst yuzu-8e4e28aacb38b4f80c3ae80167841f4e451f6ef5.zip |
Diffstat (limited to 'src/core/hle/service/ptm/ptm.h')
-rw-r--r-- | src/core/hle/service/ptm/ptm.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h new file mode 100644 index 000000000..f697aae4d --- /dev/null +++ b/src/core/hle/service/ptm/ptm.h @@ -0,0 +1,65 @@ +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <array> +#include "core/hle/result.h" + +namespace Service { +namespace PTM { + +/// Charge levels used by PTM functions +enum class ChargeLevels : u32 { + CriticalBattery = 1, + LowBattery = 2, + HalfFull = 3, + MostlyFull = 4, + CompletelyFull = 5, +}; + +/** + * Represents the gamecoin file structure in the SharedExtData archive + * More information in 3dbrew (http://www.3dbrew.org/wiki/Extdata#Shared_Extdata_0xf000000b_gamecoin.dat) + */ +struct GameCoin { + u32 magic; ///< Magic number: 0x4F00 + u16 total_coins; ///< Total Play Coins + u16 total_coins_on_date; ///< Total Play Coins obtained on the date stored below. + 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 + u16 year; + u8 month; + u8 day; +}; + +/** + * Returns whether the battery is charging or not. + * 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. + * @returns 1 if the battery is charging, and 0 otherwise. + */ +u32 GetAdapterState(); + +/** + * Returns whether the 3DS's physical shell casing is open or closed + * @returns 1 if the shell is open, and 0 if otherwise + */ +u32 GetShellState(); + +/** + * Get the current battery's charge level. + * @returns The battery's charge level. + */ +ChargeLevels GetBatteryLevel(); + +/// Initialize the PTM service +void PTMInit(); + +/// Shutdown the PTM service +void PTMShutdown(); + +} // namespace PTM +} // namespace Service |