Compare commits

..

2 Commits

Author SHA1 Message Date
yuzubot
2b9ec5db0c Android 186 2024-01-08 01:00:45 +00:00
yuzubot
24071063db Merge yuzu-emu#12579 2024-01-08 01:00:44 +00:00
80 changed files with 651 additions and 756 deletions

View File

@@ -3,33 +3,38 @@
# SPDX-FileCopyrightText: 2019 yuzu Emulator Project
# SPDX-License-Identifier: GPL-2.0-or-later
shopt -s nullglob globstar
if grep -nrI '\s$' src **/*.yml **/*.txt **/*.md Doxyfile .gitignore .gitmodules .ci* dist/*.desktop \
if 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
# Default clang-format points to default 3.5 version one
CLANG_FORMAT="${CLANG_FORMAT:-clang-format-15}"
"$CLANG_FORMAT" --version
CLANG_FORMAT=${CLANG_FORMAT:-clang-format-15}
$CLANG_FORMAT --version
if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then
# Get list of every file modified in this pull request
files_to_lint="$(git diff --name-only --diff-filter=ACMRTUXB $TRAVIS_COMMIT_RANGE | grep '^src/[^.]*[.]\(cpp\|h\)$' || true)"
else
# Check everything for branch pushes
files_to_lint="$(find src/ -name '*.cpp' -or -name '*.h')"
fi
# Turn off tracing for this because it's too verbose
set +x
# Check everything for branch pushes
FILES_TO_LINT="$(find src/ -name '*.cpp' -or -name '*.h')"
for f in $FILES_TO_LINT; do
echo "$f"
"$CLANG_FORMAT" -i "$f"
for f in $files_to_lint; do
d=$(diff -u "$f" <($CLANG_FORMAT "$f") || true)
if ! [ -z "$d" ]; then
echo "!!! $f not compliant to coding style, here is the fix:"
echo "$d"
fail=1
fi
done
DIFF=$(git diff)
set -x
if [ ! -z "$DIFF" ]; then
echo "!!! Not compliant to coding style, here is the fix:"
echo "$DIFF"
if [ "$fail" = 1 ]; then
exit 1
fi

View File

@@ -9,7 +9,7 @@ chmod a+x ./.ci/scripts/linux/docker.sh
sudo chown -R 1027 ./
# The environment variables listed below:
# AZURECIREPO TITLEBARFORMATIDLE TITLEBARFORMATRUNNING DISPLAYVERSION
# AZURECIREPO TITLEBARFORMATIDLE TITLEBARFORMATRUNNING DISPLAYVERSION
# are requested in src/common/CMakeLists.txt and appear to be provided somewhere in Azure DevOps
docker run -e AZURECIREPO -e TITLEBARFORMATIDLE -e TITLEBARFORMATRUNNING -e DISPLAYVERSION -e ENABLE_COMPATIBILITY_REPORTING -e CCACHE_DIR=/yuzu/ccache -v "$(pwd):/yuzu" -w /yuzu yuzuemu/build-environments:linux-fresh /bin/bash /yuzu/.ci/scripts/linux/docker.sh "$1"

View File

@@ -1,4 +1,4 @@
Copyright (c) <year> <owner>
Copyright (c) <year> <owner>
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@@ -1,4 +1,4 @@
Copyright (c) <year> <owner>.
Copyright (c) <year> <owner>.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

View File

@@ -35,7 +35,7 @@ Mozilla Public License Version 2.0
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"

View File

@@ -1,6 +1,6 @@
| Pull Request | Commit | Title | Author | Merged? |
|----|----|----|----|----|
| [12579](https://github.com/yuzu-emu/yuzu-android//pull/12579) | [`66ae60a9e`](https://github.com/yuzu-emu/yuzu-android//pull/12579/files) | Core: Implement Device Mapping & GPU SMMU | [FernandoS27](https://github.com/FernandoS27/) | Yes |
| [12579](https://github.com/yuzu-emu/yuzu-android//pull/12579) | [`b5b47aa25`](https://github.com/yuzu-emu/yuzu-android//pull/12579/files) | Core: Implement Device Mapping & GPU SMMU | [FernandoS27](https://github.com/FernandoS27/) | Yes |
End of merge log. You can find the original README.md below the break.

View File

@@ -138,7 +138,7 @@ if (NOT WIN32 AND NOT ANDROID)
--cross-prefix=${TOOLCHAIN}/bin/aarch64-linux-android-
--sysroot=${SYSROOT}
--target-os=android
--extra-ldflags="--ld-path=${TOOLCHAIN}/bin/ld.lld"
--extra-ldflags="--ld-path=${TOOLCHAIN}/bin/ld.lld"
--extra-ldflags="-nostdlib"
)
endif()

View File

@@ -712,24 +712,24 @@ add_library(core STATIC
hle/service/server_manager.h
hle/service/service.cpp
hle/service/service.h
hle/service/set/set.cpp
hle/service/set/set.h
hle/service/set/appln_settings.cpp
hle/service/set/appln_settings.h
hle/service/set/device_settings.cpp
hle/service/set/device_settings.h
hle/service/set/factory_settings_server.cpp
hle/service/set/factory_settings_server.h
hle/service/set/firmware_debug_settings_server.cpp
hle/service/set/firmware_debug_settings_server.h
hle/service/set/private_settings.cpp
hle/service/set/private_settings.h
hle/service/set/set_cal.cpp
hle/service/set/set_cal.h
hle/service/set/set_fd.cpp
hle/service/set/set_fd.h
hle/service/set/set_sys.cpp
hle/service/set/set_sys.h
hle/service/set/settings.cpp
hle/service/set/settings.h
hle/service/set/settings_server.cpp
hle/service/set/settings_server.h
hle/service/set/system_settings.cpp
hle/service/set/system_settings.h
hle/service/set/system_settings_server.cpp
hle/service/set/system_settings_server.h
hle/service/sm/sm.cpp
hle/service/sm/sm.h
hle/service/sm/sm_controller.cpp

View File

@@ -64,7 +64,7 @@ public:
return [this] { ShutdownThreadFunction(); };
}
void PreemptSingleCore(bool from_running_environment = true);
void PreemptSingleCore(bool from_running_enviroment = true);
std::size_t CurrentCore() const {
return current_core.load();

View File

@@ -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},
{"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},
{"----- 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},
}};
static constexpr const char* GetMemoryStateName(Kernel::Svc::MemoryState state) {

View File

@@ -26,7 +26,7 @@
#include "core/file_sys/vfs_vector.h"
#include "core/hle/service/filesystem/filesystem.h"
#include "core/hle/service/ns/language.h"
#include "core/hle/service/set/settings_server.h"
#include "core/hle/service/set/set.h"
#include "core/loader/loader.h"
#include "core/loader/nso.h"
#include "core/memory/cheat_engine.h"

View File

@@ -81,12 +81,12 @@ enum class KMemoryState : u32 {
ThreadLocal = static_cast<u32>(Svc::MemoryState::ThreadLocal) | FlagLinearMapped,
Transferred = static_cast<u32>(Svc::MemoryState::Transferred) | FlagsMisc |
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
Transfered = static_cast<u32>(Svc::MemoryState::Transfered) | FlagsMisc |
FlagCanAlignedDeviceMap | FlagCanChangeAttribute | FlagCanUseIpc |
FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
SharedTransferred = static_cast<u32>(Svc::MemoryState::SharedTransferred) | FlagsMisc |
FlagCanAlignedDeviceMap | FlagCanUseNonSecureIpc | FlagCanUseNonDeviceIpc,
SharedTransfered = static_cast<u32>(Svc::MemoryState::SharedTransfered) | 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::Transferred) == 0x055C3C0D);
static_assert(static_cast<u32>(KMemoryState::SharedTransferred) == 0x045C380E);
static_assert(static_cast<u32>(KMemoryState::Transfered) == 0x055C3C0D);
static_assert(static_cast<u32>(KMemoryState::SharedTransfered) == 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);

View File

@@ -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::Transferred:
case Svc::MemoryState::SharedTransferred:
case Svc::MemoryState::Transfered:
case Svc::MemoryState::SharedTransfered:
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::Transferred:
case Svc::MemoryState::SharedTransferred:
case Svc::MemoryState::Transfered:
case Svc::MemoryState::SharedTransfered:
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::Transferred:
case Svc::MemoryState::SharedTransferred:
case Svc::MemoryState::Transfered:
case Svc::MemoryState::SharedTransfered:
case Svc::MemoryState::SharedCode:
case Svc::MemoryState::GeneratedCode:
case Svc::MemoryState::CodeOut:

View File

@@ -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::Transferred
: KMemoryState::SharedTransferred;
? KMemoryState::Transfered
: KMemoryState::SharedTransfered;
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::Transferred
: KMemoryState::SharedTransferred;
? KMemoryState::Transfered
: KMemoryState::SharedTransfered;
R_TRY(GetCurrentProcess(m_kernel).GetPageTable().UnmapPageGroup(address, *m_page_group, state));
// Mark ourselves as unmapped.

View File

@@ -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::Transferred),
.CanContain(address, size, KMemoryState::Transfered),
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::Transferred),
.CanContain(address, size, KMemoryState::Transfered),
ResultInvalidMemoryRegion);
// Unmap the transfer memory.

View File

@@ -27,8 +27,8 @@ enum class MemoryState : u32 {
Ipc = 0x0A,
Stack = 0x0B,
ThreadLocal = 0x0C,
Transferred = 0x0D,
SharedTransferred = 0x0E,
Transfered = 0x0D,
SharedTransfered = 0x0E,
SharedCode = 0x0F,
Inaccessible = 0x10,
NonSecureIpc = 0x11,

View File

@@ -76,7 +76,7 @@ struct UiSettingsDisplayOptions {
bool is_system_or_launcher;
bool is_registration_permitted;
bool show_skip_button;
bool additional_select;
bool aditional_select;
bool show_user_selector;
bool is_unqualified_user_selectable;
};

View File

@@ -85,7 +85,7 @@ Result AlbumManager::GetAlbumFileList(std::vector<AlbumEntry>& out_entries, Albu
}
Result AlbumManager::GetAlbumFileList(std::vector<ApplicationAlbumFileEntry>& out_entries,
ContentType content_type, s64 start_posix_time,
ContentType contex_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, content_type, start_date, end_date, aruid);
const auto result = GetAlbumFileList(album_entries, contex_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 content_type, AlbumFileDateTime start_date,
ContentType contex_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 != content_type) {
if (file_id.type != contex_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 = content_type,
.content = contex_type,
.unknown = 1,
};
out_entries.push_back(entry);

View File

@@ -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 content_type, s64 start_posix_time, s64 end_posix_time,
ContentType contex_type, s64 start_posix_time, s64 end_posix_time,
u64 aruid) const;
Result GetAlbumFileList(std::vector<ApplicationAlbumEntry>& out_entries,
ContentType content_type, AlbumFileDateTime start_date,
ContentType contex_type, AlbumFileDateTime start_date,
AlbumFileDateTime end_date, u64 aruid) const;
Result GetAutoSavingStorage(bool& out_is_autosaving) const;
Result LoadAlbumScreenShotImage(LoadAlbumScreenShotImageOutput& out_image_output,

View File

@@ -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 ResultInvalidTimestamp(ErrorModule::Capture, 12);
constexpr Result ResulInvalidTimestamp(ErrorModule::Capture, 12);
constexpr Result ResultInvalidStorage(ErrorModule::Capture, 13);
constexpr Result ResultInvalidFileContents(ErrorModule::Capture, 14);
constexpr Result ResultIsNotMounted(ErrorModule::Capture, 21);

View File

@@ -131,7 +131,7 @@ private:
u8 is_favorite;
u8 same_app;
u8 same_app_played;
u8 arbitrary_app_played;
u8 arbitary_app_played;
u64 group_id;
};
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");

View File

@@ -18,23 +18,23 @@ namespace Service::HID {
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
std::shared_ptr<ResourceManager> resource_manager = std::make_shared<ResourceManager>(system);
std::shared_ptr<ResourceManager> resouce_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()) {
resource_manager->Initialize();
resource_manager->RegisterAppletResourceUserId(process_list[0]->GetId(), true);
resouce_manager->Initialize();
resouce_manager->RegisterAppletResourceUserId(process_list[0]->GetId(), true);
}
server_manager->RegisterNamedService(
"hid", std::make_shared<IHidServer>(system, resource_manager, firmware_settings));
"hid", std::make_shared<IHidServer>(system, resouce_manager, firmware_settings));
server_manager->RegisterNamedService(
"hid:dbg", std::make_shared<IHidDebugServer>(system, resource_manager));
"hid:dbg", std::make_shared<IHidDebugServer>(system, resouce_manager));
server_manager->RegisterNamedService(
"hid:sys", std::make_shared<IHidSystemServer>(system, resource_manager));
"hid:sys", std::make_shared<IHidSystemServer>(system, resouce_manager));
server_manager->RegisterNamedService("hidbus", std::make_shared<HidBus>(system));

View File

@@ -1444,8 +1444,8 @@ void IHidServer::SetNpadAnalogStickUseCenterClamp(HLERequestContext& ctx) {
const auto parameters{rp.PopRaw<Parameters>()};
LOG_INFO(Service_HID, "called, use_center_clamp={}, applet_resource_user_id={}",
parameters.use_center_clamp, parameters.applet_resource_user_id);
LOG_WARNING(Service_HID, "(STUBBED) called, use_center_clamp={}, applet_resource_user_id={}",
parameters.use_center_clamp, parameters.applet_resource_user_id);
GetResourceManager()->GetNpad()->SetNpadAnalogStickUseCenterClamp(
parameters.applet_resource_user_id, parameters.use_center_clamp);
@@ -1466,27 +1466,23 @@ void IHidServer::SetNpadCaptureButtonAssignment(HLERequestContext& ctx) {
const auto parameters{rp.PopRaw<Parameters>()};
LOG_INFO(Service_HID, "called, npad_styleset={}, applet_resource_user_id={}, button={}",
parameters.npad_styleset, parameters.applet_resource_user_id, parameters.button);
const auto result = GetResourceManager()->GetNpad()->SetNpadCaptureButtonAssignment(
parameters.applet_resource_user_id, parameters.npad_styleset, parameters.button);
LOG_WARNING(Service_HID,
"(STUBBED) called, npad_styleset={}, applet_resource_user_id={}, button={}",
parameters.npad_styleset, parameters.applet_resource_user_id, parameters.button);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result);
rb.Push(ResultSuccess);
}
void IHidServer::ClearNpadCaptureButtonAssignment(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()};
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
const auto result =
GetResourceManager()->GetNpad()->ClearNpadCaptureButtonAssignment(applet_resource_user_id);
LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}",
applet_resource_user_id);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result);
rb.Push(ResultSuccess);
}
void IHidServer::GetVibrationDeviceInfo(HLERequestContext& ctx) {

View File

@@ -46,7 +46,7 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
{310, &IHidSystemServer::GetMaskedSupportedNpadStyleSet, "GetMaskedSupportedNpadStyleSet"},
{311, nullptr, "SetNpadPlayerLedBlinkingDevice"},
{312, &IHidSystemServer::SetSupportedNpadStyleSetAll, "SetSupportedNpadStyleSetAll"},
{313, &IHidSystemServer::GetNpadCaptureButtonAssignment, "GetNpadCaptureButtonAssignment"},
{313, nullptr, "GetNpadCaptureButtonAssignment"},
{314, nullptr, "GetAppletFooterUiType"},
{315, &IHidSystemServer::GetAppletDetailedUiType, "GetAppletDetailedUiType"},
{316, &IHidSystemServer::GetNpadInterfaceType, "GetNpadInterfaceType"},
@@ -54,8 +54,8 @@ IHidSystemServer::IHidSystemServer(Core::System& system_, std::shared_ptr<Resour
{318, &IHidSystemServer::HasBattery, "HasBattery"},
{319, &IHidSystemServer::HasLeftRightBattery, "HasLeftRightBattery"},
{321, &IHidSystemServer::GetUniquePadsFromNpad, "GetUniquePadsFromNpad"},
{322, &IHidSystemServer::SetNpadSystemExtStateEnabled, "SetNpadSystemExtStateEnabled"},
{323, nullptr, "GetLastActiveUniquePad"},
{322, &IHidSystemServer::GetIrSensorState, "GetIrSensorState"},
{323, nullptr, "GetXcdHandleForNpadWithIrSensor"},
{324, nullptr, "GetUniquePadButtonSet"},
{325, nullptr, "GetUniquePadColor"},
{326, nullptr, "GetUniquePadAppletDetailedUiType"},
@@ -251,38 +251,25 @@ void IHidSystemServer::ApplyNpadSystemCommonPolicy(HLERequestContext& ctx) {
}
void IHidSystemServer::EnableAssigningSingleOnSlSrPress(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()};
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
GetResourceManager()->GetNpad()->AssigningSingleOnSlSrPress(applet_resource_user_id, true);
LOG_WARNING(Service_HID, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void IHidSystemServer::DisableAssigningSingleOnSlSrPress(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()};
LOG_INFO(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
GetResourceManager()->GetNpad()->AssigningSingleOnSlSrPress(applet_resource_user_id, false);
LOG_WARNING(Service_HID, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
}
void IHidSystemServer::GetLastActiveNpad(HLERequestContext& ctx) {
Core::HID::NpadIdType npad_id{};
const Result result = GetResourceManager()->GetNpad()->GetLastActiveNpad(npad_id);
LOG_DEBUG(Service_HID, "called, npad_id={}", npad_id);
LOG_DEBUG(Service_HID, "(STUBBED) called"); // Spams a lot when controller applet is running
IPC::ResponseBuilder rb{ctx, 3};
rb.Push(result);
rb.PushEnum(npad_id);
rb.Push(ResultSuccess);
rb.Push(0); // Dont forget to fix this
}
void IHidSystemServer::ApplyNpadSystemCommonPolicyFull(HLERequestContext& ctx) {
@@ -344,27 +331,6 @@ void IHidSystemServer::SetSupportedNpadStyleSetAll(HLERequestContext& ctx) {
rb.Push(result);
}
void IHidSystemServer::GetNpadCaptureButtonAssignment(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto applet_resource_user_id{rp.Pop<u64>()};
const auto capture_button_list_size{ctx.GetWriteBufferNumElements<Core::HID::NpadButton>()};
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
std::vector<Core::HID::NpadButton> capture_button_list(capture_button_list_size);
const auto& npad = GetResourceManager()->GetNpad();
const u64 list_size =
npad->GetNpadCaptureButtonAssignment(capture_button_list, applet_resource_user_id);
if (list_size != 0) {
ctx.WriteBuffer(capture_button_list);
}
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(ResultSuccess);
rb.Push(list_size);
}
void IHidSystemServer::GetAppletDetailedUiType(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto npad_id_type{rp.PopEnum<Core::HID::NpadIdType>()};
@@ -457,25 +423,13 @@ void IHidSystemServer::GetUniquePadsFromNpad(HLERequestContext& ctx) {
rb.Push(static_cast<u32>(unique_pads.size()));
}
void IHidSystemServer::SetNpadSystemExtStateEnabled(HLERequestContext& ctx) {
void IHidSystemServer::GetIrSensorState(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
struct Parameters {
bool is_enabled;
INSERT_PADDING_BYTES_NOINIT(7);
u64 applet_resource_user_id;
};
static_assert(sizeof(Parameters) == 0x10, "Parameters has incorrect size.");
const auto parameters{rp.PopRaw<Parameters>()};
LOG_INFO(Service_HID, "called, is_enabled={}, applet_resource_user_id={}",
parameters.is_enabled, parameters.applet_resource_user_id);
const auto result = GetResourceManager()->GetNpad()->SetNpadSystemExtStateEnabled(
parameters.applet_resource_user_id, parameters.is_enabled);
LOG_WARNING(Service_HID, "(STUBBED) called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(result);
rb.Push(ResultSuccess);
}
void IHidSystemServer::RegisterAppletResourceUserId(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};

View File

@@ -31,14 +31,13 @@ private:
void GetNpadFullKeyGripColor(HLERequestContext& ctx);
void GetMaskedSupportedNpadStyleSet(HLERequestContext& ctx);
void SetSupportedNpadStyleSetAll(HLERequestContext& ctx);
void GetNpadCaptureButtonAssignment(HLERequestContext& ctx);
void GetAppletDetailedUiType(HLERequestContext& ctx);
void GetNpadInterfaceType(HLERequestContext& ctx);
void GetNpadLeftRightInterfaceType(HLERequestContext& ctx);
void HasBattery(HLERequestContext& ctx);
void HasLeftRightBattery(HLERequestContext& ctx);
void GetUniquePadsFromNpad(HLERequestContext& ctx);
void SetNpadSystemExtStateEnabled(HLERequestContext& ctx);
void GetIrSensorState(HLERequestContext& ctx);
void RegisterAppletResourceUserId(HLERequestContext& ctx);
void UnregisterAppletResourceUserId(HLERequestContext& ctx);
void EnableAppletToGetInput(HLERequestContext& ctx);

View File

@@ -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_initialized) {
if (!devices[i].is_device_initializated) {
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_initialized = true;
devices[device_index.value()].is_device_initializated = 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_initialized = true;
devices[device_index.value()].is_device_initializated = 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_initialized = false;
devices[device_index.value()].is_device_initializated = false;
device->DeactivateDevice();
cur_entry.is_in_focus = true;

View File

@@ -89,7 +89,7 @@ private:
static_assert(sizeof(HidbusStatusManager) <= 0x1000, "HidbusStatusManager is an invalid size");
struct HidbusDevice {
bool is_device_initialized{};
bool is_device_initializated{};
BusHandle handle{};
std::unique_ptr<HidbusBase> device{nullptr};
};

View File

@@ -182,22 +182,22 @@ void HLERequestContext::ParseCommandBuffer(u32_le* src_cmdbuf, bool incoming) {
}
}
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);
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);
for (u32 i = 0; i < command_header->num_buf_x_descriptors; ++i) {
buffer_x_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
buffer_x_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorX>());
}
for (u32 i = 0; i < command_header->num_buf_a_descriptors; ++i) {
buffer_a_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
buffer_a_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
}
for (u32 i = 0; i < command_header->num_buf_b_descriptors; ++i) {
buffer_b_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
buffer_b_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
}
for (u32 i = 0; i < command_header->num_buf_w_descriptors; ++i) {
buffer_w_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
buffer_w_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorABW>());
}
const auto buffer_c_offset = rp.GetCurrentOffset() + command_header->data_size;
@@ -247,7 +247,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_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
} else {
u32 num_buf_c_descriptors =
static_cast<u32>(command_header->buf_c_descriptor_flags.Value()) - 2;
@@ -257,7 +257,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_descriptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
buffer_c_desciptors.push_back(rp.PopRaw<IPC::BufferDescriptorC>());
}
}
}

View File

@@ -234,19 +234,19 @@ public:
}
[[nodiscard]] const std::vector<IPC::BufferDescriptorX>& BufferDescriptorX() const {
return buffer_x_descriptors;
return buffer_x_desciptors;
}
[[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorA() const {
return buffer_a_descriptors;
return buffer_a_desciptors;
}
[[nodiscard]] const std::vector<IPC::BufferDescriptorABW>& BufferDescriptorB() const {
return buffer_b_descriptors;
return buffer_b_desciptors;
}
[[nodiscard]] const std::vector<IPC::BufferDescriptorC>& BufferDescriptorC() const {
return buffer_c_descriptors;
return buffer_c_desciptors;
}
[[nodiscard]] const IPC::DomainMessageHeader& GetDomainMessageHeader() const {
@@ -408,11 +408,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_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;
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;
u32_le command{};
u64 pid{};

View File

@@ -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, "compatibility_container=0x{0:x}", ntag_file.compatibility_container);
LOG_DEBUG(Service_NFP, "compability_container=0x{0:x}", ntag_file.compability_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.compatibility_container != 0xEEFF10F1U) {
if (ntag_file.compability_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.compatibility_container = nfc_data.compatibility_container;
encoded_data.compability_container = nfc_data.compability_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.compatibility_container = encoded_data.compatibility_container;
nfc_data.compability_container = encoded_data.compability_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.compatibility_container = in_data.compatibility_container;
out_data.compability_container = in_data.compability_container;
out_data.constant_value = in_data.constant_value;
out_data.write_counter = in_data.write_counter;

View File

@@ -75,7 +75,7 @@ void NfcDevice::NpadUpdate(Core::HID::ControllerTriggerType type) {
return;
}
if (!is_initialized) {
if (!is_initalized) {
return;
}
@@ -207,7 +207,7 @@ void NfcDevice::Initialize() {
return;
}
is_initialized = npad_device->AddNfcHandle();
is_initalized = npad_device->AddNfcHandle();
}
void NfcDevice::Finalize() {
@@ -226,7 +226,7 @@ void NfcDevice::Finalize() {
}
device_state = DeviceState::Unavailable;
is_initialized = false;
is_initalized = false;
}
Result NfcDevice::StartDetection(NfcProtocol allowed_protocol) {

View File

@@ -126,7 +126,7 @@ private:
Kernel::KEvent* deactivate_event = nullptr;
Kernel::KEvent* availability_change_event = nullptr;
bool is_initialized{};
bool is_initalized{};
NfcProtocol allowed_protocols{};
DeviceState device_state{DeviceState::Unavailable};

View File

@@ -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 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
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
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 compatibility_container; // Defines available memory
u32 compability_container; // Defines available memory
EncryptedAmiiboFile user_memory; // Writable data
u32 dynamic_lock; // Dynamic lock
u32 CFG0; // Defines memory protected by password

View File

@@ -2,7 +2,7 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/ns/language.h"
#include "core/hle/service/set/settings_server.h"
#include "core/hle/service/set/set.h"
namespace Service::NS {

View File

@@ -16,7 +16,7 @@
#include "core/hle/service/ns/ns.h"
#include "core/hle/service/ns/pdm_qry.h"
#include "core/hle/service/server_manager.h"
#include "core/hle/service/set/settings_server.h"
#include "core/hle/service/set/set.h"
namespace Service::NS {

View File

@@ -90,7 +90,7 @@ private:
u64_le align;
};
};
static_assert(sizeof(IoctlAllocSpace) == 24, "IoctlInitializeEx is incorrect size");
static_assert(sizeof(IoctlAllocSpace) == 24, "IoctlInitalizeEx is incorrect size");
struct IoctlFreeSpace {
u64_le offset{};

View File

@@ -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("CtrlGpuUnknownEvent");
unknown_event = events_interface.CreateEvent("CtrlGpuUknownEvent");
}
nvhost_ctrl_gpu::~nvhost_ctrl_gpu() {
events_interface.FreeEvent(error_notifier_event);

View File

@@ -51,7 +51,7 @@ enum class NvResult : u32 {
DispNoDisplaysAttached = 0x20003,
DispModeNotSupported = 0x20004,
DispNotFound = 0x20005,
DispAttachDisallowed = 0x20006,
DispAttachDissallowed = 0x20006,
DispTypeNotSupported = 0x20007,
DispAuthenticationFailed = 0x20008,
DispNotAttached = 0x20009,

View File

@@ -223,8 +223,7 @@ Result Nvnflinger::FindVsyncEvent(Kernel::KReadableEvent** out_vsync_event, u64
return VI::ResultNotFound;
}
*out_vsync_event = display->GetVSyncEvent();
return ResultSuccess;
return display->GetVSyncEvent(out_vsync_event);
}
VI::Display* Nvnflinger::FindDisplay(u64 display_id) {

View File

@@ -54,8 +54,8 @@ public:
class IClkrstSession final : public ServiceFramework<IClkrstSession> {
public:
explicit IClkrstSession(Core::System& system_, DeviceCode device_code_)
: ServiceFramework{system_, "IClkrstSession"}, device_code(device_code_) {
explicit IClkrstSession(Core::System& system_, DeviceCode deivce_code_)
: ServiceFramework{system_, "IClkrstSession"}, deivce_code(deivce_code_) {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "SetClockEnabled"},
@@ -93,7 +93,7 @@ private:
rb.Push<u32>(clock_rate);
}
DeviceCode device_code;
DeviceCode deivce_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 unknown_input = rp.Pop<u32>();
const auto unkonwn_input = rp.Pop<u32>();
LOG_DEBUG(Service_PCV, "called, device_code={}, input={}", device_code, unknown_input);
LOG_DEBUG(Service_PCV, "called, device_code={}, input={}", device_code, unkonwn_input);
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);

View File

@@ -7,7 +7,7 @@
#include "common/logging/log.h"
#include "common/settings.h"
#include "core/hle/service/ipc_helpers.h"
#include "core/hle/service/set/settings_server.h"
#include "core/hle/service/set/set.h"
namespace Service::Set {
namespace {
@@ -58,36 +58,13 @@ LanguageCode GetLanguageCodeFromIndex(std::size_t index) {
return available_language_codes.at(index);
}
ISettingsServer::ISettingsServer(Core::System& system_) : ServiceFramework{system_, "set"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &ISettingsServer::GetLanguageCode, "GetLanguageCode"},
{1, &ISettingsServer::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
{2, &ISettingsServer::MakeLanguageCode, "MakeLanguageCode"},
{3, &ISettingsServer::GetAvailableLanguageCodeCount, "GetAvailableLanguageCodeCount"},
{4, &ISettingsServer::GetRegionCode, "GetRegionCode"},
{5, &ISettingsServer::GetAvailableLanguageCodes2, "GetAvailableLanguageCodes2"},
{6, &ISettingsServer::GetAvailableLanguageCodeCount2, "GetAvailableLanguageCodeCount2"},
{7, &ISettingsServer::GetKeyCodeMap, "GetKeyCodeMap"},
{8, &ISettingsServer::GetQuestFlag, "GetQuestFlag"},
{9, &ISettingsServer::GetKeyCodeMap2, "GetKeyCodeMap2"},
{10, nullptr, "GetFirmwareVersionForDebug"},
{11, &ISettingsServer::GetDeviceNickName, "GetDeviceNickName"},
};
// clang-format on
RegisterHandlers(functions);
}
ISettingsServer::~ISettingsServer() = default;
void ISettingsServer::GetAvailableLanguageCodes(HLERequestContext& ctx) {
void SET::GetAvailableLanguageCodes(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
GetAvailableLanguageCodesImpl(ctx, PRE_4_0_0_MAX_ENTRIES);
}
void ISettingsServer::MakeLanguageCode(HLERequestContext& ctx) {
void SET::MakeLanguageCode(HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto index = rp.Pop<u32>();
@@ -103,25 +80,25 @@ void ISettingsServer::MakeLanguageCode(HLERequestContext& ctx) {
rb.PushEnum(available_language_codes[index]);
}
void ISettingsServer::GetAvailableLanguageCodes2(HLERequestContext& ctx) {
void SET::GetAvailableLanguageCodes2(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
GetAvailableLanguageCodesImpl(ctx, POST_4_0_0_MAX_ENTRIES);
}
void ISettingsServer::GetAvailableLanguageCodeCount(HLERequestContext& ctx) {
void SET::GetAvailableLanguageCodeCount(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
PushResponseLanguageCode(ctx, PRE_4_0_0_MAX_ENTRIES);
}
void ISettingsServer::GetAvailableLanguageCodeCount2(HLERequestContext& ctx) {
void SET::GetAvailableLanguageCodeCount2(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
PushResponseLanguageCode(ctx, POST_4_0_0_MAX_ENTRIES);
}
void ISettingsServer::GetQuestFlag(HLERequestContext& ctx) {
void SET::GetQuestFlag(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
IPC::ResponseBuilder rb{ctx, 3};
@@ -129,7 +106,7 @@ void ISettingsServer::GetQuestFlag(HLERequestContext& ctx) {
rb.Push(static_cast<s32>(Settings::values.quest_flag.GetValue()));
}
void ISettingsServer::GetLanguageCode(HLERequestContext& ctx) {
void SET::GetLanguageCode(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called {}", Settings::values.language_index.GetValue());
IPC::ResponseBuilder rb{ctx, 4};
@@ -138,7 +115,7 @@ void ISettingsServer::GetLanguageCode(HLERequestContext& ctx) {
available_language_codes[static_cast<s32>(Settings::values.language_index.GetValue())]);
}
void ISettingsServer::GetRegionCode(HLERequestContext& ctx) {
void SET::GetRegionCode(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
IPC::ResponseBuilder rb{ctx, 3};
@@ -146,21 +123,44 @@ void ISettingsServer::GetRegionCode(HLERequestContext& ctx) {
rb.Push(static_cast<u32>(Settings::values.region_index.GetValue()));
}
void ISettingsServer::GetKeyCodeMap(HLERequestContext& ctx) {
void SET::GetKeyCodeMap(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "Called {}", ctx.Description());
GetKeyCodeMapImpl(ctx);
}
void ISettingsServer::GetKeyCodeMap2(HLERequestContext& ctx) {
void SET::GetKeyCodeMap2(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "Called {}", ctx.Description());
GetKeyCodeMapImpl(ctx);
}
void ISettingsServer::GetDeviceNickName(HLERequestContext& ctx) {
void SET::GetDeviceNickName(HLERequestContext& ctx) {
LOG_DEBUG(Service_SET, "called");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
ctx.WriteBuffer(Settings::values.device_name.GetValue());
}
SET::SET(Core::System& system_) : ServiceFramework{system_, "set"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, &SET::GetLanguageCode, "GetLanguageCode"},
{1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
{2, &SET::MakeLanguageCode, "MakeLanguageCode"},
{3, &SET::GetAvailableLanguageCodeCount, "GetAvailableLanguageCodeCount"},
{4, &SET::GetRegionCode, "GetRegionCode"},
{5, &SET::GetAvailableLanguageCodes2, "GetAvailableLanguageCodes2"},
{6, &SET::GetAvailableLanguageCodeCount2, "GetAvailableLanguageCodeCount2"},
{7, &SET::GetKeyCodeMap, "GetKeyCodeMap"},
{8, &SET::GetQuestFlag, "GetQuestFlag"},
{9, &SET::GetKeyCodeMap2, "GetKeyCodeMap2"},
{10, nullptr, "GetFirmwareVersionForDebug"},
{11, &SET::GetDeviceNickName, "GetDeviceNickName"},
};
// clang-format on
RegisterHandlers(functions);
}
SET::~SET() = default;
} // namespace Service::Set

View File

@@ -73,10 +73,10 @@ static constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> languag
LanguageCode GetLanguageCodeFromIndex(std::size_t idx);
class ISettingsServer final : public ServiceFramework<ISettingsServer> {
class SET final : public ServiceFramework<SET> {
public:
explicit ISettingsServer(Core::System& system_);
~ISettingsServer() override;
explicit SET(Core::System& system_);
~SET() override;
private:
void GetLanguageCode(HLERequestContext& ctx);

View File

@@ -1,12 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/factory_settings_server.h"
#include "core/hle/service/set/set_cal.h"
namespace Service::Set {
IFactorySettingsServer::IFactorySettingsServer(Core::System& system_)
: ServiceFramework{system_, "set:cal"} {
SET_CAL::SET_CAL(Core::System& system_) : ServiceFramework{system_, "set:cal"} {
// clang-format off
static const FunctionInfo functions[] = {
{0, nullptr, "GetBluetoothBdAddress"},
@@ -58,6 +57,6 @@ IFactorySettingsServer::IFactorySettingsServer(Core::System& system_)
RegisterHandlers(functions);
}
IFactorySettingsServer::~IFactorySettingsServer() = default;
SET_CAL::~SET_CAL() = default;
} // namespace Service::Set

View File

@@ -11,10 +11,10 @@ class System;
namespace Service::Set {
class IFactorySettingsServer final : public ServiceFramework<IFactorySettingsServer> {
class SET_CAL final : public ServiceFramework<SET_CAL> {
public:
explicit IFactorySettingsServer(Core::System& system_);
~IFactorySettingsServer() override;
explicit SET_CAL(Core::System& system_);
~SET_CAL() override;
};
} // namespace Service::Set

View File

@@ -1,12 +1,11 @@
// SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/set/firmware_debug_settings_server.h"
#include "core/hle/service/set/set_fd.h"
namespace Service::Set {
IFirmwareDebugSettingsServer::IFirmwareDebugSettingsServer(Core::System& system_)
: ServiceFramework{system_, "set:fd"} {
SET_FD::SET_FD(Core::System& system_) : ServiceFramework{system_, "set:fd"} {
// clang-format off
static const FunctionInfo functions[] = {
{2, nullptr, "SetSettingsItemValue"},
@@ -24,6 +23,6 @@ IFirmwareDebugSettingsServer::IFirmwareDebugSettingsServer(Core::System& system_
RegisterHandlers(functions);
}
IFirmwareDebugSettingsServer::~IFirmwareDebugSettingsServer() = default;
SET_FD::~SET_FD() = default;
} // namespace Service::Set

View File

@@ -11,10 +11,10 @@ class System;
namespace Service::Set {
class IFirmwareDebugSettingsServer final : public ServiceFramework<IFirmwareDebugSettingsServer> {
class SET_FD final : public ServiceFramework<SET_FD> {
public:
explicit IFirmwareDebugSettingsServer(Core::System& system_);
~IFirmwareDebugSettingsServer() override;
explicit SET_FD(Core::System& system_);
~SET_FD() override;
};
} // namespace Service::Set

View File

@@ -47,10 +47,10 @@ static_assert(sizeof(FirmwareVersionFormat) == 0x100, "FirmwareVersionFormat is
Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System& system,
GetFirmwareVersionType type);
class ISystemSettingsServer final : public ServiceFramework<ISystemSettingsServer> {
class SET_SYS final : public ServiceFramework<SET_SYS> {
public:
explicit ISystemSettingsServer(Core::System& system_);
~ISystemSettingsServer() override;
explicit SET_SYS(Core::System& system_);
~SET_SYS() override;
Result GetSettingsItemValue(std::vector<u8>& out_value, const std::string& category,
const std::string& name);

View File

@@ -2,24 +2,21 @@
// SPDX-License-Identifier: GPL-2.0-or-later
#include "core/hle/service/server_manager.h"
#include "core/hle/service/set/factory_settings_server.h"
#include "core/hle/service/set/firmware_debug_settings_server.h"
#include "core/hle/service/set/set.h"
#include "core/hle/service/set/set_cal.h"
#include "core/hle/service/set/set_fd.h"
#include "core/hle/service/set/set_sys.h"
#include "core/hle/service/set/settings.h"
#include "core/hle/service/set/settings_server.h"
#include "core/hle/service/set/system_settings_server.h"
namespace Service::Set {
void LoopProcess(Core::System& system) {
auto server_manager = std::make_unique<ServerManager>(system);
server_manager->RegisterNamedService("set", std::make_shared<ISettingsServer>(system));
server_manager->RegisterNamedService("set:cal",
std::make_shared<IFactorySettingsServer>(system));
server_manager->RegisterNamedService("set:fd",
std::make_shared<IFirmwareDebugSettingsServer>(system));
server_manager->RegisterNamedService("set:sys",
std::make_shared<ISystemSettingsServer>(system));
server_manager->RegisterNamedService("set", std::make_shared<SET>(system));
server_manager->RegisterNamedService("set:cal", std::make_shared<SET_CAL>(system));
server_manager->RegisterNamedService("set:fd", std::make_shared<SET_FD>(system));
server_manager->RegisterNamedService("set:sys", std::make_shared<SET_SYS>(system));
ServerManager::RunServer(std::move(server_manager));
}

View File

@@ -28,7 +28,7 @@ SystemSettings DefaultSystemSettings() {
.cmu_mode = CmuMode::None,
.tv_underscan = {},
.tv_gama = 1.0f,
.contrast_ratio = 0.5f,
.constrast_ratio = 0.5f,
};
settings.initial_launch_settings_packed = {

View File

@@ -208,7 +208,7 @@ struct TvSettings {
CmuMode cmu_mode;
u32 tv_underscan;
f32 tv_gama;
f32 contrast_ratio;
f32 constrast_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_permission;
ErrorReportSharePermission error_report_share_permssion;
std::array<u8, 0x3C> reserved_09974;

View File

@@ -71,7 +71,18 @@ size_t Display::GetNumLayers() const {
return std::ranges::count_if(layers, [](auto& l) { return l->IsOpen(); });
}
Kernel::KReadableEvent* Display::GetVSyncEvent() {
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() {
return &vsync_event->GetReadableEvent();
}

View File

@@ -74,8 +74,16 @@ 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* GetVSyncEvent();
Kernel::KReadableEvent* GetVSyncEventUnchecked();
/// Signals the internal vsync event.
void SignalVSyncEvent();
@@ -96,6 +104,7 @@ 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.
@@ -124,6 +133,7 @@ private:
std::vector<std::unique_ptr<Layer>> layers;
Kernel::KEvent* vsync_event{};
bool got_vsync_event{false};
};
} // namespace Service::VI

View File

@@ -343,8 +343,8 @@ private:
class IManagerDisplayService final : public ServiceFramework<IManagerDisplayService> {
public:
explicit IManagerDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_)
: ServiceFramework{system_, "IManagerDisplayService"}, nvnflinger{nvnflinger_} {
explicit IManagerDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nv_flinger_)
: ServiceFramework{system_, "IManagerDisplayService"}, nv_flinger{nv_flinger_} {
// 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 = nvnflinger.CloseDisplay(display) ? ResultSuccess : ResultUnknown;
const Result rc = nv_flinger.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 = nvnflinger.CreateLayer(display);
const auto layer_id = nv_flinger.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& nvnflinger;
Nvnflinger::Nvnflinger& nv_flinger;
};
class IApplicationDisplayService final : public ServiceFramework<IApplicationDisplayService> {
public:
IApplicationDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_,
IApplicationDisplayService(Core::System& system_, Nvnflinger::Nvnflinger& nv_flinger_,
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server_)
: ServiceFramework{system_, "IApplicationDisplayService"}, nvnflinger{nvnflinger_},
: ServiceFramework{system_, "IApplicationDisplayService"}, nv_flinger{nv_flinger_},
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, nvnflinger);
rb.PushIpcInterface<ISystemDisplayService>(system, nv_flinger);
}
void GetManagerDisplayService(HLERequestContext& ctx) {
@@ -572,7 +572,7 @@ private:
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IManagerDisplayService>(system, nvnflinger);
rb.PushIpcInterface<IManagerDisplayService>(system, nv_flinger);
}
void GetIndirectDisplayTransactionService(HLERequestContext& ctx) {
@@ -607,7 +607,7 @@ private:
ASSERT_MSG(name == "Default", "Non-default displays aren't supported yet");
const auto display_id = nvnflinger.OpenDisplay(name);
const auto display_id = nv_flinger.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 = nvnflinger.CloseDisplay(display_id) ? ResultSuccess : ResultUnknown;
const Result rc = nv_flinger.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 = nvnflinger.OpenDisplay(display_name);
const auto display_id = nv_flinger.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 = nvnflinger.FindBufferQueueId(*display_id, layer_id);
const auto buffer_queue_id = nv_flinger.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;
}
nvnflinger.OpenLayer(layer_id);
nv_flinger.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);
nvnflinger.CloseLayer(layer_id);
nv_flinger.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 = nvnflinger.CreateLayer(display_id);
const auto layer_id = nv_flinger.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 = nvnflinger.FindBufferQueueId(display_id, *layer_id);
const auto buffer_queue_id = nv_flinger.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);
nvnflinger.DestroyLayer(layer_id);
nv_flinger.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 = nvnflinger.FindVsyncEvent(&vsync_event, display_id);
const auto result = nv_flinger.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,12 +808,6 @@ 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);
@@ -905,9 +899,8 @@ private:
}
}
Nvnflinger::Nvnflinger& nvnflinger;
Nvnflinger::Nvnflinger& nv_flinger;
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server;
bool vsync_event_fetched{false};
};
static bool IsValidServiceAccess(Permission permission, Policy policy) {
@@ -923,7 +916,7 @@ static bool IsValidServiceAccess(Permission permission, Policy policy) {
}
void detail::GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
Nvnflinger::Nvnflinger& nvnflinger,
Nvnflinger::Nvnflinger& nv_flinger,
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server,
Permission permission) {
IPC::RequestParser rp{ctx};
@@ -938,19 +931,19 @@ void detail::GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
rb.Push(ResultSuccess);
rb.PushIpcInterface<IApplicationDisplayService>(system, nvnflinger, hos_binder_driver_server);
rb.PushIpcInterface<IApplicationDisplayService>(system, nv_flinger, hos_binder_driver_server);
}
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nvnflinger,
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nv_flinger,
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, nvnflinger, hos_binder_driver_server));
"vi:m", std::make_shared<VI_M>(system, nv_flinger, hos_binder_driver_server));
server_manager->RegisterNamedService(
"vi:s", std::make_shared<VI_S>(system, nvnflinger, hos_binder_driver_server));
"vi:s", std::make_shared<VI_S>(system, nv_flinger, hos_binder_driver_server));
server_manager->RegisterNamedService(
"vi:u", std::make_shared<VI_U>(system, nvnflinger, hos_binder_driver_server));
"vi:u", std::make_shared<VI_U>(system, nv_flinger, hos_binder_driver_server));
ServerManager::RunServer(std::move(server_manager));
}

View File

@@ -48,7 +48,7 @@ void GetDisplayServiceImpl(HLERequestContext& ctx, Core::System& system,
Permission permission);
} // namespace detail
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nvnflinger,
void LoopProcess(Core::System& system, Nvnflinger::Nvnflinger& nv_flinger,
Nvnflinger::HosBinderDriverServer& hos_binder_driver_server);
} // namespace Service::VI

View File

@@ -130,7 +130,6 @@ void AppletResource::FreeAppletResourceId(u64 aruid) {
if (aruid_data.flag.is_assigned) {
aruid_data.shared_memory_format = nullptr;
aruid_data.flag.is_assigned.Assign(false);
shared_memory_holder[index].Finalize();
}
}

View File

@@ -1344,49 +1344,4 @@ AppletDetailedUiType NPad::GetAppletDetailedUiType(Core::HID::NpadIdType npad_id
};
}
Result NPad::SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
Core::HID::NpadButton button_assignment) {
std::scoped_lock lock{mutex};
return npad_resource.SetNpadCaptureButtonAssignment(aruid, npad_style_set, button_assignment);
}
Result NPad::ClearNpadCaptureButtonAssignment(u64 aruid) {
std::scoped_lock lock{mutex};
return npad_resource.ClearNpadCaptureButtonAssignment(aruid);
}
std::size_t NPad::GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
u64 aruid) const {
std::scoped_lock lock{mutex};
return npad_resource.GetNpadCaptureButtonAssignment(out_list, aruid);
}
Result NPad::SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled) {
std::scoped_lock lock{mutex};
const auto result = npad_resource.SetNpadSystemExtStateEnabled(aruid, is_enabled);
if (result.IsSuccess()) {
std::scoped_lock shared_lock{*applet_resource_holder.shared_mutex};
// TODO: abstracted_pad->EnableAppletToGetInput(aruid);
}
return result;
}
Result NPad::AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled) {
std::scoped_lock lock{mutex};
bool is_currently_enabled{};
Result result = npad_resource.IsAssigningSingleOnSlSrPressEnabled(is_currently_enabled, aruid);
if (result.IsSuccess() && is_enabled != is_currently_enabled) {
result = npad_resource.SetAssigningSingleOnSlSrPress(aruid, is_enabled);
}
return result;
}
Result NPad::GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const {
std::scoped_lock lock{mutex};
out_npad_id = hid_core.GetLastActiveController();
return ResultSuccess;
}
} // namespace Service::HID

View File

@@ -149,18 +149,6 @@ public:
AppletDetailedUiType GetAppletDetailedUiType(Core::HID::NpadIdType npad_id);
Result SetNpadCaptureButtonAssignment(u64 aruid, Core::HID::NpadStyleSet npad_style_set,
Core::HID::NpadButton button_assignment);
Result ClearNpadCaptureButtonAssignment(u64 aruid);
std::size_t GetNpadCaptureButtonAssignment(std::span<Core::HID::NpadButton> out_list,
u64 aruid) const;
Result SetNpadSystemExtStateEnabled(u64 aruid, bool is_enabled);
Result AssigningSingleOnSlSrPress(u64 aruid, bool is_enabled);
Result GetLastActiveNpad(Core::HID::NpadIdType& out_npad_id) const;
private:
struct VibrationData {
bool device_mounted{};

View File

@@ -59,8 +59,8 @@ public:
return start_address;
}
[[nodiscard]] bool IsProprietaryDriver() const noexcept {
return is_proprietary_driver;
[[nodiscard]] bool IsPropietaryDriver() const noexcept {
return is_propietary_driver;
}
protected:
@@ -68,7 +68,7 @@ protected:
std::array<u32, 8> gp_passthrough_mask{};
Stage stage{};
u32 start_address{};
bool is_proprietary_driver{};
bool is_propietary_driver{};
};
} // namespace Shader

View File

@@ -1084,7 +1084,7 @@ void ConstantPropagation(Environment& env, IR::Block& block, IR::Inst& inst) {
if (env.HasHLEMacroState()) {
FoldConstBuffer(env, block, inst);
}
if (env.IsProprietaryDriver()) {
if (env.IsPropietaryDriver()) {
FoldDriverConstBuffer(env, block, inst, 1);
}
break;

View File

@@ -267,10 +267,10 @@ private:
top_tier[page_index] = GetNewManager(base_cpu_addr);
}
Manager* GetNewManager(VAddr base_cpu_address) {
Manager* GetNewManager(VAddr base_cpu_addess) {
const auto on_return = [&] {
auto* new_manager = free_managers.front();
new_manager->SetCpuAddress(base_cpu_address);
new_manager->SetCpuAddress(base_cpu_addess);
free_managers.pop_front();
return new_manager;
};

View File

@@ -85,12 +85,12 @@ protected:
std::deque<size_t> free_channel_ids;
std::unordered_map<s32, size_t> channel_map;
std::vector<size_t> active_channel_ids;
struct AddressSpaceRef {
struct AddresSpaceRef {
size_t ref_count;
size_t storage_id;
Tegra::MemoryManager* gpu_memory;
};
std::unordered_map<size_t, AddressSpaceRef> address_spaces;
std::unordered_map<size_t, AddresSpaceRef> address_spaces;
mutable std::mutex config_mutex;
virtual void OnGPUASRegister([[maybe_unused]] size_t map_id) {}

View File

@@ -38,7 +38,7 @@ void ChannelSetupCaches<P>::CreateChannel(struct Tegra::Control::ChannelState& c
as_it->second.ref_count++;
return;
}
AddressSpaceRef new_gpu_mem_ref{
AddresSpaceRef new_gpu_mem_ref{
.ref_count = 1,
.storage_id = address_spaces.size(),
.gpu_memory = channel.memory_manager.get(),

View File

@@ -958,7 +958,7 @@ public:
enum class ClearReport : u32 {
ZPassPixelCount = 0x01,
ZCullStats = 0x02,
StreamingPrimitivesNeededMinusSucceeded = 0x03,
StreamingPrimitvesNeededMinusSucceeded = 0x03,
AlphaBetaClocks = 0x04,
StreamingPrimitivesSucceeded = 0x10,
StreamingPrimitivesNeeded = 0x11,
@@ -2383,8 +2383,8 @@ public:
};
enum class Release : u32 {
AfterAllPrecedingReads = 0,
AfterAllPrecedingWrites = 1,
AfterAllPreceedingReads = 0,
AfterAllPreceedingWrites = 1,
};
enum class Acquire : u32 {
@@ -2869,7 +2869,7 @@ public:
u32 global_base_instance_index; ///< 0x1438
INSERT_PADDING_BYTES_NOINIT(0x14);
RegisterWatermarks ps_warp_watermarks; ///< 0x1450
RegisterWatermarks ps_register_watermarks; ///< 0x1454
RegisterWatermarks ps_regster_watermarks; ///< 0x1454
INSERT_PADDING_BYTES_NOINIT(0xC);
u32 store_zcull; ///< 0x1464
INSERT_PADDING_BYTES_NOINIT(0x18);
@@ -3444,7 +3444,7 @@ ASSERT_REG_POSITION(invalidate_texture_header_cache_no_wfi, 0x1428);
ASSERT_REG_POSITION(global_base_vertex_index, 0x1434);
ASSERT_REG_POSITION(global_base_instance_index, 0x1438);
ASSERT_REG_POSITION(ps_warp_watermarks, 0x1450);
ASSERT_REG_POSITION(ps_register_watermarks, 0x1454);
ASSERT_REG_POSITION(ps_regster_watermarks, 0x1454);
ASSERT_REG_POSITION(store_zcull, 0x1464);
ASSERT_REG_POSITION(iterated_blend_constants, 0x1480);
ASSERT_REG_POSITION(load_zcull, 0x1500);

View File

@@ -172,12 +172,12 @@ bool SoftwareBlitEngine::Blit(Fermi2D::Surface& src, Fermi2D::Surface& dst,
const bool no_passthrough =
src.format != dst.format || src_extent_x != dst_extent_x || src_extent_y != dst_extent_y;
const auto conversion_phase_same_format = [&]() {
const auto convertion_phase_same_format = [&]() {
NearestNeighbor(impl->src_buffer, impl->dst_buffer, src_extent_x, src_extent_y,
dst_extent_x, dst_extent_y, dst_bytes_per_pixel);
};
const auto conversion_phase_ir = [&]() {
const auto convertion_phase_ir = [&]() {
auto* input_converter = impl->converter_factory.GetFormatConverter(src.format);
impl->intermediate_src.resize_destructive((src_copy_size / src_bytes_per_pixel) *
ir_components);
@@ -212,9 +212,9 @@ bool SoftwareBlitEngine::Blit(Fermi2D::Surface& src, Fermi2D::Surface& dst,
// Conversion Phase
if (no_passthrough) {
if (src.format != dst.format || config.filter == Fermi2D::Filter::Bilinear) {
conversion_phase_ir();
convertion_phase_ir();
} else {
conversion_phase_same_format();
convertion_phase_same_format();
}
} else {
impl->dst_buffer.swap(impl->src_buffer);

View File

@@ -42,7 +42,7 @@ private:
u8 raw;
BitField<0, 2, u8> tile_format;
BitField<2, 3, u8> gob_height;
BitField<5, 3, u8> reserved_surface_format;
BitField<5, 3, u8> reserverd_surface_format;
};
u8 error_conceal_on; // 1: error conceal on; 0: off
u32 first_part_size; // the size of first partition(frame header and mb header partition)

View File

@@ -803,7 +803,7 @@ void UnquantizeTexelWeights(uvec2 size, bool is_dual_plane) {
}
}
uint GetUnquantizedTexelWeight(uint offset_base, uint plane, bool is_dual_plane) {
uint GetUnquantizedTexelWieght(uint offset_base, uint plane, bool is_dual_plane) {
const uint offset = is_dual_plane ? 2 * offset_base + plane : offset_base;
return result_vector[offset];
}
@@ -833,23 +833,23 @@ uvec4 GetUnquantizedWeightVector(uint t, uint s, uvec2 size, uint plane_index, b
if (v0 < area) {
const uint offset_base = v0;
p0.x = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
p1.x = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
p0.x = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
p1.x = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
}
if ((v0 + 1) < (area)) {
const uint offset_base = v0 + 1;
p0.y = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
p1.y = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
p0.y = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
p1.y = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
}
if ((v0 + size.x) < (area)) {
const uint offset_base = v0 + size.x;
p0.z = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
p1.z = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
p0.z = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
p1.z = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
}
if ((v0 + size.x + 1) < (area)) {
const uint offset_base = v0 + size.x + 1;
p0.w = GetUnquantizedTexelWeight(offset_base, 0, is_dual_plane);
p1.w = GetUnquantizedTexelWeight(offset_base, 1, is_dual_plane);
p0.w = GetUnquantizedTexelWieght(offset_base, 0, is_dual_plane);
p1.w = GetUnquantizedTexelWieght(offset_base, 1, is_dual_plane);
}
const uint primary_weight = (uint(dot(p0, w)) + 8) >> 4;

View File

@@ -270,7 +270,7 @@ void QueryCacheBase<Traits>::CounterReport(GPUVAddr addr, QueryType counter_type
ASSERT(false);
return;
}
query_base->value += streamer->GetAmendValue();
query_base->value += streamer->GetAmmendValue();
streamer->SetAccumulationValue(query_base->value);
if (True(query_base->flags & QueryFlagBits::HasTimestamp)) {
u64 timestamp = impl->gpu.GetTicks();

View File

@@ -78,12 +78,12 @@ public:
return dependence_mask;
}
u64 GetAmendValue() const {
return amend_value;
u64 GetAmmendValue() const {
return ammend_value;
}
void SetAccumulationValue(u64 new_value) {
accumulation_value = new_value;
acumulation_value = new_value;
}
protected:
@@ -95,8 +95,8 @@ protected:
const size_t id;
u64 dependence_mask;
u64 dependent_mask;
u64 amend_value{};
u64 accumulation_value{};
u64 ammend_value{};
u64 acumulation_value{};
};
template <typename QueryType>

View File

@@ -231,10 +231,10 @@ void FixedPipelineState::DynamicState::Refresh(const Maxwell& regs) {
void FixedPipelineState::DynamicState::Refresh2(const Maxwell& regs,
Maxwell::PrimitiveTopology topology_,
bool base_features_supported) {
bool base_feautures_supported) {
logic_op.Assign(PackLogicOp(regs.logic_op.op));
if (base_features_supported) {
if (base_feautures_supported) {
return;
}

View File

@@ -165,7 +165,7 @@ struct FixedPipelineState {
void Refresh(const Maxwell& regs);
void Refresh2(const Maxwell& regs, Maxwell::PrimitiveTopology topology,
bool base_features_supported);
bool base_feautures_supported);
void Refresh3(const Maxwell& regs);
Maxwell::ComparisonOp DepthTestFunc() const noexcept {

View File

@@ -128,7 +128,7 @@ private:
vk::DescriptorPool descriptor_pool;
vk::DescriptorSetLayout descriptor_set_layout;
vk::PipelineLayout pipeline_layout;
vk::Pipeline nearest_neighbor_pipeline;
vk::Pipeline nearest_neightbor_pipeline;
vk::Pipeline bilinear_pipeline;
vk::Pipeline bicubic_pipeline;
vk::Pipeline gaussian_pipeline;

View File

@@ -121,8 +121,8 @@ public:
scheduler{scheduler_}, memory_allocator{memory_allocator_} {
current_bank = nullptr;
current_query = nullptr;
amend_value = 0;
accumulation_value = 0;
ammend_value = 0;
acumulation_value = 0;
queries_prefix_scan_pass = std::make_unique<QueriesPrefixScanPass>(
device, scheduler, descriptor_pool, compute_pass_descriptor_queue);
@@ -177,8 +177,8 @@ public:
}
AbandonCurrentQuery();
std::function<void()> func([this, counts = pending_flush_queries.size()] {
amend_value = 0;
accumulation_value = 0;
ammend_value = 0;
acumulation_value = 0;
});
rasterizer->SyncOperation(std::move(func));
accumulation_since_last_sync = false;
@@ -308,7 +308,7 @@ public:
}
ReplicateCurrentQueryIfNeeded();
std::function<void()> func([this] { amend_value = accumulation_value; });
std::function<void()> func([this] { ammend_value = acumulation_value; });
rasterizer->SyncOperation(std::move(func));
AbandonCurrentQuery();
num_slots_used = 0;
@@ -513,7 +513,7 @@ private:
pending_flush_queries.push_back(index);
std::function<void()> func([this, index] {
auto* query = GetQuery(index);
query->value += GetAmendValue();
query->value += GetAmmendValue();
SetAccumulationValue(query->value);
Free(index);
});
@@ -1173,7 +1173,7 @@ struct QueryCacheRuntimeImpl {
primitives_succeeded_streamer(
static_cast<size_t>(QueryType::StreamingPrimitivesSucceeded), runtime, tfb_streamer,
device_memory_),
primitives_needed_minus_succeeded_streamer(
primitives_needed_minus_suceeded_streamer(
static_cast<size_t>(QueryType::StreamingPrimitivesNeededMinusSucceeded), runtime, 0u),
hcr_setup{}, hcr_is_set{}, is_hcr_running{}, maxwell3d{} {
@@ -1212,7 +1212,7 @@ struct QueryCacheRuntimeImpl {
SamplesStreamer sample_streamer;
TFBCounterStreamer tfb_streamer;
PrimitivesSucceededStreamer primitives_succeeded_streamer;
VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_succeeded_streamer;
VideoCommon::StubStreamer<QueryCacheParams> primitives_needed_minus_suceeded_streamer;
std::vector<std::pair<DAddr, DAddr>> little_cache;
std::vector<std::pair<VkBuffer, VkDeviceSize>> buffers_to_upload_to;
@@ -1437,7 +1437,7 @@ VideoCommon::StreamerInterface* QueryCacheRuntime::GetStreamerInterface(QueryTyp
case QueryType::StreamingPrimitivesSucceeded:
return &impl->primitives_succeeded_streamer;
case QueryType::StreamingPrimitivesNeededMinusSucceeded:
return &impl->primitives_needed_minus_succeeded_streamer;
return &impl->primitives_needed_minus_suceeded_streamer;
default:
return nullptr;
}

View File

@@ -236,14 +236,14 @@ void StagingBufferPool::ReleaseLevel(StagingBuffersCache& cache, size_t log2) {
auto& entries = staging.entries;
const size_t old_size = entries.size();
const auto is_deletable = [this](const StagingBuffer& entry) {
const auto is_deleteable = [this](const StagingBuffer& entry) {
return scheduler.IsFree(entry.tick);
};
const size_t begin_offset = staging.delete_index;
const size_t end_offset = std::min(begin_offset + deletions_per_tick, old_size);
const auto begin = entries.begin() + begin_offset;
const auto end = entries.begin() + end_offset;
entries.erase(std::remove_if(begin, end, is_deletable), end);
entries.erase(std::remove_if(begin, end, is_deleteable), end);
const size_t new_size = entries.size();
staging.delete_index += deletions_per_tick;

View File

@@ -125,7 +125,7 @@ constexpr VkBorderColor ConvertBorderColor(const std::array<float, 4>& color) {
MaxwellToVK::SurfaceFormat(device, FormatType::Optimal, false, info.format);
VkImageCreateFlags flags{};
if (info.type == ImageType::e2D && info.resources.layers >= 6 &&
info.size.width == info.size.height && !device.HasBrokenCubeImageCompatibility()) {
info.size.width == info.size.height && !device.HasBrokenCubeImageCompability()) {
flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
}
if (info.type == ImageType::e3D) {

View File

@@ -322,7 +322,7 @@ GraphicsEnvironment::GraphicsEnvironment(Tegra::Engines::Maxwell3D& maxwell3d_,
ASSERT(local_size <= std::numeric_limits<u32>::max());
local_memory_size = static_cast<u32>(local_size) + sph.common3.shader_local_memory_crs_size;
texture_bound = maxwell3d->regs.bindless_texture_const_buffer_slot;
is_proprietary_driver = texture_bound == 2;
is_propietary_driver = texture_bound == 2;
has_hle_engine_state =
maxwell3d->engine_state == Tegra::Engines::Maxwell3D::EngineHint::OnHLEMacro;
}
@@ -404,7 +404,7 @@ ComputeEnvironment::ComputeEnvironment(Tegra::Engines::KeplerCompute& kepler_com
stage = Shader::Stage::Compute;
local_memory_size = qmd.local_pos_alloc + qmd.local_crs_alloc;
texture_bound = kepler_compute->regs.tex_cb_index;
is_proprietary_driver = texture_bound == 2;
is_propietary_driver = texture_bound == 2;
shared_memory_size = qmd.shared_alloc;
workgroup_size = {qmd.block_dim_x, qmd.block_dim_y, qmd.block_dim_z};
}
@@ -509,7 +509,7 @@ void FileEnvironment::Deserialize(std::ifstream& file) {
file.read(reinterpret_cast<char*>(&gp_passthrough_mask), sizeof(gp_passthrough_mask));
}
}
is_proprietary_driver = texture_bound == 2;
is_propietary_driver = texture_bound == 2;
}
void FileEnvironment::Dump(u64 pipeline_hash, u64 shader_hash) {

View File

@@ -596,7 +596,7 @@ public:
}
/// Returns true when the device does not properly support cube compatibility.
bool HasBrokenCubeImageCompatibility() const {
bool HasBrokenCubeImageCompability() const {
return has_broken_cube_compatibility;
}

View File

@@ -57,7 +57,7 @@ struct Range {
return VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
}
[[nodiscard]] VkMemoryPropertyFlags MemoryUsagePreferredVmaFlags(MemoryUsage usage) {
[[nodiscard]] VkMemoryPropertyFlags MemoryUsagePreferedVmaFlags(MemoryUsage usage) {
return usage != MemoryUsage::DeviceLocal ? VK_MEMORY_PROPERTY_HOST_COHERENT_BIT
: VkMemoryPropertyFlagBits{};
}
@@ -256,7 +256,7 @@ vk::Buffer MemoryAllocator::CreateBuffer(const VkBufferCreateInfo& ci, MemoryUsa
.flags = VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT | MemoryUsageVmaFlags(usage),
.usage = MemoryUsageVma(usage),
.requiredFlags = 0,
.preferredFlags = MemoryUsagePreferredVmaFlags(usage),
.preferredFlags = MemoryUsagePreferedVmaFlags(usage),
.memoryTypeBits = usage == MemoryUsage::Stream ? 0u : valid_memory_types,
.pool = VK_NULL_HANDLE,
.pUserData = nullptr,

View File

@@ -46,7 +46,7 @@
#include "core/hle/service/am/applet_ae.h"
#include "core/hle/service/am/applet_oe.h"
#include "core/hle/service/am/applets/applets.h"
#include "core/hle/service/set/system_settings_server.h"
#include "core/hle/service/set/set_sys.h"
#include "hid_core/frontend/emulated_controller.h"
#include "hid_core/hid_core.h"
#include "yuzu/multiplayer/state.h"