mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-08-24 14:37:20 +02:00
Implemented GetIUserInterface properly, Playreport and SSL::SetInterfaceVersion. Fixed ipc issues with IAudioDevice(wrong ids)
This commit is contained in:
parent
ebb8e06df0
commit
f3137d3bc1
@ -187,6 +187,8 @@ add_library(core STATIC
|
||||
hle/service/pctl/pctl.h
|
||||
hle/service/pctl/pctl_a.cpp
|
||||
hle/service/pctl/pctl_a.h
|
||||
hle/service/prepo/prepo.cpp
|
||||
hle/service/prepo/prepo.h
|
||||
hle/service/service.cpp
|
||||
hle/service/service.h
|
||||
hle/service/set/set.cpp
|
||||
|
@ -162,12 +162,15 @@ public:
|
||||
{0x3, &IAudioDevice::GetActiveAudioDeviceName, "GetActiveAudioDeviceName"},
|
||||
{0x4, &IAudioDevice::QueryAudioDeviceSystemEvent, "QueryAudioDeviceSystemEvent"},
|
||||
{0x5, &IAudioDevice::GetActiveChannelCount, "GetActiveChannelCount"},
|
||||
{0x6, nullptr, "ListAudioDeviceNameAuto"},
|
||||
{0x7, nullptr, "SetAudioDeviceOutputVolumeAuto"},
|
||||
{0x6, &IAudioDevice::ListAudioDeviceName,
|
||||
"ListAudioDeviceNameAuto"}, // Are these any different?
|
||||
{0x7, &IAudioDevice::SetAudioDeviceOutputVolume,
|
||||
"SetAudioDeviceOutputVolumeAuto"}, // Are these any different?
|
||||
{0x8, nullptr, "GetAudioDeviceOutputVolumeAuto"},
|
||||
{0x10, nullptr, "GetActiveAudioDeviceNameAuto"},
|
||||
{0x11, nullptr, "QueryAudioDeviceInputEvent"},
|
||||
{0x12, nullptr, "QueryAudioDeviceOutputEvent"}};
|
||||
{0xa, &IAudioDevice::GetActiveAudioDeviceName,
|
||||
"GetActiveAudioDeviceNameAuto"}, // Are these any different?
|
||||
{0xb, nullptr, "QueryAudioDeviceInputEvent"},
|
||||
{0xc, nullptr, "QueryAudioDeviceOutputEvent"}};
|
||||
RegisterHandlers(functions);
|
||||
|
||||
buffer_event =
|
||||
@ -257,7 +260,7 @@ void AudRenU::GetAudioRendererWorkBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.Push<u64>(0x400);
|
||||
rb.Push<u64>(0x4000);
|
||||
|
||||
LOG_WARNING(Service_Audio, "(STUBBED) called");
|
||||
}
|
||||
|
@ -12,10 +12,27 @@ namespace Service::NFP {
|
||||
Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
|
||||
: ServiceFramework(name), module(std::move(module)) {}
|
||||
|
||||
void Module::Interface::Unknown(Kernel::HLERequestContext& ctx) {
|
||||
class IUser final : public ServiceFramework<IUser> {
|
||||
public:
|
||||
IUser() : ServiceFramework("IUser") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IUser::Initialize, "Initialize"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
private:
|
||||
void Initialize(Kernel::HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
};
|
||||
|
||||
void Module::Interface::GetIUserInterface(Kernel::HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_NFP, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushIpcInterface<IUser>();
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
|
@ -14,7 +14,7 @@ public:
|
||||
public:
|
||||
Interface(std::shared_ptr<Module> module, const char* name);
|
||||
|
||||
void Unknown(Kernel::HLERequestContext& ctx);
|
||||
void GetIUserInterface(Kernel::HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
|
@ -9,7 +9,7 @@ namespace Service::NFP {
|
||||
NFP_User::NFP_User(std::shared_ptr<Module> module)
|
||||
: Module::Interface(std::move(module), "nfp:user") {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &NFP_User::Unknown, "Unknown"},
|
||||
{0, &NFP_User::GetIUserInterface, "GetIUserInterface"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
@ -79,6 +79,7 @@ u32 nvhost_ctrl_gpu::GetTPCMasks(const std::vector<u8>& input, std::vector<u8>&
|
||||
std::memcpy(¶ms, input.data(), input.size());
|
||||
LOG_WARNING(Service_NVDRV, "(STUBBED) called, mask=0x%x, mask_buf_addr=0x%" PRIx64,
|
||||
params.mask_buf_size, params.mask_buf_addr);
|
||||
params.unk = 0xcafe; // Needs to be non 0, what does this actually do?
|
||||
std::memcpy(output.data(), ¶ms, sizeof(params));
|
||||
return 0;
|
||||
}
|
||||
|
40
src/core/hle/service/prepo/prepo.cpp
Normal file
40
src/core/hle/service/prepo/prepo.cpp
Normal file
@ -0,0 +1,40 @@
|
||||
#include <cinttypes>
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/prepo/prepo.h"
|
||||
|
||||
namespace Service::Playreport {
|
||||
Playreport::Playreport(const char* name) : ServiceFramework(name) {
|
||||
static const FunctionInfo functions[] = {
|
||||
{10101, &Playreport::SaveReportWithUser, "SaveReportWithUser"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
};
|
||||
|
||||
void Playreport::SaveReportWithUser(Kernel::HLERequestContext& ctx) {
|
||||
/*IPC::RequestParser rp{ctx};
|
||||
auto Uid = rp.PopRaw<std::array<u64, 2>>();
|
||||
u64 unk = rp.Pop<u64>();
|
||||
std::vector<u8> buffer;
|
||||
buffer.reserve(ctx.BufferDescriptorX()[0].Size());
|
||||
Memory::ReadBlock(ctx.BufferDescriptorX()[0].Address(), buffer.data(), buffer.size());
|
||||
|
||||
std::vector<u8> buffer2;
|
||||
buffer.reserve(ctx.BufferDescriptorA()[0].Size());
|
||||
Memory::ReadBlock(ctx.BufferDescriptorA()[0].Address(), buffer.data(), buffer.size());*/
|
||||
|
||||
// If we ever want to add play reports
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<Playreport>("prepo:a")->InstallAsService(service_manager);
|
||||
std::make_shared<Playreport>("prepo:m")->InstallAsService(service_manager);
|
||||
std::make_shared<Playreport>("prepo:s")->InstallAsService(service_manager);
|
||||
std::make_shared<Playreport>("prepo:u")->InstallAsService(service_manager);
|
||||
}
|
||||
|
||||
} // namespace Service::Playreport
|
23
src/core/hle/service/prepo/prepo.h
Normal file
23
src/core/hle/service/prepo/prepo.h
Normal file
@ -0,0 +1,23 @@
|
||||
// Copyright 2018 yuzu emulator team
|
||||
// Licensed under GPLv2 or any later version
|
||||
// Refer to the license.txt file included.
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "core/hle/kernel/event.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
namespace Service::Playreport {
|
||||
|
||||
class Playreport final : public ServiceFramework<Playreport> {
|
||||
public:
|
||||
Playreport(const char* name);
|
||||
~Playreport() = default;
|
||||
|
||||
private:
|
||||
void SaveReportWithUser(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager);
|
||||
|
||||
}; // namespace Service::Playreport
|
@ -30,6 +30,7 @@
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/nvdrv/nvdrv.h"
|
||||
#include "core/hle/service/pctl/pctl.h"
|
||||
#include "core/hle/service/prepo/prepo.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/set/settings.h"
|
||||
#include "core/hle/service/sm/controller.h"
|
||||
@ -192,6 +193,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
|
||||
NS::InstallInterfaces(*sm);
|
||||
Nvidia::InstallInterfaces(*sm);
|
||||
PCTL::InstallInterfaces(*sm);
|
||||
Playreport::InstallInterfaces(*sm);
|
||||
Sockets::InstallInterfaces(*sm);
|
||||
SPL::InstallInterfaces(*sm);
|
||||
SSL::InstallInterfaces(*sm);
|
||||
|
@ -96,12 +96,21 @@ SSL::SSL() : ServiceFramework("ssl") {
|
||||
{2, nullptr, "GetCertificates"},
|
||||
{3, nullptr, "GetCertificateBufSize"},
|
||||
{4, nullptr, "DebugIoctl"},
|
||||
{5, nullptr, "SetInterfaceVersion"},
|
||||
{5, &SSL::SetInterfaceVersion, "SetInterfaceVersion"},
|
||||
{6, nullptr, "FlushSessionCache"},
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void SSL::SetInterfaceVersion(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
u32 unk1 = rp.Pop<u32>(); // Probably minor/major?
|
||||
u32 unk2 = rp.Pop<u32>();
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
}
|
||||
|
||||
void InstallInterfaces(SM::ServiceManager& service_manager) {
|
||||
std::make_shared<SSL>()->InstallAsService(service_manager);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ public:
|
||||
|
||||
private:
|
||||
void CreateContext(Kernel::HLERequestContext& ctx);
|
||||
void SetInterfaceVersion(Kernel::HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
/// Registers all SSL services with the specified service manager.
|
||||
|
Loading…
Reference in New Issue
Block a user