Skip to content

Add input delay#1267

Open
Blockyyy wants to merge 9 commits into
coop-deluxe:devfrom
Blockyyy:delay
Open

Add input delay#1267
Blockyyy wants to merge 9 commits into
coop-deluxe:devfrom
Blockyyy:delay

Conversation

@Blockyyy

@Blockyyy Blockyyy commented May 25, 2026

Copy link
Copy Markdown
Contributor
image

has a max delay of 15 frames

need translations for

INPUT_DELAY = "Input Delay"

@coderabbitai

coderabbitai Bot commented May 25, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a configurable input delay. Declares extern configInputDelay and defines configInputDelay in the config system (persisted via options). read_controller_inputs() now writes per-frame raw stick/button samples into a ring buffer and applies a delayed sample (clamped to the buffer) to compute stick values and button press/release transitions. A controls-panel slider (0–15) exposes the setting. Localization strings were added for English, French, Portuguese, and German.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Add input delay' directly and clearly describes the main change in the changeset: implementation of an input delay feature across multiple files including config, UI, and localization.
Description check ✅ Passed The description is related to the changeset, mentioning the input delay feature with a 15-frame maximum and requesting translations for the INPUT_DELAY key, which matches the changes made.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mingokrb

Copy link
Copy Markdown
Contributor

damn that's sick
Portuguese..

INPUT_DELAY = "Atraso da entrada"

@DM-kun

DM-kun commented May 25, 2026

Copy link
Copy Markdown
Contributor

German:

INPUT_DELAY = "Eingabeverzögerung"

@Isaac0-dev Isaac0-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks pretty good, here's some nitpicks. otherwise, we're just waiting on translations

Comment thread src/game/game_init.c Outdated
Comment thread src/game/game_init.c Outdated
@Blockyyy Blockyyy requested a review from Isaac0-dev May 26, 2026 10:27

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/game/game_init.c`:
- Around line 497-498: Clamp the computed delay to a non-negative value before
using it to index the buffer: replace the current upper-only clamp of delay
(using configInputDelay and INPUT_BUFFER_MAX_DELAY) with a clamp that enforces 0
<= delay <= INPUT_BUFFER_MAX_DELAY so tail calculation uses a non-negative
delay; adjust the assignment to delay (the variable computed from
configInputDelay) and then compute tail using sInputBufferHead,
INPUT_BUFFER_SIZE and INPUT_BUFFER_SIZE constants as before.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: cfaba553-240d-4d26-86e6-088dba41ebd6

📥 Commits

Reviewing files that changed from the base of the PR and between 6e73a2f and c394f9b.

📒 Files selected for processing (1)
  • src/game/game_init.c

Comment thread src/game/game_init.c Outdated
@EmeraldLoc

Copy link
Copy Markdown
Collaborator

conflicts

@EmeraldLoc EmeraldLoc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

Comment thread src/game/game_init.c Outdated
Comment thread src/game/game_init.c Outdated
Comment thread src/game/game_init.c Outdated
@PeachyPeachSM64

Copy link
Copy Markdown
Contributor

merge conflicts

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.

6 participants