Add set service + stubs needed for games

This commit is contained in:
goaaats
2018-01-18 23:55:10 +01:00
parent b4ed210b6f
commit 309a498978
4 changed files with 73 additions and 0 deletions

View File

@@ -139,6 +139,8 @@ add_library(core STATIC
hle/service/vi/vi.h
hle/service/vi/vi_m.cpp
hle/service/vi/vi_m.h
hle/service/set/set.cpp
hle/service/set/set.h
hle/shared_page.cpp
hle/shared_page.h
hw/hw.cpp

View File

@@ -29,6 +29,7 @@
#include "core/hle/service/sockets/sockets.h"
#include "core/hle/service/time/time.h"
#include "core/hle/service/vi/vi.h"
#include "core/hle/service/set/set.h"
using Kernel::ClientPort;
using Kernel::ServerPort;
@@ -178,6 +179,7 @@ void Init() {
Sockets::InstallInterfaces(*SM::g_service_manager);
Time::InstallInterfaces(*SM::g_service_manager);
VI::InstallInterfaces(*SM::g_service_manager);
Set::InstallInterfaces(*SM::g_service_manager);
LOG_DEBUG(Service, "initialized OK");
}

View File

@@ -0,0 +1,44 @@
// Copyright 2018 yuzu emulator team
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <chrono>
#include "common/logging/log.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/set/set.h"
namespace Service {
namespace Set {
void SET::GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx) {
constexpr u8 data[13] = {
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
};
const auto& output_buffer = ctx.BufferDescriptorC()[0];
Memory::WriteBlock( output_buffer.Address(), data, sizeof( data ) );
IPC::RequestBuilder rb{ ctx, 4 };
rb.Push( RESULT_SUCCESS );
rb.Push( static_cast<u64>( sizeof( data ) ) );
LOG_WARNING( Service, "(STUBBED) called" );
}
SET::SET(const char* name) : ServiceFramework(name) {
static const FunctionInfo functions[] = {
{1, &SET::GetAvailableLanguageCodes, "GetAvailableLanguageCodes"},
};
RegisterHandlers(functions);
}
void InstallInterfaces(SM::ServiceManager& service_manager) {
std::make_shared<SET>("set")->InstallAsService(service_manager);
}
} // namespace Set
} // namespace Service

View File

@@ -0,0 +1,25 @@
// 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/service.h"
namespace Service {
namespace Set {
class SET final : public ServiceFramework<SET> {
public:
explicit SET(const char* name);
~SET() = default;
private:
void GetAvailableLanguageCodes(Kernel::HLERequestContext& ctx);
};
/// Registers all Time services with the specified service manager.
void InstallInterfaces(SM::ServiceManager& service_manager);
} // namespace Set
} // namespace Service