diff options
Diffstat (limited to 'src/core')
37 files changed, 438 insertions, 65 deletions
diff --git a/src/core/crypto/partition_data_manager.cpp b/src/core/crypto/partition_data_manager.cpp index d64302f2e..7ed71ac3a 100644 --- a/src/core/crypto/partition_data_manager.cpp +++ b/src/core/crypto/partition_data_manager.cpp | |||
| @@ -202,8 +202,8 @@ static std::array<Key128, 0x20> FindEncryptedMasterKeyFromHex(const std::vector< | |||
| 202 | return out; | 202 | return out; |
| 203 | } | 203 | } |
| 204 | 204 | ||
| 205 | FileSys::VirtualFile FindFileInDirWithNames(const FileSys::VirtualDir& dir, | 205 | static FileSys::VirtualFile FindFileInDirWithNames(const FileSys::VirtualDir& dir, |
| 206 | const std::string& name) { | 206 | const std::string& name) { |
| 207 | const auto upper = Common::ToUpper(name); | 207 | const auto upper = Common::ToUpper(name); |
| 208 | 208 | ||
| 209 | for (const auto& fname : {name, name + ".bin", upper, upper + ".BIN"}) { | 209 | for (const auto& fname : {name, name + ".bin", upper, upper + ".BIN"}) { |
| @@ -345,8 +345,7 @@ FileSys::VirtualFile PartitionDataManager::GetPackage2Raw(Package2Type type) con | |||
| 345 | return package2.at(static_cast<size_t>(type)); | 345 | return package2.at(static_cast<size_t>(type)); |
| 346 | } | 346 | } |
| 347 | 347 | ||
| 348 | bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header) { | 348 | static bool AttemptDecrypt(const std::array<u8, 16>& key, Package2Header& header) { |
| 349 | |||
| 350 | const std::vector<u8> iv(header.header_ctr.begin(), header.header_ctr.end()); | 349 | const std::vector<u8> iv(header.header_ctr.begin(), header.header_ctr.end()); |
| 351 | Package2Header temp = header; | 350 | Package2Header temp = header; |
| 352 | AESCipher<Key128> cipher(key, Mode::CTR); | 351 | AESCipher<Key128> cipher(key, Mode::CTR); |
diff --git a/src/core/gdbstub/gdbstub.cpp b/src/core/gdbstub/gdbstub.cpp index 2f15635c5..70c0f8b80 100644 --- a/src/core/gdbstub/gdbstub.cpp +++ b/src/core/gdbstub/gdbstub.cpp | |||
| @@ -1389,10 +1389,9 @@ void SendTrap(Kernel::Thread* thread, int trap) { | |||
| 1389 | return; | 1389 | return; |
| 1390 | } | 1390 | } |
| 1391 | 1391 | ||
| 1392 | if (!halt_loop || current_thread == thread) { | 1392 | current_thread = thread; |
| 1393 | current_thread = thread; | 1393 | SendSignal(thread, trap); |
| 1394 | SendSignal(thread, trap); | 1394 | |
| 1395 | } | ||
| 1396 | halt_loop = true; | 1395 | halt_loop = true; |
| 1397 | send_trap = false; | 1396 | send_trap = false; |
| 1398 | } | 1397 | } |
diff --git a/src/core/hle/kernel/memory/memory_block.h b/src/core/hle/kernel/memory/memory_block.h index e11043b60..9db1f7b39 100644 --- a/src/core/hle/kernel/memory/memory_block.h +++ b/src/core/hle/kernel/memory/memory_block.h | |||
| @@ -17,7 +17,7 @@ namespace Kernel::Memory { | |||
| 17 | 17 | ||
| 18 | enum class MemoryState : u32 { | 18 | enum class MemoryState : u32 { |
| 19 | None = 0, | 19 | None = 0, |
| 20 | Mask = 0xFFFFFFFF, // TODO(bunnei): This should probable be 0xFF | 20 | Mask = 0xFF, |
| 21 | All = ~None, | 21 | All = ~None, |
| 22 | 22 | ||
| 23 | FlagCanReprotect = (1 << 8), | 23 | FlagCanReprotect = (1 << 8), |
| @@ -253,6 +253,23 @@ public: | |||
| 253 | }; | 253 | }; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | void ShareToDevice(MemoryPermission /*new_perm*/) { | ||
| 257 | ASSERT((attribute & MemoryAttribute::DeviceShared) == MemoryAttribute::DeviceShared || | ||
| 258 | device_use_count == 0); | ||
| 259 | attribute |= MemoryAttribute::DeviceShared; | ||
| 260 | const u16 new_use_count{++device_use_count}; | ||
| 261 | ASSERT(new_use_count > 0); | ||
| 262 | } | ||
| 263 | |||
| 264 | void UnshareToDevice(MemoryPermission /*new_perm*/) { | ||
| 265 | ASSERT((attribute & MemoryAttribute::DeviceShared) == MemoryAttribute::DeviceShared); | ||
| 266 | const u16 prev_use_count{device_use_count--}; | ||
| 267 | ASSERT(prev_use_count > 0); | ||
| 268 | if (prev_use_count == 1) { | ||
| 269 | attribute &= ~MemoryAttribute::DeviceShared; | ||
| 270 | } | ||
| 271 | } | ||
| 272 | |||
| 256 | private: | 273 | private: |
| 257 | constexpr bool HasProperties(MemoryState s, MemoryPermission p, MemoryAttribute a) const { | 274 | constexpr bool HasProperties(MemoryState s, MemoryPermission p, MemoryAttribute a) const { |
| 258 | constexpr MemoryAttribute AttributeIgnoreMask{MemoryAttribute::DontCareMask | | 275 | constexpr MemoryAttribute AttributeIgnoreMask{MemoryAttribute::DontCareMask | |
| @@ -287,9 +304,9 @@ private: | |||
| 287 | state = new_state; | 304 | state = new_state; |
| 288 | perm = new_perm; | 305 | perm = new_perm; |
| 289 | 306 | ||
| 290 | // TODO(bunnei): Is this right? | ||
| 291 | attribute = static_cast<MemoryAttribute>( | 307 | attribute = static_cast<MemoryAttribute>( |
| 292 | new_attribute /*| (attribute & (MemoryAttribute::IpcLocked | MemoryAttribute::DeviceShared))*/); | 308 | new_attribute | |
| 309 | (attribute & (MemoryAttribute::IpcLocked | MemoryAttribute::DeviceShared))); | ||
| 293 | } | 310 | } |
| 294 | 311 | ||
| 295 | constexpr MemoryBlock Split(VAddr split_addr) { | 312 | constexpr MemoryBlock Split(VAddr split_addr) { |
diff --git a/src/core/hle/kernel/memory/memory_block_manager.cpp b/src/core/hle/kernel/memory/memory_block_manager.cpp index 1ebc126c0..900395c37 100644 --- a/src/core/hle/kernel/memory/memory_block_manager.cpp +++ b/src/core/hle/kernel/memory/memory_block_manager.cpp | |||
| @@ -143,6 +143,42 @@ void MemoryBlockManager::Update(VAddr addr, std::size_t num_pages, MemoryState s | |||
| 143 | } | 143 | } |
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | void MemoryBlockManager::UpdateLock(VAddr addr, std::size_t num_pages, LockFunc&& lock_func, | ||
| 147 | MemoryPermission perm) { | ||
| 148 | const std::size_t prev_count{memory_block_tree.size()}; | ||
| 149 | const VAddr end_addr{addr + num_pages * PageSize}; | ||
| 150 | iterator node{memory_block_tree.begin()}; | ||
| 151 | |||
| 152 | while (node != memory_block_tree.end()) { | ||
| 153 | MemoryBlock* block{&(*node)}; | ||
| 154 | iterator next_node{std::next(node)}; | ||
| 155 | const VAddr cur_addr{block->GetAddress()}; | ||
| 156 | const VAddr cur_end_addr{block->GetNumPages() * PageSize + cur_addr}; | ||
| 157 | |||
| 158 | if (addr < cur_end_addr && cur_addr < end_addr) { | ||
| 159 | iterator new_node{node}; | ||
| 160 | |||
| 161 | if (addr > cur_addr) { | ||
| 162 | memory_block_tree.insert(node, block->Split(addr)); | ||
| 163 | } | ||
| 164 | |||
| 165 | if (end_addr < cur_end_addr) { | ||
| 166 | new_node = memory_block_tree.insert(node, block->Split(end_addr)); | ||
| 167 | } | ||
| 168 | |||
| 169 | lock_func(new_node, perm); | ||
| 170 | |||
| 171 | MergeAdjacent(new_node, next_node); | ||
| 172 | } | ||
| 173 | |||
| 174 | if (cur_end_addr - 1 >= end_addr - 1) { | ||
| 175 | break; | ||
| 176 | } | ||
| 177 | |||
| 178 | node = next_node; | ||
| 179 | } | ||
| 180 | } | ||
| 181 | |||
| 146 | void MemoryBlockManager::IterateForRange(VAddr start, VAddr end, IterateFunc&& func) { | 182 | void MemoryBlockManager::IterateForRange(VAddr start, VAddr end, IterateFunc&& func) { |
| 147 | const_iterator it{FindIterator(start)}; | 183 | const_iterator it{FindIterator(start)}; |
| 148 | MemoryInfo info{}; | 184 | MemoryInfo info{}; |
diff --git a/src/core/hle/kernel/memory/memory_block_manager.h b/src/core/hle/kernel/memory/memory_block_manager.h index 0f2270f0f..9451b5df6 100644 --- a/src/core/hle/kernel/memory/memory_block_manager.h +++ b/src/core/hle/kernel/memory/memory_block_manager.h | |||
| @@ -45,6 +45,9 @@ public: | |||
| 45 | MemoryPermission perm = MemoryPermission::None, | 45 | MemoryPermission perm = MemoryPermission::None, |
| 46 | MemoryAttribute attribute = MemoryAttribute::None); | 46 | MemoryAttribute attribute = MemoryAttribute::None); |
| 47 | 47 | ||
| 48 | using LockFunc = std::function<void(iterator, MemoryPermission)>; | ||
| 49 | void UpdateLock(VAddr addr, std::size_t num_pages, LockFunc&& lock_func, MemoryPermission perm); | ||
| 50 | |||
| 48 | using IterateFunc = std::function<void(const MemoryInfo&)>; | 51 | using IterateFunc = std::function<void(const MemoryInfo&)>; |
| 49 | void IterateForRange(VAddr start, VAddr end, IterateFunc&& func); | 52 | void IterateForRange(VAddr start, VAddr end, IterateFunc&& func); |
| 50 | 53 | ||
diff --git a/src/core/hle/kernel/memory/page_table.cpp b/src/core/hle/kernel/memory/page_table.cpp index 091e52ca4..3281611f8 100644 --- a/src/core/hle/kernel/memory/page_table.cpp +++ b/src/core/hle/kernel/memory/page_table.cpp | |||
| @@ -840,6 +840,50 @@ ResultVal<VAddr> PageTable::AllocateAndMapMemory(std::size_t needed_num_pages, s | |||
| 840 | return MakeResult<VAddr>(addr); | 840 | return MakeResult<VAddr>(addr); |
| 841 | } | 841 | } |
| 842 | 842 | ||
| 843 | ResultCode PageTable::LockForDeviceAddressSpace(VAddr addr, std::size_t size) { | ||
| 844 | std::lock_guard lock{page_table_lock}; | ||
| 845 | |||
| 846 | MemoryPermission perm{}; | ||
| 847 | if (const ResultCode result{CheckMemoryState( | ||
| 848 | nullptr, &perm, nullptr, addr, size, MemoryState::FlagCanChangeAttribute, | ||
| 849 | MemoryState::FlagCanChangeAttribute, MemoryPermission::None, MemoryPermission::None, | ||
| 850 | MemoryAttribute::LockedAndIpcLocked, MemoryAttribute::None, | ||
| 851 | MemoryAttribute::DeviceSharedAndUncached)}; | ||
| 852 | result.IsError()) { | ||
| 853 | return result; | ||
| 854 | } | ||
| 855 | |||
| 856 | block_manager->UpdateLock(addr, size / PageSize, | ||
| 857 | [](MemoryBlockManager::iterator block, MemoryPermission perm) { | ||
| 858 | block->ShareToDevice(perm); | ||
| 859 | }, | ||
| 860 | perm); | ||
| 861 | |||
| 862 | return RESULT_SUCCESS; | ||
| 863 | } | ||
| 864 | |||
| 865 | ResultCode PageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size) { | ||
| 866 | std::lock_guard lock{page_table_lock}; | ||
| 867 | |||
| 868 | MemoryPermission perm{}; | ||
| 869 | if (const ResultCode result{CheckMemoryState( | ||
| 870 | nullptr, &perm, nullptr, addr, size, MemoryState::FlagCanChangeAttribute, | ||
| 871 | MemoryState::FlagCanChangeAttribute, MemoryPermission::None, MemoryPermission::None, | ||
| 872 | MemoryAttribute::LockedAndIpcLocked, MemoryAttribute::None, | ||
| 873 | MemoryAttribute::DeviceSharedAndUncached)}; | ||
| 874 | result.IsError()) { | ||
| 875 | return result; | ||
| 876 | } | ||
| 877 | |||
| 878 | block_manager->UpdateLock(addr, size / PageSize, | ||
| 879 | [](MemoryBlockManager::iterator block, MemoryPermission perm) { | ||
| 880 | block->UnshareToDevice(perm); | ||
| 881 | }, | ||
| 882 | perm); | ||
| 883 | |||
| 884 | return RESULT_SUCCESS; | ||
| 885 | } | ||
| 886 | |||
| 843 | ResultCode PageTable::InitializeMemoryLayout(VAddr start, VAddr end) { | 887 | ResultCode PageTable::InitializeMemoryLayout(VAddr start, VAddr end) { |
| 844 | block_manager = std::make_unique<MemoryBlockManager>(start, end); | 888 | block_manager = std::make_unique<MemoryBlockManager>(start, end); |
| 845 | 889 | ||
diff --git a/src/core/hle/kernel/memory/page_table.h b/src/core/hle/kernel/memory/page_table.h index 80384ab0f..a867aa050 100644 --- a/src/core/hle/kernel/memory/page_table.h +++ b/src/core/hle/kernel/memory/page_table.h | |||
| @@ -53,6 +53,8 @@ public: | |||
| 53 | bool is_map_only, VAddr region_start, | 53 | bool is_map_only, VAddr region_start, |
| 54 | std::size_t region_num_pages, MemoryState state, | 54 | std::size_t region_num_pages, MemoryState state, |
| 55 | MemoryPermission perm, PAddr map_addr = 0); | 55 | MemoryPermission perm, PAddr map_addr = 0); |
| 56 | ResultCode LockForDeviceAddressSpace(VAddr addr, std::size_t size); | ||
| 57 | ResultCode UnlockForDeviceAddressSpace(VAddr addr, std::size_t size); | ||
| 56 | 58 | ||
| 57 | Common::PageTable& PageTableImpl() { | 59 | Common::PageTable& PageTableImpl() { |
| 58 | return page_table_impl; | 60 | return page_table_impl; |
diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index c67696757..0cd467110 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp | |||
| @@ -36,22 +36,22 @@ std::shared_ptr<SharedMemory> SharedMemory::Create( | |||
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | ResultCode SharedMemory::Map(Process& target_process, VAddr address, std::size_t size, | 38 | ResultCode SharedMemory::Map(Process& target_process, VAddr address, std::size_t size, |
| 39 | Memory::MemoryPermission permission) { | 39 | Memory::MemoryPermission permissions) { |
| 40 | const u64 page_count{(size + Memory::PageSize - 1) / Memory::PageSize}; | 40 | const u64 page_count{(size + Memory::PageSize - 1) / Memory::PageSize}; |
| 41 | 41 | ||
| 42 | if (page_list.GetNumPages() != page_count) { | 42 | if (page_list.GetNumPages() != page_count) { |
| 43 | UNIMPLEMENTED_MSG("Page count does not match"); | 43 | UNIMPLEMENTED_MSG("Page count does not match"); |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | Memory::MemoryPermission expected = | 46 | const Memory::MemoryPermission expected = |
| 47 | &target_process == owner_process ? owner_permission : user_permission; | 47 | &target_process == owner_process ? owner_permission : user_permission; |
| 48 | 48 | ||
| 49 | if (permission != expected) { | 49 | if (permissions != expected) { |
| 50 | UNIMPLEMENTED_MSG("Permission does not match"); | 50 | UNIMPLEMENTED_MSG("Permission does not match"); |
| 51 | } | 51 | } |
| 52 | 52 | ||
| 53 | return target_process.PageTable().MapPages(address, page_list, Memory::MemoryState::Shared, | 53 | return target_process.PageTable().MapPages(address, page_list, Memory::MemoryState::Shared, |
| 54 | permission); | 54 | permissions); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | } // namespace Kernel | 57 | } // namespace Kernel |
diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index cd16d6412..0ef87235c 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h | |||
| @@ -51,7 +51,7 @@ public: | |||
| 51 | * @param permissions Memory block map permissions (specified by SVC field) | 51 | * @param permissions Memory block map permissions (specified by SVC field) |
| 52 | */ | 52 | */ |
| 53 | ResultCode Map(Process& target_process, VAddr address, std::size_t size, | 53 | ResultCode Map(Process& target_process, VAddr address, std::size_t size, |
| 54 | Memory::MemoryPermission permission); | 54 | Memory::MemoryPermission permissions); |
| 55 | 55 | ||
| 56 | /** | 56 | /** |
| 57 | * Gets a pointer to the shared memory block | 57 | * Gets a pointer to the shared memory block |
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index 4134acf65..25b4a23b4 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp | |||
| @@ -55,9 +55,6 @@ constexpr bool IsValidAddressRange(VAddr address, u64 size) { | |||
| 55 | return address + size > address; | 55 | return address + size > address; |
| 56 | } | 56 | } |
| 57 | 57 | ||
| 58 | // 8 GiB | ||
| 59 | constexpr u64 MAIN_MEMORY_SIZE = 0x200000000; | ||
| 60 | |||
| 61 | // Helper function that performs the common sanity checks for svcMapMemory | 58 | // Helper function that performs the common sanity checks for svcMapMemory |
| 62 | // and svcUnmapMemory. This is doable, as both functions perform their sanitizing | 59 | // and svcUnmapMemory. This is doable, as both functions perform their sanitizing |
| 63 | // in the same order. | 60 | // in the same order. |
| @@ -1229,6 +1226,142 @@ static ResultCode QueryMemory32(Core::System& system, u32 memory_info_address, | |||
| 1229 | return QueryMemory(system, memory_info_address, page_info_address, query_address); | 1226 | return QueryMemory(system, memory_info_address, page_info_address, query_address); |
| 1230 | } | 1227 | } |
| 1231 | 1228 | ||
| 1229 | static ResultCode MapProcessCodeMemory(Core::System& system, Handle process_handle, u64 dst_address, | ||
| 1230 | u64 src_address, u64 size) { | ||
| 1231 | LOG_DEBUG(Kernel_SVC, | ||
| 1232 | "called. process_handle=0x{:08X}, dst_address=0x{:016X}, " | ||
| 1233 | "src_address=0x{:016X}, size=0x{:016X}", | ||
| 1234 | process_handle, dst_address, src_address, size); | ||
| 1235 | |||
| 1236 | if (!Common::Is4KBAligned(src_address)) { | ||
| 1237 | LOG_ERROR(Kernel_SVC, "src_address is not page-aligned (src_address=0x{:016X}).", | ||
| 1238 | src_address); | ||
| 1239 | return ERR_INVALID_ADDRESS; | ||
| 1240 | } | ||
| 1241 | |||
| 1242 | if (!Common::Is4KBAligned(dst_address)) { | ||
| 1243 | LOG_ERROR(Kernel_SVC, "dst_address is not page-aligned (dst_address=0x{:016X}).", | ||
| 1244 | dst_address); | ||
| 1245 | return ERR_INVALID_ADDRESS; | ||
| 1246 | } | ||
| 1247 | |||
| 1248 | if (size == 0 || !Common::Is4KBAligned(size)) { | ||
| 1249 | LOG_ERROR(Kernel_SVC, "Size is zero or not page-aligned (size=0x{:016X})", size); | ||
| 1250 | return ERR_INVALID_SIZE; | ||
| 1251 | } | ||
| 1252 | |||
| 1253 | if (!IsValidAddressRange(dst_address, size)) { | ||
| 1254 | LOG_ERROR(Kernel_SVC, | ||
| 1255 | "Destination address range overflows the address space (dst_address=0x{:016X}, " | ||
| 1256 | "size=0x{:016X}).", | ||
| 1257 | dst_address, size); | ||
| 1258 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1259 | } | ||
| 1260 | |||
| 1261 | if (!IsValidAddressRange(src_address, size)) { | ||
| 1262 | LOG_ERROR(Kernel_SVC, | ||
| 1263 | "Source address range overflows the address space (src_address=0x{:016X}, " | ||
| 1264 | "size=0x{:016X}).", | ||
| 1265 | src_address, size); | ||
| 1266 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1267 | } | ||
| 1268 | |||
| 1269 | const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); | ||
| 1270 | auto process = handle_table.Get<Process>(process_handle); | ||
| 1271 | if (!process) { | ||
| 1272 | LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).", | ||
| 1273 | process_handle); | ||
| 1274 | return ERR_INVALID_HANDLE; | ||
| 1275 | } | ||
| 1276 | |||
| 1277 | auto& page_table = process->PageTable(); | ||
| 1278 | if (!page_table.IsInsideAddressSpace(src_address, size)) { | ||
| 1279 | LOG_ERROR(Kernel_SVC, | ||
| 1280 | "Source address range is not within the address space (src_address=0x{:016X}, " | ||
| 1281 | "size=0x{:016X}).", | ||
| 1282 | src_address, size); | ||
| 1283 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1284 | } | ||
| 1285 | |||
| 1286 | if (!page_table.IsInsideASLRRegion(dst_address, size)) { | ||
| 1287 | LOG_ERROR(Kernel_SVC, | ||
| 1288 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " | ||
| 1289 | "size=0x{:016X}).", | ||
| 1290 | dst_address, size); | ||
| 1291 | return ERR_INVALID_MEMORY_RANGE; | ||
| 1292 | } | ||
| 1293 | |||
| 1294 | return page_table.MapProcessCodeMemory(dst_address, src_address, size); | ||
| 1295 | } | ||
| 1296 | |||
| 1297 | static ResultCode UnmapProcessCodeMemory(Core::System& system, Handle process_handle, | ||
| 1298 | u64 dst_address, u64 src_address, u64 size) { | ||
| 1299 | LOG_DEBUG(Kernel_SVC, | ||
| 1300 | "called. process_handle=0x{:08X}, dst_address=0x{:016X}, src_address=0x{:016X}, " | ||
| 1301 | "size=0x{:016X}", | ||
| 1302 | process_handle, dst_address, src_address, size); | ||
| 1303 | |||
| 1304 | if (!Common::Is4KBAligned(dst_address)) { | ||
| 1305 | LOG_ERROR(Kernel_SVC, "dst_address is not page-aligned (dst_address=0x{:016X}).", | ||
| 1306 | dst_address); | ||
| 1307 | return ERR_INVALID_ADDRESS; | ||
| 1308 | } | ||
| 1309 | |||
| 1310 | if (!Common::Is4KBAligned(src_address)) { | ||
| 1311 | LOG_ERROR(Kernel_SVC, "src_address is not page-aligned (src_address=0x{:016X}).", | ||
| 1312 | src_address); | ||
| 1313 | return ERR_INVALID_ADDRESS; | ||
| 1314 | } | ||
| 1315 | |||
| 1316 | if (size == 0 || Common::Is4KBAligned(size)) { | ||
| 1317 | LOG_ERROR(Kernel_SVC, "Size is zero or not page-aligned (size=0x{:016X}).", size); | ||
| 1318 | return ERR_INVALID_SIZE; | ||
| 1319 | } | ||
| 1320 | |||
| 1321 | if (!IsValidAddressRange(dst_address, size)) { | ||
| 1322 | LOG_ERROR(Kernel_SVC, | ||
| 1323 | "Destination address range overflows the address space (dst_address=0x{:016X}, " | ||
| 1324 | "size=0x{:016X}).", | ||
| 1325 | dst_address, size); | ||
| 1326 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1327 | } | ||
| 1328 | |||
| 1329 | if (!IsValidAddressRange(src_address, size)) { | ||
| 1330 | LOG_ERROR(Kernel_SVC, | ||
| 1331 | "Source address range overflows the address space (src_address=0x{:016X}, " | ||
| 1332 | "size=0x{:016X}).", | ||
| 1333 | src_address, size); | ||
| 1334 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1335 | } | ||
| 1336 | |||
| 1337 | const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); | ||
| 1338 | auto process = handle_table.Get<Process>(process_handle); | ||
| 1339 | if (!process) { | ||
| 1340 | LOG_ERROR(Kernel_SVC, "Invalid process handle specified (handle=0x{:08X}).", | ||
| 1341 | process_handle); | ||
| 1342 | return ERR_INVALID_HANDLE; | ||
| 1343 | } | ||
| 1344 | |||
| 1345 | auto& page_table = process->PageTable(); | ||
| 1346 | if (!page_table.IsInsideAddressSpace(src_address, size)) { | ||
| 1347 | LOG_ERROR(Kernel_SVC, | ||
| 1348 | "Source address range is not within the address space (src_address=0x{:016X}, " | ||
| 1349 | "size=0x{:016X}).", | ||
| 1350 | src_address, size); | ||
| 1351 | return ERR_INVALID_ADDRESS_STATE; | ||
| 1352 | } | ||
| 1353 | |||
| 1354 | if (!page_table.IsInsideASLRRegion(dst_address, size)) { | ||
| 1355 | LOG_ERROR(Kernel_SVC, | ||
| 1356 | "Destination address range is not within the ASLR region (dst_address=0x{:016X}, " | ||
| 1357 | "size=0x{:016X}).", | ||
| 1358 | dst_address, size); | ||
| 1359 | return ERR_INVALID_MEMORY_RANGE; | ||
| 1360 | } | ||
| 1361 | |||
| 1362 | return page_table.UnmapProcessCodeMemory(dst_address, src_address, size); | ||
| 1363 | } | ||
| 1364 | |||
| 1232 | /// Exits the current process | 1365 | /// Exits the current process |
| 1233 | static void ExitProcess(Core::System& system) { | 1366 | static void ExitProcess(Core::System& system) { |
| 1234 | auto* current_process = system.Kernel().CurrentProcess(); | 1367 | auto* current_process = system.Kernel().CurrentProcess(); |
| @@ -2256,8 +2389,8 @@ static const FunctionDef SVC_Table_64[] = { | |||
| 2256 | {0x74, nullptr, "MapProcessMemory"}, | 2389 | {0x74, nullptr, "MapProcessMemory"}, |
| 2257 | {0x75, nullptr, "UnmapProcessMemory"}, | 2390 | {0x75, nullptr, "UnmapProcessMemory"}, |
| 2258 | {0x76, SvcWrap64<QueryProcessMemory>, "QueryProcessMemory"}, | 2391 | {0x76, SvcWrap64<QueryProcessMemory>, "QueryProcessMemory"}, |
| 2259 | {0x77, nullptr, "MapProcessCodeMemory"}, | 2392 | {0x77, SvcWrap64<MapProcessCodeMemory>, "MapProcessCodeMemory"}, |
| 2260 | {0x78, nullptr, "UnmapProcessCodeMemory"}, | 2393 | {0x78, SvcWrap64<UnmapProcessCodeMemory>, "UnmapProcessCodeMemory"}, |
| 2261 | {0x79, nullptr, "CreateProcess"}, | 2394 | {0x79, nullptr, "CreateProcess"}, |
| 2262 | {0x7A, nullptr, "StartProcess"}, | 2395 | {0x7A, nullptr, "StartProcess"}, |
| 2263 | {0x7B, nullptr, "TerminateProcess"}, | 2396 | {0x7B, nullptr, "TerminateProcess"}, |
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 4c0451c01..a919750a6 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -150,8 +150,7 @@ static void ResetThreadContext64(Core::ARM_Interface::ThreadContext64& context, | |||
| 150 | context.pc = entry_point; | 150 | context.pc = entry_point; |
| 151 | context.sp = stack_top; | 151 | context.sp = stack_top; |
| 152 | // TODO(merry): Perform a hardware test to determine the below value. | 152 | // TODO(merry): Perform a hardware test to determine the below value. |
| 153 | // AHP = 0, DN = 1, FTZ = 1, RMode = Round towards zero | 153 | context.fpcr = 0; |
| 154 | context.fpcr = 0x03C00000; | ||
| 155 | } | 154 | } |
| 156 | 155 | ||
| 157 | ResultVal<std::shared_ptr<Thread>> Thread::Create(KernelCore& kernel, std::string name, | 156 | ResultVal<std::shared_ptr<Thread>> Thread::Create(KernelCore& kernel, std::string name, |
diff --git a/src/core/hle/service/acc/acc_su.cpp b/src/core/hle/service/acc/acc_su.cpp index b941c260b..ae88deda5 100644 --- a/src/core/hle/service/acc/acc_su.cpp +++ b/src/core/hle/service/acc/acc_su.cpp | |||
| @@ -33,8 +33,10 @@ ACC_SU::ACC_SU(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p | |||
| 33 | {111, nullptr, "ClearSaveDataThumbnail"}, | 33 | {111, nullptr, "ClearSaveDataThumbnail"}, |
| 34 | {112, nullptr, "LoadSaveDataThumbnail"}, | 34 | {112, nullptr, "LoadSaveDataThumbnail"}, |
| 35 | {113, nullptr, "GetSaveDataThumbnailExistence"}, | 35 | {113, nullptr, "GetSaveDataThumbnailExistence"}, |
| 36 | {120, nullptr, "ListOpenUsersInApplication"}, | ||
| 36 | {130, nullptr, "ActivateOpenContextRetention"}, | 37 | {130, nullptr, "ActivateOpenContextRetention"}, |
| 37 | {140, nullptr, "ListQualifiedUsers"}, | 38 | {140, nullptr, "ListQualifiedUsers"}, |
| 39 | {150, nullptr, "AuthenticateApplicationAsync"}, | ||
| 38 | {190, nullptr, "GetUserLastOpenedApplication"}, | 40 | {190, nullptr, "GetUserLastOpenedApplication"}, |
| 39 | {191, nullptr, "ActivateOpenContextHolder"}, | 41 | {191, nullptr, "ActivateOpenContextHolder"}, |
| 40 | {200, nullptr, "BeginUserRegistration"}, | 42 | {200, nullptr, "BeginUserRegistration"}, |
diff --git a/src/core/hle/service/acc/acc_u1.cpp b/src/core/hle/service/acc/acc_u1.cpp index 858e91dde..2b9c11928 100644 --- a/src/core/hle/service/acc/acc_u1.cpp +++ b/src/core/hle/service/acc/acc_u1.cpp | |||
| @@ -35,6 +35,7 @@ ACC_U1::ACC_U1(std::shared_ptr<Module> module, std::shared_ptr<ProfileManager> p | |||
| 35 | {113, nullptr, "GetSaveDataThumbnailExistence"}, | 35 | {113, nullptr, "GetSaveDataThumbnailExistence"}, |
| 36 | {130, nullptr, "ActivateOpenContextRetention"}, | 36 | {130, nullptr, "ActivateOpenContextRetention"}, |
| 37 | {140, nullptr, "ListQualifiedUsers"}, | 37 | {140, nullptr, "ListQualifiedUsers"}, |
| 38 | {150, nullptr, "AuthenticateApplicationAsync"}, | ||
| 38 | {190, nullptr, "GetUserLastOpenedApplication"}, | 39 | {190, nullptr, "GetUserLastOpenedApplication"}, |
| 39 | {191, nullptr, "ActivateOpenContextHolder"}, | 40 | {191, nullptr, "ActivateOpenContextHolder"}, |
| 40 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, | 41 | {997, nullptr, "DebugInvalidateTokenCacheForUser"}, |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 3ece2cf3c..bee4a9d3f 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -235,6 +235,7 @@ IDebugFunctions::IDebugFunctions() : ServiceFramework{"IDebugFunctions"} { | |||
| 235 | {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, | 235 | {30, nullptr, "RequestLaunchApplicationWithUserAndArgumentForDebug"}, |
| 236 | {40, nullptr, "GetAppletResourceUsageInfo"}, | 236 | {40, nullptr, "GetAppletResourceUsageInfo"}, |
| 237 | {100, nullptr, "SetCpuBoostModeForApplet"}, | 237 | {100, nullptr, "SetCpuBoostModeForApplet"}, |
| 238 | {101, nullptr, "CancelCpuBoostModeForApplet"}, | ||
| 238 | {110, nullptr, "PushToAppletBoundChannelForDebug"}, | 239 | {110, nullptr, "PushToAppletBoundChannelForDebug"}, |
| 239 | {111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, | 240 | {111, nullptr, "TryPopFromAppletBoundChannelForDebug"}, |
| 240 | {120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, | 241 | {120, nullptr, "AlarmSettingNotificationEnableAppEventReserve"}, |
| @@ -277,6 +278,8 @@ ISelfController::ISelfController(Core::System& system, | |||
| 277 | {41, nullptr, "IsSystemBufferSharingEnabled"}, | 278 | {41, nullptr, "IsSystemBufferSharingEnabled"}, |
| 278 | {42, nullptr, "GetSystemSharedLayerHandle"}, | 279 | {42, nullptr, "GetSystemSharedLayerHandle"}, |
| 279 | {43, nullptr, "GetSystemSharedBufferHandle"}, | 280 | {43, nullptr, "GetSystemSharedBufferHandle"}, |
| 281 | {44, nullptr, "CreateManagedDisplaySeparableLayer"}, | ||
| 282 | {45, nullptr, "SetManagedDisplayLayerSeparationMode"}, | ||
| 280 | {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"}, | 283 | {50, &ISelfController::SetHandlesRequestToDisplay, "SetHandlesRequestToDisplay"}, |
| 281 | {51, nullptr, "ApproveToDisplay"}, | 284 | {51, nullptr, "ApproveToDisplay"}, |
| 282 | {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"}, | 285 | {60, nullptr, "OverrideAutoSleepTimeAndDimmingTime"}, |
| @@ -623,11 +626,15 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system, | |||
| 623 | {64, nullptr, "SetTvPowerStateMatchingMode"}, | 626 | {64, nullptr, "SetTvPowerStateMatchingMode"}, |
| 624 | {65, nullptr, "GetApplicationIdByContentActionName"}, | 627 | {65, nullptr, "GetApplicationIdByContentActionName"}, |
| 625 | {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, | 628 | {66, &ICommonStateGetter::SetCpuBoostMode, "SetCpuBoostMode"}, |
| 629 | {67, nullptr, "CancelCpuBoostMode"}, | ||
| 626 | {80, nullptr, "PerformSystemButtonPressingIfInFocus"}, | 630 | {80, nullptr, "PerformSystemButtonPressingIfInFocus"}, |
| 627 | {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, | 631 | {90, nullptr, "SetPerformanceConfigurationChangedNotification"}, |
| 628 | {91, nullptr, "GetCurrentPerformanceConfiguration"}, | 632 | {91, nullptr, "GetCurrentPerformanceConfiguration"}, |
| 633 | {100, nullptr, "SetHandlingHomeButtonShortPressedEnabled"}, | ||
| 629 | {200, nullptr, "GetOperationModeSystemInfo"}, | 634 | {200, nullptr, "GetOperationModeSystemInfo"}, |
| 630 | {300, nullptr, "GetSettingsPlatformRegion"}, | 635 | {300, nullptr, "GetSettingsPlatformRegion"}, |
| 636 | {400, nullptr, "ActivateMigrationService"}, | ||
| 637 | {401, nullptr, "DeactivateMigrationService"}, | ||
| 631 | }; | 638 | }; |
| 632 | // clang-format on | 639 | // clang-format on |
| 633 | 640 | ||
| @@ -835,6 +842,7 @@ public: | |||
| 835 | {25, nullptr, "Terminate"}, | 842 | {25, nullptr, "Terminate"}, |
| 836 | {30, &ILibraryAppletAccessor::GetResult, "GetResult"}, | 843 | {30, &ILibraryAppletAccessor::GetResult, "GetResult"}, |
| 837 | {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, | 844 | {50, nullptr, "SetOutOfFocusApplicationSuspendingEnabled"}, |
| 845 | {60, nullptr, "PresetLibraryAppletGpuTimeSliceZero"}, | ||
| 838 | {100, &ILibraryAppletAccessor::PushInData, "PushInData"}, | 846 | {100, &ILibraryAppletAccessor::PushInData, "PushInData"}, |
| 839 | {101, &ILibraryAppletAccessor::PopOutData, "PopOutData"}, | 847 | {101, &ILibraryAppletAccessor::PopOutData, "PopOutData"}, |
| 840 | {102, nullptr, "PushExtraStorage"}, | 848 | {102, nullptr, "PushExtraStorage"}, |
| @@ -1139,6 +1147,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_) | |||
| 1139 | {31, &IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed, "EndBlockingHomeButtonShortAndLongPressed"}, | 1147 | {31, &IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed, "EndBlockingHomeButtonShortAndLongPressed"}, |
| 1140 | {32, &IApplicationFunctions::BeginBlockingHomeButton, "BeginBlockingHomeButton"}, | 1148 | {32, &IApplicationFunctions::BeginBlockingHomeButton, "BeginBlockingHomeButton"}, |
| 1141 | {33, &IApplicationFunctions::EndBlockingHomeButton, "EndBlockingHomeButton"}, | 1149 | {33, &IApplicationFunctions::EndBlockingHomeButton, "EndBlockingHomeButton"}, |
| 1150 | {34, nullptr, "SelectApplicationLicense"}, | ||
| 1142 | {40, &IApplicationFunctions::NotifyRunning, "NotifyRunning"}, | 1151 | {40, &IApplicationFunctions::NotifyRunning, "NotifyRunning"}, |
| 1143 | {50, &IApplicationFunctions::GetPseudoDeviceId, "GetPseudoDeviceId"}, | 1152 | {50, &IApplicationFunctions::GetPseudoDeviceId, "GetPseudoDeviceId"}, |
| 1144 | {60, nullptr, "SetMediaPlaybackStateForApplication"}, | 1153 | {60, nullptr, "SetMediaPlaybackStateForApplication"}, |
| @@ -1148,6 +1157,7 @@ IApplicationFunctions::IApplicationFunctions(Core::System& system_) | |||
| 1148 | {68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, | 1157 | {68, nullptr, "RequestFlushGamePlayingMovieForDebug"}, |
| 1149 | {70, nullptr, "RequestToShutdown"}, | 1158 | {70, nullptr, "RequestToShutdown"}, |
| 1150 | {71, nullptr, "RequestToReboot"}, | 1159 | {71, nullptr, "RequestToReboot"}, |
| 1160 | {72, nullptr, "RequestToSleep"}, | ||
| 1151 | {80, nullptr, "ExitAndRequestToShowThanksMessage"}, | 1161 | {80, nullptr, "ExitAndRequestToShowThanksMessage"}, |
| 1152 | {90, &IApplicationFunctions::EnableApplicationCrashReport, "EnableApplicationCrashReport"}, | 1162 | {90, &IApplicationFunctions::EnableApplicationCrashReport, "EnableApplicationCrashReport"}, |
| 1153 | {100, &IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer, "InitializeApplicationCopyrightFrameBuffer"}, | 1163 | {100, &IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer, "InitializeApplicationCopyrightFrameBuffer"}, |
diff --git a/src/core/hle/service/audio/audctl.cpp b/src/core/hle/service/audio/audctl.cpp index 9e08e5346..6ddb547fb 100644 --- a/src/core/hle/service/audio/audctl.cpp +++ b/src/core/hle/service/audio/audctl.cpp | |||
| @@ -39,6 +39,8 @@ AudCtl::AudCtl() : ServiceFramework{"audctl"} { | |||
| 39 | {25, nullptr, "GetAudioVolumeDataForPlayReport"}, | 39 | {25, nullptr, "GetAudioVolumeDataForPlayReport"}, |
| 40 | {26, nullptr, "UpdateHeadphoneSettings"}, | 40 | {26, nullptr, "UpdateHeadphoneSettings"}, |
| 41 | {27, nullptr, "SetVolumeMappingTableForDev"}, | 41 | {27, nullptr, "SetVolumeMappingTableForDev"}, |
| 42 | {28, nullptr, "GetAudioOutputChannelCountForPlayReport"}, | ||
| 43 | {29, nullptr, "BindAudioOutputChannelCountUpdateEventForPlayReport"}, | ||
| 42 | }; | 44 | }; |
| 43 | // clang-format on | 45 | // clang-format on |
| 44 | 46 | ||
diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index f589864ee..5febe8fc1 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include "core/hle/service/bcat/backend/boxcat.h" | 18 | #include "core/hle/service/bcat/backend/boxcat.h" |
| 19 | #include "core/settings.h" | 19 | #include "core/settings.h" |
| 20 | 20 | ||
| 21 | namespace Service::BCAT { | ||
| 21 | namespace { | 22 | namespace { |
| 22 | 23 | ||
| 23 | // Prevents conflicts with windows macro called CreateFile | 24 | // Prevents conflicts with windows macro called CreateFile |
| @@ -30,10 +31,6 @@ bool VfsDeleteFileWrap(FileSys::VirtualDir dir, std::string_view name) { | |||
| 30 | return dir->DeleteFile(name); | 31 | return dir->DeleteFile(name); |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | } // Anonymous namespace | ||
| 34 | |||
| 35 | namespace Service::BCAT { | ||
| 36 | |||
| 37 | constexpr ResultCode ERROR_GENERAL_BCAT_FAILURE{ErrorModule::BCAT, 1}; | 34 | constexpr ResultCode ERROR_GENERAL_BCAT_FAILURE{ErrorModule::BCAT, 1}; |
| 38 | 35 | ||
| 39 | constexpr char BOXCAT_HOSTNAME[] = "api.yuzu-emu.org"; | 36 | constexpr char BOXCAT_HOSTNAME[] = "api.yuzu-emu.org"; |
| @@ -90,8 +87,6 @@ constexpr u32 PORT = 443; | |||
| 90 | constexpr u32 TIMEOUT_SECONDS = 30; | 87 | constexpr u32 TIMEOUT_SECONDS = 30; |
| 91 | [[maybe_unused]] constexpr u64 VFS_COPY_BLOCK_SIZE = 1ULL << 24; // 4MB | 88 | [[maybe_unused]] constexpr u64 VFS_COPY_BLOCK_SIZE = 1ULL << 24; // 4MB |
| 92 | 89 | ||
| 93 | namespace { | ||
| 94 | |||
| 95 | std::string GetBINFilePath(u64 title_id) { | 90 | std::string GetBINFilePath(u64 title_id) { |
| 96 | return fmt::format("{}bcat/{:016X}/launchparam.bin", | 91 | return fmt::format("{}bcat/{:016X}/launchparam.bin", |
| 97 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); | 92 | FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); |
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp index 7ada67130..34aba7a27 100644 --- a/src/core/hle/service/bcat/module.cpp +++ b/src/core/hle/service/bcat/module.cpp | |||
| @@ -141,6 +141,7 @@ public: | |||
| 141 | {20301, nullptr, "RequestSuspendDeliveryTask"}, | 141 | {20301, nullptr, "RequestSuspendDeliveryTask"}, |
| 142 | {20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, | 142 | {20400, nullptr, "RegisterSystemApplicationDeliveryTask"}, |
| 143 | {20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, | 143 | {20401, nullptr, "UnregisterSystemApplicationDeliveryTask"}, |
| 144 | {20410, nullptr, "SetSystemApplicationDeliveryTaskTimer"}, | ||
| 144 | {30100, &IBcatService::SetPassphrase, "SetPassphrase"}, | 145 | {30100, &IBcatService::SetPassphrase, "SetPassphrase"}, |
| 145 | {30200, nullptr, "RegisterBackgroundDeliveryTask"}, | 146 | {30200, nullptr, "RegisterBackgroundDeliveryTask"}, |
| 146 | {30201, nullptr, "UnregisterBackgroundDeliveryTask"}, | 147 | {30201, nullptr, "UnregisterBackgroundDeliveryTask"}, |
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index 86f36915a..f8e9df4b1 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | #include "core/crypto/key_manager.h" | 5 | #include "core/crypto/key_manager.h" |
| 6 | #include "core/hle/ipc_helpers.h" | 6 | #include "core/hle/ipc_helpers.h" |
| 7 | #include "core/hle/service/es/es.h" | ||
| 7 | #include "core/hle/service/service.h" | 8 | #include "core/hle/service/service.h" |
| 8 | 9 | ||
| 9 | namespace Service::ES { | 10 | namespace Service::ES { |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 61045c75c..6b9b4f3b9 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -697,12 +697,14 @@ FSP_SRV::FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter) | |||
| 697 | {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, | 697 | {68, nullptr, "OpenSaveDataInfoReaderBySaveDataFilter"}, |
| 698 | {69, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, | 698 | {69, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataAttribute"}, |
| 699 | {70, nullptr, "WriteSaveDataFileSystemExtraDataBySaveDataAttribute"}, | 699 | {70, nullptr, "WriteSaveDataFileSystemExtraDataBySaveDataAttribute"}, |
| 700 | {71, nullptr, "ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute"}, | ||
| 700 | {80, nullptr, "OpenSaveDataMetaFile"}, | 701 | {80, nullptr, "OpenSaveDataMetaFile"}, |
| 701 | {81, nullptr, "OpenSaveDataTransferManager"}, | 702 | {81, nullptr, "OpenSaveDataTransferManager"}, |
| 702 | {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, | 703 | {82, nullptr, "OpenSaveDataTransferManagerVersion2"}, |
| 703 | {83, nullptr, "OpenSaveDataTransferProhibiterForCloudBackUp"}, | 704 | {83, nullptr, "OpenSaveDataTransferProhibiterForCloudBackUp"}, |
| 704 | {84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, | 705 | {84, nullptr, "ListApplicationAccessibleSaveDataOwnerId"}, |
| 705 | {85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, | 706 | {85, nullptr, "OpenSaveDataTransferManagerForSaveDataRepair"}, |
| 707 | {86, nullptr, "OpenSaveDataMover"}, | ||
| 706 | {100, nullptr, "OpenImageDirectoryFileSystem"}, | 708 | {100, nullptr, "OpenImageDirectoryFileSystem"}, |
| 707 | {110, nullptr, "OpenContentStorageFileSystem"}, | 709 | {110, nullptr, "OpenContentStorageFileSystem"}, |
| 708 | {120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, | 710 | {120, nullptr, "OpenCloudBackupWorkStorageFileSystem"}, |
| @@ -762,9 +764,11 @@ FSP_SRV::FSP_SRV(FileSystemController& fsc, const Core::Reporter& reporter) | |||
| 762 | {1011, &FSP_SRV::GetAccessLogVersionInfo, "GetAccessLogVersionInfo"}, | 764 | {1011, &FSP_SRV::GetAccessLogVersionInfo, "GetAccessLogVersionInfo"}, |
| 763 | {1012, nullptr, "GetFsStackUsage"}, | 765 | {1012, nullptr, "GetFsStackUsage"}, |
| 764 | {1013, nullptr, "UnsetSaveDataRootPath"}, | 766 | {1013, nullptr, "UnsetSaveDataRootPath"}, |
| 767 | {1014, nullptr, "OutputMultiProgramTagAccessLog"}, | ||
| 765 | {1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, | 768 | {1100, nullptr, "OverrideSaveDataTransferTokenSignVerificationKey"}, |
| 766 | {1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, | 769 | {1110, nullptr, "CorruptSaveDataFileSystemBySaveDataSpaceId2"}, |
| 767 | {1200, nullptr, "OpenMultiCommitManager"}, | 770 | {1200, nullptr, "OpenMultiCommitManager"}, |
| 771 | {1300, nullptr, "OpenBisWiper"}, | ||
| 768 | }; | 772 | }; |
| 769 | // clang-format on | 773 | // clang-format on |
| 770 | RegisterHandlers(functions); | 774 | RegisterHandlers(functions); |
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index 7938b4b80..68f259b70 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp | |||
| @@ -96,6 +96,7 @@ public: | |||
| 96 | {30830, nullptr, "ClearPlayLog"}, | 96 | {30830, nullptr, "ClearPlayLog"}, |
| 97 | {30900, nullptr, "SendFriendInvitation"}, | 97 | {30900, nullptr, "SendFriendInvitation"}, |
| 98 | {30910, nullptr, "ReadFriendInvitation"}, | 98 | {30910, nullptr, "ReadFriendInvitation"}, |
| 99 | {30911, nullptr, "ReadAllFriendInvitations"}, | ||
| 99 | {49900, nullptr, "DeleteNetworkServiceAccountCache"}, | 100 | {49900, nullptr, "DeleteNetworkServiceAccountCache"}, |
| 100 | }; | 101 | }; |
| 101 | // clang-format on | 102 | // clang-format on |
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index d6031a987..5559587e3 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -233,7 +233,7 @@ Hid::Hid(Core::System& system) : ServiceFramework("hid"), system(system) { | |||
| 233 | {302, nullptr, "StopConsoleSixAxisSensor"}, | 233 | {302, nullptr, "StopConsoleSixAxisSensor"}, |
| 234 | {303, nullptr, "ActivateSevenSixAxisSensor"}, | 234 | {303, nullptr, "ActivateSevenSixAxisSensor"}, |
| 235 | {304, nullptr, "StartSevenSixAxisSensor"}, | 235 | {304, nullptr, "StartSevenSixAxisSensor"}, |
| 236 | {305, nullptr, "StopSevenSixAxisSensor"}, | 236 | {305, &Hid::StopSevenSixAxisSensor, "StopSevenSixAxisSensor"}, |
| 237 | {306, &Hid::InitializeSevenSixAxisSensor, "InitializeSevenSixAxisSensor"}, | 237 | {306, &Hid::InitializeSevenSixAxisSensor, "InitializeSevenSixAxisSensor"}, |
| 238 | {307, nullptr, "FinalizeSevenSixAxisSensor"}, | 238 | {307, nullptr, "FinalizeSevenSixAxisSensor"}, |
| 239 | {308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, | 239 | {308, nullptr, "SetSevenSixAxisSensorFusionStrength"}, |
| @@ -282,6 +282,7 @@ Hid::Hid(Core::System& system) : ServiceFramework("hid"), system(system) { | |||
| 282 | {1001, nullptr, "GetNpadCommunicationMode"}, | 282 | {1001, nullptr, "GetNpadCommunicationMode"}, |
| 283 | {1002, nullptr, "SetTouchScreenConfiguration"}, | 283 | {1002, nullptr, "SetTouchScreenConfiguration"}, |
| 284 | {1003, nullptr, "IsFirmwareUpdateNeededForNotification"}, | 284 | {1003, nullptr, "IsFirmwareUpdateNeededForNotification"}, |
| 285 | {2000, nullptr, "ActivateDigitizer"}, | ||
| 285 | }; | 286 | }; |
| 286 | // clang-format on | 287 | // clang-format on |
| 287 | 288 | ||
| @@ -852,6 +853,17 @@ void Hid::SetPalmaBoostMode(Kernel::HLERequestContext& ctx) { | |||
| 852 | rb.Push(RESULT_SUCCESS); | 853 | rb.Push(RESULT_SUCCESS); |
| 853 | } | 854 | } |
| 854 | 855 | ||
| 856 | void Hid::StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | ||
| 857 | IPC::RequestParser rp{ctx}; | ||
| 858 | const auto applet_resource_user_id{rp.Pop<u64>()}; | ||
| 859 | |||
| 860 | LOG_WARNING(Service_HID, "(STUBBED) called, applet_resource_user_id={}", | ||
| 861 | applet_resource_user_id); | ||
| 862 | |||
| 863 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 864 | rb.Push(RESULT_SUCCESS); | ||
| 865 | } | ||
| 866 | |||
| 855 | void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { | 867 | void Hid::InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx) { |
| 856 | LOG_WARNING(Service_HID, "(STUBBED) called"); | 868 | LOG_WARNING(Service_HID, "(STUBBED) called"); |
| 857 | 869 | ||
| @@ -870,6 +882,7 @@ public: | |||
| 870 | {10, nullptr, "DeactivateTouchScreen"}, | 882 | {10, nullptr, "DeactivateTouchScreen"}, |
| 871 | {11, nullptr, "SetTouchScreenAutoPilotState"}, | 883 | {11, nullptr, "SetTouchScreenAutoPilotState"}, |
| 872 | {12, nullptr, "UnsetTouchScreenAutoPilotState"}, | 884 | {12, nullptr, "UnsetTouchScreenAutoPilotState"}, |
| 885 | {13, nullptr, "GetTouchScreenConfiguration"}, | ||
| 873 | {20, nullptr, "DeactivateMouse"}, | 886 | {20, nullptr, "DeactivateMouse"}, |
| 874 | {21, nullptr, "SetMouseAutoPilotState"}, | 887 | {21, nullptr, "SetMouseAutoPilotState"}, |
| 875 | {22, nullptr, "UnsetMouseAutoPilotState"}, | 888 | {22, nullptr, "UnsetMouseAutoPilotState"}, |
| @@ -879,7 +892,9 @@ public: | |||
| 879 | {50, nullptr, "DeactivateXpad"}, | 892 | {50, nullptr, "DeactivateXpad"}, |
| 880 | {51, nullptr, "SetXpadAutoPilotState"}, | 893 | {51, nullptr, "SetXpadAutoPilotState"}, |
| 881 | {52, nullptr, "UnsetXpadAutoPilotState"}, | 894 | {52, nullptr, "UnsetXpadAutoPilotState"}, |
| 882 | {60, nullptr, "DeactivateJoyXpad"}, | 895 | {60, nullptr, "ClearNpadSystemCommonPolicy"}, |
| 896 | {61, nullptr, "DeactivateNpad"}, | ||
| 897 | {62, nullptr, "ForceDisconnectNpad"}, | ||
| 883 | {91, nullptr, "DeactivateGesture"}, | 898 | {91, nullptr, "DeactivateGesture"}, |
| 884 | {110, nullptr, "DeactivateHomeButton"}, | 899 | {110, nullptr, "DeactivateHomeButton"}, |
| 885 | {111, nullptr, "SetHomeButtonAutoPilotState"}, | 900 | {111, nullptr, "SetHomeButtonAutoPilotState"}, |
| @@ -899,6 +914,15 @@ public: | |||
| 899 | {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, | 914 | {141, nullptr, "GetConsoleSixAxisSensorSamplingFrequency"}, |
| 900 | {142, nullptr, "DeactivateSevenSixAxisSensor"}, | 915 | {142, nullptr, "DeactivateSevenSixAxisSensor"}, |
| 901 | {143, nullptr, "GetConsoleSixAxisSensorCountStates"}, | 916 | {143, nullptr, "GetConsoleSixAxisSensorCountStates"}, |
| 917 | {144, nullptr, "GetAccelerometerFsr"}, | ||
| 918 | {145, nullptr, "SetAccelerometerFsr"}, | ||
| 919 | {146, nullptr, "GetAccelerometerOdr"}, | ||
| 920 | {147, nullptr, "SetAccelerometerOdr"}, | ||
| 921 | {148, nullptr, "GetGyroscopeFsr"}, | ||
| 922 | {149, nullptr, "SetGyroscopeFsr"}, | ||
| 923 | {150, nullptr, "GetGyroscopeOdr"}, | ||
| 924 | {151, nullptr, "SetGyroscopeOdr"}, | ||
| 925 | {152, nullptr, "GetWhoAmI"}, | ||
| 902 | {201, nullptr, "ActivateFirmwareUpdate"}, | 926 | {201, nullptr, "ActivateFirmwareUpdate"}, |
| 903 | {202, nullptr, "DeactivateFirmwareUpdate"}, | 927 | {202, nullptr, "DeactivateFirmwareUpdate"}, |
| 904 | {203, nullptr, "StartFirmwareUpdate"}, | 928 | {203, nullptr, "StartFirmwareUpdate"}, |
| @@ -927,6 +951,17 @@ public: | |||
| 927 | {233, nullptr, "ClearPairingInfo"}, | 951 | {233, nullptr, "ClearPairingInfo"}, |
| 928 | {234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, | 952 | {234, nullptr, "GetUniquePadDeviceTypeSetInternal"}, |
| 929 | {235, nullptr, "EnableAnalogStickPower"}, | 953 | {235, nullptr, "EnableAnalogStickPower"}, |
| 954 | {236, nullptr, "RequestKuinaUartClockCal"}, | ||
| 955 | {237, nullptr, "GetKuinaUartClockCal"}, | ||
| 956 | {238, nullptr, "SetKuinaUartClockTrim"}, | ||
| 957 | {239, nullptr, "KuinaLoopbackTest"}, | ||
| 958 | {240, nullptr, "RequestBatteryVoltage"}, | ||
| 959 | {241, nullptr, "GetBatteryVoltage"}, | ||
| 960 | {242, nullptr, "GetUniquePadPowerInfo"}, | ||
| 961 | {243, nullptr, "RebootUniquePad"}, | ||
| 962 | {244, nullptr, "RequestKuinaFirmwareVersion"}, | ||
| 963 | {245, nullptr, "GetKuinaFirmwareVersion"}, | ||
| 964 | {246, nullptr, "GetVidPid"}, | ||
| 930 | {301, nullptr, "GetAbstractedPadHandles"}, | 965 | {301, nullptr, "GetAbstractedPadHandles"}, |
| 931 | {302, nullptr, "GetAbstractedPadState"}, | 966 | {302, nullptr, "GetAbstractedPadState"}, |
| 932 | {303, nullptr, "GetAbstractedPadsState"}, | 967 | {303, nullptr, "GetAbstractedPadsState"}, |
| @@ -945,6 +980,17 @@ public: | |||
| 945 | {350, nullptr, "AddRegisteredDevice"}, | 980 | {350, nullptr, "AddRegisteredDevice"}, |
| 946 | {400, nullptr, "DisableExternalMcuOnNxDevice"}, | 981 | {400, nullptr, "DisableExternalMcuOnNxDevice"}, |
| 947 | {401, nullptr, "DisableRailDeviceFiltering"}, | 982 | {401, nullptr, "DisableRailDeviceFiltering"}, |
| 983 | {402, nullptr, "EnableWiredPairing"}, | ||
| 984 | {403, nullptr, "EnableShipmentModeAutoClear"}, | ||
| 985 | {500, nullptr, "SetFactoryInt"}, | ||
| 986 | {501, nullptr, "IsFactoryBootEnabled"}, | ||
| 987 | {550, nullptr, "SetAnalogStickModelDataTemporarily"}, | ||
| 988 | {551, nullptr, "GetAnalogStickModelData"}, | ||
| 989 | {552, nullptr, "ResetAnalogStickModelData"}, | ||
| 990 | {600, nullptr, "ConvertPadState"}, | ||
| 991 | {2000, nullptr, "DeactivateDigitizer"}, | ||
| 992 | {2001, nullptr, "SetDigitizerAutoPilotState"}, | ||
| 993 | {2002, nullptr, "UnsetDigitizerAutoPilotState"}, | ||
| 948 | }; | 994 | }; |
| 949 | // clang-format on | 995 | // clang-format on |
| 950 | 996 | ||
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 039c38b58..23552efb1 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -128,6 +128,7 @@ private: | |||
| 128 | void StopSixAxisSensor(Kernel::HLERequestContext& ctx); | 128 | void StopSixAxisSensor(Kernel::HLERequestContext& ctx); |
| 129 | void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx); | 129 | void SetIsPalmaAllConnectable(Kernel::HLERequestContext& ctx); |
| 130 | void SetPalmaBoostMode(Kernel::HLERequestContext& ctx); | 130 | void SetPalmaBoostMode(Kernel::HLERequestContext& ctx); |
| 131 | void StopSevenSixAxisSensor(Kernel::HLERequestContext& ctx); | ||
| 131 | void InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx); | 132 | void InitializeSevenSixAxisSensor(Kernel::HLERequestContext& ctx); |
| 132 | 133 | ||
| 133 | std::shared_ptr<IAppletResource> applet_resource; | 134 | std::shared_ptr<IAppletResource> applet_resource; |
diff --git a/src/core/hle/service/ldr/ldr.cpp b/src/core/hle/service/ldr/ldr.cpp index 0cde7a557..6ad3be1b3 100644 --- a/src/core/hle/service/ldr/ldr.cpp +++ b/src/core/hle/service/ldr/ldr.cpp | |||
| @@ -116,6 +116,7 @@ public: | |||
| 116 | {1, nullptr, "GetProgramInfo"}, | 116 | {1, nullptr, "GetProgramInfo"}, |
| 117 | {2, nullptr, "RegisterTitle"}, | 117 | {2, nullptr, "RegisterTitle"}, |
| 118 | {3, nullptr, "UnregisterTitle"}, | 118 | {3, nullptr, "UnregisterTitle"}, |
| 119 | {4, nullptr, "SetEnabledProgramVerification"}, | ||
| 119 | }; | 120 | }; |
| 120 | // clang-format on | 121 | // clang-format on |
| 121 | 122 | ||
diff --git a/src/core/hle/service/ncm/ncm.cpp b/src/core/hle/service/ncm/ncm.cpp index 89e283ca5..ec9aae04a 100644 --- a/src/core/hle/service/ncm/ncm.cpp +++ b/src/core/hle/service/ncm/ncm.cpp | |||
| @@ -122,6 +122,7 @@ public: | |||
| 122 | {11, nullptr, "ActivateContentMetaDatabase"}, | 122 | {11, nullptr, "ActivateContentMetaDatabase"}, |
| 123 | {12, nullptr, "InactivateContentMetaDatabase"}, | 123 | {12, nullptr, "InactivateContentMetaDatabase"}, |
| 124 | {13, nullptr, "InvalidateRightsIdCache"}, | 124 | {13, nullptr, "InvalidateRightsIdCache"}, |
| 125 | {14, nullptr, "GetMemoryReport"}, | ||
| 125 | }; | 126 | }; |
| 126 | // clang-format on | 127 | // clang-format on |
| 127 | 128 | ||
diff --git a/src/core/hle/service/npns/npns.cpp b/src/core/hle/service/npns/npns.cpp index aa171473b..f38d01084 100644 --- a/src/core/hle/service/npns/npns.cpp +++ b/src/core/hle/service/npns/npns.cpp | |||
| @@ -48,6 +48,8 @@ public: | |||
| 48 | {151, nullptr, "GetStateWithHandover"}, | 48 | {151, nullptr, "GetStateWithHandover"}, |
| 49 | {152, nullptr, "GetStateChangeEventWithHandover"}, | 49 | {152, nullptr, "GetStateChangeEventWithHandover"}, |
| 50 | {153, nullptr, "GetDropEventWithHandover"}, | 50 | {153, nullptr, "GetDropEventWithHandover"}, |
| 51 | {161, nullptr, "GetRequestChangeStateCancelEvent"}, | ||
| 52 | {162, nullptr, "RequestChangeStateForceTimedWithCancelEvent"}, | ||
| 51 | {201, nullptr, "RequestChangeStateForceTimed"}, | 53 | {201, nullptr, "RequestChangeStateForceTimed"}, |
| 52 | {202, nullptr, "RequestChangeStateForceAsync"}, | 54 | {202, nullptr, "RequestChangeStateForceAsync"}, |
| 53 | }; | 55 | }; |
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index fdab3cf78..8fb88990e 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -110,6 +110,10 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 110 | {100, nullptr, "ResetToFactorySettings"}, | 110 | {100, nullptr, "ResetToFactorySettings"}, |
| 111 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, | 111 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, |
| 112 | {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, | 112 | {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, |
| 113 | {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, | ||
| 114 | {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, | ||
| 115 | {105, nullptr, "RequestResetToFactorySettingsSecurely"}, | ||
| 116 | {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, | ||
| 113 | {200, nullptr, "CalculateUserSaveDataStatistics"}, | 117 | {200, nullptr, "CalculateUserSaveDataStatistics"}, |
| 114 | {201, nullptr, "DeleteUserSaveDataAll"}, | 118 | {201, nullptr, "DeleteUserSaveDataAll"}, |
| 115 | {210, nullptr, "DeleteUserSystemSaveData"}, | 119 | {210, nullptr, "DeleteUserSystemSaveData"}, |
| @@ -191,6 +195,9 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 191 | {1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, | 195 | {1307, nullptr, "TryDeleteRunningApplicationContentEntities"}, |
| 192 | {1308, nullptr, "DeleteApplicationCompletelyForDebug"}, | 196 | {1308, nullptr, "DeleteApplicationCompletelyForDebug"}, |
| 193 | {1309, nullptr, "CleanupUnavailableAddOnContents"}, | 197 | {1309, nullptr, "CleanupUnavailableAddOnContents"}, |
| 198 | {1310, nullptr, "RequestMoveApplicationEntity"}, | ||
| 199 | {1311, nullptr, "EstimateSizeToMove"}, | ||
| 200 | {1312, nullptr, "HasMovableEntity"}, | ||
| 194 | {1400, nullptr, "PrepareShutdown"}, | 201 | {1400, nullptr, "PrepareShutdown"}, |
| 195 | {1500, nullptr, "FormatSdCard"}, | 202 | {1500, nullptr, "FormatSdCard"}, |
| 196 | {1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, | 203 | {1501, nullptr, "NeedsSystemUpdateToFormatSdCard"}, |
| @@ -241,7 +248,7 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 241 | {2153, nullptr, "DeactivateRightsEnvironment"}, | 248 | {2153, nullptr, "DeactivateRightsEnvironment"}, |
| 242 | {2154, nullptr, "ForceActivateRightsContextForExit"}, | 249 | {2154, nullptr, "ForceActivateRightsContextForExit"}, |
| 243 | {2155, nullptr, "UpdateRightsEnvironmentStatus"}, | 250 | {2155, nullptr, "UpdateRightsEnvironmentStatus"}, |
| 244 | {2156, nullptr, "CreateRightsEnvironmentForPreomia"}, | 251 | {2156, nullptr, "CreateRightsEnvironmentForMicroApplication"}, |
| 245 | {2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, | 252 | {2160, nullptr, "AddTargetApplicationToRightsEnvironment"}, |
| 246 | {2161, nullptr, "SetUsersToRightsEnvironment"}, | 253 | {2161, nullptr, "SetUsersToRightsEnvironment"}, |
| 247 | {2170, nullptr, "GetRightsEnvironmentStatus"}, | 254 | {2170, nullptr, "GetRightsEnvironmentStatus"}, |
| @@ -258,6 +265,7 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 258 | {2350, nullptr, "PerformAutoUpdateByApplicationId"}, | 265 | {2350, nullptr, "PerformAutoUpdateByApplicationId"}, |
| 259 | {2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, | 266 | {2351, nullptr, "RequestNoDownloadRightsErrorResolution"}, |
| 260 | {2352, nullptr, "RequestResolveNoDownloadRightsError"}, | 267 | {2352, nullptr, "RequestResolveNoDownloadRightsError"}, |
| 268 | {2353, nullptr, "GetApplicationDownloadTaskInfo"}, | ||
| 261 | {2400, nullptr, "GetPromotionInfo"}, | 269 | {2400, nullptr, "GetPromotionInfo"}, |
| 262 | {2401, nullptr, "CountPromotionInfo"}, | 270 | {2401, nullptr, "CountPromotionInfo"}, |
| 263 | {2402, nullptr, "ListPromotionInfo"}, | 271 | {2402, nullptr, "ListPromotionInfo"}, |
| @@ -266,9 +274,12 @@ IApplicationManagerInterface::IApplicationManagerInterface() | |||
| 266 | {2500, nullptr, "ConfirmAvailableTime"}, | 274 | {2500, nullptr, "ConfirmAvailableTime"}, |
| 267 | {2510, nullptr, "CreateApplicationResource"}, | 275 | {2510, nullptr, "CreateApplicationResource"}, |
| 268 | {2511, nullptr, "GetApplicationResource"}, | 276 | {2511, nullptr, "GetApplicationResource"}, |
| 269 | {2513, nullptr, "LaunchPreomia"}, | 277 | {2513, nullptr, "LaunchMicroApplication"}, |
| 270 | {2514, nullptr, "ClearTaskOfAsyncTaskManager"}, | 278 | {2514, nullptr, "ClearTaskOfAsyncTaskManager"}, |
| 279 | {2515, nullptr, "CleanupAllPlaceHolderAndFragmentsIfNoTask"}, | ||
| 280 | {2516, nullptr, "EnsureApplicationCertificate"}, | ||
| 271 | {2800, nullptr, "GetApplicationIdOfPreomia"}, | 281 | {2800, nullptr, "GetApplicationIdOfPreomia"}, |
| 282 | {9999, nullptr, "GetApplicationCertificate"}, | ||
| 272 | }; | 283 | }; |
| 273 | // clang-format on | 284 | // clang-format on |
| 274 | 285 | ||
| @@ -505,6 +516,10 @@ IFactoryResetInterface::IFactoryResetInterface::IFactoryResetInterface() | |||
| 505 | {100, nullptr, "ResetToFactorySettings"}, | 516 | {100, nullptr, "ResetToFactorySettings"}, |
| 506 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, | 517 | {101, nullptr, "ResetToFactorySettingsWithoutUserSaveData"}, |
| 507 | {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, | 518 | {102, nullptr, "ResetToFactorySettingsForRefurbishment"}, |
| 519 | {103, nullptr, "ResetToFactorySettingsWithPlatformRegion"}, | ||
| 520 | {104, nullptr, "ResetToFactorySettingsWithPlatformRegionAuthentication"}, | ||
| 521 | {105, nullptr, "RequestResetToFactorySettingsSecurely"}, | ||
| 522 | {106, nullptr, "RequestResetToFactorySettingsWithPlatformRegionAuthenticationSecurely"}, | ||
| 508 | }; | 523 | }; |
| 509 | // clang-format on | 524 | // clang-format on |
| 510 | 525 | ||
| @@ -553,6 +568,9 @@ public: | |||
| 553 | {10, nullptr, "TerminateApplication2"}, | 568 | {10, nullptr, "TerminateApplication2"}, |
| 554 | {11, nullptr, "GetRunningApplicationProcessId"}, | 569 | {11, nullptr, "GetRunningApplicationProcessId"}, |
| 555 | {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActive"}, | 570 | {12, nullptr, "SetCurrentApplicationRightsEnvironmentCanBeActive"}, |
| 571 | {13, nullptr, "CreateApplicationResourceForDevelop"}, | ||
| 572 | {14, nullptr, "IsPreomiaForDevelop"}, | ||
| 573 | {15, nullptr, "GetApplicationProgramIdFromHost"}, | ||
| 556 | }; | 574 | }; |
| 557 | // clang-format on | 575 | // clang-format on |
| 558 | 576 | ||
diff --git a/src/core/hle/service/ns/pl_u.cpp b/src/core/hle/service/ns/pl_u.cpp index ab1746d28..6efdf1606 100644 --- a/src/core/hle/service/ns/pl_u.cpp +++ b/src/core/hle/service/ns/pl_u.cpp | |||
| @@ -164,6 +164,7 @@ PL_U::PL_U(Core::System& system) | |||
| 164 | {6, nullptr, "GetSharedFontInOrderOfPriorityForSystem"}, | 164 | {6, nullptr, "GetSharedFontInOrderOfPriorityForSystem"}, |
| 165 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, | 165 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, |
| 166 | {101, nullptr, "RequestApplicationFunctionAuthorizationForSystem"}, | 166 | {101, nullptr, "RequestApplicationFunctionAuthorizationForSystem"}, |
| 167 | {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, | ||
| 167 | {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, | 168 | {1000, nullptr, "LoadNgWordDataForPlatformRegionChina"}, |
| 168 | {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, | 169 | {1001, nullptr, "GetNgWordDataSizeForPlatformRegionChina"}, |
| 169 | }; | 170 | }; |
diff --git a/src/core/hle/service/pctl/module.cpp b/src/core/hle/service/pctl/module.cpp index c75b4ee34..caf14ed61 100644 --- a/src/core/hle/service/pctl/module.cpp +++ b/src/core/hle/service/pctl/module.cpp | |||
| @@ -31,6 +31,8 @@ public: | |||
| 31 | {1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, | 31 | {1014, nullptr, "ConfirmPlayableApplicationVideoOld"}, |
| 32 | {1015, nullptr, "ConfirmPlayableApplicationVideo"}, | 32 | {1015, nullptr, "ConfirmPlayableApplicationVideo"}, |
| 33 | {1016, nullptr, "ConfirmShowNewsPermission"}, | 33 | {1016, nullptr, "ConfirmShowNewsPermission"}, |
| 34 | {1017, nullptr, "EndFreeCommunication"}, | ||
| 35 | {1018, nullptr, "IsFreeCommunicationAvailable"}, | ||
| 34 | {1031, nullptr, "IsRestrictionEnabled"}, | 36 | {1031, nullptr, "IsRestrictionEnabled"}, |
| 35 | {1032, nullptr, "GetSafetyLevel"}, | 37 | {1032, nullptr, "GetSafetyLevel"}, |
| 36 | {1033, nullptr, "SetSafetyLevel"}, | 38 | {1033, nullptr, "SetSafetyLevel"}, |
diff --git a/src/core/hle/service/prepo/prepo.cpp b/src/core/hle/service/prepo/prepo.cpp index 8f1be0e48..14309c679 100644 --- a/src/core/hle/service/prepo/prepo.cpp +++ b/src/core/hle/service/prepo/prepo.cpp | |||
| @@ -21,8 +21,10 @@ public: | |||
| 21 | static const FunctionInfo functions[] = { | 21 | static const FunctionInfo functions[] = { |
| 22 | {10100, &PlayReport::SaveReport<Core::Reporter::PlayReportType::Old>, "SaveReportOld"}, | 22 | {10100, &PlayReport::SaveReport<Core::Reporter::PlayReportType::Old>, "SaveReportOld"}, |
| 23 | {10101, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::Old>, "SaveReportWithUserOld"}, | 23 | {10101, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::Old>, "SaveReportWithUserOld"}, |
| 24 | {10102, &PlayReport::SaveReport<Core::Reporter::PlayReportType::New>, "SaveReport"}, | 24 | {10102, &PlayReport::SaveReport<Core::Reporter::PlayReportType::Old2>, "SaveReportOld2"}, |
| 25 | {10103, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::New>, "SaveReportWithUser"}, | 25 | {10103, &PlayReport::SaveReportWithUser<Core::Reporter::PlayReportType::Old2>, "SaveReportWithUserOld2"}, |
| 26 | {10104, nullptr, "SaveReport"}, | ||
| 27 | {10105, nullptr, "SaveReportWithUser"}, | ||
| 26 | {10200, nullptr, "RequestImmediateTransmission"}, | 28 | {10200, nullptr, "RequestImmediateTransmission"}, |
| 27 | {10300, nullptr, "GetTransmissionStatus"}, | 29 | {10300, nullptr, "GetTransmissionStatus"}, |
| 28 | {10400, nullptr, "GetSystemSessionId"}, | 30 | {10400, nullptr, "GetSystemSessionId"}, |
| @@ -35,8 +37,10 @@ public: | |||
| 35 | {30400, nullptr, "GetStatistics"}, | 37 | {30400, nullptr, "GetStatistics"}, |
| 36 | {30401, nullptr, "GetThroughputHistory"}, | 38 | {30401, nullptr, "GetThroughputHistory"}, |
| 37 | {30500, nullptr, "GetLastUploadError"}, | 39 | {30500, nullptr, "GetLastUploadError"}, |
| 40 | {30600, nullptr, "GetApplicationUploadSummary"}, | ||
| 38 | {40100, nullptr, "IsUserAgreementCheckEnabled"}, | 41 | {40100, nullptr, "IsUserAgreementCheckEnabled"}, |
| 39 | {40101, nullptr, "SetUserAgreementCheckEnabled"}, | 42 | {40101, nullptr, "SetUserAgreementCheckEnabled"}, |
| 43 | {50100, nullptr, "ReadAllApplicationReportFiles"}, | ||
| 40 | {90100, nullptr, "ReadAllReportFiles"}, | 44 | {90100, nullptr, "ReadAllReportFiles"}, |
| 41 | }; | 45 | }; |
| 42 | // clang-format on | 46 | // clang-format on |
| @@ -51,7 +55,7 @@ private: | |||
| 51 | const auto process_id = rp.PopRaw<u64>(); | 55 | const auto process_id = rp.PopRaw<u64>(); |
| 52 | 56 | ||
| 53 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; | 57 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; |
| 54 | if (Type == Core::Reporter::PlayReportType::New) { | 58 | if constexpr (Type == Core::Reporter::PlayReportType::Old2) { |
| 55 | data.emplace_back(ctx.ReadBuffer(1)); | 59 | data.emplace_back(ctx.ReadBuffer(1)); |
| 56 | } | 60 | } |
| 57 | 61 | ||
| @@ -71,7 +75,7 @@ private: | |||
| 71 | const auto user_id = rp.PopRaw<u128>(); | 75 | const auto user_id = rp.PopRaw<u128>(); |
| 72 | const auto process_id = rp.PopRaw<u64>(); | 76 | const auto process_id = rp.PopRaw<u64>(); |
| 73 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; | 77 | std::vector<std::vector<u8>> data{ctx.ReadBuffer(0)}; |
| 74 | if (Type == Core::Reporter::PlayReportType::New) { | 78 | if constexpr (Type == Core::Reporter::PlayReportType::Old2) { |
| 75 | data.emplace_back(ctx.ReadBuffer(1)); | 79 | data.emplace_back(ctx.ReadBuffer(1)); |
| 76 | } | 80 | } |
| 77 | 81 | ||
diff --git a/src/core/hle/service/set/set_cal.cpp b/src/core/hle/service/set/set_cal.cpp index 1398a4a48..3fbfecc9e 100644 --- a/src/core/hle/service/set/set_cal.cpp +++ b/src/core/hle/service/set/set_cal.cpp | |||
| @@ -50,6 +50,8 @@ SET_CAL::SET_CAL() : ServiceFramework("set:cal") { | |||
| 50 | {39, nullptr, "GetConsoleSixAxisSensorModuleType"}, | 50 | {39, nullptr, "GetConsoleSixAxisSensorModuleType"}, |
| 51 | {40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, | 51 | {40, nullptr, "GetConsoleSixAxisSensorHorizontalOffset"}, |
| 52 | {41, nullptr, "GetBatteryVersion"}, | 52 | {41, nullptr, "GetBatteryVersion"}, |
| 53 | {42, nullptr, "GetDeviceId"}, | ||
| 54 | {43, nullptr, "GetConsoleSixAxisSensorMountType"}, | ||
| 53 | }; | 55 | }; |
| 54 | // clang-format on | 56 | // clang-format on |
| 55 | 57 | ||
diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index b7c9ea74b..8bd4c7e79 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp | |||
| @@ -288,6 +288,18 @@ SET_SYS::SET_SYS() : ServiceFramework("set:sys") { | |||
| 288 | {186, nullptr, "GetMemoryUsageRateFlag"}, | 288 | {186, nullptr, "GetMemoryUsageRateFlag"}, |
| 289 | {187, nullptr, "GetTouchScreenMode"}, | 289 | {187, nullptr, "GetTouchScreenMode"}, |
| 290 | {188, nullptr, "SetTouchScreenMode"}, | 290 | {188, nullptr, "SetTouchScreenMode"}, |
| 291 | {189, nullptr, "GetButtonConfigSettingsFull"}, | ||
| 292 | {190, nullptr, "SetButtonConfigSettingsFull"}, | ||
| 293 | {191, nullptr, "GetButtonConfigSettingsEmbedded"}, | ||
| 294 | {192, nullptr, "SetButtonConfigSettingsEmbedded"}, | ||
| 295 | {193, nullptr, "GetButtonConfigSettingsLeft"}, | ||
| 296 | {194, nullptr, "SetButtonConfigSettingsLeft"}, | ||
| 297 | {195, nullptr, "GetButtonConfigSettingsRight"}, | ||
| 298 | {196, nullptr, "SetButtonConfigSettingsRight"}, | ||
| 299 | {197, nullptr, "GetButtonConfigRegisteredSettingsEmbedded"}, | ||
| 300 | {198, nullptr, "SetButtonConfigRegisteredSettingsEmbedded"}, | ||
| 301 | {199, nullptr, "GetButtonConfigRegisteredSettings"}, | ||
| 302 | {200, nullptr, "SetButtonConfigRegisteredSettings"}, | ||
| 291 | }; | 303 | }; |
| 292 | // clang-format on | 304 | // clang-format on |
| 293 | 305 | ||
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index f67fab2f9..8d4952c0e 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp | |||
| @@ -148,6 +148,7 @@ BSD::BSD(const char* name) : ServiceFramework(name) { | |||
| 148 | {30, nullptr, "SendMMsg"}, | 148 | {30, nullptr, "SendMMsg"}, |
| 149 | {31, nullptr, "EventFd"}, | 149 | {31, nullptr, "EventFd"}, |
| 150 | {32, nullptr, "RegisterResourceStatisticsName"}, | 150 | {32, nullptr, "RegisterResourceStatisticsName"}, |
| 151 | {33, nullptr, "Initialize2"}, | ||
| 151 | }; | 152 | }; |
| 152 | // clang-format on | 153 | // clang-format on |
| 153 | 154 | ||
diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index e722886de..67f1bbcf3 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp | |||
| @@ -20,8 +20,8 @@ namespace Service::Time { | |||
| 20 | 20 | ||
| 21 | class ISystemClock final : public ServiceFramework<ISystemClock> { | 21 | class ISystemClock final : public ServiceFramework<ISystemClock> { |
| 22 | public: | 22 | public: |
| 23 | ISystemClock(Clock::SystemClockCore& clock_core) | 23 | explicit ISystemClock(Clock::SystemClockCore& clock_core, Core::System& system) |
| 24 | : ServiceFramework("ISystemClock"), clock_core{clock_core} { | 24 | : ServiceFramework("ISystemClock"), clock_core{clock_core}, system{system} { |
| 25 | // clang-format off | 25 | // clang-format off |
| 26 | static const FunctionInfo functions[] = { | 26 | static const FunctionInfo functions[] = { |
| 27 | {0, &ISystemClock::GetCurrentTime, "GetCurrentTime"}, | 27 | {0, &ISystemClock::GetCurrentTime, "GetCurrentTime"}, |
| @@ -46,9 +46,8 @@ private: | |||
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | s64 posix_time{}; | 48 | s64 posix_time{}; |
| 49 | if (const ResultCode result{ | 49 | if (const ResultCode result{clock_core.GetCurrentTime(system, posix_time)}; |
| 50 | clock_core.GetCurrentTime(Core::System::GetInstance(), posix_time)}; | 50 | result.IsError()) { |
| 51 | result != RESULT_SUCCESS) { | ||
| 52 | IPC::ResponseBuilder rb{ctx, 2}; | 51 | IPC::ResponseBuilder rb{ctx, 2}; |
| 53 | rb.Push(result); | 52 | rb.Push(result); |
| 54 | return; | 53 | return; |
| @@ -69,9 +68,8 @@ private: | |||
| 69 | } | 68 | } |
| 70 | 69 | ||
| 71 | Clock::SystemClockContext system_clock_context{}; | 70 | Clock::SystemClockContext system_clock_context{}; |
| 72 | if (const ResultCode result{ | 71 | if (const ResultCode result{clock_core.GetClockContext(system, system_clock_context)}; |
| 73 | clock_core.GetClockContext(Core::System::GetInstance(), system_clock_context)}; | 72 | result.IsError()) { |
| 74 | result != RESULT_SUCCESS) { | ||
| 75 | IPC::ResponseBuilder rb{ctx, 2}; | 73 | IPC::ResponseBuilder rb{ctx, 2}; |
| 76 | rb.Push(result); | 74 | rb.Push(result); |
| 77 | return; | 75 | return; |
| @@ -83,12 +81,13 @@ private: | |||
| 83 | } | 81 | } |
| 84 | 82 | ||
| 85 | Clock::SystemClockCore& clock_core; | 83 | Clock::SystemClockCore& clock_core; |
| 84 | Core::System& system; | ||
| 86 | }; | 85 | }; |
| 87 | 86 | ||
| 88 | class ISteadyClock final : public ServiceFramework<ISteadyClock> { | 87 | class ISteadyClock final : public ServiceFramework<ISteadyClock> { |
| 89 | public: | 88 | public: |
| 90 | ISteadyClock(Clock::SteadyClockCore& clock_core) | 89 | explicit ISteadyClock(Clock::SteadyClockCore& clock_core, Core::System& system) |
| 91 | : ServiceFramework("ISteadyClock"), clock_core{clock_core} { | 90 | : ServiceFramework("ISteadyClock"), clock_core{clock_core}, system{system} { |
| 92 | static const FunctionInfo functions[] = { | 91 | static const FunctionInfo functions[] = { |
| 93 | {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"}, | 92 | {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"}, |
| 94 | }; | 93 | }; |
| @@ -105,14 +104,14 @@ private: | |||
| 105 | return; | 104 | return; |
| 106 | } | 105 | } |
| 107 | 106 | ||
| 108 | const Clock::SteadyClockTimePoint time_point{ | 107 | const Clock::SteadyClockTimePoint time_point{clock_core.GetCurrentTimePoint(system)}; |
| 109 | clock_core.GetCurrentTimePoint(Core::System::GetInstance())}; | ||
| 110 | IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2}; | 108 | IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2}; |
| 111 | rb.Push(RESULT_SUCCESS); | 109 | rb.Push(RESULT_SUCCESS); |
| 112 | rb.PushRaw(time_point); | 110 | rb.PushRaw(time_point); |
| 113 | } | 111 | } |
| 114 | 112 | ||
| 115 | Clock::SteadyClockCore& clock_core; | 113 | Clock::SteadyClockCore& clock_core; |
| 114 | Core::System& system; | ||
| 116 | }; | 115 | }; |
| 117 | 116 | ||
| 118 | ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( | 117 | ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( |
| @@ -134,7 +133,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( | |||
| 134 | } | 133 | } |
| 135 | 134 | ||
| 136 | const auto current_time_point{ | 135 | const auto current_time_point{ |
| 137 | time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(Core::System::GetInstance())}; | 136 | time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; |
| 138 | if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime( | 137 | if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime( |
| 139 | clock_snapshot.user_time, current_time_point, clock_snapshot.user_context)}; | 138 | clock_snapshot.user_time, current_time_point, clock_snapshot.user_context)}; |
| 140 | result != RESULT_SUCCESS) { | 139 | result != RESULT_SUCCESS) { |
| @@ -176,21 +175,24 @@ void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ct | |||
| 176 | LOG_DEBUG(Service_Time, "called"); | 175 | LOG_DEBUG(Service_Time, "called"); |
| 177 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 176 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 178 | rb.Push(RESULT_SUCCESS); | 177 | rb.Push(RESULT_SUCCESS); |
| 179 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardUserSystemClockCore()); | 178 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardUserSystemClockCore(), |
| 179 | system); | ||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { | 182 | void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { |
| 183 | LOG_DEBUG(Service_Time, "called"); | 183 | LOG_DEBUG(Service_Time, "called"); |
| 184 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 184 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 185 | rb.Push(RESULT_SUCCESS); | 185 | rb.Push(RESULT_SUCCESS); |
| 186 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardNetworkSystemClockCore()); | 186 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardNetworkSystemClockCore(), |
| 187 | system); | ||
| 187 | } | 188 | } |
| 188 | 189 | ||
| 189 | void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { | 190 | void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { |
| 190 | LOG_DEBUG(Service_Time, "called"); | 191 | LOG_DEBUG(Service_Time, "called"); |
| 191 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 192 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 192 | rb.Push(RESULT_SUCCESS); | 193 | rb.Push(RESULT_SUCCESS); |
| 193 | rb.PushIpcInterface<ISteadyClock>(module->GetTimeManager().GetStandardSteadyClockCore()); | 194 | rb.PushIpcInterface<ISteadyClock>(module->GetTimeManager().GetStandardSteadyClockCore(), |
| 195 | system); | ||
| 194 | } | 196 | } |
| 195 | 197 | ||
| 196 | void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { | 198 | void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { |
| @@ -204,7 +206,8 @@ void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& c | |||
| 204 | LOG_DEBUG(Service_Time, "called"); | 206 | LOG_DEBUG(Service_Time, "called"); |
| 205 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 207 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 206 | rb.Push(RESULT_SUCCESS); | 208 | rb.Push(RESULT_SUCCESS); |
| 207 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardLocalSystemClockCore()); | 209 | rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardLocalSystemClockCore(), |
| 210 | system); | ||
| 208 | } | 211 | } |
| 209 | 212 | ||
| 210 | void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient( | 213 | void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient( |
| @@ -228,8 +231,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe | |||
| 228 | 231 | ||
| 229 | IPC::RequestParser rp{ctx}; | 232 | IPC::RequestParser rp{ctx}; |
| 230 | const auto context{rp.PopRaw<Clock::SystemClockContext>()}; | 233 | const auto context{rp.PopRaw<Clock::SystemClockContext>()}; |
| 231 | const auto current_time_point{ | 234 | const auto current_time_point{steady_clock_core.GetCurrentTimePoint(system)}; |
| 232 | steady_clock_core.GetCurrentTimePoint(Core::System::GetInstance())}; | ||
| 233 | 235 | ||
| 234 | if (current_time_point.clock_source_id == context.steady_time_point.clock_source_id) { | 236 | if (current_time_point.clock_source_id == context.steady_time_point.clock_source_id) { |
| 235 | const auto ticks{Clock::TimeSpanType::FromTicks( | 237 | const auto ticks{Clock::TimeSpanType::FromTicks( |
| @@ -255,8 +257,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { | |||
| 255 | Clock::SystemClockContext user_context{}; | 257 | Clock::SystemClockContext user_context{}; |
| 256 | if (const ResultCode result{ | 258 | if (const ResultCode result{ |
| 257 | module->GetTimeManager().GetStandardUserSystemClockCore().GetClockContext( | 259 | module->GetTimeManager().GetStandardUserSystemClockCore().GetClockContext( |
| 258 | Core::System::GetInstance(), user_context)}; | 260 | system, user_context)}; |
| 259 | result != RESULT_SUCCESS) { | 261 | result.IsError()) { |
| 260 | IPC::ResponseBuilder rb{ctx, 2}; | 262 | IPC::ResponseBuilder rb{ctx, 2}; |
| 261 | rb.Push(result); | 263 | rb.Push(result); |
| 262 | return; | 264 | return; |
| @@ -264,8 +266,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { | |||
| 264 | Clock::SystemClockContext network_context{}; | 266 | Clock::SystemClockContext network_context{}; |
| 265 | if (const ResultCode result{ | 267 | if (const ResultCode result{ |
| 266 | module->GetTimeManager().GetStandardNetworkSystemClockCore().GetClockContext( | 268 | module->GetTimeManager().GetStandardNetworkSystemClockCore().GetClockContext( |
| 267 | Core::System::GetInstance(), network_context)}; | 269 | system, network_context)}; |
| 268 | result != RESULT_SUCCESS) { | 270 | result.IsError()) { |
| 269 | IPC::ResponseBuilder rb{ctx, 2}; | 271 | IPC::ResponseBuilder rb{ctx, 2}; |
| 270 | rb.Push(result); | 272 | rb.Push(result); |
| 271 | return; | 273 | return; |
| @@ -274,7 +276,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { | |||
| 274 | Clock::ClockSnapshot clock_snapshot{}; | 276 | Clock::ClockSnapshot clock_snapshot{}; |
| 275 | if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal( | 277 | if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal( |
| 276 | &ctx.GetThread(), user_context, network_context, type, clock_snapshot)}; | 278 | &ctx.GetThread(), user_context, network_context, type, clock_snapshot)}; |
| 277 | result != RESULT_SUCCESS) { | 279 | result.IsError()) { |
| 278 | IPC::ResponseBuilder rb{ctx, 2}; | 280 | IPC::ResponseBuilder rb{ctx, 2}; |
| 279 | rb.Push(result); | 281 | rb.Push(result); |
| 280 | return; | 282 | return; |
diff --git a/src/core/reporter.h b/src/core/reporter.h index 380941b1b..86d760cf0 100644 --- a/src/core/reporter.h +++ b/src/core/reporter.h | |||
| @@ -56,6 +56,7 @@ public: | |||
| 56 | 56 | ||
| 57 | enum class PlayReportType { | 57 | enum class PlayReportType { |
| 58 | Old, | 58 | Old, |
| 59 | Old2, | ||
| 59 | New, | 60 | New, |
| 60 | System, | 61 | System, |
| 61 | }; | 62 | }; |
diff --git a/src/core/settings.cpp b/src/core/settings.cpp index c1282cb80..cd6c257f5 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp | |||
| @@ -92,7 +92,7 @@ void LogSettings() { | |||
| 92 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); | 92 | LogSetting("Renderer_UseFrameLimit", Settings::values.use_frame_limit); |
| 93 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); | 93 | LogSetting("Renderer_FrameLimit", Settings::values.frame_limit); |
| 94 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); | 94 | LogSetting("Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); |
| 95 | LogSetting("Renderer_UseAccurateGpuEmulation", Settings::values.use_accurate_gpu_emulation); | 95 | LogSetting("Renderer_GPUAccuracyLevel", Settings::values.gpu_accuracy); |
| 96 | LogSetting("Renderer_UseAsynchronousGpuEmulation", | 96 | LogSetting("Renderer_UseAsynchronousGpuEmulation", |
| 97 | Settings::values.use_asynchronous_gpu_emulation); | 97 | Settings::values.use_asynchronous_gpu_emulation); |
| 98 | LogSetting("Renderer_UseVsync", Settings::values.use_vsync); | 98 | LogSetting("Renderer_UseVsync", Settings::values.use_vsync); |
| @@ -109,4 +109,12 @@ void LogSettings() { | |||
| 109 | LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); | 109 | LogSetting("Services_BCATBoxcatLocal", Settings::values.bcat_boxcat_local); |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | bool IsGPULevelExtreme() { | ||
| 113 | return values.gpu_accuracy == GPUAccuracy::Extreme; | ||
| 114 | } | ||
| 115 | |||
| 116 | bool IsGPULevelHigh() { | ||
| 117 | return values.gpu_accuracy == GPUAccuracy::Extreme || values.gpu_accuracy == GPUAccuracy::High; | ||
| 118 | } | ||
| 119 | |||
| 112 | } // namespace Settings | 120 | } // namespace Settings |
diff --git a/src/core/settings.h b/src/core/settings.h index c73d1c596..163900f0b 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -376,6 +376,12 @@ enum class RendererBackend { | |||
| 376 | Vulkan = 1, | 376 | Vulkan = 1, |
| 377 | }; | 377 | }; |
| 378 | 378 | ||
| 379 | enum class GPUAccuracy : u32 { | ||
| 380 | Normal = 0, | ||
| 381 | High = 1, | ||
| 382 | Extreme = 2, | ||
| 383 | }; | ||
| 384 | |||
| 379 | struct Values { | 385 | struct Values { |
| 380 | // System | 386 | // System |
| 381 | bool use_docked_mode; | 387 | bool use_docked_mode; |
| @@ -436,10 +442,11 @@ struct Values { | |||
| 436 | bool use_frame_limit; | 442 | bool use_frame_limit; |
| 437 | u16 frame_limit; | 443 | u16 frame_limit; |
| 438 | bool use_disk_shader_cache; | 444 | bool use_disk_shader_cache; |
| 439 | bool use_accurate_gpu_emulation; | 445 | GPUAccuracy gpu_accuracy; |
| 440 | bool use_asynchronous_gpu_emulation; | 446 | bool use_asynchronous_gpu_emulation; |
| 441 | bool use_vsync; | 447 | bool use_vsync; |
| 442 | bool force_30fps_mode; | 448 | bool force_30fps_mode; |
| 449 | bool use_fast_gpu_time; | ||
| 443 | 450 | ||
| 444 | float bg_red; | 451 | float bg_red; |
| 445 | float bg_green; | 452 | float bg_green; |
| @@ -480,6 +487,9 @@ struct Values { | |||
| 480 | std::map<u64, std::vector<std::string>> disabled_addons; | 487 | std::map<u64, std::vector<std::string>> disabled_addons; |
| 481 | } extern values; | 488 | } extern values; |
| 482 | 489 | ||
| 490 | bool IsGPULevelExtreme(); | ||
| 491 | bool IsGPULevelHigh(); | ||
| 492 | |||
| 483 | void Apply(); | 493 | void Apply(); |
| 484 | void LogSettings(); | 494 | void LogSettings(); |
| 485 | } // namespace Settings | 495 | } // namespace Settings |
diff --git a/src/core/telemetry_session.cpp b/src/core/telemetry_session.cpp index fd5a3ee9f..1c3b03a1c 100644 --- a/src/core/telemetry_session.cpp +++ b/src/core/telemetry_session.cpp | |||
| @@ -56,6 +56,18 @@ static const char* TranslateRenderer(Settings::RendererBackend backend) { | |||
| 56 | return "Unknown"; | 56 | return "Unknown"; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | static const char* TranslateGPUAccuracyLevel(Settings::GPUAccuracy backend) { | ||
| 60 | switch (backend) { | ||
| 61 | case Settings::GPUAccuracy::Normal: | ||
| 62 | return "Normal"; | ||
| 63 | case Settings::GPUAccuracy::High: | ||
| 64 | return "High"; | ||
| 65 | case Settings::GPUAccuracy::Extreme: | ||
| 66 | return "Extreme"; | ||
| 67 | } | ||
| 68 | return "Unknown"; | ||
| 69 | } | ||
| 70 | |||
| 59 | u64 GetTelemetryId() { | 71 | u64 GetTelemetryId() { |
| 60 | u64 telemetry_id{}; | 72 | u64 telemetry_id{}; |
| 61 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + | 73 | const std::string filename{FileUtil::GetUserPath(FileUtil::UserPath::ConfigDir) + |
| @@ -184,8 +196,8 @@ void TelemetrySession::AddInitialInfo(Loader::AppLoader& app_loader) { | |||
| 184 | AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit); | 196 | AddField(field_type, "Renderer_UseFrameLimit", Settings::values.use_frame_limit); |
| 185 | AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit); | 197 | AddField(field_type, "Renderer_FrameLimit", Settings::values.frame_limit); |
| 186 | AddField(field_type, "Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); | 198 | AddField(field_type, "Renderer_UseDiskShaderCache", Settings::values.use_disk_shader_cache); |
| 187 | AddField(field_type, "Renderer_UseAccurateGpuEmulation", | 199 | AddField(field_type, "Renderer_GPUAccuracyLevel", |
| 188 | Settings::values.use_accurate_gpu_emulation); | 200 | TranslateGPUAccuracyLevel(Settings::values.gpu_accuracy)); |
| 189 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", | 201 | AddField(field_type, "Renderer_UseAsynchronousGpuEmulation", |
| 190 | Settings::values.use_asynchronous_gpu_emulation); | 202 | Settings::values.use_asynchronous_gpu_emulation); |
| 191 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync); | 203 | AddField(field_type, "Renderer_UseVsync", Settings::values.use_vsync); |