summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Narr the Reg2022-02-21 16:01:20 -0600
committerGravatar Narr the Reg2022-02-21 18:00:50 -0600
commitd44464829ba4448a51c199be893840b33903c489 (patch)
tree0dc25d8e699784cd53610ee26106d3fab8dfe77b
parentMerge pull request #7913 from voidanix/anv-fix (diff)
downloadyuzu-d44464829ba4448a51c199be893840b33903c489.tar.gz
yuzu-d44464829ba4448a51c199be893840b33903c489.tar.xz
yuzu-d44464829ba4448a51c199be893840b33903c489.zip
service: am: Update enum names to match documentation
-rw-r--r--src/core/hle/service/am/am.cpp6
-rw-r--r--src/core/hle/service/am/am.h36
-rw-r--r--src/core/hle/service/apm/apm_controller.cpp10
-rw-r--r--src/core/hle/service/apm/apm_controller.h15
4 files changed, 51 insertions, 16 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index 773dc9f29..2f8e21568 100644
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -618,7 +618,7 @@ void AppletMessageQueue::PushMessage(AppletMessage msg) {
618AppletMessageQueue::AppletMessage AppletMessageQueue::PopMessage() { 618AppletMessageQueue::AppletMessage AppletMessageQueue::PopMessage() {
619 if (messages.empty()) { 619 if (messages.empty()) {
620 on_new_message->GetWritableEvent().Clear(); 620 on_new_message->GetWritableEvent().Clear();
621 return AppletMessage::NoMessage; 621 return AppletMessage::None;
622 } 622 }
623 auto msg = messages.front(); 623 auto msg = messages.front();
624 messages.pop(); 624 messages.pop();
@@ -633,7 +633,7 @@ std::size_t AppletMessageQueue::GetMessageCount() const {
633} 633}
634 634
635void AppletMessageQueue::RequestExit() { 635void AppletMessageQueue::RequestExit() {
636 PushMessage(AppletMessage::ExitRequested); 636 PushMessage(AppletMessage::Exit);
637} 637}
638 638
639void AppletMessageQueue::FocusStateChanged() { 639void AppletMessageQueue::FocusStateChanged() {
@@ -732,7 +732,7 @@ void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
732 const auto message = msg_queue->PopMessage(); 732 const auto message = msg_queue->PopMessage();
733 IPC::ResponseBuilder rb{ctx, 3}; 733 IPC::ResponseBuilder rb{ctx, 3};
734 734
735 if (message == AppletMessageQueue::AppletMessage::NoMessage) { 735 if (message == AppletMessageQueue::AppletMessage::None) {
736 LOG_ERROR(Service_AM, "Message queue is empty"); 736 LOG_ERROR(Service_AM, "Message queue is empty");
737 rb.Push(ERR_NO_MESSAGES); 737 rb.Push(ERR_NO_MESSAGES);
738 rb.PushEnum<AppletMessageQueue::AppletMessage>(message); 738 rb.PushEnum<AppletMessageQueue::AppletMessage>(message);
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h
index 2a578aea5..fdd937b82 100644
--- a/src/core/hle/service/am/am.h
+++ b/src/core/hle/service/am/am.h
@@ -22,6 +22,7 @@ class NVFlinger;
22 22
23namespace Service::AM { 23namespace Service::AM {
24 24
25// This is nn::settings::Language
25enum SystemLanguage { 26enum SystemLanguage {
26 Japanese = 0, 27 Japanese = 0,
27 English = 1, // en-US 28 English = 1, // en-US
@@ -41,16 +42,44 @@ enum SystemLanguage {
41 // 4.0.0+ 42 // 4.0.0+
42 SimplifiedChinese = 15, 43 SimplifiedChinese = 15,
43 TraditionalChinese = 16, 44 TraditionalChinese = 16,
45 // 10.1.0+
46 BrazilianPortuguese = 17,
44}; 47};
45 48
46class AppletMessageQueue { 49class AppletMessageQueue {
47public: 50public:
51 // This is nn::am::AppletMessage
48 enum class AppletMessage : u32 { 52 enum class AppletMessage : u32 {
49 NoMessage = 0, 53 None = 0,
50 ExitRequested = 4, 54 ChangeIntoForeground = 1,
55 ChangeIntoBackground = 2,
56 Exit = 4,
57 ApplicationExited = 6,
51 FocusStateChanged = 15, 58 FocusStateChanged = 15,
59 Resume = 16,
60 DetectShortPressingHomeButton = 20,
61 DetectLongPressingHomeButton = 21,
62 DetectShortPressingPowerButton = 22,
63 DetectMiddlePressingPowerButton = 23,
64 DetectLongPressingPowerButton = 24,
65 RequestToPrepareSleep = 25,
66 FinishedSleepSequence = 26,
67 SleepRequiredByHighTemperature = 27,
68 SleepRequiredByLowBattery = 28,
69 AutoPowerDown = 29,
52 OperationModeChanged = 30, 70 OperationModeChanged = 30,
53 PerformanceModeChanged = 31, 71 PerformanceModeChanged = 31,
72 DetectReceivingCecSystemStandby = 32,
73 SdCardRemoved = 33,
74 LaunchApplicationRequested = 50,
75 RequestToDisplay = 51,
76 ShowApplicationLogo = 55,
77 HideApplicationLogo = 56,
78 ForceHideApplicationLogo = 57,
79 FloatingApplicationDetected = 60,
80 DetectShortPressingCaptureButton = 90,
81 AlbumScreenShotTaken = 92,
82 AlbumRecordingSaved = 93,
54 }; 83 };
55 84
56 explicit AppletMessageQueue(Core::System& system); 85 explicit AppletMessageQueue(Core::System& system);
@@ -179,11 +208,14 @@ public:
179 ~ICommonStateGetter() override; 208 ~ICommonStateGetter() override;
180 209
181private: 210private:
211 // This is nn::oe::FocusState
182 enum class FocusState : u8 { 212 enum class FocusState : u8 {
183 InFocus = 1, 213 InFocus = 1,
184 NotInFocus = 2, 214 NotInFocus = 2,
215 Background = 3,
185 }; 216 };
186 217
218 // This is nn::oe::OperationMode
187 enum class OperationMode : u8 { 219 enum class OperationMode : u8 {
188 Handheld = 0, 220 Handheld = 0,
189 Docked = 1, 221 Docked = 1,
diff --git a/src/core/hle/service/apm/apm_controller.cpp b/src/core/hle/service/apm/apm_controller.cpp
index 98839fe97..187fef2ad 100644
--- a/src/core/hle/service/apm/apm_controller.cpp
+++ b/src/core/hle/service/apm/apm_controller.cpp
@@ -17,8 +17,8 @@ constexpr auto DEFAULT_PERFORMANCE_CONFIGURATION = PerformanceConfiguration::Con
17 17
18Controller::Controller(Core::Timing::CoreTiming& core_timing_) 18Controller::Controller(Core::Timing::CoreTiming& core_timing_)
19 : core_timing{core_timing_}, configs{ 19 : core_timing{core_timing_}, configs{
20 {PerformanceMode::Handheld, DEFAULT_PERFORMANCE_CONFIGURATION}, 20 {PerformanceMode::Normal, DEFAULT_PERFORMANCE_CONFIGURATION},
21 {PerformanceMode::Docked, DEFAULT_PERFORMANCE_CONFIGURATION}, 21 {PerformanceMode::Boost, DEFAULT_PERFORMANCE_CONFIGURATION},
22 } {} 22 } {}
23 23
24Controller::~Controller() = default; 24Controller::~Controller() = default;
@@ -63,13 +63,13 @@ void Controller::SetFromCpuBoostMode(CpuBoostMode mode) {
63 PerformanceConfiguration::Config15, 63 PerformanceConfiguration::Config15,
64 }}; 64 }};
65 65
66 SetPerformanceConfiguration(PerformanceMode::Docked, 66 SetPerformanceConfiguration(PerformanceMode::Boost,
67 BOOST_MODE_TO_CONFIG_MAP.at(static_cast<u32>(mode))); 67 BOOST_MODE_TO_CONFIG_MAP.at(static_cast<u32>(mode)));
68} 68}
69 69
70PerformanceMode Controller::GetCurrentPerformanceMode() const { 70PerformanceMode Controller::GetCurrentPerformanceMode() const {
71 return Settings::values.use_docked_mode.GetValue() ? PerformanceMode::Docked 71 return Settings::values.use_docked_mode.GetValue() ? PerformanceMode::Boost
72 : PerformanceMode::Handheld; 72 : PerformanceMode::Normal;
73} 73}
74 74
75PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(PerformanceMode mode) { 75PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(PerformanceMode mode) {
diff --git a/src/core/hle/service/apm/apm_controller.h b/src/core/hle/service/apm/apm_controller.h
index 8d48e0104..d6fbd2c0c 100644
--- a/src/core/hle/service/apm/apm_controller.h
+++ b/src/core/hle/service/apm/apm_controller.h
@@ -32,15 +32,18 @@ enum class PerformanceConfiguration : u32 {
32 Config16 = 0x9222000C, 32 Config16 = 0x9222000C,
33}; 33};
34 34
35// This is nn::oe::CpuBoostMode
35enum class CpuBoostMode : u32 { 36enum class CpuBoostMode : u32 {
36 Disabled = 0, 37 Normal = 0, // Boost mode disabled
37 Full = 1, // CPU + GPU -> Config 13, 14, 15, or 16 38 FastLoad = 1, // CPU + GPU -> Config 13, 14, 15, or 16
38 Partial = 2, // GPU Only -> Config 15 or 16 39 Partial = 2, // GPU Only -> Config 15 or 16
39}; 40};
40 41
41enum class PerformanceMode : u8 { 42// This is nn::oe::PerformanceMode
42 Handheld = 0, 43enum class PerformanceMode : s32 {
43 Docked = 1, 44 Invalid = -1,
45 Normal = 0,
46 Boost = 1,
44}; 47};
45 48
46// Class to manage the state and change of the emulated system performance. 49// Class to manage the state and change of the emulated system performance.