trunk/src/emu/bus/rs232/rs232.h
| r242838 | r242839 | |
| 41 | 41 | |
| 42 | 42 | #define MCFG_RS232_BAUD(_tag, _default_baud, _description, _class, _write_line) \ |
| 43 | 43 | PORT_START(_tag) \ |
| 44 | | PORT_CONFNAME(0xff, _default_baud, _description) PORT_DEVICE PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 44 | PORT_CONFNAME(0xff, _default_baud, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 45 | 45 | PORT_CONFSETTING( RS232_BAUD_110, "110") \ |
| 46 | 46 | PORT_CONFSETTING( RS232_BAUD_150, "150") \ |
| 47 | 47 | PORT_CONFSETTING( RS232_BAUD_300, "300") \ |
| r242838 | r242839 | |
| 62 | 62 | |
| 63 | 63 | #define MCFG_RS232_STARTBITS(_tag, _default_startbits, _description, _class, _write_line) \ |
| 64 | 64 | PORT_START(_tag) \ |
| 65 | | PORT_CONFNAME(0xff, _default_startbits, _description) PORT_DEVICE PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 65 | PORT_CONFNAME(0xff, _default_startbits, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 66 | 66 | PORT_CONFSETTING( RS232_STARTBITS_0, "0") \ |
| 67 | 67 | PORT_CONFSETTING( RS232_STARTBITS_1, "1") |
| 68 | 68 | |
| r242838 | r242839 | |
| 73 | 73 | |
| 74 | 74 | #define MCFG_RS232_DATABITS(_tag, _default_databits, _description, _class, _write_line) \ |
| 75 | 75 | PORT_START(_tag) \ |
| 76 | | PORT_CONFNAME(0xff, _default_databits, _description) PORT_DEVICE PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 76 | PORT_CONFNAME(0xff, _default_databits, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 77 | 77 | PORT_CONFSETTING( RS232_DATABITS_5, "5") \ |
| 78 | 78 | PORT_CONFSETTING( RS232_DATABITS_6, "6") \ |
| 79 | 79 | PORT_CONFSETTING( RS232_DATABITS_7, "7") \ |
| r242838 | r242839 | |
| 87 | 87 | |
| 88 | 88 | #define MCFG_RS232_PARITY(_tag, _default_parity, _description, _class, _write_line) \ |
| 89 | 89 | PORT_START(_tag) \ |
| 90 | | PORT_CONFNAME(0xff, _default_parity, "Parity") PORT_DEVICE PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 90 | PORT_CONFNAME(0xff, _default_parity, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 91 | 91 | PORT_CONFSETTING( RS232_PARITY_NONE, "None") \ |
| 92 | 92 | PORT_CONFSETTING( RS232_PARITY_ODD, "Odd") \ |
| 93 | 93 | PORT_CONFSETTING( RS232_PARITY_EVEN, "Even") \ |
| r242838 | r242839 | |
| 101 | 101 | |
| 102 | 102 | #define MCFG_RS232_STOPBITS(_tag, _default_stopbits, _description, _class, _write_line) \ |
| 103 | 103 | PORT_START(_tag) \ |
| 104 | | PORT_CONFNAME(0xff, 0x01, _description) PORT_DEVICE PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 104 | PORT_CONFNAME(0xff, 0x01, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 105 | 105 | PORT_CONFSETTING( RS232_STOPBITS_0, "0") \ |
| 106 | 106 | PORT_CONFSETTING( RS232_STOPBITS_1, "1") \ |
| 107 | 107 | PORT_CONFSETTING( RS232_STOPBITS_1_5, "1.5") \ |
trunk/src/emu/bus/rs232/ser_mouse.c
| r242838 | r242839 | |
| 246 | 246 | |
| 247 | 247 | static INPUT_PORTS_START( ser_mouse ) |
| 248 | 248 | PORT_START( "ser_mouse_btn" ) |
| 249 | | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_DEVICE PORT_NAME("Mouse Left Button") PORT_CODE(MOUSECODE_BUTTON1) |
| 250 | | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_DEVICE PORT_NAME("Mouse Middle Button") PORT_CODE(MOUSECODE_BUTTON3) |
| 251 | | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_DEVICE PORT_NAME("Mouse Right Button") PORT_CODE(MOUSECODE_BUTTON2) |
| 249 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Left Button") PORT_CODE(MOUSECODE_BUTTON1) |
| 250 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_NAME("Mouse Middle Button") PORT_CODE(MOUSECODE_BUTTON3) |
| 251 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_NAME("Mouse Right Button") PORT_CODE(MOUSECODE_BUTTON2) |
| 252 | 252 | |
| 253 | 253 | PORT_START( "ser_mouse_x" ) /* Mouse - X AXIS */ |
| 254 | | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_DEVICE PORT_SENSITIVITY(100) PORT_DEVICE PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 254 | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 255 | 255 | |
| 256 | 256 | PORT_START( "ser_mouse_y" ) /* Mouse - Y AXIS */ |
| 257 | | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_Y) PORT_DEVICE PORT_SENSITIVITY(100) PORT_DEVICE PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 257 | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_Y) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 258 | 258 | INPUT_PORTS_END |
| 259 | 259 | |
| 260 | 260 | ioport_constructor serial_mouse_device::device_input_ports() const |
trunk/src/emu/bus/sms_ctrl/graphic.c
| r242838 | r242839 | |
| 46 | 46 | |
| 47 | 47 | static INPUT_PORTS_START( sms_graphic ) |
| 48 | 48 | PORT_START("BUTTONS") |
| 49 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // MENU |
| 50 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // DO |
| 51 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_DEVICE // PEN |
| 49 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) // MENU |
| 50 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 ) // DO |
| 51 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON3 ) // PEN |
| 52 | 52 | PORT_BIT( 0xf8, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 53 | 53 | |
| 54 | 54 | PORT_START("X") |
| 55 | | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_DEVICE PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 55 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 56 | 56 | |
| 57 | 57 | PORT_START("Y") |
| 58 | | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_DEVICE PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 58 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 59 | 59 | INPUT_PORTS_END |
| 60 | 60 | |
| 61 | 61 | |
trunk/src/emu/bus/sms_ctrl/joypad.c
| r242838 | r242839 | |
| 20 | 20 | |
| 21 | 21 | static INPUT_PORTS_START( sms_joypad ) |
| 22 | 22 | PORT_START("JOYPAD") |
| 23 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_DEVICE |
| 24 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_DEVICE |
| 25 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_DEVICE |
| 26 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_DEVICE |
| 23 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY |
| 24 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY |
| 25 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY |
| 26 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY |
| 27 | 27 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 28 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL |
| 28 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL |
| 29 | 29 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 30 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // TR |
| 30 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR |
| 31 | 31 | INPUT_PORTS_END |
| 32 | 32 | |
| 33 | 33 | |
trunk/src/emu/bus/sms_ctrl/lphaser.c
| r242838 | r242839 | |
| 38 | 38 | |
| 39 | 39 | static INPUT_PORTS_START( sms_light_phaser ) |
| 40 | 40 | PORT_START("CTRL_PORT") |
| 41 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL (trigger) |
| 42 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_light_phaser_device, th_pin_r, NULL) |
| 41 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL (trigger) |
| 42 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_light_phaser_device, th_pin_r, NULL) |
| 43 | 43 | PORT_BIT( 0x9f, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 44 | 44 | |
| 45 | 45 | PORT_START("LPHASER_X") |
| 46 | | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_DEVICE PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_CHANGED_MEMBER(DEVICE_SELF, sms_light_phaser_device, position_changed, 0) |
| 46 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_CHANGED_MEMBER(DEVICE_SELF, sms_light_phaser_device, position_changed, 0) |
| 47 | 47 | |
| 48 | 48 | PORT_START("LPHASER_Y") |
| 49 | | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_DEVICE PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_CHANGED_MEMBER(DEVICE_SELF, sms_light_phaser_device, position_changed, 0) |
| 49 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) PORT_CHANGED_MEMBER(DEVICE_SELF, sms_light_phaser_device, position_changed, 0) |
| 50 | 50 | INPUT_PORTS_END |
| 51 | 51 | |
| 52 | 52 | |
trunk/src/emu/bus/sms_ctrl/paddle.c
| r242838 | r242839 | |
| 42 | 42 | |
| 43 | 43 | static INPUT_PORTS_START( sms_paddle ) |
| 44 | 44 | PORT_START("CTRL_PORT") |
| 45 | | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, dir_pins_r, NULL) // Directional pins |
| 45 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, dir_pins_r, NULL) // Directional pins |
| 46 | 46 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 47 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL |
| 47 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL |
| 48 | 48 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 49 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, tr_pin_r, NULL) |
| 49 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, tr_pin_r, NULL) |
| 50 | 50 | |
| 51 | 51 | PORT_START("PADDLE_X") // Paddle knob |
| 52 | | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_DEVICE PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) |
| 52 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) |
| 53 | 53 | INPUT_PORTS_END |
| 54 | 54 | |
| 55 | 55 | |
trunk/src/emu/bus/sms_ctrl/sports.c
| r242838 | r242839 | |
| 71 | 71 | |
| 72 | 72 | static INPUT_PORTS_START( sms_sports_pad ) |
| 73 | 73 | PORT_START("SPORTS_IN") |
| 74 | | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, dir_pins_r, NULL) // Directional pins |
| 74 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, dir_pins_r, NULL) // Directional pins |
| 75 | 75 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 76 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL (Button 1) |
| 77 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_r, NULL) |
| 78 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // TR (Button 2) |
| 76 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL (Button 1) |
| 77 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_r, NULL) |
| 78 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR (Button 2) |
| 79 | 79 | |
| 80 | 80 | PORT_START("SPORTS_OUT") |
| 81 | 81 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_UNUSED ) // Directional pins |
| 82 | 82 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 83 | 83 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNUSED ) // TL (Button 1) |
| 84 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_DEVICE PORT_CHANGED_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_w, NULL) |
| 84 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_CHANGED_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_w, NULL) |
| 85 | 85 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) // TR (Button 2) |
| 86 | 86 | |
| 87 | 87 | PORT_START("SPORTS_X") /* Sports Pad X axis */ |
| 88 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_DEVICE PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 88 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 89 | 89 | |
| 90 | 90 | PORT_START("SPORTS_Y") /* Sports Pad Y axis */ |
| 91 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_DEVICE PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 91 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 92 | 92 | INPUT_PORTS_END |
| 93 | 93 | |
| 94 | 94 | |
trunk/src/emu/bus/sms_ctrl/sportsjp.c
| r242838 | r242839 | |
| 53 | 53 | |
| 54 | 54 | static INPUT_PORTS_START( sms_sports_pad_jp ) |
| 55 | 55 | PORT_START("SPORTS_JP_IN") |
| 56 | | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_jp_device, dir_pins_r, NULL) // Directional pins |
| 56 | PORT_BIT( 0x0f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_jp_device, dir_pins_r, NULL) // Directional pins |
| 57 | 57 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 58 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL (Button 1) |
| 58 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL (Button 1) |
| 59 | 59 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 60 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // TR (Button 2) |
| 60 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR (Button 2) |
| 61 | 61 | |
| 62 | 62 | PORT_START("SPORTS_JP_X") /* Sports Pad X axis */ |
| 63 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_DEVICE PORT_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 63 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 64 | 64 | |
| 65 | 65 | PORT_START("SPORTS_JP_Y") /* Sports Pad Y axis */ |
| 66 | | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_DEVICE PORT_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 66 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 67 | 67 | INPUT_PORTS_END |
| 68 | 68 | |
| 69 | 69 | |
trunk/src/emu/ioport.h
| r242838 | r242839 | |
| 996 | 996 | static const int FIELD_FLAG_COCKTAIL = 0x0002; // set if this field is relevant only for cocktail cabinets |
| 997 | 997 | static const int FIELD_FLAG_TOGGLE = 0x0004; // set if this field should behave as a toggle |
| 998 | 998 | static const int FIELD_FLAG_ROTATED = 0x0008; // set if this field represents a rotated control |
| 999 | | static const int FIELD_FLAG_DEVICE = 0x0010; // set if this field is used only in a device |
| 1000 | | static const int ANALOG_FLAG_REVERSE = 0x0020; // analog only: reverse the sense of the axis |
| 1001 | | static const int ANALOG_FLAG_RESET = 0x0040; // analog only: always preload in->default for relative axes, returning only deltas |
| 1002 | | static const int ANALOG_FLAG_WRAPS = 0x0080; // analog only: positional count wraps around |
| 1003 | | static const int ANALOG_FLAG_INVERT = 0x0100; // analog only: bitwise invert bits |
| 999 | static const int ANALOG_FLAG_REVERSE = 0x0010; // analog only: reverse the sense of the axis |
| 1000 | static const int ANALOG_FLAG_RESET = 0x0020; // analog only: always preload in->default for relative axes, returning only deltas |
| 1001 | static const int ANALOG_FLAG_WRAPS = 0x0040; // analog only: positional count wraps around |
| 1002 | static const int ANALOG_FLAG_INVERT = 0x0080; // analog only: bitwise invert bits |
| 1004 | 1003 | |
| 1005 | 1004 | public: |
| 1006 | 1005 | // construction/destruction |
| r242838 | r242839 | |
| 1028 | 1027 | bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); } |
| 1029 | 1028 | bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); } |
| 1030 | 1029 | bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); } |
| 1031 | | bool used_in_device() const { return ((m_flags & FIELD_FLAG_DEVICE) != 0); } |
| 1032 | 1030 | bool analog_reverse() const { return ((m_flags & ANALOG_FLAG_REVERSE) != 0); } |
| 1033 | 1031 | bool analog_reset() const { return ((m_flags & ANALOG_FLAG_RESET) != 0); } |
| 1034 | 1032 | bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); } |
| r242838 | r242839 | |
| 1491 | 1489 | void field_set_way(int way) const { m_curfield->m_way = way; } |
| 1492 | 1490 | void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; } |
| 1493 | 1491 | void field_set_name(const char *name) const { m_curfield->m_name = string_from_token(name); } |
| 1494 | | void field_set_device() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_DEVICE; } |
| 1495 | 1492 | void field_set_player(int player) const { m_curfield->m_player = player - 1; } |
| 1496 | 1493 | void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); } |
| 1497 | 1494 | void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; } |
| r242838 | r242839 | |
| 1627 | 1624 | #define PORT_NAME(_name) \ |
| 1628 | 1625 | configurer.field_set_name(_name); |
| 1629 | 1626 | |
| 1630 | | #define PORT_DEVICE \ |
| 1631 | | configurer.field_set_device(); |
| 1632 | | |
| 1633 | 1627 | #define PORT_PLAYER(_player) \ |
| 1634 | 1628 | configurer.field_set_player(_player); |
| 1635 | 1629 | |
trunk/src/emu/ui/miscmenu.c
| r242838 | r242839 | |
| 561 | 561 | ((field->type() == IPT_OTHER && field->name() != NULL) || machine().ioport().type_group(field->type(), field->player()) != IPG_INVALID)) |
| 562 | 562 | { |
| 563 | 563 | input_seq_type seqtype; |
| 564 | | UINT16 sortorder; |
| 564 | UINT32 sortorder; |
| 565 | 565 | |
| 566 | 566 | /* determine the sorting order */ |
| 567 | 567 | if (field->type() >= IPT_START1 && field->type() < IPT_ANALOG_LAST) |
| 568 | { |
| 568 | 569 | sortorder = (field->type() << 2) | (field->player() << 12); |
| 570 | if (strcmp(field->device().tag(), ":")) |
| 571 | sortorder |= 0x10000; |
| 572 | } |
| 569 | 573 | else |
| 570 | 574 | sortorder = field->type() | 0xf000; |
| 571 | 575 | |
| r242838 | r242839 | |
| 584 | 588 | item->sortorder = sortorder + suborder[seqtype]; |
| 585 | 589 | item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; |
| 586 | 590 | item->name = name; |
| 587 | | item->owner_name = field->used_in_device() ? (field->device().tag() + 1) : NULL; |
| 591 | item->owner_name = field->device().tag(); |
| 588 | 592 | item->next = itemlist; |
| 589 | 593 | itemlist = item; |
| 590 | 594 | |
| r242838 | r242839 | |
| 762 | 766 | const char *nameformat[INPUT_TYPE_TOTAL] = { 0 }; |
| 763 | 767 | input_item_data **itemarray, *item; |
| 764 | 768 | int numitems = 0, curitem; |
| 769 | astring text; |
| 765 | 770 | astring subtext; |
| 766 | | astring text; |
| 771 | astring prev_owner; |
| 772 | bool first_entry = true; |
| 767 | 773 | |
| 768 | 774 | /* create a mini lookup table for name format based on type */ |
| 769 | 775 | nameformat[INPUT_TYPE_DIGITAL] = "%s"; |
| r242838 | r242839 | |
| 791 | 797 | /* generate the name of the item itself, based off the base name and the type */ |
| 792 | 798 | item = itemarray[curitem]; |
| 793 | 799 | assert(nameformat[item->type] != NULL); |
| 794 | | if (item->owner_name) |
| 800 | |
| 801 | if (strcmp(item->owner_name, prev_owner.cstr()) != 0) |
| 795 | 802 | { |
| 796 | | text.printf("[%s] ", item->owner_name); |
| 797 | | text.catprintf(nameformat[item->type], item->name); |
| 803 | if (first_entry) |
| 804 | first_entry = false; |
| 805 | else |
| 806 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 807 | text.printf("[root%s]", item->owner_name); |
| 808 | item_append(text, NULL, 0, NULL); |
| 809 | prev_owner.cpy(item->owner_name); |
| 798 | 810 | } |
| 799 | | else |
| 800 | | text.printf(nameformat[item->type], item->name); |
| 801 | 811 | |
| 812 | text.printf(nameformat[item->type], item->name); |
| 813 | |
| 802 | 814 | /* if we're polling this item, use some spaces with left/right arrows */ |
| 803 | 815 | if (pollingref == item->ref) |
| 804 | 816 | { |
| r242838 | r242839 | |
| 917 | 929 | ioport_field *field; |
| 918 | 930 | ioport_port *port; |
| 919 | 931 | dip_descriptor **diplist_tailptr; |
| 932 | astring prev_owner; |
| 933 | bool first_entry = true; |
| 920 | 934 | |
| 921 | 935 | /* reset the dip switch tracking */ |
| 922 | 936 | dipcount = 0; |
| r242838 | r242839 | |
| 938 | 952 | flags |= MENU_FLAG_RIGHT_ARROW; |
| 939 | 953 | |
| 940 | 954 | /* add the menu item */ |
| 941 | | if (field->used_in_device()) |
| 942 | | name.cpy("[").cat(field->device().tag() + 1).cat("] ").cat(field->name()); |
| 943 | | else |
| 944 | | name.cpy(field->name()); |
| 955 | if (strcmp(field->device().tag(), prev_owner.cstr()) != 0) |
| 956 | { |
| 957 | if (first_entry) |
| 958 | first_entry = false; |
| 959 | else |
| 960 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 961 | name.printf("[root%s]", field->device().tag()); |
| 962 | item_append(name, NULL, 0, NULL); |
| 963 | prev_owner.cpy(field->device().tag()); |
| 964 | } |
| 945 | 965 | |
| 946 | | item_append(name.cstr(), field->setting_name(), flags, (void *)field); |
| 966 | name.cpy(field->name()); |
| 947 | 967 | |
| 968 | item_append(name, field->setting_name(), flags, (void *)field); |
| 969 | |
| 948 | 970 | /* for DIP switches, build up the model */ |
| 949 | 971 | if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL) |
| 950 | 972 | { |
| r242838 | r242839 | |
| 1187 | 1209 | { |
| 1188 | 1210 | ioport_field *field; |
| 1189 | 1211 | ioport_port *port; |
| 1212 | astring text; |
| 1190 | 1213 | astring subtext; |
| 1191 | | astring text; |
| 1214 | astring prev_owner; |
| 1215 | bool first_entry = true; |
| 1192 | 1216 | |
| 1193 | 1217 | /* loop over input ports and add the items */ |
| 1194 | 1218 | for (port = machine().ioport().first_port(); port != NULL; port = port->next()) |
| r242838 | r242839 | |
| 1232 | 1256 | analog_item_data *data; |
| 1233 | 1257 | UINT32 flags = 0; |
| 1234 | 1258 | astring name; |
| 1235 | | if (field->used_in_device()) |
| 1236 | | name.cpy("[").cat(field->device().tag() + 1).cat("] ").cat(field->name()); |
| 1237 | | else |
| 1238 | | name.cpy(field->name()); |
| 1259 | if (strcmp(field->device().tag(), prev_owner.cstr()) != 0) |
| 1260 | { |
| 1261 | if (first_entry) |
| 1262 | first_entry = false; |
| 1263 | else |
| 1264 | item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL); |
| 1265 | name.printf("[root%s]", field->device().tag()); |
| 1266 | item_append(name, NULL, 0, NULL); |
| 1267 | prev_owner.cpy(field->device().tag()); |
| 1268 | } |
| 1269 | |
| 1270 | name.cpy(field->name()); |
| 1239 | 1271 | |
| 1240 | 1272 | /* allocate a data item for tracking what this menu item refers to */ |
| 1241 | 1273 | data = (analog_item_data *)m_pool_alloc(sizeof(*data)); |