src/emu/ioport.c
| r15464 | r15465 | |
| 2652 | 2652 | mame_printf_error("Input port errors:\n%s", errors.cstr()); |
| 2653 | 2653 | } |
| 2654 | 2654 | |
| 2655 | // renumber player numbers for controller ports |
| 2656 | int player_offset = 0; |
| 2657 | for (device_t *device = iter.first(); device != NULL; device = iter.next()) |
| 2658 | { |
| 2659 | int players = 0; |
| 2660 | for (ioport_port *port = first_port(); port != NULL; port = port->next()) |
| 2661 | { |
| 2662 | if (&port->device()==device) |
| 2663 | { |
| 2664 | for (ioport_field *field = port->first_field(); field != NULL; field = field->next()) |
| 2665 | if (field->type_class()==INPUT_CLASS_CONTROLLER) |
| 2666 | { |
| 2667 | if (players < field->player() + 1) players = field->player() + 1; |
| 2668 | field->set_player(field->player() + player_offset); |
| 2669 | } |
| 2670 | } |
| 2671 | } |
| 2672 | player_offset += players; |
| 2673 | } |
| 2674 | |
| 2655 | 2675 | // allocate live structures to mirror the configuration |
| 2656 | 2676 | for (ioport_port *port = first_port(); port != NULL; port = port->next()) |
| 2657 | 2677 | port->init_live_state(); |
src/mess/machine/c64_4cga.c
| r15464 | r15465 | |
| 23 | 23 | |
| 24 | 24 | static INPUT_PORTS_START( c64_4player )
|
| 25 | 25 | PORT_START("JOY3")
|
| 26 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(3)
|
| 27 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(3)
|
| 28 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(3)
|
| 29 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(3)
|
| 26 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1)
|
| 27 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1)
|
| 28 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1)
|
| 29 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1)
|
| 30 | 30 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
| 31 | 31 | |
| 32 | 32 | PORT_START("JOY4")
|
| 33 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(4)
|
| 34 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(4)
|
| 35 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(4)
|
| 36 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(4)
|
| 33 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2)
|
| 34 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2)
|
| 35 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2)
|
| 36 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2)
|
| 37 | 37 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED )
|
| 38 | 38 | |
| 39 | 39 | PORT_START("FIRE")
|
| 40 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3)
|
| 41 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(4)
|
| 40 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1)
|
| 41 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2)
|
| 42 | 42 | PORT_BIT( 0xcf, IP_ACTIVE_LOW, IPT_UNUSED )
|
| 43 | 43 | INPUT_PORTS_END
|
| 44 | 44 | |