| 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 |
| r243661 | r243662 | |
|---|---|---|
| 422 | 422 | |
| 423 | 423 | // standard joystick mappings |
| 424 | 424 | const char joystick_map_8way[] = "7778...4445"; |
| 425 | const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445"; | |
| 426 | 425 | const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.222555666.222256666.2222s6666.2222s6666"; |
| 426 | // const char joystick_map_4way_sticky[] = "s8.4s8.44s8.4445"; | |
| 427 | 427 | |
| 428 | 428 | |
| 429 | ||
| 430 | 429 | //************************************************************************** |
| 431 | 430 | // JOYSTICK MAP |
| 432 | 431 | //************************************************************************** |
| r243661 | r243662 | |
|---|---|---|
| 1135 | 1135 | |
| 1136 | 1136 | // joystick maps |
| 1137 | 1137 | extern const char joystick_map_8way[]; |
| 1138 | extern const char joystick_map_4way_sticky[]; | |
| 1139 | 1138 | extern const char joystick_map_4way_diagonal[]; |
| 1140 | 1139 | |
| 1141 | 1140 |
| r243661 | r243662 | |
|---|---|---|
| 2519 | 2519 | init_autoselect_devices(IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball"); |
| 2520 | 2520 | init_autoselect_devices(IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse"); |
| 2521 | 2521 | |
| 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 | |
| 2523 | 2523 | const char *joystick_map_default = machine().options().joystick_map(); |
| 2524 | 2524 | if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0) |
| 2525 | 2525 | for (ioport_port *port = first_port(); port != NULL; port = port->next()) |
| 2526 | 2526 | for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) |
| 2527 | if (field->live().joystick != NULL && field-> | |
| 2527 | if (field->live().joystick != NULL && field->rotated()) | |
| 2528 | 2528 | { |
| 2529 | machine().input().set_global_joystick_map( | |
| 2529 | machine().input().set_global_joystick_map(joystick_map_4way_diagonal); | |
| 2530 | 2530 | break; |
| 2531 | 2531 | } |
| 2532 | 2532 |
| https://github.com/mamedev/mame/commit/354bd957d0c0343d25150daabdf748c4f94e7a5e |
| Previous | 199869 Revisions | Next |