rpcsx/rpcsx-os/iodev/hmd_cmd.cpp

35 lines
1.1 KiB
C++
Raw Normal View History

2023-06-23 02:28:14 +02:00
#include "io-device.hpp"
2023-07-04 18:19:17 +02:00
#include "orbis/KernelAllocator.hpp"
#include "orbis/utils/Logs.hpp"
2023-06-23 02:28:14 +02:00
struct HmdCmdDevice : public IoDevice {
orbis::ErrorCode open(orbis::Ref<orbis::File> *file, const char *path,
2023-07-29 21:46:28 +02:00
std::uint32_t flags, std::uint32_t mode,
orbis::Thread *thread) override;
};
struct HmdCmdFile : public orbis::File {};
2023-06-23 02:28:14 +02:00
static orbis::ErrorCode hmd_cmd_ioctl(orbis::File *file, std::uint64_t request,
void *argp, orbis::Thread *thread) {
ORBIS_LOG_FATAL("Unhandled hmd_cmd ioctl", request);
2023-06-23 02:28:14 +02:00
// 0x800c4802
return {};
2023-06-23 02:28:14 +02:00
}
static const orbis::FileOps ops = {
.ioctl = hmd_cmd_ioctl,
};
orbis::ErrorCode HmdCmdDevice::open(orbis::Ref<orbis::File> *file,
const char *path, std::uint32_t flags,
2023-07-29 21:46:28 +02:00
std::uint32_t mode, orbis::Thread *thread) {
auto newFile = orbis::knew<HmdCmdFile>();
newFile->device = this;
newFile->ops = &ops;
*file = newFile;
return {};
2023-06-23 02:28:14 +02:00
}
IoDevice *createHmdCmdCharacterDevice() { return orbis::knew<HmdCmdDevice>(); }