diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/am/am.cpp | 213 | ||||
| -rw-r--r-- | src/core/hle/service/am/am.h | 33 | ||||
| -rw-r--r-- | src/core/hle/service/am/applet_ae.cpp | 48 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.cpp | 24 | ||||
| -rw-r--r-- | src/core/hle/service/filesystem/fsp_srv.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/mii/mii_types.h | 2 | ||||
| -rw-r--r-- | src/core/hle/service/ns/iplatform_service_manager.cpp | 17 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 42 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 | ||||
| -rw-r--r-- | src/yuzu/main.ui | 9 |
11 files changed, 360 insertions, 33 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 8ffdd19e7..e9bd04842 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include "core/hle/service/am/am.h" | 19 | #include "core/hle/service/am/am.h" |
| 20 | #include "core/hle/service/am/applet_ae.h" | 20 | #include "core/hle/service/am/applet_ae.h" |
| 21 | #include "core/hle/service/am/applet_oe.h" | 21 | #include "core/hle/service/am/applet_oe.h" |
| 22 | #include "core/hle/service/am/applets/applet_mii_edit_types.h" | ||
| 22 | #include "core/hle/service/am/applets/applet_profile_select.h" | 23 | #include "core/hle/service/am/applets/applet_profile_select.h" |
| 23 | #include "core/hle/service/am/applets/applet_web_browser.h" | 24 | #include "core/hle/service/am/applets/applet_web_browser.h" |
| 24 | #include "core/hle/service/am/applets/applets.h" | 25 | #include "core/hle/service/am/applets/applets.h" |
| @@ -190,7 +191,7 @@ IDisplayController::IDisplayController(Core::System& system_) | |||
| 190 | {5, nullptr, "GetLastForegroundCaptureImageEx"}, | 191 | {5, nullptr, "GetLastForegroundCaptureImageEx"}, |
| 191 | {6, nullptr, "GetLastApplicationCaptureImageEx"}, | 192 | {6, nullptr, "GetLastApplicationCaptureImageEx"}, |
| 192 | {7, nullptr, "GetCallerAppletCaptureImageEx"}, | 193 | {7, nullptr, "GetCallerAppletCaptureImageEx"}, |
| 193 | {8, nullptr, "TakeScreenShotOfOwnLayer"}, | 194 | {8, &IDisplayController::TakeScreenShotOfOwnLayer, "TakeScreenShotOfOwnLayer"}, |
| 194 | {9, nullptr, "CopyBetweenCaptureBuffers"}, | 195 | {9, nullptr, "CopyBetweenCaptureBuffers"}, |
| 195 | {10, nullptr, "AcquireLastApplicationCaptureBuffer"}, | 196 | {10, nullptr, "AcquireLastApplicationCaptureBuffer"}, |
| 196 | {11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, | 197 | {11, nullptr, "ReleaseLastApplicationCaptureBuffer"}, |
| @@ -218,6 +219,13 @@ IDisplayController::IDisplayController(Core::System& system_) | |||
| 218 | 219 | ||
| 219 | IDisplayController::~IDisplayController() = default; | 220 | IDisplayController::~IDisplayController() = default; |
| 220 | 221 | ||
| 222 | void IDisplayController::TakeScreenShotOfOwnLayer(HLERequestContext& ctx) { | ||
| 223 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 224 | |||
| 225 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 226 | rb.Push(ResultSuccess); | ||
| 227 | } | ||
| 228 | |||
| 221 | IDebugFunctions::IDebugFunctions(Core::System& system_) | 229 | IDebugFunctions::IDebugFunctions(Core::System& system_) |
| 222 | : ServiceFramework{system_, "IDebugFunctions"} { | 230 | : ServiceFramework{system_, "IDebugFunctions"} { |
| 223 | // clang-format off | 231 | // clang-format off |
| @@ -724,7 +732,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, | |||
| 724 | {110, nullptr, "OpenMyGpuErrorHandler"}, | 732 | {110, nullptr, "OpenMyGpuErrorHandler"}, |
| 725 | {120, nullptr, "GetAppletLaunchedHistory"}, | 733 | {120, nullptr, "GetAppletLaunchedHistory"}, |
| 726 | {200, nullptr, "GetOperationModeSystemInfo"}, | 734 | {200, nullptr, "GetOperationModeSystemInfo"}, |
| 727 | {300, nullptr, "GetSettingsPlatformRegion"}, | 735 | {300, &ICommonStateGetter::GetSettingsPlatformRegion, "GetSettingsPlatformRegion"}, |
| 728 | {400, nullptr, "ActivateMigrationService"}, | 736 | {400, nullptr, "ActivateMigrationService"}, |
| 729 | {401, nullptr, "DeactivateMigrationService"}, | 737 | {401, nullptr, "DeactivateMigrationService"}, |
| 730 | {500, nullptr, "DisableSleepTillShutdown"}, | 738 | {500, nullptr, "DisableSleepTillShutdown"}, |
| @@ -736,6 +744,10 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_, | |||
| 736 | // clang-format on | 744 | // clang-format on |
| 737 | 745 | ||
| 738 | RegisterHandlers(functions); | 746 | RegisterHandlers(functions); |
| 747 | |||
| 748 | // Configure applets to be in foreground state | ||
| 749 | msg_queue->PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged); | ||
| 750 | msg_queue->PushMessage(AppletMessageQueue::AppletMessage::ChangeIntoForeground); | ||
| 739 | } | 751 | } |
| 740 | 752 | ||
| 741 | ICommonStateGetter::~ICommonStateGetter() = default; | 753 | ICommonStateGetter::~ICommonStateGetter() = default; |
| @@ -867,6 +879,14 @@ void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(HLERequestContext& | |||
| 867 | rb.Push(ResultSuccess); | 879 | rb.Push(ResultSuccess); |
| 868 | } | 880 | } |
| 869 | 881 | ||
| 882 | void ICommonStateGetter::GetSettingsPlatformRegion(HLERequestContext& ctx) { | ||
| 883 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 884 | |||
| 885 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 886 | rb.Push(ResultSuccess); | ||
| 887 | rb.PushEnum(SysPlatformRegion::Global); | ||
| 888 | } | ||
| 889 | |||
| 870 | void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled( | 890 | void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled( |
| 871 | HLERequestContext& ctx) { | 891 | HLERequestContext& ctx) { |
| 872 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 892 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| @@ -1324,18 +1344,19 @@ void ILibraryAppletCreator::CreateHandleStorage(HLERequestContext& ctx) { | |||
| 1324 | 1344 | ||
| 1325 | ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) | 1345 | ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) |
| 1326 | : ServiceFramework{system_, "ILibraryAppletSelfAccessor"} { | 1346 | : ServiceFramework{system_, "ILibraryAppletSelfAccessor"} { |
| 1347 | // clang-format off | ||
| 1327 | static const FunctionInfo functions[] = { | 1348 | static const FunctionInfo functions[] = { |
| 1328 | {0, nullptr, "PopInData"}, | 1349 | {0, &ILibraryAppletSelfAccessor::PopInData, "PopInData"}, |
| 1329 | {1, nullptr, "PushOutData"}, | 1350 | {1, &ILibraryAppletSelfAccessor::PushOutData, "PushOutData"}, |
| 1330 | {2, nullptr, "PopInteractiveInData"}, | 1351 | {2, nullptr, "PopInteractiveInData"}, |
| 1331 | {3, nullptr, "PushInteractiveOutData"}, | 1352 | {3, nullptr, "PushInteractiveOutData"}, |
| 1332 | {5, nullptr, "GetPopInDataEvent"}, | 1353 | {5, nullptr, "GetPopInDataEvent"}, |
| 1333 | {6, nullptr, "GetPopInteractiveInDataEvent"}, | 1354 | {6, nullptr, "GetPopInteractiveInDataEvent"}, |
| 1334 | {10, nullptr, "ExitProcessAndReturn"}, | 1355 | {10, &ILibraryAppletSelfAccessor::ExitProcessAndReturn, "ExitProcessAndReturn"}, |
| 1335 | {11, nullptr, "GetLibraryAppletInfo"}, | 1356 | {11, &ILibraryAppletSelfAccessor::GetLibraryAppletInfo, "GetLibraryAppletInfo"}, |
| 1336 | {12, nullptr, "GetMainAppletIdentityInfo"}, | 1357 | {12, nullptr, "GetMainAppletIdentityInfo"}, |
| 1337 | {13, nullptr, "CanUseApplicationCore"}, | 1358 | {13, nullptr, "CanUseApplicationCore"}, |
| 1338 | {14, nullptr, "GetCallerAppletIdentityInfo"}, | 1359 | {14, &ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo, "GetCallerAppletIdentityInfo"}, |
| 1339 | {15, nullptr, "GetMainAppletApplicationControlProperty"}, | 1360 | {15, nullptr, "GetMainAppletApplicationControlProperty"}, |
| 1340 | {16, nullptr, "GetMainAppletStorageId"}, | 1361 | {16, nullptr, "GetMainAppletStorageId"}, |
| 1341 | {17, nullptr, "GetCallerAppletIdentityInfoStack"}, | 1362 | {17, nullptr, "GetCallerAppletIdentityInfoStack"}, |
| @@ -1361,10 +1382,142 @@ ILibraryAppletSelfAccessor::ILibraryAppletSelfAccessor(Core::System& system_) | |||
| 1361 | {140, nullptr, "SetApplicationMemoryReservation"}, | 1382 | {140, nullptr, "SetApplicationMemoryReservation"}, |
| 1362 | {150, nullptr, "ShouldSetGpuTimeSliceManually"}, | 1383 | {150, nullptr, "ShouldSetGpuTimeSliceManually"}, |
| 1363 | }; | 1384 | }; |
| 1385 | // clang-format on | ||
| 1364 | RegisterHandlers(functions); | 1386 | RegisterHandlers(functions); |
| 1387 | |||
| 1388 | PushInShowMiiEditData(); | ||
| 1365 | } | 1389 | } |
| 1366 | 1390 | ||
| 1367 | ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default; | 1391 | ILibraryAppletSelfAccessor::~ILibraryAppletSelfAccessor() = default; |
| 1392 | void ILibraryAppletSelfAccessor::PopInData(HLERequestContext& ctx) { | ||
| 1393 | LOG_INFO(Service_AM, "called"); | ||
| 1394 | |||
| 1395 | if (queue_data.empty()) { | ||
| 1396 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1397 | rb.Push(ResultNoDataInChannel); | ||
| 1398 | return; | ||
| 1399 | } | ||
| 1400 | |||
| 1401 | auto data = queue_data.front(); | ||
| 1402 | queue_data.pop_front(); | ||
| 1403 | |||
| 1404 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 1405 | rb.Push(ResultSuccess); | ||
| 1406 | rb.PushIpcInterface<IStorage>(system, std::move(data)); | ||
| 1407 | } | ||
| 1408 | |||
| 1409 | void ILibraryAppletSelfAccessor::PushOutData(HLERequestContext& ctx) { | ||
| 1410 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1411 | |||
| 1412 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1413 | rb.Push(ResultSuccess); | ||
| 1414 | } | ||
| 1415 | |||
| 1416 | void ILibraryAppletSelfAccessor::ExitProcessAndReturn(HLERequestContext& ctx) { | ||
| 1417 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1418 | |||
| 1419 | system.Exit(); | ||
| 1420 | |||
| 1421 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1422 | rb.Push(ResultSuccess); | ||
| 1423 | } | ||
| 1424 | |||
| 1425 | void ILibraryAppletSelfAccessor::GetLibraryAppletInfo(HLERequestContext& ctx) { | ||
| 1426 | struct LibraryAppletInfo { | ||
| 1427 | Applets::AppletId applet_id; | ||
| 1428 | Applets::LibraryAppletMode library_applet_mode; | ||
| 1429 | }; | ||
| 1430 | |||
| 1431 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1432 | |||
| 1433 | const LibraryAppletInfo applet_info{ | ||
| 1434 | .applet_id = Applets::AppletId::MiiEdit, | ||
| 1435 | .library_applet_mode = Applets::LibraryAppletMode::AllForeground, | ||
| 1436 | }; | ||
| 1437 | |||
| 1438 | IPC::ResponseBuilder rb{ctx, 4}; | ||
| 1439 | rb.Push(ResultSuccess); | ||
| 1440 | rb.PushRaw(applet_info); | ||
| 1441 | } | ||
| 1442 | |||
| 1443 | void ILibraryAppletSelfAccessor::GetCallerAppletIdentityInfo(HLERequestContext& ctx) { | ||
| 1444 | struct AppletIdentityInfo { | ||
| 1445 | Applets::AppletId applet_id; | ||
| 1446 | INSERT_PADDING_BYTES(0x4); | ||
| 1447 | u64 application_id; | ||
| 1448 | }; | ||
| 1449 | |||
| 1450 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1451 | |||
| 1452 | const AppletIdentityInfo applet_info{ | ||
| 1453 | .applet_id = Applets::AppletId::QLaunch, | ||
| 1454 | .application_id = 0x0100000000001000ull, | ||
| 1455 | }; | ||
| 1456 | |||
| 1457 | IPC::ResponseBuilder rb{ctx, 6}; | ||
| 1458 | rb.Push(ResultSuccess); | ||
| 1459 | rb.PushRaw(applet_info); | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | void ILibraryAppletSelfAccessor::PushInShowMiiEditData() { | ||
| 1463 | struct MiiEditV3 { | ||
| 1464 | Applets::MiiEditAppletInputCommon common; | ||
| 1465 | Applets::MiiEditAppletInputV3 input; | ||
| 1466 | }; | ||
| 1467 | static_assert(sizeof(MiiEditV3) == 0x100, "MiiEditV3 has incorrect size."); | ||
| 1468 | |||
| 1469 | MiiEditV3 mii_arguments{ | ||
| 1470 | .common = | ||
| 1471 | { | ||
| 1472 | .version = Applets::MiiEditAppletVersion::Version3, | ||
| 1473 | .applet_mode = Applets::MiiEditAppletMode::ShowMiiEdit, | ||
| 1474 | }, | ||
| 1475 | .input{}, | ||
| 1476 | }; | ||
| 1477 | |||
| 1478 | std::vector<u8> argument_data(sizeof(mii_arguments)); | ||
| 1479 | std::memcpy(argument_data.data(), &mii_arguments, sizeof(mii_arguments)); | ||
| 1480 | |||
| 1481 | queue_data.emplace_back(std::move(argument_data)); | ||
| 1482 | } | ||
| 1483 | |||
| 1484 | IAppletCommonFunctions::IAppletCommonFunctions(Core::System& system_) | ||
| 1485 | : ServiceFramework{system_, "IAppletCommonFunctions"} { | ||
| 1486 | // clang-format off | ||
| 1487 | static const FunctionInfo functions[] = { | ||
| 1488 | {0, nullptr, "SetTerminateResult"}, | ||
| 1489 | {10, nullptr, "ReadThemeStorage"}, | ||
| 1490 | {11, nullptr, "WriteThemeStorage"}, | ||
| 1491 | {20, nullptr, "PushToAppletBoundChannel"}, | ||
| 1492 | {21, nullptr, "TryPopFromAppletBoundChannel"}, | ||
| 1493 | {40, nullptr, "GetDisplayLogicalResolution"}, | ||
| 1494 | {42, nullptr, "SetDisplayMagnification"}, | ||
| 1495 | {50, nullptr, "SetHomeButtonDoubleClickEnabled"}, | ||
| 1496 | {51, nullptr, "GetHomeButtonDoubleClickEnabled"}, | ||
| 1497 | {52, nullptr, "IsHomeButtonShortPressedBlocked"}, | ||
| 1498 | {60, nullptr, "IsVrModeCurtainRequired"}, | ||
| 1499 | {61, nullptr, "IsSleepRequiredByHighTemperature"}, | ||
| 1500 | {62, nullptr, "IsSleepRequiredByLowBattery"}, | ||
| 1501 | {70, &IAppletCommonFunctions::SetCpuBoostRequestPriority, "SetCpuBoostRequestPriority"}, | ||
| 1502 | {80, nullptr, "SetHandlingCaptureButtonShortPressedMessageEnabledForApplet"}, | ||
| 1503 | {81, nullptr, "SetHandlingCaptureButtonLongPressedMessageEnabledForApplet"}, | ||
| 1504 | {90, nullptr, "OpenNamedChannelAsParent"}, | ||
| 1505 | {91, nullptr, "OpenNamedChannelAsChild"}, | ||
| 1506 | {100, nullptr, "SetApplicationCoreUsageMode"}, | ||
| 1507 | }; | ||
| 1508 | // clang-format on | ||
| 1509 | |||
| 1510 | RegisterHandlers(functions); | ||
| 1511 | } | ||
| 1512 | |||
| 1513 | IAppletCommonFunctions::~IAppletCommonFunctions() = default; | ||
| 1514 | |||
| 1515 | void IAppletCommonFunctions::SetCpuBoostRequestPriority(HLERequestContext& ctx) { | ||
| 1516 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 1517 | |||
| 1518 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 1519 | rb.Push(ResultSuccess); | ||
| 1520 | } | ||
| 1368 | 1521 | ||
| 1369 | IApplicationFunctions::IApplicationFunctions(Core::System& system_) | 1522 | IApplicationFunctions::IApplicationFunctions(Core::System& system_) |
| 1370 | : ServiceFramework{system_, "IApplicationFunctions"}, service_context{system, | 1523 | : ServiceFramework{system_, "IApplicationFunctions"}, service_context{system, |
| @@ -2049,8 +2202,8 @@ IProcessWindingController::IProcessWindingController(Core::System& system_) | |||
| 2049 | : ServiceFramework{system_, "IProcessWindingController"} { | 2202 | : ServiceFramework{system_, "IProcessWindingController"} { |
| 2050 | // clang-format off | 2203 | // clang-format off |
| 2051 | static const FunctionInfo functions[] = { | 2204 | static const FunctionInfo functions[] = { |
| 2052 | {0, nullptr, "GetLaunchReason"}, | 2205 | {0, &IProcessWindingController::GetLaunchReason, "GetLaunchReason"}, |
| 2053 | {11, nullptr, "OpenCallingLibraryApplet"}, | 2206 | {11, &IProcessWindingController::OpenCallingLibraryApplet, "OpenCallingLibraryApplet"}, |
| 2054 | {21, nullptr, "PushContext"}, | 2207 | {21, nullptr, "PushContext"}, |
| 2055 | {22, nullptr, "PopContext"}, | 2208 | {22, nullptr, "PopContext"}, |
| 2056 | {23, nullptr, "CancelWindingReservation"}, | 2209 | {23, nullptr, "CancelWindingReservation"}, |
| @@ -2064,4 +2217,46 @@ IProcessWindingController::IProcessWindingController(Core::System& system_) | |||
| 2064 | } | 2217 | } |
| 2065 | 2218 | ||
| 2066 | IProcessWindingController::~IProcessWindingController() = default; | 2219 | IProcessWindingController::~IProcessWindingController() = default; |
| 2220 | |||
| 2221 | void IProcessWindingController::GetLaunchReason(HLERequestContext& ctx) { | ||
| 2222 | LOG_WARNING(Service_AM, "(STUBBED) called"); | ||
| 2223 | |||
| 2224 | struct AppletProcessLaunchReason { | ||
| 2225 | u8 flag; | ||
| 2226 | INSERT_PADDING_BYTES(3); | ||
| 2227 | }; | ||
| 2228 | static_assert(sizeof(AppletProcessLaunchReason) == 0x4, | ||
| 2229 | "AppletProcessLaunchReason is an invalid size"); | ||
| 2230 | |||
| 2231 | AppletProcessLaunchReason reason{ | ||
| 2232 | .flag = 0, | ||
| 2233 | }; | ||
| 2234 | |||
| 2235 | IPC::ResponseBuilder rb{ctx, 3}; | ||
| 2236 | rb.Push(ResultSuccess); | ||
| 2237 | rb.PushRaw(reason); | ||
| 2238 | } | ||
| 2239 | |||
| 2240 | void IProcessWindingController::OpenCallingLibraryApplet(HLERequestContext& ctx) { | ||
| 2241 | const auto applet_id = Applets::AppletId::MiiEdit; | ||
| 2242 | const auto applet_mode = Applets::LibraryAppletMode::AllForeground; | ||
| 2243 | |||
| 2244 | LOG_WARNING(Service_AM, "(STUBBED) called with applet_id={:08X}, applet_mode={:08X}", applet_id, | ||
| 2245 | applet_mode); | ||
| 2246 | |||
| 2247 | const auto& applet_manager{system.GetAppletManager()}; | ||
| 2248 | const auto applet = applet_manager.GetApplet(applet_id, applet_mode); | ||
| 2249 | |||
| 2250 | if (applet == nullptr) { | ||
| 2251 | LOG_ERROR(Service_AM, "Applet doesn't exist! applet_id={}", applet_id); | ||
| 2252 | |||
| 2253 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 2254 | rb.Push(ResultUnknown); | ||
| 2255 | return; | ||
| 2256 | } | ||
| 2257 | |||
| 2258 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 2259 | rb.Push(ResultSuccess); | ||
| 2260 | rb.PushIpcInterface<ILibraryAppletAccessor>(system, applet); | ||
| 2261 | } | ||
| 2067 | } // namespace Service::AM | 2262 | } // namespace Service::AM |
diff --git a/src/core/hle/service/am/am.h b/src/core/hle/service/am/am.h index f86841c60..5b97eb5e3 100644 --- a/src/core/hle/service/am/am.h +++ b/src/core/hle/service/am/am.h | |||
| @@ -120,6 +120,9 @@ class IDisplayController final : public ServiceFramework<IDisplayController> { | |||
| 120 | public: | 120 | public: |
| 121 | explicit IDisplayController(Core::System& system_); | 121 | explicit IDisplayController(Core::System& system_); |
| 122 | ~IDisplayController() override; | 122 | ~IDisplayController() override; |
| 123 | |||
| 124 | private: | ||
| 125 | void TakeScreenShotOfOwnLayer(HLERequestContext& ctx); | ||
| 123 | }; | 126 | }; |
| 124 | 127 | ||
| 125 | class IDebugFunctions final : public ServiceFramework<IDebugFunctions> { | 128 | class IDebugFunctions final : public ServiceFramework<IDebugFunctions> { |
| @@ -212,6 +215,11 @@ private: | |||
| 212 | CaptureButtonLongPressing, | 215 | CaptureButtonLongPressing, |
| 213 | }; | 216 | }; |
| 214 | 217 | ||
| 218 | enum class SysPlatformRegion : s32 { | ||
| 219 | Global = 1, | ||
| 220 | Terra = 2, | ||
| 221 | }; | ||
| 222 | |||
| 215 | void GetEventHandle(HLERequestContext& ctx); | 223 | void GetEventHandle(HLERequestContext& ctx); |
| 216 | void ReceiveMessage(HLERequestContext& ctx); | 224 | void ReceiveMessage(HLERequestContext& ctx); |
| 217 | void GetCurrentFocusState(HLERequestContext& ctx); | 225 | void GetCurrentFocusState(HLERequestContext& ctx); |
| @@ -227,6 +235,7 @@ private: | |||
| 227 | void GetDefaultDisplayResolution(HLERequestContext& ctx); | 235 | void GetDefaultDisplayResolution(HLERequestContext& ctx); |
| 228 | void SetCpuBoostMode(HLERequestContext& ctx); | 236 | void SetCpuBoostMode(HLERequestContext& ctx); |
| 229 | void PerformSystemButtonPressingIfInFocus(HLERequestContext& ctx); | 237 | void PerformSystemButtonPressingIfInFocus(HLERequestContext& ctx); |
| 238 | void GetSettingsPlatformRegion(HLERequestContext& ctx); | ||
| 230 | void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(HLERequestContext& ctx); | 239 | void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(HLERequestContext& ctx); |
| 231 | 240 | ||
| 232 | std::shared_ptr<AppletMessageQueue> msg_queue; | 241 | std::shared_ptr<AppletMessageQueue> msg_queue; |
| @@ -294,6 +303,26 @@ class ILibraryAppletSelfAccessor final : public ServiceFramework<ILibraryAppletS | |||
| 294 | public: | 303 | public: |
| 295 | explicit ILibraryAppletSelfAccessor(Core::System& system_); | 304 | explicit ILibraryAppletSelfAccessor(Core::System& system_); |
| 296 | ~ILibraryAppletSelfAccessor() override; | 305 | ~ILibraryAppletSelfAccessor() override; |
| 306 | |||
| 307 | private: | ||
| 308 | void PopInData(HLERequestContext& ctx); | ||
| 309 | void PushOutData(HLERequestContext& ctx); | ||
| 310 | void GetLibraryAppletInfo(HLERequestContext& ctx); | ||
| 311 | void ExitProcessAndReturn(HLERequestContext& ctx); | ||
| 312 | void GetCallerAppletIdentityInfo(HLERequestContext& ctx); | ||
| 313 | |||
| 314 | void PushInShowMiiEditData(); | ||
| 315 | |||
| 316 | std::deque<std::vector<u8>> queue_data; | ||
| 317 | }; | ||
| 318 | |||
| 319 | class IAppletCommonFunctions final : public ServiceFramework<IAppletCommonFunctions> { | ||
| 320 | public: | ||
| 321 | explicit IAppletCommonFunctions(Core::System& system_); | ||
| 322 | ~IAppletCommonFunctions() override; | ||
| 323 | |||
| 324 | private: | ||
| 325 | void SetCpuBoostRequestPriority(HLERequestContext& ctx); | ||
| 297 | }; | 326 | }; |
| 298 | 327 | ||
| 299 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { | 328 | class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> { |
| @@ -378,6 +407,10 @@ class IProcessWindingController final : public ServiceFramework<IProcessWindingC | |||
| 378 | public: | 407 | public: |
| 379 | explicit IProcessWindingController(Core::System& system_); | 408 | explicit IProcessWindingController(Core::System& system_); |
| 380 | ~IProcessWindingController() override; | 409 | ~IProcessWindingController() override; |
| 410 | |||
| 411 | private: | ||
| 412 | void GetLaunchReason(HLERequestContext& ctx); | ||
| 413 | void OpenCallingLibraryApplet(HLERequestContext& ctx); | ||
| 381 | }; | 414 | }; |
| 382 | 415 | ||
| 383 | void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system); | 416 | void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system); |
diff --git a/src/core/hle/service/am/applet_ae.cpp b/src/core/hle/service/am/applet_ae.cpp index ee9d99a54..eb12312cc 100644 --- a/src/core/hle/service/am/applet_ae.cpp +++ b/src/core/hle/service/am/applet_ae.cpp | |||
| @@ -27,7 +27,7 @@ public: | |||
| 27 | {10, &ILibraryAppletProxy::GetProcessWindingController, "GetProcessWindingController"}, | 27 | {10, &ILibraryAppletProxy::GetProcessWindingController, "GetProcessWindingController"}, |
| 28 | {11, &ILibraryAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"}, | 28 | {11, &ILibraryAppletProxy::GetLibraryAppletCreator, "GetLibraryAppletCreator"}, |
| 29 | {20, &ILibraryAppletProxy::OpenLibraryAppletSelfAccessor, "OpenLibraryAppletSelfAccessor"}, | 29 | {20, &ILibraryAppletProxy::OpenLibraryAppletSelfAccessor, "OpenLibraryAppletSelfAccessor"}, |
| 30 | {21, nullptr, "GetAppletCommonFunctions"}, | 30 | {21, &ILibraryAppletProxy::GetAppletCommonFunctions, "GetAppletCommonFunctions"}, |
| 31 | {22, nullptr, "GetHomeMenuFunctions"}, | 31 | {22, nullptr, "GetHomeMenuFunctions"}, |
| 32 | {23, nullptr, "GetGlobalStateController"}, | 32 | {23, nullptr, "GetGlobalStateController"}, |
| 33 | {1000, &ILibraryAppletProxy::GetDebugFunctions, "GetDebugFunctions"}, | 33 | {1000, &ILibraryAppletProxy::GetDebugFunctions, "GetDebugFunctions"}, |
| @@ -86,28 +86,36 @@ private: | |||
| 86 | rb.PushIpcInterface<IProcessWindingController>(system); | 86 | rb.PushIpcInterface<IProcessWindingController>(system); |
| 87 | } | 87 | } |
| 88 | 88 | ||
| 89 | void GetDebugFunctions(HLERequestContext& ctx) { | 89 | void GetLibraryAppletCreator(HLERequestContext& ctx) { |
| 90 | LOG_DEBUG(Service_AM, "called"); | 90 | LOG_DEBUG(Service_AM, "called"); |
| 91 | 91 | ||
| 92 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 92 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 93 | rb.Push(ResultSuccess); | 93 | rb.Push(ResultSuccess); |
| 94 | rb.PushIpcInterface<IDebugFunctions>(system); | 94 | rb.PushIpcInterface<ILibraryAppletCreator>(system); |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | void GetLibraryAppletCreator(HLERequestContext& ctx) { | 97 | void OpenLibraryAppletSelfAccessor(HLERequestContext& ctx) { |
| 98 | LOG_DEBUG(Service_AM, "called"); | 98 | LOG_DEBUG(Service_AM, "called"); |
| 99 | 99 | ||
| 100 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 100 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 101 | rb.Push(ResultSuccess); | 101 | rb.Push(ResultSuccess); |
| 102 | rb.PushIpcInterface<ILibraryAppletCreator>(system); | 102 | rb.PushIpcInterface<ILibraryAppletSelfAccessor>(system); |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | void OpenLibraryAppletSelfAccessor(HLERequestContext& ctx) { | 105 | void GetAppletCommonFunctions(HLERequestContext& ctx) { |
| 106 | LOG_DEBUG(Service_AM, "called"); | 106 | LOG_DEBUG(Service_AM, "called"); |
| 107 | 107 | ||
| 108 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | 108 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; |
| 109 | rb.Push(ResultSuccess); | 109 | rb.Push(ResultSuccess); |
| 110 | rb.PushIpcInterface<ILibraryAppletSelfAccessor>(system); | 110 | rb.PushIpcInterface<IAppletCommonFunctions>(system); |
| 111 | } | ||
| 112 | |||
| 113 | void GetDebugFunctions(HLERequestContext& ctx) { | ||
| 114 | LOG_DEBUG(Service_AM, "called"); | ||
| 115 | |||
| 116 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 117 | rb.Push(ResultSuccess); | ||
| 118 | rb.PushIpcInterface<IDebugFunctions>(system); | ||
| 111 | } | 119 | } |
| 112 | 120 | ||
| 113 | Nvnflinger::Nvnflinger& nvnflinger; | 121 | Nvnflinger::Nvnflinger& nvnflinger; |
| @@ -133,7 +141,7 @@ public: | |||
| 133 | {20, &ISystemAppletProxy::GetHomeMenuFunctions, "GetHomeMenuFunctions"}, | 141 | {20, &ISystemAppletProxy::GetHomeMenuFunctions, "GetHomeMenuFunctions"}, |
| 134 | {21, &ISystemAppletProxy::GetGlobalStateController, "GetGlobalStateController"}, | 142 | {21, &ISystemAppletProxy::GetGlobalStateController, "GetGlobalStateController"}, |
| 135 | {22, &ISystemAppletProxy::GetApplicationCreator, "GetApplicationCreator"}, | 143 | {22, &ISystemAppletProxy::GetApplicationCreator, "GetApplicationCreator"}, |
| 136 | {23, nullptr, "GetAppletCommonFunctions"}, | 144 | {23, &ISystemAppletProxy::GetAppletCommonFunctions, "GetAppletCommonFunctions"}, |
| 137 | {1000, &ISystemAppletProxy::GetDebugFunctions, "GetDebugFunctions"}, | 145 | {1000, &ISystemAppletProxy::GetDebugFunctions, "GetDebugFunctions"}, |
| 138 | }; | 146 | }; |
| 139 | // clang-format on | 147 | // clang-format on |
| @@ -182,14 +190,6 @@ private: | |||
| 182 | rb.PushIpcInterface<IDisplayController>(system); | 190 | rb.PushIpcInterface<IDisplayController>(system); |
| 183 | } | 191 | } |
| 184 | 192 | ||
| 185 | void GetDebugFunctions(HLERequestContext& ctx) { | ||
| 186 | LOG_DEBUG(Service_AM, "called"); | ||
| 187 | |||
| 188 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 189 | rb.Push(ResultSuccess); | ||
| 190 | rb.PushIpcInterface<IDebugFunctions>(system); | ||
| 191 | } | ||
| 192 | |||
| 193 | void GetLibraryAppletCreator(HLERequestContext& ctx) { | 193 | void GetLibraryAppletCreator(HLERequestContext& ctx) { |
| 194 | LOG_DEBUG(Service_AM, "called"); | 194 | LOG_DEBUG(Service_AM, "called"); |
| 195 | 195 | ||
| @@ -222,6 +222,22 @@ private: | |||
| 222 | rb.PushIpcInterface<IApplicationCreator>(system); | 222 | rb.PushIpcInterface<IApplicationCreator>(system); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | void GetAppletCommonFunctions(HLERequestContext& ctx) { | ||
| 226 | LOG_DEBUG(Service_AM, "called"); | ||
| 227 | |||
| 228 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 229 | rb.Push(ResultSuccess); | ||
| 230 | rb.PushIpcInterface<IAppletCommonFunctions>(system); | ||
| 231 | } | ||
| 232 | |||
| 233 | void GetDebugFunctions(HLERequestContext& ctx) { | ||
| 234 | LOG_DEBUG(Service_AM, "called"); | ||
| 235 | |||
| 236 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 237 | rb.Push(ResultSuccess); | ||
| 238 | rb.PushIpcInterface<IDebugFunctions>(system); | ||
| 239 | } | ||
| 240 | |||
| 225 | Nvnflinger::Nvnflinger& nvnflinger; | 241 | Nvnflinger::Nvnflinger& nvnflinger; |
| 226 | std::shared_ptr<AppletMessageQueue> msg_queue; | 242 | std::shared_ptr<AppletMessageQueue> msg_queue; |
| 227 | }; | 243 | }; |
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp index 6e4d26b1e..2492bbc16 100644 --- a/src/core/hle/service/filesystem/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp_srv.cpp | |||
| @@ -698,7 +698,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) | |||
| 698 | {19, nullptr, "FormatSdCardFileSystem"}, | 698 | {19, nullptr, "FormatSdCardFileSystem"}, |
| 699 | {21, nullptr, "DeleteSaveDataFileSystem"}, | 699 | {21, nullptr, "DeleteSaveDataFileSystem"}, |
| 700 | {22, &FSP_SRV::CreateSaveDataFileSystem, "CreateSaveDataFileSystem"}, | 700 | {22, &FSP_SRV::CreateSaveDataFileSystem, "CreateSaveDataFileSystem"}, |
| 701 | {23, nullptr, "CreateSaveDataFileSystemBySystemSaveDataId"}, | 701 | {23, &FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId, "CreateSaveDataFileSystemBySystemSaveDataId"}, |
| 702 | {24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, | 702 | {24, nullptr, "RegisterSaveDataFileSystemAtomicDeletion"}, |
| 703 | {25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, | 703 | {25, nullptr, "DeleteSaveDataFileSystemBySaveDataSpaceId"}, |
| 704 | {26, nullptr, "FormatSdCardDryRun"}, | 704 | {26, nullptr, "FormatSdCardDryRun"}, |
| @@ -712,7 +712,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) | |||
| 712 | {35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, | 712 | {35, nullptr, "CreateSaveDataFileSystemByHashSalt"}, |
| 713 | {36, nullptr, "OpenHostFileSystemWithOption"}, | 713 | {36, nullptr, "OpenHostFileSystemWithOption"}, |
| 714 | {51, &FSP_SRV::OpenSaveDataFileSystem, "OpenSaveDataFileSystem"}, | 714 | {51, &FSP_SRV::OpenSaveDataFileSystem, "OpenSaveDataFileSystem"}, |
| 715 | {52, nullptr, "OpenSaveDataFileSystemBySystemSaveDataId"}, | 715 | {52, &FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId, "OpenSaveDataFileSystemBySystemSaveDataId"}, |
| 716 | {53, &FSP_SRV::OpenReadOnlySaveDataFileSystem, "OpenReadOnlySaveDataFileSystem"}, | 716 | {53, &FSP_SRV::OpenReadOnlySaveDataFileSystem, "OpenReadOnlySaveDataFileSystem"}, |
| 717 | {57, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, | 717 | {57, nullptr, "ReadSaveDataFileSystemExtraDataBySaveDataSpaceId"}, |
| 718 | {58, nullptr, "ReadSaveDataFileSystemExtraData"}, | 718 | {58, nullptr, "ReadSaveDataFileSystemExtraData"}, |
| @@ -870,6 +870,21 @@ void FSP_SRV::CreateSaveDataFileSystem(HLERequestContext& ctx) { | |||
| 870 | rb.Push(ResultSuccess); | 870 | rb.Push(ResultSuccess); |
| 871 | } | 871 | } |
| 872 | 872 | ||
| 873 | void FSP_SRV::CreateSaveDataFileSystemBySystemSaveDataId(HLERequestContext& ctx) { | ||
| 874 | IPC::RequestParser rp{ctx}; | ||
| 875 | |||
| 876 | auto save_struct = rp.PopRaw<FileSys::SaveDataAttribute>(); | ||
| 877 | [[maybe_unused]] auto save_create_struct = rp.PopRaw<std::array<u8, 0x40>>(); | ||
| 878 | |||
| 879 | LOG_DEBUG(Service_FS, "called save_struct = {}", save_struct.DebugInfo()); | ||
| 880 | |||
| 881 | FileSys::VirtualDir save_data_dir{}; | ||
| 882 | fsc.CreateSaveData(&save_data_dir, FileSys::SaveDataSpaceId::NandSystem, save_struct); | ||
| 883 | |||
| 884 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 885 | rb.Push(ResultSuccess); | ||
| 886 | } | ||
| 887 | |||
| 873 | void FSP_SRV::OpenSaveDataFileSystem(HLERequestContext& ctx) { | 888 | void FSP_SRV::OpenSaveDataFileSystem(HLERequestContext& ctx) { |
| 874 | IPC::RequestParser rp{ctx}; | 889 | IPC::RequestParser rp{ctx}; |
| 875 | 890 | ||
| @@ -916,6 +931,11 @@ void FSP_SRV::OpenSaveDataFileSystem(HLERequestContext& ctx) { | |||
| 916 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); | 931 | rb.PushIpcInterface<IFileSystem>(std::move(filesystem)); |
| 917 | } | 932 | } |
| 918 | 933 | ||
| 934 | void FSP_SRV::OpenSaveDataFileSystemBySystemSaveDataId(HLERequestContext& ctx) { | ||
| 935 | LOG_WARNING(Service_FS, "(STUBBED) called, delegating to 51 OpenSaveDataFilesystem"); | ||
| 936 | OpenSaveDataFileSystem(ctx); | ||
| 937 | } | ||
| 938 | |||
| 919 | void FSP_SRV::OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx) { | 939 | void FSP_SRV::OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx) { |
| 920 | LOG_WARNING(Service_FS, "(STUBBED) called, delegating to 51 OpenSaveDataFilesystem"); | 940 | LOG_WARNING(Service_FS, "(STUBBED) called, delegating to 51 OpenSaveDataFilesystem"); |
| 921 | OpenSaveDataFileSystem(ctx); | 941 | OpenSaveDataFileSystem(ctx); |
diff --git a/src/core/hle/service/filesystem/fsp_srv.h b/src/core/hle/service/filesystem/fsp_srv.h index 4f3c2f6de..280bc9867 100644 --- a/src/core/hle/service/filesystem/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp_srv.h | |||
| @@ -39,7 +39,9 @@ private: | |||
| 39 | void OpenFileSystemWithPatch(HLERequestContext& ctx); | 39 | void OpenFileSystemWithPatch(HLERequestContext& ctx); |
| 40 | void OpenSdCardFileSystem(HLERequestContext& ctx); | 40 | void OpenSdCardFileSystem(HLERequestContext& ctx); |
| 41 | void CreateSaveDataFileSystem(HLERequestContext& ctx); | 41 | void CreateSaveDataFileSystem(HLERequestContext& ctx); |
| 42 | void CreateSaveDataFileSystemBySystemSaveDataId(HLERequestContext& ctx); | ||
| 42 | void OpenSaveDataFileSystem(HLERequestContext& ctx); | 43 | void OpenSaveDataFileSystem(HLERequestContext& ctx); |
| 44 | void OpenSaveDataFileSystemBySystemSaveDataId(HLERequestContext& ctx); | ||
| 43 | void OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx); | 45 | void OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx); |
| 44 | void OpenSaveDataInfoReaderBySaveDataSpaceId(HLERequestContext& ctx); | 46 | void OpenSaveDataInfoReaderBySaveDataSpaceId(HLERequestContext& ctx); |
| 45 | void OpenSaveDataInfoReaderOnlyCacheStorage(HLERequestContext& ctx); | 47 | void OpenSaveDataInfoReaderOnlyCacheStorage(HLERequestContext& ctx); |
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 146bb486d..bc822f19e 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp | |||
| @@ -346,6 +346,7 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) { | |||
| 346 | } | 346 | } |
| 347 | SignalStyleSetChangedEvent(npad_id); | 347 | SignalStyleSetChangedEvent(npad_id); |
| 348 | WriteEmptyEntry(controller.shared_memory); | 348 | WriteEmptyEntry(controller.shared_memory); |
| 349 | hid_core.SetLastActiveController(npad_id); | ||
| 349 | } | 350 | } |
| 350 | 351 | ||
| 351 | void Controller_NPad::OnInit() { | 352 | void Controller_NPad::OnInit() { |
diff --git a/src/core/hle/service/mii/mii_types.h b/src/core/hle/service/mii/mii_types.h index f43efd83c..08c6029df 100644 --- a/src/core/hle/service/mii/mii_types.h +++ b/src/core/hle/service/mii/mii_types.h | |||
| @@ -614,7 +614,7 @@ struct Nickname { | |||
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | std::size_t index = 1; | 616 | std::size_t index = 1; |
| 617 | while (data[index] != 0) { | 617 | while (index < MaxNameSize && data[index] != 0) { |
| 618 | index++; | 618 | index++; |
| 619 | } | 619 | } |
| 620 | while (index < MaxNameSize && data[index] == 0) { | 620 | while (index < MaxNameSize && data[index] == 0) { |
diff --git a/src/core/hle/service/ns/iplatform_service_manager.cpp b/src/core/hle/service/ns/iplatform_service_manager.cpp index 6c2f5e70b..46268be95 100644 --- a/src/core/hle/service/ns/iplatform_service_manager.cpp +++ b/src/core/hle/service/ns/iplatform_service_manager.cpp | |||
| @@ -144,7 +144,7 @@ IPlatformServiceManager::IPlatformServiceManager(Core::System& system_, const ch | |||
| 144 | {3, &IPlatformServiceManager::GetSharedMemoryAddressOffset, "GetSharedMemoryAddressOffset"}, | 144 | {3, &IPlatformServiceManager::GetSharedMemoryAddressOffset, "GetSharedMemoryAddressOffset"}, |
| 145 | {4, &IPlatformServiceManager::GetSharedMemoryNativeHandle, "GetSharedMemoryNativeHandle"}, | 145 | {4, &IPlatformServiceManager::GetSharedMemoryNativeHandle, "GetSharedMemoryNativeHandle"}, |
| 146 | {5, &IPlatformServiceManager::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"}, | 146 | {5, &IPlatformServiceManager::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriority"}, |
| 147 | {6, nullptr, "GetSharedFontInOrderOfPriorityForSystem"}, | 147 | {6, &IPlatformServiceManager::GetSharedFontInOrderOfPriority, "GetSharedFontInOrderOfPriorityForSystem"}, |
| 148 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, | 148 | {100, nullptr, "RequestApplicationFunctionAuthorization"}, |
| 149 | {101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, | 149 | {101, nullptr, "RequestApplicationFunctionAuthorizationByProcessId"}, |
| 150 | {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, | 150 | {102, nullptr, "RequestApplicationFunctionAuthorizationByApplicationId"}, |
| @@ -262,8 +262,17 @@ void IPlatformServiceManager::GetSharedMemoryNativeHandle(HLERequestContext& ctx | |||
| 262 | } | 262 | } |
| 263 | 263 | ||
| 264 | void IPlatformServiceManager::GetSharedFontInOrderOfPriority(HLERequestContext& ctx) { | 264 | void IPlatformServiceManager::GetSharedFontInOrderOfPriority(HLERequestContext& ctx) { |
| 265 | // The maximum number of elements that can be returned is 6. Regardless of the available fonts | ||
| 266 | // or buffer size. | ||
| 267 | constexpr std::size_t MaxElementCount = 6; | ||
| 265 | IPC::RequestParser rp{ctx}; | 268 | IPC::RequestParser rp{ctx}; |
| 266 | const u64 language_code{rp.Pop<u64>()}; // TODO(ogniK): Find out what this is used for | 269 | const u64 language_code{rp.Pop<u64>()}; // TODO(ogniK): Find out what this is used for |
| 270 | const std::size_t font_codes_count = | ||
| 271 | std::min(MaxElementCount, ctx.GetWriteBufferNumElements<u32>(0)); | ||
| 272 | const std::size_t font_offsets_count = | ||
| 273 | std::min(MaxElementCount, ctx.GetWriteBufferNumElements<u32>(1)); | ||
| 274 | const std::size_t font_sizes_count = | ||
| 275 | std::min(MaxElementCount, ctx.GetWriteBufferNumElements<u32>(2)); | ||
| 267 | LOG_DEBUG(Service_NS, "called, language_code={:X}", language_code); | 276 | LOG_DEBUG(Service_NS, "called, language_code={:X}", language_code); |
| 268 | 277 | ||
| 269 | IPC::ResponseBuilder rb{ctx, 4}; | 278 | IPC::ResponseBuilder rb{ctx, 4}; |
| @@ -280,9 +289,9 @@ void IPlatformServiceManager::GetSharedFontInOrderOfPriority(HLERequestContext& | |||
| 280 | } | 289 | } |
| 281 | 290 | ||
| 282 | // Resize buffers if game requests smaller size output | 291 | // Resize buffers if game requests smaller size output |
| 283 | font_codes.resize(std::min(font_codes.size(), ctx.GetWriteBufferNumElements<u32>(0))); | 292 | font_codes.resize(std::min(font_codes.size(), font_codes_count)); |
| 284 | font_offsets.resize(std::min(font_offsets.size(), ctx.GetWriteBufferNumElements<u32>(1))); | 293 | font_offsets.resize(std::min(font_offsets.size(), font_offsets_count)); |
| 285 | font_sizes.resize(std::min(font_sizes.size(), ctx.GetWriteBufferNumElements<u32>(2))); | 294 | font_sizes.resize(std::min(font_sizes.size(), font_sizes_count)); |
| 286 | 295 | ||
| 287 | ctx.WriteBuffer(font_codes, 0); | 296 | ctx.WriteBuffer(font_codes, 0); |
| 288 | ctx.WriteBuffer(font_offsets, 1); | 297 | ctx.WriteBuffer(font_offsets, 1); |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index d32aa9615..b1b6b9354 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -1551,6 +1551,7 @@ void GMainWindow::ConnectMenuEvents() { | |||
| 1551 | // Tools | 1551 | // Tools |
| 1552 | connect_menu(ui->action_Rederive, std::bind(&GMainWindow::OnReinitializeKeys, this, | 1552 | connect_menu(ui->action_Rederive, std::bind(&GMainWindow::OnReinitializeKeys, this, |
| 1553 | ReinitializeKeyBehavior::Warning)); | 1553 | ReinitializeKeyBehavior::Warning)); |
| 1554 | connect_menu(ui->action_Load_Mii_Edit, &GMainWindow::OnMiiEdit); | ||
| 1554 | connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot); | 1555 | connect_menu(ui->action_Capture_Screenshot, &GMainWindow::OnCaptureScreenshot); |
| 1555 | 1556 | ||
| 1556 | // TAS | 1557 | // TAS |
| @@ -1590,6 +1591,8 @@ void GMainWindow::UpdateMenuState() { | |||
| 1590 | } | 1591 | } |
| 1591 | 1592 | ||
| 1592 | multiplayer_state->UpdateNotificationStatus(); | 1593 | multiplayer_state->UpdateNotificationStatus(); |
| 1594 | |||
| 1595 | ui->action_Load_Mii_Edit->setEnabled(CheckFirmwarePresence()); | ||
| 1593 | } | 1596 | } |
| 1594 | 1597 | ||
| 1595 | void GMainWindow::OnDisplayTitleBars(bool show) { | 1598 | void GMainWindow::OnDisplayTitleBars(bool show) { |
| @@ -4134,6 +4137,27 @@ void GMainWindow::OnToggleStatusBar() { | |||
| 4134 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); | 4137 | statusBar()->setVisible(ui->action_Show_Status_Bar->isChecked()); |
| 4135 | } | 4138 | } |
| 4136 | 4139 | ||
| 4140 | void GMainWindow::OnMiiEdit() { | ||
| 4141 | constexpr u64 MiiEditId = 0x0100000000001009ull; | ||
| 4142 | auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); | ||
| 4143 | if (!bis_system) { | ||
| 4144 | QMessageBox::warning(this, tr("No firmware available"), | ||
| 4145 | tr("Please install the firmware to use the Mii editor.")); | ||
| 4146 | return; | ||
| 4147 | } | ||
| 4148 | |||
| 4149 | auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program); | ||
| 4150 | if (!mii_applet_nca) { | ||
| 4151 | QMessageBox::warning(this, tr("Mii Edit Applet"), | ||
| 4152 | tr("Mii editor is not available. Please reinstall firmware.")); | ||
| 4153 | return; | ||
| 4154 | } | ||
| 4155 | |||
| 4156 | const auto filename = QString::fromStdString((mii_applet_nca->GetFullPath())); | ||
| 4157 | UISettings::values.roms_path = QFileInfo(filename).path(); | ||
| 4158 | BootGame(filename); | ||
| 4159 | } | ||
| 4160 | |||
| 4137 | void GMainWindow::OnCaptureScreenshot() { | 4161 | void GMainWindow::OnCaptureScreenshot() { |
| 4138 | if (emu_thread == nullptr || !emu_thread->IsRunning()) { | 4162 | if (emu_thread == nullptr || !emu_thread->IsRunning()) { |
| 4139 | return; | 4163 | return; |
| @@ -4540,6 +4564,8 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) { | |||
| 4540 | if (behavior == ReinitializeKeyBehavior::Warning) { | 4564 | if (behavior == ReinitializeKeyBehavior::Warning) { |
| 4541 | game_list->PopulateAsync(UISettings::values.game_dirs); | 4565 | game_list->PopulateAsync(UISettings::values.game_dirs); |
| 4542 | } | 4566 | } |
| 4567 | |||
| 4568 | UpdateMenuState(); | ||
| 4543 | } | 4569 | } |
| 4544 | 4570 | ||
| 4545 | bool GMainWindow::CheckSystemArchiveDecryption() { | 4571 | bool GMainWindow::CheckSystemArchiveDecryption() { |
| @@ -4561,6 +4587,22 @@ bool GMainWindow::CheckSystemArchiveDecryption() { | |||
| 4561 | return mii_nca->GetRomFS().get() != nullptr; | 4587 | return mii_nca->GetRomFS().get() != nullptr; |
| 4562 | } | 4588 | } |
| 4563 | 4589 | ||
| 4590 | bool GMainWindow::CheckFirmwarePresence() { | ||
| 4591 | constexpr u64 MiiEditId = 0x0100000000001009ull; | ||
| 4592 | |||
| 4593 | auto bis_system = system->GetFileSystemController().GetSystemNANDContents(); | ||
| 4594 | if (!bis_system) { | ||
| 4595 | return false; | ||
| 4596 | } | ||
| 4597 | |||
| 4598 | auto mii_applet_nca = bis_system->GetEntry(MiiEditId, FileSys::ContentRecordType::Program); | ||
| 4599 | if (!mii_applet_nca) { | ||
| 4600 | return false; | ||
| 4601 | } | ||
| 4602 | |||
| 4603 | return true; | ||
| 4604 | } | ||
| 4605 | |||
| 4564 | bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, u64 program_id, | 4606 | bool GMainWindow::SelectRomFSDumpTarget(const FileSys::ContentProvider& installed, u64 program_id, |
| 4565 | u64* selected_title_id, u8* selected_content_record_type) { | 4607 | u64* selected_title_id, u8* selected_content_record_type) { |
| 4566 | using ContentInfo = std::pair<FileSys::TitleType, FileSys::ContentRecordType>; | 4608 | using ContentInfo = std::pair<FileSys::TitleType, FileSys::ContentRecordType>; |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index cf191f698..53bedfab3 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -365,6 +365,7 @@ private slots: | |||
| 365 | void ResetWindowSize720(); | 365 | void ResetWindowSize720(); |
| 366 | void ResetWindowSize900(); | 366 | void ResetWindowSize900(); |
| 367 | void ResetWindowSize1080(); | 367 | void ResetWindowSize1080(); |
| 368 | void OnMiiEdit(); | ||
| 368 | void OnCaptureScreenshot(); | 369 | void OnCaptureScreenshot(); |
| 369 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); | 370 | void OnReinitializeKeys(ReinitializeKeyBehavior behavior); |
| 370 | void OnLanguageChanged(const QString& locale); | 371 | void OnLanguageChanged(const QString& locale); |
| @@ -409,6 +410,7 @@ private: | |||
| 409 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); | 410 | void OpenPerGameConfiguration(u64 title_id, const std::string& file_name); |
| 410 | bool CheckDarkMode(); | 411 | bool CheckDarkMode(); |
| 411 | bool CheckSystemArchiveDecryption(); | 412 | bool CheckSystemArchiveDecryption(); |
| 413 | bool CheckFirmwarePresence(); | ||
| 412 | void ConfigureFilesystemProvider(const std::string& filepath); | 414 | void ConfigureFilesystemProvider(const std::string& filepath); |
| 413 | 415 | ||
| 414 | QString GetTasStateDescription() const; | 416 | QString GetTasStateDescription() const; |
diff --git a/src/yuzu/main.ui b/src/yuzu/main.ui index e54d7d75d..91d6c5ef3 100644 --- a/src/yuzu/main.ui +++ b/src/yuzu/main.ui | |||
| @@ -150,6 +150,8 @@ | |||
| 150 | <addaction name="action_Rederive"/> | 150 | <addaction name="action_Rederive"/> |
| 151 | <addaction name="action_Verify_installed_contents"/> | 151 | <addaction name="action_Verify_installed_contents"/> |
| 152 | <addaction name="separator"/> | 152 | <addaction name="separator"/> |
| 153 | <addaction name="action_Load_Mii_Edit"/> | ||
| 154 | <addaction name="separator"/> | ||
| 153 | <addaction name="action_Capture_Screenshot"/> | 155 | <addaction name="action_Capture_Screenshot"/> |
| 154 | <addaction name="menuTAS"/> | 156 | <addaction name="menuTAS"/> |
| 155 | </widget> | 157 | </widget> |
| @@ -217,7 +219,7 @@ | |||
| 217 | </action> | 219 | </action> |
| 218 | <action name="action_Verify_installed_contents"> | 220 | <action name="action_Verify_installed_contents"> |
| 219 | <property name="text"> | 221 | <property name="text"> |
| 220 | <string>Verify installed contents</string> | 222 | <string>&Verify Installed Contents</string> |
| 221 | </property> | 223 | </property> |
| 222 | </action> | 224 | </action> |
| 223 | <action name="action_About"> | 225 | <action name="action_About"> |
| @@ -368,6 +370,11 @@ | |||
| 368 | <string>&Capture Screenshot</string> | 370 | <string>&Capture Screenshot</string> |
| 369 | </property> | 371 | </property> |
| 370 | </action> | 372 | </action> |
| 373 | <action name="action_Load_Mii_Edit"> | ||
| 374 | <property name="text"> | ||
| 375 | <string>Open &Mii Editor</string> | ||
| 376 | </property> | ||
| 377 | </action> | ||
| 371 | <action name="action_Configure_Tas"> | 378 | <action name="action_Configure_Tas"> |
| 372 | <property name="text"> | 379 | <property name="text"> |
| 373 | <string>&Configure TAS...</string> | 380 | <string>&Configure TAS...</string> |