early-access version 3131

This commit is contained in:
pineappleEA 2022-11-19 18:47:06 +01:00
parent cd9434a867
commit 46ec3c7aeb
3 changed files with 13 additions and 13 deletions

View File

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

View File

@ -31,7 +31,7 @@ void EmulatedConsole::SetTouchParams() {
touch_params[index++] = touch_params[index++] =
Common::ParamPackage{"engine:cemuhookudp,axis_x:19,axis_y:20,button:131072"}; Common::ParamPackage{"engine:cemuhookudp,axis_x:19,axis_y:20,button:131072"};
for (int i = 0; i < static_cast<int>(max_active_touch_inputs); i++) { for (int i = 0; i < static_cast<int>(MaxActiveTouchInputs); i++) {
Common::ParamPackage touchscreen_param{}; Common::ParamPackage touchscreen_param{};
touchscreen_param.Set("engine", "touch"); touchscreen_param.Set("engine", "touch");
touchscreen_param.Set("axis_x", i * 2); touchscreen_param.Set("axis_x", i * 2);
@ -46,7 +46,7 @@ void EmulatedConsole::SetTouchParams() {
// Map the rest of the fingers from touch from button configuration // Map the rest of the fingers from touch from button configuration
for (const auto& config_entry : touch_buttons) { for (const auto& config_entry : touch_buttons) {
if (index >= max_touch_devices) { if (index >= MaxTouchDevices) {
continue; continue;
} }
Common::ParamPackage params{config_entry}; Common::ParamPackage params{config_entry};
@ -176,7 +176,7 @@ void EmulatedConsole::SetMotion(const Common::Input::CallbackStatus& callback) {
} }
void EmulatedConsole::SetTouch(const Common::Input::CallbackStatus& callback, std::size_t index) { void EmulatedConsole::SetTouch(const Common::Input::CallbackStatus& callback, std::size_t index) {
if (index >= max_touch_devices) { if (index >= MaxTouchDevices) {
return; return;
} }
std::unique_lock lock{mutex}; std::unique_lock lock{mutex};
@ -216,7 +216,7 @@ void EmulatedConsole::SetTouch(const Common::Input::CallbackStatus& callback, st
} }
// Touch outside allowed range. Ignore input // Touch outside allowed range. Ignore input
if (touch_index.value() >= max_active_touch_inputs) { if (touch_index.value() >= MaxActiveTouchInputs) {
return; return;
} }
@ -251,7 +251,7 @@ TouchFingerState EmulatedConsole::GetTouch() const {
} }
std::optional<std::size_t> EmulatedConsole::GetIndexFromFingerId(std::size_t finger_id) const { std::optional<std::size_t> EmulatedConsole::GetIndexFromFingerId(std::size_t finger_id) const {
for (std::size_t index = 0; index < max_touch_devices; ++index) { for (std::size_t index = 0; index < MaxTouchDevices; ++index) {
const auto& finger = console.touch_values[index]; const auto& finger = console.touch_values[index];
if (!finger.pressed.value) { if (!finger.pressed.value) {
continue; continue;
@ -264,7 +264,7 @@ std::optional<std::size_t> EmulatedConsole::GetIndexFromFingerId(std::size_t fin
} }
std::optional<std::size_t> EmulatedConsole::GetNextFreeIndex() const { std::optional<std::size_t> EmulatedConsole::GetNextFreeIndex() const {
for (std::size_t index = 0; index < max_touch_devices; ++index) { for (std::size_t index = 0; index < MaxTouchDevices; ++index) {
if (!console.touch_values[index].pressed.value) { if (!console.touch_values[index].pressed.value) {
return index; return index;
} }

View File

@ -21,8 +21,8 @@
#include "core/hid/motion_input.h" #include "core/hid/motion_input.h"
namespace Core::HID { namespace Core::HID {
static constexpr std::size_t max_touch_devices = 32; static constexpr std::size_t MaxTouchDevices = 32;
static constexpr std::size_t max_active_touch_inputs = 16; static constexpr std::size_t MaxActiveTouchInputs = 16;
struct ConsoleMotionInfo { struct ConsoleMotionInfo {
Common::Input::MotionStatus raw_status{}; Common::Input::MotionStatus raw_status{};
@ -30,13 +30,13 @@ struct ConsoleMotionInfo {
}; };
using ConsoleMotionDevices = std::unique_ptr<Common::Input::InputDevice>; using ConsoleMotionDevices = std::unique_ptr<Common::Input::InputDevice>;
using TouchDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, max_touch_devices>; using TouchDevices = std::array<std::unique_ptr<Common::Input::InputDevice>, MaxTouchDevices>;
using ConsoleMotionParams = Common::ParamPackage; using ConsoleMotionParams = Common::ParamPackage;
using TouchParams = std::array<Common::ParamPackage, max_touch_devices>; using TouchParams = std::array<Common::ParamPackage, MaxTouchDevices>;
using ConsoleMotionValues = ConsoleMotionInfo; using ConsoleMotionValues = ConsoleMotionInfo;
using TouchValues = std::array<Common::Input::TouchStatus, max_touch_devices>; using TouchValues = std::array<Common::Input::TouchStatus, MaxTouchDevices>;
struct TouchFinger { struct TouchFinger {
u64 last_touch{}; u64 last_touch{};
@ -58,7 +58,7 @@ struct ConsoleMotion {
bool is_at_rest{}; bool is_at_rest{};
}; };
using TouchFingerState = std::array<TouchFinger, max_active_touch_inputs>; using TouchFingerState = std::array<TouchFinger, MaxActiveTouchInputs>;
struct ConsoleStatus { struct ConsoleStatus {
// Data from input_common // Data from input_common