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

Add support for gyroscope/accelerometer #511

Open
svabos opened this issue Jul 7, 2024 · 6 comments
Open

Add support for gyroscope/accelerometer #511

svabos opened this issue Jul 7, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@svabos
Copy link

svabos commented Jul 7, 2024

I'm experiencing constant crash on andorid even after pure reinstall. Retroarch version: 1.19.1 ; Dosbox-pure version: 0.9.9

When loading a dosbox-pure core and going into it's menu "controller mapper", then trying to change preset from default "generic keyboard" the retroarch just crashes.
That doesn't happen on PC version of retroarch/dosbox-pure

Bonus:
is there a way to map a phone's gyroscope as mouse movement in core controller mapper

@schellingb
Copy link
Owner

I think this was fixed in 1c7ad4f. It should get released soon, I don't know when yet though. Some big changes since the last release.

Controlling something with a gyroscope sounds like a neat idea, do you know any other core that supports that? I'm not sure if it's available at all to a libretro core...

@svabos
Copy link
Author

svabos commented Jul 7, 2024

Controlling something with a gyroscope sounds like a neat idea, do you know any other core that supports that? I'm not sure if it's available at all to a libretro core...

yes, a mGBA core has it and works on android phone. I just tested it and can confirm that it works with game "WarioWare: Twisted!"
Other than that, gyro control is highly requested feature on numerous cores but I haven't seen it anywhere else. Also, as I know, in mGBA there's no function to control gyro sensitivity so it's very sensitive to use

and since we are on the subject, it would be great that the gyro could be used in parallel with analogue joypads to control various mouse speed movement. For example for joypads to control very fast mouse movement and with gyro very slow, so you can jump from one part of the screen to another fast with joypad, and then fine tune position with low sensitivity gyro movements

@schellingb
Copy link
Owner

Ok, looks like there's this part in the libretro code interface

/* Id values for SENSOR types. */
#define RETRO_SENSOR_ACCELEROMETER_X 0
#define RETRO_SENSOR_ACCELEROMETER_Y 1
#define RETRO_SENSOR_ACCELEROMETER_Z 2
#define RETRO_SENSOR_GYROSCOPE_X 3
#define RETRO_SENSOR_GYROSCOPE_Y 4
#define RETRO_SENSOR_GYROSCOPE_Z 5
#define RETRO_SENSOR_ILLUMINANCE 6

typedef bool (RETRO_CALLCONV *retro_set_sensor_state_t)(unsigned port,
      enum retro_sensor_action action, unsigned rate);

typedef float (RETRO_CALLCONV *retro_sensor_get_input_t)(unsigned port, unsigned id);

struct retro_sensor_interface
{
   retro_set_sensor_state_t set_sensor_state;
   retro_sensor_get_input_t get_sensor_input;
};

It wouldn't be easy to add support for it in DOSBox Pure. But maybe some day :-)

@schellingb schellingb added the enhancement New feature or request label Jul 7, 2024
@schellingb schellingb changed the title Android: choosing a different controller preset in dosbox-pure config crashes Retroarch Add support for gyroscope/accelerometer Jul 7, 2024
@svabos
Copy link
Author

svabos commented Jul 7, 2024

It wouldn't be easy to add support for it in DOSBox Pure. But maybe some day :-)

Please do add it! It's the only hope for playing mouse games on andorid. Touchscreen is just pain to use...

@schellingb
Copy link
Owner

Problem I can see is that it would need a lot of special options.
There are 6 axis available (gyro XYZ and accel XYZ). How to set which one does what? How to set speed? Would it be enough to just control the mouse? Or would one also want to control other inputs. I.e. joysticks. Or generic keys...

@tails101
Copy link

I wonder if it could be used for a wheel ,for cars or maybe flight simulator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants