libretro: Fix Boktai 1 solar sensor 8-bar mapping, add External Solar Sensor device for chord-based solar input#316
Draft
TideGear wants to merge 6 commits intolibretro:masterfrom
Draft
Conversation
…pping Add L3 + stick chord input mode for solar sensor control, designed for use with the Ojo del Sol ESP32 UV sensor device. This allows setting absolute solar levels via controller stick directions combined with L3. Chord mapping: - L3 only: 0 bars - Left stick up/right/down/left + L3: 1-4 bars - Right stick up/right/down/left + L3: 5-8 bars - Both sticks up + L3: 9 bars (Boktai 2/3 only) - Both sticks right + L3: 10 bars (Boktai 2/3 only) Also fixes the longstanding bug where Boktai 1 was incorrectly treated as having 10 solar steps when the game only has 8 bars. The core now detects Boktai 1 by ROM code (U3IJ/U3IE/U3IP) and remaps input accordingly. Changes: - Merge Solar Sensor Level and Solar Sensor Input into a single unified option - Add "Disabled" option to completely disable solar sensor input - Add "Use Device Sensor If Available" option (moved from level setting) - Add "L3/R3 Increment" mode (existing behavior) - Add "L3 + Stick Chords" mode (new, now default) - Add "Static: 0" through "Static: 10" for fixed solar levels - Hide Brighten/Darken input labels when chord mode is active - Add note about setting Analog to Digital Type to None in RetroArch - Update all localized option definitions in intl header
Tighten solar sensor handling and clean up libretro plumbing: chord input now requires L3 for non-zero levels, solar button labels are only exposed in L3/R3 Increment mode, and joypad bitmask reads are treated as unsigned. Also removes redundant option polling/state and silences descriptor constness warnings. Sync core options across locales by updating mgba_solar_sensor_input strings (Disabled, Use Device Sensor If Available) and dropping stale MGBA_SOLAR_SENSOR_LEVEL_* intl macros. Fix Android ndk-build by correcting LOCAL_SRC_FILES path handling, and update .gitignore for libretro-build outputs.
This reverts commit 78431e5.
…8-bar mapping" This reverts commit b0d63c0.
Detect Boktai 1 by ROM code (U3IJ/U3IE/U3IP) and remap manual solar input to match its 8‑bar gauge. L3/R3 stepping now increments/decrements 0–8 bars (mapped onto the internal 0–10 lux steps), and the mgba_solar_sensor_level core option is clamped to 0–8 for Boktai 1 while leaving other games unchanged.
Author
|
I tested this thoroughly in both Boktai 1 and 2. The bar increases and decreases by 1 all the way up and down the meter, whether there are 8 segments or 10. |
Adds an analog stick combo input mode for the Boktai solar sensor and scans all ports for valid input when active. Updates the solar sensor option text to document the stick mapping and temporary disabling of Analog to Digital caveat. This works seamlessly with any standard connected gamepad (tested with DualSense) and/or my Ojo del Sol sensor that detects real UV/sunlight. (https://github.com/TideGear/BoktaiSensor) The existing alternative (the Brighten Solar Sensor and Darken Solar Sensor binds) requires a lot of presses to go from one end of the meter to the other, and the in-game meter can lose sync with my Ojo del Sol device (if inputs get dropped), since the device is one way. The Analog Stick Control method is fast and stays synced with my device. Note that my specific device is NOT required to use this functionality. It will still work if someone makes a better solar sensor (which I would love), and as I mentioned before, it works with just a regular controller (as long as it has analog sticks). Current mapping: Solar Meter Group (0-3) - Left Analog Up Solar Meter Group (4-7) - Left Analog Down Solar Meter Group (8-10 & 0) - Left Analog Left Solar Meter Select (0/4/8) - Right Analog Up Solar Meter Select (1/5/9) - Right Analog Down Solar Meter Select (2/6/10) - Right Analog Left Solar Meter Select (3/7/0) - Right Analog Right (Extra slot here so we'll just circle back to 0.) The player chooses one of the three groups, plus one of the four selections at the same time. Example: If a player wanted solar meter 6, that would be Left Analog Down + Right Analog Left (at the same time).
Author
|
I added Analog Stick Control for the Solar Sensor Level. See the commit for details. I spoke with the devs on the mGBA Discord, and I came to the conclusion that this method of supporting jumping directly to a solar meter position is the best and least obtrusive without significant changes to the libretro core, frontends, etc. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Detect Boktai 1 by ROM code (U3IJ/U3IE/U3IP) and remap manual solar input to match its 8‑bar gauge. L3/R3 stepping now increments/decrements 0–8 bars (mapped onto the internal 0–10 lux steps), and the mgba_solar_sensor_level core option is clamped to 0–8 for Boktai 1 while leaving other games unchanged.