Skip to content

Controller backend improvements#4552

Open
RetroEdit wants to merge 4 commits intoTASEmulators:masterfrom
RetroEdit:Controller-backend-improve
Open

Controller backend improvements#4552
RetroEdit wants to merge 4 commits intoTASEmulators:masterfrom
RetroEdit:Controller-backend-improve

Conversation

@RetroEdit
Copy link
Copy Markdown
Contributor

@RetroEdit RetroEdit commented Nov 21, 2025

Fixes #4550

Check if completed:

  • I have run any relevant test suites
    • Also, spot-tested on GB and NES
  • I, the commit author, have read the licensing terms for contributors (last updated 2024-06-22) and am compliant

@RetroEdit RetroEdit force-pushed the Controller-backend-improve branch from f032f19 to 7ccee8c Compare November 21, 2025 15:54
@RetroEdit RetroEdit force-pushed the Controller-backend-improve branch from 7ccee8c to 00e4a17 Compare April 7, 2026 17:50
@RetroEdit RetroEdit requested review from Morilli and YoshiRulz April 7, 2026 17:59
@RetroEdit RetroEdit marked this pull request as ready for review April 7, 2026 18:01
@SuuperW
Copy link
Copy Markdown
Contributor

SuuperW commented Apr 7, 2026

Bk2Controller.Bk2ControllerDefinition.GenOrderedControls is also incorrect. The base implementation remarks that other implementers should include empty lists for groups with no buttons. It seems like the only reason that empty lists should be included is that there's special logic expecting console buttons to be in the first group. (e.g. for NES, the power button is in group 0, player 1's buttons are in group 1) But this implementation removes empty lists.

Related, Bk2LogEntryGenerator.GenerateLogKey also removes empty lists.

Removing empty lists in these places probably solved some issues that were created by reporting PlayerCount of 1 for handhelds and then assuming there are PlayerCount + 1 groups, which this PR fixes.

This removal of empty lists should only be a problem if there are any cores that have no console buttons and have multiple controllers. In that case, input display will show player 1's inputs last in the list of inputs instead of first. I do not know if there are any cores like this, but I think these implementations should be fixed regardless.

And it might be a good idea for this PR to change the public NumControllerGroups to return ControlsOrdered.Count instead of re-calculating it. It seems like these two values should always match. (The use of NumControllerGroups inside GenOrderedControls would need to be updated.)

@RetroEdit
Copy link
Copy Markdown
Contributor Author

One wonders if NumControllerGroups should even exist if it's just wrapping the public ControlsOrdered.Count...

While I agree Bk2Controller doesn't match the base implementation's specification in that comment, and I think you're probably right it would be okay and more correct to remove the empty entry filtering, I don't want to change more than necessary.

But if you feel strongly, feel free to add it to this PR (or make your own commit).

@SuuperW
Copy link
Copy Markdown
Contributor

SuuperW commented Apr 8, 2026

I think it's OK to leave it, since I doubt it's causing any issues.

I pushed some updates for macros. Merge conflict here should just be because MovieZone.cs was renamed.

@RetroEdit RetroEdit force-pushed the Controller-backend-improve branch from 7db8d8c to 17d5e5f Compare April 8, 2026 20:10
more accurately reflects usage and hopefully prevents future confusion
@RetroEdit RetroEdit force-pushed the Controller-backend-improve branch from 17d5e5f to df67c9d Compare April 8, 2026 20:54
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.

New extra trailing | in input LogEntry for handheld consoles.

4 participants