2018-11-23 03:02:36 +01:00
|
|
|
// Copyright 2018 yuzu emulator team
|
|
|
|
// Licensed under GPLv2 or any later version
|
|
|
|
// Refer to the license.txt file included.
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "common/common_funcs.h"
|
2019-01-11 03:53:07 +01:00
|
|
|
#include "common/uuid.h"
|
2019-04-25 14:57:17 +02:00
|
|
|
#include "core/hle/result.h"
|
2018-11-23 03:02:36 +01:00
|
|
|
#include "core/hle/service/am/applets/applets.h"
|
|
|
|
|
2019-07-11 06:53:55 +02:00
|
|
|
namespace Core {
|
|
|
|
class System;
|
|
|
|
}
|
|
|
|
|
2018-11-23 03:02:36 +01:00
|
|
|
namespace Service::AM::Applets {
|
|
|
|
|
|
|
|
struct UserSelectionConfig {
|
|
|
|
// TODO(DarkLordZach): RE this structure
|
|
|
|
// It seems to be flags and the like that determine the UI of the applet on the switch... from
|
|
|
|
// my research this is safe to ignore for now.
|
|
|
|
INSERT_PADDING_BYTES(0xA0);
|
|
|
|
};
|
|
|
|
static_assert(sizeof(UserSelectionConfig) == 0xA0, "UserSelectionConfig has incorrect size.");
|
|
|
|
|
|
|
|
struct UserSelectionOutput {
|
|
|
|
u64 result;
|
|
|
|
u128 uuid_selected;
|
|
|
|
};
|
|
|
|
static_assert(sizeof(UserSelectionOutput) == 0x18, "UserSelectionOutput has incorrect size.");
|
|
|
|
|
|
|
|
class ProfileSelect final : public Applet {
|
|
|
|
public:
|
2021-02-06 08:31:13 +01:00
|
|
|
explicit ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_,
|
2019-07-11 06:53:55 +02:00
|
|
|
const Core::Frontend::ProfileSelectApplet& frontend_);
|
2018-11-23 03:02:36 +01:00
|
|
|
~ProfileSelect() override;
|
|
|
|
|
|
|
|
void Initialize() override;
|
|
|
|
|
|
|
|
bool TransactionComplete() const override;
|
|
|
|
ResultCode GetStatus() const override;
|
|
|
|
void ExecuteInteractive() override;
|
|
|
|
void Execute() override;
|
|
|
|
|
2019-01-11 03:53:07 +01:00
|
|
|
void SelectionComplete(std::optional<Common::UUID> uuid);
|
2018-11-23 03:02:36 +01:00
|
|
|
|
|
|
|
private:
|
2019-03-12 00:35:01 +01:00
|
|
|
const Core::Frontend::ProfileSelectApplet& frontend;
|
|
|
|
|
2018-11-23 03:02:36 +01:00
|
|
|
UserSelectionConfig config;
|
|
|
|
bool complete = false;
|
2021-05-21 07:05:04 +02:00
|
|
|
ResultCode status = ResultSuccess;
|
2018-11-23 03:02:36 +01:00
|
|
|
std::vector<u8> final_data;
|
2020-11-26 21:19:08 +01:00
|
|
|
Core::System& system;
|
2018-11-23 03:02:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Service::AM::Applets
|