VERY experimental Nintendo Switch 2 emulator
C++
fixup! fixup! Refactor input system
wwylele3d0953097fb8
diff --git a/src/common/emu_window.h b/src/common/emu_window.hindex 0ae3ea2aff..57e303b6df 100644--- a/src/common/emu_window.h+++ b/src/common/emu_window.h@@ -75,14 +75,14 @@ public:/*** Signals a button press action to the HID module.* @param pad_state indicates which button to press- * @note only handle real buttons (A/B/X/Y/...), excluding analog input like circle pad.+ * @note only handles real buttons (A/B/X/Y/...), excluding analog inputs like the circle pad.*/void ButtonPressed(Service::HID::PadState pad_state);/*** Signals a button release action to the HID module.* @param pad_state indicates which button to press- * @note only handle real buttons (A/B/X/Y/...), excluding analog input like circle pad.+ * @note only handles real buttons (A/B/X/Y/...), excluding analog inputs like the circle pad.*/void ButtonReleased(Service::HID::PadState pad_state);@@ -123,7 +123,7 @@ public:}/**- * Gets the current cirle pad state.+ * Gets the current circle pad state.* @note This should be called by the core emu thread to get a state set by the window thread.* @todo Fix this function to be thread-safe.* @return std::tuple of (x, y), where `x` and `y` are the circle pad coordinatesdiff --git a/src/common/key_map.h b/src/common/key_map.hindex 4b585c1b9f..b62f017c69 100644--- a/src/common/key_map.h+++ b/src/common/key_map.h@@ -13,7 +13,7 @@ class EmuWindow;namespace KeyMap {/**- * Represents a key mapping target that are not 3DS real buttons.+ * Represents key mapping targets that are not real 3DS buttons.* They will be handled by KeyMap and translated to 3DS input.*/enum class IndirectTarget {@@ -25,7 +25,7 @@ enum class IndirectTarget {};/**- * Represents a key mapping target. It can be a PadState that represents 3DS real buttons,+ * Represents a key mapping target. It can be a PadState that represents real 3DS buttons,* or an IndirectTarget.*/struct KeyTarget {@@ -84,12 +84,12 @@ void SetKeyMapping(HostDeviceKey key, KeyTarget target);void ClearKeyMapping(int device_id);/**- * Maps a key press actions and call the corresponding function in EmuWindow+ * Maps a key press action and call the corresponding function in EmuWindow*/void PressKey(EmuWindow& emu_window, HostDeviceKey key);/**- * Maps a key release actions and call the corresponding function in EmuWindow+ * Maps a key release action and call the corresponding function in EmuWindow*/void ReleaseKey(EmuWindow& emu_window, HostDeviceKey key);diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cppindex a48184495f..c975433f4a 100644--- a/src/core/hle/service/hid/hid.cpp+++ b/src/core/hle/service/hid/hid.cpp@@ -74,7 +74,7 @@ void Update() {PadState state = VideoCore::g_emu_window->GetPadState();- // Get current circle pad positon and update circle pad direction+ // Get current circle pad position and update circle pad directions16 circle_pad_x, circle_pad_y;std::tie(circle_pad_x, circle_pad_y) = VideoCore::g_emu_window->GetCirclePadState();state.hex |= GetCirclePadDirectionState(circle_pad_x, circle_pad_y).hex;