mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
Fix/extend parsing of -resolution command line arg
In both Windows and SDL builds, format of -resolution can now be any of: <width>x<height> <width>x<height>x<depth> <width>x<height>x<depth>@<refresh> <width>x<height>@<refresh> Omitted values are defaulted to 0, at the point of parsing (as before).
This commit is contained in:
parent
d77295b722
commit
6ccbaeda7e
@ -756,6 +756,11 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
|
||||
data = defdata;
|
||||
}
|
||||
|
||||
if (sscanf(data, "%dx%d@%d", &config->width, &config->height, &config->refresh) < 2 && report_error)
|
||||
if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
|
||||
osd_printf_error("Illegal resolution value = %s\n", data);
|
||||
|
||||
const char * at_pos = strchr(data, '@');
|
||||
if (at_pos)
|
||||
if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
|
||||
osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
|
||||
}
|
||||
|
@ -508,6 +508,12 @@ static void get_resolution(const char *defdata, const char *data, osd_window_con
|
||||
return;
|
||||
data = defdata;
|
||||
}
|
||||
if (sscanf(data, "%dx%d@%d", &config->width, &config->height, &config->refresh) < 2 && report_error)
|
||||
|
||||
if (sscanf(data, "%dx%dx%d", &config->width, &config->height, &config->depth) < 2 && report_error)
|
||||
osd_printf_error("Illegal resolution value = %s\n", data);
|
||||
|
||||
const char * at_pos = strchr(data, '@');
|
||||
if (at_pos)
|
||||
if (sscanf(at_pos + 1, "%d", &config->refresh) < 1 && report_error)
|
||||
osd_printf_error("Illegal refresh rate in resolution value = %s\n", data);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user