2
1
Fork 0
mirror of https://github.com/yuzu-emu/yuzu.git synced 2024-07-04 23:31:19 +01:00

service: am: Update enum names to match documentation

This commit is contained in:
Narr the Reg 2022-02-21 16:01:20 -06:00
parent efe50d88ec
commit d44464829b
4 changed files with 51 additions and 16 deletions

View file

@ -618,7 +618,7 @@ void AppletMessageQueue::PushMessage(AppletMessage msg) {
AppletMessageQueue::AppletMessage AppletMessageQueue::PopMessage() { AppletMessageQueue::AppletMessage AppletMessageQueue::PopMessage() {
if (messages.empty()) { if (messages.empty()) {
on_new_message->GetWritableEvent().Clear(); on_new_message->GetWritableEvent().Clear();
return AppletMessage::NoMessage; return AppletMessage::None;
} }
auto msg = messages.front(); auto msg = messages.front();
messages.pop(); messages.pop();
@ -633,7 +633,7 @@ std::size_t AppletMessageQueue::GetMessageCount() const {
} }
void AppletMessageQueue::RequestExit() { void AppletMessageQueue::RequestExit() {
PushMessage(AppletMessage::ExitRequested); PushMessage(AppletMessage::Exit);
} }
void AppletMessageQueue::FocusStateChanged() { void AppletMessageQueue::FocusStateChanged() {
@ -732,7 +732,7 @@ void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
const auto message = msg_queue->PopMessage(); const auto message = msg_queue->PopMessage();
IPC::ResponseBuilder rb{ctx, 3}; IPC::ResponseBuilder rb{ctx, 3};
if (message == AppletMessageQueue::AppletMessage::NoMessage) { if (message == AppletMessageQueue::AppletMessage::None) {
LOG_ERROR(Service_AM, "Message queue is empty"); LOG_ERROR(Service_AM, "Message queue is empty");
rb.Push(ERR_NO_MESSAGES); rb.Push(ERR_NO_MESSAGES);
rb.PushEnum<AppletMessageQueue::AppletMessage>(message); rb.PushEnum<AppletMessageQueue::AppletMessage>(message);

View file

@ -22,6 +22,7 @@ class NVFlinger;
namespace Service::AM { namespace Service::AM {
// This is nn::settings::Language
enum SystemLanguage { enum SystemLanguage {
Japanese = 0, Japanese = 0,
English = 1, // en-US English = 1, // en-US
@ -41,16 +42,44 @@ enum SystemLanguage {
// 4.0.0+ // 4.0.0+
SimplifiedChinese = 15, SimplifiedChinese = 15,
TraditionalChinese = 16, TraditionalChinese = 16,
// 10.1.0+
BrazilianPortuguese = 17,
}; };
class AppletMessageQueue { class AppletMessageQueue {
public: public:
// This is nn::am::AppletMessage
enum class AppletMessage : u32 { enum class AppletMessage : u32 {
NoMessage = 0, None = 0,
ExitRequested = 4, ChangeIntoForeground = 1,
ChangeIntoBackground = 2,
Exit = 4,
ApplicationExited = 6,
FocusStateChanged = 15, FocusStateChanged = 15,
Resume = 16,
DetectShortPressingHomeButton = 20,
DetectLongPressingHomeButton = 21,
DetectShortPressingPowerButton = 22,
DetectMiddlePressingPowerButton = 23,
DetectLongPressingPowerButton = 24,
RequestToPrepareSleep = 25,
FinishedSleepSequence = 26,
SleepRequiredByHighTemperature = 27,
SleepRequiredByLowBattery = 28,
AutoPowerDown = 29,
OperationModeChanged = 30, OperationModeChanged = 30,
PerformanceModeChanged = 31, PerformanceModeChanged = 31,
DetectReceivingCecSystemStandby = 32,
SdCardRemoved = 33,
LaunchApplicationRequested = 50,
RequestToDisplay = 51,
ShowApplicationLogo = 55,
HideApplicationLogo = 56,
ForceHideApplicationLogo = 57,
FloatingApplicationDetected = 60,
DetectShortPressingCaptureButton = 90,
AlbumScreenShotTaken = 92,
AlbumRecordingSaved = 93,
}; };
explicit AppletMessageQueue(Core::System& system); explicit AppletMessageQueue(Core::System& system);
@ -179,11 +208,14 @@ public:
~ICommonStateGetter() override; ~ICommonStateGetter() override;
private: private:
// This is nn::oe::FocusState
enum class FocusState : u8 { enum class FocusState : u8 {
InFocus = 1, InFocus = 1,
NotInFocus = 2, NotInFocus = 2,
Background = 3,
}; };
// This is nn::oe::OperationMode
enum class OperationMode : u8 { enum class OperationMode : u8 {
Handheld = 0, Handheld = 0,
Docked = 1, Docked = 1,

View file

@ -17,8 +17,8 @@ constexpr auto DEFAULT_PERFORMANCE_CONFIGURATION = PerformanceConfiguration::Con
Controller::Controller(Core::Timing::CoreTiming& core_timing_) Controller::Controller(Core::Timing::CoreTiming& core_timing_)
: core_timing{core_timing_}, configs{ : core_timing{core_timing_}, configs{
{PerformanceMode::Handheld, DEFAULT_PERFORMANCE_CONFIGURATION}, {PerformanceMode::Normal, DEFAULT_PERFORMANCE_CONFIGURATION},
{PerformanceMode::Docked, DEFAULT_PERFORMANCE_CONFIGURATION}, {PerformanceMode::Boost, DEFAULT_PERFORMANCE_CONFIGURATION},
} {} } {}
Controller::~Controller() = default; Controller::~Controller() = default;
@ -63,13 +63,13 @@ void Controller::SetFromCpuBoostMode(CpuBoostMode mode) {
PerformanceConfiguration::Config15, PerformanceConfiguration::Config15,
}}; }};
SetPerformanceConfiguration(PerformanceMode::Docked, SetPerformanceConfiguration(PerformanceMode::Boost,
BOOST_MODE_TO_CONFIG_MAP.at(static_cast<u32>(mode))); BOOST_MODE_TO_CONFIG_MAP.at(static_cast<u32>(mode)));
} }
PerformanceMode Controller::GetCurrentPerformanceMode() const { PerformanceMode Controller::GetCurrentPerformanceMode() const {
return Settings::values.use_docked_mode.GetValue() ? PerformanceMode::Docked return Settings::values.use_docked_mode.GetValue() ? PerformanceMode::Boost
: PerformanceMode::Handheld; : PerformanceMode::Normal;
} }
PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(PerformanceMode mode) { PerformanceConfiguration Controller::GetCurrentPerformanceConfiguration(PerformanceMode mode) {

View file

@ -32,15 +32,18 @@ enum class PerformanceConfiguration : u32 {
Config16 = 0x9222000C, Config16 = 0x9222000C,
}; };
// This is nn::oe::CpuBoostMode
enum class CpuBoostMode : u32 { enum class CpuBoostMode : u32 {
Disabled = 0, Normal = 0, // Boost mode disabled
Full = 1, // CPU + GPU -> Config 13, 14, 15, or 16 FastLoad = 1, // CPU + GPU -> Config 13, 14, 15, or 16
Partial = 2, // GPU Only -> Config 15 or 16 Partial = 2, // GPU Only -> Config 15 or 16
}; };
enum class PerformanceMode : u8 { // This is nn::oe::PerformanceMode
Handheld = 0, enum class PerformanceMode : s32 {
Docked = 1, Invalid = -1,
Normal = 0,
Boost = 1,
}; };
// Class to manage the state and change of the emulated system performance. // Class to manage the state and change of the emulated system performance.