mirror of
https://github.com/RPCSX/rpcsx.git
synced 2025-12-06 07:12:14 +01:00
add hmd2 devices stubs
This commit is contained in:
parent
c46b391203
commit
8c5bde7bc5
|
|
@ -27,6 +27,10 @@ add_executable(rpcsx
|
|||
iodev/hmd_cmd.cpp
|
||||
iodev/hmd_mmap.cpp
|
||||
iodev/hmd_snsr.cpp
|
||||
iodev/hmd2_cmd.cpp
|
||||
iodev/hmd2_imu.cpp
|
||||
iodev/hmd2_gen_data.cpp
|
||||
iodev/hmd2_gaze.cpp
|
||||
iodev/icc_configuration.cpp
|
||||
iodev/mbus.cpp
|
||||
iodev/metadbg.cpp
|
||||
|
|
|
|||
|
|
@ -53,3 +53,7 @@ IoDevice *createIccPowerCharacterDevice();
|
|||
IoDevice *createCaymanRegCharacterDevice();
|
||||
IoDevice *createA53IoCharacterDevice();
|
||||
IoDevice *createNsidCtlCharacterDevice();
|
||||
IoDevice *createHmd2CmdCharacterDevice();
|
||||
IoDevice *createHmd2ImuCharacterDevice();
|
||||
IoDevice *createHmd2GazeCharacterDevice();
|
||||
IoDevice *createHmd2GenDataCharacterDevice();
|
||||
|
|
|
|||
32
rpcsx/iodev/hmd2_cmd.cpp
Normal file
32
rpcsx/iodev/hmd2_cmd.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2CmdDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
struct Hmd2CmdFile : public orbis::File {};
|
||||
|
||||
static orbis::ErrorCode hmd2_cmd_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("Unhandled hmd2_cmd ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps ops = {
|
||||
.ioctl = hmd2_cmd_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2CmdDevice::open(orbis::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<Hmd2CmdFile>();
|
||||
newFile->device = this;
|
||||
newFile->ops = &ops;
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
|
||||
IoDevice *createHmd2CmdCharacterDevice() { return orbis::knew<Hmd2CmdDevice>(); }
|
||||
32
rpcsx/iodev/hmd2_gaze.cpp
Normal file
32
rpcsx/iodev/hmd2_gaze.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2GazeDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
struct Hmd2GazeFile : public orbis::File {};
|
||||
|
||||
static orbis::ErrorCode hmd2_gaze_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("Unhandled hmd2_gaze ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps ops = {
|
||||
.ioctl = hmd2_gaze_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2GazeDevice::open(orbis::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<Hmd2GazeFile>();
|
||||
newFile->device = this;
|
||||
newFile->ops = &ops;
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
|
||||
IoDevice *createHmd2GazeCharacterDevice() { return orbis::knew<Hmd2GazeDevice>(); }
|
||||
32
rpcsx/iodev/hmd2_gen_data.cpp
Normal file
32
rpcsx/iodev/hmd2_gen_data.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2GenDataDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
struct Hmd2GenDataFile : public orbis::File {};
|
||||
|
||||
static orbis::ErrorCode hmd2_gen_data_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("Unhandled hmd2_gen_data ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps ops = {
|
||||
.ioctl = hmd2_gen_data_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2GenDataDevice::open(orbis::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<Hmd2GenDataFile>();
|
||||
newFile->device = this;
|
||||
newFile->ops = &ops;
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
|
||||
IoDevice *createHmd2GenDataCharacterDevice() { return orbis::knew<Hmd2GenDataDevice>(); }
|
||||
32
rpcsx/iodev/hmd2_imu.cpp
Normal file
32
rpcsx/iodev/hmd2_imu.cpp
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#include "io-device.hpp"
|
||||
#include "orbis/KernelAllocator.hpp"
|
||||
#include "orbis/utils/Logs.hpp"
|
||||
|
||||
struct Hmd2ImuDevice : public IoDevice {
|
||||
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
|
||||
std::uint32_t flags, std::uint32_t mode,
|
||||
orbis::Thread *thread) override;
|
||||
};
|
||||
struct Hmd2ImuFile : public orbis::File {};
|
||||
|
||||
static orbis::ErrorCode hmd2_imu_ioctl(orbis::File *file, std::uint64_t request,
|
||||
void *argp, orbis::Thread *thread) {
|
||||
ORBIS_LOG_FATAL("Unhandled hmd2_imu ioctl", request);
|
||||
return {};
|
||||
}
|
||||
|
||||
static const orbis::FileOps ops = {
|
||||
.ioctl = hmd2_imu_ioctl,
|
||||
};
|
||||
|
||||
orbis::ErrorCode Hmd2ImuDevice::open(orbis::Ref<orbis::File> *file,
|
||||
const char *path, std::uint32_t flags,
|
||||
std::uint32_t mode, orbis::Thread *thread) {
|
||||
auto newFile = orbis::knew<Hmd2ImuFile>();
|
||||
newFile->device = this;
|
||||
newFile->ops = &ops;
|
||||
*file = newFile;
|
||||
return {};
|
||||
}
|
||||
|
||||
IoDevice *createHmd2ImuCharacterDevice() { return orbis::knew<Hmd2ImuDevice>(); }
|
||||
|
|
@ -453,7 +453,13 @@ static void guestInitDev() {
|
|||
vfs::addDevice("ssd0.user", createHddCharacterDevice(-41630302208)); /// ?????
|
||||
vfs::addDevice("ssd0.user_bfs", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("bfs/ctl", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("md2", createHddCharacterDevice(0x100000000));
|
||||
vfs::addDevice("a53io", createA53IoCharacterDevice());
|
||||
|
||||
vfs::addDevice("hmd2_cmd", createHmd2CmdCharacterDevice());
|
||||
vfs::addDevice("hmd2_imu", createHmd2ImuCharacterDevice());
|
||||
vfs::addDevice("hmd2_gaze", createHmd2GazeCharacterDevice());
|
||||
vfs::addDevice("hmd2_gen_data", createHmd2GenDataCharacterDevice());
|
||||
}
|
||||
|
||||
// mbus->emitEvent({
|
||||
|
|
|
|||
Loading…
Reference in a new issue