committed by
Narr the Reg
10 changed files with 183 additions and 84 deletions
-
2src/common/logging/filter.cpp
-
2src/common/logging/types.h
-
4src/core/CMakeLists.txt
-
122src/core/hle/service/ptm/psm.cpp
-
31src/core/hle/service/ptm/psm.h
-
18src/core/hle/service/ptm/ptm.cpp
-
18src/core/hle/service/ptm/ptm.h
-
41src/core/hle/service/ptm/ts.cpp
-
25src/core/hle/service/ptm/ts.h
-
4src/core/hle/service/service.cpp
@ -0,0 +1,18 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include <memory>
|
||||
|
|
||||
|
#include "core/core.h"
|
||||
|
#include "core/hle/service/ptm/psm.h"
|
||||
|
#include "core/hle/service/ptm/ptm.h"
|
||||
|
#include "core/hle/service/ptm/ts.h"
|
||||
|
|
||||
|
namespace Service::PTM { |
||||
|
|
||||
|
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system) { |
||||
|
std::make_shared<PSM>(system)->InstallAsService(sm); |
||||
|
std::make_shared<TS>(system)->InstallAsService(sm); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PTM
|
||||
@ -0,0 +1,18 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
namespace Core { |
||||
|
class System; |
||||
|
} |
||||
|
|
||||
|
namespace Service::SM { |
||||
|
class ServiceManager; |
||||
|
} |
||||
|
|
||||
|
namespace Service::PTM { |
||||
|
|
||||
|
void InstallInterfaces(SM::ServiceManager& sm, Core::System& system); |
||||
|
|
||||
|
} // namespace Service::PTM |
||||
@ -0,0 +1,41 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project
|
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
|
||||
|
#include <memory>
|
||||
|
|
||||
|
#include "core/core.h"
|
||||
|
#include "core/hle/ipc_helpers.h"
|
||||
|
#include "core/hle/service/ptm/ts.h"
|
||||
|
|
||||
|
namespace Service::PTM { |
||||
|
|
||||
|
TS::TS(Core::System& system_) : ServiceFramework{system_, "ts"} { |
||||
|
// clang-format off
|
||||
|
static const FunctionInfo functions[] = { |
||||
|
{0, nullptr, "GetTemperatureRange"}, |
||||
|
{1, &TS::GetTemperature, "GetTemperature"}, |
||||
|
{2, nullptr, "SetMeasurementMode"}, |
||||
|
{3, nullptr, "GetTemperatureMilliC"}, |
||||
|
{4, nullptr, "OpenSession"}, |
||||
|
}; |
||||
|
// clang-format on
|
||||
|
|
||||
|
RegisterHandlers(functions); |
||||
|
} |
||||
|
|
||||
|
TS::~TS() = default; |
||||
|
|
||||
|
void TS::GetTemperature(Kernel::HLERequestContext& ctx) { |
||||
|
IPC::RequestParser rp{ctx}; |
||||
|
const auto location{rp.PopEnum<Location>()}; |
||||
|
|
||||
|
LOG_WARNING(Service_HID, "(STUBBED) called. location={}", location); |
||||
|
|
||||
|
const s32 temperature = location == Location::Internal ? 35 : 20; |
||||
|
|
||||
|
IPC::ResponseBuilder rb{ctx, 3}; |
||||
|
rb.Push(ResultSuccess); |
||||
|
rb.Push(temperature); |
||||
|
} |
||||
|
|
||||
|
} // namespace Service::PTM
|
||||
@ -0,0 +1,25 @@ |
|||||
|
// SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project |
||||
|
// SPDX-License-Identifier: GPL-3.0-or-later |
||||
|
|
||||
|
#pragma once |
||||
|
|
||||
|
#include "common/common_types.h" |
||||
|
#include "core/hle/service/service.h" |
||||
|
|
||||
|
namespace Service::PTM { |
||||
|
|
||||
|
class TS final : public ServiceFramework<TS> { |
||||
|
public: |
||||
|
explicit TS(Core::System& system_); |
||||
|
~TS() override; |
||||
|
|
||||
|
private: |
||||
|
enum class Location : u8 { |
||||
|
Internal, |
||||
|
External, |
||||
|
}; |
||||
|
|
||||
|
void GetTemperature(Kernel::HLERequestContext& ctx); |
||||
|
}; |
||||
|
|
||||
|
} // namespace Service::PTM |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue