Open mowmibatman opened 2 years ago
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.
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
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
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
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.
I would also love this if it ever ends up being possible!
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.