early-access version 1370

This commit is contained in:
pineappleEA 2021-01-24 21:07:01 +01:00
parent 7b95157e26
commit c2e79550e3
6 changed files with 107 additions and 6 deletions

View File

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 1369. This is the source code for early-access 1370.
## Legal Notice ## Legal Notice

View File

@ -946,6 +946,24 @@ void Controller_NPad::SetSixAxisEnabled(bool six_axis_status) {
sixaxis_sensors_enabled = six_axis_status; sixaxis_sensors_enabled = six_axis_status;
} }
void Controller_NPad::SetSixAxisFusionParameters(const DeviceHandle& handle, f32 parameter1,
f32 parameter2) {
sixaxis_fusion_parameter1 = parameter1;
sixaxis_fusion_parameter2 = parameter2;
}
std::pair<f32, f32> Controller_NPad::GetSixAxisFusionParameters(const DeviceHandle& handle) {
return {
sixaxis_fusion_parameter1,
sixaxis_fusion_parameter2,
};
}
void Controller_NPad::ResetSixAxisFusionParameters(const DeviceHandle& handle) {
sixaxis_fusion_parameter1 = 0.0f;
sixaxis_fusion_parameter2 = 0.0f;
}
void Controller_NPad::MergeSingleJoyAsDualJoy(u32 npad_id_1, u32 npad_id_2) { void Controller_NPad::MergeSingleJoyAsDualJoy(u32 npad_id_1, u32 npad_id_2) {
const auto npad_index_1 = NPadIdToIndex(npad_id_1); const auto npad_index_1 = NPadIdToIndex(npad_id_1);
const auto npad_index_2 = NPadIdToIndex(npad_id_2); const auto npad_index_2 = NPadIdToIndex(npad_id_2);

View File

@ -202,6 +202,9 @@ public:
GyroscopeZeroDriftMode GetGyroscopeZeroDriftMode() const; GyroscopeZeroDriftMode GetGyroscopeZeroDriftMode() const;
bool IsSixAxisSensorAtRest() const; bool IsSixAxisSensorAtRest() const;
void SetSixAxisEnabled(bool six_axis_status); void SetSixAxisEnabled(bool six_axis_status);
void SetSixAxisFusionParameters(const DeviceHandle& handle, f32 parameter1, f32 parameter2);
std::pair<f32, f32> GetSixAxisFusionParameters(const DeviceHandle& handle);
void ResetSixAxisFusionParameters(const DeviceHandle& handle);
LedPattern GetLedPattern(u32 npad_id); LedPattern GetLedPattern(u32 npad_id);
bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const; bool IsUnintendedHomeButtonInputProtectionEnabled(u32 npad_id) const;
void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id); void SetUnintendedHomeButtonInputProtectionEnabled(bool is_protection_enabled, u32 npad_id);
@ -458,6 +461,8 @@ private:
std::array<bool, 10> unintended_home_button_input_protection{}; std::array<bool, 10> unintended_home_button_input_protection{};
GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard}; GyroscopeZeroDriftMode gyroscope_zero_drift_mode{GyroscopeZeroDriftMode::Standard};
bool sixaxis_sensors_enabled{true}; bool sixaxis_sensors_enabled{true};
f32 sixaxis_fusion_parameter1{};
f32 sixaxis_fusion_parameter2{};
bool sixaxis_at_rest{true}; bool sixaxis_at_rest{true};
std::array<ControllerPad, 10> npad_pad_states{}; std::array<ControllerPad, 10> npad_pad_states{};
bool is_in_lr_assignment_mode{false}; bool is_in_lr_assignment_mode{false};

View File

@ -209,9 +209,9 @@ Hid::Hid(Core::System& system_) : ServiceFramework{system_, "hid"} {
{67, &Hid::StopSixAxisSensor, "StopSixAxisSensor"}, {67, &Hid::StopSixAxisSensor, "StopSixAxisSensor"},
{68, nullptr, "IsSixAxisSensorFusionEnabled"}, {68, nullptr, "IsSixAxisSensorFusionEnabled"},
{69, &Hid::EnableSixAxisSensorFusion, "EnableSixAxisSensorFusion"}, {69, &Hid::EnableSixAxisSensorFusion, "EnableSixAxisSensorFusion"},
{70, nullptr, "SetSixAxisSensorFusionParameters"}, {70, &Hid::SetSixAxisSensorFusionParameters, "SetSixAxisSensorFusionParameters"},
{71, nullptr, "GetSixAxisSensorFusionParameters"}, {71, &Hid::GetSixAxisSensorFusionParameters, "GetSixAxisSensorFusionParameters"},
{72, nullptr, "ResetSixAxisSensorFusionParameters"}, {72, &Hid::ResetSixAxisSensorFusionParameters, "ResetSixAxisSensorFusionParameters"},
{73, nullptr, "SetAccelerometerParameters"}, {73, nullptr, "SetAccelerometerParameters"},
{74, nullptr, "GetAccelerometerParameters"}, {74, nullptr, "GetAccelerometerParameters"},
{75, nullptr, "ResetAccelerometerParameters"}, {75, nullptr, "ResetAccelerometerParameters"},
@ -534,6 +534,81 @@ void Hid::EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx) {
rb.Push(RESULT_SUCCESS); rb.Push(RESULT_SUCCESS);
} }
void Hid::SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle;
f32 parameter1;
f32 parameter2;
u64 applet_resource_user_id;
};
const auto parameters{rp.PopRaw<Parameters>()};
applet_resource->GetController<Controller_NPad>(HidController::NPad)
.SetSixAxisFusionParameters(parameters.sixaxis_handle, parameters.parameter1,
parameters.parameter2);
LOG_WARNING(Service_HID,
"(STUBBED) called, float1={}, float2={}, npad_type={}, npad_id={}, "
"device_index={}, applet_resource_user_id={}",
parameters.parameter1, parameters.parameter2, parameters.sixaxis_handle.npad_type,
parameters.sixaxis_handle.npad_id, parameters.sixaxis_handle.device_index,
parameters.applet_resource_user_id);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void Hid::GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle;
u64 applet_resource_user_id;
};
f32 parameter1 = 0;
f32 parameter2 = 0;
const auto parameters{rp.PopRaw<Parameters>()};
std::tie(parameter1, parameter2) =
applet_resource->GetController<Controller_NPad>(HidController::NPad)
.GetSixAxisFusionParameters(parameters.sixaxis_handle);
LOG_WARNING(Service_HID,
"(STUBBED) called, npad_type={}, npad_id={}, "
"device_index={}, applet_resource_user_id={}",
parameters.sixaxis_handle.npad_type, parameters.sixaxis_handle.npad_id,
parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
IPC::ResponseBuilder rb{ctx, 4};
rb.Push(RESULT_SUCCESS);
rb.Push(parameter1);
rb.Push(parameter2);
}
void Hid::ResetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx};
struct Parameters {
Controller_NPad::DeviceHandle sixaxis_handle;
u64 applet_resource_user_id;
};
const auto parameters{rp.PopRaw<Parameters>()};
applet_resource->GetController<Controller_NPad>(HidController::NPad)
.ResetSixAxisFusionParameters(parameters.sixaxis_handle);
LOG_WARNING(Service_HID,
"(STUBBED) called, npad_type={}, npad_id={}, "
"device_index={}, applet_resource_user_id={}",
parameters.sixaxis_handle.npad_type, parameters.sixaxis_handle.npad_id,
parameters.sixaxis_handle.device_index, parameters.applet_resource_user_id);
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(RESULT_SUCCESS);
}
void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) { void Hid::SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx) {
IPC::RequestParser rp{ctx}; IPC::RequestParser rp{ctx};
const auto sixaxis_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()}; const auto sixaxis_handle{rp.PopRaw<Controller_NPad::DeviceHandle>()};

View File

@ -97,6 +97,9 @@ private:
void StartSixAxisSensor(Kernel::HLERequestContext& ctx); void StartSixAxisSensor(Kernel::HLERequestContext& ctx);
void StopSixAxisSensor(Kernel::HLERequestContext& ctx); void StopSixAxisSensor(Kernel::HLERequestContext& ctx);
void EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx); void EnableSixAxisSensorFusion(Kernel::HLERequestContext& ctx);
void SetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx);
void GetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx);
void ResetSixAxisSensorFusionParameters(Kernel::HLERequestContext& ctx);
void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx); void SetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx);
void GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx); void GetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx);
void ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx); void ResetGyroscopeZeroDriftMode(Kernel::HLERequestContext& ctx);

View File

@ -253,8 +253,8 @@ private:
if (line_number && *line_number != 0) { if (line_number && *line_number != 0) {
output_log += fmt::format("Line: {}\n", *line_number); output_log += fmt::format("Line: {}\n", *line_number);
} }
output_log += fmt::format("ProcessID: {}\n", entry.pid); output_log += fmt::format("ProcessID: {:X}\n", entry.pid);
output_log += fmt::format("ThreadID: {}\n", entry.tid); output_log += fmt::format("ThreadID: {:X}\n", entry.tid);
if (text_log) { if (text_log) {
output_log += fmt::format("Log Text: {}\n", *text_log); output_log += fmt::format("Log Text: {}\n", *text_log);