Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multitap driver #1611

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Conversation

johnbaumann
Copy link
Collaborator

Initial efforts. Currently lacks config mode. Draft request for picking at and discussing changes required.

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 9.96%. Comparing base (483fdba) to head (34cffd0).
Report is 88 commits behind head on main.

❗ Current head 34cffd0 differs from pull request most recent head 6b49b30. Consider uploading reports for the commit 6b49b30 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1611   +/-   ##
=======================================
  Coverage    9.96%    9.96%           
=======================================
  Files         447      447           
  Lines      132300   132308    +8     
=======================================
+ Hits        13186    13189    +3     
- Misses     119114   119119    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
src/mips/psyqo/src/advancedpad.cpp Outdated Show resolved Hide resolved
src/mips/psyqo/src/advancedpad.cpp Outdated Show resolved Hide resolved
src/mips/psyqo/src/hardware/sio.cpp Outdated Show resolved Hide resolved
uint8_t *pad_data;
static constexpr unsigned pad_data_width = 8;

for (uint16_t port = 0; port < 2; port++) {
Copy link
Member

Choose a reason for hiding this comment

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

It looks like this scans all ports? Which is different from what the .hh says, about alternating ports per frame. Also, unsigned.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Huh, guessing the description in the header is a mix of leftover from simplepad and/or copilot hallucination, mixed with my own derp. Judging from simplepad's description, this is mentioned as a drawback, so I'll just nuke the comment about alternating frames unless this seems like desirable behavior. simplepad's description below:

  • @details This class is meant to be used as a singleton, probably in
  • the Application derived class. It is a simple thunk to the BIOS'
  • PAD interface, and has the same caveats, namely that it should be
  • initialized prior using the BIOS' memory card functions, and that
  • polling will alternate between the two pads at each frame when two
  • pads are connected, which can introduce input lags.

using namespace timer_literals;

Kernel::Internal::addOnFrame([this]() {
readPad();
Copy link
Member

Choose a reason for hiding this comment

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

So one detail here is that the callbacks put on addOnFrame are run at the beginning of every drawn frame. If the software runs at 10FPS, then it'll be called 10 times per second, which may make it lose events, potentially. Same as with the SimplePad, really. But we can change this later.

nicolasnoble
nicolasnoble previously approved these changes Apr 27, 2024
Copy link
Member

@nicolasnoble nicolasnoble left a comment

Choose a reason for hiding this comment

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

Just two little nits, but otherwise it looks fine.

/**
* @brief Initializes the pads.
*
* @details This will initialize the pads polling by calling the BIOS'
Copy link
Member

Choose a reason for hiding this comment

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

The details here are actually incorrect, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Revised, but possibly lacking in detail.

src/mips/psyqo/advancedpad.hh Outdated Show resolved Hide resolved
@johnbaumann johnbaumann marked this pull request as ready for review May 14, 2024 01:29
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