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

Always call set_maple_port(), even when maple port isn't in config #1828

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

Tails86
Copy link

@Tails86 Tails86 commented Feb 1, 2025

This is regarding discussion #1825

Problem: When no config is present, then a DreamConn connection isn't being made.

DreamConnGamepad::set_maple_port() needs to be called in order to establish connection to the device. It should always be called in GamepadDevice::Register(), even when cfgLoadInt() returns the default result. This is essentially just setting it to the same defaulted index it was already set to if it isn't in the config.

@kosekmi
Copy link

kosekmi commented Feb 1, 2025

Fix confirmed

@flyinghead
Copy link
Owner

Can you do this call in the DreamConnGamepad constructor instead?
Like here.
set_maple_port() is already called by the SDLGamepad constructor but you can call it again if you need to.
No big deal if it's not possible/easy but better to keep device-specific stuff in their own source.

@flyinghead
Copy link
Owner

actually you certainly want dreamcastControllerType to be correctly set before so here is a better place.

@Tails86
Copy link
Author

Tails86 commented Feb 2, 2025

Can you do this call in the DreamConnGamepad constructor instead? Like here. set_maple_port() is already called by the SDLGamepad constructor but you can call it again if you need to. No big deal if it's not possible/easy but better to keep device-specific stuff in their own source.

I think it would make sense to prevent multiple connect() calls, so I would feel more comfortable adding something like virtual void registered(); to GamepadDevice so the DreamConnGamepad can react to registration and only do connection attempts once registered in set_maple_port(). Does that sound like an ok compromise?

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.

3 participants