Picking a preset no longer blinds the mode lamps
The six PRESET switches down the map's right flank stored their lamps in modeLamp[], which holds four. Indices 4 and 5 ran off the end into presetLamp[0..1], so the whole thing stayed self-consistent by memory layout and nobody noticed - but it overwrote the four control-mode lamps made moments earlier, and BASIC/STANDARD/VETERAN/MASTER on the upper-right MFD were never lit again. presetLamp[], meanwhile, went unused. The preset pass now fills the array it was always meant to, and the lamp work moves out of the switch handler into a virtual NotifyOfPresetChange that PresetEnable announces itself. That closes the second gap in passing: keyboard 1-6 changed the mappings without touching the lamps, leaving the flank showing a preset that was no longer in force. Both routes now go through one place. The lamp arrays are also cleared in the constructor - only the mapping loops ever filled them, and NOMODES skips those. Verified by dumping the commanded RIO lamp states out of the running game (PadRIO, TEST.EGG, at rest in Basic mode). Before and after are identical except lamp 0x33, BASIC, which goes from 14 dim to 3c lit. The preset lamps are unchanged: they worked by accident, and now work by construction. docs/CONTROL-PRESETS.md is the research behind it. The presets are not a map feature at all - each is a complete factory layout for the four mappable stick buttons, one mode-mask bit apiece, with all 26 vehicles carrying their own six-preset table in RPL4.RES for both the pod RIO and the Thrustmaster. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,12 @@ ModeMask
|
||||
//
|
||||
void
|
||||
PresetEnable(int preset_number);
|
||||
|
||||
// Announced by PresetEnable for EVERY preset change, whichever way it was
|
||||
// triggered - map-flank switch or keyboard. Platforms carrying preset
|
||||
// lamps move them here; the base mapper has none.
|
||||
virtual void
|
||||
NotifyOfPresetChange(int old_preset, int new_preset);
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// Protected data
|
||||
//
|
||||
@@ -250,6 +256,9 @@ public:
|
||||
void
|
||||
NotifyOfConfigurationModeChange(Logical new_state);
|
||||
|
||||
void
|
||||
NotifyOfPresetChange(int old_preset, int new_preset);
|
||||
|
||||
void
|
||||
SetPerformance(Performance performance)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user