early-access version 2258

This commit is contained in:
pineappleEA
2021-11-30 05:49:07 +01:00
parent eeba1aa6f2
commit 3c5094eec0
24 changed files with 387 additions and 136 deletions

View File

@@ -510,7 +510,7 @@ void Controller_NPad::OnUpdate(const Core::Timing::CoreTiming& core_timing, u8*
libnx_state.r_stick = pad_state.r_stick;
npad.system_ext_lifo.WriteNextEntry(pad_state);
press_state |= static_cast<u32>(pad_state.npad_buttons.raw);
press_state |= static_cast<u64>(pad_state.npad_buttons.raw);
std::memcpy(data + NPAD_OFFSET + (i * sizeof(NpadInternalState)),
&controller.shared_memory_entry, sizeof(NpadInternalState));
@@ -635,7 +635,7 @@ void Controller_NPad::OnMotionUpdate(const Core::Timing::CoreTiming& core_timing
// This buffer only is updated on handheld on HW
npad.sixaxis_handheld_lifo.WriteNextEntry(sixaxis_handheld_state);
} else {
// Hanheld doesn't update this buffer on HW
// Handheld doesn't update this buffer on HW
npad.sixaxis_fullkey_lifo.WriteNextEntry(sixaxis_fullkey_state);
}
@@ -1149,8 +1149,8 @@ void Controller_NPad::ClearAllControllers() {
}
}
u32 Controller_NPad::GetAndResetPressState() {
return press_state.exchange(0);
Core::HID::NpadButton Controller_NPad::GetAndResetPressState() {
return static_cast<Core::HID::NpadButton>(press_state.exchange(0));
}
bool Controller_NPad::IsControllerSupported(Core::HID::NpadStyleIndex controller) const {

View File

@@ -179,7 +179,7 @@ public:
// Logical OR for all buttons presses on all controllers
// Specifically for cheat engine and other features.
u32 GetAndResetPressState();
Core::HID::NpadButton GetAndResetPressState();
static bool IsNpadIdValid(Core::HID::NpadIdType npad_id);
static bool IsDeviceHandleValid(const Core::HID::SixAxisSensorHandle& device_handle);
@@ -503,7 +503,7 @@ private:
NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id);
const NpadControllerData& GetControllerFromNpadIdType(Core::HID::NpadIdType npad_id) const;
std::atomic<u32> press_state{};
std::atomic<u64> press_state{};
std::array<NpadControllerData, 10> controller_data{};
KernelHelpers::ServiceContext& service_context;