diff options
| author | 2018-01-15 12:54:54 -0500 | |
|---|---|---|
| committer | 2018-01-15 12:54:54 -0500 | |
| commit | 325f72acebd9ab7dd246f77ce7fbc2584104d00d (patch) | |
| tree | 8c45a330a0e7d4208b68aae58dd3341a1921c51c /src | |
| parent | Merge pull request #15 from bsaleil/master (diff) | |
| parent | yuzu_cmd: Fix default ini, add screenshot button (diff) | |
| download | yuzu-325f72acebd9ab7dd246f77ce7fbc2584104d00d.tar.gz yuzu-325f72acebd9ab7dd246f77ce7fbc2584104d00d.tar.xz yuzu-325f72acebd9ab7dd246f77ce7fbc2584104d00d.zip | |
Merge pull request #16 from shinyquagsire23/hid-sharedmem-impl-start
HID Sharedmem Impl Start
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/hle/service/hid/hid.cpp | 86 | ||||
| -rw-r--r-- | src/core/hle/service/hid/hid.h | 312 | ||||
| -rw-r--r-- | src/core/settings.h | 69 | ||||
| -rw-r--r-- | src/yuzu/configuration/config.cpp | 10 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input.cpp | 18 | ||||
| -rw-r--r-- | src/yuzu/configuration/configure_input.ui | 283 | ||||
| -rw-r--r-- | src/yuzu_cmd/default_ini.h | 25 |
7 files changed, 688 insertions, 115 deletions
diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 3f74aed06..3c4259d27 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp | |||
| @@ -2,7 +2,10 @@ | |||
| 2 | // Licensed under GPLv2 or any later version | 2 | // Licensed under GPLv2 or any later version |
| 3 | // Refer to the license.txt file included. | 3 | // Refer to the license.txt file included. |
| 4 | 4 | ||
| 5 | #include <atomic> | ||
| 5 | #include "common/logging/log.h" | 6 | #include "common/logging/log.h" |
| 7 | #include "core/core_timing.h" | ||
| 8 | #include "core/frontend/input.h" | ||
| 6 | #include "core/hle/ipc_helpers.h" | 9 | #include "core/hle/ipc_helpers.h" |
| 7 | #include "core/hle/kernel/client_port.h" | 10 | #include "core/hle/kernel/client_port.h" |
| 8 | #include "core/hle/kernel/client_session.h" | 11 | #include "core/hle/kernel/client_session.h" |
| @@ -13,6 +16,12 @@ | |||
| 13 | namespace Service { | 16 | namespace Service { |
| 14 | namespace HID { | 17 | namespace HID { |
| 15 | 18 | ||
| 19 | // Updating period for each HID device. | ||
| 20 | // TODO(shinyquagsire23): These need better values. | ||
| 21 | constexpr u64 pad_update_ticks = BASE_CLOCK_RATE / 234; | ||
| 22 | constexpr u64 accelerometer_update_ticks = BASE_CLOCK_RATE / 104; | ||
| 23 | constexpr u64 gyroscope_update_ticks = BASE_CLOCK_RATE / 101; | ||
| 24 | |||
| 16 | class IAppletResource final : public ServiceFramework<IAppletResource> { | 25 | class IAppletResource final : public ServiceFramework<IAppletResource> { |
| 17 | public: | 26 | public: |
| 18 | IAppletResource() : ServiceFramework("IAppletResource") { | 27 | IAppletResource() : ServiceFramework("IAppletResource") { |
| @@ -24,6 +33,15 @@ public: | |||
| 24 | shared_mem = Kernel::SharedMemory::Create( | 33 | shared_mem = Kernel::SharedMemory::Create( |
| 25 | nullptr, 0x40000, Kernel::MemoryPermission::ReadWrite, Kernel::MemoryPermission::Read, | 34 | nullptr, 0x40000, Kernel::MemoryPermission::ReadWrite, Kernel::MemoryPermission::Read, |
| 26 | 0, Kernel::MemoryRegion::BASE, "HID:SharedMemory"); | 35 | 0, Kernel::MemoryRegion::BASE, "HID:SharedMemory"); |
| 36 | |||
| 37 | // Register update callbacks | ||
| 38 | pad_update_event = CoreTiming::RegisterEvent( | ||
| 39 | "HID::UpdatePadCallback", | ||
| 40 | [this](u64 userdata, int cycles_late) { UpdatePadCallback(userdata, cycles_late); }); | ||
| 41 | |||
| 42 | // TODO(shinyquagsire23): Other update callbacks? (accel, gyro?) | ||
| 43 | |||
| 44 | CoreTiming::ScheduleEvent(pad_update_ticks, pad_update_event); | ||
| 27 | } | 45 | } |
| 28 | 46 | ||
| 29 | private: | 47 | private: |
| @@ -34,8 +52,76 @@ private: | |||
| 34 | LOG_DEBUG(Service, "called"); | 52 | LOG_DEBUG(Service, "called"); |
| 35 | } | 53 | } |
| 36 | 54 | ||
| 55 | void LoadInputDevices() { | ||
| 56 | std::transform(Settings::values.buttons.begin() + Settings::NativeButton::BUTTON_HID_BEGIN, | ||
| 57 | Settings::values.buttons.begin() + Settings::NativeButton::BUTTON_HID_END, | ||
| 58 | buttons.begin(), Input::CreateDevice<Input::ButtonDevice>); | ||
| 59 | // TODO(shinyquagsire23): sticks, gyro, touch, mouse, keyboard | ||
| 60 | } | ||
| 61 | |||
| 62 | void UpdatePadCallback(u64 userdata, int cycles_late) { | ||
| 63 | SharedMemory* mem = reinterpret_cast<SharedMemory*>(shared_mem->GetPointer()); | ||
| 64 | |||
| 65 | if (is_device_reload_pending.exchange(false)) | ||
| 66 | LoadInputDevices(); | ||
| 67 | |||
| 68 | // TODO(shinyquagsire23): This is a hack! | ||
| 69 | ControllerPadState& state = | ||
| 70 | mem->controllers[Controller_Handheld].layouts[Layout_Default].entries[0].buttons; | ||
| 71 | using namespace Settings::NativeButton; | ||
| 72 | state.a.Assign(buttons[A - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 73 | state.b.Assign(buttons[B - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 74 | state.x.Assign(buttons[X - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 75 | state.y.Assign(buttons[Y - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 76 | state.lstick.Assign(buttons[LStick - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 77 | state.rstick.Assign(buttons[RStick - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 78 | state.l.Assign(buttons[L - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 79 | state.r.Assign(buttons[R - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 80 | state.zl.Assign(buttons[ZL - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 81 | state.zr.Assign(buttons[ZR - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 82 | state.plus.Assign(buttons[Plus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 83 | state.minus.Assign(buttons[Minus - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 84 | |||
| 85 | state.dleft.Assign(buttons[DLeft - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 86 | state.dup.Assign(buttons[DUp - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 87 | state.dright.Assign(buttons[DRight - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 88 | state.ddown.Assign(buttons[DDown - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 89 | |||
| 90 | state.lstick_left.Assign(buttons[LStick_Left - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 91 | state.lstick_up.Assign(buttons[LStick_Up - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 92 | state.lstick_right.Assign(buttons[LStick_Right - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 93 | state.lstick_down.Assign(buttons[LStick_Down - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 94 | |||
| 95 | state.rstick_left.Assign(buttons[RStick_Left - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 96 | state.rstick_up.Assign(buttons[RStick_Up - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 97 | state.rstick_right.Assign(buttons[RStick_Right - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 98 | state.rstick_down.Assign(buttons[RStick_Down - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 99 | |||
| 100 | state.sl.Assign(buttons[SL - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 101 | state.sr.Assign(buttons[SR - BUTTON_HID_BEGIN]->GetStatus()); | ||
| 102 | |||
| 103 | // TODO(shinyquagsire23): Analog stick vals | ||
| 104 | |||
| 105 | // TODO(shinyquagsire23): Update pad info proper, (circular buffers, timestamps, layouts) | ||
| 106 | |||
| 107 | // TODO(shinyquagsire23): Update touch info | ||
| 108 | |||
| 109 | // TODO(shinyquagsire23): Signal events | ||
| 110 | |||
| 111 | // Reschedule recurrent event | ||
| 112 | CoreTiming::ScheduleEvent(pad_update_ticks - cycles_late, pad_update_event); | ||
| 113 | } | ||
| 114 | |||
| 37 | // Handle to shared memory region designated to HID service | 115 | // Handle to shared memory region designated to HID service |
| 38 | Kernel::SharedPtr<Kernel::SharedMemory> shared_mem; | 116 | Kernel::SharedPtr<Kernel::SharedMemory> shared_mem; |
| 117 | |||
| 118 | // CoreTiming update events | ||
| 119 | CoreTiming::EventType* pad_update_event; | ||
| 120 | |||
| 121 | // Stored input state info | ||
| 122 | std::atomic<bool> is_device_reload_pending{true}; | ||
| 123 | std::array<std::unique_ptr<Input::ButtonDevice>, Settings::NativeButton::NUM_BUTTONS_HID> | ||
| 124 | buttons; | ||
| 39 | }; | 125 | }; |
| 40 | 126 | ||
| 41 | class Hid final : public ServiceFramework<Hid> { | 127 | class Hid final : public ServiceFramework<Hid> { |
diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index f7621f62d..486e64800 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h | |||
| @@ -5,10 +5,322 @@ | |||
| 5 | #pragma once | 5 | #pragma once |
| 6 | 6 | ||
| 7 | #include "core/hle/service/service.h" | 7 | #include "core/hle/service/service.h" |
| 8 | #include "core/settings.h" | ||
| 8 | 9 | ||
| 9 | namespace Service { | 10 | namespace Service { |
| 10 | namespace HID { | 11 | namespace HID { |
| 11 | 12 | ||
| 13 | // Begin enums and output structs | ||
| 14 | |||
| 15 | enum ControllerType : u32 { | ||
| 16 | ControllerType_ProController = 1 << 0, | ||
| 17 | ControllerType_Handheld = 1 << 1, | ||
| 18 | ControllerType_JoyconPair = 1 << 2, | ||
| 19 | ControllerType_JoyconLeft = 1 << 3, | ||
| 20 | ControllerType_JoyconRight = 1 << 4, | ||
| 21 | }; | ||
| 22 | |||
| 23 | enum ControllerLayoutType : u32 { | ||
| 24 | Layout_ProController = 0, // Pro Controller or HID gamepad | ||
| 25 | Layout_Handheld = 1, // Two Joy-Con docked to rails | ||
| 26 | Layout_Single = 2, // Horizontal single Joy-Con or pair of Joy-Con, adjusted for orientation | ||
| 27 | Layout_Left = 3, // Only raw left Joy-Con state, no orientation adjustment | ||
| 28 | Layout_Right = 4, // Only raw right Joy-Con state, no orientation adjustment | ||
| 29 | Layout_DefaultDigital = 5, // Same as next, but sticks have 8-direction values only | ||
| 30 | Layout_Default = 6, // Safe default, single Joy-Con have buttons/sticks rotated for orientation | ||
| 31 | }; | ||
| 32 | |||
| 33 | enum ControllerColorDescription { | ||
| 34 | ColorDesc_ColorsNonexistent = 1 << 1, | ||
| 35 | }; | ||
| 36 | |||
| 37 | enum ControllerConnectionState { | ||
| 38 | ConnectionState_Connected = 1 << 0, | ||
| 39 | ConnectionState_Wired = 1 << 1, | ||
| 40 | }; | ||
| 41 | |||
| 42 | enum ControllerID { | ||
| 43 | Controller_Player1 = 0, | ||
| 44 | Controller_Player2 = 1, | ||
| 45 | Controller_Player3 = 2, | ||
| 46 | Controller_Player4 = 3, | ||
| 47 | Controller_Player5 = 4, | ||
| 48 | Controller_Player6 = 5, | ||
| 49 | Controller_Player7 = 6, | ||
| 50 | Controller_Player8 = 7, | ||
| 51 | Controller_Handheld = 8, | ||
| 52 | Controller_Unknown = 9, | ||
| 53 | }; | ||
| 54 | |||
| 55 | // End enums and output structs | ||
| 56 | |||
| 57 | // Begin TouchScreen | ||
| 58 | |||
| 59 | struct TouchScreenHeader { | ||
| 60 | u64 timestampTicks; | ||
| 61 | u64 numEntries; | ||
| 62 | u64 latestEntry; | ||
| 63 | u64 maxEntryIndex; | ||
| 64 | u64 timestamp; | ||
| 65 | }; | ||
| 66 | static_assert(sizeof(TouchScreenHeader) == 0x28, | ||
| 67 | "HID touch screen header structure has incorrect size"); | ||
| 68 | |||
| 69 | struct TouchScreenEntryHeader { | ||
| 70 | u64 timestamp; | ||
| 71 | u64 numTouches; | ||
| 72 | }; | ||
| 73 | static_assert(sizeof(TouchScreenEntryHeader) == 0x10, | ||
| 74 | "HID touch screen entry header structure has incorrect size"); | ||
| 75 | |||
| 76 | struct TouchScreenEntryTouch { | ||
| 77 | u64 timestamp; | ||
| 78 | u32 padding; | ||
| 79 | u32 touchIndex; | ||
| 80 | u32 x; | ||
| 81 | u32 y; | ||
| 82 | u32 diameterX; | ||
| 83 | u32 diameterY; | ||
| 84 | u32 angle; | ||
| 85 | u32 padding_2; | ||
| 86 | }; | ||
| 87 | static_assert(sizeof(TouchScreenEntryTouch) == 0x28, | ||
| 88 | "HID touch screen touch structure has incorrect size"); | ||
| 89 | |||
| 90 | struct TouchScreenEntry { | ||
| 91 | TouchScreenEntryHeader header; | ||
| 92 | std::array<TouchScreenEntryTouch, 16> touches; | ||
| 93 | u64 unk; | ||
| 94 | }; | ||
| 95 | static_assert(sizeof(TouchScreenEntry) == 0x298, | ||
| 96 | "HID touch screen entry structure has incorrect size"); | ||
| 97 | |||
| 98 | struct TouchScreen { | ||
| 99 | TouchScreenHeader header; | ||
| 100 | std::array<TouchScreenEntry, 17> entries; | ||
| 101 | std::array<u8, 0x3c0> padding; | ||
| 102 | }; | ||
| 103 | static_assert(sizeof(TouchScreen) == 0x3000, "HID touch screen structure has incorrect size"); | ||
| 104 | |||
| 105 | // End TouchScreen | ||
| 106 | |||
| 107 | // Begin Mouse | ||
| 108 | |||
| 109 | struct MouseHeader { | ||
| 110 | u64 timestampTicks; | ||
| 111 | u64 numEntries; | ||
| 112 | u64 latestEntry; | ||
| 113 | u64 maxEntryIndex; | ||
| 114 | }; | ||
| 115 | static_assert(sizeof(MouseHeader) == 0x20, "HID mouse header structure has incorrect size"); | ||
| 116 | |||
| 117 | struct MouseButtonState { | ||
| 118 | union { | ||
| 119 | u64 hex{}; | ||
| 120 | |||
| 121 | // Buttons | ||
| 122 | BitField<0, 1, u64> left; | ||
| 123 | BitField<1, 1, u64> right; | ||
| 124 | BitField<2, 1, u64> middle; | ||
| 125 | BitField<3, 1, u64> forward; | ||
| 126 | BitField<4, 1, u64> back; | ||
| 127 | }; | ||
| 128 | }; | ||
| 129 | |||
| 130 | struct MouseEntry { | ||
| 131 | u64 timestamp; | ||
| 132 | u64 timestamp_2; | ||
| 133 | u32 x; | ||
| 134 | u32 y; | ||
| 135 | u32 velocityX; | ||
| 136 | u32 velocityY; | ||
| 137 | u32 scrollVelocityX; | ||
| 138 | u32 scrollVelocityY; | ||
| 139 | MouseButtonState buttons; | ||
| 140 | }; | ||
| 141 | static_assert(sizeof(MouseEntry) == 0x30, "HID mouse entry structure has incorrect size"); | ||
| 142 | |||
| 143 | struct Mouse { | ||
| 144 | MouseHeader header; | ||
| 145 | std::array<MouseEntry, 17> entries; | ||
| 146 | std::array<u8, 0xB0> padding; | ||
| 147 | }; | ||
| 148 | static_assert(sizeof(Mouse) == 0x400, "HID mouse structure has incorrect size"); | ||
| 149 | |||
| 150 | // End Mouse | ||
| 151 | |||
| 152 | // Begin Keyboard | ||
| 153 | |||
| 154 | struct KeyboardHeader { | ||
| 155 | u64 timestampTicks; | ||
| 156 | u64 numEntries; | ||
| 157 | u64 latestEntry; | ||
| 158 | u64 maxEntryIndex; | ||
| 159 | }; | ||
| 160 | static_assert(sizeof(KeyboardHeader) == 0x20, "HID keyboard header structure has incorrect size"); | ||
| 161 | |||
| 162 | struct KeyboardModifierKeyState { | ||
| 163 | union { | ||
| 164 | u64 hex{}; | ||
| 165 | |||
| 166 | // Buttons | ||
| 167 | BitField<0, 1, u64> lctrl; | ||
| 168 | BitField<1, 1, u64> lshift; | ||
| 169 | BitField<2, 1, u64> lalt; | ||
| 170 | BitField<3, 1, u64> lmeta; | ||
| 171 | BitField<4, 1, u64> rctrl; | ||
| 172 | BitField<5, 1, u64> rshift; | ||
| 173 | BitField<6, 1, u64> ralt; | ||
| 174 | BitField<7, 1, u64> rmeta; | ||
| 175 | BitField<8, 1, u64> capslock; | ||
| 176 | BitField<9, 1, u64> scrolllock; | ||
| 177 | BitField<10, 1, u64> numlock; | ||
| 178 | }; | ||
| 179 | }; | ||
| 180 | |||
| 181 | struct KeyboardEntry { | ||
| 182 | u64 timestamp; | ||
| 183 | u64 timestamp_2; | ||
| 184 | KeyboardModifierKeyState modifier; | ||
| 185 | u32 keys[8]; | ||
| 186 | }; | ||
| 187 | static_assert(sizeof(KeyboardEntry) == 0x38, "HID keyboard entry structure has incorrect size"); | ||
| 188 | |||
| 189 | struct Keyboard { | ||
| 190 | KeyboardHeader header; | ||
| 191 | std::array<KeyboardEntry, 17> entries; | ||
| 192 | std::array<u8, 0x28> padding; | ||
| 193 | }; | ||
| 194 | static_assert(sizeof(Keyboard) == 0x400, "HID keyboard structure has incorrect size"); | ||
| 195 | |||
| 196 | // End Keyboard | ||
| 197 | |||
| 198 | // Begin Controller | ||
| 199 | |||
| 200 | struct ControllerMAC { | ||
| 201 | u64 timestamp; | ||
| 202 | std::array<u8, 0x8> mac; | ||
| 203 | u64 unk; | ||
| 204 | u64 timestamp_2; | ||
| 205 | }; | ||
| 206 | static_assert(sizeof(ControllerMAC) == 0x20, "HID controller MAC structure has incorrect size"); | ||
| 207 | |||
| 208 | struct ControllerHeader { | ||
| 209 | u32 type; | ||
| 210 | u32 isHalf; | ||
| 211 | u32 singleColorsDescriptor; | ||
| 212 | u32 singleColorBody; | ||
| 213 | u32 singleColorButtons; | ||
| 214 | u32 splitColorsDescriptor; | ||
| 215 | u32 leftColorBody; | ||
| 216 | u32 leftColorButtons; | ||
| 217 | u32 rightColorBody; | ||
| 218 | u32 rightColorbuttons; | ||
| 219 | }; | ||
| 220 | static_assert(sizeof(ControllerHeader) == 0x28, | ||
| 221 | "HID controller header structure has incorrect size"); | ||
| 222 | |||
| 223 | struct ControllerLayoutHeader { | ||
| 224 | u64 timestampTicks; | ||
| 225 | u64 numEntries; | ||
| 226 | u64 latestEntry; | ||
| 227 | u64 maxEntryIndex; | ||
| 228 | }; | ||
| 229 | static_assert(sizeof(ControllerLayoutHeader) == 0x20, | ||
| 230 | "HID controller layout header structure has incorrect size"); | ||
| 231 | |||
| 232 | struct ControllerPadState { | ||
| 233 | union { | ||
| 234 | u64 hex{}; | ||
| 235 | |||
| 236 | // Buttons | ||
| 237 | BitField<0, 1, u64> a; | ||
| 238 | BitField<1, 1, u64> b; | ||
| 239 | BitField<2, 1, u64> x; | ||
| 240 | BitField<3, 1, u64> y; | ||
| 241 | BitField<4, 1, u64> lstick; | ||
| 242 | BitField<5, 1, u64> rstick; | ||
| 243 | BitField<6, 1, u64> l; | ||
| 244 | BitField<7, 1, u64> r; | ||
| 245 | BitField<8, 1, u64> zl; | ||
| 246 | BitField<9, 1, u64> zr; | ||
| 247 | BitField<10, 1, u64> plus; | ||
| 248 | BitField<11, 1, u64> minus; | ||
| 249 | |||
| 250 | // D-pad buttons | ||
| 251 | BitField<12, 1, u64> dleft; | ||
| 252 | BitField<13, 1, u64> dup; | ||
| 253 | BitField<14, 1, u64> dright; | ||
| 254 | BitField<15, 1, u64> ddown; | ||
| 255 | |||
| 256 | // Left stick directions | ||
| 257 | BitField<16, 1, u64> lstick_left; | ||
| 258 | BitField<17, 1, u64> lstick_up; | ||
| 259 | BitField<18, 1, u64> lstick_right; | ||
| 260 | BitField<19, 1, u64> lstick_down; | ||
| 261 | |||
| 262 | // Right stick directions | ||
| 263 | BitField<20, 1, u64> rstick_left; | ||
| 264 | BitField<21, 1, u64> rstick_up; | ||
| 265 | BitField<22, 1, u64> rstick_right; | ||
| 266 | BitField<23, 1, u64> rstick_down; | ||
| 267 | |||
| 268 | BitField<24, 1, u64> sl; | ||
| 269 | BitField<25, 1, u64> sr; | ||
| 270 | }; | ||
| 271 | }; | ||
| 272 | |||
| 273 | struct ControllerInputEntry { | ||
| 274 | u64 timestamp; | ||
| 275 | u64 timestamp_2; | ||
| 276 | ControllerPadState buttons; | ||
| 277 | u32 joystickLeftX; | ||
| 278 | u32 joystickLeftY; | ||
| 279 | u32 joystickRightX; | ||
| 280 | u32 joystickRightY; | ||
| 281 | u64 connectionState; | ||
| 282 | }; | ||
| 283 | static_assert(sizeof(ControllerInputEntry) == 0x30, | ||
| 284 | "HID controller input entry structure has incorrect size"); | ||
| 285 | |||
| 286 | struct ControllerLayout { | ||
| 287 | ControllerLayoutHeader header; | ||
| 288 | std::array<ControllerInputEntry, 17> entries; | ||
| 289 | }; | ||
| 290 | static_assert(sizeof(ControllerLayout) == 0x350, | ||
| 291 | "HID controller layout structure has incorrect size"); | ||
| 292 | |||
| 293 | struct Controller { | ||
| 294 | ControllerHeader header; | ||
| 295 | std::array<ControllerLayout, 7> layouts; | ||
| 296 | std::array<u8, 0x2a70> unk_1; | ||
| 297 | ControllerMAC macLeft; | ||
| 298 | ControllerMAC macRight; | ||
| 299 | std::array<u8, 0xdf8> unk_2; | ||
| 300 | }; | ||
| 301 | static_assert(sizeof(Controller) == 0x5000, "HID controller structure has incorrect size"); | ||
| 302 | |||
| 303 | // End Controller | ||
| 304 | |||
| 305 | struct SharedMemory { | ||
| 306 | std::array<u8, 0x400> header; | ||
| 307 | TouchScreen touchscreen; | ||
| 308 | Mouse mouse; | ||
| 309 | Keyboard keyboard; | ||
| 310 | std::array<u8, 0x400> unkSection1; | ||
| 311 | std::array<u8, 0x400> unkSection2; | ||
| 312 | std::array<u8, 0x400> unkSection3; | ||
| 313 | std::array<u8, 0x400> unkSection4; | ||
| 314 | std::array<u8, 0x200> unkSection5; | ||
| 315 | std::array<u8, 0x200> unkSection6; | ||
| 316 | std::array<u8, 0x200> unkSection7; | ||
| 317 | std::array<u8, 0x800> unkSection8; | ||
| 318 | std::array<u8, 0x4000> controllerSerials; | ||
| 319 | std::array<Controller, 10> controllers; | ||
| 320 | std::array<u8, 0x4600> unkSection9; | ||
| 321 | }; | ||
| 322 | static_assert(sizeof(SharedMemory) == 0x40000, "HID Shared Memory structure has incorrect size"); | ||
| 323 | |||
| 12 | /// Reload input devices. Used when input configuration changed | 324 | /// Reload input devices. Used when input configuration changed |
| 13 | void ReloadInputDevices(); | 325 | void ReloadInputDevices(); |
| 14 | 326 | ||
diff --git a/src/core/settings.h b/src/core/settings.h index f2c88e5d4..bd9a3d9fe 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -16,52 +16,87 @@ enum Values { | |||
| 16 | B, | 16 | B, |
| 17 | X, | 17 | X, |
| 18 | Y, | 18 | Y, |
| 19 | Up, | 19 | LStick, |
| 20 | Down, | 20 | RStick, |
| 21 | Left, | ||
| 22 | Right, | ||
| 23 | L, | 21 | L, |
| 24 | R, | 22 | R, |
| 25 | Start, | ||
| 26 | Select, | ||
| 27 | |||
| 28 | ZL, | 23 | ZL, |
| 29 | ZR, | 24 | ZR, |
| 25 | Plus, | ||
| 26 | Minus, | ||
| 27 | |||
| 28 | DLeft, | ||
| 29 | DUp, | ||
| 30 | DRight, | ||
| 31 | DDown, | ||
| 32 | |||
| 33 | LStick_Left, | ||
| 34 | LStick_Up, | ||
| 35 | LStick_Right, | ||
| 36 | LStick_Down, | ||
| 37 | |||
| 38 | RStick_Left, | ||
| 39 | RStick_Up, | ||
| 40 | RStick_Right, | ||
| 41 | RStick_Down, | ||
| 42 | |||
| 43 | SL, | ||
| 44 | SR, | ||
| 30 | 45 | ||
| 31 | Home, | 46 | Home, |
| 47 | Screenshot, | ||
| 32 | 48 | ||
| 33 | NumButtons, | 49 | NumButtons, |
| 34 | }; | 50 | }; |
| 35 | 51 | ||
| 36 | constexpr int BUTTON_HID_BEGIN = A; | 52 | constexpr int BUTTON_HID_BEGIN = A; |
| 37 | constexpr int BUTTON_IR_BEGIN = ZL; | ||
| 38 | constexpr int BUTTON_NS_BEGIN = Home; | 53 | constexpr int BUTTON_NS_BEGIN = Home; |
| 39 | 54 | ||
| 40 | constexpr int BUTTON_HID_END = BUTTON_IR_BEGIN; | 55 | constexpr int BUTTON_HID_END = BUTTON_NS_BEGIN; |
| 41 | constexpr int BUTTON_IR_END = BUTTON_NS_BEGIN; | ||
| 42 | constexpr int BUTTON_NS_END = NumButtons; | 56 | constexpr int BUTTON_NS_END = NumButtons; |
| 43 | 57 | ||
| 44 | constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; | 58 | constexpr int NUM_BUTTONS_HID = BUTTON_HID_END - BUTTON_HID_BEGIN; |
| 45 | constexpr int NUM_BUTTONS_IR = BUTTON_IR_END - BUTTON_IR_BEGIN; | ||
| 46 | constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; | 59 | constexpr int NUM_BUTTONS_NS = BUTTON_NS_END - BUTTON_NS_BEGIN; |
| 47 | 60 | ||
| 48 | static const std::array<const char*, NumButtons> mapping = {{ | 61 | static const std::array<const char*, NumButtons> mapping = {{ |
| 49 | "button_a", "button_b", "button_x", "button_y", "button_up", "button_down", "button_left", | 62 | "button_a", |
| 50 | "button_right", "button_l", "button_r", "button_start", "button_select", "button_zl", | 63 | "button_b", |
| 51 | "button_zr", "button_home", | 64 | "button_x", |
| 65 | "button_y", | ||
| 66 | "button_lstick", | ||
| 67 | "button_rstick", | ||
| 68 | "button_l", | ||
| 69 | "button_r", | ||
| 70 | "button_zl", | ||
| 71 | "button_zr", | ||
| 72 | "button_plus", | ||
| 73 | "button_minus", | ||
| 74 | "button_dleft", | ||
| 75 | "button_dup", | ||
| 76 | "button_dright", | ||
| 77 | "button_ddown", | ||
| 78 | "button_lstick_left", | ||
| 79 | "button_lstick_up", | ||
| 80 | "button_lstick_right", | ||
| 81 | "button_lstick_down", | ||
| 82 | "button_sl", | ||
| 83 | "button_sr", | ||
| 84 | "button_home", | ||
| 85 | "button_screenshot", | ||
| 52 | }}; | 86 | }}; |
| 53 | } // namespace NativeButton | 87 | } // namespace NativeButton |
| 54 | 88 | ||
| 55 | namespace NativeAnalog { | 89 | namespace NativeAnalog { |
| 56 | enum Values { | 90 | enum Values { |
| 57 | CirclePad, | 91 | LStick, |
| 58 | CStick, | 92 | RStick, |
| 59 | 93 | ||
| 60 | NumAnalogs, | 94 | NumAnalogs, |
| 61 | }; | 95 | }; |
| 62 | 96 | ||
| 63 | static const std::array<const char*, NumAnalogs> mapping = {{ | 97 | static const std::array<const char*, NumAnalogs> mapping = {{ |
| 64 | "circle_pad", "c_stick", | 98 | "lstick", |
| 99 | "rstick", | ||
| 65 | }}; | 100 | }}; |
| 66 | } // namespace NativeAnalog | 101 | } // namespace NativeAnalog |
| 67 | 102 | ||
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp index 4c713fcbc..9ce851d17 100644 --- a/src/yuzu/configuration/config.cpp +++ b/src/yuzu/configuration/config.cpp | |||
| @@ -19,16 +19,18 @@ Config::Config() { | |||
| 19 | } | 19 | } |
| 20 | 20 | ||
| 21 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { | 21 | const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = { |
| 22 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_T, Qt::Key_G, Qt::Key_F, Qt::Key_H, | 22 | Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q, Qt::Key_W, |
| 23 | Qt::Key_Q, Qt::Key_W, Qt::Key_M, Qt::Key_N, Qt::Key_1, Qt::Key_2, Qt::Key_B, | 23 | Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T, Qt::Key_H, Qt::Key_G, |
| 24 | Qt::Key_Left, Qt::Key_Up, Qt::Key_Right, Qt::Key_Down, Qt::Key_J, Qt::Key_I, Qt::Key_L, | ||
| 25 | Qt::Key_K, Qt::Key_D, Qt::Key_C, Qt::Key_B, Qt::Key_V, | ||
| 24 | }; | 26 | }; |
| 25 | 27 | ||
| 26 | const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{ | 28 | const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{ |
| 27 | { | 29 | { |
| 28 | Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_D, | 30 | Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right, Qt::Key_E, |
| 29 | }, | 31 | }, |
| 30 | { | 32 | { |
| 31 | Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, Qt::Key_D, | 33 | Qt::Key_I, Qt::Key_K, Qt::Key_J, Qt::Key_L, Qt::Key_R, |
| 32 | }, | 34 | }, |
| 33 | }}; | 35 | }}; |
| 34 | 36 | ||
diff --git a/src/yuzu/configuration/configure_input.cpp b/src/yuzu/configuration/configure_input.cpp index 4c2a3e738..d92a1fed9 100644 --- a/src/yuzu/configuration/configure_input.cpp +++ b/src/yuzu/configuration/configure_input.cpp | |||
| @@ -54,19 +54,23 @@ ConfigureInput::ConfigureInput(QWidget* parent) | |||
| 54 | setFocusPolicy(Qt::ClickFocus); | 54 | setFocusPolicy(Qt::ClickFocus); |
| 55 | 55 | ||
| 56 | button_map = { | 56 | button_map = { |
| 57 | ui->buttonA, ui->buttonB, ui->buttonX, ui->buttonY, ui->buttonDpadUp, | 57 | ui->buttonA, ui->buttonB, ui->buttonX, ui->buttonY, |
| 58 | ui->buttonDpadDown, ui->buttonDpadLeft, ui->buttonDpadRight, ui->buttonL, ui->buttonR, | 58 | ui->buttonLStick, ui->buttonRStick, ui->buttonL, ui->buttonR, |
| 59 | ui->buttonStart, ui->buttonSelect, ui->buttonZL, ui->buttonZR, ui->buttonHome, | 59 | ui->buttonZL, ui->buttonZR, ui->buttonPlus, ui->buttonMinus, |
| 60 | ui->buttonDpadLeft, ui->buttonDpadUp, ui->buttonDpadRight, ui->buttonDpadDown, | ||
| 61 | ui->buttonLStickLeft, ui->buttonLStickUp, ui->buttonLStickRight, ui->buttonLStickDown, | ||
| 62 | ui->buttonRStickLeft, ui->buttonRStickUp, ui->buttonRStickRight, ui->buttonRStickDown, | ||
| 63 | ui->buttonSL, ui->buttonSR, ui->buttonHome, ui->buttonScreenshot, | ||
| 60 | }; | 64 | }; |
| 61 | 65 | ||
| 62 | analog_map = {{ | 66 | analog_map = {{ |
| 63 | { | 67 | { |
| 64 | ui->buttonCircleUp, ui->buttonCircleDown, ui->buttonCircleLeft, ui->buttonCircleRight, | 68 | ui->buttonLStickUp, ui->buttonLStickDown, ui->buttonLStickLeft, ui->buttonLStickRight, |
| 65 | ui->buttonCircleMod, | 69 | ui->buttonLStickMod, |
| 66 | }, | 70 | }, |
| 67 | { | 71 | { |
| 68 | ui->buttonCStickUp, ui->buttonCStickDown, ui->buttonCStickLeft, ui->buttonCStickRight, | 72 | ui->buttonRStickUp, ui->buttonRStickDown, ui->buttonRStickLeft, ui->buttonRStickRight, |
| 69 | nullptr, | 73 | ui->buttonRStickMod, |
| 70 | }, | 74 | }, |
| 71 | }}; | 75 | }}; |
| 72 | 76 | ||
diff --git a/src/yuzu/configuration/configure_input.ui b/src/yuzu/configuration/configure_input.ui index 2760787e5..5143c9d72 100644 --- a/src/yuzu/configuration/configure_input.ui +++ b/src/yuzu/configuration/configure_input.ui | |||
| @@ -6,8 +6,8 @@ | |||
| 6 | <rect> | 6 | <rect> |
| 7 | <x>0</x> | 7 | <x>0</x> |
| 8 | <y>0</y> | 8 | <y>0</y> |
| 9 | <width>370</width> | 9 | <width>343</width> |
| 10 | <height>534</height> | 10 | <height>665</height> |
| 11 | </rect> | 11 | </rect> |
| 12 | </property> | 12 | </property> |
| 13 | <property name="windowTitle"> | 13 | <property name="windowTitle"> |
| @@ -190,7 +190,108 @@ | |||
| 190 | </layout> | 190 | </layout> |
| 191 | </widget> | 191 | </widget> |
| 192 | </item> | 192 | </item> |
| 193 | <item row="1" column="0"> | 193 | <item row="3" column="1"> |
| 194 | <widget class="QGroupBox" name="faceButtons_6"> | ||
| 195 | <property name="title"> | ||
| 196 | <string>Misc.</string> | ||
| 197 | </property> | ||
| 198 | <property name="flat"> | ||
| 199 | <bool>false</bool> | ||
| 200 | </property> | ||
| 201 | <property name="checkable"> | ||
| 202 | <bool>false</bool> | ||
| 203 | </property> | ||
| 204 | <layout class="QGridLayout" name="gridLayout_6"> | ||
| 205 | <item row="0" column="0"> | ||
| 206 | <layout class="QVBoxLayout" name="verticalLayout_25"> | ||
| 207 | <item> | ||
| 208 | <widget class="QLabel" name="label_29"> | ||
| 209 | <property name="text"> | ||
| 210 | <string>Plus:</string> | ||
| 211 | </property> | ||
| 212 | </widget> | ||
| 213 | </item> | ||
| 214 | <item> | ||
| 215 | <widget class="QPushButton" name="buttonPlus"> | ||
| 216 | <property name="text"> | ||
| 217 | <string/> | ||
| 218 | </property> | ||
| 219 | </widget> | ||
| 220 | </item> | ||
| 221 | </layout> | ||
| 222 | </item> | ||
| 223 | <item row="0" column="1"> | ||
| 224 | <layout class="QVBoxLayout" name="verticalLayout_26"> | ||
| 225 | <item> | ||
| 226 | <widget class="QLabel" name="label_30"> | ||
| 227 | <property name="text"> | ||
| 228 | <string>Minus:</string> | ||
| 229 | </property> | ||
| 230 | </widget> | ||
| 231 | </item> | ||
| 232 | <item> | ||
| 233 | <widget class="QPushButton" name="buttonMinus"> | ||
| 234 | <property name="text"> | ||
| 235 | <string/> | ||
| 236 | </property> | ||
| 237 | </widget> | ||
| 238 | </item> | ||
| 239 | </layout> | ||
| 240 | </item> | ||
| 241 | <item row="1" column="0"> | ||
| 242 | <layout class="QVBoxLayout" name="verticalLayout_27"> | ||
| 243 | <item> | ||
| 244 | <widget class="QLabel" name="label_31"> | ||
| 245 | <property name="text"> | ||
| 246 | <string>Home:</string> | ||
| 247 | </property> | ||
| 248 | </widget> | ||
| 249 | </item> | ||
| 250 | <item> | ||
| 251 | <widget class="QPushButton" name="buttonHome"> | ||
| 252 | <property name="text"> | ||
| 253 | <string/> | ||
| 254 | </property> | ||
| 255 | </widget> | ||
| 256 | </item> | ||
| 257 | </layout> | ||
| 258 | </item> | ||
| 259 | <item row="1" column="1"> | ||
| 260 | <layout class="QVBoxLayout" name="verticalLayout_28"> | ||
| 261 | <item> | ||
| 262 | <widget class="QLabel" name="label_11"> | ||
| 263 | <property name="text"> | ||
| 264 | <string>Screen | ||
| 265 | Capture:</string> | ||
| 266 | </property> | ||
| 267 | </widget> | ||
| 268 | </item> | ||
| 269 | <item> | ||
| 270 | <widget class="QPushButton" name="buttonScreenshot"> | ||
| 271 | <property name="text"> | ||
| 272 | <string/> | ||
| 273 | </property> | ||
| 274 | </widget> | ||
| 275 | </item> | ||
| 276 | </layout> | ||
| 277 | </item> | ||
| 278 | <item row="2" column="1"> | ||
| 279 | <spacer name="verticalSpacer"> | ||
| 280 | <property name="orientation"> | ||
| 281 | <enum>Qt::Vertical</enum> | ||
| 282 | </property> | ||
| 283 | <property name="sizeHint" stdset="0"> | ||
| 284 | <size> | ||
| 285 | <width>20</width> | ||
| 286 | <height>40</height> | ||
| 287 | </size> | ||
| 288 | </property> | ||
| 289 | </spacer> | ||
| 290 | </item> | ||
| 291 | </layout> | ||
| 292 | </widget> | ||
| 293 | </item> | ||
| 294 | <item row="3" column="0"> | ||
| 194 | <widget class="QGroupBox" name="faceButtons_3"> | 295 | <widget class="QGroupBox" name="faceButtons_3"> |
| 195 | <property name="title"> | 296 | <property name="title"> |
| 196 | <string>Shoulder Buttons</string> | 297 | <string>Shoulder Buttons</string> |
| @@ -274,13 +375,49 @@ | |||
| 274 | </item> | 375 | </item> |
| 275 | </layout> | 376 | </layout> |
| 276 | </item> | 377 | </item> |
| 378 | <item row="2" column="0"> | ||
| 379 | <layout class="QVBoxLayout" name="verticalLayout_8"> | ||
| 380 | <item> | ||
| 381 | <widget class="QLabel" name="label_7"> | ||
| 382 | <property name="text"> | ||
| 383 | <string>SL:</string> | ||
| 384 | </property> | ||
| 385 | </widget> | ||
| 386 | </item> | ||
| 387 | <item> | ||
| 388 | <widget class="QPushButton" name="buttonSL"> | ||
| 389 | <property name="text"> | ||
| 390 | <string/> | ||
| 391 | </property> | ||
| 392 | </widget> | ||
| 393 | </item> | ||
| 394 | </layout> | ||
| 395 | </item> | ||
| 396 | <item row="2" column="1"> | ||
| 397 | <layout class="QVBoxLayout" name="verticalLayout_29"> | ||
| 398 | <item> | ||
| 399 | <widget class="QLabel" name="label_8"> | ||
| 400 | <property name="text"> | ||
| 401 | <string>SR:</string> | ||
| 402 | </property> | ||
| 403 | </widget> | ||
| 404 | </item> | ||
| 405 | <item> | ||
| 406 | <widget class="QPushButton" name="buttonSR"> | ||
| 407 | <property name="text"> | ||
| 408 | <string/> | ||
| 409 | </property> | ||
| 410 | </widget> | ||
| 411 | </item> | ||
| 412 | </layout> | ||
| 413 | </item> | ||
| 277 | </layout> | 414 | </layout> |
| 278 | </widget> | 415 | </widget> |
| 279 | </item> | 416 | </item> |
| 280 | <item row="1" column="1"> | 417 | <item row="1" column="0"> |
| 281 | <widget class="QGroupBox" name="faceButtons_4"> | 418 | <widget class="QGroupBox" name="faceButtons_4"> |
| 282 | <property name="title"> | 419 | <property name="title"> |
| 283 | <string>Circle Pad</string> | 420 | <string>Left Stick</string> |
| 284 | </property> | 421 | </property> |
| 285 | <property name="flat"> | 422 | <property name="flat"> |
| 286 | <bool>false</bool> | 423 | <bool>false</bool> |
| @@ -299,7 +436,7 @@ | |||
| 299 | </widget> | 436 | </widget> |
| 300 | </item> | 437 | </item> |
| 301 | <item> | 438 | <item> |
| 302 | <widget class="QPushButton" name="buttonCircleLeft"> | 439 | <widget class="QPushButton" name="buttonLStickLeft"> |
| 303 | <property name="text"> | 440 | <property name="text"> |
| 304 | <string/> | 441 | <string/> |
| 305 | </property> | 442 | </property> |
| @@ -317,7 +454,7 @@ | |||
| 317 | </widget> | 454 | </widget> |
| 318 | </item> | 455 | </item> |
| 319 | <item> | 456 | <item> |
| 320 | <widget class="QPushButton" name="buttonCircleRight"> | 457 | <widget class="QPushButton" name="buttonLStickRight"> |
| 321 | <property name="text"> | 458 | <property name="text"> |
| 322 | <string/> | 459 | <string/> |
| 323 | </property> | 460 | </property> |
| @@ -335,7 +472,7 @@ | |||
| 335 | </widget> | 472 | </widget> |
| 336 | </item> | 473 | </item> |
| 337 | <item> | 474 | <item> |
| 338 | <widget class="QPushButton" name="buttonCircleUp"> | 475 | <widget class="QPushButton" name="buttonLStickUp"> |
| 339 | <property name="text"> | 476 | <property name="text"> |
| 340 | <string/> | 477 | <string/> |
| 341 | </property> | 478 | </property> |
| @@ -353,7 +490,7 @@ | |||
| 353 | </widget> | 490 | </widget> |
| 354 | </item> | 491 | </item> |
| 355 | <item> | 492 | <item> |
| 356 | <widget class="QPushButton" name="buttonCircleDown"> | 493 | <widget class="QPushButton" name="buttonLStickDown"> |
| 357 | <property name="text"> | 494 | <property name="text"> |
| 358 | <string/> | 495 | <string/> |
| 359 | </property> | 496 | </property> |
| @@ -361,32 +498,17 @@ | |||
| 361 | </item> | 498 | </item> |
| 362 | </layout> | 499 | </layout> |
| 363 | </item> | 500 | </item> |
| 364 | </layout> | 501 | <item row="2" column="0"> |
| 365 | </widget> | 502 | <layout class="QVBoxLayout" name="verticalLayout_7" stretch="0,0"> |
| 366 | </item> | ||
| 367 | <item row="2" column="0"> | ||
| 368 | <widget class="QGroupBox" name="faceButtons_5"> | ||
| 369 | <property name="title"> | ||
| 370 | <string>C-Stick</string> | ||
| 371 | </property> | ||
| 372 | <property name="flat"> | ||
| 373 | <bool>false</bool> | ||
| 374 | </property> | ||
| 375 | <property name="checkable"> | ||
| 376 | <bool>false</bool> | ||
| 377 | </property> | ||
| 378 | <layout class="QGridLayout" name="gridLayout_5"> | ||
| 379 | <item row="0" column="0"> | ||
| 380 | <layout class="QVBoxLayout" name="verticalLayout_21"> | ||
| 381 | <item> | 503 | <item> |
| 382 | <widget class="QLabel" name="label_25"> | 504 | <widget class="QLabel" name="label_6"> |
| 383 | <property name="text"> | 505 | <property name="text"> |
| 384 | <string>Left:</string> | 506 | <string>Pressed:</string> |
| 385 | </property> | 507 | </property> |
| 386 | </widget> | 508 | </widget> |
| 387 | </item> | 509 | </item> |
| 388 | <item> | 510 | <item> |
| 389 | <widget class="QPushButton" name="buttonCStickLeft"> | 511 | <widget class="QPushButton" name="buttonLStick"> |
| 390 | <property name="text"> | 512 | <property name="text"> |
| 391 | <string/> | 513 | <string/> |
| 392 | </property> | 514 | </property> |
| @@ -394,17 +516,17 @@ | |||
| 394 | </item> | 516 | </item> |
| 395 | </layout> | 517 | </layout> |
| 396 | </item> | 518 | </item> |
| 397 | <item row="0" column="1"> | 519 | <item row="2" column="1"> |
| 398 | <layout class="QVBoxLayout" name="verticalLayout_22"> | 520 | <layout class="QVBoxLayout" name="verticalLayout_31"> |
| 399 | <item> | 521 | <item> |
| 400 | <widget class="QLabel" name="label_27"> | 522 | <widget class="QLabel" name="label_9"> |
| 401 | <property name="text"> | 523 | <property name="text"> |
| 402 | <string>Right:</string> | 524 | <string>Modifier:</string> |
| 403 | </property> | 525 | </property> |
| 404 | </widget> | 526 | </widget> |
| 405 | </item> | 527 | </item> |
| 406 | <item> | 528 | <item> |
| 407 | <widget class="QPushButton" name="buttonCStickRight"> | 529 | <widget class="QPushButton" name="buttonLStickMod"> |
| 408 | <property name="text"> | 530 | <property name="text"> |
| 409 | <string/> | 531 | <string/> |
| 410 | </property> | 532 | </property> |
| @@ -412,17 +534,35 @@ | |||
| 412 | </item> | 534 | </item> |
| 413 | </layout> | 535 | </layout> |
| 414 | </item> | 536 | </item> |
| 415 | <item row="1" column="0"> | 537 | </layout> |
| 416 | <layout class="QVBoxLayout" name="verticalLayout_23"> | 538 | </widget> |
| 539 | </item> | ||
| 540 | <item row="1" column="1"> | ||
| 541 | <widget class="QGroupBox" name="faceButtons_5"> | ||
| 542 | <property name="title"> | ||
| 543 | <string>Right Stick</string> | ||
| 544 | </property> | ||
| 545 | <property name="alignment"> | ||
| 546 | <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> | ||
| 547 | </property> | ||
| 548 | <property name="flat"> | ||
| 549 | <bool>false</bool> | ||
| 550 | </property> | ||
| 551 | <property name="checkable"> | ||
| 552 | <bool>false</bool> | ||
| 553 | </property> | ||
| 554 | <layout class="QGridLayout" name="gridLayout_5"> | ||
| 555 | <item row="1" column="1"> | ||
| 556 | <layout class="QVBoxLayout" name="verticalLayout_24"> | ||
| 417 | <item> | 557 | <item> |
| 418 | <widget class="QLabel" name="label_28"> | 558 | <widget class="QLabel" name="label_26"> |
| 419 | <property name="text"> | 559 | <property name="text"> |
| 420 | <string>Up:</string> | 560 | <string>Down:</string> |
| 421 | </property> | 561 | </property> |
| 422 | </widget> | 562 | </widget> |
| 423 | </item> | 563 | </item> |
| 424 | <item> | 564 | <item> |
| 425 | <widget class="QPushButton" name="buttonCStickUp"> | 565 | <widget class="QPushButton" name="buttonRStickDown"> |
| 426 | <property name="text"> | 566 | <property name="text"> |
| 427 | <string/> | 567 | <string/> |
| 428 | </property> | 568 | </property> |
| @@ -430,17 +570,17 @@ | |||
| 430 | </item> | 570 | </item> |
| 431 | </layout> | 571 | </layout> |
| 432 | </item> | 572 | </item> |
| 433 | <item row="1" column="1"> | 573 | <item row="0" column="1"> |
| 434 | <layout class="QVBoxLayout" name="verticalLayout_24"> | 574 | <layout class="QVBoxLayout" name="verticalLayout_22"> |
| 435 | <item> | 575 | <item> |
| 436 | <widget class="QLabel" name="label_26"> | 576 | <widget class="QLabel" name="label_27"> |
| 437 | <property name="text"> | 577 | <property name="text"> |
| 438 | <string>Down:</string> | 578 | <string>Right:</string> |
| 439 | </property> | 579 | </property> |
| 440 | </widget> | 580 | </widget> |
| 441 | </item> | 581 | </item> |
| 442 | <item> | 582 | <item> |
| 443 | <widget class="QPushButton" name="buttonCStickDown"> | 583 | <widget class="QPushButton" name="buttonRStickRight"> |
| 444 | <property name="text"> | 584 | <property name="text"> |
| 445 | <string/> | 585 | <string/> |
| 446 | </property> | 586 | </property> |
| @@ -448,32 +588,17 @@ | |||
| 448 | </item> | 588 | </item> |
| 449 | </layout> | 589 | </layout> |
| 450 | </item> | 590 | </item> |
| 451 | </layout> | 591 | <item row="1" column="0"> |
| 452 | </widget> | 592 | <layout class="QVBoxLayout" name="verticalLayout_23"> |
| 453 | </item> | ||
| 454 | <item row="2" column="1"> | ||
| 455 | <widget class="QGroupBox" name="faceButtons_6"> | ||
| 456 | <property name="title"> | ||
| 457 | <string>Misc.</string> | ||
| 458 | </property> | ||
| 459 | <property name="flat"> | ||
| 460 | <bool>false</bool> | ||
| 461 | </property> | ||
| 462 | <property name="checkable"> | ||
| 463 | <bool>false</bool> | ||
| 464 | </property> | ||
| 465 | <layout class="QGridLayout" name="gridLayout_6"> | ||
| 466 | <item row="0" column="0"> | ||
| 467 | <layout class="QVBoxLayout" name="verticalLayout_25"> | ||
| 468 | <item> | 593 | <item> |
| 469 | <widget class="QLabel" name="label_29"> | 594 | <widget class="QLabel" name="label_28"> |
| 470 | <property name="text"> | 595 | <property name="text"> |
| 471 | <string>Start:</string> | 596 | <string>Up:</string> |
| 472 | </property> | 597 | </property> |
| 473 | </widget> | 598 | </widget> |
| 474 | </item> | 599 | </item> |
| 475 | <item> | 600 | <item> |
| 476 | <widget class="QPushButton" name="buttonStart"> | 601 | <widget class="QPushButton" name="buttonRStickUp"> |
| 477 | <property name="text"> | 602 | <property name="text"> |
| 478 | <string/> | 603 | <string/> |
| 479 | </property> | 604 | </property> |
| @@ -481,17 +606,17 @@ | |||
| 481 | </item> | 606 | </item> |
| 482 | </layout> | 607 | </layout> |
| 483 | </item> | 608 | </item> |
| 484 | <item row="0" column="1"> | 609 | <item row="0" column="0"> |
| 485 | <layout class="QVBoxLayout" name="verticalLayout_26"> | 610 | <layout class="QVBoxLayout" name="verticalLayout_21"> |
| 486 | <item> | 611 | <item> |
| 487 | <widget class="QLabel" name="label_30"> | 612 | <widget class="QLabel" name="label_25"> |
| 488 | <property name="text"> | 613 | <property name="text"> |
| 489 | <string>Select:</string> | 614 | <string>Left:</string> |
| 490 | </property> | 615 | </property> |
| 491 | </widget> | 616 | </widget> |
| 492 | </item> | 617 | </item> |
| 493 | <item> | 618 | <item> |
| 494 | <widget class="QPushButton" name="buttonSelect"> | 619 | <widget class="QPushButton" name="buttonRStickLeft"> |
| 495 | <property name="text"> | 620 | <property name="text"> |
| 496 | <string/> | 621 | <string/> |
| 497 | </property> | 622 | </property> |
| @@ -499,17 +624,17 @@ | |||
| 499 | </item> | 624 | </item> |
| 500 | </layout> | 625 | </layout> |
| 501 | </item> | 626 | </item> |
| 502 | <item row="1" column="0"> | 627 | <item row="2" column="1"> |
| 503 | <layout class="QVBoxLayout" name="verticalLayout_27"> | 628 | <layout class="QVBoxLayout" name="verticalLayout_32"> |
| 504 | <item> | 629 | <item> |
| 505 | <widget class="QLabel" name="label_31"> | 630 | <widget class="QLabel" name="label_10"> |
| 506 | <property name="text"> | 631 | <property name="text"> |
| 507 | <string>Home:</string> | 632 | <string>Modifier:</string> |
| 508 | </property> | 633 | </property> |
| 509 | </widget> | 634 | </widget> |
| 510 | </item> | 635 | </item> |
| 511 | <item> | 636 | <item> |
| 512 | <widget class="QPushButton" name="buttonHome"> | 637 | <widget class="QPushButton" name="buttonRStickMod"> |
| 513 | <property name="text"> | 638 | <property name="text"> |
| 514 | <string/> | 639 | <string/> |
| 515 | </property> | 640 | </property> |
| @@ -517,17 +642,17 @@ | |||
| 517 | </item> | 642 | </item> |
| 518 | </layout> | 643 | </layout> |
| 519 | </item> | 644 | </item> |
| 520 | <item row="1" column="1"> | 645 | <item row="2" column="0"> |
| 521 | <layout class="QVBoxLayout" name="verticalLayout_28"> | 646 | <layout class="QVBoxLayout" name="verticalLayout_6"> |
| 522 | <item> | 647 | <item> |
| 523 | <widget class="QLabel" name="label_36"> | 648 | <widget class="QLabel" name="label_5"> |
| 524 | <property name="text"> | 649 | <property name="text"> |
| 525 | <string>Circle Mod:</string> | 650 | <string>Pressed:</string> |
| 526 | </property> | 651 | </property> |
| 527 | </widget> | 652 | </widget> |
| 528 | </item> | 653 | </item> |
| 529 | <item> | 654 | <item> |
| 530 | <widget class="QPushButton" name="buttonCircleMod"> | 655 | <widget class="QPushButton" name="buttonRStick"> |
| 531 | <property name="text"> | 656 | <property name="text"> |
| 532 | <string/> | 657 | <string/> |
| 533 | </property> | 658 | </property> |
diff --git a/src/yuzu_cmd/default_ini.h b/src/yuzu_cmd/default_ini.h index e7941eceb..469df96cc 100644 --- a/src/yuzu_cmd/default_ini.h +++ b/src/yuzu_cmd/default_ini.h | |||
| @@ -30,17 +30,26 @@ button_a= | |||
| 30 | button_b= | 30 | button_b= |
| 31 | button_x= | 31 | button_x= |
| 32 | button_y= | 32 | button_y= |
| 33 | button_up= | 33 | button_lstick= |
| 34 | button_down= | 34 | button_rstick= |
| 35 | button_left= | ||
| 36 | button_right= | ||
| 37 | button_l= | 35 | button_l= |
| 38 | button_r= | 36 | button_r= |
| 39 | button_start= | ||
| 40 | button_select= | ||
| 41 | button_zl= | 37 | button_zl= |
| 42 | button_zr= | 38 | button_zr= |
| 39 | button_plus= | ||
| 40 | button_minus= | ||
| 41 | button_dleft= | ||
| 42 | button_dup= | ||
| 43 | button_dright= | ||
| 44 | button_ddown= | ||
| 45 | button_lstick_left= | ||
| 46 | button_lstick_up= | ||
| 47 | button_lstick_right= | ||
| 48 | button_lstick_down= | ||
| 49 | button_sl= | ||
| 50 | button_sr= | ||
| 43 | button_home= | 51 | button_home= |
| 52 | button_screenshot= | ||
| 44 | 53 | ||
| 45 | # for analog input, the following devices are available: | 54 | # for analog input, the following devices are available: |
| 46 | # - "analog_from_button" (default) for emulating analog input from direction buttons. Required parameters: | 55 | # - "analog_from_button" (default) for emulating analog input from direction buttons. Required parameters: |
| @@ -53,8 +62,8 @@ button_home= | |||
| 53 | # - "joystick": the index of the joystick to bind | 62 | # - "joystick": the index of the joystick to bind |
| 54 | # - "axis_x": the index of the axis to bind as x-axis (default to 0) | 63 | # - "axis_x": the index of the axis to bind as x-axis (default to 0) |
| 55 | # - "axis_y": the index of the axis to bind as y-axis (default to 1) | 64 | # - "axis_y": the index of the axis to bind as y-axis (default to 1) |
| 56 | circle_pad= | 65 | lstick= |
| 57 | c_stick= | 66 | rstick= |
| 58 | 67 | ||
| 59 | # for motion input, the following devices are available: | 68 | # for motion input, the following devices are available: |
| 60 | # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: | 69 | # - "motion_emu" (default) for emulating motion input from mouse input. Required parameters: |