mirror of
https://github.com/holub/mame
synced 2025-05-25 07:15:25 +03:00
Fixed Analog Settings to return to default when IPT_UI_SELECT (enter) pressed.
Fixed misplaced brackets, allowing upper/lower case extensions for crosshair graphics and ldplayer chd files.
This commit is contained in:
parent
5fe1d26c40
commit
1125eb211c
@ -467,7 +467,7 @@ static void crosshair_load(running_machine *machine, int config_type, xml_data_n
|
|||||||
{
|
{
|
||||||
auto_time = xml_get_attribute_int(crosshairnode, "val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
|
auto_time = xml_get_attribute_int(crosshairnode, "val", CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT);
|
||||||
if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX))
|
if ((auto_time >= CROSSHAIR_VISIBILITY_AUTOTIME_MIN) && (auto_time <= CROSSHAIR_VISIBILITY_AUTOTIME_MAX))
|
||||||
global.auto_time = (UINT8)auto_time;
|
global.auto_time = (UINT8)auto_time;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,6 +163,7 @@ struct _analog_item_data
|
|||||||
int type;
|
int type;
|
||||||
int min, max;
|
int min, max;
|
||||||
int cur;
|
int cur;
|
||||||
|
int defvalue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -2222,7 +2223,7 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter
|
|||||||
{
|
{
|
||||||
/* if selected, reset to default value */
|
/* if selected, reset to default value */
|
||||||
case IPT_UI_SELECT:
|
case IPT_UI_SELECT:
|
||||||
newval = data->field->defvalue;
|
newval = data->defvalue;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* left decrements */
|
/* left decrements */
|
||||||
@ -2331,6 +2332,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
|
|||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
data->cur = settings.delta;
|
data->cur = settings.delta;
|
||||||
|
data->defvalue = field->delta;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_CENTERSPEED:
|
case ANALOG_ITEM_CENTERSPEED:
|
||||||
@ -2339,6 +2341,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
|
|||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
data->cur = settings.centerdelta;
|
data->cur = settings.centerdelta;
|
||||||
|
data->defvalue = field->centerdelta;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_REVERSE:
|
case ANALOG_ITEM_REVERSE:
|
||||||
@ -2347,6 +2350,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
|
|||||||
data->min = 0;
|
data->min = 0;
|
||||||
data->max = 1;
|
data->max = 1;
|
||||||
data->cur = settings.reverse;
|
data->cur = settings.reverse;
|
||||||
|
data->defvalue = ((field->flags & ANALOG_FLAG_REVERSE) != 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ANALOG_ITEM_SENSITIVITY:
|
case ANALOG_ITEM_SENSITIVITY:
|
||||||
@ -2355,6 +2359,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
|
|||||||
data->min = 1;
|
data->min = 1;
|
||||||
data->max = 255;
|
data->max = 255;
|
||||||
data->cur = settings.sensitivity;
|
data->cur = settings.sensitivity;
|
||||||
|
data->defvalue = field->sensitivity;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3241,10 +3246,10 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
|
|||||||
|
|
||||||
/* look for files ending in .png with a name not larger then 9 chars*/
|
/* look for files ending in .png with a name not larger then 9 chars*/
|
||||||
if ((length > 4) && (length <= CROSSHAIR_PIC_NAME_LENGTH + 4) &&
|
if ((length > 4) && (length <= CROSSHAIR_PIC_NAME_LENGTH + 4) &&
|
||||||
tolower(dir->name[length - 4] == '.') &&
|
dir->name[length - 4] == '.' &&
|
||||||
tolower(dir->name[length - 3] == 'p') &&
|
tolower(dir->name[length - 3]) == 'p' &&
|
||||||
tolower(dir->name[length - 2] == 'n') &&
|
tolower(dir->name[length - 2]) == 'n' &&
|
||||||
tolower(dir->name[length - 1] == 'g'))
|
tolower(dir->name[length - 1]) == 'g')
|
||||||
|
|
||||||
{
|
{
|
||||||
/* remove .png from length */
|
/* remove .png from length */
|
||||||
|
@ -106,10 +106,10 @@ static chd_file *get_disc(const device_config *device)
|
|||||||
|
|
||||||
/* look for files ending in .chd */
|
/* look for files ending in .chd */
|
||||||
if (length > 4 &&
|
if (length > 4 &&
|
||||||
tolower(dir->name[length - 4] == '.') &&
|
dir->name[length - 4] == '.' &&
|
||||||
tolower(dir->name[length - 3] == 'c') &&
|
tolower(dir->name[length - 3]) == 'c' &&
|
||||||
tolower(dir->name[length - 2] == 'h') &&
|
tolower(dir->name[length - 2]) == 'h' &&
|
||||||
tolower(dir->name[length - 1] == 'd'))
|
tolower(dir->name[length - 1]) == 'd')
|
||||||
{
|
{
|
||||||
file_error filerr;
|
file_error filerr;
|
||||||
chd_error chderr;
|
chd_error chderr;
|
||||||
|
Loading…
Reference in New Issue
Block a user