Skip to content

Feature: translate C-Buttons as Smash/Aerial Attacks (rebased from #66)#92

Merged
JRickey merged 2 commits intomainfrom
agent/c-stick-smash-rebased
May 2, 2026
Merged

Feature: translate C-Buttons as Smash/Aerial Attacks (rebased from #66)#92
JRickey merged 2 commits intomainfrom
agent/c-stick-smash-rebased

Conversation

@JRickey
Copy link
Copy Markdown
Owner

@JRickey JRickey commented May 2, 2026

Replaces #66 (which had merge conflicts against current main).

All commits from the original PR are preserved with their original authorship; this branch adds the merge of latest main + a small polish pass with conflict resolutions and minor code-quality cleanups, all credited to @the-outcaster as Co-Authored-By.

Summary (from #66)

Allows the player to set the C buttons to smash attacks, or aerial attacks if the player is in the air, as opposed to the default jump behavior. Makes it more akin to the later Smash games where the user can easily tilt the right stick to perform a smash attack.

A check is made to make sure this is only applied while the player is in the game; this ensures that the player can still adjust the character's color palette in the CSS with the C buttons without causing erratic behavior (i.e. the cursor snapping in a certain direction and hitting the A button at the same time).

If the user has tap jump disabled, this can be a problem though since they won't have any way to jump otherwise. As a compromise, I added a second toggle underneath that converts D-pad input to the C buttons. This way the player can map a button, such as X or Y on a Xbox-style gamepad, to any of the D-pad directions, and give them their jumping ability back.

What changed during merge resolution

Polish on top

  • Dedented the new per-port enhancement widget block from 8 → 4 spaces to match the surrounding function body.
  • Added tooltips to P2/P3/P4 widgets matching the original code's commented-out style.
  • Renamed helper parameter raw_taptap_pre_remap and documented why it's needed (snapshot of *button_tap taken BEFORE the helper rewrites it, used to detect rising-edge taps after C-bits get cleared).
  • Added explicit i < GMCOMMON_PLAYERS_MAX bound in controller.c before indexing BattleState->players[] — the loop math equals PLAYERS_MAX today but the indirection is fragile and a per-player-array overrun has the same fingerprint as past LP64 per-gkind-table bugs.

Test plan

  • Clean Release build (191/191 TUs)
  • Binary launches; menu shows the new "Per-Port Enhancements" block with all four players
  • In-game smoke test: C-Stick Smash (P1) on, C-button presses produce smash attacks
  • CSS palette cycling with C-buttons still works when C-Stick Smash is on (the gameplay-only guard)
  • D-Pad to Jump (P1) on while Disable Tap Jump (P1) is on → D-Pad direction triggers a jump

🤖 Generated with Claude Code

the-outcaster and others added 2 commits May 2, 2026 00:46
Conflicts were in three files, all in the enhancement plumbing (cvar
declarations + PortMenu widget block) where main and PR #66 each added
new entries. Resolution kept main's flat-namespace-body indentation
style for the new declarations and combined PR #66's twin anonymous
namespaces in `enhancements.cpp` into a single one to match the rest
of the file.

`port/gui/PortMenu.cpp` had a tiny `// hitbox` placeholder where main
inserted the StageClearFrozenWallpaper widget; took main's widget.

`libultraship` pinned at 833528a6 (post-#87, includes StopAllRumble).

Polish on top of PR #66's content (also credited to author):
- Dedent the new per-port enhancement widget block from 8 → 4 spaces
  to match the surrounding function body in `PortMenu.cpp`.
- Add tooltips to P2/P3/P4 widgets ("Same as P1, applied to player N.")
  matching the original code's commented-out style for parity.
- Rename the helper parameter `raw_tap` → `tap_pre_remap` and document
  why it's needed (snapshot of `*button_tap` taken BEFORE the helper
  rewrites it, used to detect rising-edge taps after C-bits get
  cleared from the working tap mask).
- In `controller.c`, hoist the `i < GMCOMMON_PLAYERS_MAX` bound into
  the gameplay-only guard before indexing `BattleState->players[]` —
  the loop limit is `(ARRAY_COUNT(descs)+ARRAY_COUNT(devs))/2` which
  equals GMCOMMON_PLAYERS_MAX today but the math is fragile, and a
  per-player-array overrun has the same fingerprint as past LP64
  per-gkind-table bugs.

Tested: clean Release build (191/191), binary links.

Co-Authored-By: the-outcaster <101075966+the-outcaster@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants