Improve responsiveness of 8-way joysticks default behaviour on 4-way games when moves unintentionally become diagonal by favouring the new direction change.

This commit is contained in:
Quench0 2015-02-21 01:37:43 +11:00
parent 34d335629e
commit 354bd957d0
3 changed files with 4 additions and 6 deletions

View File

@ -422,9 +422,8 @@ static const code_string_table itemid_token_table[] =
// standard joystick mappings
const char joystick_map_8way[] = "7778...4445";
const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445";
const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
// const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445";
//**************************************************************************

View File

@ -1135,7 +1135,6 @@ private:
// joystick maps
extern const char joystick_map_8way[];
extern const char joystick_map_4way_sticky[];
extern const char joystick_map_4way_diagonal[];

View File

@ -2519,14 +2519,14 @@ time_t ioport_manager::initialize()
init_autoselect_devices(IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
init_autoselect_devices(IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
// look for 4-way joysticks and change the default map if we find any
// look for 4-way diagonal joysticks and change the default map if we find any
const char *joystick_map_default = machine().options().joystick_map();
if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
for (ioport_port *port = first_port(); port != NULL; port = port->next())
for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
if (field->live().joystick != NULL && field->way() == 4)
if (field->live().joystick != NULL && field->rotated())
{
machine().input().set_global_joystick_map(field->rotated() ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
machine().input().set_global_joystick_map(joystick_map_4way_diagonal);
break;
}