summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2021-11-15 04:56:54 +0100
committerNarr the Reg <juangerman-13@hotmail.com>2021-11-25 03:30:28 +0100
commit42949738f2c01a4125a9a385c9100240181153ec (patch)
tree5de97be0bc08a1dd4ff5138196c08a6bf2e08e70 /src/core/hle/service
parentcore/hid: Improve accuary of mouse implementation (diff)
downloadyuzu-42949738f2c01a4125a9a385c9100240181153ec.tar
yuzu-42949738f2c01a4125a9a385c9100240181153ec.tar.gz
yuzu-42949738f2c01a4125a9a385c9100240181153ec.tar.bz2
yuzu-42949738f2c01a4125a9a385c9100240181153ec.tar.lz
yuzu-42949738f2c01a4125a9a385c9100240181153ec.tar.xz
yuzu-42949738f2c01a4125a9a385c9100240181153ec.tar.zst
yuzu-42949738f2c01a4125a9a385c9100240181153ec.zip
Diffstat (limited to 'src/core/hle/service')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp2
-rw-r--r--src/core/hle/service/hid/ring_lifo.h7
2 files changed, 4 insertions, 5 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index eaec79139..4b23230e1 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -345,7 +345,7 @@ void Controller_NPad::RequestPadStateUpdate(Core::HID::NpadIdType npad_id) {
constexpr btn right_button_mask = btn::A | btn::B | btn::X | btn::Y | btn::StickR | btn::R |
btn::ZR | btn::Plus | btn::StickRLeft | btn::StickRUp |
btn::StickRRight | btn::StickRDown;
- pad_entry.npad_buttons.raw |= button_state.raw & right_button_mask;
+ pad_entry.npad_buttons.raw = button_state.raw & right_button_mask;
pad_entry.r_stick = stick_state.right;
}
diff --git a/src/core/hle/service/hid/ring_lifo.h b/src/core/hle/service/hid/ring_lifo.h
index 6209ed0d1..f0e0bab7f 100644
--- a/src/core/hle/service/hid/ring_lifo.h
+++ b/src/core/hle/service/hid/ring_lifo.h
@@ -7,7 +7,6 @@
#include <array>
#include "common/common_types.h"
-#include "common/swap.h"
namespace Service::HID {
constexpr std::size_t max_buffer_size = 17;
@@ -21,7 +20,7 @@ struct AtomicStorage {
template <typename State>
struct Lifo {
s64 timestamp{};
- s64 total_buffer_count = max_buffer_size;
+ s64 total_buffer_count = static_cast<s64>(max_buffer_size);
s64 buffer_tail{};
s64 buffer_count{};
std::array<AtomicStorage<State>, max_buffer_size> entries{};
@@ -35,11 +34,11 @@ struct Lifo {
}
std::size_t GetPreviousEntryIndex() const {
- return (buffer_tail + total_buffer_count - 1) % total_buffer_count;
+ return static_cast<size_t>((buffer_tail + total_buffer_count - 1) % total_buffer_count);
}
std::size_t GetNextEntryIndex() const {
- return (buffer_tail + 1) % total_buffer_count;
+ return static_cast<size_t>((buffer_tail + 1) % total_buffer_count);
}
void WriteNextEntry(const State& new_state) {