Skip to content
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
14 changes: 7 additions & 7 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
]
}
21 changes: 17 additions & 4 deletions HAL/pico/include/config_defaults.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
// clang-format off

const Config default_config = {
.game_mode_configs_count = 6,
.game_mode_configs_count = 7,
.game_mode_configs = {
GameModeConfig {
GameModeConfig {
.mode_id = MODE_MELEE,
.socd_pairs_count = 4,
.socd_pairs = {
Expand All @@ -22,7 +22,7 @@ const Config default_config = {
.activation_binding_count = 3,
.activation_binding = { BTN_LT1, BTN_MB1, BTN_LF4 },
},
GameModeConfig {
GameModeConfig {
.mode_id = MODE_PROJECT_M,
.socd_pairs_count = 4,
.socd_pairs = {
Expand Down Expand Up @@ -75,6 +75,19 @@ const Config default_config = {
.activation_binding_count = 3,
.activation_binding = { BTN_LT1, BTN_MB1, BTN_RF1 },
},
GameModeConfig {
.mode_id = MODE_RIVALS_2,
.socd_pairs_count = 4,
.socd_pairs = {
SocdPair { .button_dir1 = BTN_LF3, .button_dir2 = BTN_LF1, .socd_type = SOCD_2IP_NO_REAC },
SocdPair { .button_dir1 = BTN_LF2, .button_dir2 = BTN_RF4, .socd_type = SOCD_2IP_NO_REAC },
SocdPair { .button_dir1 = BTN_RT3, .button_dir2 = BTN_RT5, .socd_type = SOCD_2IP_NO_REAC },
SocdPair { .button_dir1 = BTN_RT2, .button_dir2 = BTN_RT4, .socd_type = SOCD_2IP_NO_REAC },
},
.button_remapping_count = 0,
.activation_binding_count = 3,
.activation_binding = { BTN_LT1, BTN_MB1, BTN_RF5 },
},
GameModeConfig {
.mode_id = MODE_KEYBOARD,
.socd_pairs_count = 2,
Expand Down Expand Up @@ -177,4 +190,4 @@ const Config default_config = {

// clang-format on

#endif
#endif
56 changes: 28 additions & 28 deletions config/pico/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,33 +16,33 @@
Config config = default_config;

GpioButtonMapping button_mappings[] = {
{BTN_LF1, 2 },
{ BTN_LF2, 3 },
{ BTN_LF3, 4 },
{ BTN_LF4, 5 },

{ BTN_LT1, 6 },
{ BTN_LT2, 7 },

{ BTN_MB1, 0 },
{ BTN_MB2, 10},
{ BTN_MB3, 11},

{ BTN_RT1, 14},
{ BTN_RT2, 15},
{ BTN_RT3, 13},
{ BTN_RT4, 12},
{ BTN_RT5, 16},

{ BTN_RF1, 26},
{ BTN_RF2, 21},
{ BTN_RF3, 19},
{ BTN_RF4, 17},

{ BTN_RF5, 27},
{ BTN_RF6, 22},
{ BTN_RF7, 20},
{ BTN_RF8, 18},
{ BTN_LF1, 2 },
{ BTN_LF2, 3 },
{ BTN_LF3, 4 },
{ BTN_LF4, 5 },

{ BTN_LT1, 6 },
{ BTN_LT2, 7 },

{ BTN_MB1, 0 },
{ BTN_MB2, 10 },
{ BTN_MB3, 11 },

{ BTN_RT1, 14 },
{ BTN_RT2, 15 },
{ BTN_RT3, 13 },
{ BTN_RT4, 12 },
{ BTN_RT5, 16 },

{ BTN_RF1, 26 },
{ BTN_RF2, 21 },
{ BTN_RF3, 19 },
{ BTN_RF4, 17 },

{ BTN_RF5, 27 },
{ BTN_RF6, 22 },
{ BTN_RF7, 20 },
{ BTN_RF8, 18 },
};
const size_t button_count = sizeof(button_mappings) / sizeof(GpioButtonMapping);

Expand Down Expand Up @@ -115,4 +115,4 @@ void loop1() {
if (backends != nullptr) {
gpio_input.UpdateInputs(backends[0]->GetInputs());
}
}
}
4 changes: 3 additions & 1 deletion include/core/config_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ constexpr const char *gamemode_name(GameModeId mode_id) {
return "FGC";
case MODE_RIVALS_OF_AETHER:
return "Rivals";
case MODE_RIVALS_2:
return "Rivals 2";
case MODE_KEYBOARD:
return "Keyboard";
default:
Expand Down Expand Up @@ -88,4 +90,4 @@ constexpr const char *socd_name(SocdType socd_type) {
}
}

#endif
#endif
18 changes: 18 additions & 0 deletions include/modes/Rivals2.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#ifndef _MODES_RIVALS_2_HPP
#define _MODES_RIVALS_2_HPP

#include "core/ControllerMode.hpp"
#include "core/state.hpp"

#include <config.pb.h> //this was not here, but doesn't seem to matter if I remove it from Melee20Button.hpp anyway

class Rivals2 : public ControllerMode {
public:
Rivals2();

private:
void UpdateDigitalOutputs(const InputState &inputs, OutputState &outputs);
void UpdateAnalogOutputs(const InputState &inputs, OutputState &outputs);
};

#endif
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ custom_nanopb_options =
--error-on-unmatched
lib_deps =
nanopb/Nanopb@^0.4.8
https://github.com/JonnyHaystack/HayBox-proto#5b2bb5d
https://github.com/JonnyHaystack/HayBox-proto#bbd0862

[avr_base]
platform = atmelavr
Expand Down
8 changes: 7 additions & 1 deletion src/core/mode_selection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "modes/FgcMode.hpp"
#include "modes/Melee20Button.hpp"
#include "modes/ProjectM.hpp"
#include "modes/Rivals2.hpp"
#include "modes/RivalsOfAether.hpp"
#include "modes/Ultimate.hpp"
#include "util/state_util.hpp"
Expand All @@ -17,6 +18,7 @@ ProjectM projectm_mode;
Ultimate ultimate_mode;
FgcMode fgc_mode;
RivalsOfAether rivals_mode;
Rivals2 rivals2_mode;
CustomKeyboardMode keyboard_mode;
CustomControllerMode custom_mode;

Expand Down Expand Up @@ -68,6 +70,10 @@ void set_mode(CommunicationBackend *backend, GameModeConfig &mode_config, Config
rivals_mode.SetConfig(mode_config);
set_mode(backend, &rivals_mode);
break;
case MODE_RIVALS_2:
rivals2_mode.SetConfig(mode_config);
set_mode(backend, &rivals2_mode);
break;
case MODE_KEYBOARD:
if (backend->BackendId() != COMMS_BACKEND_DINPUT ||
mode_config.keyboard_mode_config < 1 ||
Expand Down Expand Up @@ -137,4 +143,4 @@ void setup_mode_activation_bindings(const GameModeConfig *mode_configs, size_t m
mode_configs[i].activation_binding_count
);
}
}
}
Loading