libretro: fix Boktai 1 solar bar mapping and add external analog solar input mode#320
Open
TideGear wants to merge 2 commits intolibretro:masterfrom
Open
libretro: fix Boktai 1 solar bar mapping and add external analog solar input mode#320TideGear wants to merge 2 commits intolibretro:masterfrom
TideGear wants to merge 2 commits intolibretro:masterfrom
Conversation
Boktai 1 only has 8 solar sensor bars, but the libretro core exposed all 10 steps (matching Boktai 2/3) for every Boktai game. This caused L3/R3 presses to overshoot — the player had to cycle through 10 increments when only 8 are meaningful. Detect Boktai 1 at ROM load time by checking the game code (U3IJ, U3IE, U3IP) and store the result in a static bool. Add two mapping functions that convert between the internal 10-step index and the 8-bar user-facing value. Steps 3/4 both map to bar 3 and steps 8/9 both map to bar 7, matching the game's native bar boundaries. Apply the mapping in all input paths: L3/R3 stepping, static core option values, and sensor-based input. The internal luxLevelIndex and shared GBA_LUX_LEVELS array are unchanged, so Boktai 2/3 and all other platforms are unaffected.
… option labels Rename the mgba_solar_sensor_level option label from Solar Sensor Level to Solar Sensor. Add a new option value: external (Use external sensor (Ojo del Sol)). Relabel static levels to Static: N bars (0 through 10) in both default and intl core option tables. Implement external sensor input handling in the libretro runtime: Scan all connected input ports. Require R3 held as the unlock gate. Read Right Stick X+ deflection and map to bars with floor/clamp behavior. Apply Boktai-specific bar ranges (0-8 for Boktai 1, 0-10 for Boktai 2/3). Suppress default R3/L3 brighten/darken solar binds while external mode is active so they do not interfere.
Author
|
Open to questions and suggestions! |
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.
Summary
This PR intentionally contains two commits:
What changed
Solar Sensorcore option value:Use external sensor (Ojo del Sol).R3hold as an unlock gateX+deflection and map it to bars with floor/clamp logicL3/R3brighten/darken stepping while external mode is active.Solar Sensor,Static: N bars, including intl tables).Why
R3How to test
Solar SensortoUse external sensor (Ojo del Sol).R3, move right stick: solar value should not update.R3and move right stick right: solar value should track stick deflection.R3while maintaining deflection to lock in the solar value.L3/R3brighten/darken binds do not interfere while external mode is active.sensorand static values; verify normal behavior still works.Notes
Ojo del Solis considered too product-specific, I can rename it to a generic label.libretro_core_options_intl.h.