mirror of
https://github.com/PabloMK7/citra.git
synced 2025-10-11 20:10:03 +00:00
hle: Eliminate need to specify command headers for IPC. (#6678)
This commit is contained in:
parent
0bedb28bdc
commit
e043caac27
96 changed files with 2691 additions and 2707 deletions
|
@ -307,7 +307,7 @@ void Module::UpdateGyroscopeCallback(std::uintptr_t user_data, s64 cycles_late)
|
|||
}
|
||||
|
||||
void Module::Interface::GetIPCHandles(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0xA, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(1, 7);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
rb.PushCopyObjects(hid->shared_mem, hid->event_pad_or_touch_1, hid->event_pad_or_touch_2,
|
||||
|
@ -315,7 +315,7 @@ void Module::Interface::GetIPCHandles(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void Module::Interface::EnableAccelerometer(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x11, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
++hid->enable_accelerometer_count;
|
||||
|
||||
|
@ -332,7 +332,7 @@ void Module::Interface::EnableAccelerometer(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void Module::Interface::DisableAccelerometer(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x12, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
--hid->enable_accelerometer_count;
|
||||
|
||||
|
@ -348,7 +348,7 @@ void Module::Interface::DisableAccelerometer(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void Module::Interface::EnableGyroscopeLow(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x13, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
++hid->enable_gyroscope_count;
|
||||
|
||||
|
@ -364,7 +364,7 @@ void Module::Interface::EnableGyroscopeLow(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void Module::Interface::DisableGyroscopeLow(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x14, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
--hid->enable_gyroscope_count;
|
||||
|
||||
|
@ -380,7 +380,7 @@ void Module::Interface::DisableGyroscopeLow(Kernel::HLERequestContext& ctx) {
|
|||
}
|
||||
|
||||
void Module::Interface::GetGyroscopeLowRawToDpsCoefficient(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x15, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(2, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
|
@ -388,7 +388,7 @@ void Module::Interface::GetGyroscopeLowRawToDpsCoefficient(Kernel::HLERequestCon
|
|||
}
|
||||
|
||||
void Module::Interface::GetGyroscopeLowCalibrateParam(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x16, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
IPC::RequestBuilder rb = rp.MakeBuilder(6, 0);
|
||||
rb.Push(RESULT_SUCCESS);
|
||||
|
@ -405,7 +405,7 @@ void Module::Interface::GetGyroscopeLowCalibrateParam(Kernel::HLERequestContext&
|
|||
}
|
||||
|
||||
void Module::Interface::GetSoundVolume(Kernel::HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx, 0x17, 0, 0};
|
||||
IPC::RequestParser rp(ctx);
|
||||
|
||||
const u8 volume = static_cast<u8>(0x3F * Settings::values.volume.GetValue());
|
||||
|
||||
|
|
|
@ -12,18 +12,18 @@ namespace Service::HID {
|
|||
Spvr::Spvr(std::shared_ptr<Module> hid) : Module::Interface(std::move(hid), "hid:SPVR", 6) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 8, 0), nullptr, "CalibrateTouchScreen"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), nullptr, "UpdateTouchConfig"},
|
||||
{IPC::MakeHeader(0x000A, 0, 0), &Spvr::GetIPCHandles, "GetIPCHandles"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "StartAnalogStickCalibration"},
|
||||
{IPC::MakeHeader(0x000E, 0, 0), nullptr, "GetAnalogStickCalibrateParam"},
|
||||
{IPC::MakeHeader(0x0011, 0, 0), &Spvr::EnableAccelerometer, "EnableAccelerometer"},
|
||||
{IPC::MakeHeader(0x0012, 0, 0), &Spvr::DisableAccelerometer, "DisableAccelerometer"},
|
||||
{IPC::MakeHeader(0x0013, 0, 0), &Spvr::EnableGyroscopeLow, "EnableGyroscopeLow"},
|
||||
{IPC::MakeHeader(0x0014, 0, 0), &Spvr::DisableGyroscopeLow, "DisableGyroscopeLow"},
|
||||
{IPC::MakeHeader(0x0015, 0, 0), &Spvr::GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"},
|
||||
{IPC::MakeHeader(0x0016, 0, 0), &Spvr::GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"},
|
||||
{IPC::MakeHeader(0x0017, 0, 0), &Spvr::GetSoundVolume, "GetSoundVolume"},
|
||||
{0x0001, nullptr, "CalibrateTouchScreen"},
|
||||
{0x0002, nullptr, "UpdateTouchConfig"},
|
||||
{0x000A, &Spvr::GetIPCHandles, "GetIPCHandles"},
|
||||
{0x000B, nullptr, "StartAnalogStickCalibration"},
|
||||
{0x000E, nullptr, "GetAnalogStickCalibrateParam"},
|
||||
{0x0011, &Spvr::EnableAccelerometer, "EnableAccelerometer"},
|
||||
{0x0012, &Spvr::DisableAccelerometer, "DisableAccelerometer"},
|
||||
{0x0013, &Spvr::EnableGyroscopeLow, "EnableGyroscopeLow"},
|
||||
{0x0014, &Spvr::DisableGyroscopeLow, "DisableGyroscopeLow"},
|
||||
{0x0015, &Spvr::GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"},
|
||||
{0x0016, &Spvr::GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"},
|
||||
{0x0017, &Spvr::GetSoundVolume, "GetSoundVolume"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
|
|
@ -12,18 +12,18 @@ namespace Service::HID {
|
|||
User::User(std::shared_ptr<Module> hid) : Module::Interface(std::move(hid), "hid:USER", 6) {
|
||||
static const FunctionInfo functions[] = {
|
||||
// clang-format off
|
||||
{IPC::MakeHeader(0x0001, 8, 0), nullptr, "CalibrateTouchScreen"},
|
||||
{IPC::MakeHeader(0x0002, 0, 0), nullptr, "UpdateTouchConfig"},
|
||||
{IPC::MakeHeader(0x000A, 0, 0), &User::GetIPCHandles, "GetIPCHandles"},
|
||||
{IPC::MakeHeader(0x000B, 0, 0), nullptr, "StartAnalogStickCalibration"},
|
||||
{IPC::MakeHeader(0x000E, 0, 0), nullptr, "GetAnalogStickCalibrateParam"},
|
||||
{IPC::MakeHeader(0x0011, 0, 0), &User::EnableAccelerometer, "EnableAccelerometer"},
|
||||
{IPC::MakeHeader(0x0012, 0, 0), &User::DisableAccelerometer, "DisableAccelerometer"},
|
||||
{IPC::MakeHeader(0x0013, 0, 0), &User::EnableGyroscopeLow, "EnableGyroscopeLow"},
|
||||
{IPC::MakeHeader(0x0014, 0, 0), &User::DisableGyroscopeLow, "DisableGyroscopeLow"},
|
||||
{IPC::MakeHeader(0x0015, 0, 0), &User::GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"},
|
||||
{IPC::MakeHeader(0x0016, 0, 0), &User::GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"},
|
||||
{IPC::MakeHeader(0x0017, 0, 0), &User::GetSoundVolume, "GetSoundVolume"},
|
||||
{0x0001, nullptr, "CalibrateTouchScreen"},
|
||||
{0x0002, nullptr, "UpdateTouchConfig"},
|
||||
{0x000A, &User::GetIPCHandles, "GetIPCHandles"},
|
||||
{0x000B, nullptr, "StartAnalogStickCalibration"},
|
||||
{0x000E, nullptr, "GetAnalogStickCalibrateParam"},
|
||||
{0x0011, &User::EnableAccelerometer, "EnableAccelerometer"},
|
||||
{0x0012, &User::DisableAccelerometer, "DisableAccelerometer"},
|
||||
{0x0013, &User::EnableGyroscopeLow, "EnableGyroscopeLow"},
|
||||
{0x0014, &User::DisableGyroscopeLow, "DisableGyroscopeLow"},
|
||||
{0x0015, &User::GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"},
|
||||
{0x0016, &User::GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"},
|
||||
{0x0017, &User::GetSoundVolume, "GetSoundVolume"},
|
||||
// clang-format on
|
||||
};
|
||||
RegisterHandlers(functions);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue