Lime3DS/src/core/hle/service/gsp/gsp.cpp
Weiyi Wang b163502744
Core: pass down Core::System reference to all services (#4272)
* Core: pass down Core::System reference to all services

This has to be done at once due to unified interface used by HLE/LLE switcher

* apt: eliminate Core::System::GetInstance

* gpu_gsp: eliminate Core::System::GetInstance in service

* hid: eliminate Core::System::GetInstance

* nwm: eliminate Core::System::GetInstance

* err_f: eliminate Core::System::GetInstance
2018-10-05 10:59:43 -04:00

36 lines
1,021 B
C++

// Copyright 2017 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include <vector>
#include "core/core.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/shared_memory.h"
#include "core/hle/service/gsp/gsp.h"
namespace Service::GSP {
static std::weak_ptr<GSP_GPU> gsp_gpu;
FrameBufferUpdate* GetFrameBufferInfo(u32 thread_id, u32 screen_index) {
auto gpu = gsp_gpu.lock();
ASSERT(gpu != nullptr);
return gpu->GetFrameBufferInfo(thread_id, screen_index);
}
void SignalInterrupt(InterruptId interrupt_id) {
auto gpu = gsp_gpu.lock();
ASSERT(gpu != nullptr);
return gpu->SignalInterrupt(interrupt_id);
}
void InstallInterfaces(Core::System& system) {
auto& service_manager = system.ServiceManager();
auto gpu = std::make_shared<GSP_GPU>(system);
gpu->InstallAsService(service_manager);
gsp_gpu = gpu;
std::make_shared<GSP_LCD>()->InstallAsService(service_manager);
}
} // namespace Service::GSP