Compare commits
12 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bee22540a1 | ||
|
|
a4d90a9a64 | ||
|
|
84787a2ada | ||
|
|
6533dfd7ce | ||
|
|
e11a3414ae | ||
|
|
4fdc900581 | ||
|
|
d99830b59c | ||
|
|
23c11e50f9 | ||
|
|
5fde5e62a8 | ||
|
|
f124461674 | ||
|
|
ea710e6523 | ||
|
|
ae88ea79b2 |
@@ -5,8 +5,7 @@
|
||||
|
||||
shopt -s nullglob globstar
|
||||
|
||||
if grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
|
||||
dist/*.svg dist/*.xml; then
|
||||
if git grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop dist/*.svg dist/*.xml; then
|
||||
echo Trailing whitespace found, aborting
|
||||
exit 1
|
||||
fi
|
||||
@@ -26,7 +25,7 @@ for f in $FILES_TO_LINT; do
|
||||
"$CLANG_FORMAT" -i "$f"
|
||||
done
|
||||
|
||||
DIFF=$(git diff)
|
||||
DIFF=$(git -c core.fileMode=false diff)
|
||||
|
||||
if [ ! -z "$DIFF" ]; then
|
||||
echo "!!! Not compliant to coding style, here is the fix:"
|
||||
|
||||
2
externals/nx_tzdb/tzdb_to_nx
vendored
2
externals/nx_tzdb/tzdb_to_nx
vendored
Submodule externals/nx_tzdb/tzdb_to_nx updated: f6680093bc...404d390045
@@ -64,7 +64,7 @@ public:
|
||||
return [this] { ShutdownThreadFunction(); };
|
||||
}
|
||||
|
||||
void PreemptSingleCore(bool from_running_enviroment = true);
|
||||
void PreemptSingleCore(bool from_running_environment = true);
|
||||
|
||||
std::size_t CurrentCore() const {
|
||||
return current_core.load();
|
||||
|
||||
@@ -559,28 +559,28 @@ void GDBStub::HandleVCont(std::string_view command, std::vector<DebuggerAction>&
|
||||
}
|
||||
|
||||
constexpr std::array<std::pair<const char*, Kernel::Svc::MemoryState>, 22> MemoryStateNames{{
|
||||
{"----- Free -----", Kernel::Svc::MemoryState::Free},
|
||||
{"Io ", Kernel::Svc::MemoryState::Io},
|
||||
{"Static ", Kernel::Svc::MemoryState::Static},
|
||||
{"Code ", Kernel::Svc::MemoryState::Code},
|
||||
{"CodeData ", Kernel::Svc::MemoryState::CodeData},
|
||||
{"Normal ", Kernel::Svc::MemoryState::Normal},
|
||||
{"Shared ", Kernel::Svc::MemoryState::Shared},
|
||||
{"AliasCode ", Kernel::Svc::MemoryState::AliasCode},
|
||||
{"AliasCodeData ", Kernel::Svc::MemoryState::AliasCodeData},
|
||||
{"Ipc ", Kernel::Svc::MemoryState::Ipc},
|
||||
{"Stack ", Kernel::Svc::MemoryState::Stack},
|
||||
{"ThreadLocal ", Kernel::Svc::MemoryState::ThreadLocal},
|
||||
{"Transfered ", Kernel::Svc::MemoryState::Transfered},
|
||||
{"SharedTransfered", Kernel::Svc::MemoryState::SharedTransfered},
|
||||
{"SharedCode ", Kernel::Svc::MemoryState::SharedCode},
|
||||
{"Inaccessible ", Kernel::Svc::MemoryState::Inaccessible},
|
||||
{"NonSecureIpc ", Kernel::Svc::MemoryState::NonSecureIpc},
|
||||
{"NonDeviceIpc ", Kernel::Svc::MemoryState::NonDeviceIpc},
|
||||
{"Kernel ", Kernel::Svc::MemoryState::Kernel},
|
||||
{"GeneratedCode ", Kernel::Svc::MemoryState::GeneratedCode},
|
||||
{"CodeOut ", Kernel::Svc::MemoryState::CodeOut},
|
||||
{"Coverage ", Kernel::Svc::MemoryState::Coverage},
|
||||
{"----- Free ------", Kernel::Svc::MemoryState::Free},
|
||||
{"Io ", Kernel::Svc::MemoryState::Io},
|
||||
{"Static ", Kernel::Svc::MemoryState::Static},
|
||||
{"Code ", Kernel::Svc::MemoryState::Code},
|
||||
{"CodeData ", Kernel::Svc::MemoryState::CodeData},
|
||||
{"Normal ", Kernel::Svc::MemoryState::Normal},
|
||||
{"Shared ", Kernel::Svc::MemoryState::Shared},
|
||||
{"AliasCode ", Kernel::Svc::MemoryState::AliasCode},
|
||||
{"AliasCodeData ", Kernel::Svc::MemoryState::AliasCodeData},
|
||||
{"Ipc ", Kernel::Svc::MemoryState::Ipc},
|
||||
{"Stack ", Kernel::Svc::MemoryState::Stack},
|
||||
{"ThreadLocal ", Kernel::Svc::MemoryState::ThreadLocal},
|
||||
{"Transferred ", Kernel::Svc::MemoryState::Transferred},
|
||||
{"SharedTransferred", Kernel::Svc::MemoryState::SharedTransferred},
|
||||
{"SharedCode ", Kernel::Svc::MemoryState::SharedCode},
|
||||
{"Inaccessible ", Kernel::Svc::MemoryState::Inaccessible},
|
||||
{"NonSecureIpc ", Kernel::Svc::MemoryState::NonSecureIpc},
|
||||
{"NonDeviceIpc ", Kernel::Svc::MemoryState::NonDeviceIpc},
|
||||
{"Kernel ", Kernel::Svc::MemoryState::Kernel},
|
||||
{"GeneratedCode ", Kernel::Svc::MemoryState::GeneratedCode},
|
||||
{"CodeOut ", Kernel::Svc::MemoryState::CodeOut},
|
||||
{"Coverage ", Kernel::Svc::MemoryState::Coverage},
|
||||
}};
|
||||
|
||||
static constexpr const char* GetMemoryStateName(Kernel::Svc::MemoryState state) {
|
||||
|
||||
@@ -81,12 +81,12 @@ enum class KMemoryState : u32 {
|
||||
|
||||
ThreadLocal = static_cast<u32>(Svc::MemoryState::ThreadLocal) | FlagLinearMapped,
|
||||
|
||||
Transfered = static_cast<u32>(Svc::MemoryState::Transfered) | FlagsMisc |
|
||||
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
|
||||
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||
Transferred = static_cast<u32>(Svc::MemoryState::Transferred) | FlagsMisc |
|
||||
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
|
||||
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||
|
||||
SharedTransfered = static_cast<u32>(Svc::MemoryState::SharedTransfered) | FlagsMisc |
|
||||
FlagCanAlignedDeviceMap | FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||
SharedTransferred = static_cast<u32>(Svc::MemoryState::SharedTransferred) | FlagsMisc |
|
||||
FlagCanAlignedDeviceMap | FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
|
||||
|
||||
SharedCode = static_cast<u32>(Svc::MemoryState::SharedCode) | FlagMapped |
|
||||
FlagReferenceCounted | FlagLinearMapped | FlagCanUseNonSecureIpc |
|
||||
@@ -130,8 +130,8 @@ static_assert(static_cast<u32>(KMemoryState::AliasCodeData) == 0x0FFFBD09);
|
||||
static_assert(static_cast<u32>(KMemoryState::Ipc) == 0x045C3C0A);
|
||||
static_assert(static_cast<u32>(KMemoryState::Stack) == 0x045C3C0B);
|
||||
static_assert(static_cast<u32>(KMemoryState::ThreadLocal) == 0x0400000C);
|
||||
static_assert(static_cast<u32>(KMemoryState::Transfered) == 0x055C3C0D);
|
||||
static_assert(static_cast<u32>(KMemoryState::SharedTransfered) == 0x045C380E);
|
||||
static_assert(static_cast<u32>(KMemoryState::Transferred) == 0x055C3C0D);
|
||||
static_assert(static_cast<u32>(KMemoryState::SharedTransferred) == 0x045C380E);
|
||||
static_assert(static_cast<u32>(KMemoryState::SharedCode) == 0x0440380F);
|
||||
static_assert(static_cast<u32>(KMemoryState::Inaccessible) == 0x00000010);
|
||||
static_assert(static_cast<u32>(KMemoryState::NonSecureIpc) == 0x045C3811);
|
||||
|
||||
@@ -486,8 +486,8 @@ KProcessAddress KPageTableBase::GetRegionAddress(Svc::MemoryState state) const {
|
||||
case Svc::MemoryState::Shared:
|
||||
case Svc::MemoryState::AliasCode:
|
||||
case Svc::MemoryState::AliasCodeData:
|
||||
case Svc::MemoryState::Transfered:
|
||||
case Svc::MemoryState::SharedTransfered:
|
||||
case Svc::MemoryState::Transferred:
|
||||
case Svc::MemoryState::SharedTransferred:
|
||||
case Svc::MemoryState::SharedCode:
|
||||
case Svc::MemoryState::GeneratedCode:
|
||||
case Svc::MemoryState::CodeOut:
|
||||
@@ -522,8 +522,8 @@ size_t KPageTableBase::GetRegionSize(Svc::MemoryState state) const {
|
||||
case Svc::MemoryState::Shared:
|
||||
case Svc::MemoryState::AliasCode:
|
||||
case Svc::MemoryState::AliasCodeData:
|
||||
case Svc::MemoryState::Transfered:
|
||||
case Svc::MemoryState::SharedTransfered:
|
||||
case Svc::MemoryState::Transferred:
|
||||
case Svc::MemoryState::SharedTransferred:
|
||||
case Svc::MemoryState::SharedCode:
|
||||
case Svc::MemoryState::GeneratedCode:
|
||||
case Svc::MemoryState::CodeOut:
|
||||
@@ -564,8 +564,8 @@ bool KPageTableBase::CanContain(KProcessAddress addr, size_t size, Svc::MemorySt
|
||||
case Svc::MemoryState::AliasCodeData:
|
||||
case Svc::MemoryState::Stack:
|
||||
case Svc::MemoryState::ThreadLocal:
|
||||
case Svc::MemoryState::Transfered:
|
||||
case Svc::MemoryState::SharedTransfered:
|
||||
case Svc::MemoryState::Transferred:
|
||||
case Svc::MemoryState::SharedTransferred:
|
||||
case Svc::MemoryState::SharedCode:
|
||||
case Svc::MemoryState::GeneratedCode:
|
||||
case Svc::MemoryState::CodeOut:
|
||||
|
||||
@@ -76,8 +76,8 @@ Result KTransferMemory::Map(KProcessAddress address, size_t size, Svc::MemoryPer
|
||||
|
||||
// Map the memory.
|
||||
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
||||
? KMemoryState::Transfered
|
||||
: KMemoryState::SharedTransfered;
|
||||
? KMemoryState::Transferred
|
||||
: KMemoryState::SharedTransferred;
|
||||
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().MapPageGroup(
|
||||
address, *m_page_group, state, KMemoryPermission::UserReadWrite));
|
||||
|
||||
@@ -96,8 +96,8 @@ Result KTransferMemory::Unmap(KProcessAddress address, size_t size) {
|
||||
|
||||
// Unmap the memory.
|
||||
const KMemoryState state = (m_owner_perm == Svc::MemoryPermission::None)
|
||||
? KMemoryState::Transfered
|
||||
: KMemoryState::SharedTransfered;
|
||||
? KMemoryState::Transferred
|
||||
: KMemoryState::SharedTransferred;
|
||||
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().UnmapPageGroup(address, *m_page_group, state));
|
||||
|
||||
// Mark ourselves as unmapped.
|
||||
|
||||
@@ -90,7 +90,7 @@ Result MapTransferMemory(Core::System& system, Handle trmem_handle, uint64_t add
|
||||
// Verify that the mapping is in range.
|
||||
R_UNLESS(GetCurrentProcess(system.Kernel())
|
||||
.GetPageTable()
|
||||
.CanContain(address, size, KMemoryState::Transfered),
|
||||
.CanContain(address, size, KMemoryState::Transferred),
|
||||
ResultInvalidMemoryRegion);
|
||||
|
||||
// Map the transfer memory.
|
||||
@@ -117,7 +117,7 @@ Result UnmapTransferMemory(Core::System& system, Handle trmem_handle, uint64_t a
|
||||
// Verify that the mapping is in range.
|
||||
R_UNLESS(GetCurrentProcess(system.Kernel())
|
||||
.GetPageTable()
|
||||
.CanContain(address, size, KMemoryState::Transfered),
|
||||
.CanContain(address, size, KMemoryState::Transferred),
|
||||
ResultInvalidMemoryRegion);
|
||||
|
||||
// Unmap the transfer memory.
|
||||
|
||||
@@ -27,8 +27,8 @@ enum class MemoryState : u32 {
|
||||
Ipc = 0x0A,
|
||||
Stack = 0x0B,
|
||||
ThreadLocal = 0x0C,
|
||||
Transfered = 0x0D,
|
||||
SharedTransfered = 0x0E,
|
||||
Transferred = 0x0D,
|
||||
SharedTransferred = 0x0E,
|
||||
SharedCode = 0x0F,
|
||||
Inaccessible = 0x10,
|
||||
NonSecureIpc = 0x11,
|
||||
|
||||
@@ -61,9 +61,7 @@ ProfileManager::ProfileManager() {
|
||||
OpenUser(*GetUser(current));
|
||||
}
|
||||
|
||||
ProfileManager::~ProfileManager() {
|
||||
WriteUserSaveFile();
|
||||
}
|
||||
ProfileManager::~ProfileManager() = default;
|
||||
|
||||
/// After a users creation it needs to be "registered" to the system. AddToProfiles handles the
|
||||
/// internal management of the users profiles
|
||||
@@ -113,6 +111,8 @@ Result ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& username)
|
||||
return ERROR_USER_ALREADY_EXISTS;
|
||||
}
|
||||
|
||||
is_save_needed = true;
|
||||
|
||||
return AddUser({
|
||||
.user_uuid = uuid,
|
||||
.username = username,
|
||||
@@ -326,6 +326,9 @@ bool ProfileManager::RemoveUser(UUID uuid) {
|
||||
profiles[*index] = ProfileInfo{};
|
||||
std::stable_partition(profiles.begin(), profiles.end(),
|
||||
[](const ProfileInfo& profile) { return profile.user_uuid.IsValid(); });
|
||||
|
||||
is_save_needed = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -340,6 +343,8 @@ bool ProfileManager::SetProfileBase(UUID uuid, const ProfileBase& profile_new) {
|
||||
profile.username = profile_new.username;
|
||||
profile.creation_time = profile_new.timestamp;
|
||||
|
||||
is_save_needed = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -348,6 +353,7 @@ bool ProfileManager::SetProfileBaseAndData(Common::UUID uuid, const ProfileBase&
|
||||
const auto index = GetUserIndex(uuid);
|
||||
if (index.has_value() && SetProfileBase(uuid, profile_new)) {
|
||||
profiles[*index].data = data_new;
|
||||
is_save_needed = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -391,6 +397,10 @@ void ProfileManager::ParseUserSaveFile() {
|
||||
}
|
||||
|
||||
void ProfileManager::WriteUserSaveFile() {
|
||||
if (!is_save_needed) {
|
||||
return;
|
||||
}
|
||||
|
||||
ProfileDataRaw raw{};
|
||||
|
||||
for (std::size_t i = 0; i < MAX_USERS; ++i) {
|
||||
@@ -423,7 +433,10 @@ void ProfileManager::WriteUserSaveFile() {
|
||||
if (!save.IsOpen() || !save.SetSize(sizeof(ProfileDataRaw)) || !save.WriteObject(raw)) {
|
||||
LOG_WARNING(Service_ACC, "Failed to write save data to file... No changes to user data "
|
||||
"made in current session will be saved.");
|
||||
return;
|
||||
}
|
||||
|
||||
is_save_needed = false;
|
||||
}
|
||||
|
||||
}; // namespace Service::Account
|
||||
|
||||
@@ -103,6 +103,7 @@ private:
|
||||
std::optional<std::size_t> AddToProfiles(const ProfileInfo& profile);
|
||||
bool RemoveProfileAtIndex(std::size_t index);
|
||||
|
||||
bool is_save_needed{};
|
||||
std::array<ProfileInfo, MAX_USERS> profiles{};
|
||||
std::array<ProfileInfo, MAX_USERS> stored_opened_profiles{};
|
||||
std::size_t user_count{};
|
||||
|
||||
@@ -76,7 +76,7 @@ struct UiSettingsDisplayOptions {
|
||||
bool is_system_or_launcher;
|
||||
bool is_registration_permitted;
|
||||
bool show_skip_button;
|
||||
bool aditional_select;
|
||||
bool additional_select;
|
||||
bool show_user_selector;
|
||||
bool is_unqualified_user_selectable;
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<AlbumEntry>& out_entries, Albu
|
||||
}
|
||||
|
||||
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
||||
ContentType contex_type, s64 start_posix_time,
|
||||
ContentType content_type, s64 start_posix_time,
|
||||
s64 end_posix_time, u64 aruid) const {
|
||||
if (!is_mounted) {
|
||||
return ResultIsNotMounted;
|
||||
@@ -94,7 +94,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& ou
|
||||
std::vector<ApplicationAlbumEntry> album_entries;
|
||||
const auto start_date = ConvertToAlbumDateTime(start_posix_time);
|
||||
const auto end_date = ConvertToAlbumDateTime(end_posix_time);
|
||||
const auto result = GetAlbumFileList(album_entries, contex_type, start_date, end_date, aruid);
|
||||
const auto result = GetAlbumFileList(album_entries, content_type, start_date, end_date, aruid);
|
||||
|
||||
if (result.IsError()) {
|
||||
return result;
|
||||
@@ -113,14 +113,14 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& ou
|
||||
}
|
||||
|
||||
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
||||
ContentType contex_type, AlbumFileDateTime start_date,
|
||||
ContentType content_type, AlbumFileDateTime start_date,
|
||||
AlbumFileDateTime end_date, u64 aruid) const {
|
||||
if (!is_mounted) {
|
||||
return ResultIsNotMounted;
|
||||
}
|
||||
|
||||
for (auto& [file_id, path] : album_files) {
|
||||
if (file_id.type != contex_type) {
|
||||
if (file_id.type != content_type) {
|
||||
continue;
|
||||
}
|
||||
if (file_id.date > start_date) {
|
||||
@@ -139,7 +139,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_en
|
||||
.hash{},
|
||||
.datetime = file_id.date,
|
||||
.storage = file_id.storage,
|
||||
.content = contex_type,
|
||||
.content = content_type,
|
||||
.unknown = 1,
|
||||
};
|
||||
out_entries.push_back(entry);
|
||||
|
||||
@@ -45,10 +45,10 @@ public:
|
||||
Result GetAlbumFileList(std::vector<AlbumEntry>& out_entries, AlbumStorage storage,
|
||||
u8 flags) const;
|
||||
Result GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
|
||||
ContentType contex_type, s64 start_posix_time, s64 end_posix_time,
|
||||
ContentType content_type, s64 start_posix_time, s64 end_posix_time,
|
||||
u64 aruid) const;
|
||||
Result GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
|
||||
ContentType contex_type, AlbumFileDateTime start_date,
|
||||
ContentType content_type, AlbumFileDateTime start_date,
|
||||
AlbumFileDateTime end_date, u64 aruid) const;
|
||||
Result GetAutoSavingStorage(bool& out_is_autosaving) const;
|
||||
Result LoadAlbumScreenShotImage(LoadAlbumScreenShotImageOutput& out_image_output,
|
||||
|
||||
@@ -12,7 +12,7 @@ constexpr Result ResultUnknown5(ErrorModule::Capture, 5);
|
||||
constexpr Result ResultUnknown6(ErrorModule::Capture, 6);
|
||||
constexpr Result ResultUnknown7(ErrorModule::Capture, 7);
|
||||
constexpr Result ResultOutOfRange(ErrorModule::Capture, 8);
|
||||
constexpr Result ResulInvalidTimestamp(ErrorModule::Capture, 12);
|
||||
constexpr Result ResultInvalidTimestamp(ErrorModule::Capture, 12);
|
||||
constexpr Result ResultInvalidStorage(ErrorModule::Capture, 13);
|
||||
constexpr Result ResultInvalidFileContents(ErrorModule::Capture, 14);
|
||||
constexpr Result ResultIsNotMounted(ErrorModule::Capture, 21);
|
||||
|
||||
@@ -131,7 +131,7 @@ private:
|
||||
u8 is_favorite;
|
||||
u8 same_app;
|
||||
u8 same_app_played;
|
||||
u8 arbitary_app_played;
|
||||
u8 arbitrary_app_played;
|
||||
u64 group_id;
|
||||
};
|
||||
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
|
||||
|
||||
@@ -18,23 +18,23 @@ namespace Service::HID {
|
||||
|
||||
void LoopProcess(Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
std::shared_ptr<ResourceManager> resouce_manager = std::make_shared<ResourceManager>(system);
|
||||
std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system);
|
||||
std::shared_ptr<HidFirmwareSettings> firmware_settings =
|
||||
std::make_shared<HidFirmwareSettings>();
|
||||
|
||||
// TODO: Remove this hack until this service is emulated properly.
|
||||
const auto process_list = system.Kernel().GetProcessList();
|
||||
if (!process_list.empty()) {
|
||||
resouce_manager->Initialize();
|
||||
resouce_manager->RegisterAppletResourceUserId(process_list[0]->GetId(), true);
|
||||
resource_manager->Initialize();
|
||||
resource_manager->RegisterAppletResourceUserId(process_list[0]->GetId(), true);
|
||||
}
|
||||
|
||||
server_manager->RegisterNamedService(
|
||||
"hid", std::make_shared<IHidServer>(system, resouce_manager, firmware_settings));
|
||||
"hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
|
||||
server_manager->RegisterNamedService(
|
||||
"hid:dbg", std::make_shared<IHidDebugServer>(system, resouce_manager));
|
||||
"hid:dbg", std::make_shared<IHidDebugServer>(system, resource_manager));
|
||||
server_manager->RegisterNamedService(
|
||||
"hid:sys", std::make_shared<IHidSystemServer>(system, resouce_manager));
|
||||
"hid:sys", std::make_shared<IHidSystemServer>(system, resource_manager));
|
||||
|
||||
server_manager->RegisterNamedService("hidbus", std::make_shared<HidBus>(system));
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ HidBus::~HidBus() {
|
||||
void HidBus::UpdateHidbus(std::chrono::nanoseconds ns_late) {
|
||||
if (is_hidbus_enabled) {
|
||||
for (std::size_t i = 0; i < devices.size(); ++i) {
|
||||
if (!devices[i].is_device_initializated) {
|
||||
if (!devices[i].is_device_initialized) {
|
||||
continue;
|
||||
}
|
||||
auto& device = devices[i].device;
|
||||
@@ -213,7 +213,7 @@ void HidBus::Initialize(HLERequestContext& ctx) {
|
||||
|
||||
if (bus_handle_.internal_index == 0 && Settings::values.enable_ring_controller) {
|
||||
MakeDevice<RingController>(bus_handle_);
|
||||
devices[device_index.value()].is_device_initializated = true;
|
||||
devices[device_index.value()].is_device_initialized = true;
|
||||
devices[device_index.value()].device->ActivateDevice();
|
||||
cur_entry.is_in_focus = true;
|
||||
cur_entry.is_connected = true;
|
||||
@@ -222,7 +222,7 @@ void HidBus::Initialize(HLERequestContext& ctx) {
|
||||
cur_entry.is_polling_mode = false;
|
||||
} else {
|
||||
MakeDevice<HidbusStubbed>(bus_handle_);
|
||||
devices[device_index.value()].is_device_initializated = true;
|
||||
devices[device_index.value()].is_device_initialized = true;
|
||||
cur_entry.is_in_focus = true;
|
||||
cur_entry.is_connected = false;
|
||||
cur_entry.is_connected_result = ResultSuccess;
|
||||
@@ -261,7 +261,7 @@ void HidBus::Finalize(HLERequestContext& ctx) {
|
||||
const auto entry_index = devices[device_index.value()].handle.internal_index;
|
||||
auto& cur_entry = hidbus_status.entries[entry_index];
|
||||
auto& device = devices[device_index.value()].device;
|
||||
devices[device_index.value()].is_device_initializated = false;
|
||||
devices[device_index.value()].is_device_initialized = false;
|
||||
device->DeactivateDevice();
|
||||
|
||||
cur_entry.is_in_focus = true;
|
||||
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
static_assert(sizeof(HidbusStatusManager) <= 0x1000, "HidbusStatusManager is an invalid size");
|
||||
|
||||
struct HidbusDevice {
|
||||
bool is_device_initializated{};
|
||||
bool is_device_initialized{};
|
||||
BusHandle handle{};
|
||||
std::unique_ptr<HidbusBase> device{nullptr};
|
||||
};
|
||||
|
||||
@@ -181,22 +181,22 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
||||
}
|
||||
}
|
||||
|
||||
buffer_x_desciptors.reserve(command_header->num_buf_x_descriptors);
|
||||
buffer_a_desciptors.reserve(command_header->num_buf_a_descriptors);
|
||||
buffer_b_desciptors.reserve(command_header->num_buf_b_descriptors);
|
||||
buffer_w_desciptors.reserve(command_header->num_buf_w_descriptors);
|
||||
buffer_x_descriptors.reserve(command_header->num_buf_x_descriptors);
|
||||
buffer_a_descriptors.reserve(command_header->num_buf_a_descriptors);
|
||||
buffer_b_descriptors.reserve(command_header->num_buf_b_descriptors);
|
||||
buffer_w_descriptors.reserve(command_header->num_buf_w_descriptors);
|
||||
|
||||
for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) {
|
||||
buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
|
||||
buffer_x_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
|
||||
}
|
||||
for (u32 i = 0; i < command_header->num_buf_a_descriptors; ++i) {
|
||||
buffer_a_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
buffer_a_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
}
|
||||
for (u32 i = 0; i < command_header->num_buf_b_descriptors; ++i) {
|
||||
buffer_b_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
buffer_b_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
}
|
||||
for (u32 i = 0; i < command_header->num_buf_w_descriptors; ++i) {
|
||||
buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
buffer_w_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
|
||||
}
|
||||
|
||||
const auto buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size;
|
||||
@@ -246,7 +246,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
||||
IPC::CommandHeader::BufferDescriptorCFlag::InlineDescriptor) {
|
||||
if (command_header->buf_c_descriptor_flags ==
|
||||
IPC::CommandHeader::BufferDescriptorCFlag::OneDescriptor) {
|
||||
buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
|
||||
buffer_c_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
|
||||
} else {
|
||||
u32 num_buf_c_descriptors =
|
||||
static_cast<u32>(command_header->buf_c_descriptor_flags.Value()) - 2;
|
||||
@@ -256,7 +256,7 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
|
||||
ASSERT(num_buf_c_descriptors < 14);
|
||||
|
||||
for (u32 i = 0; i < num_buf_c_descriptors; ++i) {
|
||||
buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
|
||||
buffer_c_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,19 +232,19 @@ public:
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::vector<IPC::BufferDescriptorX>& BufferDescriptorX() const {
|
||||
return buffer_x_desciptors;
|
||||
return buffer_x_descriptors;
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorA() const {
|
||||
return buffer_a_desciptors;
|
||||
return buffer_a_descriptors;
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorB() const {
|
||||
return buffer_b_desciptors;
|
||||
return buffer_b_descriptors;
|
||||
}
|
||||
|
||||
[[nodiscard]] const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const {
|
||||
return buffer_c_desciptors;
|
||||
return buffer_c_descriptors;
|
||||
}
|
||||
|
||||
[[nodiscard]] const IPC::DomainMessageHeader& GetDomainMessageHeader() const {
|
||||
@@ -406,11 +406,11 @@ private:
|
||||
std::optional<IPC::HandleDescriptorHeader> handle_descriptor_header;
|
||||
std::optional<IPC::DataPayloadHeader> data_payload_header;
|
||||
std::optional<IPC::DomainMessageHeader> domain_message_header;
|
||||
std::vector<IPC::BufferDescriptorX> buffer_x_desciptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_a_desciptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_b_desciptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_w_desciptors;
|
||||
std::vector<IPC::BufferDescriptorC> buffer_c_desciptors;
|
||||
std::vector<IPC::BufferDescriptorX> buffer_x_descriptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_a_descriptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_b_descriptors;
|
||||
std::vector<IPC::BufferDescriptorABW> buffer_w_descriptors;
|
||||
std::vector<IPC::BufferDescriptorC> buffer_c_descriptors;
|
||||
|
||||
u32_le command{};
|
||||
u64 pid{};
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Service::NFP::AmiiboCrypto {
|
||||
bool IsAmiiboValid(const EncryptedNTAG215File& ntag_file) {
|
||||
const auto& amiibo_data = ntag_file.user_memory;
|
||||
LOG_DEBUG(Service_NFP, "uuid_lock=0x{0:x}", ntag_file.static_lock);
|
||||
LOG_DEBUG(Service_NFP, "compability_container=0x{0:x}", ntag_file.compability_container);
|
||||
LOG_DEBUG(Service_NFP, "compatibility_container=0x{0:x}", ntag_file.compatibility_container);
|
||||
LOG_DEBUG(Service_NFP, "write_count={}", static_cast<u16>(amiibo_data.write_counter));
|
||||
|
||||
LOG_DEBUG(Service_NFP, "character_id=0x{0:x}", amiibo_data.model_info.character_id);
|
||||
@@ -49,7 +49,7 @@ bool IsAmiiboValid(const EncryptedNTAG215File& ntag_file) {
|
||||
if (ntag_file.static_lock != 0xE00F) {
|
||||
return false;
|
||||
}
|
||||
if (ntag_file.compability_container != 0xEEFF10F1U) {
|
||||
if (ntag_file.compatibility_container != 0xEEFF10F1U) {
|
||||
return false;
|
||||
}
|
||||
if (amiibo_data.model_info.tag_type != NFC::PackedTagType::Type2) {
|
||||
@@ -78,7 +78,7 @@ NTAG215File NfcDataToEncodedData(const EncryptedNTAG215File& nfc_data) {
|
||||
encoded_data.uid_crc_check2 = nfc_data.uuid_crc_check2;
|
||||
encoded_data.internal_number = nfc_data.internal_number;
|
||||
encoded_data.static_lock = nfc_data.static_lock;
|
||||
encoded_data.compability_container = nfc_data.compability_container;
|
||||
encoded_data.compatibility_container = nfc_data.compatibility_container;
|
||||
encoded_data.hmac_data = nfc_data.user_memory.hmac_data;
|
||||
encoded_data.constant_value = nfc_data.user_memory.constant_value;
|
||||
encoded_data.write_counter = nfc_data.user_memory.write_counter;
|
||||
@@ -112,7 +112,7 @@ EncryptedNTAG215File EncodedDataToNfcData(const NTAG215File& encoded_data) {
|
||||
nfc_data.uuid_crc_check2 = encoded_data.uid_crc_check2;
|
||||
nfc_data.internal_number = encoded_data.internal_number;
|
||||
nfc_data.static_lock = encoded_data.static_lock;
|
||||
nfc_data.compability_container = encoded_data.compability_container;
|
||||
nfc_data.compatibility_container = encoded_data.compatibility_container;
|
||||
nfc_data.user_memory.hmac_data = encoded_data.hmac_data;
|
||||
nfc_data.user_memory.constant_value = encoded_data.constant_value;
|
||||
nfc_data.user_memory.write_counter = encoded_data.write_counter;
|
||||
@@ -257,7 +257,7 @@ void Cipher(const DerivedKeys& keys, const NTAG215File& in_data, NTAG215File& ou
|
||||
out_data.uid_crc_check2 = in_data.uid_crc_check2;
|
||||
out_data.internal_number = in_data.internal_number;
|
||||
out_data.static_lock = in_data.static_lock;
|
||||
out_data.compability_container = in_data.compability_container;
|
||||
out_data.compatibility_container = in_data.compatibility_container;
|
||||
|
||||
out_data.constant_value = in_data.constant_value;
|
||||
out_data.write_counter = in_data.write_counter;
|
||||
|
||||
@@ -75,7 +75,7 @@ void NfcDevice::NpadUpdate(Core::HID::ControllerTriggerType type) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!is_initalized) {
|
||||
if (!is_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ void NfcDevice::Initialize() {
|
||||
return;
|
||||
}
|
||||
|
||||
is_initalized = npad_device->AddNfcHandle();
|
||||
is_initialized = npad_device->AddNfcHandle();
|
||||
}
|
||||
|
||||
void NfcDevice::Finalize() {
|
||||
@@ -226,7 +226,7 @@ void NfcDevice::Finalize() {
|
||||
}
|
||||
|
||||
device_state = DeviceState::Unavailable;
|
||||
is_initalized = false;
|
||||
is_initialized = false;
|
||||
}
|
||||
|
||||
Result NfcDevice::StartDetection(NfcProtocol allowed_protocol) {
|
||||
|
||||
@@ -126,7 +126,7 @@ private:
|
||||
Kernel::KEvent* deactivate_event = nullptr;
|
||||
Kernel::KEvent* availability_change_event = nullptr;
|
||||
|
||||
bool is_initalized{};
|
||||
bool is_initialized{};
|
||||
NfcProtocol allowed_protocols{};
|
||||
DeviceState device_state{DeviceState::Unavailable};
|
||||
|
||||
|
||||
@@ -243,12 +243,12 @@ static_assert(sizeof(EncryptedAmiiboFile) == 0x1F8, "AmiiboFile is an invalid si
|
||||
struct NTAG215File {
|
||||
u8 uid_crc_check2;
|
||||
u8 internal_number;
|
||||
u16 static_lock; // Set defined pages as read only
|
||||
u32 compability_container; // Defines available memory
|
||||
HashData hmac_data; // Hash
|
||||
u8 constant_value; // Must be A5
|
||||
u16_be write_counter; // Number of times the amiibo has been written?
|
||||
u8 amiibo_version; // Amiibo file version
|
||||
u16 static_lock; // Set defined pages as read only
|
||||
u32 compatibility_container; // Defines available memory
|
||||
HashData hmac_data; // Hash
|
||||
u8 constant_value; // Must be A5
|
||||
u16_be write_counter; // Number of times the amiibo has been written?
|
||||
u8 amiibo_version; // Amiibo file version
|
||||
AmiiboSettings settings;
|
||||
Service::Mii::Ver3StoreData owner_mii; // Mii data
|
||||
u64_be application_id; // Game id
|
||||
@@ -278,7 +278,7 @@ struct EncryptedNTAG215File {
|
||||
u8 uuid_crc_check2;
|
||||
u8 internal_number;
|
||||
u16 static_lock; // Set defined pages as read only
|
||||
u32 compability_container; // Defines available memory
|
||||
u32 compatibility_container; // Defines available memory
|
||||
EncryptedAmiiboFile user_memory; // Writable data
|
||||
u32 dynamic_lock; // Dynamic lock
|
||||
u32 CFG0; // Defines memory protected by password
|
||||
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
u64_le align;
|
||||
};
|
||||
};
|
||||
static_assert(sizeof(IoctlAllocSpace) == 24, "IoctlInitalizeEx is incorrect size");
|
||||
static_assert(sizeof(IoctlAllocSpace) == 24, "IoctlInitializeEx is incorrect size");
|
||||
|
||||
struct IoctlFreeSpace {
|
||||
u64_le offset{};
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace Service::Nvidia::Devices {
|
||||
nvhost_ctrl_gpu::nvhost_ctrl_gpu(Core::System& system_, EventInterface& events_interface_)
|
||||
: nvdevice{system_}, events_interface{events_interface_} {
|
||||
error_notifier_event = events_interface.CreateEvent("CtrlGpuErrorNotifier");
|
||||
unknown_event = events_interface.CreateEvent("CtrlGpuUknownEvent");
|
||||
unknown_event = events_interface.CreateEvent("CtrlGpuUnknownEvent");
|
||||
}
|
||||
nvhost_ctrl_gpu::~nvhost_ctrl_gpu() {
|
||||
events_interface.FreeEvent(error_notifier_event);
|
||||
|
||||
@@ -51,7 +51,7 @@ enum class NvResult : u32 {
|
||||
DispNoDisplaysAttached = 0x20003,
|
||||
DispModeNotSupported = 0x20004,
|
||||
DispNotFound = 0x20005,
|
||||
DispAttachDissallowed = 0x20006,
|
||||
DispAttachDisallowed = 0x20006,
|
||||
DispTypeNotSupported = 0x20007,
|
||||
DispAuthenticationFailed = 0x20008,
|
||||
DispNotAttached = 0x20009,
|
||||
|
||||
@@ -223,7 +223,8 @@ Result Nvnflinger::FindVsyncEvent(Kernel::KReadableEvent** out_vsync_event, u64
|
||||
return VI::ResultNotFound;
|
||||
}
|
||||
|
||||
return display->GetVSyncEvent(out_vsync_event);
|
||||
*out_vsync_event = display->GetVSyncEvent();
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
VI::Display* Nvnflinger::FindDisplay(u64 display_id) {
|
||||
|
||||
@@ -54,8 +54,8 @@ public:
|
||||
|
||||
class IClkrstSession final : public ServiceFramework<IClkrstSession> {
|
||||
public:
|
||||
explicit IClkrstSession(Core::System& system_, DeviceCode deivce_code_)
|
||||
: ServiceFramework{system_, "IClkrstSession"}, deivce_code(deivce_code_) {
|
||||
explicit IClkrstSession(Core::System& system_, DeviceCode device_code_)
|
||||
: ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, nullptr, "SetClockEnabled"},
|
||||
@@ -93,7 +93,7 @@ private:
|
||||
rb.Push<u32>(clock_rate);
|
||||
}
|
||||
|
||||
DeviceCode deivce_code;
|
||||
DeviceCode device_code;
|
||||
u32 clock_rate{};
|
||||
};
|
||||
|
||||
@@ -118,9 +118,9 @@ private:
|
||||
void OpenSession(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto device_code = static_cast<DeviceCode>(rp.Pop<u32>());
|
||||
const auto unkonwn_input = rp.Pop<u32>();
|
||||
const auto unknown_input = rp.Pop<u32>();
|
||||
|
||||
LOG_DEBUG(Service_PCV, "called, device_code={}, input={}", device_code, unkonwn_input);
|
||||
LOG_DEBUG(Service_PCV, "called, device_code={}, input={}", device_code, unknown_input);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
|
||||
@@ -28,7 +28,7 @@ SystemSettings DefaultSystemSettings() {
|
||||
.cmu_mode = CmuMode::None,
|
||||
.tv_underscan = {},
|
||||
.tv_gama = 1.0f,
|
||||
.constrast_ratio = 0.5f,
|
||||
.contrast_ratio = 0.5f,
|
||||
};
|
||||
|
||||
settings.initial_launch_settings_packed = {
|
||||
|
||||
@@ -208,7 +208,7 @@ struct TvSettings {
|
||||
CmuMode cmu_mode;
|
||||
u32 tv_underscan;
|
||||
f32 tv_gama;
|
||||
f32 constrast_ratio;
|
||||
f32 contrast_ratio;
|
||||
};
|
||||
static_assert(sizeof(TvSettings) == 0x20, "TvSettings is an invalid size");
|
||||
|
||||
@@ -341,7 +341,7 @@ struct SystemSettings {
|
||||
std::array<u8, 0x3C> reserved_09934;
|
||||
|
||||
// nn::settings::system::ErrorReportSharePermission
|
||||
ErrorReportSharePermission error_report_share_permssion;
|
||||
ErrorReportSharePermission error_report_share_permission;
|
||||
|
||||
std::array<u8, 0x3C> reserved_09974;
|
||||
|
||||
|
||||
@@ -721,10 +721,10 @@ void ISystemSettingsServer::SetTvSettings(HLERequestContext& ctx) {
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET,
|
||||
"called, flags={}, cmu_mode={}, constrast_ratio={}, hdmi_content_type={}, "
|
||||
"called, flags={}, cmu_mode={}, contrast_ratio={}, hdmi_content_type={}, "
|
||||
"rgb_range={}, tv_gama={}, tv_resolution={}, tv_underscan={}",
|
||||
m_system_settings.tv_settings.flags.raw, m_system_settings.tv_settings.cmu_mode,
|
||||
m_system_settings.tv_settings.constrast_ratio,
|
||||
m_system_settings.tv_settings.contrast_ratio,
|
||||
m_system_settings.tv_settings.hdmi_content_type,
|
||||
m_system_settings.tv_settings.rgb_range, m_system_settings.tv_settings.tv_gama,
|
||||
m_system_settings.tv_settings.tv_resolution,
|
||||
@@ -870,10 +870,10 @@ void ISystemSettingsServer::GetInitialLaunchSettings(HLERequestContext& ctx) {
|
||||
|
||||
void ISystemSettingsServer::SetInitialLaunchSettings(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto inital_launch_settings = rp.PopRaw<InitialLaunchSettings>();
|
||||
auto initial_launch_settings = rp.PopRaw<InitialLaunchSettings>();
|
||||
|
||||
m_system_settings.initial_launch_settings_packed.flags = inital_launch_settings.flags;
|
||||
m_system_settings.initial_launch_settings_packed.timestamp = inital_launch_settings.timestamp;
|
||||
m_system_settings.initial_launch_settings_packed.flags = initial_launch_settings.flags;
|
||||
m_system_settings.initial_launch_settings_packed.timestamp = initial_launch_settings.timestamp;
|
||||
SetSaveNeeded();
|
||||
|
||||
LOG_INFO(Service_SET, "called, flags={}, timestamp={}",
|
||||
|
||||
@@ -71,18 +71,7 @@ size_t Display::GetNumLayers() const {
|
||||
return std::ranges::count_if(layers, [](auto& l) { return l->IsOpen(); });
|
||||
}
|
||||
|
||||
Result Display::GetVSyncEvent(Kernel::KReadableEvent** out_vsync_event) {
|
||||
if (got_vsync_event) {
|
||||
return ResultPermissionDenied;
|
||||
}
|
||||
|
||||
got_vsync_event = true;
|
||||
|
||||
*out_vsync_event = GetVSyncEventUnchecked();
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
Kernel::KReadableEvent* Display::GetVSyncEventUnchecked() {
|
||||
Kernel::KReadableEvent* Display::GetVSyncEvent() {
|
||||
return &vsync_event->GetReadableEvent();
|
||||
}
|
||||
|
||||
|
||||
@@ -74,16 +74,8 @@ public:
|
||||
|
||||
std::size_t GetNumLayers() const;
|
||||
|
||||
/**
|
||||
* Gets the internal vsync event.
|
||||
*
|
||||
* @returns The internal Vsync event if it has not yet been retrieved,
|
||||
* VI::ResultPermissionDenied otherwise.
|
||||
*/
|
||||
[[nodiscard]] Result GetVSyncEvent(Kernel::KReadableEvent** out_vsync_event);
|
||||
|
||||
/// Gets the internal vsync event.
|
||||
Kernel::KReadableEvent* GetVSyncEventUnchecked();
|
||||
Kernel::KReadableEvent* GetVSyncEvent();
|
||||
|
||||
/// Signals the internal vsync event.
|
||||
void SignalVSyncEvent();
|
||||
@@ -104,7 +96,6 @@ public:
|
||||
/// Resets the display for a new connection.
|
||||
void Reset() {
|
||||
layers.clear();
|
||||
got_vsync_event = false;
|
||||
}
|
||||
|
||||
/// Attempts to find a layer with the given ID.
|
||||
@@ -133,7 +124,6 @@ private:
|
||||
|
||||
std::vector<std::unique_ptr<Layer>> layers;
|
||||
Kernel::KEvent* vsync_event{};
|
||||
bool got_vsync_event{false};
|
||||
};
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -343,8 +343,8 @@ private:
|
||||
|
||||
class IManagerDisplayService final : public ServiceFramework<IManagerDisplayService> {
|
||||
public:
|
||||
explicit IManagerDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nv_flinger_)
|
||||
: ServiceFramework{system_, "IManagerDisplayService"}, nv_flinger{nv_flinger_} {
|
||||
explicit IManagerDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_)
|
||||
: ServiceFramework{system_, "IManagerDisplayService"}, nvnflinger{nvnflinger_} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{200, nullptr, "AllocateProcessHeapBlock"},
|
||||
@@ -440,7 +440,7 @@ private:
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 display = rp.Pop<u64>();
|
||||
|
||||
const Result rc = nv_flinger.CloseDisplay(display) ? ResultSuccess : ResultUnknown;
|
||||
const Result rc = nvnflinger.CloseDisplay(display) ? ResultSuccess : ResultUnknown;
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(rc);
|
||||
@@ -457,7 +457,7 @@ private:
|
||||
"(STUBBED) called. unknown=0x{:08X}, display=0x{:016X}, aruid=0x{:016X}",
|
||||
unknown, display, aruid);
|
||||
|
||||
const auto layer_id = nv_flinger.CreateLayer(display);
|
||||
const auto layer_id = nvnflinger.CreateLayer(display);
|
||||
if (!layer_id) {
|
||||
LOG_ERROR(Service_VI, "Layer not found! display=0x{:016X}", display);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -494,14 +494,14 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
Nvnflinger::Nvnflinger& nv_flinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
};
|
||||
|
||||
class IApplicationDisplayService final : public ServiceFramework<IApplicationDisplayService> {
|
||||
public:
|
||||
IApplicationDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nv_flinger_,
|
||||
IApplicationDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server_)
|
||||
: ServiceFramework{system_, "IApplicationDisplayService"}, nv_flinger{nv_flinger_},
|
||||
: ServiceFramework{system_, "IApplicationDisplayService"}, nvnflinger{nvnflinger_},
|
||||
hos_binder_driver_server{hos_binder_driver_server_} {
|
||||
|
||||
static const FunctionInfo functions[] = {
|
||||
@@ -564,7 +564,7 @@ private:
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISystemDisplayService>(system, nv_flinger);
|
||||
rb.PushIpcInterface<ISystemDisplayService>(system, nvnflinger);
|
||||
}
|
||||
|
||||
void GetManagerDisplayService(HLERequestContext& ctx) {
|
||||
@@ -572,7 +572,7 @@ private:
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<IManagerDisplayService>(system, nv_flinger);
|
||||
rb.PushIpcInterface<IManagerDisplayService>(system, nvnflinger);
|
||||
}
|
||||
|
||||
void GetIndirectDisplayTransactionService(HLERequestContext& ctx) {
|
||||
@@ -607,7 +607,7 @@ private:
|
||||
|
||||
ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
|
||||
|
||||
const auto display_id = nv_flinger.OpenDisplay(name);
|
||||
const auto display_id = nvnflinger.OpenDisplay(name);
|
||||
if (!display_id) {
|
||||
LOG_ERROR(Service_VI, "Display not found! display_name={}", name);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -624,7 +624,7 @@ private:
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 display_id = rp.Pop<u64>();
|
||||
|
||||
const Result rc = nv_flinger.CloseDisplay(display_id) ? ResultSuccess : ResultUnknown;
|
||||
const Result rc = nvnflinger.CloseDisplay(display_id) ? ResultSuccess : ResultUnknown;
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(rc);
|
||||
@@ -703,7 +703,7 @@ private:
|
||||
|
||||
LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}, aruid=0x{:016X}", layer_id, aruid);
|
||||
|
||||
const auto display_id = nv_flinger.OpenDisplay(display_name);
|
||||
const auto display_id = nvnflinger.OpenDisplay(display_name);
|
||||
if (!display_id) {
|
||||
LOG_ERROR(Service_VI, "Layer not found! layer_id={}", layer_id);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -711,7 +711,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
const auto buffer_queue_id = nv_flinger.FindBufferQueueId(*display_id, layer_id);
|
||||
const auto buffer_queue_id = nvnflinger.FindBufferQueueId(*display_id, layer_id);
|
||||
if (!buffer_queue_id) {
|
||||
LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", *display_id);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -719,7 +719,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
nv_flinger.OpenLayer(layer_id);
|
||||
nvnflinger.OpenLayer(layer_id);
|
||||
|
||||
android::OutputParcel parcel;
|
||||
parcel.WriteInterface(NativeWindow{*buffer_queue_id});
|
||||
@@ -737,7 +737,7 @@ private:
|
||||
|
||||
LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}", layer_id);
|
||||
|
||||
nv_flinger.CloseLayer(layer_id);
|
||||
nvnflinger.CloseLayer(layer_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -753,7 +753,7 @@ private:
|
||||
|
||||
// TODO(Subv): What's the difference between a Stray and a Managed layer?
|
||||
|
||||
const auto layer_id = nv_flinger.CreateLayer(display_id);
|
||||
const auto layer_id = nvnflinger.CreateLayer(display_id);
|
||||
if (!layer_id) {
|
||||
LOG_ERROR(Service_VI, "Layer not found! display_id={}", display_id);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -761,7 +761,7 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
const auto buffer_queue_id = nv_flinger.FindBufferQueueId(display_id, *layer_id);
|
||||
const auto buffer_queue_id = nvnflinger.FindBufferQueueId(display_id, *layer_id);
|
||||
if (!buffer_queue_id) {
|
||||
LOG_ERROR(Service_VI, "Buffer queue id not found! display_id={}", display_id);
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -785,7 +785,7 @@ private:
|
||||
const u64 layer_id = rp.Pop<u64>();
|
||||
|
||||
LOG_WARNING(Service_VI, "(STUBBED) called. layer_id=0x{:016X}", layer_id);
|
||||
nv_flinger.DestroyLayer(layer_id);
|
||||
nvnflinger.DestroyLayer(layer_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -798,7 +798,7 @@ private:
|
||||
LOG_DEBUG(Service_VI, "called. display_id={}", display_id);
|
||||
|
||||
Kernel::KReadableEvent* vsync_event{};
|
||||
const auto result = nv_flinger.FindVsyncEvent(&vsync_event, display_id);
|
||||
const auto result = nvnflinger.FindVsyncEvent(&vsync_event, display_id);
|
||||
if (result != ResultSuccess) {
|
||||
if (result == ResultNotFound) {
|
||||
LOG_ERROR(Service_VI, "Vsync event was not found for display_id={}", display_id);
|
||||
@@ -808,6 +808,12 @@ private:
|
||||
rb.Push(result);
|
||||
return;
|
||||
}
|
||||
if (vsync_event_fetched) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(VI::ResultPermissionDenied);
|
||||
return;
|
||||
}
|
||||
vsync_event_fetched = true;
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -899,8 +905,9 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
Nvnflinger::Nvnflinger& nv_flinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server;
|
||||
bool vsync_event_fetched{false};
|
||||
};
|
||||
|
||||
static bool IsValidServiceAccess(Permission permission, Policy policy) {
|
||||
@@ -916,7 +923,7 @@ static bool IsValidServiceAccess(Permission permission, Policy policy) {
|
||||
}
|
||||
|
||||
void detail::GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
|
||||
Nvnflinger::Nvnflinger& nv_flinger,
|
||||
Nvnflinger::Nvnflinger& nvnflinger,
|
||||
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server,
|
||||
Permission permission) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -931,19 +938,19 @@ void detail::GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<IApplicationDisplayService>(system, nv_flinger, hos_binder_driver_server);
|
||||
rb.PushIpcInterface<IApplicationDisplayService>(system, nvnflinger, hos_binder_driver_server);
|
||||
}
|
||||
|
||||
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nv_flinger,
|
||||
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nvnflinger,
|
||||
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
|
||||
server_manager->RegisterNamedService(
|
||||
"vi:m", std::make_shared<VI_M>(system, nv_flinger, hos_binder_driver_server));
|
||||
"vi:m", std::make_shared<VI_M>(system, nvnflinger, hos_binder_driver_server));
|
||||
server_manager->RegisterNamedService(
|
||||
"vi:s", std::make_shared<VI_S>(system, nv_flinger, hos_binder_driver_server));
|
||||
"vi:s", std::make_shared<VI_S>(system, nvnflinger, hos_binder_driver_server));
|
||||
server_manager->RegisterNamedService(
|
||||
"vi:u", std::make_shared<VI_U>(system, nv_flinger, hos_binder_driver_server));
|
||||
"vi:u", std::make_shared<VI_U>(system, nvnflinger, hos_binder_driver_server));
|
||||
ServerManager::RunServer(std::move(server_manager));
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ void GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
|
||||
Permission permission);
|
||||
} // namespace detail
|
||||
|
||||
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nv_flinger,
|
||||
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nvnflinger,
|
||||
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server);
|
||||
|
||||
} // namespace Service::VI
|
||||
|
||||
@@ -205,6 +205,7 @@ void ConfigureProfileManager::AddUser() {
|
||||
|
||||
const auto uuid = Common::UUID::MakeRandom();
|
||||
profile_manager.CreateNewUser(uuid, username.toStdString());
|
||||
profile_manager.WriteUserSaveFile();
|
||||
|
||||
item_model->appendRow(new QStandardItem{GetIcon(uuid), FormatUserEntryText(username, uuid)});
|
||||
}
|
||||
@@ -228,6 +229,7 @@ void ConfigureProfileManager::RenameUser() {
|
||||
std::copy(username_std.begin(), username_std.end(), profile.username.begin());
|
||||
|
||||
profile_manager.SetProfileBase(*uuid, profile);
|
||||
profile_manager.WriteUserSaveFile();
|
||||
|
||||
item_model->setItem(
|
||||
user, 0,
|
||||
@@ -256,6 +258,8 @@ void ConfigureProfileManager::DeleteUser(const Common::UUID& uuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
profile_manager.WriteUserSaveFile();
|
||||
|
||||
item_model->removeRows(tree_view->currentIndex().row(), 1);
|
||||
tree_view->clearSelection();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user