Previous 199869 Revisions Next

r35150 Friday 20th February, 2015 at 14:42:08 UTC by Quench
Improve responsiveness of 8-way joysticks default behaviour on 4-way games when moves unintentionally become diagonal by favouring the new direction change.
[src/emu]input.c input.h ioport.c

trunk/src/emu/input.c
r243661r243662
422422
423423// standard joystick mappings
424424const char          joystick_map_8way[] = "7778...4445";
425const char          joystick_map_4way_sticky[] = "s8.4s8.44s8.4445";
426425const char          joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666";
426// const char          joystick_map_4way_sticky[] = "s8.4s8.44s8.4445";
427427
428428
429
430429//**************************************************************************
431430//  JOYSTICK MAP
432431//**************************************************************************
trunk/src/emu/input.h
r243661r243662
11351135
11361136// joystick maps
11371137extern const char joystick_map_8way[];
1138extern const char joystick_map_4way_sticky[];
11391138extern const char joystick_map_4way_diagonal[];
11401139
11411140
trunk/src/emu/ioport.c
r243661r243662
25192519   init_autoselect_devices(IPT_TRACKBALL_X, IPT_TRACKBALL_Y,  0,              OPTION_TRACKBALL_DEVICE,  "trackball");
25202520   init_autoselect_devices(IPT_MOUSE_X,     IPT_MOUSE_Y,      0,              OPTION_MOUSE_DEVICE,      "mouse");
25212521
2522   // look for 4-way joysticks and change the default map if we find any
2522   // look for 4-way diagonal joysticks and change the default map if we find any
25232523   const char *joystick_map_default = machine().options().joystick_map();
25242524   if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
25252525      for (ioport_port *port = first_port(); port != NULL; port = port->next())
25262526         for (ioport_field *field = port->first_field(); field != NULL; field = field->next())
2527            if (field->live().joystick != NULL && field->way() == 4)
2527            if (field->live().joystick != NULL && field->rotated())
25282528            {
2529               machine().input().set_global_joystick_map(field->rotated() ? joystick_map_4way_diagonal : joystick_map_4way_sticky);
2529               machine().input().set_global_joystick_map(joystick_map_4way_diagonal);
25302530               break;
25312531            }
25322532


Previous 199869 Revisions Next


© 1997-2024 The MAME Team