Skip to content

Commit

Permalink
Fixed angled tilts to work with tap jump.
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Dec 17, 2023
1 parent 0493d17 commit bdb29b6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 6 additions & 2 deletions config/b0xx_r4/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,12 @@ void setup() {
if (console == ConnectedConsole::GAMECUBE) {
// NOTE: This is called when using a gcc adapter with the switch!
primary_backend = new GamecubeBackend(input_sources, input_source_count, pinout.joybus_data);
socd::SocdType socdType = (button_holds.r && button_holds.y) ? socd::SOCD_2IP_NO_REAC : socd::SOCD_2IP;
primary_backend->SetGameMode(new Melee20Button(socdType, { .crouch_walk_os = false }));
if (button_holds.b) {
primary_backend->SetGameMode(new UltimateR4(socd::SOCD_2IP));
} else {
socd::SocdType socdType = (button_holds.r && button_holds.y) ? socd::SOCD_2IP_NO_REAC : socd::SOCD_2IP;
primary_backend->SetGameMode(new Melee20Button(socdType, { .crouch_walk_os = false }));
}
} else if (console == ConnectedConsole::N64) {
primary_backend = new N64Backend(input_sources, input_source_count, pinout.joybus_data);
primary_backend->SetGameMode(new UltimateR4(socd::SOCD_2IP));
Expand Down
1 change: 1 addition & 0 deletions config/mode_selection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void select_mode(CommunicationBackend *backend) {
)
);
} else if (inputs.down) {
// TODO: Should I make this switch to UltimateR4?
set_mode(backend, new Ultimate(socd::SOCD_2IP));
} else if (inputs.right) {
set_mode(backend, new FgcMode(socd::SOCD_NEUTRAL, socd::SOCD_NEUTRAL));
Expand Down
16 changes: 13 additions & 3 deletions src/modes/UltimateR4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,16 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
outputs.rightStickY = ANALOG_STICK_NEUTRAL + 59;
}

// These all can be true at the same time
if (directions.horizontal) {
// Fastest walking speed before run
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
} else if (directions.vertical) {
}
if (directions.vertical) {
// Vertical Shield Tilt and crouch with mod_x = 65
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
} else if (directions.diagonal) {
}
if (directions.diagonal) {
// MX + q1/2/3/4 = 53 35
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
Expand Down Expand Up @@ -150,10 +153,17 @@ void UltimateR4::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
outputs.triggerLDigital = true;
outputs.triggerRDigital = true;
}

// These all can be true at the same time
if (directions.horizontal) {
// Allow tink/yink walk shield
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 28);
} else if (directions.diagonal) {
}
if (directions.vertical) {
// Vertical Shield Tilt and crouch with mod_x = 65
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 65);
}
if (directions.diagonal) {
outputs.leftStickX = ANALOG_STICK_NEUTRAL + (directions.x * 53);
outputs.leftStickY = ANALOG_STICK_NEUTRAL + (directions.y * 34);
}
Expand Down

0 comments on commit bdb29b6

Please sign in to comment.