mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-29 19:14:17 +01:00
- added stubbed out GSP::Gpu service interface
- various cleanups/refactors to HLE services
This commit is contained in:
parent
acef5e0b17
commit
32c3462047
@ -154,6 +154,7 @@
|
|||||||
<ClCompile Include="file_sys\meta_file_system.cpp" />
|
<ClCompile Include="file_sys\meta_file_system.cpp" />
|
||||||
<ClCompile Include="hle\hle.cpp" />
|
<ClCompile Include="hle\hle.cpp" />
|
||||||
<ClCompile Include="hle\service\apt.cpp" />
|
<ClCompile Include="hle\service\apt.cpp" />
|
||||||
|
<ClCompile Include="hle\service\gsp.cpp" />
|
||||||
<ClCompile Include="hle\service\service.cpp" />
|
<ClCompile Include="hle\service\service.cpp" />
|
||||||
<ClCompile Include="hle\service\srv.cpp" />
|
<ClCompile Include="hle\service\srv.cpp" />
|
||||||
<ClCompile Include="hle\syscall.cpp" />
|
<ClCompile Include="hle\syscall.cpp" />
|
||||||
@ -190,6 +191,7 @@
|
|||||||
<ClInclude Include="hle\function_wrappers.h" />
|
<ClInclude Include="hle\function_wrappers.h" />
|
||||||
<ClInclude Include="hle\hle.h" />
|
<ClInclude Include="hle\hle.h" />
|
||||||
<ClInclude Include="hle\service\apt.h" />
|
<ClInclude Include="hle\service\apt.h" />
|
||||||
|
<ClInclude Include="hle\service\gsp.h" />
|
||||||
<ClInclude Include="hle\service\service.h" />
|
<ClInclude Include="hle\service\service.h" />
|
||||||
<ClInclude Include="hle\service\srv.h" />
|
<ClInclude Include="hle\service\srv.h" />
|
||||||
<ClInclude Include="hle\syscall.h" />
|
<ClInclude Include="hle\syscall.h" />
|
||||||
|
@ -96,6 +96,9 @@
|
|||||||
<ClCompile Include="hle\service\srv.cpp">
|
<ClCompile Include="hle\service\srv.cpp">
|
||||||
<Filter>hle\service</Filter>
|
<Filter>hle\service</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="hle\service\gsp.cpp">
|
||||||
|
<Filter>hle\service</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="arm\disassembler\arm_disasm.h">
|
<ClInclude Include="arm\disassembler\arm_disasm.h">
|
||||||
@ -187,6 +190,9 @@
|
|||||||
<ClInclude Include="hle\service\srv.h">
|
<ClInclude Include="hle\service\srv.h">
|
||||||
<Filter>hle\service</Filter>
|
<Filter>hle\service</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="hle\service\gsp.h">
|
||||||
|
<Filter>hle\service</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="CMakeLists.txt" />
|
<Text Include="CMakeLists.txt" />
|
||||||
|
@ -25,7 +25,7 @@ public:
|
|||||||
~Interface();
|
~Interface();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the string port name used by CTROS for the APT service
|
* Gets the string port name used by CTROS for the service
|
||||||
* @return Port name of service
|
* @return Port name of service
|
||||||
*/
|
*/
|
||||||
std::string GetPortName() const {
|
std::string GetPortName() const {
|
||||||
|
56
src/core/hle/service/gsp.cpp
Normal file
56
src/core/hle/service/gsp.cpp
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
// Copyright 2014 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
|
||||||
|
#include "common/log.h"
|
||||||
|
|
||||||
|
#include "core/hle/hle.h"
|
||||||
|
#include "core/hle/service/gsp.h"
|
||||||
|
|
||||||
|
namespace GSP_GPU {
|
||||||
|
|
||||||
|
const HLE::FunctionDef FunctionTable[] = {
|
||||||
|
{0x00010082, NULL, "WriteHWRegs"},
|
||||||
|
{0x00020084, NULL, "WriteHWRegsWithMask"},
|
||||||
|
{0x00030082, NULL, "WriteHWRegRepeat"},
|
||||||
|
{0x00040080, NULL, "ReadHWRegs"},
|
||||||
|
{0x00050200, NULL, "SetBufferSwap"},
|
||||||
|
{0x00060082, NULL, "SetCommandList"},
|
||||||
|
{0x000700C2, NULL, "RequestDma"},
|
||||||
|
{0x00080082, NULL, "FlushDataCache"},
|
||||||
|
{0x00090082, NULL, "InvalidateDataCache"},
|
||||||
|
{0x000A0044, NULL, "RegisterInterruptEvents"},
|
||||||
|
{0x000B0040, NULL, "SetLcdForceBlack"},
|
||||||
|
{0x000C0000, NULL, "TriggerCmdReqQueue"},
|
||||||
|
{0x000D0140, NULL, "SetDisplayTransfer"},
|
||||||
|
{0x000E0180, NULL, "SetTextureCopy"},
|
||||||
|
{0x000F0200, NULL, "SetMemoryFill"},
|
||||||
|
{0x00100040, NULL, "SetAxiConfigQoSMode"},
|
||||||
|
{0x00110040, NULL, "SetPerfLogMode"},
|
||||||
|
{0x00120000, NULL, "GetPerfLog"},
|
||||||
|
{0x00130042, NULL, "RegisterInterruptRelayQueue"},
|
||||||
|
{0x00140000, NULL, "UnregisterInterruptRelayQueue"},
|
||||||
|
{0x00150002, NULL, "TryAcquireRight"},
|
||||||
|
{0x00160042, NULL, "AcquireRight"},
|
||||||
|
{0x00170000, NULL, "ReleaseRight"},
|
||||||
|
{0x00180000, NULL, "ImportDisplayCaptureInfo"},
|
||||||
|
{0x00190000, NULL, "SaveVramSysArea"},
|
||||||
|
{0x001A0000, NULL, "RestoreVramSysArea"},
|
||||||
|
{0x001B0000, NULL, "ResetGpuCore"},
|
||||||
|
{0x001C0040, NULL, "SetLedForceOff"},
|
||||||
|
{0x001D0040, NULL, "SetTestCommand"},
|
||||||
|
{0x001E0080, NULL, "SetInternalPriorities"},
|
||||||
|
};
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Interface class
|
||||||
|
|
||||||
|
Interface::Interface() {
|
||||||
|
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
|
||||||
|
}
|
||||||
|
|
||||||
|
Interface::~Interface() {
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
34
src/core/hle/service/gsp.h
Normal file
34
src/core/hle/service/gsp.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Copyright 2014 Citra Emulator Project
|
||||||
|
// Licensed under GPLv2
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "core/hle/service/service.h"
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
// Namespace Service
|
||||||
|
|
||||||
|
namespace GSP_GPU {
|
||||||
|
|
||||||
|
class Interface : public Service::Interface {
|
||||||
|
public:
|
||||||
|
|
||||||
|
Interface();
|
||||||
|
|
||||||
|
~Interface();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the string port name used by CTROS for the service
|
||||||
|
* @return Port name of service
|
||||||
|
*/
|
||||||
|
std::string GetPortName() const {
|
||||||
|
return "gsp::Gpu";
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
DISALLOW_COPY_AND_ASSIGN(Interface);
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace
|
@ -9,6 +9,7 @@
|
|||||||
#include "core/hle/hle.h"
|
#include "core/hle/hle.h"
|
||||||
#include "core/hle/service/service.h"
|
#include "core/hle/service/service.h"
|
||||||
#include "core/hle/service/apt.h"
|
#include "core/hle/service/apt.h"
|
||||||
|
#include "core/hle/service/gsp.h"
|
||||||
#include "core/hle/service/srv.h"
|
#include "core/hle/service/srv.h"
|
||||||
|
|
||||||
namespace Service {
|
namespace Service {
|
||||||
@ -73,8 +74,11 @@ Interface* Manager::FetchFromPortName(std::string port_name) {
|
|||||||
/// Initialize ServiceManager
|
/// Initialize ServiceManager
|
||||||
void Init() {
|
void Init() {
|
||||||
g_manager = new Manager;
|
g_manager = new Manager;
|
||||||
|
|
||||||
g_manager->AddService(new SRV::Interface);
|
g_manager->AddService(new SRV::Interface);
|
||||||
g_manager->AddService(new APT_U::Interface);
|
g_manager->AddService(new APT_U::Interface);
|
||||||
|
g_manager->AddService(new GSP_GPU::Interface);
|
||||||
|
|
||||||
NOTICE_LOG(HLE, "Services initialized OK");
|
NOTICE_LOG(HLE, "Services initialized OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ namespace Service {
|
|||||||
|
|
||||||
typedef s32 NativeUID; ///< Native handle for a service
|
typedef s32 NativeUID; ///< Native handle for a service
|
||||||
|
|
||||||
|
static const int kMaxPortSize = 0x08; ///< Maximum size of a port name (8 characters)
|
||||||
static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header
|
static const int kCommandHeaderOffset = 0x80; ///< Offset into command buffer of header
|
||||||
|
|
||||||
class Manager;
|
class Manager;
|
||||||
@ -59,13 +60,14 @@ public:
|
|||||||
auto itr = m_functions.find(cmd_buff[0]);
|
auto itr = m_functions.find(cmd_buff[0]);
|
||||||
|
|
||||||
if (itr == m_functions.end()) {
|
if (itr == m_functions.end()) {
|
||||||
ERROR_LOG(OSHLE, "Unknown/unimplemented function: port=%s, command=0x%08X!",
|
ERROR_LOG(OSHLE, "Unknown/unimplemented function: port = %s, command = 0x%08X!",
|
||||||
GetPortName().c_str(), cmd_buff[0]);
|
GetPortName().c_str(), cmd_buff[0]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (itr->second.func == NULL) {
|
if (itr->second.func == NULL) {
|
||||||
ERROR_LOG(OSHLE, "Unimplemented function: port=%s, name=%s!",
|
ERROR_LOG(OSHLE, "Unimplemented function: port = %s, name = %s!",
|
||||||
GetPortName().c_str(), itr->second.name.c_str());
|
GetPortName().c_str(), itr->second.name.c_str());
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
itr->second.func();
|
itr->second.func();
|
||||||
|
@ -17,7 +17,7 @@ void GetServiceHandle() {
|
|||||||
Syscall::Result res = 0;
|
Syscall::Result res = 0;
|
||||||
u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset);
|
u32* cmd_buff = (u32*)HLE::GetPointer(HLE::CMD_BUFFER_ADDR + Service::kCommandHeaderOffset);
|
||||||
|
|
||||||
const char* port_name = (const char*)&cmd_buff[1];
|
std::string port_name = std::string((const char*)&cmd_buff[1], 0, Service::kMaxPortSize);
|
||||||
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
|
Service::Interface* service = Service::g_manager->FetchFromPortName(port_name);
|
||||||
|
|
||||||
NOTICE_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name,
|
NOTICE_LOG(OSHLE, "SRV::Sync - GetHandle - port: %s, handle: 0x%08X", port_name,
|
||||||
|
@ -18,7 +18,7 @@ public:
|
|||||||
~Interface();
|
~Interface();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the string name used by CTROS for a service
|
* Gets the string name used by CTROS for the service
|
||||||
* @return Port name of service
|
* @return Port name of service
|
||||||
*/
|
*/
|
||||||
std::string GetPortName() const {
|
std::string GetPortName() const {
|
||||||
|
Loading…
Reference in New Issue
Block a user