@@ -1886,7 +1886,10 @@ void drawDEFormatMenu()
18861886 // number of core menu items
18871887 #define N_DEFMT_CORE 8
18881888
1889- MenuItem mitems[N_DEFMT_CORE +N_PANE_0_CH ] = {
1889+ // PLOT_CH_SATACT can't join PANE_0_CH_MASK -- that's a 32-bit bitmask constant and SATACT's
1890+ // ordinal (32) can never fit in one, by the same design as everywhere else PLOTBIT() is used.
1891+ // it's offered as one extra, separately-handled menu item instead.
1892+ MenuItem mitems[N_DEFMT_CORE +N_PANE_0_CH +1 ] = {
18901893
18911894 // outer menu is whether to display the DE pane or use both DE+DX for a pane choice
18921895 {MENU_1OFN , !SHOWING_PANE_0 (), 1 , mi, " DE format:" , NULL },
@@ -1920,11 +1923,22 @@ void drawDEFormatMenu()
19201923 PlotPane pp = findPaneForChoice ((PlotChoice)plot_n);
19211924 bool available = plotChoiceIsAvailable ((PlotChoice)plot_n) && (pp == PANE_NONE || pp == PANE_0 );
19221925 MenuFieldType type = available ? MENU_AL1OFN : MENU_IGNORE ;
1923- mitems[N_DEFMT_CORE +i] = {type, !!(plot_rotset[PANE_0 ] & ( 1 << plot_n)), 3 , Mi, plot_names[plot_n], 0 };
1926+ mitems[N_DEFMT_CORE +i] = {type, !!(plot_rotset[PANE_0 ] & PLOTBIT ( plot_n)), 3 , Mi, plot_names[plot_n], 0 };
19241927 }
19251928 if (pane_0_bits != 0 )
19261929 fatalError (" drawDEFormatMenu() %d %d 0x%x\n " , pane_0_bits, N_PANE_0_CH , PANE_0_CH_MASK );
19271930
1931+ // extra SATACT item -- can't be represented in plot_rotset (see comment above), so its
1932+ // "currently set" state is determined the same way paneHasChoice() checks a solo choice
1933+ const int SATACT_MI = N_DEFMT_CORE + N_PANE_0_CH ;
1934+ {
1935+ PlotPane pp = findPaneForChoice (PLOT_CH_SATACT );
1936+ bool available = plotChoiceIsAvailable (PLOT_CH_SATACT ) && (pp == PANE_NONE || pp == PANE_0 );
1937+ MenuFieldType type = available ? MENU_AL1OFN : MENU_IGNORE ;
1938+ bool is_set = (plot_ch[PANE_0 ] == PLOT_CH_SATACT && plot_rotset[PANE_0 ] == 0 );
1939+ mitems[SATACT_MI ] = {type, is_set, 3 , Mi, plot_names[PLOT_CH_SATACT ], 0 };
1940+ }
1941+
19281942 // create a box for the menu
19291943 SBox menu_b;
19301944 menu_b.x = de_info_b.x + 4 ;
@@ -1966,18 +1980,26 @@ void drawDEFormatMenu()
19661980 uint32_t new_rotset = 0 ;
19671981 for (int i = 0 ; i < N_PANE_0_CH ; i++) {
19681982 if (mitems[N_DEFMT_CORE +i].set )
1969- new_rotset |= ( 1 << menu_ch[i]);
1983+ new_rotset |= PLOTBIT ( menu_ch[i]);
19701984 }
19711985
1972- // might not be any if user clicked this section but made no choice
1973- if (new_rotset != 0 ) {
1986+ bool satact_set = mitems[SATACT_MI ].set ;
1987+
1988+ if (satact_set && new_rotset == 0 ) {
1989+
1990+ // SATACT alone: solo, non-rotating choice -- can't be represented in plot_rotset
1991+ plot_ch[PANE_0 ] = PLOT_CH_SATACT ;
1992+ plot_rotset[PANE_0 ] = 0 ;
1993+
1994+ } else if (new_rotset != 0 ) {
19741995
1975- // ok!
1996+ // one or more mask-based choices (SATACT, if also checked, can't join a
1997+ // multi-item rotation set the way these can, so it's dropped in that case)
19761998 plot_rotset[PANE_0 ] = new_rotset;
19771999
19782000 // pick any one as current
19792001 for (int i = 0 ; i < PLOT_CH_N ; i++) {
1980- if (plot_rotset[PANE_0 ] & ( 1 << i)) {
2002+ if (plot_rotset[PANE_0 ] & PLOTBIT ( i)) {
19812003 plot_ch[PANE_0 ] = (PlotChoice) i;
19822004 break ;
19832005 }
0 commit comments