mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 22:25:41 +12:00
[IR:USER] Add empty service
This commit is contained in:
parent
46207a3995
commit
1c08912a59
7 changed files with 47 additions and 2 deletions
|
@ -104,6 +104,7 @@ set(SERVICE_SOURCE_FILES src/core/services/service_manager.cpp src/core/services
|
||||||
src/core/services/frd.cpp src/core/services/nim.cpp src/core/services/shared_font.cpp
|
src/core/services/frd.cpp src/core/services/nim.cpp src/core/services/shared_font.cpp
|
||||||
src/core/services/y2r.cpp src/core/services/cam.cpp src/core/services/ldr_ro.cpp
|
src/core/services/y2r.cpp src/core/services/cam.cpp src/core/services/ldr_ro.cpp
|
||||||
src/core/services/act.cpp src/core/services/nfc.cpp src/core/services/dlp_srvr.cpp
|
src/core/services/act.cpp src/core/services/nfc.cpp src/core/services/dlp_srvr.cpp
|
||||||
|
src/core/services/ir_user.cpp
|
||||||
)
|
)
|
||||||
set(PICA_SOURCE_FILES src/core/PICA/gpu.cpp src/core/PICA/regs.cpp src/core/PICA/shader_unit.cpp
|
set(PICA_SOURCE_FILES src/core/PICA/gpu.cpp src/core/PICA/regs.cpp src/core/PICA/shader_unit.cpp
|
||||||
src/core/PICA/shader_interpreter.cpp src/core/PICA/dynapica/shader_rec.cpp
|
src/core/PICA/shader_interpreter.cpp src/core/PICA/dynapica/shader_rec.cpp
|
||||||
|
@ -141,7 +142,7 @@ set(HEADER_FILES include/emulator.hpp include/helpers.hpp include/opengl.hpp inc
|
||||||
include/result/result_common.hpp include/result/result_fs.hpp include/result/result_fnd.hpp
|
include/result/result_common.hpp include/result/result_fs.hpp include/result/result_fnd.hpp
|
||||||
include/result/result_gsp.hpp include/result/result_kernel.hpp include/result/result_os.hpp
|
include/result/result_gsp.hpp include/result/result_kernel.hpp include/result/result_os.hpp
|
||||||
include/crypto/aes_engine.hpp include/metaprogramming.hpp include/PICA/pica_vertex.hpp include/gl_state.hpp
|
include/crypto/aes_engine.hpp include/metaprogramming.hpp include/PICA/pica_vertex.hpp include/gl_state.hpp
|
||||||
include/config.hpp
|
include/config.hpp include/services/ir_user.hpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
set(THIRD_PARTY_SOURCE_FILES third_party/imgui/imgui.cpp
|
||||||
|
|
|
@ -21,6 +21,7 @@ namespace KernelHandles {
|
||||||
DLP_SRVR, // Download Play: Server. Used for network play.
|
DLP_SRVR, // Download Play: Server. Used for network play.
|
||||||
DSP, // DSP service (Used for audio decoding and output)
|
DSP, // DSP service (Used for audio decoding and output)
|
||||||
HID, // HID service (Handles everything input-related including gyro)
|
HID, // HID service (Handles everything input-related including gyro)
|
||||||
|
IR_USER, // One of 3 infrared communication services
|
||||||
FRD, // Friend service (Miiverse friend service)
|
FRD, // Friend service (Miiverse friend service)
|
||||||
FS, // Filesystem service
|
FS, // Filesystem service
|
||||||
GPU, // GPU service
|
GPU, // GPU service
|
||||||
|
@ -68,6 +69,7 @@ namespace KernelHandles {
|
||||||
case DSP: return "DSP";
|
case DSP: return "DSP";
|
||||||
case DLP_SRVR: return "DLP::SRVR";
|
case DLP_SRVR: return "DLP::SRVR";
|
||||||
case HID: return "HID";
|
case HID: return "HID";
|
||||||
|
case IR_USER: return "IR:USER";
|
||||||
case FRD: return "FRD";
|
case FRD: return "FRD";
|
||||||
case FS: return "FS";
|
case FS: return "FS";
|
||||||
case GPU: return "GSP::GPU";
|
case GPU: return "GSP::GPU";
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace Log {
|
||||||
static Logger<false> frdLogger;
|
static Logger<false> frdLogger;
|
||||||
static Logger<false> fsLogger;
|
static Logger<false> fsLogger;
|
||||||
static Logger<false> hidLogger;
|
static Logger<false> hidLogger;
|
||||||
|
static Logger<false> irUserLogger;
|
||||||
static Logger<false> gspGPULogger;
|
static Logger<false> gspGPULogger;
|
||||||
static Logger<false> gspLCDLogger;
|
static Logger<false> gspLCDLogger;
|
||||||
static Logger<false> ldrLogger;
|
static Logger<false> ldrLogger;
|
||||||
|
|
19
include/services/ir_user.hpp
Normal file
19
include/services/ir_user.hpp
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
#include "helpers.hpp"
|
||||||
|
#include "kernel_types.hpp"
|
||||||
|
#include "logger.hpp"
|
||||||
|
#include "memory.hpp"
|
||||||
|
#include "result/result.hpp"
|
||||||
|
|
||||||
|
class IRUserService {
|
||||||
|
Handle handle = KernelHandles::IR_USER;
|
||||||
|
Memory& mem;
|
||||||
|
MAKE_LOG_FUNCTION(log, irUserLogger)
|
||||||
|
|
||||||
|
// Service commands
|
||||||
|
|
||||||
|
public:
|
||||||
|
IRUserService(Memory& mem) : mem(mem) {}
|
||||||
|
void reset();
|
||||||
|
void handleSyncRequest(u32 messagePointer);
|
||||||
|
};
|
|
@ -21,6 +21,7 @@
|
||||||
#include "services/gsp_gpu.hpp"
|
#include "services/gsp_gpu.hpp"
|
||||||
#include "services/gsp_lcd.hpp"
|
#include "services/gsp_lcd.hpp"
|
||||||
#include "services/hid.hpp"
|
#include "services/hid.hpp"
|
||||||
|
#include "services/ir_user.hpp"
|
||||||
#include "services/ldr_ro.hpp"
|
#include "services/ldr_ro.hpp"
|
||||||
#include "services/mic.hpp"
|
#include "services/mic.hpp"
|
||||||
#include "services/ndm.hpp"
|
#include "services/ndm.hpp"
|
||||||
|
@ -52,6 +53,7 @@ class ServiceManager {
|
||||||
DlpSrvrService dlp_srvr;
|
DlpSrvrService dlp_srvr;
|
||||||
DSPService dsp;
|
DSPService dsp;
|
||||||
HIDService hid;
|
HIDService hid;
|
||||||
|
IRUserService ir_user;
|
||||||
FRDService frd;
|
FRDService frd;
|
||||||
FSService fs;
|
FSService fs;
|
||||||
GPUService gsp_gpu;
|
GPUService gsp_gpu;
|
||||||
|
|
15
src/core/services/ir_user.cpp
Normal file
15
src/core/services/ir_user.cpp
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
#include "ipc.hpp"
|
||||||
|
#include "services/ir_user.hpp"
|
||||||
|
|
||||||
|
namespace IRUserCommands {
|
||||||
|
enum : u32 {};
|
||||||
|
}
|
||||||
|
|
||||||
|
void IRUserService::reset() {}
|
||||||
|
|
||||||
|
void IRUserService::handleSyncRequest(u32 messagePointer) {
|
||||||
|
const u32 command = mem.read32(messagePointer);
|
||||||
|
switch (command) {
|
||||||
|
default: Helpers::panic("ir:USER service requested. Command: %08X\n", command);
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
ServiceManager::ServiceManager(std::span<u32, 16> regs, Memory& mem, GPU& gpu, u32& currentPID, Kernel& kernel)
|
ServiceManager::ServiceManager(std::span<u32, 16> regs, Memory& mem, GPU& gpu, u32& currentPID, Kernel& kernel)
|
||||||
: regs(regs), mem(mem), kernel(kernel), ac(mem), am(mem), boss(mem), act(mem), apt(mem, kernel), cam(mem),
|
: regs(regs), mem(mem), kernel(kernel), ac(mem), am(mem), boss(mem), act(mem), apt(mem, kernel), cam(mem),
|
||||||
cecd(mem, kernel), cfg(mem), dlp_srvr(mem), dsp(mem, kernel), hid(mem, kernel), frd(mem), fs(mem, kernel),
|
cecd(mem, kernel), cfg(mem), dlp_srvr(mem), dsp(mem, kernel), hid(mem, kernel), ir_user(mem), frd(mem), fs(mem, kernel),
|
||||||
gsp_gpu(mem, gpu, kernel, currentPID), gsp_lcd(mem), ldr(mem), mic(mem), nfc(mem, kernel), nim(mem), ndm(mem),
|
gsp_gpu(mem, gpu, kernel, currentPID), gsp_lcd(mem), ldr(mem), mic(mem), nfc(mem, kernel), nim(mem), ndm(mem),
|
||||||
ptm(mem), y2r(mem, kernel) {}
|
ptm(mem), y2r(mem, kernel) {}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ void ServiceManager::reset() {
|
||||||
dlp_srvr.reset();
|
dlp_srvr.reset();
|
||||||
dsp.reset();
|
dsp.reset();
|
||||||
hid.reset();
|
hid.reset();
|
||||||
|
ir_user.reset();
|
||||||
frd.reset();
|
frd.reset();
|
||||||
fs.reset();
|
fs.reset();
|
||||||
gsp_gpu.reset();
|
gsp_gpu.reset();
|
||||||
|
@ -83,6 +84,7 @@ void ServiceManager::registerClient(u32 messagePointer) {
|
||||||
mem.write32(messagePointer + 4, Result::Success);
|
mem.write32(messagePointer + 4, Result::Success);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clang-format off
|
||||||
static std::map<std::string, Handle> serviceMap = {
|
static std::map<std::string, Handle> serviceMap = {
|
||||||
{ "ac:u", KernelHandles::AC },
|
{ "ac:u", KernelHandles::AC },
|
||||||
{ "act:u", KernelHandles::ACT },
|
{ "act:u", KernelHandles::ACT },
|
||||||
|
@ -97,6 +99,7 @@ static std::map<std::string, Handle> serviceMap = {
|
||||||
{ "dlp:SRVR", KernelHandles::DLP_SRVR },
|
{ "dlp:SRVR", KernelHandles::DLP_SRVR },
|
||||||
{ "dsp::DSP", KernelHandles::DSP },
|
{ "dsp::DSP", KernelHandles::DSP },
|
||||||
{ "hid:USER", KernelHandles::HID },
|
{ "hid:USER", KernelHandles::HID },
|
||||||
|
{ "ir:USER", KernelHandles::IR_USER },
|
||||||
{ "frd:u", KernelHandles::FRD },
|
{ "frd:u", KernelHandles::FRD },
|
||||||
{ "fs:USER", KernelHandles::FS },
|
{ "fs:USER", KernelHandles::FS },
|
||||||
{ "gsp::Gpu", KernelHandles::GPU },
|
{ "gsp::Gpu", KernelHandles::GPU },
|
||||||
|
@ -110,6 +113,7 @@ static std::map<std::string, Handle> serviceMap = {
|
||||||
{ "ptm:sysm", KernelHandles::PTM },
|
{ "ptm:sysm", KernelHandles::PTM },
|
||||||
{ "y2r:u", KernelHandles::Y2R }
|
{ "y2r:u", KernelHandles::Y2R }
|
||||||
};
|
};
|
||||||
|
// clang-format on
|
||||||
|
|
||||||
// https://www.3dbrew.org/wiki/SRV:GetServiceHandle
|
// https://www.3dbrew.org/wiki/SRV:GetServiceHandle
|
||||||
void ServiceManager::getServiceHandle(u32 messagePointer) {
|
void ServiceManager::getServiceHandle(u32 messagePointer) {
|
||||||
|
@ -179,6 +183,7 @@ void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) {
|
||||||
case KernelHandles::CFG: cfg.handleSyncRequest(messagePointer); break;
|
case KernelHandles::CFG: cfg.handleSyncRequest(messagePointer); break;
|
||||||
case KernelHandles::DLP_SRVR: dlp_srvr.handleSyncRequest(messagePointer); break;
|
case KernelHandles::DLP_SRVR: dlp_srvr.handleSyncRequest(messagePointer); break;
|
||||||
case KernelHandles::HID: hid.handleSyncRequest(messagePointer); break;
|
case KernelHandles::HID: hid.handleSyncRequest(messagePointer); break;
|
||||||
|
case KernelHandles::IR_USER: ir_user.handleSyncRequest(messagePointer); break;
|
||||||
case KernelHandles::FRD: frd.handleSyncRequest(messagePointer); break;
|
case KernelHandles::FRD: frd.handleSyncRequest(messagePointer); break;
|
||||||
case KernelHandles::LCD: gsp_lcd.handleSyncRequest(messagePointer); break;
|
case KernelHandles::LCD: gsp_lcd.handleSyncRequest(messagePointer); break;
|
||||||
case KernelHandles::LDR_RO: ldr.handleSyncRequest(messagePointer); break;
|
case KernelHandles::LDR_RO: ldr.handleSyncRequest(messagePointer); break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue