mgba icon indicating copy to clipboard operation
mgba copied to clipboard

[Feature request] Solar sensor emulation via ambient light sensor on the Steam Deck

Open mowmibatman opened this issue 2 years ago • 5 comments

Kindly please consider making mgba able to set the current solar sensor level for Boktai games based on data from the ambient light sensor on devices equipped with it, like the Steam Deck. This is already a working feature in My Boy! for Android.

mowmibatman avatar May 16 '22 06:05 mowmibatman

Solar sensor is already emulated, but no devices mGBA runs on have an (accessible) ambient light sensor. I would need to look into how to query it on the Deck to hook into mGBA.

endrift avatar May 16 '22 06:05 endrift

Thank you for your instant reply. I am well aware of manual solar sensor emulation. Thank you for considering the feature.

As for devices with an accessible ambient light sensor, it is known to be accessible on some Asus and Dell notebooks. This might not be helpful for Deck compatibility, but technically the feature could be supported on those laptops. https://github.com/mikhail-m1/illuminanced

mowmibatman avatar May 16 '22 07:05 mowmibatman

By default SDL seems to expose only the Accelerometer and Gyroscope but the SDL documentation mentions that "Additional sensors may be available, using platform dependent semantics.". So if we are lucky the Light Sensor is exposed in the same way. Unfortunately i don't have access to a Steam Deck to test it. https://wiki.libsdl.org/SDL_SensorType

shenef avatar Jun 15 '22 07:06 shenef

I've figured out a way to access the light sensor, via sysfs, but it's not a very friendly one. Using Linux iio APIs might be better, but I don't know them

endrift avatar Jun 15 '22 07:06 endrift

Also, in addition to IIO, a nice to have would be allowing the user to map the solar sensor to an HID axis, so it would allow DIY USB/Bluetooth solar sensors that only allow UV like the original one. This is already the case for tilt and gyro sensors but not for solar sensor.

dogtopus avatar Jul 14 '22 20:07 dogtopus

I would also love this if it ever ends up being possible!

whitt-e avatar Apr 18 '23 03:04 whitt-e