forked from suyu/suyu
Improved Addons Manager
This commit is contained in:
parent
feb3b6ece3
commit
e5a954617b
103 changed files with 1588 additions and 1351 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -14,6 +14,7 @@ dist/english_plurals/generated_en.ts
|
||||||
.idea/
|
.idea/
|
||||||
.vs/
|
.vs/
|
||||||
.vscode/
|
.vscode/
|
||||||
|
.cache/
|
||||||
CMakeLists.txt.user*
|
CMakeLists.txt.user*
|
||||||
|
|
||||||
# *nix related
|
# *nix related
|
||||||
|
|
|
@ -5,6 +5,7 @@ stages:
|
||||||
clang-format:
|
clang-format:
|
||||||
stage: format
|
stage: format
|
||||||
image: suyuemu/cibuild:linux-x64
|
image: suyuemu/cibuild:linux-x64
|
||||||
|
allow_failure: true
|
||||||
variables:
|
variables:
|
||||||
RELEASE_NAME: mainline
|
RELEASE_NAME: mainline
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
namespace AudioCore::AudioIn {
|
namespace AudioCore::AudioIn {
|
||||||
|
|
||||||
In::In(Core::System& system_, Manager& manager_, Kernel::KEvent* event_, size_t session_id_)
|
In::In(Core::System& system_, Manager& manager_, Kernel::KEvent* event_, size_t session_id_)
|
||||||
: manager{manager_}, parent_mutex{manager.mutex}, event{event_}, system{system_, event,
|
: manager{manager_}, parent_mutex{manager.mutex}, event{event_},
|
||||||
session_id_} {}
|
system{system_, event, session_id_} {}
|
||||||
|
|
||||||
void In::Free() {
|
void In::Free() {
|
||||||
std::scoped_lock l{parent_mutex};
|
std::scoped_lock l{parent_mutex};
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
namespace AudioCore::AudioIn {
|
namespace AudioCore::AudioIn {
|
||||||
|
|
||||||
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
|
System::System(Core::System& system_, Kernel::KEvent* event_, const size_t session_id_)
|
||||||
: system{system_}, buffer_event{event_},
|
: system{system_}, buffer_event{event_}, session_id{session_id_},
|
||||||
session_id{session_id_}, session{std::make_unique<DeviceSession>(system_)} {}
|
session{std::make_unique<DeviceSession>(system_)} {}
|
||||||
|
|
||||||
System::~System() {
|
System::~System() {
|
||||||
Finalize();
|
Finalize();
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
namespace AudioCore::AudioOut {
|
namespace AudioCore::AudioOut {
|
||||||
|
|
||||||
Out::Out(Core::System& system_, Manager& manager_, Kernel::KEvent* event_, size_t session_id_)
|
Out::Out(Core::System& system_, Manager& manager_, Kernel::KEvent* event_, size_t session_id_)
|
||||||
: manager{manager_}, parent_mutex{manager.mutex}, event{event_}, system{system_, event,
|
: manager{manager_}, parent_mutex{manager.mutex}, event{event_},
|
||||||
session_id_} {}
|
system{system_, event, session_id_} {}
|
||||||
|
|
||||||
void Out::Free() {
|
void Out::Free() {
|
||||||
std::scoped_lock l{parent_mutex};
|
std::scoped_lock l{parent_mutex};
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
namespace AudioCore::AudioOut {
|
namespace AudioCore::AudioOut {
|
||||||
|
|
||||||
System::System(Core::System& system_, Kernel::KEvent* event_, size_t session_id_)
|
System::System(Core::System& system_, Kernel::KEvent* event_, size_t session_id_)
|
||||||
: system{system_}, buffer_event{event_},
|
: system{system_}, buffer_event{event_}, session_id{session_id_},
|
||||||
session_id{session_id_}, session{std::make_unique<DeviceSession>(system_)} {}
|
session{std::make_unique<DeviceSession>(system_)} {}
|
||||||
|
|
||||||
System::~System() {
|
System::~System() {
|
||||||
Finalize();
|
Finalize();
|
||||||
|
|
|
@ -19,10 +19,9 @@ namespace AudioCore::Renderer {
|
||||||
|
|
||||||
InfoUpdater::InfoUpdater(std::span<const u8> input_, std::span<u8> output_,
|
InfoUpdater::InfoUpdater(std::span<const u8> input_, std::span<u8> output_,
|
||||||
Kernel::KProcess* process_handle_, BehaviorInfo& behaviour_)
|
Kernel::KProcess* process_handle_, BehaviorInfo& behaviour_)
|
||||||
: input{input_.data() + sizeof(UpdateDataHeader)},
|
: input{input_.data() + sizeof(UpdateDataHeader)}, input_origin{input_},
|
||||||
input_origin{input_}, output{output_.data() + sizeof(UpdateDataHeader)},
|
output{output_.data() + sizeof(UpdateDataHeader)}, output_origin{output_},
|
||||||
output_origin{output_}, in_header{reinterpret_cast<const UpdateDataHeader*>(
|
in_header{reinterpret_cast<const UpdateDataHeader*>(input_origin.data())},
|
||||||
input_origin.data())},
|
|
||||||
out_header{reinterpret_cast<UpdateDataHeader*>(output_origin.data())},
|
out_header{reinterpret_cast<UpdateDataHeader*>(output_origin.data())},
|
||||||
expected_input_size{input_.size()}, expected_output_size{output_.size()},
|
expected_input_size{input_.size()}, expected_output_size{output_.size()},
|
||||||
process_handle{process_handle_}, behaviour{behaviour_} {
|
process_handle{process_handle_}, behaviour{behaviour_} {
|
||||||
|
|
|
@ -13,8 +13,8 @@ PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, bool force_map_)
|
||||||
|
|
||||||
PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, std::span<MemoryPoolInfo> pool_infos_,
|
PoolMapper::PoolMapper(Kernel::KProcess* process_handle_, std::span<MemoryPoolInfo> pool_infos_,
|
||||||
u32 pool_count_, bool force_map_)
|
u32 pool_count_, bool force_map_)
|
||||||
: process_handle{process_handle_}, pool_infos{pool_infos_.data()},
|
: process_handle{process_handle_}, pool_infos{pool_infos_.data()}, pool_count{pool_count_},
|
||||||
pool_count{pool_count_}, force_map{force_map_} {}
|
force_map{force_map_} {}
|
||||||
|
|
||||||
void PoolMapper::ClearUseState(std::span<MemoryPoolInfo> pools, const u32 count) {
|
void PoolMapper::ClearUseState(std::span<MemoryPoolInfo> pools, const u32 count) {
|
||||||
for (u32 i = 0; i < count; i++) {
|
for (u32 i = 0; i < count; i++) {
|
||||||
|
|
|
@ -12,8 +12,7 @@
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
template <typename VaType, size_t AddressSpaceBits>
|
template <typename VaType, size_t AddressSpaceBits>
|
||||||
concept AddressSpaceValid = std::is_unsigned_v<VaType> && sizeof(VaType) * 8 >=
|
concept AddressSpaceValid = std::is_unsigned_v<VaType> && sizeof(VaType) * 8 >= AddressSpaceBits;
|
||||||
AddressSpaceBits;
|
|
||||||
|
|
||||||
struct EmptyStruct {};
|
struct EmptyStruct {};
|
||||||
|
|
||||||
|
|
|
@ -16,9 +16,9 @@ concept IsContiguousContainer = std::contiguous_iterator<typename T::iterator>;
|
||||||
// is available on all supported platforms.
|
// is available on all supported platforms.
|
||||||
template <typename Derived, typename Base>
|
template <typename Derived, typename Base>
|
||||||
concept DerivedFrom = requires {
|
concept DerivedFrom = requires {
|
||||||
std::is_base_of_v<Base, Derived>;
|
std::is_base_of_v<Base, Derived>;
|
||||||
std::is_convertible_v<const volatile Derived*, const volatile Base*>;
|
std::is_convertible_v<const volatile Derived*, const volatile Base*>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO: Replace with std::convertible_to when libc++ implements it.
|
// TODO: Replace with std::convertible_to when libc++ implements it.
|
||||||
template <typename From, typename To>
|
template <typename From, typename To>
|
||||||
|
|
|
@ -598,14 +598,14 @@ public:
|
||||||
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
||||||
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
|
std::enable_if_t<!std::is_convertible_v<G&&, E>>* = nullptr>
|
||||||
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
constexpr explicit Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
||||||
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
|
: impl_base{unexpect_t{}, std::move(e.value())},
|
||||||
detail::default_constructor_tag{}} {}
|
ctor_base{detail::default_constructor_tag{}} {}
|
||||||
|
|
||||||
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
template <typename G = E, std::enable_if_t<std::is_constructible_v<E, G&&>>* = nullptr,
|
||||||
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
|
std::enable_if_t<std::is_convertible_v<G&&, E>>* = nullptr>
|
||||||
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
constexpr Expected(Unexpected<G>&& e) noexcept(std::is_nothrow_constructible_v<E, G&&>)
|
||||||
: impl_base{unexpect_t{}, std::move(e.value())}, ctor_base{
|
: impl_base{unexpect_t{}, std::move(e.value())},
|
||||||
detail::default_constructor_tag{}} {}
|
ctor_base{detail::default_constructor_tag{}} {}
|
||||||
|
|
||||||
template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
|
template <typename... Args, std::enable_if_t<std::is_constructible_v<E, Args&&...>>* = nullptr>
|
||||||
constexpr explicit Expected(unexpect_t, Args&&... args)
|
constexpr explicit Expected(unexpect_t, Args&&... args)
|
||||||
|
|
|
@ -238,10 +238,8 @@ public:
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept HasRedBlackKeyType = requires {
|
concept HasRedBlackKeyType = requires {
|
||||||
{
|
{ std::is_same<typename T::RedBlackKeyType, void>::value } -> std::convertible_to<bool>;
|
||||||
std::is_same<typename T::RedBlackKeyType, void>::value
|
};
|
||||||
} -> std::convertible_to<bool>;
|
|
||||||
};
|
|
||||||
|
|
||||||
namespace impl {
|
namespace impl {
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,12 @@ public:
|
||||||
|
|
||||||
MultiLevelPageTable(MultiLevelPageTable&& other) noexcept
|
MultiLevelPageTable(MultiLevelPageTable&& other) noexcept
|
||||||
: address_space_bits{std::exchange(other.address_space_bits, 0)},
|
: address_space_bits{std::exchange(other.address_space_bits, 0)},
|
||||||
first_level_bits{std::exchange(other.first_level_bits, 0)}, page_bits{std::exchange(
|
first_level_bits{std::exchange(other.first_level_bits, 0)},
|
||||||
other.page_bits, 0)},
|
page_bits{std::exchange(other.page_bits, 0)},
|
||||||
first_level_shift{std::exchange(other.first_level_shift, 0)},
|
first_level_shift{std::exchange(other.first_level_shift, 0)},
|
||||||
first_level_chunk_size{std::exchange(other.first_level_chunk_size, 0)},
|
first_level_chunk_size{std::exchange(other.first_level_chunk_size, 0)},
|
||||||
first_level_map{std::move(other.first_level_map)}, base_ptr{std::exchange(other.base_ptr,
|
first_level_map{std::move(other.first_level_map)},
|
||||||
nullptr)} {}
|
base_ptr{std::exchange(other.base_ptr, nullptr)} {}
|
||||||
|
|
||||||
MultiLevelPageTable& operator=(MultiLevelPageTable&& other) noexcept {
|
MultiLevelPageTable& operator=(MultiLevelPageTable&& other) noexcept {
|
||||||
address_space_bits = std::exchange(other.address_space_bits, 0);
|
address_space_bits = std::exchange(other.address_space_bits, 0);
|
||||||
|
|
|
@ -18,9 +18,9 @@ namespace ranges {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept range = requires(T& t) {
|
concept range = requires(T& t) {
|
||||||
begin(t);
|
begin(t);
|
||||||
end(t);
|
end(t);
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept input_range = range<T>;
|
concept input_range = range<T>;
|
||||||
|
|
|
@ -103,9 +103,9 @@ concept IsRBEntry = CheckRBEntry<T>::value;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept HasRBEntry = requires(T& t, const T& ct) {
|
concept HasRBEntry = requires(T& t, const T& ct) {
|
||||||
{ t.GetRBEntry() } -> std::same_as<RBEntry<T>&>;
|
{ t.GetRBEntry() } -> std::same_as<RBEntry<T>&>;
|
||||||
{ ct.GetRBEntry() } -> std::same_as<const RBEntry<T>&>;
|
{ ct.GetRBEntry() } -> std::same_as<const RBEntry<T>&>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
requires HasRBEntry<T>
|
requires HasRBEntry<T>
|
||||||
|
|
|
@ -362,7 +362,9 @@ public:
|
||||||
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
|
// _DEFINE_SWIZZLER2 defines a single such function, DEFINE_SWIZZLER2 defines all of them for all
|
||||||
// component names (x<->r) and permutations (xy<->yx)
|
// component names (x<->r) and permutations (xy<->yx)
|
||||||
#define _DEFINE_SWIZZLER2(a, b, name) \
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
||||||
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
||||||
|
return Vec2<T>(a, b); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
|
#define DEFINE_SWIZZLER2(a, b, a2, b2, a3, b3, a4, b4) \
|
||||||
_DEFINE_SWIZZLER2(a, b, a##b); \
|
_DEFINE_SWIZZLER2(a, b, a##b); \
|
||||||
_DEFINE_SWIZZLER2(a, b, a2##b2); \
|
_DEFINE_SWIZZLER2(a, b, a2##b2); \
|
||||||
|
@ -555,7 +557,9 @@ public:
|
||||||
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
|
// DEFINE_SWIZZLER2_COMP2 defines two component functions for all component names (x<->r) and
|
||||||
// permutations (xy<->yx)
|
// permutations (xy<->yx)
|
||||||
#define _DEFINE_SWIZZLER2(a, b, name) \
|
#define _DEFINE_SWIZZLER2(a, b, name) \
|
||||||
[[nodiscard]] constexpr Vec2<T> name() const { return Vec2<T>(a, b); }
|
[[nodiscard]] constexpr Vec2<T> name() const { \
|
||||||
|
return Vec2<T>(a, b); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
|
#define DEFINE_SWIZZLER2_COMP1(a, a2) \
|
||||||
_DEFINE_SWIZZLER2(a, a, a##a); \
|
_DEFINE_SWIZZLER2(a, a, a##a); \
|
||||||
_DEFINE_SWIZZLER2(a, a, a2##a2)
|
_DEFINE_SWIZZLER2(a, a, a2##a2)
|
||||||
|
@ -580,7 +584,9 @@ public:
|
||||||
#undef _DEFINE_SWIZZLER2
|
#undef _DEFINE_SWIZZLER2
|
||||||
|
|
||||||
#define _DEFINE_SWIZZLER3(a, b, c, name) \
|
#define _DEFINE_SWIZZLER3(a, b, c, name) \
|
||||||
[[nodiscard]] constexpr Vec3<T> name() const { return Vec3<T>(a, b, c); }
|
[[nodiscard]] constexpr Vec3<T> name() const { \
|
||||||
|
return Vec3<T>(a, b, c); \
|
||||||
|
}
|
||||||
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
|
#define DEFINE_SWIZZLER3_COMP1(a, a2) \
|
||||||
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
|
_DEFINE_SWIZZLER3(a, a, a, a##a##a); \
|
||||||
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
|
_DEFINE_SWIZZLER3(a, a, a, a2##a2##a2)
|
||||||
|
|
|
@ -33,8 +33,8 @@ public:
|
||||||
VirtualBuffer& operator=(const VirtualBuffer&) = delete;
|
VirtualBuffer& operator=(const VirtualBuffer&) = delete;
|
||||||
|
|
||||||
VirtualBuffer(VirtualBuffer&& other) noexcept
|
VirtualBuffer(VirtualBuffer&& other) noexcept
|
||||||
: alloc_size{std::exchange(other.alloc_size, 0)}, base_ptr{std::exchange(other.base_ptr),
|
: alloc_size{std::exchange(other.alloc_size, 0)},
|
||||||
nullptr} {}
|
base_ptr{std::exchange(other.base_ptr), nullptr} {}
|
||||||
|
|
||||||
VirtualBuffer& operator=(VirtualBuffer&& other) noexcept {
|
VirtualBuffer& operator=(VirtualBuffer&& other) noexcept {
|
||||||
alloc_size = std::exchange(other.alloc_size, 0);
|
alloc_size = std::exchange(other.alloc_size, 0);
|
||||||
|
|
|
@ -8,8 +8,8 @@
|
||||||
namespace Common::X64 {
|
namespace Common::X64 {
|
||||||
|
|
||||||
NativeClock::NativeClock(u64 rdtsc_frequency_)
|
NativeClock::NativeClock(u64 rdtsc_frequency_)
|
||||||
: rdtsc_frequency{rdtsc_frequency_}, ns_rdtsc_factor{GetFixedPoint64Factor(NsRatio::den,
|
: rdtsc_frequency{rdtsc_frequency_},
|
||||||
rdtsc_frequency)},
|
ns_rdtsc_factor{GetFixedPoint64Factor(NsRatio::den, rdtsc_frequency)},
|
||||||
us_rdtsc_factor{GetFixedPoint64Factor(UsRatio::den, rdtsc_frequency)},
|
us_rdtsc_factor{GetFixedPoint64Factor(UsRatio::den, rdtsc_frequency)},
|
||||||
ms_rdtsc_factor{GetFixedPoint64Factor(MsRatio::den, rdtsc_frequency)},
|
ms_rdtsc_factor{GetFixedPoint64Factor(MsRatio::den, rdtsc_frequency)},
|
||||||
cntpct_rdtsc_factor{GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency)},
|
cntpct_rdtsc_factor{GetFixedPoint64Factor(CNTFRQ, rdtsc_frequency)},
|
||||||
|
|
|
@ -16,8 +16,8 @@ using namespace Common::Literals;
|
||||||
class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks {
|
class DynarmicCallbacks32 : public Dynarmic::A32::UserCallbacks {
|
||||||
public:
|
public:
|
||||||
explicit DynarmicCallbacks32(ArmDynarmic32& parent, Kernel::KProcess* process)
|
explicit DynarmicCallbacks32(ArmDynarmic32& parent, Kernel::KProcess* process)
|
||||||
: m_parent{parent}, m_memory(process->GetMemory()),
|
: m_parent{parent}, m_memory(process->GetMemory()), m_process(process),
|
||||||
m_process(process), m_debugger_enabled{parent.m_system.DebuggerEnabled()},
|
m_debugger_enabled{parent.m_system.DebuggerEnabled()},
|
||||||
m_check_memory_access{m_debugger_enabled ||
|
m_check_memory_access{m_debugger_enabled ||
|
||||||
!Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {}
|
!Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@ using namespace Common::Literals;
|
||||||
class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks {
|
class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks {
|
||||||
public:
|
public:
|
||||||
explicit DynarmicCallbacks64(ArmDynarmic64& parent, Kernel::KProcess* process)
|
explicit DynarmicCallbacks64(ArmDynarmic64& parent, Kernel::KProcess* process)
|
||||||
: m_parent{parent}, m_memory(process->GetMemory()),
|
: m_parent{parent}, m_memory(process->GetMemory()), m_process(process),
|
||||||
m_process(process), m_debugger_enabled{parent.m_system.DebuggerEnabled()},
|
m_debugger_enabled{parent.m_system.DebuggerEnabled()},
|
||||||
m_check_memory_access{m_debugger_enabled ||
|
m_check_memory_access{m_debugger_enabled ||
|
||||||
!Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {}
|
!Settings::values.cpuopt_ignore_memory_aborts.GetValue()} {}
|
||||||
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ constexpr std::array partition_names{
|
||||||
|
|
||||||
XCI::XCI(VirtualFile file_, u64 program_id, size_t program_index)
|
XCI::XCI(VirtualFile file_, u64 program_id, size_t program_index)
|
||||||
: file(std::move(file_)), program_nca_status{Loader::ResultStatus::ErrorXCIMissingProgramNCA},
|
: file(std::move(file_)), program_nca_status{Loader::ResultStatus::ErrorXCIMissingProgramNCA},
|
||||||
partitions(partition_names.size()),
|
partitions(partition_names.size()), partitions_raw(partition_names.size()),
|
||||||
partitions_raw(partition_names.size()), keys{Core::Crypto::KeyManager::Instance()} {
|
keys{Core::Crypto::KeyManager::Instance()} {
|
||||||
const auto header_status = TryReadHeader();
|
const auto header_status = TryReadHeader();
|
||||||
if (header_status != Loader::ResultStatus::Success) {
|
if (header_status != Loader::ResultStatus::Success) {
|
||||||
status = header_status;
|
status = header_status;
|
||||||
|
|
|
@ -91,8 +91,12 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
#define DECLARE_PATH_FLAG_HANDLER(__WHICH__) \
|
#define DECLARE_PATH_FLAG_HANDLER(__WHICH__) \
|
||||||
constexpr bool Is##__WHICH__##Allowed() const { return (m_value & __WHICH__##Flag) != 0; } \
|
constexpr bool Is##__WHICH__##Allowed() const { \
|
||||||
constexpr void Allow##__WHICH__() { m_value |= __WHICH__##Flag; }
|
return (m_value & __WHICH__##Flag) != 0; \
|
||||||
|
} \
|
||||||
|
constexpr void Allow##__WHICH__() { \
|
||||||
|
m_value |= __WHICH__##Flag; \
|
||||||
|
}
|
||||||
|
|
||||||
DECLARE_PATH_FLAG_HANDLER(WindowsPath)
|
DECLARE_PATH_FLAG_HANDLER(WindowsPath)
|
||||||
DECLARE_PATH_FLAG_HANDLER(RelativePath)
|
DECLARE_PATH_FLAG_HANDLER(RelativePath)
|
||||||
|
|
|
@ -486,6 +486,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
.name = "Update",
|
.name = "Update",
|
||||||
.version = "",
|
.version = "",
|
||||||
.type = PatchType::Update,
|
.type = PatchType::Update,
|
||||||
|
.file_path = std::nullopt,
|
||||||
|
.root_path = std::nullopt,
|
||||||
.program_id = title_id,
|
.program_id = title_id,
|
||||||
.title_id = title_id};
|
.title_id = title_id};
|
||||||
|
|
||||||
|
@ -514,6 +516,9 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
std::string types;
|
std::string types;
|
||||||
|
|
||||||
const auto exefs_dir = FindSubdirectoryCaseless(mod, "exefs");
|
const auto exefs_dir = FindSubdirectoryCaseless(mod, "exefs");
|
||||||
|
std::optional<std::string> file_path = std::nullopt;
|
||||||
|
std::optional<std::string> root_path = std::nullopt;
|
||||||
|
|
||||||
if (IsDirValidAndNonEmpty(exefs_dir)) {
|
if (IsDirValidAndNonEmpty(exefs_dir)) {
|
||||||
bool ips = false;
|
bool ips = false;
|
||||||
bool ipswitch = false;
|
bool ipswitch = false;
|
||||||
|
@ -523,6 +528,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
if (file->GetExtension() == "ips") {
|
if (file->GetExtension() == "ips") {
|
||||||
ips = true;
|
ips = true;
|
||||||
} else if (file->GetExtension() == "pchtxt") {
|
} else if (file->GetExtension() == "pchtxt") {
|
||||||
|
file_path = file->GetFullPath();
|
||||||
|
root_path = exefs_dir->GetParentDirectory()->GetFullPath();
|
||||||
ipswitch = true;
|
ipswitch = true;
|
||||||
} else if (std::find(EXEFS_FILE_NAMES.begin(), EXEFS_FILE_NAMES.end(),
|
} else if (std::find(EXEFS_FILE_NAMES.begin(), EXEFS_FILE_NAMES.end(),
|
||||||
file->GetName()) != EXEFS_FILE_NAMES.end()) {
|
file->GetName()) != EXEFS_FILE_NAMES.end()) {
|
||||||
|
@ -551,6 +558,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
.name = mod->GetName(),
|
.name = mod->GetName(),
|
||||||
.version = types,
|
.version = types,
|
||||||
.type = PatchType::Mod,
|
.type = PatchType::Mod,
|
||||||
|
.file_path = file_path,
|
||||||
|
.root_path = root_path,
|
||||||
.program_id = title_id,
|
.program_id = title_id,
|
||||||
.title_id = title_id});
|
.title_id = title_id});
|
||||||
}
|
}
|
||||||
|
@ -574,6 +583,7 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
.name = "SDMC",
|
.name = "SDMC",
|
||||||
.version = types,
|
.version = types,
|
||||||
.type = PatchType::Mod,
|
.type = PatchType::Mod,
|
||||||
|
.file_path = std::nullopt,
|
||||||
.program_id = title_id,
|
.program_id = title_id,
|
||||||
.title_id = title_id});
|
.title_id = title_id});
|
||||||
}
|
}
|
||||||
|
@ -606,6 +616,8 @@ std::vector<Patch> PatchManager::GetPatches(VirtualFile update_raw) const {
|
||||||
.name = "DLC",
|
.name = "DLC",
|
||||||
.version = std::move(list),
|
.version = std::move(list),
|
||||||
.type = PatchType::DLC,
|
.type = PatchType::DLC,
|
||||||
|
.file_path = std::nullopt,
|
||||||
|
.root_path = std::nullopt,
|
||||||
.program_id = title_id,
|
.program_id = title_id,
|
||||||
.title_id = dlc_match.back().title_id});
|
.title_id = dlc_match.back().title_id});
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@ struct Patch {
|
||||||
std::string name;
|
std::string name;
|
||||||
std::string version;
|
std::string version;
|
||||||
PatchType type;
|
PatchType type;
|
||||||
|
std::optional<std::string> file_path;
|
||||||
|
std::optional<std::string> root_path;
|
||||||
u64 program_id;
|
u64 program_id;
|
||||||
u64 title_id;
|
u64 title_id;
|
||||||
};
|
};
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
namespace FileSys {
|
namespace FileSys {
|
||||||
|
|
||||||
NSP::NSP(VirtualFile file_, u64 title_id_, std::size_t program_index_)
|
NSP::NSP(VirtualFile file_, u64 title_id_, std::size_t program_index_)
|
||||||
: file(std::move(file_)), expected_program_id(title_id_),
|
: file(std::move(file_)), expected_program_id(title_id_), program_index(program_index_),
|
||||||
program_index(program_index_), status{Loader::ResultStatus::Success},
|
status{Loader::ResultStatus::Success}, pfs(std::make_shared<PartitionFilesystem>(file)),
|
||||||
pfs(std::make_shared<PartitionFilesystem>(file)), keys{Core::Crypto::KeyManager::Instance()} {
|
keys{Core::Crypto::KeyManager::Instance()} {
|
||||||
if (pfs->GetStatus() != Loader::ResultStatus::Success) {
|
if (pfs->GetStatus() != Loader::ResultStatus::Success) {
|
||||||
status = pfs->GetStatus();
|
status = pfs->GetStatus();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -44,8 +44,8 @@ static bool CalculateHMAC256(Destination* out, const SourceKey* key, std::size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
NAX::NAX(VirtualFile file_)
|
NAX::NAX(VirtualFile file_)
|
||||||
: header(std::make_unique<NAXHeader>()),
|
: header(std::make_unique<NAXHeader>()), file(std::move(file_)),
|
||||||
file(std::move(file_)), keys{Core::Crypto::KeyManager::Instance()} {
|
keys{Core::Crypto::KeyManager::Instance()} {
|
||||||
std::string path = Common::FS::SanitizePath(file->GetFullPath());
|
std::string path = Common::FS::SanitizePath(file->GetFullPath());
|
||||||
static const std::regex nax_path_regex("/registered/(000000[0-9A-F]{2})/([0-9A-F]{32})\\.nca",
|
static const std::regex nax_path_regex("/registered/(000000[0-9A-F]{2})/([0-9A-F]{32})\\.nca",
|
||||||
std::regex_constants::ECMAScript |
|
std::regex_constants::ECMAScript |
|
||||||
|
@ -62,8 +62,8 @@ NAX::NAX(VirtualFile file_)
|
||||||
}
|
}
|
||||||
|
|
||||||
NAX::NAX(VirtualFile file_, std::array<u8, 0x10> nca_id)
|
NAX::NAX(VirtualFile file_, std::array<u8, 0x10> nca_id)
|
||||||
: header(std::make_unique<NAXHeader>()),
|
: header(std::make_unique<NAXHeader>()), file(std::move(file_)),
|
||||||
file(std::move(file_)), keys{Core::Crypto::KeyManager::Instance()} {
|
keys{Core::Crypto::KeyManager::Instance()} {
|
||||||
Core::Crypto::SHA256Hash hash{};
|
Core::Crypto::SHA256Hash hash{};
|
||||||
mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0);
|
mbedtls_sha256_ret(nca_id.data(), nca_id.size(), hash.data(), 0);
|
||||||
status = Parse(fmt::format("/registered/000000{:02X}/{}.nca", hash[0],
|
status = Parse(fmt::format("/registered/000000{:02X}/{}.nca", hash[0],
|
||||||
|
|
|
@ -24,7 +24,9 @@ private:
|
||||||
friend class ::Kernel::KClassTokenGenerator; \
|
friend class ::Kernel::KClassTokenGenerator; \
|
||||||
static constexpr inline auto ObjectType = ::Kernel::KClassTokenGenerator::ObjectType::CLASS; \
|
static constexpr inline auto ObjectType = ::Kernel::KClassTokenGenerator::ObjectType::CLASS; \
|
||||||
static constexpr inline const char* const TypeName = #CLASS; \
|
static constexpr inline const char* const TypeName = #CLASS; \
|
||||||
static constexpr inline ClassTokenType ClassToken() { return ::Kernel::ClassToken<CLASS>; } \
|
static constexpr inline ClassTokenType ClassToken() { \
|
||||||
|
return ::Kernel::ClassToken<CLASS>; \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
SUYU_NON_COPYABLE(CLASS); \
|
SUYU_NON_COPYABLE(CLASS); \
|
||||||
|
@ -35,9 +37,15 @@ public:
|
||||||
constexpr ClassTokenType Token = ClassToken(); \
|
constexpr ClassTokenType Token = ClassToken(); \
|
||||||
return TypeObj(TypeName, Token); \
|
return TypeObj(TypeName, Token); \
|
||||||
} \
|
} \
|
||||||
static constexpr const char* GetStaticTypeName() { return TypeName; } \
|
static constexpr const char* GetStaticTypeName() { \
|
||||||
virtual TypeObj GetTypeObj() ATTRIBUTE { return GetStaticTypeObj(); } \
|
return TypeName; \
|
||||||
virtual const char* GetTypeName() ATTRIBUTE { return GetStaticTypeName(); } \
|
} \
|
||||||
|
virtual TypeObj GetTypeObj() ATTRIBUTE { \
|
||||||
|
return GetStaticTypeObj(); \
|
||||||
|
} \
|
||||||
|
virtual const char* GetTypeName() ATTRIBUTE { \
|
||||||
|
return GetStaticTypeName(); \
|
||||||
|
} \
|
||||||
\
|
\
|
||||||
private: \
|
private: \
|
||||||
constexpr bool operator!=(const TypeObj& rhs)
|
constexpr bool operator!=(const TypeObj& rhs)
|
||||||
|
|
|
@ -128,8 +128,8 @@ KVirtualAddress KMemoryRegionTree::GetRandomAlignedRegion(size_t size, size_t al
|
||||||
|
|
||||||
KMemoryLayout::KMemoryLayout()
|
KMemoryLayout::KMemoryLayout()
|
||||||
: m_virtual_tree{m_memory_region_allocator}, m_physical_tree{m_memory_region_allocator},
|
: m_virtual_tree{m_memory_region_allocator}, m_physical_tree{m_memory_region_allocator},
|
||||||
m_virtual_linear_tree{m_memory_region_allocator}, m_physical_linear_tree{
|
m_virtual_linear_tree{m_memory_region_allocator},
|
||||||
m_memory_region_allocator} {}
|
m_physical_linear_tree{m_memory_region_allocator} {}
|
||||||
|
|
||||||
void KMemoryLayout::InitializeLinearMemoryRegionTrees(KPhysicalAddress aligned_linear_phys_start,
|
void KMemoryLayout::InitializeLinearMemoryRegionTrees(KPhysicalAddress aligned_linear_phys_start,
|
||||||
KVirtualAddress linear_virtual_start) {
|
KVirtualAddress linear_virtual_start) {
|
||||||
|
|
|
@ -17,38 +17,32 @@ namespace Kernel {
|
||||||
class KThread;
|
class KThread;
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept KPriorityQueueAffinityMask = !
|
concept KPriorityQueueAffinityMask = !std::is_reference_v<T> && requires(T& t) {
|
||||||
std::is_reference_v<T>&& requires(T& t) {
|
{ t.GetAffinityMask() } -> Common::ConvertibleTo<u64>;
|
||||||
{ t.GetAffinityMask() } -> Common::ConvertibleTo<u64>;
|
{ t.SetAffinityMask(0) };
|
||||||
{ t.SetAffinityMask(0) };
|
|
||||||
|
|
||||||
{ t.GetAffinity(0) } -> std::same_as<bool>;
|
{ t.GetAffinity(0) } -> std::same_as<bool>;
|
||||||
{ t.SetAffinity(0, false) };
|
{ t.SetAffinity(0, false) };
|
||||||
{ t.SetAll() };
|
{ t.SetAll() };
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept KPriorityQueueMember = !
|
concept KPriorityQueueMember = !std::is_reference_v<T> && requires(T& t) {
|
||||||
std::is_reference_v<T>&& requires(T& t) {
|
{ typename T::QueueEntry() };
|
||||||
{ typename T::QueueEntry() };
|
{ (typename T::QueueEntry()).Initialize() };
|
||||||
{ (typename T::QueueEntry()).Initialize() };
|
{ (typename T::QueueEntry()).SetPrev(std::addressof(t)) };
|
||||||
{ (typename T::QueueEntry()).SetPrev(std::addressof(t)) };
|
{ (typename T::QueueEntry()).SetNext(std::addressof(t)) };
|
||||||
{ (typename T::QueueEntry()).SetNext(std::addressof(t)) };
|
{ (typename T::QueueEntry()).GetNext() } -> std::same_as<T*>;
|
||||||
{ (typename T::QueueEntry()).GetNext() } -> std::same_as<T*>;
|
{ (typename T::QueueEntry()).GetPrev() } -> std::same_as<T*>;
|
||||||
{ (typename T::QueueEntry()).GetPrev() } -> std::same_as<T*>;
|
{ t.GetPriorityQueueEntry(0) } -> std::same_as<typename T::QueueEntry&>;
|
||||||
{
|
|
||||||
t.GetPriorityQueueEntry(0)
|
|
||||||
} -> std::same_as<typename T::QueueEntry&>;
|
|
||||||
|
|
||||||
{ t.GetAffinityMask() };
|
{ t.GetAffinityMask() };
|
||||||
{
|
{ std::remove_cvref_t<decltype(t.GetAffinityMask())>() } -> KPriorityQueueAffinityMask;
|
||||||
std::remove_cvref_t<decltype(t.GetAffinityMask())>()
|
|
||||||
} -> KPriorityQueueAffinityMask;
|
|
||||||
|
|
||||||
{ t.GetActiveCore() } -> Common::ConvertibleTo<s32>;
|
{ t.GetActiveCore() } -> Common::ConvertibleTo<s32>;
|
||||||
{ t.GetPriority() } -> Common::ConvertibleTo<s32>;
|
{ t.GetPriority() } -> Common::ConvertibleTo<s32>;
|
||||||
{ t.IsDummyThread() } -> Common::ConvertibleTo<bool>;
|
{ t.IsDummyThread() } -> Common::ConvertibleTo<bool>;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename Member, size_t NumCores_, int LowestPriority, int HighestPriority>
|
template <typename Member, size_t NumCores_, int LowestPriority, int HighestPriority>
|
||||||
requires KPriorityQueueMember<Member>
|
requires KPriorityQueueMember<Member>
|
||||||
|
|
|
@ -10,11 +10,10 @@
|
||||||
namespace Kernel {
|
namespace Kernel {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
concept KLockable = !
|
concept KLockable = !std::is_reference_v<T> && requires(T& t) {
|
||||||
std::is_reference_v<T>&& requires(T& t) {
|
{ t.Lock() } -> std::same_as<void>;
|
||||||
{ t.Lock() } -> std::same_as<void>;
|
{ t.Unlock() } -> std::same_as<void>;
|
||||||
{ t.Unlock() } -> std::same_as<void>;
|
};
|
||||||
};
|
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
requires KLockable<T>
|
requires KLockable<T>
|
||||||
|
|
|
@ -458,9 +458,13 @@ constexpr inline Result __TmpCurrentResultReference = ResultSuccess;
|
||||||
if (true)
|
if (true)
|
||||||
|
|
||||||
#define R_CONVERT(catch_type, convert_type) \
|
#define R_CONVERT(catch_type, convert_type) \
|
||||||
R_CATCH(catch_type) { R_THROW(static_cast<Result>(convert_type)); }
|
R_CATCH(catch_type) { \
|
||||||
|
R_THROW(static_cast<Result>(convert_type)); \
|
||||||
|
}
|
||||||
|
|
||||||
#define R_CONVERT_ALL(convert_type) \
|
#define R_CONVERT_ALL(convert_type) \
|
||||||
R_CATCH_ALL() { R_THROW(static_cast<Result>(convert_type)); }
|
R_CATCH_ALL() { \
|
||||||
|
R_THROW(static_cast<Result>(convert_type)); \
|
||||||
|
}
|
||||||
|
|
||||||
#define R_ASSERT(res_expr) ASSERT(R_SUCCEEDED(res_expr))
|
#define R_ASSERT(res_expr) ASSERT(R_SUCCEEDED(res_expr))
|
||||||
|
|
|
@ -1028,8 +1028,8 @@ void Module::Interface::TrySelectUserWithoutInteraction(HLERequestContext& ctx)
|
||||||
Module::Interface::Interface(std::shared_ptr<Module> module_,
|
Module::Interface::Interface(std::shared_ptr<Module> module_,
|
||||||
std::shared_ptr<ProfileManager> profile_manager_,
|
std::shared_ptr<ProfileManager> profile_manager_,
|
||||||
Core::System& system_, const char* name)
|
Core::System& system_, const char* name)
|
||||||
: ServiceFramework{system_, name}, module{std::move(module_)}, profile_manager{std::move(
|
: ServiceFramework{system_, name}, module{std::move(module_)},
|
||||||
profile_manager_)} {}
|
profile_manager{std::move(profile_manager_)} {}
|
||||||
|
|
||||||
Module::Interface::~Interface() = default;
|
Module::Interface::~Interface() = default;
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,8 @@ namespace Service::AM::Frontend {
|
||||||
|
|
||||||
Cabinet::Cabinet(Core::System& system_, std::shared_ptr<Applet> applet_,
|
Cabinet::Cabinet(Core::System& system_, std::shared_ptr<Applet> applet_,
|
||||||
LibraryAppletMode applet_mode_, const Core::Frontend::CabinetApplet& frontend_)
|
LibraryAppletMode applet_mode_, const Core::Frontend::CabinetApplet& frontend_)
|
||||||
: FrontendApplet{system_, applet_, applet_mode_}, frontend{frontend_}, service_context{
|
: FrontendApplet{system_, applet_, applet_mode_}, frontend{frontend_},
|
||||||
system_,
|
service_context{system_, "CabinetApplet"} {
|
||||||
"CabinetApplet"} {
|
|
||||||
|
|
||||||
availability_change_event =
|
availability_change_event =
|
||||||
service_context.CreateEvent("CabinetApplet:AvailabilityChangeEvent");
|
service_context.CreateEvent("CabinetApplet:AvailabilityChangeEvent");
|
||||||
|
|
|
@ -18,8 +18,8 @@ namespace Service::AM {
|
||||||
|
|
||||||
IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
IApplicationProxy::IApplicationProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
Kernel::KProcess* process, WindowSystem& window_system)
|
Kernel::KProcess* process, WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "IApplicationProxy"},
|
: ServiceFramework{system_, "IApplicationProxy"}, m_window_system{window_system},
|
||||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
m_process{process}, m_applet{std::move(applet)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
{0, D<&IApplicationProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
|
|
@ -165,8 +165,8 @@ std::shared_ptr<ILibraryAppletAccessor> CreateFrontendApplet(Core::System& syste
|
||||||
|
|
||||||
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
WindowSystem& window_system)
|
WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "ILibraryAppletCreator"},
|
: ServiceFramework{system_, "ILibraryAppletCreator"}, m_window_system{window_system},
|
||||||
m_window_system{window_system}, m_applet{std::move(applet)} {
|
m_applet{std::move(applet)} {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"},
|
{0, D<&ILibraryAppletCreator::CreateLibraryApplet>, "CreateLibraryApplet"},
|
||||||
{1, nullptr, "TerminateAllLibraryApplets"},
|
{1, nullptr, "TerminateAllLibraryApplets"},
|
||||||
|
|
|
@ -20,8 +20,8 @@ namespace Service::AM {
|
||||||
|
|
||||||
ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
ILibraryAppletProxy::ILibraryAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
Kernel::KProcess* process, WindowSystem& window_system)
|
Kernel::KProcess* process, WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "ILibraryAppletProxy"},
|
: ServiceFramework{system_, "ILibraryAppletProxy"}, m_window_system{window_system},
|
||||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
m_process{process}, m_applet{std::move(applet)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
{0, D<&ILibraryAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
|
|
@ -16,8 +16,8 @@ namespace Service::AM {
|
||||||
|
|
||||||
ISelfController::ISelfController(Core::System& system_, std::shared_ptr<Applet> applet,
|
ISelfController::ISelfController(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
Kernel::KProcess* process)
|
Kernel::KProcess* process)
|
||||||
: ServiceFramework{system_, "ISelfController"}, m_process{process}, m_applet{
|
: ServiceFramework{system_, "ISelfController"}, m_process{process},
|
||||||
std::move(applet)} {
|
m_applet{std::move(applet)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&ISelfController::Exit>, "Exit"},
|
{0, D<&ISelfController::Exit>, "Exit"},
|
||||||
|
|
|
@ -20,8 +20,8 @@ namespace Service::AM {
|
||||||
|
|
||||||
ISystemAppletProxy::ISystemAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
ISystemAppletProxy::ISystemAppletProxy(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
Kernel::KProcess* process, WindowSystem& window_system)
|
Kernel::KProcess* process, WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "ISystemAppletProxy"},
|
: ServiceFramework{system_, "ISystemAppletProxy"}, m_window_system{window_system},
|
||||||
m_window_system{window_system}, m_process{process}, m_applet{std::move(applet)} {
|
m_process{process}, m_applet{std::move(applet)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
{0, D<&ISystemAppletProxy::GetCommonStateGetter>, "GetCommonStateGetter"},
|
||||||
|
|
|
@ -11,8 +11,8 @@ namespace Service::AM {
|
||||||
|
|
||||||
IWindowController::IWindowController(Core::System& system_, std::shared_ptr<Applet> applet,
|
IWindowController::IWindowController(Core::System& system_, std::shared_ptr<Applet> applet,
|
||||||
WindowSystem& window_system)
|
WindowSystem& window_system)
|
||||||
: ServiceFramework{system_, "IWindowController"},
|
: ServiceFramework{system_, "IWindowController"}, m_window_system{window_system},
|
||||||
m_window_system{window_system}, m_applet{std::move(applet)} {
|
m_applet{std::move(applet)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, nullptr, "CreateWindow"},
|
{0, nullptr, "CreateWindow"},
|
||||||
|
|
|
@ -9,8 +9,8 @@ namespace Service::AOC {
|
||||||
constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400};
|
constexpr Result ResultNoPurchasedProductInfoAvailable{ErrorModule::NIMShop, 400};
|
||||||
|
|
||||||
IPurchaseEventManager::IPurchaseEventManager(Core::System& system_)
|
IPurchaseEventManager::IPurchaseEventManager(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IPurchaseEventManager"}, service_context{system,
|
: ServiceFramework{system_, "IPurchaseEventManager"},
|
||||||
"IPurchaseEventManager"} {
|
service_context{system, "IPurchaseEventManager"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"},
|
{0, D<&IPurchaseEventManager::SetDefaultDeliveryTarget>, "SetDefaultDeliveryTarget"},
|
||||||
|
|
|
@ -12,9 +12,8 @@ IAudioIn::IAudioIn(Core::System& system_, Manager& manager, size_t session_id,
|
||||||
const std::string& device_name, const AudioInParameter& in_params,
|
const std::string& device_name, const AudioInParameter& in_params,
|
||||||
Kernel::KProcess* handle, u64 applet_resource_user_id)
|
Kernel::KProcess* handle, u64 applet_resource_user_id)
|
||||||
: ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"},
|
: ServiceFramework{system_, "IAudioIn"}, process{handle}, service_context{system_, "IAudioIn"},
|
||||||
event{service_context.CreateEvent("AudioInEvent")}, impl{std::make_shared<In>(system_,
|
event{service_context.CreateEvent("AudioInEvent")},
|
||||||
manager, event,
|
impl{std::make_shared<In>(system_, manager, event, session_id)} {
|
||||||
session_id)} {
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"},
|
{0, D<&IAudioIn::GetAudioInState>, "GetAudioInState"},
|
||||||
|
|
|
@ -10,8 +10,8 @@ namespace Service::Audio {
|
||||||
using namespace AudioCore::AudioIn;
|
using namespace AudioCore::AudioIn;
|
||||||
|
|
||||||
IAudioInManager::IAudioInManager(Core::System& system_)
|
IAudioInManager::IAudioInManager(Core::System& system_)
|
||||||
: ServiceFramework{system_, "audin:u"}, impl{std::make_unique<AudioCore::AudioIn::Manager>(
|
: ServiceFramework{system_, "audin:u"},
|
||||||
system_)} {
|
impl{std::make_unique<AudioCore::AudioIn::Manager>(system_)} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"},
|
{0, D<&IAudioInManager::ListAudioIns>, "ListAudioIns"},
|
||||||
|
|
|
@ -14,8 +14,8 @@ IAudioRenderer::IAudioRenderer(Core::System& system_, Manager& manager_,
|
||||||
s32 session_id)
|
s32 session_id)
|
||||||
: ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"},
|
: ServiceFramework{system_, "IAudioRenderer"}, service_context{system_, "IAudioRenderer"},
|
||||||
rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_},
|
rendered_event{service_context.CreateEvent("IAudioRendererEvent")}, manager{manager_},
|
||||||
impl{std::make_unique<Renderer>(system_, manager, rendered_event)}, process_handle{
|
impl{std::make_unique<Renderer>(system_, manager, rendered_event)},
|
||||||
process_handle_} {
|
process_handle{process_handle_} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"},
|
{0, D<&IAudioRenderer::GetSampleRate>, "GetSampleRate"},
|
||||||
|
|
|
@ -7,9 +7,8 @@
|
||||||
namespace Service::News {
|
namespace Service::News {
|
||||||
|
|
||||||
INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_)
|
INewlyArrivedEventHolder::INewlyArrivedEventHolder(Core::System& system_)
|
||||||
: ServiceFramework{system_, "INewlyArrivedEventHolder"}, service_context{
|
: ServiceFramework{system_, "INewlyArrivedEventHolder"},
|
||||||
system_,
|
service_context{system_, "INewlyArrivedEventHolder"} {
|
||||||
"INewlyArrivedEventHolder"} {
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&INewlyArrivedEventHolder::Get>, "Get"},
|
{0, D<&INewlyArrivedEventHolder::Get>, "Get"},
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
namespace Service::News {
|
namespace Service::News {
|
||||||
|
|
||||||
IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_)
|
IOverwriteEventHolder::IOverwriteEventHolder(Core::System& system_)
|
||||||
: ServiceFramework{system_, "IOverwriteEventHolder"}, service_context{system_,
|
: ServiceFramework{system_, "IOverwriteEventHolder"},
|
||||||
"IOverwriteEventHolder"} {
|
service_context{system_, "IOverwriteEventHolder"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IOverwriteEventHolder::Get>, "Get"},
|
{0, D<&IOverwriteEventHolder::Get>, "Get"},
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
namespace Service::FileSystem {
|
namespace Service::FileSystem {
|
||||||
|
|
||||||
IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_)
|
IFileSystem::IFileSystem(Core::System& system_, FileSys::VirtualDir dir_, SizeGetter size_getter_)
|
||||||
: ServiceFramework{system_, "IFileSystem"}, backend{std::make_unique<FileSys::Fsa::IFileSystem>(
|
: ServiceFramework{system_, "IFileSystem"},
|
||||||
dir_)},
|
backend{std::make_unique<FileSys::Fsa::IFileSystem>(dir_)},
|
||||||
size_getter{std::move(size_getter_)} {
|
size_getter{std::move(size_getter_)} {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IFileSystem::CreateFile>, "CreateFile"},
|
{0, D<&IFileSystem::CreateFile>, "CreateFile"},
|
||||||
|
|
|
@ -12,8 +12,8 @@ namespace Service::FileSystem {
|
||||||
ISaveDataInfoReader::ISaveDataInfoReader(Core::System& system_,
|
ISaveDataInfoReader::ISaveDataInfoReader(Core::System& system_,
|
||||||
std::shared_ptr<SaveDataController> save_data_controller_,
|
std::shared_ptr<SaveDataController> save_data_controller_,
|
||||||
FileSys::SaveDataSpaceId space)
|
FileSys::SaveDataSpaceId space)
|
||||||
: ServiceFramework{system_, "ISaveDataInfoReader"}, save_data_controller{
|
: ServiceFramework{system_, "ISaveDataInfoReader"},
|
||||||
save_data_controller_} {
|
save_data_controller{save_data_controller_} {
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"},
|
{0, D<&ISaveDataInfoReader::ReadSaveDataInfo>, "ReadSaveDataInfo"},
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
namespace Service::Glue::Time {
|
namespace Service::Glue::Time {
|
||||||
|
|
||||||
AlarmWorker::AlarmWorker(Core::System& system, StandardSteadyClockResource& steady_clock_resource)
|
AlarmWorker::AlarmWorker(Core::System& system, StandardSteadyClockResource& steady_clock_resource)
|
||||||
: m_system{system}, m_ctx{system, "Glue:AlarmWorker"}, m_steady_clock_resource{
|
: m_system{system}, m_ctx{system, "Glue:AlarmWorker"},
|
||||||
steady_clock_resource} {}
|
m_steady_clock_resource{steady_clock_resource} {}
|
||||||
|
|
||||||
AlarmWorker::~AlarmWorker() {
|
AlarmWorker::~AlarmWorker() {
|
||||||
m_system.CoreTiming().UnscheduleEvent(m_timer_timing_event);
|
m_system.CoreTiming().UnscheduleEvent(m_timer_timing_event);
|
||||||
|
|
|
@ -87,10 +87,8 @@ static Service::PSC::Time::LocationName GetTimeZoneString(
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeManager::TimeManager(Core::System& system)
|
TimeManager::TimeManager(Core::System& system)
|
||||||
: m_steady_clock_resource{system}, m_time_zone_binary{system}, m_worker{
|
: m_steady_clock_resource{system}, m_time_zone_binary{system},
|
||||||
system,
|
m_worker{system, m_steady_clock_resource, m_file_timestamp_worker} {
|
||||||
m_steady_clock_resource,
|
|
||||||
m_file_timestamp_worker} {
|
|
||||||
m_time_m =
|
m_time_m =
|
||||||
system.ServiceManager().GetService<Service::PSC::Time::ServiceManager>("time:m", true);
|
system.ServiceManager().GetService<Service::PSC::Time::ServiceManager>("time:m", true);
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ TimeZoneService::TimeZoneService(
|
||||||
std::shared_ptr<Service::PSC::Time::TimeZoneService> time_zone_service)
|
std::shared_ptr<Service::PSC::Time::TimeZoneService> time_zone_service)
|
||||||
: ServiceFramework{system_, "ITimeZoneService"}, m_system{system},
|
: ServiceFramework{system_, "ITimeZoneService"}, m_system{system},
|
||||||
m_can_write_timezone_device_location{can_write_timezone_device_location},
|
m_can_write_timezone_device_location{can_write_timezone_device_location},
|
||||||
m_file_timestamp_worker{file_timestamp_worker}, m_wrapped_service{std::move(
|
m_file_timestamp_worker{file_timestamp_worker},
|
||||||
time_zone_service)},
|
m_wrapped_service{std::move(time_zone_service)}, m_operation_event{m_system},
|
||||||
m_operation_event{m_system}, m_time_zone_binary{time_zone_binary} {
|
m_time_zone_binary{time_zone_binary} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"},
|
{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"},
|
||||||
|
|
|
@ -19,11 +19,11 @@ namespace Service::Glue::Time {
|
||||||
|
|
||||||
TimeWorker::TimeWorker(Core::System& system, StandardSteadyClockResource& steady_clock_resource,
|
TimeWorker::TimeWorker(Core::System& system, StandardSteadyClockResource& steady_clock_resource,
|
||||||
FileTimestampWorker& file_timestamp_worker)
|
FileTimestampWorker& file_timestamp_worker)
|
||||||
: m_system{system}, m_ctx{m_system, "Glue:TimeWorker"}, m_event{m_ctx.CreateEvent(
|
: m_system{system}, m_ctx{m_system, "Glue:TimeWorker"},
|
||||||
"Glue:TimeWorker:Event")},
|
m_event{m_ctx.CreateEvent("Glue:TimeWorker:Event")},
|
||||||
m_steady_clock_resource{steady_clock_resource},
|
m_steady_clock_resource{steady_clock_resource},
|
||||||
m_file_timestamp_worker{file_timestamp_worker}, m_timer_steady_clock{m_ctx.CreateEvent(
|
m_file_timestamp_worker{file_timestamp_worker},
|
||||||
"Glue:TimeWorker:SteadyClockTimerEvent")},
|
m_timer_steady_clock{m_ctx.CreateEvent("Glue:TimeWorker:SteadyClockTimerEvent")},
|
||||||
m_timer_file_system{m_ctx.CreateEvent("Glue:TimeWorker:FileTimeTimerEvent")},
|
m_timer_file_system{m_ctx.CreateEvent("Glue:TimeWorker:FileTimeTimerEvent")},
|
||||||
m_alarm_worker{m_system, m_steady_clock_resource}, m_pm_state_change_handler{m_alarm_worker} {
|
m_alarm_worker{m_system, m_steady_clock_resource}, m_pm_state_change_handler{m_alarm_worker} {
|
||||||
m_timer_steady_clock_timing_event = Core::Timing::CreateEvent(
|
m_timer_steady_clock_timing_event = Core::Timing::CreateEvent(
|
||||||
|
|
|
@ -17,8 +17,8 @@ namespace Service::HID {
|
||||||
|
|
||||||
IHidDebugServer::IHidDebugServer(Core::System& system_, std::shared_ptr<ResourceManager> resource,
|
IHidDebugServer::IHidDebugServer(Core::System& system_, std::shared_ptr<ResourceManager> resource,
|
||||||
std::shared_ptr<HidFirmwareSettings> settings)
|
std::shared_ptr<HidFirmwareSettings> settings)
|
||||||
: ServiceFramework{system_, "hid:dbg"}, resource_manager{resource}, firmware_settings{
|
: ServiceFramework{system_, "hid:dbg"}, resource_manager{resource},
|
||||||
settings} {
|
firmware_settings{settings} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, nullptr, "DeactivateDebugPad"},
|
{0, nullptr, "DeactivateDebugPad"},
|
||||||
|
|
|
@ -72,8 +72,8 @@ public:
|
||||||
u32 num_handles_to_copy_ = 0, u32 num_objects_to_move_ = 0,
|
u32 num_handles_to_copy_ = 0, u32 num_objects_to_move_ = 0,
|
||||||
Flags flags = Flags::None)
|
Flags flags = Flags::None)
|
||||||
: RequestHelperBase(ctx), normal_params_size(normal_params_size_),
|
: RequestHelperBase(ctx), normal_params_size(normal_params_size_),
|
||||||
num_handles_to_copy(num_handles_to_copy_),
|
num_handles_to_copy(num_handles_to_copy_), num_objects_to_move(num_objects_to_move_),
|
||||||
num_objects_to_move(num_objects_to_move_), kernel{ctx.kernel} {
|
kernel{ctx.kernel} {
|
||||||
|
|
||||||
memset(cmdbuf, 0, sizeof(u32) * IPC::COMMAND_BUFFER_LENGTH);
|
memset(cmdbuf, 0, sizeof(u32) * IPC::COMMAND_BUFFER_LENGTH);
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ class DynarmicCallbacks64 : public Dynarmic::A64::UserCallbacks {
|
||||||
public:
|
public:
|
||||||
explicit DynarmicCallbacks64(Core::Memory::Memory& memory_, std::vector<u8>& local_memory_,
|
explicit DynarmicCallbacks64(Core::Memory::Memory& memory_, std::vector<u8>& local_memory_,
|
||||||
IntervalSet& mapped_ranges_, JITContextImpl& parent_)
|
IntervalSet& mapped_ranges_, JITContextImpl& parent_)
|
||||||
: memory{memory_}, local_memory{local_memory_},
|
: memory{memory_}, local_memory{local_memory_}, mapped_ranges{mapped_ranges_},
|
||||||
mapped_ranges{mapped_ranges_}, parent{parent_} {}
|
parent{parent_} {}
|
||||||
|
|
||||||
u8 MemoryRead8(u64 vaddr) override {
|
u8 MemoryRead8(u64 vaddr) override {
|
||||||
return ReadMemory<u8>(vaddr);
|
return ReadMemory<u8>(vaddr);
|
||||||
|
|
|
@ -23,8 +23,8 @@ class IDatabaseService final : public ServiceFramework<IDatabaseService> {
|
||||||
public:
|
public:
|
||||||
explicit IDatabaseService(Core::System& system_, std::shared_ptr<MiiManager> mii_manager,
|
explicit IDatabaseService(Core::System& system_, std::shared_ptr<MiiManager> mii_manager,
|
||||||
bool is_system_)
|
bool is_system_)
|
||||||
: ServiceFramework{system_, "IDatabaseService"}, manager{mii_manager}, is_system{
|
: ServiceFramework{system_, "IDatabaseService"}, manager{mii_manager},
|
||||||
is_system_} {
|
is_system{is_system_} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IDatabaseService::IsUpdated>, "IsUpdated"},
|
{0, D<&IDatabaseService::IsUpdated>, "IsUpdated"},
|
||||||
|
|
|
@ -30,8 +30,8 @@ Alarm::~Alarm() {
|
||||||
Alarms::Alarms(Core::System& system, StandardSteadyClockCore& steady_clock,
|
Alarms::Alarms(Core::System& system, StandardSteadyClockCore& steady_clock,
|
||||||
PowerStateRequestManager& power_state_request_manager)
|
PowerStateRequestManager& power_state_request_manager)
|
||||||
: m_system{system}, m_ctx{system, "Psc:Alarms"}, m_steady_clock{steady_clock},
|
: m_system{system}, m_ctx{system, "Psc:Alarms"}, m_steady_clock{steady_clock},
|
||||||
m_power_state_request_manager{power_state_request_manager}, m_event{m_ctx.CreateEvent(
|
m_power_state_request_manager{power_state_request_manager},
|
||||||
"Psc:Alarms:Event")} {}
|
m_event{m_ctx.CreateEvent("Psc:Alarms:Event")} {}
|
||||||
|
|
||||||
Alarms::~Alarms() {
|
Alarms::~Alarms() {
|
||||||
m_ctx.CloseEvent(m_event);
|
m_ctx.CloseEvent(m_event);
|
||||||
|
|
|
@ -11,8 +11,8 @@ StandardUserSystemClockCore::StandardUserSystemClockCore(
|
||||||
StandardNetworkSystemClockCore& network_clock)
|
StandardNetworkSystemClockCore& network_clock)
|
||||||
: SystemClockCore{local_clock.GetSteadyClock()}, m_system{system},
|
: SystemClockCore{local_clock.GetSteadyClock()}, m_system{system},
|
||||||
m_ctx{m_system, "Psc:StandardUserSystemClockCore"}, m_local_system_clock{local_clock},
|
m_ctx{m_system, "Psc:StandardUserSystemClockCore"}, m_local_system_clock{local_clock},
|
||||||
m_network_system_clock{network_clock}, m_event{m_ctx.CreateEvent(
|
m_network_system_clock{network_clock},
|
||||||
"Psc:StandardUserSystemClockCore:Event")} {}
|
m_event{m_ctx.CreateEvent("Psc:StandardUserSystemClockCore:Event")} {}
|
||||||
|
|
||||||
StandardUserSystemClockCore::~StandardUserSystemClockCore() {
|
StandardUserSystemClockCore::~StandardUserSystemClockCore() {
|
||||||
m_ctx.CloseEvent(m_event);
|
m_ctx.CloseEvent(m_event);
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
namespace Service::PSC::Time {
|
namespace Service::PSC::Time {
|
||||||
OperationEvent::OperationEvent(Core::System& system)
|
OperationEvent::OperationEvent(Core::System& system)
|
||||||
: m_ctx{system, "Time:OperationEvent"}, m_event{
|
: m_ctx{system, "Time:OperationEvent"},
|
||||||
m_ctx.CreateEvent("Time:OperationEvent:Event")} {}
|
m_event{m_ctx.CreateEvent("Time:OperationEvent:Event")} {}
|
||||||
|
|
||||||
OperationEvent::~OperationEvent() {
|
OperationEvent::~OperationEvent() {
|
||||||
m_ctx.CloseEvent(m_event);
|
m_ctx.CloseEvent(m_event);
|
||||||
|
|
|
@ -29,8 +29,8 @@ public:
|
||||||
m_standard_user_system_clock{m_system, m_standard_local_system_clock,
|
m_standard_user_system_clock{m_system, m_standard_local_system_clock,
|
||||||
m_standard_network_system_clock},
|
m_standard_network_system_clock},
|
||||||
m_ephemeral_network_clock{m_tick_based_steady_clock}, m_shared_memory{m_system},
|
m_ephemeral_network_clock{m_tick_based_steady_clock}, m_shared_memory{m_system},
|
||||||
m_power_state_request_manager{m_system}, m_alarms{m_system, m_standard_steady_clock,
|
m_power_state_request_manager{m_system},
|
||||||
m_power_state_request_manager},
|
m_alarms{m_system, m_standard_steady_clock, m_power_state_request_manager},
|
||||||
m_local_system_clock_context_writer{m_system, m_shared_memory},
|
m_local_system_clock_context_writer{m_system, m_shared_memory},
|
||||||
m_network_system_clock_context_writer{m_system, m_shared_memory,
|
m_network_system_clock_context_writer{m_system, m_shared_memory,
|
||||||
m_standard_user_system_clock},
|
m_standard_user_system_clock},
|
||||||
|
|
|
@ -8,8 +8,8 @@ namespace Service::PSC::Time {
|
||||||
|
|
||||||
IPowerStateRequestHandler::IPowerStateRequestHandler(
|
IPowerStateRequestHandler::IPowerStateRequestHandler(
|
||||||
Core::System& system_, PowerStateRequestManager& power_state_request_manager)
|
Core::System& system_, PowerStateRequestManager& power_state_request_manager)
|
||||||
: ServiceFramework{system_, "time:p"}, m_system{system}, m_power_state_request_manager{
|
: ServiceFramework{system_, "time:p"}, m_system{system},
|
||||||
power_state_request_manager} {
|
m_power_state_request_manager{power_state_request_manager} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"},
|
{0, D<&IPowerStateRequestHandler::GetPowerStateRequestEventReadableHandle>, "GetPowerStateRequestEventReadableHandle"},
|
||||||
|
|
|
@ -37,8 +37,8 @@ StaticService::StaticService(Core::System& system_, StaticServiceSetupInfo setup
|
||||||
m_user_system_clock{m_time->m_standard_user_system_clock},
|
m_user_system_clock{m_time->m_standard_user_system_clock},
|
||||||
m_network_system_clock{m_time->m_standard_network_system_clock},
|
m_network_system_clock{m_time->m_standard_network_system_clock},
|
||||||
m_time_zone{m_time->m_time_zone},
|
m_time_zone{m_time->m_time_zone},
|
||||||
m_ephemeral_network_clock{m_time->m_ephemeral_network_clock}, m_shared_memory{
|
m_ephemeral_network_clock{m_time->m_ephemeral_network_clock},
|
||||||
m_time->m_shared_memory} {
|
m_shared_memory{m_time->m_shared_memory} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"},
|
{0, D<&StaticService::GetStandardUserSystemClock>, "GetStandardUserSystemClock"},
|
||||||
|
|
|
@ -12,8 +12,8 @@ SteadyClock::SteadyClock(Core::System& system_, std::shared_ptr<TimeManager> man
|
||||||
bool can_write_steady_clock, bool can_write_uninitialized_clock)
|
bool can_write_steady_clock, bool can_write_uninitialized_clock)
|
||||||
: ServiceFramework{system_, "ISteadyClock"}, m_system{system},
|
: ServiceFramework{system_, "ISteadyClock"}, m_system{system},
|
||||||
m_clock_core{manager->m_standard_steady_clock},
|
m_clock_core{manager->m_standard_steady_clock},
|
||||||
m_can_write_steady_clock{can_write_steady_clock}, m_can_write_uninitialized_clock{
|
m_can_write_steady_clock{can_write_steady_clock},
|
||||||
can_write_uninitialized_clock} {
|
m_can_write_uninitialized_clock{can_write_uninitialized_clock} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"},
|
{0, D<&SteadyClock::GetCurrentTimePoint>, "GetCurrentTimePoint"},
|
||||||
|
|
|
@ -11,8 +11,8 @@ namespace Service::PSC::Time {
|
||||||
SystemClock::SystemClock(Core::System& system_, SystemClockCore& clock_core, bool can_write_clock,
|
SystemClock::SystemClock(Core::System& system_, SystemClockCore& clock_core, bool can_write_clock,
|
||||||
bool can_write_uninitialized_clock)
|
bool can_write_uninitialized_clock)
|
||||||
: ServiceFramework{system_, "ISystemClock"}, m_system{system}, m_clock_core{clock_core},
|
: ServiceFramework{system_, "ISystemClock"}, m_system{system}, m_clock_core{clock_core},
|
||||||
m_can_write_clock{can_write_clock}, m_can_write_uninitialized_clock{
|
m_can_write_clock{can_write_clock},
|
||||||
can_write_uninitialized_clock} {
|
m_can_write_uninitialized_clock{can_write_uninitialized_clock} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"},
|
{0, D<&SystemClock::GetCurrentTime>, "GetCurrentTime"},
|
||||||
|
|
|
@ -13,8 +13,8 @@ namespace Service::PSC::Time {
|
||||||
TimeZoneService::TimeZoneService(Core::System& system_, StandardSteadyClockCore& clock_core,
|
TimeZoneService::TimeZoneService(Core::System& system_, StandardSteadyClockCore& clock_core,
|
||||||
TimeZone& time_zone, bool can_write_timezone_device_location)
|
TimeZone& time_zone, bool can_write_timezone_device_location)
|
||||||
: ServiceFramework{system_, "ITimeZoneService"}, m_system{system}, m_clock_core{clock_core},
|
: ServiceFramework{system_, "ITimeZoneService"}, m_system{system}, m_clock_core{clock_core},
|
||||||
m_time_zone{time_zone}, m_can_write_timezone_device_location{
|
m_time_zone{time_zone},
|
||||||
can_write_timezone_device_location} {
|
m_can_write_timezone_device_location{can_write_timezone_device_location} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"},
|
{0, D<&TimeZoneService::GetDeviceLocationName>, "GetDeviceLocationName"},
|
||||||
|
|
|
@ -251,8 +251,8 @@ void SM::UnregisterService(HLERequestContext& ctx) {
|
||||||
}
|
}
|
||||||
|
|
||||||
SM::SM(ServiceManager& service_manager_, Core::System& system_)
|
SM::SM(ServiceManager& service_manager_, Core::System& system_)
|
||||||
: ServiceFramework{system_, "sm:", 4},
|
: ServiceFramework{system_, "sm:", 4}, service_manager{service_manager_},
|
||||||
service_manager{service_manager_}, kernel{system_.Kernel()} {
|
kernel{system_.Kernel()} {
|
||||||
RegisterHandlers({
|
RegisterHandlers({
|
||||||
{0, &SM::Initialize, "Initialize"},
|
{0, &SM::Initialize, "Initialize"},
|
||||||
{1, &SM::GetServiceCmif, "GetService"},
|
{1, &SM::GetServiceCmif, "GetService"},
|
||||||
|
|
|
@ -15,8 +15,8 @@ namespace Service::VI {
|
||||||
|
|
||||||
IApplicationDisplayService::IApplicationDisplayService(Core::System& system_,
|
IApplicationDisplayService::IApplicationDisplayService(Core::System& system_,
|
||||||
std::shared_ptr<Container> container)
|
std::shared_ptr<Container> container)
|
||||||
: ServiceFramework{system_, "IApplicationDisplayService"},
|
: ServiceFramework{system_, "IApplicationDisplayService"}, m_container{std::move(container)},
|
||||||
m_container{std::move(container)}, m_context{system, "IApplicationDisplayService"} {
|
m_context{system, "IApplicationDisplayService"} {
|
||||||
// clang-format off
|
// clang-format off
|
||||||
static const FunctionInfo functions[] = {
|
static const FunctionInfo functions[] = {
|
||||||
{100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"},
|
{100, C<&IApplicationDisplayService::GetRelayService>, "GetRelayService"},
|
||||||
|
|
|
@ -218,8 +218,8 @@ std::vector<CheatEntry> TextCheatParser::Parse(std::string_view data) const {
|
||||||
|
|
||||||
CheatEngine::CheatEngine(System& system_, std::vector<CheatEntry> cheats_,
|
CheatEngine::CheatEngine(System& system_, std::vector<CheatEntry> cheats_,
|
||||||
const std::array<u8, 0x20>& build_id_)
|
const std::array<u8, 0x20>& build_id_)
|
||||||
: vm{std::make_unique<StandardVmCallbacks>(system_, metadata)},
|
: vm{std::make_unique<StandardVmCallbacks>(system_, metadata)}, cheats(std::move(cheats_)),
|
||||||
cheats(std::move(cheats_)), core_timing{system_.CoreTiming()}, system{system_} {
|
core_timing{system_.CoreTiming()}, system{system_} {
|
||||||
metadata.main_nso_build_id = build_id_;
|
metadata.main_nso_build_id = build_id_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -148,8 +148,8 @@ public:
|
||||||
Common::Input::AnalogProperties properties_y_,
|
Common::Input::AnalogProperties properties_y_,
|
||||||
InputEngine* input_engine_)
|
InputEngine* input_engine_)
|
||||||
: identifier(identifier_), axis_x(axis_x_), axis_y(axis_y_), properties_x(properties_x_),
|
: identifier(identifier_), axis_x(axis_x_), axis_y(axis_y_), properties_x(properties_x_),
|
||||||
properties_y(properties_y_),
|
properties_y(properties_y_), input_engine(input_engine_),
|
||||||
input_engine(input_engine_), invert_axis_y{input_engine_->GetEngineName() == "sdl"} {
|
invert_axis_y{input_engine_->GetEngineName() == "sdl"} {
|
||||||
UpdateCallback engine_callback{[this]() { OnChange(); }};
|
UpdateCallback engine_callback{[this]() { OnChange(); }};
|
||||||
const InputIdentifier x_input_identifier{
|
const InputIdentifier x_input_identifier{
|
||||||
.identifier = identifier,
|
.identifier = identifier,
|
||||||
|
|
|
@ -186,8 +186,8 @@ Function::Function(ObjectPool<Block>& block_pool, Location start_address)
|
||||||
|
|
||||||
CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_address,
|
CFG::CFG(Environment& env_, ObjectPool<Block>& block_pool_, Location start_address,
|
||||||
bool exits_to_dispatcher_)
|
bool exits_to_dispatcher_)
|
||||||
: env{env_}, block_pool{block_pool_}, program_start{start_address}, exits_to_dispatcher{
|
: env{env_}, block_pool{block_pool_}, program_start{start_address},
|
||||||
exits_to_dispatcher_} {
|
exits_to_dispatcher{exits_to_dispatcher_} {
|
||||||
if (exits_to_dispatcher) {
|
if (exits_to_dispatcher) {
|
||||||
dispatch_block = block_pool.Create(Block{});
|
dispatch_block = block_pool.Create(Block{});
|
||||||
dispatch_block->begin = {};
|
dispatch_block->begin = {};
|
||||||
|
|
|
@ -112,8 +112,8 @@ struct Statement : ListBaseHook {
|
||||||
Statement(SetVariable, u32 id_, Statement* op_, Statement* up_)
|
Statement(SetVariable, u32 id_, Statement* op_, Statement* up_)
|
||||||
: op{op_}, id{id_}, up{up_}, type{StatementType::SetVariable} {}
|
: op{op_}, id{id_}, up{up_}, type{StatementType::SetVariable} {}
|
||||||
Statement(SetIndirectBranchVariable, IR::Reg branch_reg_, s32 branch_offset_, Statement* up_)
|
Statement(SetIndirectBranchVariable, IR::Reg branch_reg_, s32 branch_offset_, Statement* up_)
|
||||||
: branch_offset{branch_offset_},
|
: branch_offset{branch_offset_}, branch_reg{branch_reg_}, up{up_},
|
||||||
branch_reg{branch_reg_}, up{up_}, type{StatementType::SetIndirectBranchVariable} {}
|
type{StatementType::SetIndirectBranchVariable} {}
|
||||||
Statement(Variable, u32 id_, Statement* up_)
|
Statement(Variable, u32 id_, Statement* up_)
|
||||||
: id{id_}, up{up_}, type{StatementType::Variable} {}
|
: id{id_}, up{up_}, type{StatementType::Variable} {}
|
||||||
Statement(IndirectBranchCond, u32 location_, Statement* up_)
|
Statement(IndirectBranchCond, u32 location_, Statement* up_)
|
||||||
|
|
|
@ -54,8 +54,8 @@ QtNXWebEngineView::QtNXWebEngineView(QWidget* parent, Core::System& system,
|
||||||
: QWebEngineView(parent), input_subsystem{input_subsystem_},
|
: QWebEngineView(parent), input_subsystem{input_subsystem_},
|
||||||
url_interceptor(std::make_unique<UrlRequestInterceptor>()),
|
url_interceptor(std::make_unique<UrlRequestInterceptor>()),
|
||||||
input_interpreter(std::make_unique<InputInterpreter>(system)),
|
input_interpreter(std::make_unique<InputInterpreter>(system)),
|
||||||
default_profile{QWebEngineProfile::defaultProfile()}, global_settings{
|
default_profile{QWebEngineProfile::defaultProfile()},
|
||||||
default_profile->settings()} {
|
global_settings{default_profile->settings()} {
|
||||||
default_profile->setPersistentStoragePath(QString::fromStdString(Common::FS::PathToUTF8String(
|
default_profile->setPersistentStoragePath(QString::fromStdString(Common::FS::PathToUTF8String(
|
||||||
Common::FS::GetSuyuPath(Common::FS::SuyuPath::SuyuDir) / "qtwebengine")));
|
Common::FS::GetSuyuPath(Common::FS::SuyuPath::SuyuDir) / "qtwebengine")));
|
||||||
|
|
||||||
|
|
|
@ -284,8 +284,8 @@ struct NullRenderWidget : public RenderWidget {
|
||||||
GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
GRenderWindow::GRenderWindow(GMainWindow* parent, EmuThread* emu_thread_,
|
||||||
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
std::shared_ptr<InputCommon::InputSubsystem> input_subsystem_,
|
||||||
Core::System& system_)
|
Core::System& system_)
|
||||||
: QWidget(parent),
|
: QWidget(parent), emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)},
|
||||||
emu_thread(emu_thread_), input_subsystem{std::move(input_subsystem_)}, system{system_} {
|
system{system_} {
|
||||||
setWindowTitle(QStringLiteral("suyu %1 | %2-%3")
|
setWindowTitle(QStringLiteral("suyu %1 | %2-%3")
|
||||||
.arg(QString::fromUtf8(Common::g_build_name),
|
.arg(QString::fromUtf8(Common::g_build_name),
|
||||||
QString::fromUtf8(Common::g_scm_branch),
|
QString::fromUtf8(Common::g_scm_branch),
|
||||||
|
|
|
@ -32,9 +32,9 @@ ConfigureDialog::ConfigureDialog(QWidget* parent, HotkeyRegistry& registry_,
|
||||||
InputCommon::InputSubsystem* input_subsystem,
|
InputCommon::InputSubsystem* input_subsystem,
|
||||||
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
||||||
Core::System& system_, bool enable_web_config)
|
Core::System& system_, bool enable_web_config)
|
||||||
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()},
|
: QDialog(parent), ui{std::make_unique<Ui::ConfigureDialog>()}, registry(registry_),
|
||||||
registry(registry_), system{system_}, builder{std::make_unique<ConfigurationShared::Builder>(
|
system{system_},
|
||||||
this, !system_.IsPoweredOn())},
|
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
|
||||||
applets_tab{std::make_unique<ConfigureApplets>(system_, nullptr, *builder, this)},
|
applets_tab{std::make_unique<ConfigureApplets>(system_, nullptr, *builder, this)},
|
||||||
audio_tab{std::make_unique<ConfigureAudio>(system_, nullptr, *builder, this)},
|
audio_tab{std::make_unique<ConfigureAudio>(system_, nullptr, *builder, this)},
|
||||||
cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, *builder, this)},
|
cpu_tab{std::make_unique<ConfigureCpu>(system_, nullptr, *builder, this)},
|
||||||
|
|
|
@ -293,11 +293,11 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i
|
||||||
InputCommon::InputSubsystem* input_subsystem_,
|
InputCommon::InputSubsystem* input_subsystem_,
|
||||||
InputProfiles* profiles_, Core::HID::HIDCore& hid_core_,
|
InputProfiles* profiles_, Core::HID::HIDCore& hid_core_,
|
||||||
bool is_powered_on_, bool debug_)
|
bool is_powered_on_, bool debug_)
|
||||||
: QWidget(parent),
|
: QWidget(parent), ui(std::make_unique<Ui::ConfigureInputPlayer>()),
|
||||||
ui(std::make_unique<Ui::ConfigureInputPlayer>()), player_index{player_index_}, debug{debug_},
|
player_index{player_index_}, debug{debug_}, is_powered_on{is_powered_on_},
|
||||||
is_powered_on{is_powered_on_}, input_subsystem{input_subsystem_}, profiles(profiles_),
|
input_subsystem{input_subsystem_}, profiles(profiles_),
|
||||||
timeout_timer(std::make_unique<QTimer>()),
|
timeout_timer(std::make_unique<QTimer>()), poll_timer(std::make_unique<QTimer>()),
|
||||||
poll_timer(std::make_unique<QTimer>()), bottom_row{bottom_row_}, hid_core{hid_core_} {
|
bottom_row{bottom_row_}, hid_core{hid_core_} {
|
||||||
if (player_index == 0) {
|
if (player_index == 0) {
|
||||||
auto* emulated_controller_p1 =
|
auto* emulated_controller_p1 =
|
||||||
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
|
hid_core.GetEmulatedController(Core::HID::NpadIdType::Player1);
|
||||||
|
|
|
@ -44,8 +44,8 @@
|
||||||
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
|
ConfigurePerGame::ConfigurePerGame(QWidget* parent, u64 title_id_, const std::string& file_name,
|
||||||
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
std::vector<VkDeviceInfo::Record>& vk_device_records,
|
||||||
Core::System& system_)
|
Core::System& system_)
|
||||||
: QDialog(parent),
|
: QDialog(parent), ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_},
|
||||||
ui(std::make_unique<Ui::ConfigurePerGame>()), title_id{title_id_}, system{system_},
|
system{system_},
|
||||||
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
|
builder{std::make_unique<ConfigurationShared::Builder>(this, !system_.IsPoweredOn())},
|
||||||
tab_group{std::make_shared<std::vector<ConfigurationShared::Tab*>>()} {
|
tab_group{std::make_shared<std::vector<ConfigurationShared::Tab*>>()} {
|
||||||
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
|
const auto file_path = std::filesystem::path(Common::FS::ToU8String(file_name));
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <filesystem>
|
||||||
|
#include <fstream>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
@ -11,12 +13,19 @@
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
#include <qdesktopservices.h>
|
||||||
|
#include <qdialog.h>
|
||||||
|
#include <qdialogbuttonbox.h>
|
||||||
|
#include <qformlayout.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qlineedit.h>
|
||||||
|
#include <qmessagebox.h>
|
||||||
|
#include <qtreewidget.h>
|
||||||
|
|
||||||
#include "common/fs/fs.h"
|
#include "common/fs/fs.h"
|
||||||
#include "common/fs/path_util.h"
|
#include "common/fs/path_util.h"
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/file_sys/patch_manager.h"
|
#include "core/file_sys/patch_manager.h"
|
||||||
#include "core/file_sys/xts_archive.h"
|
|
||||||
#include "core/loader/loader.h"
|
#include "core/loader/loader.h"
|
||||||
#include "suyu/configuration/configure_input.h"
|
#include "suyu/configuration/configure_input.h"
|
||||||
#include "suyu/configuration/configure_per_game_addons.h"
|
#include "suyu/configuration/configure_per_game_addons.h"
|
||||||
|
@ -63,6 +72,16 @@ ConfigurePerGameAddons::ConfigurePerGameAddons(Core::System& system_, QWidget* p
|
||||||
|
|
||||||
connect(item_model, &QStandardItemModel::itemChanged,
|
connect(item_model, &QStandardItemModel::itemChanged,
|
||||||
[] { UISettings::values.is_game_list_reload_pending.exchange(true); });
|
[] { UISettings::values.is_game_list_reload_pending.exchange(true); });
|
||||||
|
|
||||||
|
connect(tree_view, &QTreeView::clicked, this, &ConfigurePerGameAddons::OnPatchSelected);
|
||||||
|
|
||||||
|
connect(ui->new_btn, &QPushButton::clicked, this, &ConfigurePerGameAddons::OnPatchCreateClick);
|
||||||
|
connect(ui->edit_btn, &QPushButton::clicked, this, &ConfigurePerGameAddons::OnPatchEditClick);
|
||||||
|
connect(ui->remove_btn, &QPushButton::clicked, this,
|
||||||
|
&ConfigurePerGameAddons::OnPatchRemoveClick);
|
||||||
|
|
||||||
|
connect(ui->folder_btn, &QPushButton::clicked, this,
|
||||||
|
&ConfigurePerGameAddons::OnPatchOpenFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigurePerGameAddons::~ConfigurePerGameAddons() = default;
|
ConfigurePerGameAddons::~ConfigurePerGameAddons() = default;
|
||||||
|
@ -119,10 +138,11 @@ void ConfigurePerGameAddons::LoadConfiguration() {
|
||||||
|
|
||||||
FileSys::VirtualFile update_raw;
|
FileSys::VirtualFile update_raw;
|
||||||
loader->ReadUpdateRaw(update_raw);
|
loader->ReadUpdateRaw(update_raw);
|
||||||
|
patches = pm.GetPatches(update_raw);
|
||||||
|
|
||||||
const auto& disabled = Settings::values.disabled_addons[title_id];
|
const auto& disabled = Settings::values.disabled_addons[title_id];
|
||||||
|
|
||||||
for (const auto& patch : pm.GetPatches(update_raw)) {
|
for (const auto& patch : patches) {
|
||||||
const auto name = QString::fromStdString(patch.name);
|
const auto name = QString::fromStdString(patch.name);
|
||||||
|
|
||||||
auto* const first_item = new QStandardItem;
|
auto* const first_item = new QStandardItem;
|
||||||
|
@ -141,3 +161,148 @@ void ConfigurePerGameAddons::LoadConfiguration() {
|
||||||
|
|
||||||
tree_view->resizeColumnToContents(1);
|
tree_view->resizeColumnToContents(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::ReloadList() {
|
||||||
|
// Clear all items and selection
|
||||||
|
item_model->setRowCount(0);
|
||||||
|
list_items.clear();
|
||||||
|
selected_patch = std::nullopt;
|
||||||
|
|
||||||
|
// Remove the cache to ensure we'll recreate it
|
||||||
|
Common::FS::RemoveFile(Common::FS::GetSuyuPath(Common::FS::SuyuPath::CacheDir) / "game_list" /
|
||||||
|
fmt::format("{:016X}.pv.txt", title_id));
|
||||||
|
|
||||||
|
// Reload stuff
|
||||||
|
UISettings::values.is_game_list_reload_pending.exchange(true);
|
||||||
|
UISettings::values.is_game_list_reload_pending.notify_all();
|
||||||
|
LoadConfiguration();
|
||||||
|
ApplyConfiguration();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::OnPatchSelected(const QModelIndex& selectedIndex) {
|
||||||
|
QModelIndexList indexes = tree_view->selectionModel()->selectedIndexes();
|
||||||
|
if (indexes.size() == 0) {
|
||||||
|
// Nothing selected
|
||||||
|
ui->edit_btn->setEnabled(false);
|
||||||
|
ui->remove_btn->setEnabled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QStandardItemModel* model = (QStandardItemModel*)tree_view->model();
|
||||||
|
QStandardItem* item = model->itemFromIndex(selectedIndex.siblingAtColumn(0));
|
||||||
|
|
||||||
|
std::string patch_name = item->text().toStdString();
|
||||||
|
selected_patch = std::nullopt;
|
||||||
|
|
||||||
|
for (const auto& patch : patches) {
|
||||||
|
if (patch.name != patch_name)
|
||||||
|
continue;
|
||||||
|
if (patch.version != "IPSwitch")
|
||||||
|
continue;
|
||||||
|
|
||||||
|
selected_patch = patch;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selected_patch || !selected_patch->file_path) {
|
||||||
|
// Either patch not found or selected isn't a patch
|
||||||
|
ui->edit_btn->setEnabled(false);
|
||||||
|
ui->remove_btn->setEnabled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ui->edit_btn->setEnabled(true);
|
||||||
|
ui->remove_btn->setEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::OnPatchCreateClick(bool checked) {
|
||||||
|
std::filesystem::path addon_path =
|
||||||
|
Common::FS::GetSuyuPath(Common::FS::SuyuPath::LoadDir) / fmt::format("{:016X}", title_id);
|
||||||
|
|
||||||
|
QDialog dialog(this);
|
||||||
|
dialog.setWindowTitle(QString::fromStdString("New Patch"));
|
||||||
|
|
||||||
|
QFormLayout form(&dialog);
|
||||||
|
form.addRow(
|
||||||
|
new QLabel(QString::fromStdString("Enter the name of the patch that will be created")));
|
||||||
|
|
||||||
|
QLineEdit* lineEdit = new QLineEdit(&dialog);
|
||||||
|
form.addRow(QString::fromStdString("Patch Name"), lineEdit);
|
||||||
|
|
||||||
|
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal,
|
||||||
|
&dialog);
|
||||||
|
|
||||||
|
form.addRow(&buttonBox);
|
||||||
|
QObject::connect(&buttonBox, SIGNAL(accepted()), &dialog, SLOT(accept()));
|
||||||
|
QObject::connect(&buttonBox, SIGNAL(rejected()), &dialog, SLOT(reject()));
|
||||||
|
|
||||||
|
if (dialog.exec() == QDialog::Accepted) {
|
||||||
|
std::filesystem::path addon_root_path = addon_path / lineEdit->text().toStdString();
|
||||||
|
std::filesystem::path addon_exefs_path = addon_root_path / "exefs";
|
||||||
|
std::filesystem::path addon_file_path = addon_exefs_path / "patch.pchtxt";
|
||||||
|
|
||||||
|
// Create the folders
|
||||||
|
if (!Common::FS::CreateDir(addon_root_path)) {
|
||||||
|
LOG_ERROR(Core, "Could not create new addon root path at {}",
|
||||||
|
addon_root_path.generic_string());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Common::FS::CreateDir(addon_exefs_path)) {
|
||||||
|
LOG_ERROR(Core, "Could not create new addon root path at {}",
|
||||||
|
addon_root_path.generic_string());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create the patch file
|
||||||
|
std::ofstream patch_file(addon_file_path);
|
||||||
|
patch_file << "# Place your patches below" << std::endl;
|
||||||
|
patch_file.close();
|
||||||
|
|
||||||
|
// Reload everything
|
||||||
|
ReloadList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::OnPatchEditClick(bool checked) {
|
||||||
|
if (!selected_patch || !selected_patch->file_path) {
|
||||||
|
// Either no patch selected or selected patch somehow doesn't have a file?
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QDesktopServices::openUrl(
|
||||||
|
QUrl::fromLocalFile(QString::fromStdString(selected_patch->file_path.value())));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::OnPatchRemoveClick(bool checked) {
|
||||||
|
if (!selected_patch || !selected_patch->file_path || !selected_patch->root_path) {
|
||||||
|
// Either no patch selected or selected patch somehow doesn't have a file?
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QMessageBox::StandardButton reply;
|
||||||
|
reply = QMessageBox::question(
|
||||||
|
this, QString::fromStdString("Remove patch confirmation"),
|
||||||
|
QString::fromStdString(
|
||||||
|
"Are you sure you want to remove the patch '%1'? This action is permanent!")
|
||||||
|
.arg(QString::fromStdString(selected_patch->name)),
|
||||||
|
QMessageBox::Yes | QMessageBox::No);
|
||||||
|
|
||||||
|
if (reply != QMessageBox::Yes) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove the patch then reload
|
||||||
|
if (!Common::FS::RemoveDirRecursively(selected_patch->root_path.value_or("Invalid Path"))) {
|
||||||
|
LOG_ERROR(Core, "Could not create new addon root path at {}",
|
||||||
|
selected_patch->root_path.value_or("Invalid Path"));
|
||||||
|
}
|
||||||
|
|
||||||
|
ReloadList();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConfigurePerGameAddons::OnPatchOpenFolder(bool checked) {
|
||||||
|
std::filesystem::path path =
|
||||||
|
Common::FS::GetSuyuPath(Common::FS::SuyuPath::LoadDir) / fmt::format("{:016X}", title_id);
|
||||||
|
|
||||||
|
QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(path.generic_string())));
|
||||||
|
}
|
||||||
|
|
|
@ -7,7 +7,9 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
#include <qtreewidget.h>
|
||||||
|
|
||||||
|
#include "core/file_sys/patch_manager.h"
|
||||||
#include "core/file_sys/vfs/vfs_types.h"
|
#include "core/file_sys/vfs/vfs_types.h"
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
@ -43,6 +45,7 @@ private:
|
||||||
void RetranslateUI();
|
void RetranslateUI();
|
||||||
|
|
||||||
void LoadConfiguration();
|
void LoadConfiguration();
|
||||||
|
void ReloadList();
|
||||||
|
|
||||||
std::unique_ptr<Ui::ConfigurePerGameAddons> ui;
|
std::unique_ptr<Ui::ConfigurePerGameAddons> ui;
|
||||||
FileSys::VirtualFile file;
|
FileSys::VirtualFile file;
|
||||||
|
@ -54,5 +57,15 @@ private:
|
||||||
|
|
||||||
std::vector<QList<QStandardItem*>> list_items;
|
std::vector<QList<QStandardItem*>> list_items;
|
||||||
|
|
||||||
|
std::optional<FileSys::Patch> selected_patch;
|
||||||
|
std::vector<FileSys::Patch> patches;
|
||||||
|
|
||||||
Core::System& system;
|
Core::System& system;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void OnPatchSelected(const QModelIndex& selectedIndex);
|
||||||
|
void OnPatchCreateClick(bool checked = false);
|
||||||
|
void OnPatchEditClick(bool checked = false);
|
||||||
|
void OnPatchRemoveClick(bool checked = false);
|
||||||
|
void OnPatchOpenFolder(bool checked = false);
|
||||||
};
|
};
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>400</width>
|
<width>482</width>
|
||||||
<height>300</height>
|
<height>316</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
|
@ -18,21 +18,63 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QScrollArea" name="scrollArea">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="widgetResizable">
|
<item>
|
||||||
<bool>true</bool>
|
<widget class="QScrollArea" name="scrollArea">
|
||||||
</property>
|
<property name="widgetResizable">
|
||||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
<bool>true</bool>
|
||||||
<property name="geometry">
|
</property>
|
||||||
<rect>
|
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||||
<x>0</x>
|
<property name="geometry">
|
||||||
<y>0</y>
|
<rect>
|
||||||
<width>380</width>
|
<x>0</x>
|
||||||
<height>280</height>
|
<y>0</y>
|
||||||
</rect>
|
<width>460</width>
|
||||||
</property>
|
<height>262</height>
|
||||||
</widget>
|
</rect>
|
||||||
</widget>
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<layout class="QHBoxLayout" name="action_buttons">
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="new_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>New Patch</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="edit_btn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Edit Patch</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="remove_btn">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Remove Patch</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QPushButton" name="folder_btn">
|
||||||
|
<property name="text">
|
||||||
|
<string>Open Folder</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
|
|
@ -766,8 +766,8 @@ Widget::Widget(Settings::BasicSetting* setting_, const TranslationMap& translati
|
||||||
|
|
||||||
Builder::Builder(QWidget* parent_, bool runtime_lock_)
|
Builder::Builder(QWidget* parent_, bool runtime_lock_)
|
||||||
: translations{InitializeTranslations(parent_)},
|
: translations{InitializeTranslations(parent_)},
|
||||||
combobox_translations{ComboboxEnumeration(parent_)}, parent{parent_}, runtime_lock{
|
combobox_translations{ComboboxEnumeration(parent_)}, parent{parent_},
|
||||||
runtime_lock_} {}
|
runtime_lock{runtime_lock_} {}
|
||||||
|
|
||||||
Builder::~Builder() = default;
|
Builder::~Builder() = default;
|
||||||
|
|
||||||
|
|
|
@ -234,8 +234,8 @@ GameListWorker::GameListWorker(FileSys::VirtualFilesystem vfs_,
|
||||||
const PlayTime::PlayTimeManager& play_time_manager_,
|
const PlayTime::PlayTimeManager& play_time_manager_,
|
||||||
Core::System& system_)
|
Core::System& system_)
|
||||||
: vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_},
|
: vfs{std::move(vfs_)}, provider{provider_}, game_dirs{game_dirs_},
|
||||||
compatibility_list{compatibility_list_}, play_time_manager{play_time_manager_}, system{
|
compatibility_list{compatibility_list_}, play_time_manager{play_time_manager_},
|
||||||
system_} {
|
system{system_} {
|
||||||
// We want the game list to manage our lifetime.
|
// We want the game list to manage our lifetime.
|
||||||
setAutoDelete(false);
|
setAutoDelete(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,8 +24,8 @@ enum class ConnectionType : u8 { TraversalServer, IP };
|
||||||
|
|
||||||
DirectConnectWindow::DirectConnectWindow(Core::System& system_, QWidget* parent)
|
DirectConnectWindow::DirectConnectWindow(Core::System& system_, QWidget* parent)
|
||||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||||
ui(std::make_unique<Ui::DirectConnect>()), system{system_}, room_network{
|
ui(std::make_unique<Ui::DirectConnect>()), system{system_},
|
||||||
system.GetRoomNetwork()} {
|
room_network{system.GetRoomNetwork()} {
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,8 @@ HostRoomWindow::HostRoomWindow(QWidget* parent, QStandardItemModel* list,
|
||||||
std::shared_ptr<Core::AnnounceMultiplayerSession> session,
|
std::shared_ptr<Core::AnnounceMultiplayerSession> session,
|
||||||
Core::System& system_)
|
Core::System& system_)
|
||||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||||
ui(std::make_unique<Ui::HostRoom>()),
|
ui(std::make_unique<Ui::HostRoom>()), announce_multiplayer_session(session), system{system_},
|
||||||
announce_multiplayer_session(session), system{system_}, room_network{
|
room_network{system.GetRoomNetwork()} {
|
||||||
system.GetRoomNetwork()} {
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// set up validation for all of the fields
|
// set up validation for all of the fields
|
||||||
|
|
|
@ -27,9 +27,8 @@
|
||||||
Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
|
Lobby::Lobby(QWidget* parent, QStandardItemModel* list,
|
||||||
std::shared_ptr<Core::AnnounceMultiplayerSession> session, Core::System& system_)
|
std::shared_ptr<Core::AnnounceMultiplayerSession> session, Core::System& system_)
|
||||||
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
: QDialog(parent, Qt::WindowTitleHint | Qt::WindowCloseButtonHint | Qt::WindowSystemMenuHint),
|
||||||
ui(std::make_unique<Ui::Lobby>()),
|
ui(std::make_unique<Ui::Lobby>()), announce_multiplayer_session(session), system{system_},
|
||||||
announce_multiplayer_session(session), system{system_}, room_network{
|
room_network{system.GetRoomNetwork()} {
|
||||||
system.GetRoomNetwork()} {
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
// setup the watcher for background connections
|
// setup the watcher for background connections
|
||||||
|
|
|
@ -18,8 +18,8 @@ namespace Tegra {
|
||||||
|
|
||||||
CDmaPusher::CDmaPusher(Host1x::Host1x& host1x_, s32 id)
|
CDmaPusher::CDmaPusher(Host1x::Host1x& host1x_, s32 id)
|
||||||
: host1x{host1x_}, memory_manager{host1x.GMMU()},
|
: host1x{host1x_}, memory_manager{host1x.GMMU()},
|
||||||
host_processor{std::make_unique<Host1x::Control>(host1x_)}, current_class{
|
host_processor{std::make_unique<Host1x::Control>(host1x_)},
|
||||||
static_cast<ChClassId>(id)} {
|
current_class{static_cast<ChClassId>(id)} {
|
||||||
thread = std::jthread([this](std::stop_token stop_token) { ProcessEntries(stop_token); });
|
thread = std::jthread([this](std::stop_token stop_token) { ProcessEntries(stop_token); });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ constexpr u32 ComputeInline = 0x6D;
|
||||||
|
|
||||||
DmaPusher::DmaPusher(Core::System& system_, GPU& gpu_, MemoryManager& memory_manager_,
|
DmaPusher::DmaPusher(Core::System& system_, GPU& gpu_, MemoryManager& memory_manager_,
|
||||||
Control::ChannelState& channel_state_)
|
Control::ChannelState& channel_state_)
|
||||||
: gpu{gpu_}, system{system_}, memory_manager{memory_manager_}, puller{gpu_, memory_manager_,
|
: gpu{gpu_}, system{system_}, memory_manager{memory_manager_},
|
||||||
*this, channel_state_} {}
|
puller{gpu_, memory_manager_, *this, channel_state_} {}
|
||||||
|
|
||||||
DmaPusher::~DmaPusher() = default;
|
DmaPusher::~DmaPusher() = default;
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,8 @@ constexpr u32 MacroRegistersStart = 0xE00;
|
||||||
|
|
||||||
Maxwell3D::Maxwell3D(Core::System& system_, MemoryManager& memory_manager_)
|
Maxwell3D::Maxwell3D(Core::System& system_, MemoryManager& memory_manager_)
|
||||||
: draw_manager{std::make_unique<DrawManager>(this)}, system{system_},
|
: draw_manager{std::make_unique<DrawManager>(this)}, system{system_},
|
||||||
memory_manager{memory_manager_}, macro_engine{GetMacroEngine(*this)}, upload_state{
|
memory_manager{memory_manager_}, macro_engine{GetMacroEngine(*this)},
|
||||||
memory_manager,
|
upload_state{memory_manager, regs.upload} {
|
||||||
regs.upload} {
|
|
||||||
dirty.flags.flip();
|
dirty.flags.flip();
|
||||||
InitializeRegisterDefaults();
|
InitializeRegisterDefaults();
|
||||||
execution_mask.reset();
|
execution_mask.reset();
|
||||||
|
|
|
@ -21,8 +21,8 @@ namespace Tegra::Engines {
|
||||||
|
|
||||||
Puller::Puller(GPU& gpu_, MemoryManager& memory_manager_, DmaPusher& dma_pusher_,
|
Puller::Puller(GPU& gpu_, MemoryManager& memory_manager_, DmaPusher& dma_pusher_,
|
||||||
Control::ChannelState& channel_state_)
|
Control::ChannelState& channel_state_)
|
||||||
: gpu{gpu_}, memory_manager{memory_manager_}, dma_pusher{dma_pusher_}, channel_state{
|
: gpu{gpu_}, memory_manager{memory_manager_}, dma_pusher{dma_pusher_},
|
||||||
channel_state_} {}
|
channel_state{channel_state_} {}
|
||||||
|
|
||||||
Puller::~Puller() = default;
|
Puller::~Puller() = default;
|
||||||
|
|
||||||
|
|
4
src/video_core/host1x/codecs/decoder.cpp
Executable file → Normal file
4
src/video_core/host1x/codecs/decoder.cpp
Executable file → Normal file
|
@ -11,8 +11,8 @@ namespace Tegra {
|
||||||
|
|
||||||
Decoder::Decoder(Host1x::Host1x& host1x_, s32 id_, const Host1x::NvdecCommon::NvdecRegisters& regs_,
|
Decoder::Decoder(Host1x::Host1x& host1x_, s32 id_, const Host1x::NvdecCommon::NvdecRegisters& regs_,
|
||||||
Host1x::FrameQueue& frame_queue_)
|
Host1x::FrameQueue& frame_queue_)
|
||||||
: host1x(host1x_), memory_manager{host1x.GMMU()}, regs{regs_}, id{id_}, frame_queue{
|
: host1x(host1x_), memory_manager{host1x.GMMU()}, regs{regs_}, id{id_},
|
||||||
frame_queue_} {}
|
frame_queue{frame_queue_} {}
|
||||||
|
|
||||||
Decoder::~Decoder() = default;
|
Decoder::~Decoder() = default;
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
namespace Tegra::Host1x {
|
namespace Tegra::Host1x {
|
||||||
|
|
||||||
Host1x::Host1x(Core::System& system_)
|
Host1x::Host1x(Core::System& system_)
|
||||||
: system{system_}, syncpoint_manager{},
|
: system{system_}, syncpoint_manager{}, memory_manager(system.DeviceMemory()),
|
||||||
memory_manager(system.DeviceMemory()), gmmu_manager{system, memory_manager, 32, 0, 12},
|
gmmu_manager{system, memory_manager, 32, 0, 12},
|
||||||
allocator{std::make_unique<Common::FlatAllocator<u32, 0, 32>>(1 << 12)} {}
|
allocator{std::make_unique<Common::FlatAllocator<u32, 0, 32>>(1 << 12)} {}
|
||||||
|
|
||||||
Host1x::~Host1x() = default;
|
Host1x::~Host1x() = default;
|
||||||
|
|
|
@ -94,8 +94,8 @@ void SwizzleSurface(std::span<u8> output, u32 out_stride, std::span<const u8> in
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
Vic::Vic(Host1x& host1x_, s32 id_, u32 syncpt, FrameQueue& frame_queue_)
|
Vic::Vic(Host1x& host1x_, s32 id_, u32 syncpt, FrameQueue& frame_queue_)
|
||||||
: CDmaPusher{host1x_, id_}, id{id_}, syncpoint{syncpt},
|
: CDmaPusher{host1x_, id_}, id{id_}, syncpoint{syncpt}, frame_queue{frame_queue_},
|
||||||
frame_queue{frame_queue_}, has_sse41{HasSSE41()} {
|
has_sse41{HasSSE41()} {
|
||||||
LOG_INFO(HW_GPU, "Created vic {}", id);
|
LOG_INFO(HW_GPU, "Created vic {}", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ MemoryManager::MemoryManager(Core::System& system_, MaxwellDeviceMemoryManager&
|
||||||
split_address{split_address_}, page_bits{page_bits_}, big_page_bits{big_page_bits_},
|
split_address{split_address_}, page_bits{page_bits_}, big_page_bits{big_page_bits_},
|
||||||
entries{}, big_entries{}, page_table{address_space_bits, address_space_bits + page_bits - 38,
|
entries{}, big_entries{}, page_table{address_space_bits, address_space_bits + page_bits - 38,
|
||||||
page_bits != big_page_bits ? page_bits : 0},
|
page_bits != big_page_bits ? page_bits : 0},
|
||||||
kind_map{PTEKind::INVALID}, unique_identifier{unique_identifier_generator.fetch_add(
|
kind_map{PTEKind::INVALID},
|
||||||
1, std::memory_order_acq_rel)},
|
unique_identifier{unique_identifier_generator.fetch_add(1, std::memory_order_acq_rel)},
|
||||||
accumulator{std::make_unique<VideoCommon::InvalidationAccumulator>()} {
|
accumulator{std::make_unique<VideoCommon::InvalidationAccumulator>()} {
|
||||||
address_space_size = 1ULL << address_space_bits;
|
address_space_size = 1ULL << address_space_bits;
|
||||||
page_size = 1ULL << page_bits;
|
page_size = 1ULL << page_bits;
|
||||||
|
|
|
@ -115,8 +115,8 @@ struct QueryCacheBase<Traits>::QueryCacheBaseImpl {
|
||||||
QueryCacheBaseImpl(QueryCacheBase<Traits>* owner_, VideoCore::RasterizerInterface& rasterizer_,
|
QueryCacheBaseImpl(QueryCacheBase<Traits>* owner_, VideoCore::RasterizerInterface& rasterizer_,
|
||||||
Tegra::MaxwellDeviceMemoryManager& device_memory_, RuntimeType& runtime_,
|
Tegra::MaxwellDeviceMemoryManager& device_memory_, RuntimeType& runtime_,
|
||||||
Tegra::GPU& gpu_)
|
Tegra::GPU& gpu_)
|
||||||
: owner{owner_}, rasterizer{rasterizer_},
|
: owner{owner_}, rasterizer{rasterizer_}, device_memory{device_memory_}, runtime{runtime_},
|
||||||
device_memory{device_memory_}, runtime{runtime_}, gpu{gpu_} {
|
gpu{gpu_} {
|
||||||
streamer_mask = 0;
|
streamer_mask = 0;
|
||||||
for (size_t i = 0; i < static_cast<size_t>(QueryType::MaxQueryTypes); i++) {
|
for (size_t i = 0; i < static_cast<size_t>(QueryType::MaxQueryTypes); i++) {
|
||||||
streamers[i] = runtime.GetStreamerInterface(static_cast<QueryType>(i));
|
streamers[i] = runtime.GetStreamerInterface(static_cast<QueryType>(i));
|
||||||
|
|
|
@ -31,8 +31,8 @@ ComputePipeline::ComputePipeline(const Device& device, TextureCache& texture_cac
|
||||||
BufferCache& buffer_cache_, ProgramManager& program_manager_,
|
BufferCache& buffer_cache_, ProgramManager& program_manager_,
|
||||||
const Shader::Info& info_, std::string code,
|
const Shader::Info& info_, std::string code,
|
||||||
std::vector<u32> code_v, bool force_context_flush)
|
std::vector<u32> code_v, bool force_context_flush)
|
||||||
: texture_cache{texture_cache_}, buffer_cache{buffer_cache_},
|
: texture_cache{texture_cache_}, buffer_cache{buffer_cache_}, program_manager{program_manager_},
|
||||||
program_manager{program_manager_}, info{info_} {
|
info{info_} {
|
||||||
switch (device.GetShaderBackend()) {
|
switch (device.GetShaderBackend()) {
|
||||||
case Settings::ShaderBackend::Glsl:
|
case Settings::ShaderBackend::Glsl:
|
||||||
source_program = CreateProgram(code, GL_COMPUTE_SHADER);
|
source_program = CreateProgram(code, GL_COMPUTE_SHADER);
|
||||||
|
|
|
@ -66,9 +66,8 @@ bool QueryCache::AnyCommandQueued() const noexcept {
|
||||||
|
|
||||||
HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
|
HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> dependency_,
|
||||||
VideoCore::QueryType type_)
|
VideoCore::QueryType type_)
|
||||||
: HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_}, query{
|
: HostCounterBase{std::move(dependency_)}, cache{cache_}, type{type_},
|
||||||
cache.AllocateQuery(
|
query{cache.AllocateQuery(type)} {
|
||||||
type)} {
|
|
||||||
glBeginQuery(GetTarget(type), query.handle);
|
glBeginQuery(GetTarget(type), query.handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@ using PushConstants = std::array<u32, 4 * 4>;
|
||||||
|
|
||||||
FSR::FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count,
|
FSR::FSR(const Device& device, MemoryAllocator& memory_allocator, size_t image_count,
|
||||||
VkExtent2D extent)
|
VkExtent2D extent)
|
||||||
: m_device{device}, m_memory_allocator{memory_allocator},
|
: m_device{device}, m_memory_allocator{memory_allocator}, m_image_count{image_count},
|
||||||
m_image_count{image_count}, m_extent{extent} {
|
m_extent{extent} {
|
||||||
|
|
||||||
CreateImages();
|
CreateImages();
|
||||||
CreateRenderPasses();
|
CreateRenderPasses();
|
||||||
|
|
|
@ -531,8 +531,8 @@ ASTCDecoderPass::ASTCDecoderPass(const Device& device_, Scheduler& scheduler_,
|
||||||
ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO,
|
ASTC_PASS_DESCRIPTOR_UPDATE_TEMPLATE_ENTRY, ASTC_BANK_INFO,
|
||||||
COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV),
|
COMPUTE_PUSH_CONSTANT_RANGE<sizeof(AstcPushConstants)>, ASTC_DECODER_COMP_SPV),
|
||||||
scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_},
|
scheduler{scheduler_}, staging_buffer_pool{staging_buffer_pool_},
|
||||||
compute_pass_descriptor_queue{compute_pass_descriptor_queue_}, memory_allocator{
|
compute_pass_descriptor_queue{compute_pass_descriptor_queue_},
|
||||||
memory_allocator_} {}
|
memory_allocator{memory_allocator_} {}
|
||||||
|
|
||||||
ASTCDecoderPass::~ASTCDecoderPass() = default;
|
ASTCDecoderPass::~ASTCDecoderPass() = default;
|
||||||
|
|
||||||
|
|
|
@ -31,8 +31,8 @@ ComputePipeline::ComputePipeline(const Device& device_, vk::PipelineCache& pipel
|
||||||
PipelineStatistics* pipeline_statistics,
|
PipelineStatistics* pipeline_statistics,
|
||||||
VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_,
|
VideoCore::ShaderNotify* shader_notify, const Shader::Info& info_,
|
||||||
vk::ShaderModule spv_module_)
|
vk::ShaderModule spv_module_)
|
||||||
: device{device_},
|
: device{device_}, pipeline_cache(pipeline_cache_),
|
||||||
pipeline_cache(pipeline_cache_), guest_descriptor_queue{guest_descriptor_queue_}, info{info_},
|
guest_descriptor_queue{guest_descriptor_queue_}, info{info_},
|
||||||
spv_module(std::move(spv_module_)) {
|
spv_module(std::move(spv_module_)) {
|
||||||
if (shader_notify) {
|
if (shader_notify) {
|
||||||
shader_notify->MarkShaderBuilding();
|
shader_notify->MarkShaderBuilding();
|
||||||
|
|
|
@ -100,8 +100,8 @@ PresentManager::PresentManager(const vk::Instance& instance_,
|
||||||
Swapchain& swapchain_, vk::SurfaceKHR& surface_)
|
Swapchain& swapchain_, vk::SurfaceKHR& surface_)
|
||||||
: instance{instance_}, render_window{render_window_}, device{device_},
|
: instance{instance_}, render_window{render_window_}, device{device_},
|
||||||
memory_allocator{memory_allocator_}, scheduler{scheduler_}, swapchain{swapchain_},
|
memory_allocator{memory_allocator_}, scheduler{scheduler_}, swapchain{swapchain_},
|
||||||
surface{surface_}, blit_supported{CanBlitToSwapchain(device.GetPhysical(),
|
surface{surface_},
|
||||||
swapchain.GetImageViewFormat())},
|
blit_supported{CanBlitToSwapchain(device.GetPhysical(), swapchain.GetImageViewFormat())},
|
||||||
use_present_thread{Settings::values.async_presentation.GetValue()} {
|
use_present_thread{Settings::values.async_presentation.GetValue()} {
|
||||||
SetImageCount();
|
SetImageCount();
|
||||||
|
|
||||||
|
|
|
@ -1161,10 +1161,9 @@ struct QueryCacheRuntimeImpl {
|
||||||
StagingBufferPool& staging_pool_,
|
StagingBufferPool& staging_pool_,
|
||||||
ComputePassDescriptorQueue& compute_pass_descriptor_queue,
|
ComputePassDescriptorQueue& compute_pass_descriptor_queue,
|
||||||
DescriptorPool& descriptor_pool)
|
DescriptorPool& descriptor_pool)
|
||||||
: rasterizer{rasterizer_}, device_memory{device_memory_},
|
: rasterizer{rasterizer_}, device_memory{device_memory_}, buffer_cache{buffer_cache_},
|
||||||
buffer_cache{buffer_cache_}, device{device_},
|
device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_},
|
||||||
memory_allocator{memory_allocator_}, scheduler{scheduler_}, staging_pool{staging_pool_},
|
staging_pool{staging_pool_}, guest_streamer(0, runtime),
|
||||||
guest_streamer(0, runtime),
|
|
||||||
sample_streamer(static_cast<size_t>(QueryType::ZPassPixelCount64), runtime, rasterizer,
|
sample_streamer(static_cast<size_t>(QueryType::ZPassPixelCount64), runtime, rasterizer,
|
||||||
device, scheduler, memory_allocator, compute_pass_descriptor_queue,
|
device, scheduler, memory_allocator, compute_pass_descriptor_queue,
|
||||||
descriptor_pool),
|
descriptor_pool),
|
||||||
|
|
|
@ -49,8 +49,8 @@ size_t GetStreamBufferSize(const Device& device) {
|
||||||
StagingBufferPool::StagingBufferPool(const Device& device_, MemoryAllocator& memory_allocator_,
|
StagingBufferPool::StagingBufferPool(const Device& device_, MemoryAllocator& memory_allocator_,
|
||||||
Scheduler& scheduler_)
|
Scheduler& scheduler_)
|
||||||
: device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_},
|
: device{device_}, memory_allocator{memory_allocator_}, scheduler{scheduler_},
|
||||||
stream_buffer_size{GetStreamBufferSize(device)}, region_size{stream_buffer_size /
|
stream_buffer_size{GetStreamBufferSize(device)},
|
||||||
StagingBufferPool::NUM_SYNCS} {
|
region_size{stream_buffer_size / StagingBufferPool::NUM_SYNCS} {
|
||||||
VkBufferCreateInfo stream_ci = {
|
VkBufferCreateInfo stream_ci = {
|
||||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||||
.pNext = nullptr,
|
.pNext = nullptr,
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue