Skip to content

Commit

Permalink
FGC mode for clonk
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Jan 31, 2024
1 parent 1e2d38e commit 15228fc
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/modes/FgcMode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,39 @@ FgcMode::FgcMode(socd::SocdType horizontal_socd, socd::SocdType vertical_socd) {
}

void FgcMode::UpdateDigitalOutputs(InputState &inputs, OutputState &outputs) {
// Menu keys
outputs.start = inputs.start;
outputs.select = inputs.c_left;
outputs.home = inputs.c_down;

// Directions
outputs.dpadLeft = inputs.left;
outputs.dpadRight = inputs.right;
outputs.dpadDown = inputs.down;
outputs.dpadUp = inputs.mod_x || inputs.c_up;
outputs.dpadUp = inputs.mod_x;

// Menu keys
outputs.start = inputs.start;
outputs.select = inputs.c_left;
outputs.home = inputs.c_down;
// Left thumb
outputs.triggerLDigital = inputs.mod_y;
outputs.triggerRDigital = inputs.a;

// Right hand bottom row
outputs.a = inputs.b;
outputs.b = inputs.x;
outputs.triggerRDigital = inputs.z;
outputs.triggerLDigital = inputs.up;
outputs.buttonR = inputs.z;
outputs.buttonL = inputs.up;

// Right hand top row
outputs.x = inputs.r;
outputs.y = inputs.y;
outputs.buttonR = inputs.lightshield;
outputs.buttonL = inputs.midshield;
outputs.leftStickClick = inputs.lightshield;
outputs.rightStickClick = inputs.midshield;
}

void FgcMode::UpdateAnalogOutputs(InputState &inputs, OutputState &outputs) {
outputs.leftStickX = 128;
outputs.leftStickY = 128;
outputs.rightStickX = 128;
outputs.rightStickY = 128;
outputs.triggerLAnalog = outputs.triggerLDigital ? 255 : 0;
outputs.triggerRAnalog = outputs.triggerRDigital ? 255 : 0;
// outputs.triggerLAnalog = outputs.triggerLDigital ? 255 : 0;
// outputs.triggerRAnalog = outputs.triggerRDigital ? 255 : 0;
}

0 comments on commit 15228fc

Please sign in to comment.