diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/CMakeLists.txt | 26 | ||||
| -rw-r--r-- | src/core/core_timing.cpp | 53 | ||||
| -rw-r--r-- | src/core/core_timing.h | 53 | ||||
| -rw-r--r-- | src/core/core_timing_util.cpp | 63 | ||||
| -rw-r--r-- | src/core/core_timing_util.h | 64 | ||||
| -rw-r--r-- | src/core/hle/ipc_helpers.h | 8 | ||||
| -rw-r--r-- | src/core/hle/kernel/svc.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/kernel/timer.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audout_u.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/audio/audren_u.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/nvflinger/nvflinger.cpp | 1 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.cpp | 19 | ||||
| -rw-r--r-- | src/core/hle/service/set/set_sys.h | 11 | ||||
| -rw-r--r-- | src/core/hle/service/time/interface.cpp (renamed from src/core/hle/service/time/time_s.cpp) | 15 | ||||
| -rw-r--r-- | src/core/hle/service/time/interface.h (renamed from src/core/hle/service/time/time_s.h) | 4 | ||||
| -rw-r--r-- | src/core/hle/service/time/time.cpp | 9 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_u.cpp | 31 | ||||
| -rw-r--r-- | src/core/hle/service/time/time_u.h | 16 | 
20 files changed, 198 insertions, 184 deletions
| diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index b7d52babc..833605475 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -10,6 +10,8 @@ add_library(core STATIC      core_cpu.h      core_timing.cpp      core_timing.h +    core_timing_util.cpp +    core_timing_util.h      file_sys/content_archive.cpp      file_sys/content_archive.h      file_sys/control_metadata.cpp @@ -114,26 +116,26 @@ add_library(core STATIC      hle/service/apm/apm.h      hle/service/apm/interface.cpp      hle/service/apm/interface.h -    hle/service/audio/audio.cpp -    hle/service/audio/audio.h      hle/service/audio/audin_u.cpp      hle/service/audio/audin_u.h +    hle/service/audio/audio.cpp +    hle/service/audio/audio.h      hle/service/audio/audout_u.cpp      hle/service/audio/audout_u.h      hle/service/audio/audrec_u.cpp      hle/service/audio/audrec_u.h      hle/service/audio/audren_u.cpp -    hle/service/audio/audren_u.h      hle/service/audio/audren_u.cpp      hle/service/audio/audren_u.h +    hle/service/audio/audren_u.h      hle/service/audio/codecctl.cpp      hle/service/audio/codecctl.h      hle/service/audio/hwopus.cpp      hle/service/audio/hwopus.h -    hle/service/bcat/module.cpp -    hle/service/bcat/module.h      hle/service/bcat/bcat.cpp      hle/service/bcat/bcat.h +    hle/service/bcat/module.cpp +    hle/service/bcat/module.h      hle/service/fatal/fatal.cpp      hle/service/fatal/fatal.h      hle/service/fatal/fatal_p.cpp @@ -154,6 +156,10 @@ add_library(core STATIC      hle/service/lm/lm.h      hle/service/mm/mm_u.cpp      hle/service/mm/mm_u.h +    hle/service/nfp/nfp.cpp +    hle/service/nfp/nfp.h +    hle/service/nfp/nfp_user.cpp +    hle/service/nfp/nfp_user.h      hle/service/nifm/nifm.cpp      hle/service/nifm/nifm.h      hle/service/nifm/nifm_a.cpp @@ -162,10 +168,6 @@ add_library(core STATIC      hle/service/nifm/nifm_s.h      hle/service/nifm/nifm_u.cpp      hle/service/nifm/nifm_u.h -    hle/service/nfp/nfp.cpp -    hle/service/nfp/nfp.h -    hle/service/nfp/nfp_user.cpp -    hle/service/nfp/nfp_user.h      hle/service/ns/ns.cpp      hle/service/ns/ns.h      hle/service/ns/pl_u.cpp @@ -233,12 +235,10 @@ add_library(core STATIC      hle/service/spl/spl.h      hle/service/ssl/ssl.cpp      hle/service/ssl/ssl.h +    hle/service/time/interface.cpp +    hle/service/time/interface.h      hle/service/time/time.cpp      hle/service/time/time.h -    hle/service/time/time_s.cpp -    hle/service/time/time_s.h -    hle/service/time/time_u.cpp -    hle/service/time/time_u.h      hle/service/vi/vi.cpp      hle/service/vi/vi.h      hle/service/vi/vi_m.cpp diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 50d1e3fc9..a1b6f96f1 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -5,17 +5,15 @@  #include "core/core_timing.h"  #include <algorithm> -#include <cinttypes> -#include <limits>  #include <mutex>  #include <string>  #include <tuple>  #include <unordered_map>  #include <vector>  #include "common/assert.h" -#include "common/logging/log.h"  #include "common/thread.h"  #include "common/threadsafe_queue.h" +#include "core/core_timing_util.h"  namespace CoreTiming { @@ -59,7 +57,6 @@ static u64 event_fifo_id;  static Common::MPSCQueue<Event, false> ts_queue;  constexpr int MAX_SLICE_LENGTH = 20000; -constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE;  static s64 idled_cycles; @@ -72,54 +69,6 @@ static EventType* ev_lost = nullptr;  static void EmptyTimedCallback(u64 userdata, s64 cyclesLate) {} -s64 usToCycles(s64 us) { -    if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { -        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); -        return std::numeric_limits<s64>::max(); -    } -    if (us > MAX_VALUE_TO_MULTIPLY) { -        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); -        return BASE_CLOCK_RATE * (us / 1000000); -    } -    return (BASE_CLOCK_RATE * us) / 1000000; -} - -s64 usToCycles(u64 us) { -    if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { -        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); -        return std::numeric_limits<s64>::max(); -    } -    if (us > MAX_VALUE_TO_MULTIPLY) { -        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); -        return BASE_CLOCK_RATE * static_cast<s64>(us / 1000000); -    } -    return (BASE_CLOCK_RATE * static_cast<s64>(us)) / 1000000; -} - -s64 nsToCycles(s64 ns) { -    if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { -        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); -        return std::numeric_limits<s64>::max(); -    } -    if (ns > MAX_VALUE_TO_MULTIPLY) { -        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); -        return BASE_CLOCK_RATE * (ns / 1000000000); -    } -    return (BASE_CLOCK_RATE * ns) / 1000000000; -} - -s64 nsToCycles(u64 ns) { -    if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { -        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); -        return std::numeric_limits<s64>::max(); -    } -    if (ns > MAX_VALUE_TO_MULTIPLY) { -        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); -        return BASE_CLOCK_RATE * (static_cast<s64>(ns) / 1000000000); -    } -    return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; -} -  EventType* RegisterEvent(const std::string& name, TimedCallback callback) {      // check for existing type with same name.      // we want event type names to remain unique so that we can use them for serialization. diff --git a/src/core/core_timing.h b/src/core/core_timing.h index dc31124a8..7fe6380ad 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -23,59 +23,6 @@  namespace CoreTiming { -// The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz -// The exact value used is of course unverified. -constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch clock speed is 1020MHz un/docked - -inline s64 msToCycles(int ms) { -    // since ms is int there is no way to overflow -    return BASE_CLOCK_RATE * static_cast<s64>(ms) / 1000; -} - -inline s64 msToCycles(float ms) { -    return static_cast<s64>(BASE_CLOCK_RATE * (0.001f) * ms); -} - -inline s64 msToCycles(double ms) { -    return static_cast<s64>(BASE_CLOCK_RATE * (0.001) * ms); -} - -inline s64 usToCycles(float us) { -    return static_cast<s64>(BASE_CLOCK_RATE * (0.000001f) * us); -} - -inline s64 usToCycles(int us) { -    return (BASE_CLOCK_RATE * static_cast<s64>(us) / 1000000); -} - -s64 usToCycles(s64 us); - -s64 usToCycles(u64 us); - -inline s64 nsToCycles(float ns) { -    return static_cast<s64>(BASE_CLOCK_RATE * (0.000000001f) * ns); -} - -inline s64 nsToCycles(int ns) { -    return BASE_CLOCK_RATE * static_cast<s64>(ns) / 1000000000; -} - -s64 nsToCycles(s64 ns); - -s64 nsToCycles(u64 ns); - -inline u64 cyclesToNs(s64 cycles) { -    return cycles * 1000000000 / BASE_CLOCK_RATE; -} - -inline s64 cyclesToUs(s64 cycles) { -    return cycles * 1000000 / BASE_CLOCK_RATE; -} - -inline u64 cyclesToMs(s64 cycles) { -    return cycles * 1000 / BASE_CLOCK_RATE; -} -  /**   * CoreTiming begins at the boundary of timing slice -1. An initial call to Advance() is   * required to end slice -1 and start slice 0 before the first cycle of code is executed. diff --git a/src/core/core_timing_util.cpp b/src/core/core_timing_util.cpp new file mode 100644 index 000000000..73dea4edb --- /dev/null +++ b/src/core/core_timing_util.cpp @@ -0,0 +1,63 @@ +// Copyright 2008 Dolphin Emulator Project / 2017 Citra Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#include "core/core_timing_util.h" + +#include <cinttypes> +#include <limits> +#include "common/logging/log.h" + +namespace CoreTiming { + +constexpr u64 MAX_VALUE_TO_MULTIPLY = std::numeric_limits<s64>::max() / BASE_CLOCK_RATE; + +s64 usToCycles(s64 us) { +    if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { +        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); +        return std::numeric_limits<s64>::max(); +    } +    if (us > MAX_VALUE_TO_MULTIPLY) { +        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); +        return BASE_CLOCK_RATE * (us / 1000000); +    } +    return (BASE_CLOCK_RATE * us) / 1000000; +} + +s64 usToCycles(u64 us) { +    if (us / 1000000 > MAX_VALUE_TO_MULTIPLY) { +        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); +        return std::numeric_limits<s64>::max(); +    } +    if (us > MAX_VALUE_TO_MULTIPLY) { +        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); +        return BASE_CLOCK_RATE * static_cast<s64>(us / 1000000); +    } +    return (BASE_CLOCK_RATE * static_cast<s64>(us)) / 1000000; +} + +s64 nsToCycles(s64 ns) { +    if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { +        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); +        return std::numeric_limits<s64>::max(); +    } +    if (ns > MAX_VALUE_TO_MULTIPLY) { +        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); +        return BASE_CLOCK_RATE * (ns / 1000000000); +    } +    return (BASE_CLOCK_RATE * ns) / 1000000000; +} + +s64 nsToCycles(u64 ns) { +    if (ns / 1000000000 > MAX_VALUE_TO_MULTIPLY) { +        LOG_ERROR(Core_Timing, "Integer overflow, use max value"); +        return std::numeric_limits<s64>::max(); +    } +    if (ns > MAX_VALUE_TO_MULTIPLY) { +        LOG_DEBUG(Core_Timing, "Time very big, do rounding"); +        return BASE_CLOCK_RATE * (static_cast<s64>(ns) / 1000000000); +    } +    return (BASE_CLOCK_RATE * static_cast<s64>(ns)) / 1000000000; +} + +} // namespace CoreTiming diff --git a/src/core/core_timing_util.h b/src/core/core_timing_util.h new file mode 100644 index 000000000..5c3718782 --- /dev/null +++ b/src/core/core_timing_util.h @@ -0,0 +1,64 @@ +// Copyright 2008 Dolphin Emulator Project / 2017 Citra Emulator Project +// Licensed under GPLv2+ +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +namespace CoreTiming { + +// The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz +// The exact value used is of course unverified. +constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch clock speed is 1020MHz un/docked + +inline s64 msToCycles(int ms) { +    // since ms is int there is no way to overflow +    return BASE_CLOCK_RATE * static_cast<s64>(ms) / 1000; +} + +inline s64 msToCycles(float ms) { +    return static_cast<s64>(BASE_CLOCK_RATE * (0.001f) * ms); +} + +inline s64 msToCycles(double ms) { +    return static_cast<s64>(BASE_CLOCK_RATE * (0.001) * ms); +} + +inline s64 usToCycles(float us) { +    return static_cast<s64>(BASE_CLOCK_RATE * (0.000001f) * us); +} + +inline s64 usToCycles(int us) { +    return (BASE_CLOCK_RATE * static_cast<s64>(us) / 1000000); +} + +s64 usToCycles(s64 us); + +s64 usToCycles(u64 us); + +inline s64 nsToCycles(float ns) { +    return static_cast<s64>(BASE_CLOCK_RATE * (0.000000001f) * ns); +} + +inline s64 nsToCycles(int ns) { +    return BASE_CLOCK_RATE * static_cast<s64>(ns) / 1000000000; +} + +s64 nsToCycles(s64 ns); + +s64 nsToCycles(u64 ns); + +inline u64 cyclesToNs(s64 cycles) { +    return cycles * 1000000000 / BASE_CLOCK_RATE; +} + +inline s64 cyclesToUs(s64 cycles) { +    return cycles * 1000000 / BASE_CLOCK_RATE; +} + +inline u64 cyclesToMs(s64 cycles) { +    return cycles * 1000 / BASE_CLOCK_RATE; +} + +} // namespace CoreTiming diff --git a/src/core/hle/ipc_helpers.h b/src/core/hle/ipc_helpers.h index f5bd27a75..7fb0da408 100644 --- a/src/core/hle/ipc_helpers.h +++ b/src/core/hle/ipc_helpers.h @@ -300,6 +300,14 @@ public:      template <typename First, typename... Other>      void Pop(First& first_value, Other&... other_values); +    template <typename T> +    T PopEnum() { +        static_assert(std::is_enum_v<T>, "T must be an enum type within a PopEnum call."); +        static_assert(!std::is_convertible_v<T, int>, +                      "enum type in PopEnum must be a strongly typed enum."); +        return static_cast<T>(Pop<std::underlying_type_t<T>>()); +    } +      /**       * @brief Reads the next normal parameters as a struct, by copying it       * @note: The output class must be correctly packed/padded to fit hardware layout. diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index da7cacb57..0b439401a 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -40,7 +40,9 @@ static ResultCode SetHeapSize(VAddr* heap_addr, u64 heap_size) {  }  static ResultCode SetMemoryAttribute(VAddr addr, u64 size, u32 state0, u32 state1) { -    LOG_WARNING(Kernel_SVC, "(STUBBED) called, addr=0x{:X}", addr); +    LOG_WARNING(Kernel_SVC, +                "(STUBBED) called, addr=0x{:X}, size=0x{:X}, state0=0x{:X}, state1=0x{:X}", addr, +                size, state0, state1);      return RESULT_SUCCESS;  } diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index cd85c4b7c..94735c86e 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -14,6 +14,7 @@  #include "core/arm/arm_interface.h"  #include "core/core.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/kernel/errors.h"  #include "core/hle/kernel/handle_table.h"  #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 0141125e4..904a3d0a5 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -6,6 +6,7 @@  #include "common/assert.h"  #include "common/logging/log.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/kernel/handle_table.h"  #include "core/hle/kernel/kernel.h"  #include "core/hle/kernel/thread.h" diff --git a/src/core/hle/service/audio/audout_u.cpp b/src/core/hle/service/audio/audout_u.cpp index 154bc12da..1dcd84d98 100644 --- a/src/core/hle/service/audio/audout_u.cpp +++ b/src/core/hle/service/audio/audout_u.cpp @@ -6,6 +6,7 @@  #include <vector>  #include "common/logging/log.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/ipc_helpers.h"  #include "core/hle/kernel/event.h"  #include "core/hle/kernel/hle_ipc.h" diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index e623f4f8e..6aed9e2fa 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp @@ -7,6 +7,7 @@  #include "common/alignment.h"  #include "common/logging/log.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/ipc_helpers.h"  #include "core/hle/kernel/event.h"  #include "core/hle/kernel/hle_ipc.h" diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 475a0a5cf..9a02ba686 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -5,6 +5,7 @@  #include <atomic>  #include "common/logging/log.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/frontend/emu_window.h"  #include "core/frontend/input.h"  #include "core/hle/ipc_helpers.h" diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp index 1fca1743d..5344441e1 100644 --- a/src/core/hle/service/nvflinger/nvflinger.cpp +++ b/src/core/hle/service/nvflinger/nvflinger.cpp @@ -9,6 +9,7 @@  #include "common/scope_exit.h"  #include "core/core.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h"  #include "core/hle/service/nvdrv/nvdrv.h"  #include "core/hle/service/nvflinger/buffer_queue.h" diff --git a/src/core/hle/service/set/set_sys.cpp b/src/core/hle/service/set/set_sys.cpp index fa85277fe..41efca31c 100644 --- a/src/core/hle/service/set/set_sys.cpp +++ b/src/core/hle/service/set/set_sys.cpp @@ -10,13 +10,22 @@  namespace Service::Set {  void SET_SYS::GetColorSetId(Kernel::HLERequestContext& ctx) { -      IPC::ResponseBuilder rb{ctx, 3};      rb.Push(RESULT_SUCCESS); -    rb.Push<u32>(0); +    rb.PushEnum(color_set); -    LOG_WARNING(Service_SET, "(STUBBED) called"); +    LOG_DEBUG(Service_SET, "called"); +} + +void SET_SYS::SetColorSetId(Kernel::HLERequestContext& ctx) { +    IPC::RequestParser rp{ctx}; +    color_set = rp.PopEnum<ColorSet>(); + +    IPC::ResponseBuilder rb{ctx, 2}; +    rb.Push(RESULT_SUCCESS); + +    LOG_DEBUG(Service_SET, "called");  }  SET_SYS::SET_SYS() : ServiceFramework("set:sys") { @@ -44,7 +53,7 @@ SET_SYS::SET_SYS() : ServiceFramework("set:sys") {          {21, nullptr, "GetEulaVersions"},          {22, nullptr, "SetEulaVersions"},          {23, &SET_SYS::GetColorSetId, "GetColorSetId"}, -        {24, nullptr, "SetColorSetId"}, +        {24, &SET_SYS::SetColorSetId, "SetColorSetId"},          {25, nullptr, "GetConsoleInformationUploadFlag"},          {26, nullptr, "SetConsoleInformationUploadFlag"},          {27, nullptr, "GetAutomaticApplicationDownloadFlag"}, @@ -172,4 +181,6 @@ SET_SYS::SET_SYS() : ServiceFramework("set:sys") {      RegisterHandlers(functions);  } +SET_SYS::~SET_SYS() = default; +  } // namespace Service::Set diff --git a/src/core/hle/service/set/set_sys.h b/src/core/hle/service/set/set_sys.h index b77a97cde..f602f3c77 100644 --- a/src/core/hle/service/set/set_sys.h +++ b/src/core/hle/service/set/set_sys.h @@ -11,10 +11,19 @@ namespace Service::Set {  class SET_SYS final : public ServiceFramework<SET_SYS> {  public:      explicit SET_SYS(); -    ~SET_SYS() = default; +    ~SET_SYS() override;  private: +    /// Indicates the current theme set by the system settings +    enum class ColorSet : u32 { +        BasicWhite = 0, +        BasicBlack = 1, +    }; +      void GetColorSetId(Kernel::HLERequestContext& ctx); +    void SetColorSetId(Kernel::HLERequestContext& ctx); + +    ColorSet color_set = ColorSet::BasicWhite;  };  } // namespace Service::Set diff --git a/src/core/hle/service/time/time_s.cpp b/src/core/hle/service/time/interface.cpp index 0b599ea00..048d5b077 100644 --- a/src/core/hle/service/time/time_s.cpp +++ b/src/core/hle/service/time/interface.cpp @@ -2,17 +2,18 @@  // Licensed under GPLv2 or any later version  // Refer to the license.txt file included. -#include "core/hle/service/time/time_s.h" +#include "core/hle/service/time/interface.h"  namespace Service::Time { -TIME_S::TIME_S(std::shared_ptr<Module> time) : Module::Interface(std::move(time), "time:s") { +Time::Time(std::shared_ptr<Module> time, const char* name) +    : Module::Interface(std::move(time), name) {      static const FunctionInfo functions[] = { -        {0, &TIME_S::GetStandardUserSystemClock, "GetStandardUserSystemClock"}, -        {1, &TIME_S::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"}, -        {2, &TIME_S::GetStandardSteadyClock, "GetStandardSteadyClock"}, -        {3, &TIME_S::GetTimeZoneService, "GetTimeZoneService"}, -        {4, &TIME_S::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"}, +        {0, &Time::GetStandardUserSystemClock, "GetStandardUserSystemClock"}, +        {1, &Time::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"}, +        {2, &Time::GetStandardSteadyClock, "GetStandardSteadyClock"}, +        {3, &Time::GetTimeZoneService, "GetTimeZoneService"}, +        {4, &Time::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"},          {5, nullptr, "GetEphemeralNetworkSystemClock"},          {50, nullptr, "SetStandardSteadyClockInternalOffset"},          {100, nullptr, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, diff --git a/src/core/hle/service/time/time_s.h b/src/core/hle/service/time/interface.h index 4a2daa513..183a53db1 100644 --- a/src/core/hle/service/time/time_s.h +++ b/src/core/hle/service/time/interface.h @@ -8,9 +8,9 @@  namespace Service::Time { -class TIME_S final : public Module::Interface { +class Time final : public Module::Interface {  public: -    explicit TIME_S(std::shared_ptr<Module> time); +    explicit Time(std::shared_ptr<Module> time, const char* name);  };  } // namespace Service::Time diff --git a/src/core/hle/service/time/time.cpp b/src/core/hle/service/time/time.cpp index 507ae95f4..37b58bb77 100644 --- a/src/core/hle/service/time/time.cpp +++ b/src/core/hle/service/time/time.cpp @@ -6,12 +6,12 @@  #include <ctime>  #include "common/logging/log.h"  #include "core/core_timing.h" +#include "core/core_timing_util.h"  #include "core/hle/ipc_helpers.h"  #include "core/hle/kernel/client_port.h"  #include "core/hle/kernel/client_session.h" +#include "core/hle/service/time/interface.h"  #include "core/hle/service/time/time.h" -#include "core/hle/service/time/time_s.h" -#include "core/hle/service/time/time_u.h"  namespace Service::Time { @@ -212,8 +212,9 @@ Module::Interface::Interface(std::shared_ptr<Module> time, const char* name)  void InstallInterfaces(SM::ServiceManager& service_manager) {      auto time = std::make_shared<Module>(); -    std::make_shared<TIME_S>(time)->InstallAsService(service_manager); -    std::make_shared<TIME_U>(time)->InstallAsService(service_manager); +    std::make_shared<Time>(time, "time:a")->InstallAsService(service_manager); +    std::make_shared<Time>(time, "time:s")->InstallAsService(service_manager); +    std::make_shared<Time>(time, "time:u")->InstallAsService(service_manager);  }  } // namespace Service::Time diff --git a/src/core/hle/service/time/time_u.cpp b/src/core/hle/service/time/time_u.cpp deleted file mode 100644 index 1ed42c419..000000000 --- a/src/core/hle/service/time/time_u.cpp +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#include "core/hle/service/time/time_u.h" - -namespace Service::Time { - -TIME_U::TIME_U(std::shared_ptr<Module> time) : Module::Interface(std::move(time), "time:u") { -    static const FunctionInfo functions[] = { -        {0, &TIME_U::GetStandardUserSystemClock, "GetStandardUserSystemClock"}, -        {1, &TIME_U::GetStandardNetworkSystemClock, "GetStandardNetworkSystemClock"}, -        {2, &TIME_U::GetStandardSteadyClock, "GetStandardSteadyClock"}, -        {3, &TIME_U::GetTimeZoneService, "GetTimeZoneService"}, -        {4, &TIME_U::GetStandardLocalSystemClock, "GetStandardLocalSystemClock"}, -        {5, nullptr, "GetEphemeralNetworkSystemClock"}, -        {50, nullptr, "SetStandardSteadyClockInternalOffset"}, -        {100, nullptr, "IsStandardUserSystemClockAutomaticCorrectionEnabled"}, -        {101, nullptr, "SetStandardUserSystemClockAutomaticCorrectionEnabled"}, -        {102, nullptr, "GetStandardUserSystemClockInitialYear"}, -        {200, nullptr, "IsStandardNetworkSystemClockAccuracySufficient"}, -        {300, nullptr, "CalculateMonotonicSystemClockBaseTimePoint"}, -        {400, nullptr, "GetClockSnapshot"}, -        {401, nullptr, "GetClockSnapshotFromSystemClockContext"}, -        {500, nullptr, "CalculateStandardUserSystemClockDifferenceByUser"}, -        {501, nullptr, "CalculateSpanBetween"}, -    }; -    RegisterHandlers(functions); -} - -} // namespace Service::Time diff --git a/src/core/hle/service/time/time_u.h b/src/core/hle/service/time/time_u.h deleted file mode 100644 index 3724bcdc7..000000000 --- a/src/core/hle/service/time/time_u.h +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include "core/hle/service/time/time.h" - -namespace Service::Time { - -class TIME_U final : public Module::Interface { -public: -    explicit TIME_U(std::shared_ptr<Module> time); -}; - -} // namespace Service::Time | 
