diff --git a/src/core/hle/kernel/svc/svc_info.cpp b/src/core/hle/kernel/svc/svc_info.cpp index e6190ac33a..863bb58fa8 100644 --- a/src/core/hle/kernel/svc/svc_info.cpp +++ b/src/core/hle/kernel/svc/svc_info.cpp @@ -210,6 +210,13 @@ Result GetInfo(Core::System& system, u64* result, InfoType info_id_type, Handle *result = system.Kernel().CurrentScheduler()->GetIdleThread()->GetCpuTime(); R_SUCCEED(); } + case InfoType::Unknown37: + case InfoType::Unknown38: { + LOG_WARNING(Kernel_SVC, "(STUBBED) called, info_id={:#x}, info_sub_id={:#x}, handle={:#08x}", + info_id, info_sub_id, handle); + *result = 0; + R_SUCCEED(); + } case InfoType::MesosphereMeta: { enum MesosphereMetaInfo : u64 { KernelVersion = 0, diff --git a/src/core/hle/kernel/svc_types.h b/src/core/hle/kernel/svc_types.h index fce3dea476..c6d75f646b 100644 --- a/src/core/hle/kernel/svc_types.h +++ b/src/core/hle/kernel/svc_types.h @@ -158,6 +158,11 @@ enum class InfoType : u32 { IoRegionHint = 27, AliasRegionExtraSize = 28, + TransferMemoryHint = 34, + + Unknown37 = 37, + Unknown38 = 38, + MesosphereMeta = 65000, MesosphereCurrentProcess = 65001, }; diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp index fdbd50ed7a..7d270b7b6f 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp @@ -54,7 +54,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) static const FunctionInfo functions[] = { {0, nullptr, "OpenFileSystem"}, {1, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, - {2, nullptr, "OpenDataFileSystemByCurrentProcess"}, + {2, D<&FSP_SRV::OpenDataFileSystemByCurrentProcess>, "OpenDataFileSystemByCurrentProcess"}, {7, D<&FSP_SRV::OpenFileSystemWithPatch>, "OpenFileSystemWithPatch"}, {8, nullptr, "OpenFileSystemWithId"}, {9, nullptr, "OpenDataFileSystemByApplicationId"}, @@ -118,6 +118,7 @@ FSP_SRV::FSP_SRV(Core::System& system_) {204, nullptr, "OpenDataFileSystemByProgramIndex"}, {205, D<&FSP_SRV::OpenDataStorageWithProgramIndex>, "OpenDataStorageWithProgramIndex"}, {206, nullptr, "OpenDataStorageByPath"}, + {210, D<&FSP_SRV::SetCurrentProcess>, "SetCurrentProcess"}, {400, nullptr, "OpenDeviceOperator"}, {500, nullptr, "OpenSdCardDetectionEventNotifier"}, {501, nullptr, "OpenGameCardDetectionEventNotifier"}, @@ -460,6 +461,31 @@ Result FSP_SRV::OpenSaveDataTransferProhibiter( R_SUCCEED(); } +Result FSP_SRV::OpenDataFileSystemByCurrentProcess(OutInterface out_interface) { + LOG_DEBUG(Service_FS, "called"); + + if (!romfs) { + auto current_romfs = romfs_controller->OpenRomFSCurrentProcess(); + if (!current_romfs) { + LOG_CRITICAL(Service_FS, "No file system interface available!"); + R_RETURN(ResultUnknown); + } + + romfs = current_romfs; + } + + auto extracted_romfs = FileSys::ExtractRomFS(romfs); + if (!extracted_romfs) { + LOG_CRITICAL(Service_FS, "Failed to extract RomFS for the current process!"); + R_RETURN(ResultUnknown); + } + + *out_interface = std::make_shared( + system, extracted_romfs, SizeGetter::FromStorageId(fsc, FileSys::StorageId::NandUser)); + + R_SUCCEED(); +} + Result FSP_SRV::OpenDataStorageByCurrentProcess(OutInterface out_interface) { LOG_DEBUG(Service_FS, "called"); diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.h b/src/core/hle/service/filesystem/fsp/fsp_srv.h index 0ea41903e4..156cf4e571 100644 --- a/src/core/hle/service/filesystem/fsp/fsp_srv.h +++ b/src/core/hle/service/filesystem/fsp/fsp_srv.h @@ -51,6 +51,7 @@ public: private: Result SetCurrentProcess(ClientProcessId pid); + Result OpenDataFileSystemByCurrentProcess(OutInterface out_interface); Result OpenFileSystemWithPatch(OutInterface out_interface, FileSystemProxyType type, u64 open_program_id); Result OpenSdCardFileSystem(OutInterface out_interface); diff --git a/src/core/hle/service/pctl/parental_control_service.cpp b/src/core/hle/service/pctl/parental_control_service.cpp index 97c178799e..51953c2657 100644 --- a/src/core/hle/service/pctl/parental_control_service.cpp +++ b/src/core/hle/service/pctl/parental_control_service.cpp @@ -4,6 +4,8 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include + #include "core/core.h" #include "core/file_sys/control_metadata.h" #include "core/file_sys/patch_manager.h" @@ -94,6 +96,7 @@ IParentalControlService::IParentalControlService(Core::System& system_, Capabili {1457, D<&IParentalControlService::GetPlayTimerEventToRequestSuspension>, "GetPlayTimerEventToRequestSuspension"}, {1458, D<&IParentalControlService::IsPlayTimerAlarmDisabled>, "IsPlayTimerAlarmDisabled"}, {1459, D<&IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo>, "GetPlayTimerRemainingTimeDisplayInfo"}, + {1460, D<&IParentalControlService::Unknown1460>, "Unknown1460"}, {1471, nullptr, "NotifyWrongPinCodeInputManyTimes"}, {1472, nullptr, "CancelNetworkRequest"}, {1473, D<&IParentalControlService::GetUnlinkedEvent>, "GetUnlinkedEvent"}, @@ -440,8 +443,15 @@ Result IParentalControlService::IsPlayTimerAlarmDisabled(Out out_play_time R_SUCCEED(); } -Result IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo(/* Out 0x18 */) { - LOG_INFO(Service_PCTL, "called"); +Result IParentalControlService::GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called"); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; + R_SUCCEED(); +} + +Result IParentalControlService::Unknown1460(u8 in_unk, Out out_display_info) { + LOG_DEBUG(Service_PCTL, "called, in_unk={}", in_unk); + *out_display_info = {.state = PlayTimerDisplayState::NotConfigured}; R_SUCCEED(); } diff --git a/src/core/hle/service/pctl/parental_control_service.h b/src/core/hle/service/pctl/parental_control_service.h index 92d1d38429..9dabe3d059 100644 --- a/src/core/hle/service/pctl/parental_control_service.h +++ b/src/core/hle/service/pctl/parental_control_service.h @@ -55,7 +55,8 @@ private: Result GetPlayTimerSettingsOld(Out out_play_timer_settings); Result GetPlayTimerEventToRequestSuspension(OutCopyHandle out_event); Result IsPlayTimerAlarmDisabled(Out out_play_timer_alarm_disabled); - Result GetPlayTimerRemainingTimeDisplayInfo(); + Result GetPlayTimerRemainingTimeDisplayInfo(Out out_display_info); + Result Unknown1460(u8 in_unk, Out out_display_info); Result GetUnlinkedEvent(OutCopyHandle out_event); Result GetStereoVisionRestriction(Out out_stereo_vision_restriction); Result SetStereoVisionRestriction(bool stereo_vision_restriction); diff --git a/src/core/hle/service/pctl/pctl_types.h b/src/core/hle/service/pctl/pctl_types.h index a559c5d35f..962457fd48 100644 --- a/src/core/hle/service/pctl/pctl_types.h +++ b/src/core/hle/service/pctl/pctl_types.h @@ -49,4 +49,25 @@ struct PlayTimerSettings { }; static_assert(sizeof(PlayTimerSettings) == 0x44, "PlayTimerSettings has incorrect size."); +enum class PlayTimerDisplayState : u8 { + TimesUp = 0, + BedtimeAlarm = 1, + RemainingTime = 2, + Unknown3 = 3, + Unknown4 = 4, + Unknown5 = 5, + TimerDisabled = 6, + NotConfigured = 7, +}; + +// This is nn::pctl::PlayTimerRemainingTimeDisplayInfo +struct PlayTimerRemainingTimeDisplayInfo { + PlayTimerDisplayState state; + INSERT_PADDING_BYTES(0x7); + u64 unknown_08; + u64 remaining_time; +}; +static_assert(sizeof(PlayTimerRemainingTimeDisplayInfo) == 0x18, + "PlayTimerRemainingTimeDisplayInfo has incorrect size."); + } // namespace Service::PCTL