diff options
67 files changed, 778 insertions, 159 deletions
diff --git a/src/common/bit_field.h b/src/common/bit_field.h index fd2bbbd99..26ae6c7fc 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h | |||
| @@ -180,7 +180,7 @@ public: | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | constexpr void Assign(const T& value) { | 182 | constexpr void Assign(const T& value) { |
| 183 | storage = (static_cast<StorageType>(storage) & ~mask) | FormatValue(value); | 183 | storage = static_cast<StorageType>((storage & ~mask) | FormatValue(value)); |
| 184 | } | 184 | } |
| 185 | 185 | ||
| 186 | constexpr T Value() const { | 186 | constexpr T Value() const { |
diff --git a/src/core/hle/kernel/memory/page_table.cpp b/src/core/hle/kernel/memory/page_table.cpp index 2c9925f33..3281611f8 100644 --- a/src/core/hle/kernel/memory/page_table.cpp +++ b/src/core/hle/kernel/memory/page_table.cpp | |||
| @@ -854,7 +854,7 @@ ResultCode PageTable::LockForDeviceAddressSpace(VAddr addr, std::size_t size) { | |||
| 854 | } | 854 | } |
| 855 | 855 | ||
| 856 | block_manager->UpdateLock(addr, size / PageSize, | 856 | block_manager->UpdateLock(addr, size / PageSize, |
| 857 | [perm](MemoryBlockManager::iterator block, MemoryPermission perm) { | 857 | [](MemoryBlockManager::iterator block, MemoryPermission perm) { |
| 858 | block->ShareToDevice(perm); | 858 | block->ShareToDevice(perm); |
| 859 | }, | 859 | }, |
| 860 | perm); | 860 | perm); |
| @@ -876,7 +876,7 @@ ResultCode PageTable::UnlockForDeviceAddressSpace(VAddr addr, std::size_t size) | |||
| 876 | } | 876 | } |
| 877 | 877 | ||
| 878 | block_manager->UpdateLock(addr, size / PageSize, | 878 | block_manager->UpdateLock(addr, size / PageSize, |
| 879 | [perm](MemoryBlockManager::iterator block, MemoryPermission perm) { | 879 | [](MemoryBlockManager::iterator block, MemoryPermission perm) { |
| 880 | block->UnshareToDevice(perm); | 880 | block->UnshareToDevice(perm); |
| 881 | }, | 881 | }, |
| 882 | perm); | 882 | perm); |
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/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/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/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/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.h b/src/core/settings.h index 7d09253f5..163900f0b 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -446,6 +446,7 @@ struct Values { | |||
| 446 | bool use_asynchronous_gpu_emulation; | 446 | bool use_asynchronous_gpu_emulation; |
| 447 | bool use_vsync; | 447 | bool use_vsync; |
| 448 | bool force_30fps_mode; | 448 | bool force_30fps_mode; |
| 449 | bool use_fast_gpu_time; | ||
| 449 | 450 | ||
| 450 | float bg_red; | 451 | float bg_red; |
| 451 | float bg_green; | 452 | float bg_green; |
diff --git a/src/video_core/dma_pusher.cpp b/src/video_core/dma_pusher.cpp index 324dafdcd..16311f05e 100644 --- a/src/video_core/dma_pusher.cpp +++ b/src/video_core/dma_pusher.cpp | |||
| @@ -71,16 +71,22 @@ bool DmaPusher::Step() { | |||
| 71 | gpu.MemoryManager().ReadBlockUnsafe(dma_get, command_headers.data(), | 71 | gpu.MemoryManager().ReadBlockUnsafe(dma_get, command_headers.data(), |
| 72 | command_list_header.size * sizeof(u32)); | 72 | command_list_header.size * sizeof(u32)); |
| 73 | 73 | ||
| 74 | for (const CommandHeader& command_header : command_headers) { | 74 | for (std::size_t index = 0; index < command_headers.size();) { |
| 75 | 75 | const CommandHeader& command_header = command_headers[index]; | |
| 76 | // now, see if we're in the middle of a command | 76 | |
| 77 | if (dma_state.length_pending) { | 77 | if (dma_state.method_count) { |
| 78 | // Second word of long non-inc methods command - method count | ||
| 79 | dma_state.length_pending = 0; | ||
| 80 | dma_state.method_count = command_header.method_count_; | ||
| 81 | } else if (dma_state.method_count) { | ||
| 82 | // Data word of methods command | 78 | // Data word of methods command |
| 83 | CallMethod(command_header.argument); | 79 | if (dma_state.non_incrementing) { |
| 80 | const u32 max_write = static_cast<u32>( | ||
| 81 | std::min<std::size_t>(index + dma_state.method_count, command_headers.size()) - | ||
| 82 | index); | ||
| 83 | CallMultiMethod(&command_header.argument, max_write); | ||
| 84 | dma_state.method_count -= max_write; | ||
| 85 | index += max_write; | ||
| 86 | continue; | ||
| 87 | } else { | ||
| 88 | CallMethod(command_header.argument); | ||
| 89 | } | ||
| 84 | 90 | ||
| 85 | if (!dma_state.non_incrementing) { | 91 | if (!dma_state.non_incrementing) { |
| 86 | dma_state.method++; | 92 | dma_state.method++; |
| @@ -120,6 +126,7 @@ bool DmaPusher::Step() { | |||
| 120 | break; | 126 | break; |
| 121 | } | 127 | } |
| 122 | } | 128 | } |
| 129 | index++; | ||
| 123 | } | 130 | } |
| 124 | 131 | ||
| 125 | if (!non_main) { | 132 | if (!non_main) { |
| @@ -140,4 +147,9 @@ void DmaPusher::CallMethod(u32 argument) const { | |||
| 140 | gpu.CallMethod({dma_state.method, argument, dma_state.subchannel, dma_state.method_count}); | 147 | gpu.CallMethod({dma_state.method, argument, dma_state.subchannel, dma_state.method_count}); |
| 141 | } | 148 | } |
| 142 | 149 | ||
| 150 | void DmaPusher::CallMultiMethod(const u32* base_start, u32 num_methods) const { | ||
| 151 | gpu.CallMultiMethod(dma_state.method, dma_state.subchannel, base_start, num_methods, | ||
| 152 | dma_state.method_count); | ||
| 153 | } | ||
| 154 | |||
| 143 | } // namespace Tegra | 155 | } // namespace Tegra |
diff --git a/src/video_core/dma_pusher.h b/src/video_core/dma_pusher.h index d6188614a..6cef71306 100644 --- a/src/video_core/dma_pusher.h +++ b/src/video_core/dma_pusher.h | |||
| @@ -75,6 +75,7 @@ private: | |||
| 75 | void SetState(const CommandHeader& command_header); | 75 | void SetState(const CommandHeader& command_header); |
| 76 | 76 | ||
| 77 | void CallMethod(u32 argument) const; | 77 | void CallMethod(u32 argument) const; |
| 78 | void CallMultiMethod(const u32* base_start, u32 num_methods) const; | ||
| 78 | 79 | ||
| 79 | std::vector<CommandHeader> command_headers; ///< Buffer for list of commands fetched at once | 80 | std::vector<CommandHeader> command_headers; ///< Buffer for list of commands fetched at once |
| 80 | 81 | ||
diff --git a/src/video_core/engines/fermi_2d.cpp b/src/video_core/engines/fermi_2d.cpp index bace6affb..8a47614d2 100644 --- a/src/video_core/engines/fermi_2d.cpp +++ b/src/video_core/engines/fermi_2d.cpp | |||
| @@ -28,6 +28,12 @@ void Fermi2D::CallMethod(const GPU::MethodCall& method_call) { | |||
| 28 | } | 28 | } |
| 29 | } | 29 | } |
| 30 | 30 | ||
| 31 | void Fermi2D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) { | ||
| 32 | for (std::size_t i = 0; i < amount; i++) { | ||
| 33 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 34 | } | ||
| 35 | } | ||
| 36 | |||
| 31 | static std::pair<u32, u32> DelimitLine(u32 src_1, u32 src_2, u32 dst_1, u32 dst_2, u32 src_line) { | 37 | static std::pair<u32, u32> DelimitLine(u32 src_1, u32 src_2, u32 dst_1, u32 dst_2, u32 src_line) { |
| 32 | const u32 line_a = src_2 - src_1; | 38 | const u32 line_a = src_2 - src_1; |
| 33 | const u32 line_b = dst_2 - dst_1; | 39 | const u32 line_b = dst_2 - dst_1; |
diff --git a/src/video_core/engines/fermi_2d.h b/src/video_core/engines/fermi_2d.h index dba342c70..939a5966d 100644 --- a/src/video_core/engines/fermi_2d.h +++ b/src/video_core/engines/fermi_2d.h | |||
| @@ -39,6 +39,9 @@ public: | |||
| 39 | /// Write the value to the register identified by method. | 39 | /// Write the value to the register identified by method. |
| 40 | void CallMethod(const GPU::MethodCall& method_call); | 40 | void CallMethod(const GPU::MethodCall& method_call); |
| 41 | 41 | ||
| 42 | /// Write multiple values to the register identified by method. | ||
| 43 | void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending); | ||
| 44 | |||
| 42 | enum class Origin : u32 { | 45 | enum class Origin : u32 { |
| 43 | Center = 0, | 46 | Center = 0, |
| 44 | Corner = 1, | 47 | Corner = 1, |
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp index 368c75a66..00a12175f 100644 --- a/src/video_core/engines/kepler_compute.cpp +++ b/src/video_core/engines/kepler_compute.cpp | |||
| @@ -51,6 +51,13 @@ void KeplerCompute::CallMethod(const GPU::MethodCall& method_call) { | |||
| 51 | } | 51 | } |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | void KeplerCompute::CallMultiMethod(u32 method, const u32* base_start, u32 amount, | ||
| 55 | u32 methods_pending) { | ||
| 56 | for (std::size_t i = 0; i < amount; i++) { | ||
| 57 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 58 | } | ||
| 59 | } | ||
| 60 | |||
| 54 | Texture::FullTextureInfo KeplerCompute::GetTexture(std::size_t offset) const { | 61 | Texture::FullTextureInfo KeplerCompute::GetTexture(std::size_t offset) const { |
| 55 | const std::bitset<8> cbuf_mask = launch_description.const_buffer_enable_mask.Value(); | 62 | const std::bitset<8> cbuf_mask = launch_description.const_buffer_enable_mask.Value(); |
| 56 | ASSERT(cbuf_mask[regs.tex_cb_index]); | 63 | ASSERT(cbuf_mask[regs.tex_cb_index]); |
diff --git a/src/video_core/engines/kepler_compute.h b/src/video_core/engines/kepler_compute.h index eeb79c56f..fe55fdfd0 100644 --- a/src/video_core/engines/kepler_compute.h +++ b/src/video_core/engines/kepler_compute.h | |||
| @@ -202,6 +202,9 @@ public: | |||
| 202 | /// Write the value to the register identified by method. | 202 | /// Write the value to the register identified by method. |
| 203 | void CallMethod(const GPU::MethodCall& method_call); | 203 | void CallMethod(const GPU::MethodCall& method_call); |
| 204 | 204 | ||
| 205 | /// Write multiple values to the register identified by method. | ||
| 206 | void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending); | ||
| 207 | |||
| 205 | Texture::FullTextureInfo GetTexture(std::size_t offset) const; | 208 | Texture::FullTextureInfo GetTexture(std::size_t offset) const; |
| 206 | 209 | ||
| 207 | /// Given a texture handle, returns the TSC and TIC entries. | 210 | /// Given a texture handle, returns the TSC and TIC entries. |
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp index 597872e43..586ff15dc 100644 --- a/src/video_core/engines/kepler_memory.cpp +++ b/src/video_core/engines/kepler_memory.cpp | |||
| @@ -41,4 +41,11 @@ void KeplerMemory::CallMethod(const GPU::MethodCall& method_call) { | |||
| 41 | } | 41 | } |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | void KeplerMemory::CallMultiMethod(u32 method, const u32* base_start, u32 amount, | ||
| 45 | u32 methods_pending) { | ||
| 46 | for (std::size_t i = 0; i < amount; i++) { | ||
| 47 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 48 | } | ||
| 49 | } | ||
| 50 | |||
| 44 | } // namespace Tegra::Engines | 51 | } // namespace Tegra::Engines |
diff --git a/src/video_core/engines/kepler_memory.h b/src/video_core/engines/kepler_memory.h index 396fb6e86..bb26fb030 100644 --- a/src/video_core/engines/kepler_memory.h +++ b/src/video_core/engines/kepler_memory.h | |||
| @@ -40,6 +40,9 @@ public: | |||
| 40 | /// Write the value to the register identified by method. | 40 | /// Write the value to the register identified by method. |
| 41 | void CallMethod(const GPU::MethodCall& method_call); | 41 | void CallMethod(const GPU::MethodCall& method_call); |
| 42 | 42 | ||
| 43 | /// Write multiple values to the register identified by method. | ||
| 44 | void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending); | ||
| 45 | |||
| 43 | struct Regs { | 46 | struct Regs { |
| 44 | static constexpr size_t NUM_REGS = 0x7F; | 47 | static constexpr size_t NUM_REGS = 0x7F; |
| 45 | 48 | ||
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 2824ed707..39e3b66a2 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -280,6 +280,58 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) { | |||
| 280 | } | 280 | } |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, | ||
| 284 | u32 methods_pending) { | ||
| 285 | // Methods after 0xE00 are special, they're actually triggers for some microcode that was | ||
| 286 | // uploaded to the GPU during initialization. | ||
| 287 | if (method >= MacroRegistersStart) { | ||
| 288 | // We're trying to execute a macro | ||
| 289 | if (executing_macro == 0) { | ||
| 290 | // A macro call must begin by writing the macro method's register, not its argument. | ||
| 291 | ASSERT_MSG((method % 2) == 0, | ||
| 292 | "Can't start macro execution by writing to the ARGS register"); | ||
| 293 | executing_macro = method; | ||
| 294 | } | ||
| 295 | |||
| 296 | for (std::size_t i = 0; i < amount; i++) { | ||
| 297 | macro_params.push_back(base_start[i]); | ||
| 298 | } | ||
| 299 | |||
| 300 | // Call the macro when there are no more parameters in the command buffer | ||
| 301 | if (amount == methods_pending) { | ||
| 302 | CallMacroMethod(executing_macro, macro_params.size(), macro_params.data()); | ||
| 303 | macro_params.clear(); | ||
| 304 | } | ||
| 305 | return; | ||
| 306 | } | ||
| 307 | switch (method) { | ||
| 308 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]): | ||
| 309 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]): | ||
| 310 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[2]): | ||
| 311 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[3]): | ||
| 312 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[4]): | ||
| 313 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[5]): | ||
| 314 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[6]): | ||
| 315 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[7]): | ||
| 316 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[8]): | ||
| 317 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[9]): | ||
| 318 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[10]): | ||
| 319 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[11]): | ||
| 320 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[12]): | ||
| 321 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[13]): | ||
| 322 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[14]): | ||
| 323 | case MAXWELL3D_REG_INDEX(const_buffer.cb_data[15]): { | ||
| 324 | ProcessCBMultiData(method, base_start, amount); | ||
| 325 | break; | ||
| 326 | } | ||
| 327 | default: { | ||
| 328 | for (std::size_t i = 0; i < amount; i++) { | ||
| 329 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 330 | } | ||
| 331 | } | ||
| 332 | } | ||
| 333 | } | ||
| 334 | |||
| 283 | void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) { | 335 | void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) { |
| 284 | if (mme_draw.current_mode == MMEDrawMode::Undefined) { | 336 | if (mme_draw.current_mode == MMEDrawMode::Undefined) { |
| 285 | if (mme_draw.gl_begin_consume) { | 337 | if (mme_draw.gl_begin_consume) { |
| @@ -570,6 +622,28 @@ void Maxwell3D::StartCBData(u32 method) { | |||
| 570 | ProcessCBData(regs.const_buffer.cb_data[cb_data_state.id]); | 622 | ProcessCBData(regs.const_buffer.cb_data[cb_data_state.id]); |
| 571 | } | 623 | } |
| 572 | 624 | ||
| 625 | void Maxwell3D::ProcessCBMultiData(u32 method, const u32* start_base, u32 amount) { | ||
| 626 | if (cb_data_state.current != method) { | ||
| 627 | if (cb_data_state.current != null_cb_data) { | ||
| 628 | FinishCBData(); | ||
| 629 | } | ||
| 630 | constexpr u32 first_cb_data = MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]); | ||
| 631 | cb_data_state.start_pos = regs.const_buffer.cb_pos; | ||
| 632 | cb_data_state.id = method - first_cb_data; | ||
| 633 | cb_data_state.current = method; | ||
| 634 | cb_data_state.counter = 0; | ||
| 635 | } | ||
| 636 | const std::size_t id = cb_data_state.id; | ||
| 637 | const std::size_t size = amount; | ||
| 638 | std::size_t i = 0; | ||
| 639 | for (; i < size; i++) { | ||
| 640 | cb_data_state.buffer[id][cb_data_state.counter] = start_base[i]; | ||
| 641 | cb_data_state.counter++; | ||
| 642 | } | ||
| 643 | // Increment the current buffer position. | ||
| 644 | regs.const_buffer.cb_pos = regs.const_buffer.cb_pos + 4 * amount; | ||
| 645 | } | ||
| 646 | |||
| 573 | void Maxwell3D::FinishCBData() { | 647 | void Maxwell3D::FinishCBData() { |
| 574 | // Write the input value to the current const buffer at the current position. | 648 | // Write the input value to the current const buffer at the current position. |
| 575 | const GPUVAddr buffer_address = regs.const_buffer.BufferAddress(); | 649 | const GPUVAddr buffer_address = regs.const_buffer.BufferAddress(); |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 59d5752d2..3dfba8197 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -1259,7 +1259,8 @@ public: | |||
| 1259 | 1259 | ||
| 1260 | GPUVAddr LimitAddress() const { | 1260 | GPUVAddr LimitAddress() const { |
| 1261 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(limit_high) << 32) | | 1261 | return static_cast<GPUVAddr>((static_cast<GPUVAddr>(limit_high) << 32) | |
| 1262 | limit_low); | 1262 | limit_low) + |
| 1263 | 1; | ||
| 1263 | } | 1264 | } |
| 1264 | } vertex_array_limit[NumVertexArrays]; | 1265 | } vertex_array_limit[NumVertexArrays]; |
| 1265 | 1266 | ||
| @@ -1358,6 +1359,9 @@ public: | |||
| 1358 | /// Write the value to the register identified by method. | 1359 | /// Write the value to the register identified by method. |
| 1359 | void CallMethod(const GPU::MethodCall& method_call); | 1360 | void CallMethod(const GPU::MethodCall& method_call); |
| 1360 | 1361 | ||
| 1362 | /// Write multiple values to the register identified by method. | ||
| 1363 | void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending); | ||
| 1364 | |||
| 1361 | /// Write the value to the register identified by method. | 1365 | /// Write the value to the register identified by method. |
| 1362 | void CallMethodFromMME(const GPU::MethodCall& method_call); | 1366 | void CallMethodFromMME(const GPU::MethodCall& method_call); |
| 1363 | 1367 | ||
| @@ -1511,6 +1515,7 @@ private: | |||
| 1511 | /// Handles a write to the CB_DATA[i] register. | 1515 | /// Handles a write to the CB_DATA[i] register. |
| 1512 | void StartCBData(u32 method); | 1516 | void StartCBData(u32 method); |
| 1513 | void ProcessCBData(u32 value); | 1517 | void ProcessCBData(u32 value); |
| 1518 | void ProcessCBMultiData(u32 method, const u32* start_base, u32 amount); | ||
| 1514 | void FinishCBData(); | 1519 | void FinishCBData(); |
| 1515 | 1520 | ||
| 1516 | /// Handles a write to the CB_BIND register. | 1521 | /// Handles a write to the CB_BIND register. |
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp index 3bfed6ab8..6630005b0 100644 --- a/src/video_core/engines/maxwell_dma.cpp +++ b/src/video_core/engines/maxwell_dma.cpp | |||
| @@ -36,6 +36,13 @@ void MaxwellDMA::CallMethod(const GPU::MethodCall& method_call) { | |||
| 36 | #undef MAXWELLDMA_REG_INDEX | 36 | #undef MAXWELLDMA_REG_INDEX |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | void MaxwellDMA::CallMultiMethod(u32 method, const u32* base_start, u32 amount, | ||
| 40 | u32 methods_pending) { | ||
| 41 | for (std::size_t i = 0; i < amount; i++) { | ||
| 42 | CallMethod({method, base_start[i], 0, methods_pending - static_cast<u32>(i)}); | ||
| 43 | } | ||
| 44 | } | ||
| 45 | |||
| 39 | void MaxwellDMA::HandleCopy() { | 46 | void MaxwellDMA::HandleCopy() { |
| 40 | LOG_TRACE(HW_GPU, "Requested a DMA copy"); | 47 | LOG_TRACE(HW_GPU, "Requested a DMA copy"); |
| 41 | 48 | ||
diff --git a/src/video_core/engines/maxwell_dma.h b/src/video_core/engines/maxwell_dma.h index 4f40d1d1f..c43ed8194 100644 --- a/src/video_core/engines/maxwell_dma.h +++ b/src/video_core/engines/maxwell_dma.h | |||
| @@ -35,6 +35,9 @@ public: | |||
| 35 | /// Write the value to the register identified by method. | 35 | /// Write the value to the register identified by method. |
| 36 | void CallMethod(const GPU::MethodCall& method_call); | 36 | void CallMethod(const GPU::MethodCall& method_call); |
| 37 | 37 | ||
| 38 | /// Write multiple values to the register identified by method. | ||
| 39 | void CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending); | ||
| 40 | |||
| 38 | struct Regs { | 41 | struct Regs { |
| 39 | static constexpr std::size_t NUM_REGS = 0x1D6; | 42 | static constexpr std::size_t NUM_REGS = 0x1D6; |
| 40 | 43 | ||
diff --git a/src/video_core/engines/shader_bytecode.h b/src/video_core/engines/shader_bytecode.h index 7231597d4..cde3a26b9 100644 --- a/src/video_core/engines/shader_bytecode.h +++ b/src/video_core/engines/shader_bytecode.h | |||
| @@ -655,6 +655,7 @@ union Instruction { | |||
| 655 | } | 655 | } |
| 656 | 656 | ||
| 657 | constexpr Instruction(u64 value) : value{value} {} | 657 | constexpr Instruction(u64 value) : value{value} {} |
| 658 | constexpr Instruction(const Instruction& instr) : value(instr.value) {} | ||
| 658 | 659 | ||
| 659 | BitField<0, 8, Register> gpr0; | 660 | BitField<0, 8, Register> gpr0; |
| 660 | BitField<8, 8, Register> gpr8; | 661 | BitField<8, 8, Register> gpr8; |
| @@ -817,11 +818,9 @@ union Instruction { | |||
| 817 | BitField<32, 1, u64> saturate; | 818 | BitField<32, 1, u64> saturate; |
| 818 | BitField<49, 2, HalfMerge> merge; | 819 | BitField<49, 2, HalfMerge> merge; |
| 819 | 820 | ||
| 820 | BitField<43, 1, u64> negate_a; | ||
| 821 | BitField<44, 1, u64> abs_a; | 821 | BitField<44, 1, u64> abs_a; |
| 822 | BitField<47, 2, HalfType> type_a; | 822 | BitField<47, 2, HalfType> type_a; |
| 823 | 823 | ||
| 824 | BitField<31, 1, u64> negate_b; | ||
| 825 | BitField<30, 1, u64> abs_b; | 824 | BitField<30, 1, u64> abs_b; |
| 826 | BitField<28, 2, HalfType> type_b; | 825 | BitField<28, 2, HalfType> type_b; |
| 827 | 826 | ||
diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp index 3b7572d61..b87fd873d 100644 --- a/src/video_core/gpu.cpp +++ b/src/video_core/gpu.cpp | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include "core/core_timing_util.h" | 9 | #include "core/core_timing_util.h" |
| 10 | #include "core/frontend/emu_window.h" | 10 | #include "core/frontend/emu_window.h" |
| 11 | #include "core/memory.h" | 11 | #include "core/memory.h" |
| 12 | #include "core/settings.h" | ||
| 12 | #include "video_core/engines/fermi_2d.h" | 13 | #include "video_core/engines/fermi_2d.h" |
| 13 | #include "video_core/engines/kepler_compute.h" | 14 | #include "video_core/engines/kepler_compute.h" |
| 14 | #include "video_core/engines/kepler_memory.h" | 15 | #include "video_core/engines/kepler_memory.h" |
| @@ -154,7 +155,10 @@ u64 GPU::GetTicks() const { | |||
| 154 | constexpr u64 gpu_ticks_den = 625; | 155 | constexpr u64 gpu_ticks_den = 625; |
| 155 | 156 | ||
| 156 | const u64 cpu_ticks = system.CoreTiming().GetTicks(); | 157 | const u64 cpu_ticks = system.CoreTiming().GetTicks(); |
| 157 | const u64 nanoseconds = Core::Timing::CyclesToNs(cpu_ticks).count(); | 158 | u64 nanoseconds = Core::Timing::CyclesToNs(cpu_ticks).count(); |
| 159 | if (Settings::values.use_fast_gpu_time) { | ||
| 160 | nanoseconds /= 256; | ||
| 161 | } | ||
| 158 | const u64 nanoseconds_num = nanoseconds / gpu_ticks_den; | 162 | const u64 nanoseconds_num = nanoseconds / gpu_ticks_den; |
| 159 | const u64 nanoseconds_rem = nanoseconds % gpu_ticks_den; | 163 | const u64 nanoseconds_rem = nanoseconds % gpu_ticks_den; |
| 160 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; | 164 | return nanoseconds_num * gpu_ticks_num + (nanoseconds_rem * gpu_ticks_num) / gpu_ticks_den; |
| @@ -209,16 +213,32 @@ void GPU::CallMethod(const MethodCall& method_call) { | |||
| 209 | 213 | ||
| 210 | ASSERT(method_call.subchannel < bound_engines.size()); | 214 | ASSERT(method_call.subchannel < bound_engines.size()); |
| 211 | 215 | ||
| 212 | if (ExecuteMethodOnEngine(method_call)) { | 216 | if (ExecuteMethodOnEngine(method_call.method)) { |
| 213 | CallEngineMethod(method_call); | 217 | CallEngineMethod(method_call); |
| 214 | } else { | 218 | } else { |
| 215 | CallPullerMethod(method_call); | 219 | CallPullerMethod(method_call); |
| 216 | } | 220 | } |
| 217 | } | 221 | } |
| 218 | 222 | ||
| 219 | bool GPU::ExecuteMethodOnEngine(const MethodCall& method_call) { | 223 | void GPU::CallMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, |
| 220 | const auto method = static_cast<BufferMethods>(method_call.method); | 224 | u32 methods_pending) { |
| 221 | return method >= BufferMethods::NonPullerMethods; | 225 | LOG_TRACE(HW_GPU, "Processing method {:08X} on subchannel {}", method, subchannel); |
| 226 | |||
| 227 | ASSERT(subchannel < bound_engines.size()); | ||
| 228 | |||
| 229 | if (ExecuteMethodOnEngine(method)) { | ||
| 230 | CallEngineMultiMethod(method, subchannel, base_start, amount, methods_pending); | ||
| 231 | } else { | ||
| 232 | for (std::size_t i = 0; i < amount; i++) { | ||
| 233 | CallPullerMethod( | ||
| 234 | {method, base_start[i], subchannel, methods_pending - static_cast<u32>(i)}); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | } | ||
| 238 | |||
| 239 | bool GPU::ExecuteMethodOnEngine(u32 method) { | ||
| 240 | const auto buffer_method = static_cast<BufferMethods>(method); | ||
| 241 | return buffer_method >= BufferMethods::NonPullerMethods; | ||
| 222 | } | 242 | } |
| 223 | 243 | ||
| 224 | void GPU::CallPullerMethod(const MethodCall& method_call) { | 244 | void GPU::CallPullerMethod(const MethodCall& method_call) { |
| @@ -298,6 +318,31 @@ void GPU::CallEngineMethod(const MethodCall& method_call) { | |||
| 298 | } | 318 | } |
| 299 | } | 319 | } |
| 300 | 320 | ||
| 321 | void GPU::CallEngineMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, | ||
| 322 | u32 methods_pending) { | ||
| 323 | const EngineID engine = bound_engines[subchannel]; | ||
| 324 | |||
| 325 | switch (engine) { | ||
| 326 | case EngineID::FERMI_TWOD_A: | ||
| 327 | fermi_2d->CallMultiMethod(method, base_start, amount, methods_pending); | ||
| 328 | break; | ||
| 329 | case EngineID::MAXWELL_B: | ||
| 330 | maxwell_3d->CallMultiMethod(method, base_start, amount, methods_pending); | ||
| 331 | break; | ||
| 332 | case EngineID::KEPLER_COMPUTE_B: | ||
| 333 | kepler_compute->CallMultiMethod(method, base_start, amount, methods_pending); | ||
| 334 | break; | ||
| 335 | case EngineID::MAXWELL_DMA_COPY_A: | ||
| 336 | maxwell_dma->CallMultiMethod(method, base_start, amount, methods_pending); | ||
| 337 | break; | ||
| 338 | case EngineID::KEPLER_INLINE_TO_MEMORY_B: | ||
| 339 | kepler_memory->CallMultiMethod(method, base_start, amount, methods_pending); | ||
| 340 | break; | ||
| 341 | default: | ||
| 342 | UNIMPLEMENTED_MSG("Unimplemented engine"); | ||
| 343 | } | ||
| 344 | } | ||
| 345 | |||
| 301 | void GPU::ProcessBindMethod(const MethodCall& method_call) { | 346 | void GPU::ProcessBindMethod(const MethodCall& method_call) { |
| 302 | // Bind the current subchannel to the desired engine id. | 347 | // Bind the current subchannel to the desired engine id. |
| 303 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", method_call.subchannel, | 348 | LOG_DEBUG(HW_GPU, "Binding subchannel {} to engine {}", method_call.subchannel, |
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h index 5e3eb94e9..dd51c95b7 100644 --- a/src/video_core/gpu.h +++ b/src/video_core/gpu.h | |||
| @@ -155,6 +155,10 @@ public: | |||
| 155 | /// Calls a GPU method. | 155 | /// Calls a GPU method. |
| 156 | void CallMethod(const MethodCall& method_call); | 156 | void CallMethod(const MethodCall& method_call); |
| 157 | 157 | ||
| 158 | /// Calls a GPU multivalue method. | ||
| 159 | void CallMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, | ||
| 160 | u32 methods_pending); | ||
| 161 | |||
| 158 | /// Flush all current written commands into the host GPU for execution. | 162 | /// Flush all current written commands into the host GPU for execution. |
| 159 | void FlushCommands(); | 163 | void FlushCommands(); |
| 160 | /// Synchronizes CPU writes with Host GPU memory. | 164 | /// Synchronizes CPU writes with Host GPU memory. |
| @@ -309,8 +313,12 @@ private: | |||
| 309 | /// Calls a GPU engine method. | 313 | /// Calls a GPU engine method. |
| 310 | void CallEngineMethod(const MethodCall& method_call); | 314 | void CallEngineMethod(const MethodCall& method_call); |
| 311 | 315 | ||
| 316 | /// Calls a GPU engine multivalue method. | ||
| 317 | void CallEngineMultiMethod(u32 method, u32 subchannel, const u32* base_start, u32 amount, | ||
| 318 | u32 methods_pending); | ||
| 319 | |||
| 312 | /// Determines where the method should be executed. | 320 | /// Determines where the method should be executed. |
| 313 | bool ExecuteMethodOnEngine(const MethodCall& method_call); | 321 | bool ExecuteMethodOnEngine(u32 method); |
| 314 | 322 | ||
| 315 | protected: | 323 | protected: |
| 316 | std::unique_ptr<Tegra::DmaPusher> dma_pusher; | 324 | std::unique_ptr<Tegra::DmaPusher> dma_pusher; |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 4c16c89d2..6fe155bcc 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -186,8 +186,12 @@ void RasterizerOpenGL::SetupVertexBuffer() { | |||
| 186 | const GPUVAddr start = vertex_array.StartAddress(); | 186 | const GPUVAddr start = vertex_array.StartAddress(); |
| 187 | const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); | 187 | const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); |
| 188 | 188 | ||
| 189 | ASSERT(end > start); | 189 | ASSERT(end >= start); |
| 190 | const u64 size = end - start + 1; | 190 | const u64 size = end - start; |
| 191 | if (size == 0) { | ||
| 192 | glBindVertexBuffer(static_cast<GLuint>(index), 0, 0, vertex_array.stride); | ||
| 193 | continue; | ||
| 194 | } | ||
| 191 | const auto [vertex_buffer, vertex_buffer_offset] = buffer_cache.UploadMemory(start, size); | 195 | const auto [vertex_buffer, vertex_buffer_offset] = buffer_cache.UploadMemory(start, size); |
| 192 | glBindVertexBuffer(static_cast<GLuint>(index), vertex_buffer, vertex_buffer_offset, | 196 | glBindVertexBuffer(static_cast<GLuint>(index), vertex_buffer, vertex_buffer_offset, |
| 193 | vertex_array.stride); | 197 | vertex_array.stride); |
| @@ -311,8 +315,8 @@ std::size_t RasterizerOpenGL::CalculateVertexArraysSize() const { | |||
| 311 | const GPUVAddr start = regs.vertex_array[index].StartAddress(); | 315 | const GPUVAddr start = regs.vertex_array[index].StartAddress(); |
| 312 | const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); | 316 | const GPUVAddr end = regs.vertex_array_limit[index].LimitAddress(); |
| 313 | 317 | ||
| 314 | ASSERT(end > start); | 318 | size += end - start; |
| 315 | size += end - start + 1; | 319 | ASSERT(end >= start); |
| 316 | } | 320 | } |
| 317 | 321 | ||
| 318 | return size; | 322 | return size; |
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.h b/src/video_core/renderer_vulkan/fixed_pipeline_state.h index d4fd4d3f1..77188b862 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.h +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.h | |||
| @@ -129,7 +129,7 @@ struct FixedPipelineState { | |||
| 129 | auto& binding = bindings[index]; | 129 | auto& binding = bindings[index]; |
| 130 | binding.raw = 0; | 130 | binding.raw = 0; |
| 131 | binding.enabled.Assign(enabled ? 1 : 0); | 131 | binding.enabled.Assign(enabled ? 1 : 0); |
| 132 | binding.stride.Assign(stride); | 132 | binding.stride.Assign(static_cast<u16>(stride)); |
| 133 | binding_divisors[index] = divisor; | 133 | binding_divisors[index] = divisor; |
| 134 | } | 134 | } |
| 135 | 135 | ||
diff --git a/src/video_core/renderer_vulkan/vk_device.h b/src/video_core/renderer_vulkan/vk_device.h index a4d841e26..c8640762d 100644 --- a/src/video_core/renderer_vulkan/vk_device.h +++ b/src/video_core/renderer_vulkan/vk_device.h | |||
| @@ -82,11 +82,6 @@ public: | |||
| 82 | return present_family; | 82 | return present_family; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | /// Returns true if the device is integrated with the host CPU. | ||
| 86 | bool IsIntegrated() const { | ||
| 87 | return properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU; | ||
| 88 | } | ||
| 89 | |||
| 90 | /// Returns the current Vulkan API version provided in Vulkan-formatted version numbers. | 85 | /// Returns the current Vulkan API version provided in Vulkan-formatted version numbers. |
| 91 | u32 GetApiVersion() const { | 86 | u32 GetApiVersion() const { |
| 92 | return properties.apiVersion; | 87 | return properties.apiVersion; |
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.cpp b/src/video_core/renderer_vulkan/vk_memory_manager.cpp index 6a9e658bf..b4c650a63 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_memory_manager.cpp | |||
| @@ -118,8 +118,7 @@ private: | |||
| 118 | }; | 118 | }; |
| 119 | 119 | ||
| 120 | VKMemoryManager::VKMemoryManager(const VKDevice& device) | 120 | VKMemoryManager::VKMemoryManager(const VKDevice& device) |
| 121 | : device{device}, properties{device.GetPhysical().GetMemoryProperties()}, | 121 | : device{device}, properties{device.GetPhysical().GetMemoryProperties()} {} |
| 122 | is_memory_unified{GetMemoryUnified(properties)} {} | ||
| 123 | 122 | ||
| 124 | VKMemoryManager::~VKMemoryManager() = default; | 123 | VKMemoryManager::~VKMemoryManager() = default; |
| 125 | 124 | ||
| @@ -209,16 +208,6 @@ VKMemoryCommit VKMemoryManager::TryAllocCommit(const VkMemoryRequirements& requi | |||
| 209 | return {}; | 208 | return {}; |
| 210 | } | 209 | } |
| 211 | 210 | ||
| 212 | bool VKMemoryManager::GetMemoryUnified(const VkPhysicalDeviceMemoryProperties& properties) { | ||
| 213 | for (u32 heap_index = 0; heap_index < properties.memoryHeapCount; ++heap_index) { | ||
| 214 | if (!(properties.memoryHeaps[heap_index].flags & VK_MEMORY_HEAP_DEVICE_LOCAL_BIT)) { | ||
| 215 | // Memory is considered unified when heaps are device local only. | ||
| 216 | return false; | ||
| 217 | } | ||
| 218 | } | ||
| 219 | return true; | ||
| 220 | } | ||
| 221 | |||
| 222 | VKMemoryCommitImpl::VKMemoryCommitImpl(const VKDevice& device, VKMemoryAllocation* allocation, | 211 | VKMemoryCommitImpl::VKMemoryCommitImpl(const VKDevice& device, VKMemoryAllocation* allocation, |
| 223 | const vk::DeviceMemory& memory, u64 begin, u64 end) | 212 | const vk::DeviceMemory& memory, u64 begin, u64 end) |
| 224 | : device{device}, memory{memory}, interval{begin, end}, allocation{allocation} {} | 213 | : device{device}, memory{memory}, interval{begin, end}, allocation{allocation} {} |
diff --git a/src/video_core/renderer_vulkan/vk_memory_manager.h b/src/video_core/renderer_vulkan/vk_memory_manager.h index 5b6858e9b..1af88e3d4 100644 --- a/src/video_core/renderer_vulkan/vk_memory_manager.h +++ b/src/video_core/renderer_vulkan/vk_memory_manager.h | |||
| @@ -40,11 +40,6 @@ public: | |||
| 40 | /// Commits memory required by the image and binds it. | 40 | /// Commits memory required by the image and binds it. |
| 41 | VKMemoryCommit Commit(const vk::Image& image, bool host_visible); | 41 | VKMemoryCommit Commit(const vk::Image& image, bool host_visible); |
| 42 | 42 | ||
| 43 | /// Returns true if the memory allocations are done always in host visible and coherent memory. | ||
| 44 | bool IsMemoryUnified() const { | ||
| 45 | return is_memory_unified; | ||
| 46 | } | ||
| 47 | |||
| 48 | private: | 43 | private: |
| 49 | /// Allocates a chunk of memory. | 44 | /// Allocates a chunk of memory. |
| 50 | bool AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 type_mask, u64 size); | 45 | bool AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 type_mask, u64 size); |
| @@ -53,12 +48,8 @@ private: | |||
| 53 | VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements, | 48 | VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements, |
| 54 | VkMemoryPropertyFlags wanted_properties); | 49 | VkMemoryPropertyFlags wanted_properties); |
| 55 | 50 | ||
| 56 | /// Returns true if the device uses an unified memory model. | 51 | const VKDevice& device; ///< Device handler. |
| 57 | static bool GetMemoryUnified(const VkPhysicalDeviceMemoryProperties& properties); | 52 | const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties. |
| 58 | |||
| 59 | const VKDevice& device; ///< Device handler. | ||
| 60 | const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties. | ||
| 61 | const bool is_memory_unified; ///< True if memory model is unified. | ||
| 62 | std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations. | 53 | std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations. |
| 63 | }; | 54 | }; |
| 64 | 55 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 4eafdc14d..c821b1229 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -883,8 +883,12 @@ void RasterizerVulkan::SetupVertexArrays(FixedPipelineState::VertexInput& vertex | |||
| 883 | const GPUVAddr start{vertex_array.StartAddress()}; | 883 | const GPUVAddr start{vertex_array.StartAddress()}; |
| 884 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; | 884 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; |
| 885 | 885 | ||
| 886 | ASSERT(end > start); | 886 | ASSERT(end >= start); |
| 887 | const std::size_t size{end - start + 1}; | 887 | const std::size_t size{end - start}; |
| 888 | if (size == 0) { | ||
| 889 | buffer_bindings.AddVertexBinding(DefaultBuffer(), 0); | ||
| 890 | continue; | ||
| 891 | } | ||
| 888 | const auto [buffer, offset] = buffer_cache.UploadMemory(start, size); | 892 | const auto [buffer, offset] = buffer_cache.UploadMemory(start, size); |
| 889 | buffer_bindings.AddVertexBinding(buffer, offset); | 893 | buffer_bindings.AddVertexBinding(buffer, offset); |
| 890 | } | 894 | } |
| @@ -1039,8 +1043,7 @@ void RasterizerVulkan::SetupConstBuffer(const ConstBufferEntry& entry, | |||
| 1039 | const Tegra::Engines::ConstBufferInfo& buffer) { | 1043 | const Tegra::Engines::ConstBufferInfo& buffer) { |
| 1040 | if (!buffer.enabled) { | 1044 | if (!buffer.enabled) { |
| 1041 | // Set values to zero to unbind buffers | 1045 | // Set values to zero to unbind buffers |
| 1042 | update_descriptor_queue.AddBuffer(buffer_cache.GetEmptyBuffer(sizeof(float)), 0, | 1046 | update_descriptor_queue.AddBuffer(DefaultBuffer(), 0, DEFAULT_BUFFER_SIZE); |
| 1043 | sizeof(float)); | ||
| 1044 | return; | 1047 | return; |
| 1045 | } | 1048 | } |
| 1046 | 1049 | ||
| @@ -1063,7 +1066,9 @@ void RasterizerVulkan::SetupGlobalBuffer(const GlobalBufferEntry& entry, GPUVAdd | |||
| 1063 | if (size == 0) { | 1066 | if (size == 0) { |
| 1064 | // Sometimes global memory pointers don't have a proper size. Upload a dummy entry | 1067 | // Sometimes global memory pointers don't have a proper size. Upload a dummy entry |
| 1065 | // because Vulkan doesn't like empty buffers. | 1068 | // because Vulkan doesn't like empty buffers. |
| 1066 | constexpr std::size_t dummy_size = 4; | 1069 | // Note: Do *not* use DefaultBuffer() here, storage buffers can be written breaking the |
| 1070 | // default buffer. | ||
| 1071 | static constexpr std::size_t dummy_size = 4; | ||
| 1067 | const auto buffer = buffer_cache.GetEmptyBuffer(dummy_size); | 1072 | const auto buffer = buffer_cache.GetEmptyBuffer(dummy_size); |
| 1068 | update_descriptor_queue.AddBuffer(buffer, 0, dummy_size); | 1073 | update_descriptor_queue.AddBuffer(buffer, 0, dummy_size); |
| 1069 | return; | 1074 | return; |
| @@ -1228,7 +1233,7 @@ std::size_t RasterizerVulkan::CalculateVertexArraysSize() const { | |||
| 1228 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; | 1233 | const GPUVAddr end{regs.vertex_array_limit[index].LimitAddress()}; |
| 1229 | DEBUG_ASSERT(end >= start); | 1234 | DEBUG_ASSERT(end >= start); |
| 1230 | 1235 | ||
| 1231 | size += (end - start + 1) * regs.vertex_array[index].enable; | 1236 | size += (end - start) * regs.vertex_array[index].enable; |
| 1232 | } | 1237 | } |
| 1233 | return size; | 1238 | return size; |
| 1234 | } | 1239 | } |
| @@ -1276,4 +1281,29 @@ RenderPassParams RasterizerVulkan::GetRenderPassParams(Texceptions texceptions) | |||
| 1276 | return params; | 1281 | return params; |
| 1277 | } | 1282 | } |
| 1278 | 1283 | ||
| 1284 | VkBuffer RasterizerVulkan::DefaultBuffer() { | ||
| 1285 | if (default_buffer) { | ||
| 1286 | return *default_buffer; | ||
| 1287 | } | ||
| 1288 | |||
| 1289 | VkBufferCreateInfo ci; | ||
| 1290 | ci.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; | ||
| 1291 | ci.pNext = nullptr; | ||
| 1292 | ci.flags = 0; | ||
| 1293 | ci.size = DEFAULT_BUFFER_SIZE; | ||
| 1294 | ci.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | | ||
| 1295 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT; | ||
| 1296 | ci.sharingMode = VK_SHARING_MODE_EXCLUSIVE; | ||
| 1297 | ci.queueFamilyIndexCount = 0; | ||
| 1298 | ci.pQueueFamilyIndices = nullptr; | ||
| 1299 | default_buffer = device.GetLogical().CreateBuffer(ci); | ||
| 1300 | default_buffer_commit = memory_manager.Commit(default_buffer, false); | ||
| 1301 | |||
| 1302 | scheduler.RequestOutsideRenderPassOperationContext(); | ||
| 1303 | scheduler.Record([buffer = *default_buffer](vk::CommandBuffer cmdbuf) { | ||
| 1304 | cmdbuf.FillBuffer(buffer, 0, DEFAULT_BUFFER_SIZE, 0); | ||
| 1305 | }); | ||
| 1306 | return *default_buffer; | ||
| 1307 | } | ||
| 1308 | |||
| 1279 | } // namespace Vulkan | 1309 | } // namespace Vulkan |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.h b/src/video_core/renderer_vulkan/vk_rasterizer.h index 2fa46b0cc..d41a7929e 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.h +++ b/src/video_core/renderer_vulkan/vk_rasterizer.h | |||
| @@ -155,6 +155,7 @@ private: | |||
| 155 | using Texceptions = std::bitset<Maxwell::NumRenderTargets + 1>; | 155 | using Texceptions = std::bitset<Maxwell::NumRenderTargets + 1>; |
| 156 | 156 | ||
| 157 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; | 157 | static constexpr std::size_t ZETA_TEXCEPTION_INDEX = 8; |
| 158 | static constexpr VkDeviceSize DEFAULT_BUFFER_SIZE = 4 * sizeof(float); | ||
| 158 | 159 | ||
| 159 | void FlushWork(); | 160 | void FlushWork(); |
| 160 | 161 | ||
| @@ -247,6 +248,8 @@ private: | |||
| 247 | 248 | ||
| 248 | RenderPassParams GetRenderPassParams(Texceptions texceptions) const; | 249 | RenderPassParams GetRenderPassParams(Texceptions texceptions) const; |
| 249 | 250 | ||
| 251 | VkBuffer DefaultBuffer(); | ||
| 252 | |||
| 250 | Core::System& system; | 253 | Core::System& system; |
| 251 | Core::Frontend::EmuWindow& render_window; | 254 | Core::Frontend::EmuWindow& render_window; |
| 252 | VKScreenInfo& screen_info; | 255 | VKScreenInfo& screen_info; |
| @@ -271,6 +274,9 @@ private: | |||
| 271 | VKFenceManager fence_manager; | 274 | VKFenceManager fence_manager; |
| 272 | VKQueryCache query_cache; | 275 | VKQueryCache query_cache; |
| 273 | 276 | ||
| 277 | vk::Buffer default_buffer; | ||
| 278 | VKMemoryCommit default_buffer_commit; | ||
| 279 | |||
| 274 | std::array<View, Maxwell::NumRenderTargets> color_attachments; | 280 | std::array<View, Maxwell::NumRenderTargets> color_attachments; |
| 275 | View zeta_attachment; | 281 | View zeta_attachment; |
| 276 | 282 | ||
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp index 94d954d7a..45c180221 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.cpp | |||
| @@ -39,8 +39,7 @@ VKStagingBufferPool::StagingBuffer& VKStagingBufferPool::StagingBuffer::operator | |||
| 39 | 39 | ||
| 40 | VKStagingBufferPool::VKStagingBufferPool(const VKDevice& device, VKMemoryManager& memory_manager, | 40 | VKStagingBufferPool::VKStagingBufferPool(const VKDevice& device, VKMemoryManager& memory_manager, |
| 41 | VKScheduler& scheduler) | 41 | VKScheduler& scheduler) |
| 42 | : device{device}, memory_manager{memory_manager}, scheduler{scheduler}, | 42 | : device{device}, memory_manager{memory_manager}, scheduler{scheduler} {} |
| 43 | is_device_integrated{device.IsIntegrated()} {} | ||
| 44 | 43 | ||
| 45 | VKStagingBufferPool::~VKStagingBufferPool() = default; | 44 | VKStagingBufferPool::~VKStagingBufferPool() = default; |
| 46 | 45 | ||
| @@ -56,9 +55,7 @@ void VKStagingBufferPool::TickFrame() { | |||
| 56 | current_delete_level = (current_delete_level + 1) % NumLevels; | 55 | current_delete_level = (current_delete_level + 1) % NumLevels; |
| 57 | 56 | ||
| 58 | ReleaseCache(true); | 57 | ReleaseCache(true); |
| 59 | if (!is_device_integrated) { | 58 | ReleaseCache(false); |
| 60 | ReleaseCache(false); | ||
| 61 | } | ||
| 62 | } | 59 | } |
| 63 | 60 | ||
| 64 | VKBuffer* VKStagingBufferPool::TryGetReservedBuffer(std::size_t size, bool host_visible) { | 61 | VKBuffer* VKStagingBufferPool::TryGetReservedBuffer(std::size_t size, bool host_visible) { |
| @@ -81,7 +78,7 @@ VKBuffer& VKStagingBufferPool::CreateStagingBuffer(std::size_t size, bool host_v | |||
| 81 | ci.size = 1ULL << log2; | 78 | ci.size = 1ULL << log2; |
| 82 | ci.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | | 79 | ci.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | |
| 83 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | | 80 | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | |
| 84 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT; | 81 | VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; |
| 85 | ci.sharingMode = VK_SHARING_MODE_EXCLUSIVE; | 82 | ci.sharingMode = VK_SHARING_MODE_EXCLUSIVE; |
| 86 | ci.queueFamilyIndexCount = 0; | 83 | ci.queueFamilyIndexCount = 0; |
| 87 | ci.pQueueFamilyIndices = nullptr; | 84 | ci.pQueueFamilyIndices = nullptr; |
| @@ -95,7 +92,7 @@ VKBuffer& VKStagingBufferPool::CreateStagingBuffer(std::size_t size, bool host_v | |||
| 95 | } | 92 | } |
| 96 | 93 | ||
| 97 | VKStagingBufferPool::StagingBuffersCache& VKStagingBufferPool::GetCache(bool host_visible) { | 94 | VKStagingBufferPool::StagingBuffersCache& VKStagingBufferPool::GetCache(bool host_visible) { |
| 98 | return is_device_integrated || host_visible ? host_staging_buffers : device_staging_buffers; | 95 | return host_visible ? host_staging_buffers : device_staging_buffers; |
| 99 | } | 96 | } |
| 100 | 97 | ||
| 101 | void VKStagingBufferPool::ReleaseCache(bool host_visible) { | 98 | void VKStagingBufferPool::ReleaseCache(bool host_visible) { |
diff --git a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h index a0840ff8c..faf6418fd 100644 --- a/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h +++ b/src/video_core/renderer_vulkan/vk_staging_buffer_pool.h | |||
| @@ -71,7 +71,6 @@ private: | |||
| 71 | const VKDevice& device; | 71 | const VKDevice& device; |
| 72 | VKMemoryManager& memory_manager; | 72 | VKMemoryManager& memory_manager; |
| 73 | VKScheduler& scheduler; | 73 | VKScheduler& scheduler; |
| 74 | const bool is_device_integrated; | ||
| 75 | 74 | ||
| 76 | StagingBuffersCache host_staging_buffers; | 75 | StagingBuffersCache host_staging_buffers; |
| 77 | StagingBuffersCache device_staging_buffers; | 76 | StagingBuffersCache device_staging_buffers; |
diff --git a/src/video_core/renderer_vulkan/wrapper.cpp b/src/video_core/renderer_vulkan/wrapper.cpp index 539f3c974..7f5bc1404 100644 --- a/src/video_core/renderer_vulkan/wrapper.cpp +++ b/src/video_core/renderer_vulkan/wrapper.cpp | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <algorithm> | ||
| 5 | #include <exception> | 6 | #include <exception> |
| 6 | #include <memory> | 7 | #include <memory> |
| 7 | #include <optional> | 8 | #include <optional> |
| @@ -16,6 +17,23 @@ namespace Vulkan::vk { | |||
| 16 | 17 | ||
| 17 | namespace { | 18 | namespace { |
| 18 | 19 | ||
| 20 | void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceDispatch& dld) { | ||
| 21 | std::stable_sort(devices.begin(), devices.end(), [&](auto lhs, auto rhs) { | ||
| 22 | // This will call Vulkan more than needed, but these calls are cheap. | ||
| 23 | const auto lhs_properties = vk::PhysicalDevice(lhs, dld).GetProperties(); | ||
| 24 | const auto rhs_properties = vk::PhysicalDevice(rhs, dld).GetProperties(); | ||
| 25 | |||
| 26 | // Prefer discrete GPUs, Nvidia over AMD, AMD over Intel, Intel over the rest. | ||
| 27 | const bool preferred = | ||
| 28 | (lhs_properties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU && | ||
| 29 | rhs_properties.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) || | ||
| 30 | (lhs_properties.vendorID == 0x10DE && rhs_properties.vendorID != 0x10DE) || | ||
| 31 | (lhs_properties.vendorID == 0x1002 && rhs_properties.vendorID != 0x1002) || | ||
| 32 | (lhs_properties.vendorID == 0x8086 && rhs_properties.vendorID != 0x8086); | ||
| 33 | return !preferred; | ||
| 34 | }); | ||
| 35 | } | ||
| 36 | |||
| 19 | template <typename T> | 37 | template <typename T> |
| 20 | bool Proc(T& result, const InstanceDispatch& dld, const char* proc_name, | 38 | bool Proc(T& result, const InstanceDispatch& dld, const char* proc_name, |
| 21 | VkInstance instance = nullptr) noexcept { | 39 | VkInstance instance = nullptr) noexcept { |
| @@ -389,7 +407,8 @@ std::optional<std::vector<VkPhysicalDevice>> Instance::EnumeratePhysicalDevices( | |||
| 389 | if (dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data()) != VK_SUCCESS) { | 407 | if (dld->vkEnumeratePhysicalDevices(handle, &num, physical_devices.data()) != VK_SUCCESS) { |
| 390 | return std::nullopt; | 408 | return std::nullopt; |
| 391 | } | 409 | } |
| 392 | return physical_devices; | 410 | SortPhysicalDevices(physical_devices, *dld); |
| 411 | return std::make_optional(std::move(physical_devices)); | ||
| 393 | } | 412 | } |
| 394 | 413 | ||
| 395 | DebugCallback Instance::TryCreateDebugCallback( | 414 | DebugCallback Instance::TryCreateDebugCallback( |
diff --git a/src/video_core/shader/decode/arithmetic_half.cpp b/src/video_core/shader/decode/arithmetic_half.cpp index ee7d9a29d..a276aee44 100644 --- a/src/video_core/shader/decode/arithmetic_half.cpp +++ b/src/video_core/shader/decode/arithmetic_half.cpp | |||
| @@ -19,22 +19,46 @@ u32 ShaderIR::DecodeArithmeticHalf(NodeBlock& bb, u32 pc) { | |||
| 19 | const Instruction instr = {program_code[pc]}; | 19 | const Instruction instr = {program_code[pc]}; |
| 20 | const auto opcode = OpCode::Decode(instr); | 20 | const auto opcode = OpCode::Decode(instr); |
| 21 | 21 | ||
| 22 | if (opcode->get().GetId() == OpCode::Id::HADD2_C || | 22 | bool negate_a = false; |
| 23 | opcode->get().GetId() == OpCode::Id::HADD2_R) { | 23 | bool negate_b = false; |
| 24 | bool absolute_a = false; | ||
| 25 | bool absolute_b = false; | ||
| 26 | |||
| 27 | switch (opcode->get().GetId()) { | ||
| 28 | case OpCode::Id::HADD2_R: | ||
| 24 | if (instr.alu_half.ftz == 0) { | 29 | if (instr.alu_half.ftz == 0) { |
| 25 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); | 30 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); |
| 26 | } | 31 | } |
| 32 | negate_a = ((instr.value >> 43) & 1) != 0; | ||
| 33 | negate_b = ((instr.value >> 31) & 1) != 0; | ||
| 34 | absolute_a = ((instr.value >> 44) & 1) != 0; | ||
| 35 | absolute_b = ((instr.value >> 30) & 1) != 0; | ||
| 36 | break; | ||
| 37 | case OpCode::Id::HADD2_C: | ||
| 38 | if (instr.alu_half.ftz == 0) { | ||
| 39 | LOG_DEBUG(HW_GPU, "{} without FTZ is not implemented", opcode->get().GetName()); | ||
| 40 | } | ||
| 41 | negate_a = ((instr.value >> 43) & 1) != 0; | ||
| 42 | negate_b = ((instr.value >> 56) & 1) != 0; | ||
| 43 | absolute_a = ((instr.value >> 44) & 1) != 0; | ||
| 44 | absolute_b = ((instr.value >> 54) & 1) != 0; | ||
| 45 | break; | ||
| 46 | case OpCode::Id::HMUL2_R: | ||
| 47 | negate_a = ((instr.value >> 43) & 1) != 0; | ||
| 48 | absolute_a = ((instr.value >> 44) & 1) != 0; | ||
| 49 | absolute_b = ((instr.value >> 30) & 1) != 0; | ||
| 50 | break; | ||
| 51 | case OpCode::Id::HMUL2_C: | ||
| 52 | negate_b = ((instr.value >> 31) & 1) != 0; | ||
| 53 | absolute_a = ((instr.value >> 44) & 1) != 0; | ||
| 54 | absolute_b = ((instr.value >> 54) & 1) != 0; | ||
| 55 | break; | ||
| 27 | } | 56 | } |
| 28 | 57 | ||
| 29 | const bool negate_a = | ||
| 30 | opcode->get().GetId() != OpCode::Id::HMUL2_R && instr.alu_half.negate_a != 0; | ||
| 31 | const bool negate_b = | ||
| 32 | opcode->get().GetId() != OpCode::Id::HMUL2_C && instr.alu_half.negate_b != 0; | ||
| 33 | |||
| 34 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.alu_half.type_a); | 58 | Node op_a = UnpackHalfFloat(GetRegister(instr.gpr8), instr.alu_half.type_a); |
| 35 | op_a = GetOperandAbsNegHalf(op_a, instr.alu_half.abs_a, negate_a); | 59 | op_a = GetOperandAbsNegHalf(op_a, absolute_a, negate_a); |
| 36 | 60 | ||
| 37 | auto [type_b, op_b] = [&]() -> std::tuple<HalfType, Node> { | 61 | auto [type_b, op_b] = [this, instr, opcode]() -> std::pair<HalfType, Node> { |
| 38 | switch (opcode->get().GetId()) { | 62 | switch (opcode->get().GetId()) { |
| 39 | case OpCode::Id::HADD2_C: | 63 | case OpCode::Id::HADD2_C: |
| 40 | case OpCode::Id::HMUL2_C: | 64 | case OpCode::Id::HMUL2_C: |
| @@ -48,17 +72,16 @@ u32 ShaderIR::DecodeArithmeticHalf(NodeBlock& bb, u32 pc) { | |||
| 48 | } | 72 | } |
| 49 | }(); | 73 | }(); |
| 50 | op_b = UnpackHalfFloat(op_b, type_b); | 74 | op_b = UnpackHalfFloat(op_b, type_b); |
| 51 | // redeclaration to avoid a bug in clang with reusing local bindings in lambdas | 75 | op_b = GetOperandAbsNegHalf(op_b, absolute_b, negate_b); |
| 52 | Node op_b_alt = GetOperandAbsNegHalf(op_b, instr.alu_half.abs_b, negate_b); | ||
| 53 | 76 | ||
| 54 | Node value = [&]() { | 77 | Node value = [this, opcode, op_a, op_b = op_b] { |
| 55 | switch (opcode->get().GetId()) { | 78 | switch (opcode->get().GetId()) { |
| 56 | case OpCode::Id::HADD2_C: | 79 | case OpCode::Id::HADD2_C: |
| 57 | case OpCode::Id::HADD2_R: | 80 | case OpCode::Id::HADD2_R: |
| 58 | return Operation(OperationCode::HAdd, PRECISE, op_a, op_b_alt); | 81 | return Operation(OperationCode::HAdd, PRECISE, op_a, op_b); |
| 59 | case OpCode::Id::HMUL2_C: | 82 | case OpCode::Id::HMUL2_C: |
| 60 | case OpCode::Id::HMUL2_R: | 83 | case OpCode::Id::HMUL2_R: |
| 61 | return Operation(OperationCode::HMul, PRECISE, op_a, op_b_alt); | 84 | return Operation(OperationCode::HMul, PRECISE, op_a, op_b); |
| 62 | default: | 85 | default: |
| 63 | UNIMPLEMENTED_MSG("Unhandled half float instruction: {}", opcode->get().GetName()); | 86 | UNIMPLEMENTED_MSG("Unhandled half float instruction: {}", opcode->get().GetName()); |
| 64 | return Immediate(0); | 87 | return Immediate(0); |
diff --git a/src/video_core/shader/decode/arithmetic_integer.cpp b/src/video_core/shader/decode/arithmetic_integer.cpp index 0f4c3103a..9af8c606d 100644 --- a/src/video_core/shader/decode/arithmetic_integer.cpp +++ b/src/video_core/shader/decode/arithmetic_integer.cpp | |||
| @@ -249,8 +249,8 @@ u32 ShaderIR::DecodeArithmeticInteger(NodeBlock& bb, u32 pc) { | |||
| 249 | } | 249 | } |
| 250 | case OpCode::Id::LEA_IMM: { | 250 | case OpCode::Id::LEA_IMM: { |
| 251 | const bool neg = instr.lea.imm.neg != 0; | 251 | const bool neg = instr.lea.imm.neg != 0; |
| 252 | return {Immediate(static_cast<u32>(instr.lea.imm.entry_a)), | 252 | return {GetOperandAbsNegInteger(GetRegister(instr.gpr8), false, neg, true), |
| 253 | GetOperandAbsNegInteger(GetRegister(instr.gpr8), false, neg, true), | 253 | Immediate(static_cast<u32>(instr.lea.imm.entry_a)), |
| 254 | Immediate(static_cast<u32>(instr.lea.imm.entry_b))}; | 254 | Immediate(static_cast<u32>(instr.lea.imm.entry_b))}; |
| 255 | } | 255 | } |
| 256 | case OpCode::Id::LEA_RZ: { | 256 | case OpCode::Id::LEA_RZ: { |
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 196a3a116..a44eed047 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | #include "input_common/main.h" | 12 | #include "input_common/main.h" |
| 13 | #include "input_common/udp/client.h" | 13 | #include "input_common/udp/client.h" |
| 14 | #include "yuzu/configuration/config.h" | 14 | #include "yuzu/configuration/config.h" |
| 15 | #include "yuzu/uisettings.h" | ||
| 16 | 15 | ||
| 17 | Config::Config() { | 16 | Config::Config() { |
| 18 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. | 17 | // TODO: Don't hardcode the path; let the frontend decide where to put the config files. |
| @@ -212,12 +211,13 @@ const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> Config::default | |||
| 212 | // This must be in alphabetical order according to action name as it must have the same order as | 211 | // This must be in alphabetical order according to action name as it must have the same order as |
| 213 | // UISetting::values.shortcuts, which is alphabetically ordered. | 212 | // UISetting::values.shortcuts, which is alphabetically ordered. |
| 214 | // clang-format off | 213 | // clang-format off |
| 215 | const std::array<UISettings::Shortcut, 15> default_hotkeys{{ | 214 | const std::array<UISettings::Shortcut, 15> Config::default_hotkeys{{ |
| 216 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, | 215 | {QStringLiteral("Capture Screenshot"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, |
| 216 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, | ||
| 217 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, | 217 | {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, |
| 218 | {QStringLiteral("Decrease Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("-"), Qt::ApplicationShortcut}}, | 218 | {QStringLiteral("Decrease Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("-"), Qt::ApplicationShortcut}}, |
| 219 | {QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), Qt::WindowShortcut}}, | ||
| 220 | {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), Qt::WindowShortcut}}, | 219 | {QStringLiteral("Exit Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("Esc"), Qt::WindowShortcut}}, |
| 220 | {QStringLiteral("Exit yuzu"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Q"), Qt::WindowShortcut}}, | ||
| 221 | {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), Qt::WindowShortcut}}, | 221 | {QStringLiteral("Fullscreen"), QStringLiteral("Main Window"), {QStringLiteral("F11"), Qt::WindowShortcut}}, |
| 222 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}}, | 222 | {QStringLiteral("Increase Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("+"), Qt::ApplicationShortcut}}, |
| 223 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}}, | 223 | {QStringLiteral("Load Amiibo"), QStringLiteral("Main Window"), {QStringLiteral("F2"), Qt::ApplicationShortcut}}, |
| @@ -227,7 +227,6 @@ const std::array<UISettings::Shortcut, 15> default_hotkeys{{ | |||
| 227 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, | 227 | {QStringLiteral("Toggle Filter Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, |
| 228 | {QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), Qt::ApplicationShortcut}}, | 228 | {QStringLiteral("Toggle Speed Limit"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+Z"), Qt::ApplicationShortcut}}, |
| 229 | {QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}}, | 229 | {QStringLiteral("Toggle Status Bar"), QStringLiteral("Main Window"), {QStringLiteral("Ctrl+S"), Qt::WindowShortcut}}, |
| 230 | {QStringLiteral("Change Docked Mode"), QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::ApplicationShortcut}}, | ||
| 231 | }}; | 230 | }}; |
| 232 | // clang-format on | 231 | // clang-format on |
| 233 | 232 | ||
| @@ -644,6 +643,8 @@ void Config::ReadRendererValues() { | |||
| 644 | Settings::values.use_asynchronous_gpu_emulation = | 643 | Settings::values.use_asynchronous_gpu_emulation = |
| 645 | ReadSetting(QStringLiteral("use_asynchronous_gpu_emulation"), false).toBool(); | 644 | ReadSetting(QStringLiteral("use_asynchronous_gpu_emulation"), false).toBool(); |
| 646 | Settings::values.use_vsync = ReadSetting(QStringLiteral("use_vsync"), true).toBool(); | 645 | Settings::values.use_vsync = ReadSetting(QStringLiteral("use_vsync"), true).toBool(); |
| 646 | Settings::values.use_fast_gpu_time = | ||
| 647 | ReadSetting(QStringLiteral("use_fast_gpu_time"), true).toBool(); | ||
| 647 | Settings::values.force_30fps_mode = | 648 | Settings::values.force_30fps_mode = |
| 648 | ReadSetting(QStringLiteral("force_30fps_mode"), false).toBool(); | 649 | ReadSetting(QStringLiteral("force_30fps_mode"), false).toBool(); |
| 649 | 650 | ||
| @@ -1085,6 +1086,7 @@ void Config::SaveRendererValues() { | |||
| 1085 | WriteSetting(QStringLiteral("use_asynchronous_gpu_emulation"), | 1086 | WriteSetting(QStringLiteral("use_asynchronous_gpu_emulation"), |
| 1086 | Settings::values.use_asynchronous_gpu_emulation, false); | 1087 | Settings::values.use_asynchronous_gpu_emulation, false); |
| 1087 | WriteSetting(QStringLiteral("use_vsync"), Settings::values.use_vsync, true); | 1088 | WriteSetting(QStringLiteral("use_vsync"), Settings::values.use_vsync, true); |
| 1089 | WriteSetting(QStringLiteral("use_fast_gpu_time"), Settings::values.use_fast_gpu_time, true); | ||
| 1088 | WriteSetting(QStringLiteral("force_30fps_mode"), Settings::values.force_30fps_mode, false); | 1090 | WriteSetting(QStringLiteral("force_30fps_mode"), Settings::values.force_30fps_mode, false); |
| 1089 | 1091 | ||
| 1090 | // Cast to double because Qt's written float values are not human-readable | 1092 | // Cast to double because Qt's written float values are not human-readable |
diff --git a/src/yuzu/configuration/config.h b/src/yuzu/configuration/config.h index ba6888004..5cd2a5feb 100644 --- a/src/yuzu/configuration/config.h +++ b/src/yuzu/configuration/config.h | |||
| @@ -9,6 +9,7 @@ | |||
| 9 | #include <string> | 9 | #include <string> |
| 10 | #include <QVariant> | 10 | #include <QVariant> |
| 11 | #include "core/settings.h" | 11 | #include "core/settings.h" |
| 12 | #include "yuzu/uisettings.h" | ||
| 12 | 13 | ||
| 13 | class QSettings; | 14 | class QSettings; |
| 14 | 15 | ||
| @@ -26,6 +27,7 @@ public: | |||
| 26 | default_mouse_buttons; | 27 | default_mouse_buttons; |
| 27 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; | 28 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardKeys> default_keyboard_keys; |
| 28 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; | 29 | static const std::array<int, Settings::NativeKeyboard::NumKeyboardMods> default_keyboard_mods; |
| 30 | static const std::array<UISettings::Shortcut, 15> default_hotkeys; | ||
| 29 | 31 | ||
| 30 | private: | 32 | private: |
| 31 | void ReadValues(); | 33 | void ReadValues(); |
diff --git a/src/yuzu/configuration/configure_filesystem.cpp b/src/yuzu/configuration/configure_filesystem.cpp index 29f540eb7..835ee821c 100644 --- a/src/yuzu/configuration/configure_filesystem.cpp +++ b/src/yuzu/configuration/configure_filesystem.cpp | |||
| @@ -138,7 +138,7 @@ void ConfigureFilesystem::SetDirectory(DirectoryTarget target, QLineEdit* edit) | |||
| 138 | str = QFileDialog::getOpenFileName(this, caption, QFileInfo(edit->text()).dir().path(), | 138 | str = QFileDialog::getOpenFileName(this, caption, QFileInfo(edit->text()).dir().path(), |
| 139 | QStringLiteral("NX Gamecard;*.xci")); | 139 | QStringLiteral("NX Gamecard;*.xci")); |
| 140 | } else { | 140 | } else { |
| 141 | str = QFileDialog::getExistingDirectory(this, caption, edit->text()); | 141 | str = QFileDialog::getExistingDirectory(this, caption, edit->text()) + QDir::separator(); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | if (str.isEmpty()) | 144 | if (str.isEmpty()) |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.cpp b/src/yuzu/configuration/configure_graphics_advanced.cpp index 0a3f47339..5bb2ae555 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.cpp +++ b/src/yuzu/configuration/configure_graphics_advanced.cpp | |||
| @@ -22,6 +22,7 @@ void ConfigureGraphicsAdvanced::SetConfiguration() { | |||
| 22 | ui->gpu_accuracy->setCurrentIndex(static_cast<int>(Settings::values.gpu_accuracy)); | 22 | ui->gpu_accuracy->setCurrentIndex(static_cast<int>(Settings::values.gpu_accuracy)); |
| 23 | ui->use_vsync->setEnabled(runtime_lock); | 23 | ui->use_vsync->setEnabled(runtime_lock); |
| 24 | ui->use_vsync->setChecked(Settings::values.use_vsync); | 24 | ui->use_vsync->setChecked(Settings::values.use_vsync); |
| 25 | ui->use_fast_gpu_time->setChecked(Settings::values.use_fast_gpu_time); | ||
| 25 | ui->force_30fps_mode->setEnabled(runtime_lock); | 26 | ui->force_30fps_mode->setEnabled(runtime_lock); |
| 26 | ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode); | 27 | ui->force_30fps_mode->setChecked(Settings::values.force_30fps_mode); |
| 27 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); | 28 | ui->anisotropic_filtering_combobox->setEnabled(runtime_lock); |
| @@ -32,6 +33,7 @@ void ConfigureGraphicsAdvanced::ApplyConfiguration() { | |||
| 32 | auto gpu_accuracy = static_cast<Settings::GPUAccuracy>(ui->gpu_accuracy->currentIndex()); | 33 | auto gpu_accuracy = static_cast<Settings::GPUAccuracy>(ui->gpu_accuracy->currentIndex()); |
| 33 | Settings::values.gpu_accuracy = gpu_accuracy; | 34 | Settings::values.gpu_accuracy = gpu_accuracy; |
| 34 | Settings::values.use_vsync = ui->use_vsync->isChecked(); | 35 | Settings::values.use_vsync = ui->use_vsync->isChecked(); |
| 36 | Settings::values.use_fast_gpu_time = ui->use_fast_gpu_time->isChecked(); | ||
| 35 | Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked(); | 37 | Settings::values.force_30fps_mode = ui->force_30fps_mode->isChecked(); |
| 36 | Settings::values.max_anisotropy = ui->anisotropic_filtering_combobox->currentIndex(); | 38 | Settings::values.max_anisotropy = ui->anisotropic_filtering_combobox->currentIndex(); |
| 37 | } | 39 | } |
diff --git a/src/yuzu/configuration/configure_graphics_advanced.ui b/src/yuzu/configuration/configure_graphics_advanced.ui index 0c7b383e0..770b80c50 100644 --- a/src/yuzu/configuration/configure_graphics_advanced.ui +++ b/src/yuzu/configuration/configure_graphics_advanced.ui | |||
| @@ -70,6 +70,13 @@ | |||
| 70 | </widget> | 70 | </widget> |
| 71 | </item> | 71 | </item> |
| 72 | <item> | 72 | <item> |
| 73 | <widget class="QCheckBox" name="use_fast_gpu_time"> | ||
| 74 | <property name="text"> | ||
| 75 | <string>Use Fast GPU Time</string> | ||
| 76 | </property> | ||
| 77 | </widget> | ||
| 78 | </item> | ||
| 79 | <item> | ||
| 73 | <layout class="QHBoxLayout" name="horizontalLayout_1"> | 80 | <layout class="QHBoxLayout" name="horizontalLayout_1"> |
| 74 | <item> | 81 | <item> |
| 75 | <widget class="QLabel" name="af_label"> | 82 | <widget class="QLabel" name="af_label"> |
diff --git a/src/yuzu/configuration/configure_hotkeys.cpp b/src/yuzu/configuration/configure_hotkeys.cpp index fa9052136..6f7fd4414 100644 --- a/src/yuzu/configuration/configure_hotkeys.cpp +++ b/src/yuzu/configuration/configure_hotkeys.cpp | |||
| @@ -2,10 +2,12 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <QMenu> | ||
| 5 | #include <QMessageBox> | 6 | #include <QMessageBox> |
| 6 | #include <QStandardItemModel> | 7 | #include <QStandardItemModel> |
| 7 | #include "core/settings.h" | 8 | #include "core/settings.h" |
| 8 | #include "ui_configure_hotkeys.h" | 9 | #include "ui_configure_hotkeys.h" |
| 10 | #include "yuzu/configuration/config.h" | ||
| 9 | #include "yuzu/configuration/configure_hotkeys.h" | 11 | #include "yuzu/configuration/configure_hotkeys.h" |
| 10 | #include "yuzu/hotkeys.h" | 12 | #include "yuzu/hotkeys.h" |
| 11 | #include "yuzu/util/sequence_dialog/sequence_dialog.h" | 13 | #include "yuzu/util/sequence_dialog/sequence_dialog.h" |
| @@ -19,6 +21,9 @@ ConfigureHotkeys::ConfigureHotkeys(QWidget* parent) | |||
| 19 | model->setColumnCount(3); | 21 | model->setColumnCount(3); |
| 20 | 22 | ||
| 21 | connect(ui->hotkey_list, &QTreeView::doubleClicked, this, &ConfigureHotkeys::Configure); | 23 | connect(ui->hotkey_list, &QTreeView::doubleClicked, this, &ConfigureHotkeys::Configure); |
| 24 | connect(ui->hotkey_list, &QTreeView::customContextMenuRequested, this, | ||
| 25 | &ConfigureHotkeys::PopupContextMenu); | ||
| 26 | ui->hotkey_list->setContextMenuPolicy(Qt::CustomContextMenu); | ||
| 22 | ui->hotkey_list->setModel(model); | 27 | ui->hotkey_list->setModel(model); |
| 23 | 28 | ||
| 24 | // TODO(Kloen): Make context configurable as well (hiding the column for now) | 29 | // TODO(Kloen): Make context configurable as well (hiding the column for now) |
| @@ -27,6 +32,10 @@ ConfigureHotkeys::ConfigureHotkeys(QWidget* parent) | |||
| 27 | ui->hotkey_list->setColumnWidth(0, 200); | 32 | ui->hotkey_list->setColumnWidth(0, 200); |
| 28 | ui->hotkey_list->resizeColumnToContents(1); | 33 | ui->hotkey_list->resizeColumnToContents(1); |
| 29 | 34 | ||
| 35 | connect(ui->button_restore_defaults, &QPushButton::clicked, this, | ||
| 36 | &ConfigureHotkeys::RestoreDefaults); | ||
| 37 | connect(ui->button_clear_all, &QPushButton::clicked, this, &ConfigureHotkeys::ClearAll); | ||
| 38 | |||
| 30 | RetranslateUI(); | 39 | RetranslateUI(); |
| 31 | } | 40 | } |
| 32 | 41 | ||
| @@ -71,7 +80,6 @@ void ConfigureHotkeys::Configure(QModelIndex index) { | |||
| 71 | } | 80 | } |
| 72 | 81 | ||
| 73 | index = index.sibling(index.row(), 1); | 82 | index = index.sibling(index.row(), 1); |
| 74 | auto* const model = ui->hotkey_list->model(); | ||
| 75 | const auto previous_key = model->data(index); | 83 | const auto previous_key = model->data(index); |
| 76 | 84 | ||
| 77 | SequenceDialog hotkey_dialog{this}; | 85 | SequenceDialog hotkey_dialog{this}; |
| @@ -81,31 +89,33 @@ void ConfigureHotkeys::Configure(QModelIndex index) { | |||
| 81 | if (return_code == QDialog::Rejected || key_sequence.isEmpty()) { | 89 | if (return_code == QDialog::Rejected || key_sequence.isEmpty()) { |
| 82 | return; | 90 | return; |
| 83 | } | 91 | } |
| 92 | const auto [key_sequence_used, used_action] = IsUsedKey(key_sequence); | ||
| 84 | 93 | ||
| 85 | if (IsUsedKey(key_sequence) && key_sequence != QKeySequence(previous_key.toString())) { | 94 | if (key_sequence_used && key_sequence != QKeySequence(previous_key.toString())) { |
| 86 | QMessageBox::warning(this, tr("Conflicting Key Sequence"), | 95 | QMessageBox::warning( |
| 87 | tr("The entered key sequence is already assigned to another hotkey.")); | 96 | this, tr("Conflicting Key Sequence"), |
| 97 | tr("The entered key sequence is already assigned to: %1").arg(used_action)); | ||
| 88 | } else { | 98 | } else { |
| 89 | model->setData(index, key_sequence.toString(QKeySequence::NativeText)); | 99 | model->setData(index, key_sequence.toString(QKeySequence::NativeText)); |
| 90 | } | 100 | } |
| 91 | } | 101 | } |
| 92 | 102 | ||
| 93 | bool ConfigureHotkeys::IsUsedKey(QKeySequence key_sequence) const { | 103 | std::pair<bool, QString> ConfigureHotkeys::IsUsedKey(QKeySequence key_sequence) const { |
| 94 | for (int r = 0; r < model->rowCount(); r++) { | 104 | for (int r = 0; r < model->rowCount(); ++r) { |
| 95 | const QStandardItem* const parent = model->item(r, 0); | 105 | const QStandardItem* const parent = model->item(r, 0); |
| 96 | 106 | ||
| 97 | for (int r2 = 0; r2 < parent->rowCount(); r2++) { | 107 | for (int r2 = 0; r2 < parent->rowCount(); ++r2) { |
| 98 | const QStandardItem* const key_seq_item = parent->child(r2, 1); | 108 | const QStandardItem* const key_seq_item = parent->child(r2, 1); |
| 99 | const auto key_seq_str = key_seq_item->text(); | 109 | const auto key_seq_str = key_seq_item->text(); |
| 100 | const auto key_seq = QKeySequence::fromString(key_seq_str, QKeySequence::NativeText); | 110 | const auto key_seq = QKeySequence::fromString(key_seq_str, QKeySequence::NativeText); |
| 101 | 111 | ||
| 102 | if (key_sequence == key_seq) { | 112 | if (key_sequence == key_seq) { |
| 103 | return true; | 113 | return std::make_pair(true, parent->child(r2, 0)->text()); |
| 104 | } | 114 | } |
| 105 | } | 115 | } |
| 106 | } | 116 | } |
| 107 | 117 | ||
| 108 | return false; | 118 | return std::make_pair(false, QString()); |
| 109 | } | 119 | } |
| 110 | 120 | ||
| 111 | void ConfigureHotkeys::ApplyConfiguration(HotkeyRegistry& registry) { | 121 | void ConfigureHotkeys::ApplyConfiguration(HotkeyRegistry& registry) { |
| @@ -128,3 +138,55 @@ void ConfigureHotkeys::ApplyConfiguration(HotkeyRegistry& registry) { | |||
| 128 | 138 | ||
| 129 | registry.SaveHotkeys(); | 139 | registry.SaveHotkeys(); |
| 130 | } | 140 | } |
| 141 | |||
| 142 | void ConfigureHotkeys::RestoreDefaults() { | ||
| 143 | for (int r = 0; r < model->rowCount(); ++r) { | ||
| 144 | const QStandardItem* parent = model->item(r, 0); | ||
| 145 | |||
| 146 | for (int r2 = 0; r2 < parent->rowCount(); ++r2) { | ||
| 147 | model->item(r, 0)->child(r2, 1)->setText(Config::default_hotkeys[r2].shortcut.first); | ||
| 148 | } | ||
| 149 | } | ||
| 150 | } | ||
| 151 | |||
| 152 | void ConfigureHotkeys::ClearAll() { | ||
| 153 | for (int r = 0; r < model->rowCount(); ++r) { | ||
| 154 | const QStandardItem* parent = model->item(r, 0); | ||
| 155 | |||
| 156 | for (int r2 = 0; r2 < parent->rowCount(); ++r2) { | ||
| 157 | model->item(r, 0)->child(r2, 1)->setText(tr("")); | ||
| 158 | } | ||
| 159 | } | ||
| 160 | } | ||
| 161 | |||
| 162 | void ConfigureHotkeys::PopupContextMenu(const QPoint& menu_location) { | ||
| 163 | QModelIndex index = ui->hotkey_list->indexAt(menu_location); | ||
| 164 | if (!index.parent().isValid()) { | ||
| 165 | return; | ||
| 166 | } | ||
| 167 | |||
| 168 | const auto selected = index.sibling(index.row(), 1); | ||
| 169 | QMenu context_menu; | ||
| 170 | |||
| 171 | QAction* restore_default = context_menu.addAction(tr("Restore Default")); | ||
| 172 | QAction* clear = context_menu.addAction(tr("Clear")); | ||
| 173 | |||
| 174 | connect(restore_default, &QAction::triggered, [this, selected] { | ||
| 175 | const QKeySequence& default_key_sequence = QKeySequence::fromString( | ||
| 176 | Config::default_hotkeys[selected.row()].shortcut.first, QKeySequence::NativeText); | ||
| 177 | const auto [key_sequence_used, used_action] = IsUsedKey(default_key_sequence); | ||
| 178 | |||
| 179 | if (key_sequence_used && | ||
| 180 | default_key_sequence != QKeySequence(model->data(selected).toString())) { | ||
| 181 | |||
| 182 | QMessageBox::warning( | ||
| 183 | this, tr("Conflicting Key Sequence"), | ||
| 184 | tr("The default key sequence is already assigned to: %1").arg(used_action)); | ||
| 185 | } else { | ||
| 186 | model->setData(selected, default_key_sequence.toString(QKeySequence::NativeText)); | ||
| 187 | } | ||
| 188 | }); | ||
| 189 | connect(clear, &QAction::triggered, [this, selected] { model->setData(selected, tr("")); }); | ||
| 190 | |||
| 191 | context_menu.exec(ui->hotkey_list->viewport()->mapToGlobal(menu_location)); | ||
| 192 | } | ||
diff --git a/src/yuzu/configuration/configure_hotkeys.h b/src/yuzu/configuration/configure_hotkeys.h index 8f8c6173b..a2ec3323e 100644 --- a/src/yuzu/configuration/configure_hotkeys.h +++ b/src/yuzu/configuration/configure_hotkeys.h | |||
| @@ -35,7 +35,11 @@ private: | |||
| 35 | void RetranslateUI(); | 35 | void RetranslateUI(); |
| 36 | 36 | ||
| 37 | void Configure(QModelIndex index); | 37 | void Configure(QModelIndex index); |
| 38 | bool IsUsedKey(QKeySequence key_sequence) const; | 38 | std::pair<bool, QString> IsUsedKey(QKeySequence key_sequence) const; |
| 39 | |||
| 40 | void RestoreDefaults(); | ||
| 41 | void ClearAll(); | ||
| 42 | void PopupContextMenu(const QPoint& menu_location); | ||
| 39 | 43 | ||
| 40 | std::unique_ptr<Ui::ConfigureHotkeys> ui; | 44 | std::unique_ptr<Ui::ConfigureHotkeys> ui; |
| 41 | 45 | ||
diff --git a/src/yuzu/configuration/configure_hotkeys.ui b/src/yuzu/configuration/configure_hotkeys.ui index 0d0b70f38..6d9f861e3 100644 --- a/src/yuzu/configuration/configure_hotkeys.ui +++ b/src/yuzu/configuration/configure_hotkeys.ui | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>363</width> | 9 | <width>439</width> |
| 10 | <height>388</height> | 10 | <height>510</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
| @@ -15,7 +15,7 @@ | |||
| 15 | </property> | 15 | </property> |
| 16 | <layout class="QVBoxLayout" name="verticalLayout"> | 16 | <layout class="QVBoxLayout" name="verticalLayout"> |
| 17 | <item> | 17 | <item> |
| 18 | <layout class="QVBoxLayout" name="verticalLayout_2"> | 18 | <layout class="QHBoxLayout" name="horizontalLayout"> |
| 19 | <item> | 19 | <item> |
| 20 | <widget class="QLabel" name="label_2"> | 20 | <widget class="QLabel" name="label_2"> |
| 21 | <property name="text"> | 21 | <property name="text"> |
| @@ -24,6 +24,37 @@ | |||
| 24 | </widget> | 24 | </widget> |
| 25 | </item> | 25 | </item> |
| 26 | <item> | 26 | <item> |
| 27 | <spacer name="horizontalSpacer"> | ||
| 28 | <property name="orientation"> | ||
| 29 | <enum>Qt::Horizontal</enum> | ||
| 30 | </property> | ||
| 31 | <property name="sizeHint" stdset="0"> | ||
| 32 | <size> | ||
| 33 | <width>40</width> | ||
| 34 | <height>20</height> | ||
| 35 | </size> | ||
| 36 | </property> | ||
| 37 | </spacer> | ||
| 38 | </item> | ||
| 39 | <item> | ||
| 40 | <widget class="QPushButton" name="button_clear_all"> | ||
| 41 | <property name="text"> | ||
| 42 | <string>Clear All</string> | ||
| 43 | </property> | ||
| 44 | </widget> | ||
| 45 | </item> | ||
| 46 | <item> | ||
| 47 | <widget class="QPushButton" name="button_restore_defaults"> | ||
| 48 | <property name="text"> | ||
| 49 | <string>Restore Defaults</string> | ||
| 50 | </property> | ||
| 51 | </widget> | ||
| 52 | </item> | ||
| 53 | </layout> | ||
| 54 | </item> | ||
| 55 | <item> | ||
| 56 | <layout class="QVBoxLayout" name="verticalLayout_2"> | ||
| 57 | <item> | ||
| 27 | <widget class="QTreeView" name="hotkey_list"> | 58 | <widget class="QTreeView" name="hotkey_list"> |
| 28 | <property name="editTriggers"> | 59 | <property name="editTriggers"> |
| 29 | <set>QAbstractItemView::NoEditTriggers</set> | 60 | <set>QAbstractItemView::NoEditTriggers</set> |
| @@ -39,4 +70,4 @@ | |||
| 39 | </widget> | 70 | </widget> |
| 40 | <resources/> | 71 | <resources/> |
| 41 | <connections/> | 72 | <connections/> |
| 42 | </ui> \ No newline at end of file | 73 | </ui> |
diff --git a/src/yuzu/configuration/configure_input_player.cpp b/src/yuzu/configuration/configure_input_player.cpp index 15ac30f12..e4eb5594b 100644 --- a/src/yuzu/configuration/configure_input_player.cpp +++ b/src/yuzu/configuration/configure_input_player.cpp | |||
| @@ -56,7 +56,6 @@ static void SetAnalogButton(const Common::ParamPackage& input_param, | |||
| 56 | if (analog_param.Get("engine", "") != "analog_from_button") { | 56 | if (analog_param.Get("engine", "") != "analog_from_button") { |
| 57 | analog_param = { | 57 | analog_param = { |
| 58 | {"engine", "analog_from_button"}, | 58 | {"engine", "analog_from_button"}, |
| 59 | {"modifier_scale", "0.5"}, | ||
| 60 | }; | 59 | }; |
| 61 | } | 60 | } |
| 62 | analog_param.Set(button_name, input_param.Serialize()); | 61 | analog_param.Set(button_name, input_param.Serialize()); |
| @@ -236,8 +235,10 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 236 | widget->setVisible(false); | 235 | widget->setVisible(false); |
| 237 | 236 | ||
| 238 | analog_map_stick = {ui->buttonLStickAnalog, ui->buttonRStickAnalog}; | 237 | analog_map_stick = {ui->buttonLStickAnalog, ui->buttonRStickAnalog}; |
| 239 | analog_map_deadzone = {ui->sliderLStickDeadzone, ui->sliderRStickDeadzone}; | 238 | analog_map_deadzone_and_modifier_slider = {ui->sliderLStickDeadzoneAndModifier, |
| 240 | analog_map_deadzone_label = {ui->labelLStickDeadzone, ui->labelRStickDeadzone}; | 239 | ui->sliderRStickDeadzoneAndModifier}; |
| 240 | analog_map_deadzone_and_modifier_slider_label = {ui->labelLStickDeadzoneAndModifier, | ||
| 241 | ui->labelRStickDeadzoneAndModifier}; | ||
| 241 | 242 | ||
| 242 | for (int button_id = 0; button_id < Settings::NativeButton::NumButtons; button_id++) { | 243 | for (int button_id = 0; button_id < Settings::NativeButton::NumButtons; button_id++) { |
| 243 | auto* const button = button_map[button_id]; | 244 | auto* const button = button_map[button_id]; |
| @@ -328,10 +329,18 @@ ConfigureInputPlayer::ConfigureInputPlayer(QWidget* parent, std::size_t player_i | |||
| 328 | InputCommon::Polling::DeviceType::Analog); | 329 | InputCommon::Polling::DeviceType::Analog); |
| 329 | } | 330 | } |
| 330 | }); | 331 | }); |
| 331 | connect(analog_map_deadzone[analog_id], &QSlider::valueChanged, [=] { | 332 | |
| 332 | const float deadzone = analog_map_deadzone[analog_id]->value() / 100.0f; | 333 | connect(analog_map_deadzone_and_modifier_slider[analog_id], &QSlider::valueChanged, [=] { |
| 333 | analog_map_deadzone_label[analog_id]->setText(tr("Deadzone: %1").arg(deadzone)); | 334 | const float slider_value = analog_map_deadzone_and_modifier_slider[analog_id]->value(); |
| 334 | analogs_param[analog_id].Set("deadzone", deadzone); | 335 | if (analogs_param[analog_id].Get("engine", "") == "sdl") { |
| 336 | analog_map_deadzone_and_modifier_slider_label[analog_id]->setText( | ||
| 337 | tr("Deadzone: %1%").arg(slider_value)); | ||
| 338 | analogs_param[analog_id].Set("deadzone", slider_value / 100.0f); | ||
| 339 | } else { | ||
| 340 | analog_map_deadzone_and_modifier_slider_label[analog_id]->setText( | ||
| 341 | tr("Modifier Scale: %1%").arg(slider_value)); | ||
| 342 | analogs_param[analog_id].Set("modifier_scale", slider_value / 100.0f); | ||
| 343 | } | ||
| 335 | }); | 344 | }); |
| 336 | } | 345 | } |
| 337 | 346 | ||
| @@ -517,20 +526,31 @@ void ConfigureInputPlayer::UpdateButtonLabels() { | |||
| 517 | analog_map_stick[analog_id]->setText(tr("Set Analog Stick")); | 526 | analog_map_stick[analog_id]->setText(tr("Set Analog Stick")); |
| 518 | 527 | ||
| 519 | auto& param = analogs_param[analog_id]; | 528 | auto& param = analogs_param[analog_id]; |
| 520 | auto* const analog_deadzone_slider = analog_map_deadzone[analog_id]; | 529 | auto* const analog_stick_slider = analog_map_deadzone_and_modifier_slider[analog_id]; |
| 521 | auto* const analog_deadzone_label = analog_map_deadzone_label[analog_id]; | 530 | auto* const analog_stick_slider_label = |
| 522 | 531 | analog_map_deadzone_and_modifier_slider_label[analog_id]; | |
| 523 | if (param.Has("engine") && param.Get("engine", "") == "sdl") { | 532 | |
| 524 | if (!param.Has("deadzone")) { | 533 | if (param.Has("engine")) { |
| 525 | param.Set("deadzone", 0.1f); | 534 | if (param.Get("engine", "") == "sdl") { |
| 535 | if (!param.Has("deadzone")) { | ||
| 536 | param.Set("deadzone", 0.1f); | ||
| 537 | } | ||
| 538 | |||
| 539 | analog_stick_slider->setValue(static_cast<int>(param.Get("deadzone", 0.1f) * 100)); | ||
| 540 | if (analog_stick_slider->value() == 0) { | ||
| 541 | analog_stick_slider_label->setText(tr("Deadzone: 0%")); | ||
| 542 | } | ||
| 543 | } else { | ||
| 544 | if (!param.Has("modifier_scale")) { | ||
| 545 | param.Set("modifier_scale", 0.5f); | ||
| 546 | } | ||
| 547 | |||
| 548 | analog_stick_slider->setValue( | ||
| 549 | static_cast<int>(param.Get("modifier_scale", 0.5f) * 100)); | ||
| 550 | if (analog_stick_slider->value() == 0) { | ||
| 551 | analog_stick_slider_label->setText(tr("Modifier Scale: 0%")); | ||
| 552 | } | ||
| 526 | } | 553 | } |
| 527 | |||
| 528 | analog_deadzone_slider->setValue(static_cast<int>(param.Get("deadzone", 0.1f) * 100)); | ||
| 529 | analog_deadzone_slider->setVisible(true); | ||
| 530 | analog_deadzone_label->setVisible(true); | ||
| 531 | } else { | ||
| 532 | analog_deadzone_slider->setVisible(false); | ||
| 533 | analog_deadzone_label->setVisible(false); | ||
| 534 | } | 554 | } |
| 535 | } | 555 | } |
| 536 | } | 556 | } |
diff --git a/src/yuzu/configuration/configure_input_player.h b/src/yuzu/configuration/configure_input_player.h index 045704e47..95afa5375 100644 --- a/src/yuzu/configuration/configure_input_player.h +++ b/src/yuzu/configuration/configure_input_player.h | |||
| @@ -97,8 +97,10 @@ private: | |||
| 97 | /// Analog inputs are also represented each with a single button, used to configure with an | 97 | /// Analog inputs are also represented each with a single button, used to configure with an |
| 98 | /// actual analog stick | 98 | /// actual analog stick |
| 99 | std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_stick; | 99 | std::array<QPushButton*, Settings::NativeAnalog::NumAnalogs> analog_map_stick; |
| 100 | std::array<QSlider*, Settings::NativeAnalog::NumAnalogs> analog_map_deadzone; | 100 | std::array<QSlider*, Settings::NativeAnalog::NumAnalogs> |
| 101 | std::array<QLabel*, Settings::NativeAnalog::NumAnalogs> analog_map_deadzone_label; | 101 | analog_map_deadzone_and_modifier_slider; |
| 102 | std::array<QLabel*, Settings::NativeAnalog::NumAnalogs> | ||
| 103 | analog_map_deadzone_and_modifier_slider_label; | ||
| 102 | 104 | ||
| 103 | static const std::array<std::string, ANALOG_SUB_BUTTONS_NUM> analog_sub_buttons; | 105 | static const std::array<std::string, ANALOG_SUB_BUTTONS_NUM> analog_sub_buttons; |
| 104 | 106 | ||
diff --git a/src/yuzu/configuration/configure_input_player.ui b/src/yuzu/configuration/configure_input_player.ui index 4b37746a1..f27a77180 100644 --- a/src/yuzu/configuration/configure_input_player.ui +++ b/src/yuzu/configuration/configure_input_player.ui | |||
| @@ -171,11 +171,11 @@ | |||
| 171 | </layout> | 171 | </layout> |
| 172 | </item> | 172 | </item> |
| 173 | <item row="4" column="0" colspan="2"> | 173 | <item row="4" column="0" colspan="2"> |
| 174 | <layout class="QVBoxLayout" name="sliderRStickDeadzoneVerticalLayout"> | 174 | <layout class="QVBoxLayout" name="sliderRStickDeadzoneAndModifierVerticalLayout"> |
| 175 | <item> | 175 | <item> |
| 176 | <layout class="QHBoxLayout" name="sliderRStickDeadzoneHorizontalLayout"> | 176 | <layout class="QHBoxLayout" name="sliderRStickDeadzoneAndModifierHorizontalLayout"> |
| 177 | <item> | 177 | <item> |
| 178 | <widget class="QLabel" name="labelRStickDeadzone"> | 178 | <widget class="QLabel" name="labelRStickDeadzoneAndModifier"> |
| 179 | <property name="text"> | 179 | <property name="text"> |
| 180 | <string>Deadzone: 0</string> | 180 | <string>Deadzone: 0</string> |
| 181 | </property> | 181 | </property> |
| @@ -187,7 +187,7 @@ | |||
| 187 | </layout> | 187 | </layout> |
| 188 | </item> | 188 | </item> |
| 189 | <item> | 189 | <item> |
| 190 | <widget class="QSlider" name="sliderRStickDeadzone"> | 190 | <widget class="QSlider" name="sliderRStickDeadzoneAndModifier"> |
| 191 | <property name="orientation"> | 191 | <property name="orientation"> |
| 192 | <enum>Qt::Horizontal</enum> | 192 | <enum>Qt::Horizontal</enum> |
| 193 | </property> | 193 | </property> |
| @@ -784,14 +784,14 @@ | |||
| 784 | </layout> | 784 | </layout> |
| 785 | </item> | 785 | </item> |
| 786 | <item row="5" column="1" colspan="2"> | 786 | <item row="5" column="1" colspan="2"> |
| 787 | <layout class="QVBoxLayout" name="sliderLStickDeadzoneVerticalLayout"> | 787 | <layout class="QVBoxLayout" name="sliderLStickDeadzoneAndModifierVerticalLayout"> |
| 788 | <property name="sizeConstraint"> | 788 | <property name="sizeConstraint"> |
| 789 | <enum>QLayout::SetDefaultConstraint</enum> | 789 | <enum>QLayout::SetDefaultConstraint</enum> |
| 790 | </property> | 790 | </property> |
| 791 | <item> | 791 | <item> |
| 792 | <layout class="QHBoxLayout" name="sliderLStickDeadzoneHorizontalLayout"> | 792 | <layout class="QHBoxLayout" name="sliderLStickDeadzoneAndModifierHorizontalLayout"> |
| 793 | <item> | 793 | <item> |
| 794 | <widget class="QLabel" name="labelLStickDeadzone"> | 794 | <widget class="QLabel" name="labelLStickDeadzoneAndModifier"> |
| 795 | <property name="text"> | 795 | <property name="text"> |
| 796 | <string>Deadzone: 0</string> | 796 | <string>Deadzone: 0</string> |
| 797 | </property> | 797 | </property> |
| @@ -803,7 +803,7 @@ | |||
| 803 | </layout> | 803 | </layout> |
| 804 | </item> | 804 | </item> |
| 805 | <item> | 805 | <item> |
| 806 | <widget class="QSlider" name="sliderLStickDeadzone"> | 806 | <widget class="QSlider" name="sliderLStickDeadzoneAndModifier"> |
| 807 | <property name="orientation"> | 807 | <property name="orientation"> |
| 808 | <enum>Qt::Horizontal</enum> | 808 | <enum>Qt::Horizontal</enum> |
| 809 | </property> | 809 | </property> |
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h index 3e6d5a7cd..0cd0054c8 100644 --- a/src/yuzu/game_list_p.h +++ b/src/yuzu/game_list_p.h | |||
| @@ -126,13 +126,6 @@ public: | |||
| 126 | 126 | ||
| 127 | return GameListItem::data(role); | 127 | return GameListItem::data(role); |
| 128 | } | 128 | } |
| 129 | |||
| 130 | /** | ||
| 131 | * Override to prevent automatic sorting. | ||
| 132 | */ | ||
| 133 | bool operator<(const QStandardItem& other) const override { | ||
| 134 | return false; | ||
| 135 | } | ||
| 136 | }; | 129 | }; |
| 137 | 130 | ||
| 138 | class GameListItemCompat : public GameListItem { | 131 | class GameListItemCompat : public GameListItem { |
| @@ -279,6 +272,13 @@ public: | |||
| 279 | return static_cast<int>(dir_type); | 272 | return static_cast<int>(dir_type); |
| 280 | } | 273 | } |
| 281 | 274 | ||
| 275 | /** | ||
| 276 | * Override to prevent automatic sorting between folders and the addDir button. | ||
| 277 | */ | ||
| 278 | bool operator<(const QStandardItem& other) const override { | ||
| 279 | return false; | ||
| 280 | } | ||
| 281 | |||
| 282 | private: | 282 | private: |
| 283 | GameListItemType dir_type; | 283 | GameListItemType dir_type; |
| 284 | }; | 284 | }; |
diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index d1ac354bf..8476a5a16 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp | |||
| @@ -394,6 +394,8 @@ void Config::ReadValues() { | |||
| 394 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false); | 394 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false); |
| 395 | Settings::values.use_vsync = | 395 | Settings::values.use_vsync = |
| 396 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1)); | 396 | static_cast<u16>(sdl2_config->GetInteger("Renderer", "use_vsync", 1)); |
| 397 | Settings::values.use_fast_gpu_time = | ||
| 398 | sdl2_config->GetBoolean("Renderer", "use_fast_gpu_time", true); | ||
| 397 | 399 | ||
| 398 | Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); | 400 | Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); |
| 399 | Settings::values.bg_green = | 401 | Settings::values.bg_green = |
diff --git a/src/yuzu_tester/config.cpp b/src/yuzu_tester/config.cpp index c0325cc3c..3be58b15d 100644 --- a/src/yuzu_tester/config.cpp +++ b/src/yuzu_tester/config.cpp | |||
| @@ -130,6 +130,8 @@ void Config::ReadValues() { | |||
| 130 | Settings::values.gpu_accuracy = static_cast<Settings::GPUAccuracy>(gpu_accuracy_level); | 130 | Settings::values.gpu_accuracy = static_cast<Settings::GPUAccuracy>(gpu_accuracy_level); |
| 131 | Settings::values.use_asynchronous_gpu_emulation = | 131 | Settings::values.use_asynchronous_gpu_emulation = |
| 132 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false); | 132 | sdl2_config->GetBoolean("Renderer", "use_asynchronous_gpu_emulation", false); |
| 133 | Settings::values.use_fast_gpu_time = | ||
| 134 | sdl2_config->GetBoolean("Renderer", "use_fast_gpu_time", true); | ||
| 133 | 135 | ||
| 134 | Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); | 136 | Settings::values.bg_red = static_cast<float>(sdl2_config->GetReal("Renderer", "bg_red", 0.0)); |
| 135 | Settings::values.bg_green = | 137 | Settings::values.bg_green = |