Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating to main #5

Merged
merged 10 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Make Executable
working-directory: ${{github.workspace}}/tools
run: sudo chmod +x makefsdata

- name: Use Node.js
uses: actions/setup-node@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Full documentation can be found at <https://gp2040-ce.info>
## Features

* Select from 5 input modes: XInput, Nintendo Switch, PS4, PS3 and Keyboard
* Overclocked polling rate for less than 1 ms of input latency in all modes.
* Overclocked polling rate for an average of 0.77ms of input latency in Xinput, Switch and Dinput modes and on average 1.72 for Playstation 4/5.
* Multiple SOCD cleaning modes - Up Priority (a.k.a. Stickless), Neutral, and Second Input Priority.
* Left and Right stick emulation via D-pad inputs as well as dedicated toggle switches.
* Dual direction via D-pad + LS/RS.
Expand Down
Binary file modified configs/Liatris/assets/Liatris.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/OpenCore0/assets/Open_Core0_WASD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/OpenCore0/assets/Open_Core0_WASD_pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/OpenCore0WASD/assets/Open_Core0_WASD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/OpenCore0WASD/assets/Open_Core0_WASD_pinout.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/RanaTadpole/assets/RanaTadpole_buttons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified configs/ReflexEncodeV2.0/assets/ReflexBoard_V2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 34 additions & 1 deletion headers/addons/inputhistory.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,34 @@
#define INPUT_HISTORY_ROW 7
#endif

#define INPUT_HISTORY_MAX_INPUTS 22

#define CHAR_TRIANGLE "\x80"
#define CHAR_CIRCLE "\x81"
#define CHAR_CROSS "\x82"
#define CHAR_SQUARE "\x83"

#define CHAR_UP "\x84"
#define CHAR_DOWN "\x85"
#define CHAR_LEFT "\x86"
#define CHAR_RIGHT "\x87"

#define CHAR_UL "\x88"
#define CHAR_UR "\x89"
#define CHAR_DL "\x8A"
#define CHAR_DR "\x8B"

#define CHAR_HOME_S "\x8C"
#define CHAR_CAP_S "\x8D"

#define CHAR_VIEW_X "\x8E"
#define CHAR_MENU_X "\x8F"
#define CHAR_HOME_X "\x90"

#define CHAR_TPAD_P "\x91"
#define CHAR_HOME_P "\x92"
#define CHAR_SHARE_P "\x93"

#define InputHistoryName "InputHistory"

class InputHistoryAddon : public GPAddon
Expand All @@ -42,13 +70,18 @@ class InputHistoryAddon : public GPAddon
uint32_t row;
std::string historyString;
std::deque<std::string> inputHistory;
std::array<bool, 18> lastInput;
std::array<bool, INPUT_HISTORY_MAX_INPUTS> lastInput;
Gamepad* gamepad;
Gamepad* pGamepad;
bool pressedUp();
bool pressedDown();
bool pressedLeft();
bool pressedRight();

bool pressedUpLeft();
bool pressedUpRight();
bool pressedDownLeft();
bool pressedDownRight();
};

#endif
5 changes: 5 additions & 0 deletions headers/gp2040.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#ifndef GP2040_H_
#define GP2040_H_

#include <map>

// GP2040 Classes
#include "gamepad.h"
#include "addonmanager.h"
Expand Down Expand Up @@ -48,6 +50,9 @@ class GP2040 {
SET_INPUT_MODE_PS4
};
BootAction getBootAction();

// input mask, action
std::map<uint32_t, int32_t> bootActions;
};

#endif
584 changes: 584 additions & 0 deletions lib/OneBitDisplay/fonts.h

Large diffs are not rendered by default.

556 changes: 1 addition & 555 deletions lib/OneBitDisplay/obd.inl

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions proto/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ message GamepadOptions
optional uint32 profileNumber = 9;
optional PS4ControllerType ps4ControllerType = 10;
optional uint32 debounceDelay = 11;
optional int32 inputModeB1 = 12;
optional int32 inputModeB2 = 13;
optional int32 inputModeB3 = 14;
optional int32 inputModeB4 = 15;
optional int32 inputModeL1 = 16;
optional int32 inputModeL2 = 17;
optional int32 inputModeR1 = 18;
optional int32 inputModeR2 = 19;
}

message KeyboardMapping
Expand Down
Binary file modified site/docs/assets/boards/FlatboxRev5Southpaw.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/KeyboardConverter.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/Liatris.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/OpenCore0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/OpenCore0WASD.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/PicoW.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/ReflexCtrlSNES.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/ReflexEncode_v2.0.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/boards/SGFDevices.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/gp2040-ce-placeholder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-dual-directional.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-focus-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-input-history.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-joystick-slider.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-player-number.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified site/docs/assets/images/gpc-add-ons-ps-passthrough.png
Binary file modified site/docs/assets/images/gpc-add-ons-ps4-mode.png
201 changes: 1 addition & 200 deletions site/docs/assets/images/gpc-add-ons-snespad-input-pinout.svg

Large diffs are not rendered by default.

Binary file modified site/docs/assets/images/gpc-add-ons-tilt.png
Binary file modified site/docs/assets/images/gpc-add-ons-wii-extensions.png
Binary file modified site/docs/assets/images/gpc-backup-and-restore.png
Binary file modified site/docs/assets/images/gpc-backup.png
Binary file modified site/docs/assets/images/gpc-documentation-current-version.png
Binary file modified site/docs/assets/images/gpc-documentation-next-version.png
Binary file modified site/docs/assets/images/gpc-home.png
Binary file modified site/docs/assets/images/gpc-hotkey-settings.png
Binary file modified site/docs/assets/images/gpc-keyboard-mapping.png
Binary file modified site/docs/assets/images/gpc-macros-input-line.png
Binary file modified site/docs/assets/images/gpc-macros.png
Binary file modified site/docs/assets/images/gpc-profile-settings.png
Binary file modified site/docs/assets/images/gpc-restore.png
373 changes: 1 addition & 372 deletions site/docs/assets/images/wii-extension-controllers/classic.svg

Large diffs are not rendered by default.

234 changes: 1 addition & 233 deletions site/docs/assets/images/wii-extension-controllers/drums.svg

Large diffs are not rendered by default.

287 changes: 1 addition & 286 deletions site/docs/assets/images/wii-extension-controllers/guitar.svg

Large diffs are not rendered by default.

245 changes: 1 addition & 244 deletions site/docs/assets/images/wii-extension-controllers/nunchuck.svg

Large diffs are not rendered by default.

175 changes: 1 addition & 174 deletions site/docs/assets/images/wii-extension-controllers/taiko.svg

Large diffs are not rendered by default.

321 changes: 1 addition & 320 deletions site/docs/assets/images/wii-extension-controllers/turntable.svg

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions site/docs/faq/faq-troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Select the button labels to be displayed in the usage guide:

There are many different reasons why this could be the case.

PS5 is at present supported using passthrough authentication only; see [PS Passthrough](../add-ons/ps-passthrough.mdx).

#### Incorrect Mapping in Steam

Verify that your controller settings in Steam are correctly set, both global settings and the per-game settings. See [Steam Support](https://partner.steamgames.com/doc/features/steam_controller/getting_started_for_players) for more information on how to resolve this issue.
Expand Down
815 changes: 1 addition & 814 deletions site/static/img/gp2040-ce-logo.svg

Large diffs are not rendered by default.

97 changes: 79 additions & 18 deletions src/addons/inputhistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,45 @@
#include "helper.h"
#include "config.pb.h"

static const std::string displayNames[][18] = {
static const std::string displayNames[][INPUT_HISTORY_MAX_INPUTS] = {
{ // HID / DINPUT
"U", "D", "L", "R",
"X", "O", "#", "^",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
CHAR_CROSS, CHAR_CIRCLE, CHAR_SQUARE, CHAR_TRIANGLE,
"L1", "R1", "L2", "R2",
"SL", "ST", "L3", "R3", "PS", "A2"
},
{ // Switch
"U", "D", "L", "R",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
"B", "A", "Y", "X",
"L", "R", "ZL", "ZR",
"-", "+", "LS", "RS", "H", "C"
"-", "+", "LS", "RS", CHAR_HOME_S, CHAR_CAP_S
},
{ // XInput
"U", "D", "L", "R",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
"A", "B", "X", "Y",
"LB", "RB", "LT", "RT",
"BK", "ST", "LS", "RS", "G", "A2"
CHAR_VIEW_X, CHAR_MENU_X, "LS", "RS", CHAR_HOME_X, "A2"
},
{ // Keyboard / HID-KB
"U", "D", "L", "R",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
"B1", "B2", "B3", "B4",
"L1", "R1", "L2", "R2",
"S1", "S2", "L3", "R3", "A1", "A2"
},
{ // PS4
"U", "D", "L", "R",
"X", "O", "#", "^",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
CHAR_CROSS, CHAR_CIRCLE, CHAR_SQUARE, CHAR_TRIANGLE,
"L1", "R1", "L2", "R2",
"SH", "OP", "L3", "R3", "PS", "T"
CHAR_SHARE_P, "OP", "L3", "R3", CHAR_HOME_P, CHAR_TPAD_P
},
{ // Config
"U", "D", "L", "R",
CHAR_UP, CHAR_DOWN, CHAR_LEFT, CHAR_RIGHT,
CHAR_UL, CHAR_UR, CHAR_DL, CHAR_DR,
"B1", "B2", "B3", "B4",
"L1", "R1", "L2", "R2",
"S1", "S2", "L3", "R3", "A1", "A2"
Expand All @@ -64,11 +70,18 @@ void InputHistoryAddon::process() {
std::deque<std::string> pressed;

// Get key states
std::array<bool, 18> currentInput = {
std::array<bool, INPUT_HISTORY_MAX_INPUTS> currentInput = {

pressedUp(),
pressedDown(),
pressedLeft(),
pressedRight(),

pressedUpLeft(),
pressedUpRight(),
pressedDownLeft(),
pressedDownRight(),

gamepad->pressedB1(),
gamepad->pressedB2(),
gamepad->pressedB3(),
Expand Down Expand Up @@ -100,7 +113,7 @@ void InputHistoryAddon::process() {
// Check if any new keys have been pressed
if (lastInput != currentInput) {
// Iterate through array
for (uint8_t x=0; x<18; x++) {
for (uint8_t x=0; x<INPUT_HISTORY_MAX_INPUTS; x++) {
// Add any pressed keys to deque
if (currentInput[x]) pressed.push_back(displayNames[mode][x]);
}
Expand Down Expand Up @@ -153,7 +166,7 @@ bool InputHistoryAddon::pressedUp()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return pGamepad->pressedUp();
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == GAMEPAD_MASK_UP);
case DPAD_MODE_LEFT_ANALOG: return pGamepad->state.ly == GAMEPAD_JOYSTICK_MIN;
case DPAD_MODE_RIGHT_ANALOG: return pGamepad->state.ry == GAMEPAD_JOYSTICK_MIN;
}
Expand All @@ -165,7 +178,7 @@ bool InputHistoryAddon::pressedDown()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return pGamepad->pressedDown();
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == GAMEPAD_MASK_DOWN);
case DPAD_MODE_LEFT_ANALOG: return pGamepad->state.ly == GAMEPAD_JOYSTICK_MAX;
case DPAD_MODE_RIGHT_ANALOG: return pGamepad->state.ry == GAMEPAD_JOYSTICK_MAX;
}
Expand All @@ -177,7 +190,7 @@ bool InputHistoryAddon::pressedLeft()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return pGamepad->pressedLeft();
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == GAMEPAD_MASK_LEFT);
case DPAD_MODE_LEFT_ANALOG: return pGamepad->state.lx == GAMEPAD_JOYSTICK_MIN;
case DPAD_MODE_RIGHT_ANALOG: return pGamepad->state.rx == GAMEPAD_JOYSTICK_MIN;
}
Expand All @@ -189,10 +202,58 @@ bool InputHistoryAddon::pressedRight()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return pGamepad->pressedRight();
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == GAMEPAD_MASK_RIGHT);
case DPAD_MODE_LEFT_ANALOG: return pGamepad->state.lx == GAMEPAD_JOYSTICK_MAX;
case DPAD_MODE_RIGHT_ANALOG: return pGamepad->state.rx == GAMEPAD_JOYSTICK_MAX;
}

return false;
}

bool InputHistoryAddon::pressedUpLeft()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == (GAMEPAD_MASK_UP | GAMEPAD_MASK_LEFT));
case DPAD_MODE_LEFT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MIN) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MIN);
case DPAD_MODE_RIGHT_ANALOG: return (pGamepad->state.rx == GAMEPAD_JOYSTICK_MIN) && (pGamepad->state.ry == GAMEPAD_JOYSTICK_MIN);
}

return false;
}

bool InputHistoryAddon::pressedUpRight()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == (GAMEPAD_MASK_UP | GAMEPAD_MASK_RIGHT));
case DPAD_MODE_LEFT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MAX) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MIN);
case DPAD_MODE_RIGHT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MAX) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MIN);
}

return false;
}

bool InputHistoryAddon::pressedDownLeft()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == (GAMEPAD_MASK_DOWN | GAMEPAD_MASK_LEFT));
case DPAD_MODE_LEFT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MIN) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MAX);
case DPAD_MODE_RIGHT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MIN) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MAX);
}

return false;
}

bool InputHistoryAddon::pressedDownRight()
{
switch (gamepad->getOptions().dpadMode)
{
case DPAD_MODE_DIGITAL: return ((pGamepad->state.dpad & GAMEPAD_MASK_DPAD) == (GAMEPAD_MASK_DOWN | GAMEPAD_MASK_RIGHT));
case DPAD_MODE_LEFT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MAX) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MAX);
case DPAD_MODE_RIGHT_ANALOG: return (pGamepad->state.lx == GAMEPAD_JOYSTICK_MAX) && (pGamepad->state.ly == GAMEPAD_JOYSTICK_MAX);
}

return false;
}
32 changes: 32 additions & 0 deletions src/config_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,30 @@
#ifndef DEFAULT_INPUT_MODE
#define DEFAULT_INPUT_MODE INPUT_MODE_XINPUT
#endif
#ifndef DEFAULT_INPUT_MODE_B1
#define DEFAULT_INPUT_MODE_B1 INPUT_MODE_SWITCH
#endif
#ifndef DEFAULT_INPUT_MODE_B2
#define DEFAULT_INPUT_MODE_B2 INPUT_MODE_XINPUT
#endif
#ifndef DEFAULT_INPUT_MODE_B3
#define DEFAULT_INPUT_MODE_B3 INPUT_MODE_HID
#endif
#ifndef DEFAULT_INPUT_MODE_B4
#define DEFAULT_INPUT_MODE_B4 INPUT_MODE_PS4
#endif
#ifndef DEFAULT_INPUT_MODE_L1
#define DEFAULT_INPUT_MODE_L1 -1
#endif
#ifndef DEFAULT_INPUT_MODE_L2
#define DEFAULT_INPUT_MODE_L2 -1
#endif
#ifndef DEFAULT_INPUT_MODE_R1
#define DEFAULT_INPUT_MODE_R1 -1
#endif
#ifndef DEFAULT_INPUT_MODE_R2
#define DEFAULT_INPUT_MODE_R2 INPUT_MODE_KEYBOARD
#endif
#ifndef DEFAULT_DPAD_MODE
#define DEFAULT_DPAD_MODE DPAD_MODE_DIGITAL
#endif
Expand Down Expand Up @@ -114,6 +138,14 @@ void ConfigUtils::initUnsetPropertiesWithDefaults(Config& config)
INIT_UNSET_PROPERTY(config.gamepadOptions, profileNumber, 1);
INIT_UNSET_PROPERTY(config.gamepadOptions, ps4ControllerType, DEFAULT_PS4CONTROLLER_TYPE);
INIT_UNSET_PROPERTY(config.gamepadOptions, debounceDelay, 5);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeB1, DEFAULT_INPUT_MODE_B1);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeB2, DEFAULT_INPUT_MODE_B2);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeB3, DEFAULT_INPUT_MODE_B3);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeB4, DEFAULT_INPUT_MODE_B4);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeL1, DEFAULT_INPUT_MODE_L1);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeL2, DEFAULT_INPUT_MODE_L2);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeR1, DEFAULT_INPUT_MODE_R1);
INIT_UNSET_PROPERTY(config.gamepadOptions, inputModeR2, DEFAULT_INPUT_MODE_R2);

// hotkeyOptions
HotkeyOptions& hotkeyOptions = config.hotkeyOptions;
Expand Down
16 changes: 16 additions & 0 deletions src/configs/webconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,14 @@ std::string setGamepadOptions()
readDoc(gamepadOptions.profileNumber, doc, "profileNumber");
readDoc(gamepadOptions.ps4ControllerType, doc, "ps4ControllerType");
readDoc(gamepadOptions.debounceDelay, doc, "debounceDelay");
readDoc(gamepadOptions.inputModeB1, doc, "inputModeB1");
readDoc(gamepadOptions.inputModeB2, doc, "inputModeB2");
readDoc(gamepadOptions.inputModeB3, doc, "inputModeB3");
readDoc(gamepadOptions.inputModeB4, doc, "inputModeB4");
readDoc(gamepadOptions.inputModeL1, doc, "inputModeL1");
readDoc(gamepadOptions.inputModeL2, doc, "inputModeL2");
readDoc(gamepadOptions.inputModeR1, doc, "inputModeR1");
readDoc(gamepadOptions.inputModeR2, doc, "inputModeR2");

HotkeyOptions& hotkeyOptions = Storage::getInstance().getHotkeyOptions();
save_hotkey(&hotkeyOptions.hotkey01, doc, "hotkey01");
Expand Down Expand Up @@ -660,6 +668,14 @@ std::string getGamepadOptions()
writeDoc(doc, "profileNumber", gamepadOptions.profileNumber);
writeDoc(doc, "ps4ControllerType", gamepadOptions.ps4ControllerType);
writeDoc(doc, "debounceDelay", gamepadOptions.debounceDelay);
writeDoc(doc, "inputModeB1", gamepadOptions.inputModeB1);
writeDoc(doc, "inputModeB2", gamepadOptions.inputModeB2);
writeDoc(doc, "inputModeB3", gamepadOptions.inputModeB3);
writeDoc(doc, "inputModeB4", gamepadOptions.inputModeB4);
writeDoc(doc, "inputModeL1", gamepadOptions.inputModeL1);
writeDoc(doc, "inputModeL2", gamepadOptions.inputModeL2);
writeDoc(doc, "inputModeR1", gamepadOptions.inputModeR1);
writeDoc(doc, "inputModeR2", gamepadOptions.inputModeR2);

writeDoc(doc, "fnButtonPin", -1);
GpioMappingInfo* gpioMappings = Storage::getInstance().getGpioMappings().pins;
Expand Down
Loading
Loading