--- uae/src/cfgfile.c 2018/04/24 17:07:24 1.1.1.12 +++ uae/src/cfgfile.c 2018/04/24 17:12:36 1.1.1.15 @@ -60,6 +60,7 @@ static struct cfg_lines opttable[] = {"gfx_colour_mode", "" }, {"32bit_blits", "Enable 32 bit blitter emulation" }, {"immediate_blits", "Perform blits immediately" }, + {"show_leds", "LED display" }, {"gfxlib_replacement", "Use graphics.library replacement?" }, {"sound_output", "" }, {"sound_frequency", "" }, @@ -175,7 +176,7 @@ void save_options (FILE *f, struct uae_p fprintf (f, "serial_on_demand=%s\n", p->serial_demand ? "true" : "false"); fprintf (f, "sound_output=%s\n", soundmode[p->produce_sound]); - fprintf (f, "sound_channels=%s\n", stereomode1[p->stereo + p->mixed_stereo]); + fprintf (f, "sound_channels=%s\n", stereomode1[p->sound_stereo + p->mixed_stereo]); fprintf (f, "sound_bits=%d\n", p->sound_bits); fprintf (f, "sound_min_buff=%d\n", p->sound_minbsiz); fprintf (f, "sound_max_buff=%d\n", p->sound_maxbsiz); @@ -204,6 +205,7 @@ void save_options (FILE *f, struct uae_p fprintf (f, "immediate_blits=%s\n", p->immediate_blits ? "true" : "false"); fprintf (f, "ntsc=%s\n", p->ntscmode ? "true" : "false"); + fprintf (f, "show_leds=%s\n", p->leds_on_screen ? "true" : "false"); if (p->chipset_mask & CSMASK_AGA) fprintf (f, "chipset=aga\n"); else if ((p->chipset_mask & CSMASK_ECS_AGNUS) && (p->chipset_mask & CSMASK_ECS_AGNUS)) @@ -432,15 +434,16 @@ int cfgfile_parse_option (struct uae_pre return 1; } - if (cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode1, 1) - || cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode2, 1) - || cfgfile_strval (option, value, "sound_channels", &p->stereo, stereomode3, 0)) + if (cfgfile_strval (option, value, "sound_channels", &p->sound_stereo, stereomode1, 1) + || cfgfile_strval (option, value, "sound_channels", &p->sound_stereo, stereomode2, 1) + || cfgfile_strval (option, value, "sound_channels", &p->sound_stereo, stereomode3, 0)) { p->mixed_stereo = 0; - if (p->stereo == 2) { - p->stereo = 1; + if (p->sound_stereo == 2) { + p->sound_stereo = 1; p->mixed_stereo = 1; } + return 1; } if (cfgfile_strval (option, value, "cpu_type", &p->cpu_level, cpumode, 0)) { @@ -594,7 +597,11 @@ int cfgfile_load (struct uae_prefs *p, c return 0; while (fgets (line, 256, fh) != 0) { - line[strcspn (line, "\t \r\n")] = '\0'; + int len = strlen (line); + /* Delete trailing whitespace. */ + while (len > 0 && strcspn (line + len - 1, "\t \r\n") == 0) { + line[--len] = '\0'; + } if (strlen (line) > 0) cfgfile_parse_line (p, line); } @@ -711,11 +718,11 @@ static void parse_sound_spec (char *spec if (x1) { currprefs.mixed_stereo = 0; if (*x1 == 'S') - currprefs.stereo = currprefs.mixed_stereo = 1; + currprefs.sound_stereo = currprefs.mixed_stereo = 1; else if (*x1 == 's') - currprefs.stereo = 1; + currprefs.sound_stereo = 1; else - currprefs.stereo = 0; + currprefs.sound_stereo = 0; } if (x2) currprefs.sound_bits = atoi (x2);