diff options
Diffstat (limited to 'src/core/hle/service')
-rw-r--r-- | src/core/hle/service/am/am.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 13 | ||||
-rw-r--r-- | src/core/hle/service/bcat/backend/boxcat.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/service/es/es.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/hid/controllers/npad.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/time/time.cpp | 50 | ||||
-rw-r--r-- | src/core/hle/service/time/time_zone_manager.cpp | 4 |
7 files changed, 41 insertions, 41 deletions
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 557608e76..3ece2cf3c 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -903,7 +903,7 @@ private: void PopOutData(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_AM, "called"); - const auto storage = applet->GetBroker().PopNormalDataToGame(); + auto storage = applet->GetBroker().PopNormalDataToGame(); if (storage == nullptr) { LOG_ERROR(Service_AM, "storage is a nullptr. There is no data in the current normal channel"); @@ -934,7 +934,7 @@ private: void PopInteractiveOutData(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_AM, "called"); - const auto storage = applet->GetBroker().PopInteractiveDataToGame(); + auto storage = applet->GetBroker().PopInteractiveDataToGame(); if (storage == nullptr) { LOG_ERROR(Service_AM, "storage is a nullptr. There is no data in the current interactive channel"); diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 175cabf45..d8359abaa 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -92,11 +92,16 @@ private: } void RequestUpdateImpl(Kernel::HLERequestContext& ctx) { - LOG_WARNING(Service_Audio, "(STUBBED) called"); + LOG_DEBUG(Service_Audio, "(STUBBED) called"); + + auto result = renderer->UpdateAudioRenderer(ctx.ReadBuffer()); + + if (result.Succeeded()) { + ctx.WriteBuffer(result.Unwrap()); + } - ctx.WriteBuffer(renderer->UpdateAudioRenderer(ctx.ReadBuffer())); IPC::ResponseBuilder rb{ctx, 2}; - rb.Push(RESULT_SUCCESS); + rb.Push(result.Code()); } void Start(Kernel::HLERequestContext& ctx) { @@ -252,8 +257,6 @@ private: } void GetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - const auto device_name_buffer = ctx.ReadBuffer(); const std::string name = Common::StringFromBuffer(device_name_buffer); diff --git a/src/core/hle/service/bcat/backend/boxcat.cpp b/src/core/hle/service/bcat/backend/boxcat.cpp index f589864ee..5febe8fc1 100644 --- a/src/core/hle/service/bcat/backend/boxcat.cpp +++ b/src/core/hle/service/bcat/backend/boxcat.cpp @@ -18,6 +18,7 @@ #include "core/hle/service/bcat/backend/boxcat.h" #include "core/settings.h" +namespace Service::BCAT { namespace { // Prevents conflicts with windows macro called CreateFile @@ -30,10 +31,6 @@ bool VfsDeleteFileWrap(FileSys::VirtualDir dir, std::string_view name) { return dir->DeleteFile(name); } -} // Anonymous namespace - -namespace Service::BCAT { - constexpr ResultCode ERROR_GENERAL_BCAT_FAILURE{ErrorModule::BCAT, 1}; constexpr char BOXCAT_HOSTNAME[] = "api.yuzu-emu.org"; @@ -90,8 +87,6 @@ constexpr u32 PORT = 443; constexpr u32 TIMEOUT_SECONDS = 30; [[maybe_unused]] constexpr u64 VFS_COPY_BLOCK_SIZE = 1ULL << 24; // 4MB -namespace { - std::string GetBINFilePath(u64 title_id) { return fmt::format("{}bcat/{:016X}/launchparam.bin", FileUtil::GetUserPath(FileUtil::UserPath::CacheDir), title_id); diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp index df00ae625..f8e9df4b1 100644 --- a/src/core/hle/service/es/es.cpp +++ b/src/core/hle/service/es/es.cpp @@ -4,6 +4,7 @@ #include "core/crypto/key_manager.h" #include "core/hle/ipc_helpers.h" +#include "core/hle/service/es/es.h" #include "core/hle/service/service.h" namespace Service::ES { @@ -76,7 +77,6 @@ private: } void ImportTicket(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; const auto ticket = ctx.ReadBuffer(); const auto cert = ctx.ReadBuffer(1); diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp index 2ccfffc19..c55d900e2 100644 --- a/src/core/hle/service/hid/controllers/npad.cpp +++ b/src/core/hle/service/hid/controllers/npad.cpp @@ -502,7 +502,7 @@ void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, const std::vector<Vibration>& vibrations) { - LOG_WARNING(Service_HID, "(STUBBED) called"); + LOG_DEBUG(Service_HID, "(STUBBED) called"); if (!can_controllers_vibrate) { return; diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index e722886de..67f1bbcf3 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -20,8 +20,8 @@ namespace Service::Time { class ISystemClock final : public ServiceFramework<ISystemClock> { public: - ISystemClock(Clock::SystemClockCore& clock_core) - : ServiceFramework("ISystemClock"), clock_core{clock_core} { + explicit ISystemClock(Clock::SystemClockCore& clock_core, Core::System& system) + : ServiceFramework("ISystemClock"), clock_core{clock_core}, system{system} { // clang-format off static const FunctionInfo functions[] = { {0, &ISystemClock::GetCurrentTime, "GetCurrentTime"}, @@ -46,9 +46,8 @@ private: } s64 posix_time{}; - if (const ResultCode result{ - clock_core.GetCurrentTime(Core::System::GetInstance(), posix_time)}; - result != RESULT_SUCCESS) { + if (const ResultCode result{clock_core.GetCurrentTime(system, posix_time)}; + result.IsError()) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -69,9 +68,8 @@ private: } Clock::SystemClockContext system_clock_context{}; - if (const ResultCode result{ - clock_core.GetClockContext(Core::System::GetInstance(), system_clock_context)}; - result != RESULT_SUCCESS) { + if (const ResultCode result{clock_core.GetClockContext(system, system_clock_context)}; + result.IsError()) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -83,12 +81,13 @@ private: } Clock::SystemClockCore& clock_core; + Core::System& system; }; class ISteadyClock final : public ServiceFramework<ISteadyClock> { public: - ISteadyClock(Clock::SteadyClockCore& clock_core) - : ServiceFramework("ISteadyClock"), clock_core{clock_core} { + explicit ISteadyClock(Clock::SteadyClockCore& clock_core, Core::System& system) + : ServiceFramework("ISteadyClock"), clock_core{clock_core}, system{system} { static const FunctionInfo functions[] = { {0, &ISteadyClock::GetCurrentTimePoint, "GetCurrentTimePoint"}, }; @@ -105,14 +104,14 @@ private: return; } - const Clock::SteadyClockTimePoint time_point{ - clock_core.GetCurrentTimePoint(Core::System::GetInstance())}; + const Clock::SteadyClockTimePoint time_point{clock_core.GetCurrentTimePoint(system)}; IPC::ResponseBuilder rb{ctx, (sizeof(Clock::SteadyClockTimePoint) / 4) + 2}; rb.Push(RESULT_SUCCESS); rb.PushRaw(time_point); } Clock::SteadyClockCore& clock_core; + Core::System& system; }; ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( @@ -134,7 +133,7 @@ ResultCode Module::Interface::GetClockSnapshotFromSystemClockContextInternal( } const auto current_time_point{ - time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(Core::System::GetInstance())}; + time_manager.GetStandardSteadyClockCore().GetCurrentTimePoint(system)}; if (const ResultCode result{Clock::ClockSnapshot::GetCurrentTime( clock_snapshot.user_time, current_time_point, clock_snapshot.user_context)}; result != RESULT_SUCCESS) { @@ -176,21 +175,24 @@ void Module::Interface::GetStandardUserSystemClock(Kernel::HLERequestContext& ct LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardUserSystemClockCore()); + rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardUserSystemClockCore(), + system); } void Module::Interface::GetStandardNetworkSystemClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardNetworkSystemClockCore()); + rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardNetworkSystemClockCore(), + system); } void Module::Interface::GetStandardSteadyClock(Kernel::HLERequestContext& ctx) { LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<ISteadyClock>(module->GetTimeManager().GetStandardSteadyClockCore()); + rb.PushIpcInterface<ISteadyClock>(module->GetTimeManager().GetStandardSteadyClockCore(), + system); } void Module::Interface::GetTimeZoneService(Kernel::HLERequestContext& ctx) { @@ -204,7 +206,8 @@ void Module::Interface::GetStandardLocalSystemClock(Kernel::HLERequestContext& c LOG_DEBUG(Service_Time, "called"); IPC::ResponseBuilder rb{ctx, 2, 0, 1}; rb.Push(RESULT_SUCCESS); - rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardLocalSystemClockCore()); + rb.PushIpcInterface<ISystemClock>(module->GetTimeManager().GetStandardLocalSystemClockCore(), + system); } void Module::Interface::IsStandardNetworkSystemClockAccuracySufficient( @@ -228,8 +231,7 @@ void Module::Interface::CalculateMonotonicSystemClockBaseTimePoint(Kernel::HLERe IPC::RequestParser rp{ctx}; const auto context{rp.PopRaw<Clock::SystemClockContext>()}; - const auto current_time_point{ - steady_clock_core.GetCurrentTimePoint(Core::System::GetInstance())}; + const auto current_time_point{steady_clock_core.GetCurrentTimePoint(system)}; if (current_time_point.clock_source_id == context.steady_time_point.clock_source_id) { const auto ticks{Clock::TimeSpanType::FromTicks( @@ -255,8 +257,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { Clock::SystemClockContext user_context{}; if (const ResultCode result{ module->GetTimeManager().GetStandardUserSystemClockCore().GetClockContext( - Core::System::GetInstance(), user_context)}; - result != RESULT_SUCCESS) { + system, user_context)}; + result.IsError()) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -264,8 +266,8 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { Clock::SystemClockContext network_context{}; if (const ResultCode result{ module->GetTimeManager().GetStandardNetworkSystemClockCore().GetClockContext( - Core::System::GetInstance(), network_context)}; - result != RESULT_SUCCESS) { + system, network_context)}; + result.IsError()) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; @@ -274,7 +276,7 @@ void Module::Interface::GetClockSnapshot(Kernel::HLERequestContext& ctx) { Clock::ClockSnapshot clock_snapshot{}; if (const ResultCode result{GetClockSnapshotFromSystemClockContextInternal( &ctx.GetThread(), user_context, network_context, type, clock_snapshot)}; - result != RESULT_SUCCESS) { + result.IsError()) { IPC::ResponseBuilder rb{ctx, 2}; rb.Push(result); return; diff --git a/src/core/hle/service/time/time_zone_manager.cpp b/src/core/hle/service/time/time_zone_manager.cpp index c8159bcd5..69152d0ac 100644 --- a/src/core/hle/service/time/time_zone_manager.cpp +++ b/src/core/hle/service/time/time_zone_manager.cpp @@ -518,8 +518,8 @@ static bool ParseTimeZoneBinary(TimeZoneRule& time_zone_rule, FileSys::VirtualFi constexpr s32 time_zone_max_leaps{50}; constexpr s32 time_zone_max_chars{50}; if (!(0 <= header.leap_count && header.leap_count < time_zone_max_leaps && - 0 < header.type_count && header.type_count < time_zone_rule.ttis.size() && - 0 <= header.time_count && header.time_count < time_zone_rule.ats.size() && + 0 < header.type_count && header.type_count < s32(time_zone_rule.ttis.size()) && + 0 <= header.time_count && header.time_count < s32(time_zone_rule.ats.size()) && 0 <= header.char_count && header.char_count < time_zone_max_chars && (header.ttis_std_count == header.type_count || header.ttis_std_count == 0) && (header.ttis_gmt_count == header.type_count || header.ttis_gmt_count == 0))) { |