mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-23 05:05:46 +00:00
service: ptm: Rewrite PSM and add TS
This commit is contained in:
parent
d3da378c46
commit
2bad788ead
10 changed files with 189 additions and 90 deletions
41
src/core/hle/service/ptm/ts.cpp
Normal file
41
src/core/hle/service/ptm/ts.cpp
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue