summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/hle/shared_page.cpp7
-rw-r--r--src/core/hle/shared_page.h10
2 files changed, 16 insertions, 1 deletions
diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp
index d0d92487d..5978ccdd4 100644
--- a/src/core/hle/shared_page.cpp
+++ b/src/core/hle/shared_page.cpp
@@ -6,6 +6,7 @@
6#include <cstring> 6#include <cstring>
7#include <ctime> 7#include <ctime>
8#include "core/core_timing.h" 8#include "core/core_timing.h"
9#include "core/hle/service/ptm/ptm.h"
9#include "core/hle/shared_page.h" 10#include "core/hle/shared_page.h"
10 11
11//////////////////////////////////////////////////////////////////////////////////////////////////// 12////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -73,6 +74,12 @@ void Init() {
73 // Some games wait until this value becomes 0x1, before asking running_hw 74 // Some games wait until this value becomes 0x1, before asking running_hw
74 shared_page.unknown_value = 0x1; 75 shared_page.unknown_value = 0x1;
75 76
77 // Set to a completely full battery
78 shared_page.battery_state.charge_level.Assign(
79 static_cast<u8>(Service::PTM::ChargeLevels::CompletelyFull));
80 shared_page.battery_state.is_adapter_connected.Assign(1);
81 shared_page.battery_state.is_charging.Assign(1);
82
76 update_time_event = 83 update_time_event =
77 CoreTiming::RegisterEvent("SharedPage::UpdateTimeCallback", UpdateTimeCallback); 84 CoreTiming::RegisterEvent("SharedPage::UpdateTimeCallback", UpdateTimeCallback);
78 CoreTiming::ScheduleEvent(0, update_time_event); 85 CoreTiming::ScheduleEvent(0, update_time_event);
diff --git a/src/core/hle/shared_page.h b/src/core/hle/shared_page.h
index 106e47efc..864695ae1 100644
--- a/src/core/hle/shared_page.h
+++ b/src/core/hle/shared_page.h
@@ -10,6 +10,7 @@
10 * write access, according to 3dbrew; this is not emulated) 10 * write access, according to 3dbrew; this is not emulated)
11 */ 11 */
12 12
13#include "common/bit_field.h"
13#include "common/common_funcs.h" 14#include "common/common_funcs.h"
14#include "common/common_types.h" 15#include "common/common_types.h"
15#include "common/swap.h" 16#include "common/swap.h"
@@ -29,6 +30,13 @@ struct DateTime {
29}; 30};
30static_assert(sizeof(DateTime) == 0x20, "Datetime size is wrong"); 31static_assert(sizeof(DateTime) == 0x20, "Datetime size is wrong");
31 32
33union BatteryState {
34 u8 raw;
35 BitField<0, 1, u8> is_adapter_connected;
36 BitField<1, 1, u8> is_charging;
37 BitField<2, 3, u8> charge_level;
38};
39
32struct SharedPageDef { 40struct SharedPageDef {
33 // Most of these names are taken from the 3dbrew page linked above. 41 // Most of these names are taken from the 3dbrew page linked above.
34 u32_le date_time_counter; // 0 42 u32_le date_time_counter; // 0
@@ -44,7 +52,7 @@ struct SharedPageDef {
44 INSERT_PADDING_BYTES(0x80 - 0x68); // 68 52 INSERT_PADDING_BYTES(0x80 - 0x68); // 68
45 float_le sliderstate_3d; // 80 53 float_le sliderstate_3d; // 80
46 u8 ledstate_3d; // 84 54 u8 ledstate_3d; // 84
47 INSERT_PADDING_BYTES(1); // 85 55 BatteryState battery_state; // 85
48 u8 unknown_value; // 86 56 u8 unknown_value; // 86
49 INSERT_PADDING_BYTES(0xA0 - 0x87); // 87 57 INSERT_PADDING_BYTES(0xA0 - 0x87); // 87
50 u64_le menu_title_id; // A0 58 u64_le menu_title_id; // A0