diff --git a/README.md b/README.md
index 52a6b0e29..ab7d06d4b 100755
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
yuzu emulator early access
=============
-This is the source code for early-access 3310.
+This is the source code for early-access 3311.
## Legal Notice
diff --git a/dist/yuzu.ico b/dist/yuzu.ico
index 7c998a5c5..df3be8464 100755
Binary files a/dist/yuzu.ico and b/dist/yuzu.ico differ
diff --git a/dist/yuzu.svg b/dist/yuzu.svg
index 98ded2d8f..93171d1bf 100755
--- a/dist/yuzu.svg
+++ b/dist/yuzu.svg
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/src/common/input.h b/src/common/input.h
index 1f9db5af2..23da5efe3 100755
--- a/src/common/input.h
+++ b/src/common/input.h
@@ -51,8 +51,6 @@ enum class PollingMode {
NFC,
// Enable infrared camera polling
IR,
- // Enable ring controller polling
- Ring,
};
enum class CameraFormat {
@@ -64,22 +62,21 @@ enum class CameraFormat {
None,
};
-// Different results that can happen from a device request
-enum class DriverResult {
- Success,
- WrongReply,
- Timeout,
- UnsupportedControllerType,
- HandleInUse,
- ErrorReadingData,
- ErrorWritingData,
- NoDeviceDetected,
- InvalidHandle,
+// Vibration reply from the controller
+enum class VibrationError {
+ None,
NotSupported,
Disabled,
Unknown,
};
+// Polling mode reply from the controller
+enum class PollingError {
+ None,
+ NotSupported,
+ Unknown,
+};
+
// Nfc reply from the controller
enum class NfcState {
Success,
@@ -93,6 +90,13 @@ enum class NfcState {
Unknown,
};
+// Ir camera reply from the controller
+enum class CameraError {
+ None,
+ NotSupported,
+ Unknown,
+};
+
// Hint for amplification curve to be used
enum class VibrationAmplificationType {
Linear,
@@ -186,8 +190,6 @@ struct TouchStatus {
struct BodyColorStatus {
u32 body{};
u32 buttons{};
- u32 left_grip{};
- u32 right_grip{};
};
// HD rumble data
@@ -226,31 +228,17 @@ enum class ButtonNames {
Engine,
// This will display the button by value instead of the button name
Value,
-
- // Joycon button names
ButtonLeft,
ButtonRight,
ButtonDown,
ButtonUp,
+ TriggerZ,
+ TriggerR,
+ TriggerL,
ButtonA,
ButtonB,
ButtonX,
ButtonY,
- ButtonPlus,
- ButtonMinus,
- ButtonHome,
- ButtonCapture,
- ButtonStickL,
- ButtonStickR,
- TriggerL,
- TriggerZL,
- TriggerSL,
- TriggerR,
- TriggerZR,
- TriggerSR,
-
- // GC button names
- TriggerZ,
ButtonStart,
// DS4 button names
@@ -328,24 +316,22 @@ class OutputDevice {
public:
virtual ~OutputDevice() = default;
- virtual DriverResult SetLED([[maybe_unused]] const LedStatus& led_status) {
- return DriverResult::NotSupported;
- }
+ virtual void SetLED([[maybe_unused]] const LedStatus& led_status) {}
- virtual DriverResult SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) {
- return DriverResult::NotSupported;
+ virtual VibrationError SetVibration([[maybe_unused]] const VibrationStatus& vibration_status) {
+ return VibrationError::NotSupported;
}
virtual bool IsVibrationEnabled() {
return false;
}
- virtual DriverResult SetPollingMode([[maybe_unused]] PollingMode polling_mode) {
- return DriverResult::NotSupported;
+ virtual PollingError SetPollingMode([[maybe_unused]] PollingMode polling_mode) {
+ return PollingError::NotSupported;
}
- virtual DriverResult SetCameraFormat([[maybe_unused]] CameraFormat camera_format) {
- return DriverResult::NotSupported;
+ virtual CameraError SetCameraFormat([[maybe_unused]] CameraFormat camera_format) {
+ return CameraError::NotSupported;
}
virtual NfcState SupportsNfc() const {
diff --git a/src/common/settings.h b/src/common/settings.h
index 3958298ef..98fa5e631 100755
--- a/src/common/settings.h
+++ b/src/common/settings.h
@@ -483,7 +483,6 @@ struct Values {
Setting enable_raw_input{false, "enable_raw_input"};
Setting controller_navigation{true, "controller_navigation"};
- Setting enable_joycon_driver{true, "enable_joycon_driver"};
SwitchableSetting vibration_enabled{true, "vibration_enabled"};
SwitchableSetting enable_accurate_vibrations{false, "enable_accurate_vibrations"};
diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp
index b9e897f3b..b847fd4d9 100755
--- a/src/common/string_util.cpp
+++ b/src/common/string_util.cpp
@@ -30,7 +30,7 @@ std::string ToUpper(std::string str) {
return str;
}
-std::string StringFromBuffer(std::span data) {
+std::string StringFromBuffer(const std::vector& data) {
return std::string(data.begin(), std::find(data.begin(), data.end(), '\0'));
}
diff --git a/src/common/string_util.h b/src/common/string_util.h
index e03bde0a5..2ba7cadb9 100755
--- a/src/common/string_util.h
+++ b/src/common/string_util.h
@@ -5,7 +5,6 @@
#pragma once
#include
-#include
#include
#include
#include "common/common_types.h"
@@ -18,7 +17,7 @@ namespace Common {
/// Make a string uppercase
[[nodiscard]] std::string ToUpper(std::string str);
-[[nodiscard]] std::string StringFromBuffer(std::span data);
+[[nodiscard]] std::string StringFromBuffer(const std::vector& data);
[[nodiscard]] std::string StripSpaces(const std::string& s);
[[nodiscard]] std::string StripQuotes(const std::string& s);
diff --git a/src/core/hid/emulated_controller.cpp b/src/core/hid/emulated_controller.cpp
index 0122a815c..ca833f55e 100755
--- a/src/core/hid/emulated_controller.cpp
+++ b/src/core/hid/emulated_controller.cpp
@@ -93,7 +93,6 @@ void EmulatedController::ReloadFromSettings() {
motion_params[index] = Common::ParamPackage(player.motions[index]);
}
- controller.color_values = {};
controller.colors_state.fullkey = {
.body = GetNpadColor(player.body_color_left),
.button = GetNpadColor(player.button_color_left),
@@ -107,8 +106,6 @@ void EmulatedController::ReloadFromSettings() {
.button = GetNpadColor(player.button_color_right),
};
- ring_params[0] = Common::ParamPackage(Settings::values.ringcon_analogs);
-
// Other or debug controller should always be a pro controller
if (npad_id_type != NpadIdType::Other) {
SetNpadStyleIndex(MapSettingsTypeToNPad(player.controller_type));
@@ -135,28 +132,18 @@ void EmulatedController::LoadDevices() {
trigger_params[LeftIndex] = button_params[Settings::NativeButton::ZL];
trigger_params[RightIndex] = button_params[Settings::NativeButton::ZR];
- color_params[LeftIndex] = left_joycon;
- color_params[RightIndex] = right_joycon;
- color_params[LeftIndex].Set("color", true);
- color_params[RightIndex].Set("color", true);
-
battery_params[LeftIndex] = left_joycon;
battery_params[RightIndex] = right_joycon;
battery_params[LeftIndex].Set("battery", true);
battery_params[RightIndex].Set("battery", true);
- camera_params[0] = right_joycon;
- camera_params[0].Set("camera", true);
- camera_params[1] = Common::ParamPackage{"engine:camera,camera:1"};
- ring_params[1] = Common::ParamPackage{"engine:joycon,axis_x:100,axis_y:101"};
- nfc_params[0] = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"};
- nfc_params[1] = right_joycon;
- nfc_params[1].Set("nfc", true);
+ camera_params = Common::ParamPackage{"engine:camera,camera:1"};
+ nfc_params = Common::ParamPackage{"engine:virtual_amiibo,nfc:1"};
output_params[LeftIndex] = left_joycon;
output_params[RightIndex] = right_joycon;
- output_params[2] = camera_params[1];
- output_params[3] = nfc_params[0];
+ output_params[2] = camera_params;
+ output_params[3] = nfc_params;
output_params[LeftIndex].Set("output", true);
output_params[RightIndex].Set("output", true);
output_params[2].Set("output", true);
@@ -172,11 +159,8 @@ void EmulatedController::LoadDevices() {
Common::Input::CreateInputDevice);
std::ranges::transform(battery_params, battery_devices.begin(),
Common::Input::CreateInputDevice);
- std::ranges::transform(color_params, color_devices.begin(), Common::Input::CreateInputDevice);
- std::ranges::transform(camera_params, camera_devices.begin(), Common::Input::CreateInputDevice);
- std::ranges::transform(ring_params, ring_analog_devices.begin(),
- Common::Input::CreateInputDevice);
- std::ranges::transform(nfc_params, nfc_devices.begin(), Common::Input::CreateInputDevice);
+ camera_devices = Common::Input::CreateInputDevice(camera_params);
+ nfc_devices = Common::Input::CreateInputDevice(nfc_params);
std::ranges::transform(output_params, output_devices.begin(),
Common::Input::CreateOutputDevice);
@@ -338,19 +322,6 @@ void EmulatedController::ReloadInput() {
battery_devices[index]->ForceUpdate();
}
- for (std::size_t index = 0; index < color_devices.size(); ++index) {
- if (!color_devices[index]) {
- continue;
- }
- color_devices[index]->SetCallback({
- .on_change =
- [this, index](const Common::Input::CallbackStatus& callback) {
- SetColors(callback, index);
- },
- });
- color_devices[index]->ForceUpdate();
- }
-
for (std::size_t index = 0; index < motion_devices.size(); ++index) {
if (!motion_devices[index]) {
continue;
@@ -364,37 +335,22 @@ void EmulatedController::ReloadInput() {
motion_devices[index]->ForceUpdate();
}
- for (std::size_t index = 0; index < camera_devices.size(); ++index) {
- if (!camera_devices[index]) {
- continue;
- }
- camera_devices[index]->SetCallback({
+ if (camera_devices) {
+ camera_devices->SetCallback({
.on_change =
[this](const Common::Input::CallbackStatus& callback) { SetCamera(callback); },
});
- camera_devices[index]->ForceUpdate();
+ camera_devices->ForceUpdate();
}
- for (std::size_t index = 0; index < ring_analog_devices.size(); ++index) {
- if (!ring_analog_devices[index]) {
- continue;
+ if (nfc_devices) {
+ if (npad_id_type == NpadIdType::Handheld || npad_id_type == NpadIdType::Player1) {
+ nfc_devices->SetCallback({
+ .on_change =
+ [this](const Common::Input::CallbackStatus& callback) { SetNfc(callback); },
+ });
+ nfc_devices->ForceUpdate();
}
- ring_analog_devices[index]->SetCallback({
- .on_change =
- [this](const Common::Input::CallbackStatus& callback) { SetRingAnalog(callback); },
- });
- ring_analog_devices[index]->ForceUpdate();
- }
-
- for (std::size_t index = 0; index < nfc_devices.size(); ++index) {
- if (!nfc_devices[index]) {
- continue;
- }
- nfc_devices[index]->SetCallback({
- .on_change =
- [this](const Common::Input::CallbackStatus& callback) { SetNfc(callback); },
- });
- nfc_devices[index]->ForceUpdate();
}
// Register TAS devices. No need to force update
@@ -464,9 +420,6 @@ void EmulatedController::UnloadInput() {
for (auto& battery : battery_devices) {
battery.reset();
}
- for (auto& color : color_devices) {
- color.reset();
- }
for (auto& output : output_devices) {
output.reset();
}
@@ -482,15 +435,8 @@ void EmulatedController::UnloadInput() {
for (auto& stick : virtual_stick_devices) {
stick.reset();
}
- for (auto& camera : camera_devices) {
- camera.reset();
- }
- for (auto& ring : ring_analog_devices) {
- ring.reset();
- }
- for (auto& nfc : nfc_devices) {
- nfc.reset();
- }
+ camera_devices.reset();
+ nfc_devices.reset();
}
void EmulatedController::EnableConfiguration() {
@@ -502,11 +448,6 @@ void EmulatedController::EnableConfiguration() {
void EmulatedController::DisableConfiguration() {
is_configuring = false;
- // Get Joycon colors before turning on the controller
- for (const auto& color_device : color_devices) {
- color_device->ForceUpdate();
- }
-
// Apply temporary npad type to the real controller
if (tmp_npad_type != npad_type) {
if (is_connected) {
@@ -560,9 +501,6 @@ void EmulatedController::SaveCurrentConfig() {
for (std::size_t index = 0; index < player.motions.size(); ++index) {
player.motions[index] = motion_params[index].Serialize();
}
- if (npad_id_type == NpadIdType::Player1) {
- Settings::values.ringcon_analogs = ring_params[0].Serialize();
- }
}
void EmulatedController::RestoreConfig() {
@@ -977,58 +915,6 @@ void EmulatedController::SetMotion(const Common::Input::CallbackStatus& callback
TriggerOnChange(ControllerTriggerType::Motion, true);
}
-void EmulatedController::SetColors(const Common::Input::CallbackStatus& callback,
- std::size_t index) {
- if (index >= controller.color_values.size()) {
- return;
- }
- std::unique_lock lock{mutex};
- controller.color_values[index] = TransformToColor(callback);
-
- if (is_configuring) {
- lock.unlock();
- TriggerOnChange(ControllerTriggerType::Color, false);
- return;
- }
-
- if (controller.color_values[index].body == 0) {
- return;
- }
-
- controller.colors_state.fullkey = {
- .body = GetNpadColor(controller.color_values[index].body),
- .button = GetNpadColor(controller.color_values[index].buttons),
- };
- if (npad_type == NpadStyleIndex::ProController) {
- controller.colors_state.left = {
- .body = GetNpadColor(controller.color_values[index].left_grip),
- .button = GetNpadColor(controller.color_values[index].buttons),
- };
- controller.colors_state.right = {
- .body = GetNpadColor(controller.color_values[index].right_grip),
- .button = GetNpadColor(controller.color_values[index].buttons),
- };
- } else {
- switch (index) {
- case LeftIndex:
- controller.colors_state.left = {
- .body = GetNpadColor(controller.color_values[index].body),
- .button = GetNpadColor(controller.color_values[index].buttons),
- };
- break;
- case RightIndex:
- controller.colors_state.right = {
- .body = GetNpadColor(controller.color_values[index].body),
- .button = GetNpadColor(controller.color_values[index].buttons),
- };
- break;
- }
- }
-
- lock.unlock();
- TriggerOnChange(ControllerTriggerType::Color, true);
-}
-
void EmulatedController::SetBattery(const Common::Input::CallbackStatus& callback,
std::size_t index) {
if (index >= controller.battery_values.size()) {
@@ -1119,24 +1005,6 @@ void EmulatedController::SetCamera(const Common::Input::CallbackStatus& callback
TriggerOnChange(ControllerTriggerType::IrSensor, true);
}
-void EmulatedController::SetRingAnalog(const Common::Input::CallbackStatus& callback) {
- std::unique_lock lock{mutex};
- const auto force_value = TransformToStick(callback);
-
- controller.ring_analog_value = force_value.x;
-
- if (is_configuring) {
- lock.unlock();
- TriggerOnChange(ControllerTriggerType::RingController, false);
- return;
- }
-
- controller.ring_analog_state.force = force_value.x.value;
-
- lock.unlock();
- TriggerOnChange(ControllerTriggerType::RingController, true);
-}
-
void EmulatedController::SetNfc(const Common::Input::CallbackStatus& callback) {
std::unique_lock lock{mutex};
controller.nfc_values = TransformToNfc(callback);
@@ -1185,7 +1053,7 @@ bool EmulatedController::SetVibration(std::size_t device_index, VibrationValue v
.type = type,
};
return output_devices[device_index]->SetVibration(status) ==
- Common::Input::DriverResult::Success;
+ Common::Input::VibrationError::None;
}
bool EmulatedController::IsVibrationEnabled(std::size_t device_index) {
@@ -1207,32 +1075,16 @@ bool EmulatedController::IsVibrationEnabled(std::size_t device_index) {
return output_devices[device_index]->IsVibrationEnabled();
}
-Common::Input::DriverResult EmulatedController::SetPollingMode(
- EmulatedDeviceIndex device_index, Common::Input::PollingMode polling_mode) {
- LOG_INFO(Service_HID, "Set polling mode {}, device_index={}", polling_mode, device_index);
-
- auto& left_output_device = output_devices[static_cast(DeviceIndex::Left)];
- auto& right_output_device = output_devices[static_cast(DeviceIndex::Right)];
+bool EmulatedController::SetPollingMode(Common::Input::PollingMode polling_mode) {
+ LOG_INFO(Service_HID, "Set polling mode {}", polling_mode);
+ auto& output_device = output_devices[static_cast(DeviceIndex::Right)];
auto& nfc_output_device = output_devices[3];
- if (device_index == EmulatedDeviceIndex::LeftIndex) {
- return left_output_device->SetPollingMode(polling_mode);
- }
+ const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode);
+ const auto mapped_nfc_result = output_device->SetPollingMode(polling_mode);
- if (device_index == EmulatedDeviceIndex::RightIndex) {
- const auto virtual_nfc_result = nfc_output_device->SetPollingMode(polling_mode);
- const auto mapped_nfc_result = right_output_device->SetPollingMode(polling_mode);
-
- if (virtual_nfc_result == Common::Input::DriverResult::Success) {
- return virtual_nfc_result;
- }
- return mapped_nfc_result;
- }
-
- left_output_device->SetPollingMode(polling_mode);
- right_output_device->SetPollingMode(polling_mode);
- nfc_output_device->SetPollingMode(polling_mode);
- return Common::Input::DriverResult::Success;
+ return virtual_nfc_result == Common::Input::PollingError::None ||
+ mapped_nfc_result == Common::Input::PollingError::None;
}
bool EmulatedController::SetCameraFormat(
@@ -1243,22 +1095,13 @@ bool EmulatedController::SetCameraFormat(
auto& camera_output_device = output_devices[2];
if (right_output_device->SetCameraFormat(static_cast(
- camera_format)) == Common::Input::DriverResult::Success) {
+ camera_format)) == Common::Input::CameraError::None) {
return true;
}
// Fallback to Qt camera if native device doesn't have support
return camera_output_device->SetCameraFormat(static_cast(
- camera_format)) == Common::Input::DriverResult::Success;
-}
-
-Common::ParamPackage EmulatedController::GetRingParam() const {
- return ring_params[0];
-}
-
-void EmulatedController::SetRingParam(Common::ParamPackage param) {
- ring_params[0] = std::move(param);
- ReloadInput();
+ camera_format)) == Common::Input::CameraError::None;
}
bool EmulatedController::HasNfc() const {
@@ -1552,10 +1395,6 @@ CameraValues EmulatedController::GetCameraValues() const {
return controller.camera_values;
}
-RingAnalogValue EmulatedController::GetRingSensorValues() const {
- return controller.ring_analog_value;
-}
-
HomeButtonState EmulatedController::GetHomeButtons() const {
std::scoped_lock lock{mutex};
if (is_configuring) {
@@ -1639,10 +1478,6 @@ const CameraState& EmulatedController::GetCamera() const {
return controller.camera_state;
}
-RingSensorForce EmulatedController::GetRingSensorForce() const {
- return controller.ring_analog_state;
-}
-
const NfcState& EmulatedController::GetNfc() const {
std::scoped_lock lock{mutex};
return controller.nfc_state;
diff --git a/src/core/hid/emulated_controller.h b/src/core/hid/emulated_controller.h
index dd97bb817..883e84115 100755
--- a/src/core/hid/emulated_controller.h
+++ b/src/core/hid/emulated_controller.h
@@ -35,27 +35,19 @@ using ControllerMotionDevices =
std::array, Settings::NativeMotion::NumMotions>;
using TriggerDevices =
std::array, Settings::NativeTrigger::NumTriggers>;
-using ColorDevices =
- std::array, max_emulated_controllers>;
using BatteryDevices =
std::array, max_emulated_controllers>;
-using CameraDevices =
- std::array, max_emulated_controllers>;
-using RingAnalogDevices =
- std::array, max_emulated_controllers>;
-using NfcDevices =
- std::array, max_emulated_controllers>;
+using CameraDevices = std::unique_ptr;
+using NfcDevices = std::unique_ptr;
using OutputDevices = std::array, output_devices_size>;
using ButtonParams = std::array;
using StickParams = std::array;
using ControllerMotionParams = std::array;
using TriggerParams = std::array;
-using ColorParams = std::array;
using BatteryParams = std::array;
-using CameraParams = std::array;
-using RingAnalogParams = std::array;
-using NfcParams = std::array;
+using CameraParams = Common::ParamPackage;
+using NfcParams = Common::ParamPackage;
using OutputParams = std::array;
using ButtonValues = std::array;
@@ -66,7 +58,6 @@ using ControllerMotionValues = std::array;
using BatteryValues = std::array;
using CameraValues = Common::Input::CameraStatus;
-using RingAnalogValue = Common::Input::AnalogStatus;
using NfcValues = Common::Input::NfcStatus;
using VibrationValues = std::array;
@@ -93,10 +84,6 @@ struct CameraState {
std::size_t sample{};
};
-struct RingSensorForce {
- f32 force;
-};
-
struct NfcState {
Common::Input::NfcState state{};
std::vector data{};
@@ -129,7 +116,6 @@ struct ControllerStatus {
BatteryValues battery_values{};
VibrationValues vibration_values{};
CameraValues camera_values{};
- RingAnalogValue ring_analog_value{};
NfcValues nfc_values{};
// Data for HID serices
@@ -143,7 +129,6 @@ struct ControllerStatus {
ControllerColors colors_state{};
BatteryLevelState battery_state{};
CameraState camera_state{};
- RingSensorForce ring_analog_state{};
NfcState nfc_state{};
};
@@ -156,7 +141,6 @@ enum class ControllerTriggerType {
Battery,
Vibration,
IrSensor,
- RingController,
Nfc,
Connected,
Disconnected,
@@ -310,9 +294,6 @@ public:
/// Returns the latest camera status from the controller with parameters
CameraValues GetCameraValues() const;
- /// Returns the latest status of analog input from the ring sensor with parameters
- RingAnalogValue GetRingSensorValues() const;
-
/// Returns the latest status of button input for the hid::HomeButton service
HomeButtonState GetHomeButtons() const;
@@ -343,9 +324,6 @@ public:
/// Returns the latest camera status from the controller
const CameraState& GetCamera() const;
- /// Returns the latest ringcon force sensor value
- RingSensorForce GetRingSensorForce() const;
-
/// Returns the latest ntag status from the controller
const NfcState& GetNfc() const;
@@ -363,12 +341,10 @@ public:
/**
* Sets the desired data to be polled from a controller
- * @param device_index index of the controller to set the polling mode
* @param polling_mode type of input desired buttons, gyro, nfc, ir, etc.
- * @return driver result from this command
+ * @return true if SetPollingMode was successfull
*/
- Common::Input::DriverResult SetPollingMode(EmulatedDeviceIndex device_index,
- Common::Input::PollingMode polling_mode);
+ bool SetPollingMode(Common::Input::PollingMode polling_mode);
/**
* Sets the desired camera format to be polled from a controller
@@ -377,15 +353,6 @@ public:
*/
bool SetCameraFormat(Core::IrSensor::ImageTransferProcessorFormat camera_format);
- // Returns the current mapped ring device
- Common::ParamPackage GetRingParam() const;
-
- /**
- * Updates the current mapped ring device
- * @param param ParamPackage with ring sensor data to be mapped
- */
- void SetRingParam(Common::ParamPackage param);
-
/// Returns true if the device has nfc support
bool HasNfc() const;
@@ -465,17 +432,10 @@ private:
*/
void SetMotion(const Common::Input::CallbackStatus& callback, std::size_t index);
- /**
- * Updates the color status of the controller
- * @param callback A CallbackStatus containing the color status
- * @param index color ID of the to be updated
- */
- void SetColors(const Common::Input::CallbackStatus& callback, std::size_t index);
-
/**
* Updates the battery status of the controller
* @param callback A CallbackStatus containing the battery status
- * @param index battery ID of the to be updated
+ * @param index Button ID of the to be updated
*/
void SetBattery(const Common::Input::CallbackStatus& callback, std::size_t index);
@@ -485,12 +445,6 @@ private:
*/
void SetCamera(const Common::Input::CallbackStatus& callback);
- /**
- * Updates the ring analog sensor status of the ring controller
- * @param callback A CallbackStatus containing the force status
- */
- void SetRingAnalog(const Common::Input::CallbackStatus& callback);
-
/**
* Updates the nfc status of the controller
* @param callback A CallbackStatus containing the nfc status
@@ -530,9 +484,7 @@ private:
ControllerMotionParams motion_params;
TriggerParams trigger_params;
BatteryParams battery_params;
- ColorParams color_params;
CameraParams camera_params;
- RingAnalogParams ring_params;
NfcParams nfc_params;
OutputParams output_params;
@@ -541,9 +493,7 @@ private:
ControllerMotionDevices motion_devices;
TriggerDevices trigger_devices;
BatteryDevices battery_devices;
- ColorDevices color_devices;
CameraDevices camera_devices;
- RingAnalogDevices ring_analog_devices;
NfcDevices nfc_devices;
OutputDevices output_devices;
diff --git a/src/core/hid/emulated_devices.cpp b/src/core/hid/emulated_devices.cpp
index 50994a249..6c9cdcb31 100755
--- a/src/core/hid/emulated_devices.cpp
+++ b/src/core/hid/emulated_devices.cpp
@@ -14,6 +14,7 @@ EmulatedDevices::EmulatedDevices() = default;
EmulatedDevices::~EmulatedDevices() = default;
void EmulatedDevices::ReloadFromSettings() {
+ ring_params = Common::ParamPackage(Settings::values.ringcon_analogs);
ReloadInput();
}
@@ -65,6 +66,8 @@ void EmulatedDevices::ReloadInput() {
key_index++;
}
+ ring_analog_device = Common::Input::CreateInputDevice(ring_params);
+
for (std::size_t index = 0; index < mouse_button_devices.size(); ++index) {
if (!mouse_button_devices[index]) {
continue;
@@ -119,6 +122,13 @@ void EmulatedDevices::ReloadInput() {
},
});
}
+
+ if (ring_analog_device) {
+ ring_analog_device->SetCallback({
+ .on_change =
+ [this](const Common::Input::CallbackStatus& callback) { SetRingAnalog(callback); },
+ });
+ }
}
void EmulatedDevices::UnloadInput() {
@@ -135,6 +145,7 @@ void EmulatedDevices::UnloadInput() {
for (auto& button : keyboard_modifier_devices) {
button.reset();
}
+ ring_analog_device.reset();
}
void EmulatedDevices::EnableConfiguration() {
@@ -154,6 +165,7 @@ void EmulatedDevices::SaveCurrentConfig() {
if (!is_configuring) {
return;
}
+ Settings::values.ringcon_analogs = ring_params.Serialize();
}
void EmulatedDevices::RestoreConfig() {
@@ -163,6 +175,15 @@ void EmulatedDevices::RestoreConfig() {
ReloadFromSettings();
}
+Common::ParamPackage EmulatedDevices::GetRingParam() const {
+ return ring_params;
+}
+
+void EmulatedDevices::SetRingParam(Common::ParamPackage param) {
+ ring_params = std::move(param);
+ ReloadInput();
+}
+
void EmulatedDevices::SetKeyboardButton(const Common::Input::CallbackStatus& callback,
std::size_t index) {
if (index >= device_status.keyboard_values.size()) {
@@ -409,6 +430,23 @@ void EmulatedDevices::SetMouseStick(const Common::Input::CallbackStatus& callbac
TriggerOnChange(DeviceTriggerType::Mouse);
}
+void EmulatedDevices::SetRingAnalog(const Common::Input::CallbackStatus& callback) {
+ std::lock_guard lock{mutex};
+ const auto force_value = TransformToStick(callback);
+
+ device_status.ring_analog_value = force_value.x;
+
+ if (is_configuring) {
+ device_status.ring_analog_value = {};
+ TriggerOnChange(DeviceTriggerType::RingController);
+ return;
+ }
+
+ device_status.ring_analog_state.force = force_value.x.value;
+
+ TriggerOnChange(DeviceTriggerType::RingController);
+}
+
KeyboardValues EmulatedDevices::GetKeyboardValues() const {
std::scoped_lock lock{mutex};
return device_status.keyboard_values;
@@ -424,6 +462,10 @@ MouseButtonValues EmulatedDevices::GetMouseButtonsValues() const {
return device_status.mouse_button_values;
}
+RingAnalogValue EmulatedDevices::GetRingSensorValues() const {
+ return device_status.ring_analog_value;
+}
+
KeyboardKey EmulatedDevices::GetKeyboard() const {
std::scoped_lock lock{mutex};
return device_status.keyboard_state;
@@ -449,6 +491,10 @@ AnalogStickState EmulatedDevices::GetMouseWheel() const {
return device_status.mouse_wheel_state;
}
+RingSensorForce EmulatedDevices::GetRingSensorForce() const {
+ return device_status.ring_analog_state;
+}
+
void EmulatedDevices::TriggerOnChange(DeviceTriggerType type) {
std::scoped_lock lock{callback_mutex};
for (const auto& poller_pair : callback_list) {
diff --git a/src/core/hid/emulated_devices.h b/src/core/hid/emulated_devices.h
index 850c6c622..8e776b707 100755
--- a/src/core/hid/emulated_devices.h
+++ b/src/core/hid/emulated_devices.h
@@ -26,9 +26,11 @@ using MouseButtonDevices = std::array,
Settings::NativeMouseWheel::NumMouseWheels>;
using MouseStickDevice = std::unique_ptr;
+using RingAnalogDevice = std::unique_ptr;
using MouseButtonParams =
std::array;
+using RingAnalogParams = Common::ParamPackage;
using KeyboardValues =
std::array;
@@ -39,12 +41,17 @@ using MouseButtonValues =
using MouseAnalogValues =
std::array;
using MouseStickValue = Common::Input::TouchStatus;
+using RingAnalogValue = Common::Input::AnalogStatus;
struct MousePosition {
f32 x;
f32 y;
};
+struct RingSensorForce {
+ f32 force;
+};
+
struct DeviceStatus {
// Data from input_common
KeyboardValues keyboard_values{};
@@ -52,6 +59,7 @@ struct DeviceStatus {
MouseButtonValues mouse_button_values{};
MouseAnalogValues mouse_analog_values{};
MouseStickValue mouse_stick_value{};
+ RingAnalogValue ring_analog_value{};
// Data for HID serices
KeyboardKey keyboard_state{};
@@ -59,6 +67,7 @@ struct DeviceStatus {
MouseButton mouse_button_state{};
MousePosition mouse_position_state{};
AnalogStickState mouse_wheel_state{};
+ RingSensorForce ring_analog_state{};
};
enum class DeviceTriggerType {
@@ -129,6 +138,9 @@ public:
/// Returns the latest status of button input from the mouse with parameters
MouseButtonValues GetMouseButtonsValues() const;
+ /// Returns the latest status of analog input from the ring sensor with parameters
+ RingAnalogValue GetRingSensorValues() const;
+
/// Returns the latest status of button input from the keyboard
KeyboardKey GetKeyboard() const;
@@ -144,6 +156,9 @@ public:
/// Returns the latest mouse wheel change
AnalogStickState GetMouseWheel() const;
+ /// Returns the latest ringcon force sensor value
+ RingSensorForce GetRingSensorForce() const;
+
/**
* Adds a callback to the list of events
* @param update_callback InterfaceUpdateCallback that will be triggered
@@ -209,11 +224,14 @@ private:
bool is_configuring{false};
+ RingAnalogParams ring_params;
+
KeyboardDevices keyboard_devices;
KeyboardModifierDevices keyboard_modifier_devices;
MouseButtonDevices mouse_button_devices;
MouseAnalogDevices mouse_analog_devices;
MouseStickDevice mouse_stick_device;
+ RingAnalogDevice ring_analog_device;
mutable std::mutex mutex;
mutable std::mutex callback_mutex;
diff --git a/src/core/hid/input_converter.cpp b/src/core/hid/input_converter.cpp
index 13df8788a..64d0c72ce 100755
--- a/src/core/hid/input_converter.cpp
+++ b/src/core/hid/input_converter.cpp
@@ -304,18 +304,6 @@ Common::Input::NfcStatus TransformToNfc(const Common::Input::CallbackStatus& cal
return nfc;
}
-Common::Input::BodyColorStatus TransformToColor(const Common::Input::CallbackStatus& callback) {
- switch (callback.type) {
- case Common::Input::InputType::Color:
- return callback.color_status;
- break;
- default:
- LOG_ERROR(Input, "Conversion from type {} to color not implemented", callback.type);
- return {};
- break;
- }
-}
-
void SanitizeAnalog(Common::Input::AnalogStatus& analog, bool clamp_value) {
const auto& properties = analog.properties;
float& raw_value = analog.raw_value;
diff --git a/src/core/hid/input_converter.h b/src/core/hid/input_converter.h
index 5750d1a12..e0b0e72b9 100755
--- a/src/core/hid/input_converter.h
+++ b/src/core/hid/input_converter.h
@@ -88,18 +88,10 @@ Common::Input::CameraStatus TransformToCamera(const Common::Input::CallbackStatu
* Converts raw input data into a valid nfc status.
*
* @param callback Supported callbacks: Nfc.
- * @return A valid data tag vector.
+ * @return A valid CameraObject object.
*/
Common::Input::NfcStatus TransformToNfc(const Common::Input::CallbackStatus& callback);
-/**
- * Converts raw input data into a valid color status.
- *
- * @param callback Supported callbacks: Color.
- * @return A valid Color object.
- */
-Common::Input::BodyColorStatus TransformToColor(const Common::Input::CallbackStatus& callback);
-
/**
* Converts raw analog data into a valid analog value
* @param analog An analog object containing raw data and properties
diff --git a/src/core/hle/kernel/hle_ipc.cpp b/src/core/hle/kernel/hle_ipc.cpp
index 20c051364..b2879a24d 100755
--- a/src/core/hle/kernel/hle_ipc.cpp
+++ b/src/core/hle/kernel/hle_ipc.cpp
@@ -11,7 +11,6 @@
#include "common/common_funcs.h"
#include "common/common_types.h"
#include "common/logging/log.h"
-#include "common/scratch_buffer.h"
#include "core/hle/ipc_helpers.h"
#include "core/hle/kernel/hle_ipc.h"
#include "core/hle/kernel/k_auto_object.h"
@@ -326,7 +325,7 @@ Result HLERequestContext::WriteToOutgoingCommandBuffer(KThread& requesting_threa
return ResultSuccess;
}
-std::vector HLERequestContext::ReadBufferCopy(std::size_t buffer_index) const {
+std::vector HLERequestContext::ReadBuffer(std::size_t buffer_index) const {
const bool is_buffer_a{BufferDescriptorA().size() > buffer_index &&
BufferDescriptorA()[buffer_index].Size()};
if (is_buffer_a) {
@@ -346,33 +345,6 @@ std::vector HLERequestContext::ReadBufferCopy(std::size_t buffer_index) cons
}
}
-std::span HLERequestContext::ReadBuffer(std::size_t buffer_index) const {
- static thread_local std::array, 2> read_buffer_a;
- static thread_local std::array, 2> read_buffer_x;
-
- const bool is_buffer_a{BufferDescriptorA().size() > buffer_index &&
- BufferDescriptorA()[buffer_index].Size()};
- if (is_buffer_a) {
- ASSERT_OR_EXECUTE_MSG(
- BufferDescriptorA().size() > buffer_index, { return {}; },
- "BufferDescriptorA invalid buffer_index {}", buffer_index);
- auto& read_buffer = read_buffer_a[buffer_index];
- read_buffer.resize_destructive(BufferDescriptorA()[buffer_index].Size());
- memory.ReadBlock(BufferDescriptorA()[buffer_index].Address(), read_buffer.data(),
- read_buffer.size());
- return read_buffer;
- } else {
- ASSERT_OR_EXECUTE_MSG(
- BufferDescriptorX().size() > buffer_index, { return {}; },
- "BufferDescriptorX invalid buffer_index {}", buffer_index);
- auto& read_buffer = read_buffer_x[buffer_index];
- read_buffer.resize_destructive(BufferDescriptorX()[buffer_index].Size());
- memory.ReadBlock(BufferDescriptorX()[buffer_index].Address(), read_buffer.data(),
- read_buffer.size());
- return read_buffer;
- }
-}
-
std::size_t HLERequestContext::WriteBuffer(const void* buffer, std::size_t size,
std::size_t buffer_index) const {
if (size == 0) {
diff --git a/src/core/hle/kernel/hle_ipc.h b/src/core/hle/kernel/hle_ipc.h
index 8eeeee4e1..1715c0924 100755
--- a/src/core/hle/kernel/hle_ipc.h
+++ b/src/core/hle/kernel/hle_ipc.h
@@ -7,7 +7,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -271,11 +270,8 @@ public:
return domain_message_header.has_value();
}
- /// Helper function to get a span of a buffer using the appropriate buffer descriptor
- [[nodiscard]] std::span ReadBuffer(std::size_t buffer_index = 0) const;
-
- /// Helper function to read a copy of a buffer using the appropriate buffer descriptor
- [[nodiscard]] std::vector ReadBufferCopy(std::size_t buffer_index = 0) const;
+ /// Helper function to read a buffer using the appropriate buffer descriptor
+ [[nodiscard]] std::vector ReadBuffer(std::size_t buffer_index = 0) const;
/// Helper function to write a buffer using the appropriate buffer descriptor
std::size_t WriteBuffer(const void* buffer, std::size_t size,
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp
index d6f46e3c5..294e7692b 100755
--- a/src/core/hle/service/am/am.cpp
+++ b/src/core/hle/service/am/am.cpp
@@ -1124,7 +1124,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const u64 offset{rp.Pop()};
- const auto data{ctx.ReadBuffer()};
+ const std::vector data{ctx.ReadBuffer()};
const std::size_t size{std::min(data.size(), backing.GetSize() - offset)};
LOG_DEBUG(Service_AM, "called, offset={}, size={}", offset, size);
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp
index a0d67412e..539240842 100755
--- a/src/core/hle/service/audio/audren_u.cpp
+++ b/src/core/hle/service/audio/audren_u.cpp
@@ -112,7 +112,7 @@ private:
void RequestUpdate(Kernel::HLERequestContext& ctx) {
LOG_TRACE(Service_Audio, "called");
- const auto input{ctx.ReadBuffer(0)};
+ std::vector input{ctx.ReadBuffer(0)};
// These buffers are written manually to avoid an issue with WriteBuffer throwing errors for
// checking size 0. Performance size is 0 for most games.
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp
index 5953f1c4a..4508ea821 100755
--- a/src/core/hle/service/audio/hwopus.cpp
+++ b/src/core/hle/service/audio/hwopus.cpp
@@ -93,7 +93,7 @@ private:
ctx.WriteBuffer(samples);
}
- bool DecodeOpusData(u32& consumed, u32& sample_count, std::span input,
+ bool DecodeOpusData(u32& consumed, u32& sample_count, const std::vector& input,
std::vector& output, u64* out_performance_time) const {
const auto start_time = std::chrono::steady_clock::now();
const std::size_t raw_output_sz = output.size() * sizeof(opus_int16);
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 1447688b4..c62f53b3d 100755
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -122,7 +122,7 @@ private:
void ImportTicket(Kernel::HLERequestContext& ctx) {
const auto ticket = ctx.ReadBuffer();
- [[maybe_unused]] const auto cert = ctx.ReadBuffer(1);
+ const auto cert = ctx.ReadBuffer(1);
if (ticket.size() < sizeof(Core::Crypto::Ticket)) {
LOG_ERROR(Service_ETicket, "The input buffer is not large enough!");
diff --git a/src/core/hle/service/filesystem/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp_srv.cpp
index 34af9fd94..779072def 100755
--- a/src/core/hle/service/filesystem/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp_srv.cpp
@@ -190,7 +190,7 @@ private:
return;
}
- const auto data = ctx.ReadBuffer();
+ const std::vector data = ctx.ReadBuffer();
ASSERT_MSG(
static_cast(data.size()) <= length,
@@ -401,8 +401,11 @@ public:
}
void RenameFile(Kernel::HLERequestContext& ctx) {
- const std::string src_name = Common::StringFromBuffer(ctx.ReadBuffer(0));
- const std::string dst_name = Common::StringFromBuffer(ctx.ReadBuffer(1));
+ std::vector buffer = ctx.ReadBuffer(0);
+ const std::string src_name = Common::StringFromBuffer(buffer);
+
+ buffer = ctx.ReadBuffer(1);
+ const std::string dst_name = Common::StringFromBuffer(buffer);
LOG_DEBUG(Service_FS, "called. file '{}' to file '{}'", src_name, dst_name);
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp
index a33de8166..03bd04f1a 100755
--- a/src/core/hle/service/glue/arp.cpp
+++ b/src/core/hle/service/glue/arp.cpp
@@ -228,8 +228,7 @@ private:
return;
}
- // TODO: Can this be a span?
- control = ctx.ReadBufferCopy();
+ control = ctx.ReadBuffer();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ResultSuccess);
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 986370455..14a1c853b 100755
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -272,8 +272,6 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) {
}
break;
case Core::HID::NpadStyleIndex::JoyconLeft:
- shared_memory->fullkey_color.attribute = ColorAttribute::Ok;
- shared_memory->fullkey_color.fullkey = body_colors.left;
shared_memory->joycon_color.attribute = ColorAttribute::Ok;
shared_memory->joycon_color.left = body_colors.left;
shared_memory->battery_level_dual = battery_level.left.battery_level;
@@ -287,8 +285,6 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) {
shared_memory->sixaxis_left_properties.is_newly_assigned.Assign(1);
break;
case Core::HID::NpadStyleIndex::JoyconRight:
- shared_memory->fullkey_color.attribute = ColorAttribute::Ok;
- shared_memory->fullkey_color.fullkey = body_colors.right;
shared_memory->joycon_color.attribute = ColorAttribute::Ok;
shared_memory->joycon_color.right = body_colors.right;
shared_memory->battery_level_right = battery_level.right.battery_level;
@@ -336,20 +332,6 @@ void Controller_NPad::InitNewlyAddedController(Core::HID::NpadIdType npad_id) {
controller.is_connected = true;
controller.device->Connect();
- controller.device->SetLedPattern();
- if (controller_type == Core::HID::NpadStyleIndex::JoyconDual) {
- if (controller.is_dual_left_connected) {
- controller.device->SetPollingMode(Core::HID::EmulatedDeviceIndex::LeftIndex,
- Common::Input::PollingMode::Active);
- }
- if (controller.is_dual_right_connected) {
- controller.device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
- }
- } else {
- controller.device->SetPollingMode(Core::HID::EmulatedDeviceIndex::AllDevices,
- Common::Input::PollingMode::Active);
- }
SignalStyleSetChangedEvent(npad_id);
WriteEmptyEntry(controller.shared_memory);
}
@@ -755,12 +737,11 @@ Core::HID::NpadStyleTag Controller_NPad::GetSupportedStyleSet() const {
return hid_core.GetSupportedStyleTag();
}
-void Controller_NPad::SetSupportedNpadIdTypes(std::span data) {
- const auto length = data.size();
+void Controller_NPad::SetSupportedNpadIdTypes(u8* data, std::size_t length) {
ASSERT(length > 0 && (length % sizeof(u32)) == 0);
supported_npad_id_types.clear();
supported_npad_id_types.resize(length / sizeof(u32));
- std::memcpy(supported_npad_id_types.data(), data.data(), length);
+ std::memcpy(supported_npad_id_types.data(), data, length);
}
void Controller_NPad::GetSupportedNpadIdTypes(u32* data, std::size_t max_length) {
diff --git a/src/core/hle/service/hid/controllers/npad.h b/src/core/hle/service/hid/controllers/npad.h
index 968d671ac..cfcc27222 100755
--- a/src/core/hle/service/hid/controllers/npad.h
+++ b/src/core/hle/service/hid/controllers/npad.h
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
#include "common/bit_field.h"
#include "common/common_types.h"
@@ -96,7 +95,7 @@ public:
void SetSupportedStyleSet(Core::HID::NpadStyleTag style_set);
Core::HID::NpadStyleTag GetSupportedStyleSet() const;
- void SetSupportedNpadIdTypes(std::span data);
+ void SetSupportedNpadIdTypes(u8* data, std::size_t length);
void GetSupportedNpadIdTypes(u32* data, std::size_t max_length);
std::size_t GetSupportedNpadIdTypesSize() const;
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp
index 1944ae64f..224d9f86a 100755
--- a/src/core/hle/service/hid/hid.cpp
+++ b/src/core/hle/service/hid/hid.cpp
@@ -1026,7 +1026,7 @@ void Hid::SetSupportedNpadIdType(Kernel::HLERequestContext& ctx) {
const auto applet_resource_user_id{rp.Pop()};
applet_resource->GetController(HidController::NPad)
- .SetSupportedNpadIdTypes(ctx.ReadBuffer());
+ .SetSupportedNpadIdTypes(ctx.ReadBuffer().data(), ctx.GetReadBufferSize());
LOG_DEBUG(Service_HID, "called, applet_resource_user_id={}", applet_resource_user_id);
@@ -2104,7 +2104,7 @@ void Hid::WritePalmaRgbLedPatternEntry(Kernel::HLERequestContext& ctx) {
const auto connection_handle{rp.PopRaw()};
const auto unknown{rp.Pop()};
- [[maybe_unused]] const auto buffer = ctx.ReadBuffer();
+ const auto buffer = ctx.ReadBuffer();
LOG_WARNING(Service_HID, "(STUBBED) called, connection_handle={}, unknown={}",
connection_handle.npad_id, unknown);
diff --git a/src/core/hle/service/hid/hidbus.cpp b/src/core/hle/service/hid/hidbus.cpp
index 35badd632..8833f8bed 100755
--- a/src/core/hle/service/hid/hidbus.cpp
+++ b/src/core/hle/service/hid/hidbus.cpp
@@ -297,13 +297,13 @@ void HidBus::EnableExternalDevice(Kernel::HLERequestContext& ctx) {
const auto parameters{rp.PopRaw()};
- LOG_DEBUG(Service_HID,
- "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, "
- "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}",
- parameters.enable, parameters.bus_handle.abstracted_pad_id,
- parameters.bus_handle.bus_type, parameters.bus_handle.internal_index,
- parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval,
- parameters.applet_resource_user_id);
+ LOG_INFO(Service_HID,
+ "called, enable={}, abstracted_pad_id={}, bus_type={}, internal_index={}, "
+ "player_number={}, is_valid={}, inval={}, applet_resource_user_id{}",
+ parameters.enable, parameters.bus_handle.abstracted_pad_id,
+ parameters.bus_handle.bus_type, parameters.bus_handle.internal_index,
+ parameters.bus_handle.player_number, parameters.bus_handle.is_valid, parameters.inval,
+ parameters.applet_resource_user_id);
const auto device_index = GetDeviceIndexFromHandle(parameters.bus_handle);
@@ -326,11 +326,11 @@ void HidBus::GetExternalDeviceId(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
const auto bus_handle_{rp.PopRaw()};
- LOG_DEBUG(Service_HID,
- "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, "
- "is_valid={}",
- bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index,
- bus_handle_.player_number, bus_handle_.is_valid);
+ LOG_INFO(Service_HID,
+ "called, abstracted_pad_id={}, bus_type={}, internal_index={}, player_number={}, "
+ "is_valid={}",
+ bus_handle_.abstracted_pad_id, bus_handle_.bus_type, bus_handle_.internal_index,
+ bus_handle_.player_number, bus_handle_.is_valid);
const auto device_index = GetDeviceIndexFromHandle(bus_handle_);
diff --git a/src/core/hle/service/hid/hidbus/hidbus_base.h b/src/core/hle/service/hid/hidbus/hidbus_base.h
index 9258b73d6..ff5c56c9a 100755
--- a/src/core/hle/service/hid/hidbus/hidbus_base.h
+++ b/src/core/hle/service/hid/hidbus/hidbus_base.h
@@ -4,7 +4,6 @@
#pragma once
#include
-#include
#include "common/common_types.h"
#include "core/hle/result.h"
@@ -151,7 +150,7 @@ public:
}
// Assigns a command from data
- virtual bool SetCommand(std::span data) {
+ virtual bool SetCommand(const std::vector& data) {
return {};
}
diff --git a/src/core/hle/service/hid/hidbus/ringcon.cpp b/src/core/hle/service/hid/hidbus/ringcon.cpp
index 8181531d7..61d288e49 100755
--- a/src/core/hle/service/hid/hidbus/ringcon.cpp
+++ b/src/core/hle/service/hid/hidbus/ringcon.cpp
@@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
-#include "core/hid/emulated_controller.h"
+#include "core/hid/emulated_devices.h"
#include "core/hid/hid_core.h"
#include "core/hle/kernel/k_event.h"
#include "core/hle/kernel/k_readable_event.h"
@@ -12,20 +12,16 @@ namespace Service::HID {
RingController::RingController(Core::HID::HIDCore& hid_core_,
KernelHelpers::ServiceContext& service_context_)
: HidbusBase(service_context_) {
- input = hid_core_.GetEmulatedController(Core::HID::NpadIdType::Player1);
+ input = hid_core_.GetEmulatedDevices();
}
RingController::~RingController() = default;
void RingController::OnInit() {
- input->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Ring);
return;
}
void RingController::OnRelease() {
- input->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
return;
};
@@ -116,7 +112,7 @@ std::vector RingController::GetReply() const {
}
}
-bool RingController::SetCommand(std::span data) {
+bool RingController::SetCommand(const std::vector& data) {
if (data.size() < 4) {
LOG_ERROR(Service_HID, "Command size not supported {}", data.size());
command = RingConCommands::Error;
diff --git a/src/core/hle/service/hid/hidbus/ringcon.h b/src/core/hle/service/hid/hidbus/ringcon.h
index 1a7b477af..22629a19c 100755
--- a/src/core/hle/service/hid/hidbus/ringcon.h
+++ b/src/core/hle/service/hid/hidbus/ringcon.h
@@ -4,13 +4,12 @@
#pragma once
#include
-#include
#include "common/common_types.h"
#include "core/hle/service/hid/hidbus/hidbus_base.h"
namespace Core::HID {
-class EmulatedController;
+class EmulatedDevices;
} // namespace Core::HID
namespace Service::HID {
@@ -32,7 +31,7 @@ public:
u8 GetDeviceId() const override;
// Assigns a command from data
- bool SetCommand(std::span data) override;
+ bool SetCommand(const std::vector& data) override;
// Returns a reply from a command
std::vector GetReply() const override;
@@ -249,6 +248,6 @@ private:
.zero = {.value = idle_value, .crc = 225},
};
- Core::HID::EmulatedController* input;
+ Core::HID::EmulatedDevices* input;
};
} // namespace Service::HID
diff --git a/src/core/hle/service/hid/hidbus/starlink.cpp b/src/core/hle/service/hid/hidbus/starlink.cpp
index 3d74eaafd..6d1d01629 100755
--- a/src/core/hle/service/hid/hidbus/starlink.cpp
+++ b/src/core/hle/service/hid/hidbus/starlink.cpp
@@ -42,7 +42,7 @@ std::vector Starlink::GetReply() const {
return {};
}
-bool Starlink::SetCommand(std::span data) {
+bool Starlink::SetCommand(const std::vector& data) {
LOG_ERROR(Service_HID, "Command not implemented");
return false;
}
diff --git a/src/core/hle/service/hid/hidbus/starlink.h b/src/core/hle/service/hid/hidbus/starlink.h
index bbde84384..9be7d54c1 100755
--- a/src/core/hle/service/hid/hidbus/starlink.h
+++ b/src/core/hle/service/hid/hidbus/starlink.h
@@ -29,7 +29,7 @@ public:
u8 GetDeviceId() const override;
// Assigns a command from data
- bool SetCommand(std::span data) override;
+ bool SetCommand(const std::vector& data) override;
// Returns a reply from a command
std::vector GetReply() const override;
diff --git a/src/core/hle/service/hid/hidbus/stubbed.cpp b/src/core/hle/service/hid/hidbus/stubbed.cpp
index c4215443c..7489d50cb 100755
--- a/src/core/hle/service/hid/hidbus/stubbed.cpp
+++ b/src/core/hle/service/hid/hidbus/stubbed.cpp
@@ -43,7 +43,7 @@ std::vector HidbusStubbed::GetReply() const {
return {};
}
-bool HidbusStubbed::SetCommand(std::span data) {
+bool HidbusStubbed::SetCommand(const std::vector& data) {
LOG_ERROR(Service_HID, "Command not implemented");
return false;
}
diff --git a/src/core/hle/service/hid/hidbus/stubbed.h b/src/core/hle/service/hid/hidbus/stubbed.h
index 0772bc6ee..0130707a9 100755
--- a/src/core/hle/service/hid/hidbus/stubbed.h
+++ b/src/core/hle/service/hid/hidbus/stubbed.h
@@ -29,7 +29,7 @@ public:
u8 GetDeviceId() const override;
// Assigns a command from data
- bool SetCommand(std::span data) override;
+ bool SetCommand(const std::vector& data) override;
// Returns a reply from a command
std::vector GetReply() const override;
diff --git a/src/core/hle/service/hid/irs.cpp b/src/core/hle/service/hid/irs.cpp
index 04021d5c3..f3f1cca61 100755
--- a/src/core/hle/service/hid/irs.cpp
+++ b/src/core/hle/service/hid/irs.cpp
@@ -108,8 +108,6 @@ void IRS::StopImageProcessor(Kernel::HLERequestContext& ctx) {
auto result = IsIrCameraHandleValid(parameters.camera_handle);
if (result.IsSuccess()) {
// TODO: Stop Image processor
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
result = ResultSuccess;
}
@@ -141,8 +139,6 @@ void IRS::RunMomentProcessor(Kernel::HLERequestContext& ctx) {
MakeProcessor(parameters.camera_handle, device);
auto& image_transfer_processor = GetProcessor(parameters.camera_handle);
image_transfer_processor.SetConfig(parameters.processor_config);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -174,8 +170,6 @@ void IRS::RunClusteringProcessor(Kernel::HLERequestContext& ctx) {
auto& image_transfer_processor =
GetProcessor(parameters.camera_handle);
image_transfer_processor.SetConfig(parameters.processor_config);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -225,8 +219,6 @@ void IRS::RunImageTransferProcessor(Kernel::HLERequestContext& ctx) {
GetProcessor(parameters.camera_handle);
image_transfer_processor.SetConfig(parameters.processor_config);
image_transfer_processor.SetTransferMemoryPointer(transfer_memory);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -302,8 +294,6 @@ void IRS::RunTeraPluginProcessor(Kernel::HLERequestContext& ctx) {
auto& image_transfer_processor =
GetProcessor(parameters.camera_handle);
image_transfer_processor.SetConfig(parameters.processor_config);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -353,8 +343,6 @@ void IRS::RunPointingProcessor(Kernel::HLERequestContext& ctx) {
MakeProcessor(camera_handle, device);
auto& image_transfer_processor = GetProcessor(camera_handle);
image_transfer_processor.SetConfig(processor_config);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -465,8 +453,6 @@ void IRS::RunImageTransferExProcessor(Kernel::HLERequestContext& ctx) {
GetProcessor(parameters.camera_handle);
image_transfer_processor.SetConfig(parameters.processor_config);
image_transfer_processor.SetTransferMemoryPointer(transfer_memory);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -493,8 +479,6 @@ void IRS::RunIrLedProcessor(Kernel::HLERequestContext& ctx) {
MakeProcessor(camera_handle, device);
auto& image_transfer_processor = GetProcessor(camera_handle);
image_transfer_processor.SetConfig(processor_config);
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::IR);
}
IPC::ResponseBuilder rb{ctx, 2};
@@ -520,8 +504,6 @@ void IRS::StopImageProcessorAsync(Kernel::HLERequestContext& ctx) {
auto result = IsIrCameraHandleValid(parameters.camera_handle);
if (result.IsSuccess()) {
// TODO: Stop image processor async
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
result = ResultSuccess;
}
diff --git a/src/core/hle/service/jit/jit.cpp b/src/core/hle/service/jit/jit.cpp
index ec162fd31..a6369d52a 100755
--- a/src/core/hle/service/jit/jit.cpp
+++ b/src/core/hle/service/jit/jit.cpp
@@ -62,7 +62,7 @@ public:
const auto parameters{rp.PopRaw()};
// Optional input/output buffers
- const auto input_buffer{ctx.CanReadBuffer() ? ctx.ReadBuffer() : std::span()};
+ std::vector input_buffer{ctx.CanReadBuffer() ? ctx.ReadBuffer() : std::vector()};
std::vector output_buffer(ctx.CanWriteBuffer() ? ctx.GetWriteBufferSize() : 0);
// Function call prototype:
@@ -132,7 +132,7 @@ public:
const auto command{rp.PopRaw()};
// Optional input/output buffers
- const auto input_buffer{ctx.CanReadBuffer() ? ctx.ReadBuffer() : std::span()};
+ std::vector input_buffer{ctx.CanReadBuffer() ? ctx.ReadBuffer() : std::vector()};
std::vector output_buffer(ctx.CanWriteBuffer() ? ctx.GetWriteBufferSize() : 0);
// Function call prototype:
diff --git a/src/core/hle/service/ldn/ldn.cpp b/src/core/hle/service/ldn/ldn.cpp
index edd170132..a5ff82944 100755
--- a/src/core/hle/service/ldn/ldn.cpp
+++ b/src/core/hle/service/ldn/ldn.cpp
@@ -427,7 +427,7 @@ public:
}
void SetAdvertiseData(Kernel::HLERequestContext& ctx) {
- const auto read_buffer = ctx.ReadBuffer();
+ std::vector read_buffer = ctx.ReadBuffer();
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(lan_discovery.SetAdvertiseData(read_buffer));
@@ -479,7 +479,7 @@ public:
parameters.security_config.passphrase_size,
parameters.security_config.security_mode, parameters.local_communication_version);
- const auto read_buffer = ctx.ReadBuffer();
+ const std::vector read_buffer = ctx.ReadBuffer();
if (read_buffer.size() != sizeof(NetworkInfo)) {
LOG_ERROR(Frontend, "NetworkInfo doesn't match read_buffer size!");
IPC::ResponseBuilder rb{ctx, 2};
diff --git a/src/core/hle/service/nfc/nfc_device.cpp b/src/core/hle/service/nfc/nfc_device.cpp
index 9a3234e8c..78578f723 100755
--- a/src/core/hle/service/nfc/nfc_device.cpp
+++ b/src/core/hle/service/nfc/nfc_device.cpp
@@ -130,9 +130,7 @@ Result NfcDevice::StartDetection(NFP::TagProtocol allowed_protocol) {
return WrongDeviceState;
}
- if (npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::NFC) !=
- Common::Input::DriverResult::Success) {
+ if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) {
LOG_ERROR(Service_NFC, "Nfc not supported");
return NfcDisabled;
}
@@ -143,8 +141,7 @@ Result NfcDevice::StartDetection(NFP::TagProtocol allowed_protocol) {
}
Result NfcDevice::StopDetection() {
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
+ npad_device->SetPollingMode(Common::Input::PollingMode::Active);
if (device_state == NFP::DeviceState::Initialized) {
return ResultSuccess;
diff --git a/src/core/hle/service/nfp/nfp_device.cpp b/src/core/hle/service/nfp/nfp_device.cpp
index dbfaaf605..517ed0564 100755
--- a/src/core/hle/service/nfp/nfp_device.cpp
+++ b/src/core/hle/service/nfp/nfp_device.cpp
@@ -152,9 +152,7 @@ Result NfpDevice::StartDetection(TagProtocol allowed_protocol) {
return WrongDeviceState;
}
- if (npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::NFC) !=
- Common::Input::DriverResult::Success) {
+ if (!npad_device->SetPollingMode(Common::Input::PollingMode::NFC)) {
LOG_ERROR(Service_NFP, "Nfc not supported");
return NfcDisabled;
}
@@ -165,8 +163,7 @@ Result NfpDevice::StartDetection(TagProtocol allowed_protocol) {
}
Result NfpDevice::StopDetection() {
- npad_device->SetPollingMode(Core::HID::EmulatedDeviceIndex::RightIndex,
- Common::Input::PollingMode::Active);
+ npad_device->SetPollingMode(Common::Input::PollingMode::Active);
if (device_state == DeviceState::Initialized) {
return ResultSuccess;
diff --git a/src/core/hle/service/nvdrv/devices/nvdevice.h b/src/core/hle/service/nvdrv/devices/nvdevice.h
index 607d303d7..4020821b3 100755
--- a/src/core/hle/service/nvdrv/devices/nvdevice.h
+++ b/src/core/hle/service/nvdrv/devices/nvdevice.h
@@ -3,9 +3,7 @@
#pragma once
-#include
#include
-
#include "common/common_types.h"
#include "core/hle/service/nvdrv/nvdata.h"
@@ -33,7 +31,7 @@ public:
* @param output A buffer where the output data will be written to.
* @returns The result code of the ioctl.
*/
- virtual NvResult Ioctl1(DeviceFD fd, Ioctl command, std::span input,
+ virtual NvResult Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output) = 0;
/**
@@ -44,8 +42,8 @@ public:
* @param output A buffer where the output data will be written to.
* @returns The result code of the ioctl.
*/
- virtual NvResult Ioctl2(DeviceFD fd, Ioctl command, std::span input,
- std::span inline_input, std::vector& output) = 0;
+ virtual NvResult Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input,
+ const std::vector& inline_input, std::vector& output) = 0;
/**
* Handles an ioctl3 request.
@@ -55,7 +53,7 @@ public:
* @param inline_output A buffer where the inlined output data will be written to.
* @returns The result code of the ioctl.
*/
- virtual NvResult Ioctl3(DeviceFD fd, Ioctl command, std::span input,
+ virtual NvResult Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output, std::vector& inline_output) = 0;
/**
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
index 0b4bb7bcb..6ddd40e85 100755
--- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.cpp
@@ -17,19 +17,19 @@ nvdisp_disp0::nvdisp_disp0(Core::System& system_, NvCore::Container& core)
: nvdevice{system_}, container{core}, nvmap{core.GetNvMapFile()} {}
nvdisp_disp0::~nvdisp_disp0() = default;
-NvResult nvdisp_disp0::Ioctl1(DeviceFD fd, Ioctl command, std::span input,
+NvResult nvdisp_disp0::Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output) {
UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw);
return NvResult::NotImplemented;
}
-NvResult nvdisp_disp0::Ioctl2(DeviceFD fd, Ioctl command, std::span input,
- std::span inline_input, std::vector& output) {
+NvResult nvdisp_disp0::Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input,
+ const std::vector& inline_input, std::vector& output) {
UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw);
return NvResult::NotImplemented;
}
-NvResult nvdisp_disp0::Ioctl3(DeviceFD fd, Ioctl command, std::span input,
+NvResult nvdisp_disp0::Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output, std::vector& inline_output) {
UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw);
return NvResult::NotImplemented;
diff --git a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
index 7e09e3331..e420efb4f 100755
--- a/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
+++ b/src/core/hle/service/nvdrv/devices/nvdisp_disp0.h
@@ -25,12 +25,12 @@ public:
explicit nvdisp_disp0(Core::System& system_, NvCore::Container& core);
~nvdisp_disp0() override;
- NvResult Ioctl1(DeviceFD fd, Ioctl command, std::span input,
+ NvResult Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output) override;
- NvResult Ioctl2(DeviceFD fd, Ioctl command, std::span input,
- std::span inline_input, std::vector& output) override;
- NvResult Ioctl3(DeviceFD fd, Ioctl command, std::span input, std::vector& output,
- std::vector& inline_output) override;
+ NvResult Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input,
+ const std::vector& inline_input, std::vector& output) override;
+ NvResult Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input,
+ std::vector& output, std::vector& inline_output) override;
void OnOpen(DeviceFD fd) override;
void OnClose(DeviceFD fd) override;
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
index ad4fab423..72a4d18eb 100755
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.cpp
@@ -27,7 +27,7 @@ nvhost_as_gpu::nvhost_as_gpu(Core::System& system_, Module& module_, NvCore::Con
nvhost_as_gpu::~nvhost_as_gpu() = default;
-NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span input,
+NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output) {
switch (command.group) {
case 'A':
@@ -60,13 +60,13 @@ NvResult nvhost_as_gpu::Ioctl1(DeviceFD fd, Ioctl command, std::span i
return NvResult::NotImplemented;
}
-NvResult nvhost_as_gpu::Ioctl2(DeviceFD fd, Ioctl command, std::span input,
- std::span inline_input, std::vector& output) {
+NvResult nvhost_as_gpu::Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input,
+ const std::vector& inline_input, std::vector& output) {
UNIMPLEMENTED_MSG("Unimplemented ioctl={:08X}", command.raw);
return NvResult::NotImplemented;
}
-NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, std::span input,
+NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output, std::vector& inline_output) {
switch (command.group) {
case 'A':
@@ -87,7 +87,7 @@ NvResult nvhost_as_gpu::Ioctl3(DeviceFD fd, Ioctl command, std::span i
void nvhost_as_gpu::OnOpen(DeviceFD fd) {}
void nvhost_as_gpu::OnClose(DeviceFD fd) {}
-NvResult nvhost_as_gpu::AllocAsEx(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::AllocAsEx(const std::vector& input, std::vector& output) {
IoctlAllocAsEx params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -141,7 +141,7 @@ NvResult nvhost_as_gpu::AllocAsEx(std::span input, std::vector& ou
return NvResult::Success;
}
-NvResult nvhost_as_gpu::AllocateSpace(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::AllocateSpace(const std::vector& input, std::vector& output) {
IoctlAllocSpace params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -220,7 +220,7 @@ void nvhost_as_gpu::FreeMappingLocked(u64 offset) {
mapping_map.erase(offset);
}
-NvResult nvhost_as_gpu::FreeSpace(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::FreeSpace(const std::vector& input, std::vector& output) {
IoctlFreeSpace params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -266,7 +266,7 @@ NvResult nvhost_as_gpu::FreeSpace(std::span input, std::vector& ou
return NvResult::Success;
}
-NvResult nvhost_as_gpu::Remap(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::Remap(const std::vector& input, std::vector& output) {
const auto num_entries = input.size() / sizeof(IoctlRemapEntry);
LOG_DEBUG(Service_NVDRV, "called, num_entries=0x{:X}", num_entries);
@@ -320,7 +320,7 @@ NvResult nvhost_as_gpu::Remap(std::span input, std::vector& output
return NvResult::Success;
}
-NvResult nvhost_as_gpu::MapBufferEx(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::MapBufferEx(const std::vector& input, std::vector& output) {
IoctlMapBufferEx params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -424,7 +424,7 @@ NvResult nvhost_as_gpu::MapBufferEx(std::span input, std::vector&
return NvResult::Success;
}
-NvResult nvhost_as_gpu::UnmapBuffer(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::UnmapBuffer(const std::vector& input, std::vector& output) {
IoctlUnmapBuffer params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -463,7 +463,7 @@ NvResult nvhost_as_gpu::UnmapBuffer(std::span input, std::vector&
return NvResult::Success;
}
-NvResult nvhost_as_gpu::BindChannel(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::BindChannel(const std::vector& input, std::vector& output) {
IoctlBindChannel params{};
std::memcpy(¶ms, input.data(), input.size());
LOG_DEBUG(Service_NVDRV, "called, fd={:X}", params.fd);
@@ -492,7 +492,7 @@ void nvhost_as_gpu::GetVARegionsImpl(IoctlGetVaRegions& params) {
};
}
-NvResult nvhost_as_gpu::GetVARegions(std::span input, std::vector& output) {
+NvResult nvhost_as_gpu::GetVARegions(const std::vector& input, std::vector& output) {
IoctlGetVaRegions params{};
std::memcpy(¶ms, input.data(), input.size());
@@ -511,7 +511,7 @@ NvResult nvhost_as_gpu::GetVARegions(std::span input, std::vector&
return NvResult::Success;
}
-NvResult nvhost_as_gpu::GetVARegions(std::span input, std::vector& output,
+NvResult nvhost_as_gpu::GetVARegions(const std::vector& input, std::vector& output,
std::vector& inline_output) {
IoctlGetVaRegions params{};
std::memcpy(¶ms, input.data(), input.size());
diff --git a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
index dcfc02419..57b6a1f76 100755
--- a/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
+++ b/src/core/hle/service/nvdrv/devices/nvhost_as_gpu.h
@@ -47,12 +47,12 @@ public:
explicit nvhost_as_gpu(Core::System& system_, Module& module, NvCore::Container& core);
~nvhost_as_gpu() override;
- NvResult Ioctl1(DeviceFD fd, Ioctl command, std::span input,
+ NvResult Ioctl1(DeviceFD fd, Ioctl command, const std::vector& input,
std::vector& output) override;
- NvResult Ioctl2(DeviceFD fd, Ioctl command, std::span input,
- std::span inline_input, std::vector& output) override;
- NvResult Ioctl3(DeviceFD fd, Ioctl command, std::span input, std::vector& output,
- std::vector& inline_output) override;
+ NvResult Ioctl2(DeviceFD fd, Ioctl command, const std::vector& input,
+ const std::vector& inline_input, std::vector& output) override;
+ NvResult Ioctl3(DeviceFD fd, Ioctl command, const std::vector& input,
+ std::vector& output, std::vector