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

cellGem: Update controllers at 10 Hz in separate thread #16528

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Megamouse
Copy link
Contributor

  • Update controllers at 10 Hz in separate thread instead of cellGemGetInfo

Some games don't use cellGemGetInfo, which means we had to reboot the game if the controller wasn't connected on boot.
Updating controllers outside of the cell functions fixes this problem.

@Megamouse Megamouse force-pushed the cellGemUpdate branch 3 times, most recently from 205f62b to dabcd46 Compare January 8, 2025 03:06

void wait_for_result()
{
if (!m_done)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be a while loop, code should not assume that wait is accurate and won't wake up spuriously

}
}

gem_config_data& operator=(thread_state)
Copy link
Contributor

Choose a reason for hiding this comment

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

noexcept

gem_config_data& operator=(thread_state)
{
wake_up();
done();
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't done() be called exclusive by the thread? In case of emulation stop, PPUs should check their own state and not depend on notifications from others.

  1. Use thread_ctrl::wait_on() instead of atomic_t::wait
  2. Check ppu_thread::state if stopped before wait.
  3. Remove this line.
  4. If PPU wakes up prematurely on emulation stopping, add cpu_state::again to state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm assuming the = operators aren't necessary anymore then

Some games don't use cellGemGetInfo.
Which means we had to reboot the game if the controller wasn't
connected on boot.
Updating controllers outside of the cell functions fixes this problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants