trunk/src/emu/bus/rs232/rs232.h
| r242807 | r242808 | |
| 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_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 44 | PORT_CONFNAME(0xff, _default_baud, _description) PORT_DEVICE 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") \ |
| r242807 | r242808 | |
| 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_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 65 | PORT_CONFNAME(0xff, _default_startbits, _description) PORT_DEVICE 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 | |
| r242807 | r242808 | |
| 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_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 76 | PORT_CONFNAME(0xff, _default_databits, _description) PORT_DEVICE 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") \ |
| r242807 | r242808 | |
| 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_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 90 | PORT_CONFNAME(0xff, _default_parity, "Parity") PORT_DEVICE 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") \ |
| r242807 | r242808 | |
| 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_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ |
| 104 | PORT_CONFNAME(0xff, 0x01, _description) PORT_DEVICE 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
| r242807 | r242808 | |
| 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_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) |
| 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) |
| 252 | 252 | |
| 253 | 253 | PORT_START( "ser_mouse_x" ) /* Mouse - X AXIS */ |
| 254 | | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 254 | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_X) PORT_DEVICE PORT_SENSITIVITY(100) PORT_DEVICE 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_SENSITIVITY(100) PORT_KEYDELTA(0) PORT_PLAYER(1) |
| 257 | PORT_BIT( 0xfff, 0x00, IPT_MOUSE_Y) PORT_DEVICE PORT_SENSITIVITY(100) PORT_DEVICE 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
| r242807 | r242808 | |
| 46 | 46 | |
| 47 | 47 | static INPUT_PORTS_START( sms_graphic ) |
| 48 | 48 | PORT_START("BUTTONS") |
| 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 |
| 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 |
| 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_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 55 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_X) PORT_DEVICE 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_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(50) PORT_KEYDELTA(15) |
| 58 | PORT_BIT( 0xff, 0x00, IPT_LIGHTGUN_Y) PORT_DEVICE 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
| r242807 | r242808 | |
| 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 |
| 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 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 28 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL |
| 29 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 30 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR |
| 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 |
| 27 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 28 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL |
| 29 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 30 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // TR |
| 31 | 31 | INPUT_PORTS_END |
| 32 | 32 | |
| 33 | 33 | |
trunk/src/emu/bus/sms_ctrl/lphaser.c
| r242807 | r242808 | |
| 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 ) // TL (trigger) |
| 42 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_light_phaser_device, th_pin_r, NULL) |
| 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) |
| 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_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_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) |
| 47 | 47 | |
| 48 | 48 | PORT_START("LPHASER_Y") |
| 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) |
| 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) |
| 50 | 50 | INPUT_PORTS_END |
| 51 | 51 | |
| 52 | 52 | |
trunk/src/emu/bus/sms_ctrl/paddle.c
| r242807 | r242808 | |
| 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_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, dir_pins_r, NULL) // Directional pins |
| 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 |
| 46 | 46 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 47 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) // TL |
| 47 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL |
| 48 | 48 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 49 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, sms_paddle_device, tr_pin_r, NULL) |
| 49 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_DEVICE 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_SENSITIVITY(40) PORT_KEYDELTA(20) PORT_CENTERDELTA(0) PORT_MINMAX(0,255) |
| 52 | PORT_BIT( 0xff, 0x80, IPT_PADDLE) PORT_DEVICE 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
| r242807 | r242808 | |
| 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_CUSTOM_MEMBER(DEVICE_SELF, sms_sports_pad_device, dir_pins_r, NULL) // Directional pins |
| 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 |
| 75 | 75 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // Vcc |
| 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) |
| 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) |
| 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_CHANGED_MEMBER(DEVICE_SELF, sms_sports_pad_device, th_pin_w, NULL) |
| 84 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OUTPUT ) PORT_DEVICE 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_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 88 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_DEVICE 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_SENSITIVITY(50) PORT_KEYDELTA(40) PORT_RESET PORT_REVERSE |
| 91 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_DEVICE 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
| r242807 | r242808 | |
| 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_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_DEVICE 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 ) // TL (Button 1) |
| 58 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_DEVICE // TL (Button 1) |
| 59 | 59 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // TH |
| 60 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) // TR (Button 2) |
| 60 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_DEVICE // 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_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 63 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_X ) PORT_DEVICE 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_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 66 | PORT_BIT( 0xff, 0x00, IPT_TRACKBALL_Y ) PORT_DEVICE PORT_SENSITIVITY(50) PORT_KEYDELTA(40) |
| 67 | 67 | INPUT_PORTS_END |
| 68 | 68 | |
| 69 | 69 | |
trunk/src/emu/ioport.h
| r242807 | r242808 | |
| 992 | 992 | friend class dynamic_field; |
| 993 | 993 | |
| 994 | 994 | // flags for ioport_fields |
| 995 | | static const int FIELD_FLAG_UNUSED = 0x01; // set if this field is unused but relevant to other games on the same hw |
| 996 | | static const int FIELD_FLAG_COCKTAIL = 0x02; // set if this field is relevant only for cocktail cabinets |
| 997 | | static const int FIELD_FLAG_TOGGLE = 0x04; // set if this field should behave as a toggle |
| 998 | | static const int FIELD_FLAG_ROTATED = 0x08; // set if this field represents a rotated control |
| 999 | | static const int ANALOG_FLAG_REVERSE = 0x10; // analog only: reverse the sense of the axis |
| 1000 | | static const int ANALOG_FLAG_RESET = 0x20; // analog only: always preload in->default for relative axes, returning only deltas |
| 1001 | | static const int ANALOG_FLAG_WRAPS = 0x40; // analog only: positional count wraps around |
| 1002 | | static const int ANALOG_FLAG_INVERT = 0x80; // analog only: bitwise invert bits |
| 995 | static const int FIELD_FLAG_UNUSED = 0x0001; // set if this field is unused but relevant to other games on the same hw |
| 996 | static const int FIELD_FLAG_COCKTAIL = 0x0002; // set if this field is relevant only for cocktail cabinets |
| 997 | static const int FIELD_FLAG_TOGGLE = 0x0004; // set if this field should behave as a toggle |
| 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 |
| 1003 | 1004 | |
| 1004 | 1005 | public: |
| 1005 | 1006 | // construction/destruction |
| r242807 | r242808 | |
| 1027 | 1028 | bool cocktail() const { return ((m_flags & FIELD_FLAG_COCKTAIL) != 0); } |
| 1028 | 1029 | bool toggle() const { return ((m_flags & FIELD_FLAG_TOGGLE) != 0); } |
| 1029 | 1030 | bool rotated() const { return ((m_flags & FIELD_FLAG_ROTATED) != 0); } |
| 1031 | bool used_in_device() const { return ((m_flags & FIELD_FLAG_DEVICE) != 0); } |
| 1030 | 1032 | bool analog_reverse() const { return ((m_flags & ANALOG_FLAG_REVERSE) != 0); } |
| 1031 | 1033 | bool analog_reset() const { return ((m_flags & ANALOG_FLAG_RESET) != 0); } |
| 1032 | 1034 | bool analog_wraps() const { return ((m_flags & ANALOG_FLAG_WRAPS) != 0); } |
| r242807 | r242808 | |
| 1489 | 1491 | void field_set_way(int way) const { m_curfield->m_way = way; } |
| 1490 | 1492 | void field_set_rotated() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_ROTATED; } |
| 1491 | 1493 | 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; } |
| 1492 | 1495 | void field_set_player(int player) const { m_curfield->m_player = player - 1; } |
| 1493 | 1496 | void field_set_cocktail() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_COCKTAIL; field_set_player(2); } |
| 1494 | 1497 | void field_set_toggle() const { m_curfield->m_flags |= ioport_field::FIELD_FLAG_TOGGLE; } |
| r242807 | r242808 | |
| 1624 | 1627 | #define PORT_NAME(_name) \ |
| 1625 | 1628 | configurer.field_set_name(_name); |
| 1626 | 1629 | |
| 1630 | #define PORT_DEVICE \ |
| 1631 | configurer.field_set_device(); |
| 1632 | |
| 1627 | 1633 | #define PORT_PLAYER(_player) \ |
| 1628 | 1634 | configurer.field_set_player(_player); |
| 1629 | 1635 | |
trunk/src/emu/ui/miscmenu.c
| r242807 | r242808 | |
| 510 | 510 | item->sortorder = sortorder * 4 + suborder[seqtype]; |
| 511 | 511 | item->type = ioport_manager::type_is_analog(entry->type()) ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; |
| 512 | 512 | item->name = entry->name(); |
| 513 | item->owner_name = NULL; |
| 513 | 514 | item->next = itemlist; |
| 514 | 515 | itemlist = item; |
| 515 | 516 | |
| r242807 | r242808 | |
| 583 | 584 | item->sortorder = sortorder + suborder[seqtype]; |
| 584 | 585 | item->type = field->is_analog() ? (INPUT_TYPE_ANALOG + seqtype) : INPUT_TYPE_DIGITAL; |
| 585 | 586 | item->name = name; |
| 587 | item->owner_name = field->used_in_device() ? (field->device().tag() + 1) : NULL; |
| 586 | 588 | item->next = itemlist; |
| 587 | 589 | itemlist = item; |
| 588 | 590 | |
| r242807 | r242808 | |
| 789 | 791 | /* generate the name of the item itself, based off the base name and the type */ |
| 790 | 792 | item = itemarray[curitem]; |
| 791 | 793 | assert(nameformat[item->type] != NULL); |
| 792 | | text.printf(nameformat[item->type], item->name); |
| 794 | if (item->owner_name) |
| 795 | { |
| 796 | text.printf("[%s] ", item->owner_name); |
| 797 | text.catprintf(nameformat[item->type], item->name); |
| 798 | } |
| 799 | else |
| 800 | text.printf(nameformat[item->type], item->name); |
| 793 | 801 | |
| 794 | 802 | /* if we're polling this item, use some spaces with left/right arrows */ |
| 795 | 803 | if (pollingref == item->ref) |
| r242807 | r242808 | |
| 921 | 929 | if (field->type() == type && field->enabled()) |
| 922 | 930 | { |
| 923 | 931 | UINT32 flags = 0; |
| 932 | astring name; |
| 924 | 933 | |
| 925 | 934 | /* set the left/right flags appropriately */ |
| 926 | 935 | if (field->has_previous_setting()) |
| r242807 | r242808 | |
| 929 | 938 | flags |= MENU_FLAG_RIGHT_ARROW; |
| 930 | 939 | |
| 931 | 940 | /* add the menu item */ |
| 932 | | item_append(field->name(), field->setting_name(), flags, (void *)field); |
| 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()); |
| 933 | 945 | |
| 946 | item_append(name.cstr(), field->setting_name(), flags, (void *)field); |
| 947 | |
| 934 | 948 | /* for DIP switches, build up the model */ |
| 935 | 949 | if (type == IPT_DIPSWITCH && field->first_diplocation() != NULL) |
| 936 | 950 | { |
| r242807 | r242808 | |
| 1217 | 1231 | { |
| 1218 | 1232 | analog_item_data *data; |
| 1219 | 1233 | UINT32 flags = 0; |
| 1220 | | |
| 1234 | 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()); |
| 1239 | |
| 1221 | 1240 | /* allocate a data item for tracking what this menu item refers to */ |
| 1222 | 1241 | data = (analog_item_data *)m_pool_alloc(sizeof(*data)); |
| 1223 | 1242 | data->field = field; |
| r242807 | r242808 | |
| 1228 | 1247 | { |
| 1229 | 1248 | default: |
| 1230 | 1249 | case ANALOG_ITEM_KEYSPEED: |
| 1231 | | text.printf("%s Digital Speed", field->name()); |
| 1250 | text.printf("%s Digital Speed", name.cstr()); |
| 1232 | 1251 | subtext.printf("%d", settings.delta); |
| 1233 | 1252 | data->min = 0; |
| 1234 | 1253 | data->max = 255; |
| r242807 | r242808 | |
| 1237 | 1256 | break; |
| 1238 | 1257 | |
| 1239 | 1258 | case ANALOG_ITEM_CENTERSPEED: |
| 1240 | | text.printf("%s Autocenter Speed", field->name()); |
| 1259 | text.printf("%s Autocenter Speed", name.cstr()); |
| 1241 | 1260 | subtext.printf("%d", settings.centerdelta); |
| 1242 | 1261 | data->min = 0; |
| 1243 | 1262 | data->max = 255; |
| r242807 | r242808 | |
| 1246 | 1265 | break; |
| 1247 | 1266 | |
| 1248 | 1267 | case ANALOG_ITEM_REVERSE: |
| 1249 | | text.printf("%s Reverse", field->name()); |
| 1268 | text.printf("%s Reverse", name.cstr()); |
| 1250 | 1269 | subtext.cpy(settings.reverse ? "On" : "Off"); |
| 1251 | 1270 | data->min = 0; |
| 1252 | 1271 | data->max = 1; |
| r242807 | r242808 | |
| 1255 | 1274 | break; |
| 1256 | 1275 | |
| 1257 | 1276 | case ANALOG_ITEM_SENSITIVITY: |
| 1258 | | text.printf("%s Sensitivity", field->name()); |
| 1277 | text.printf("%s Sensitivity", name.cstr()); |
| 1259 | 1278 | subtext.printf("%d", settings.sensitivity); |
| 1260 | 1279 | data->min = 1; |
| 1261 | 1280 | data->max = 255; |
trunk/src/osd/windows/winfile.c
| r242807 | r242808 | |
| 22 | 22 | #include "winutil.h" |
| 23 | 23 | #include "winutf8.h" |
| 24 | 24 | |
| 25 | | #if defined(SDLMAME_WIN32) || defined(SDLMAME_OS2) |
| 26 | | #define INVPATHSEPCH '/' |
| 27 | | #else |
| 28 | | #define INVPATHSEPCH '\\' |
| 29 | | #endif |
| 30 | | |
| 31 | 25 | #include "winfile.h" |
| 32 | 26 | |
| 33 | 27 | //============================================================ |
| r242807 | r242808 | |
| 96 | 90 | |
| 97 | 91 | // convert the path into something Windows compatible |
| 98 | 92 | dst = (*file)->filename; |
| 93 | #if defined(SDLMAME_WIN32) || defined(SDLMAME_OS2) |
| 99 | 94 | for (src = t_path; *src != 0; src++) |
| 95 | *dst++ = (*src == '/') ? '\\' : *src; |
| 96 | #else |
| 97 | for (src = t_path; *src != 0; src++) |
| 100 | 98 | *dst++ = *src;//(*src == '/') ? '\\' : *src; |
| 99 | #endif |
| 101 | 100 | *dst++ = 0; |
| 102 | 101 | |
| 103 | 102 | // select the file open modes |
| r242807 | r242808 | |
| 127 | 126 | // create the path if necessary |
| 128 | 127 | if (error == ERROR_PATH_NOT_FOUND && (openflags & OPEN_FLAG_CREATE) && (openflags & OPEN_FLAG_CREATE_PATHS)) |
| 129 | 128 | { |
| 130 | | TCHAR *pathsep = _tcsrchr((*file)->filename, INVPATHSEPCH); |
| 129 | TCHAR *pathsep = _tcsrchr((*file)->filename, '\\'); |
| 131 | 130 | if (pathsep != NULL) |
| 132 | 131 | { |
| 133 | 132 | // create the path up to the file |
| 134 | 133 | *pathsep = 0; |
| 135 | 134 | error = create_path_recursive((*file)->filename); |
| 136 | | *pathsep = INVPATHSEPCH; |
| 135 | *pathsep = '\\'; |
| 137 | 136 | |
| 138 | 137 | // attempt to reopen the file |
| 139 | 138 | if (error == NO_ERROR) |
| r242807 | r242808 | |
| 406 | 405 | |
| 407 | 406 | DWORD create_path_recursive(const TCHAR *path) |
| 408 | 407 | { |
| 409 | | TCHAR *sep = (TCHAR *)_tcsrchr(path, INVPATHSEPCH); |
| 408 | TCHAR *sep = (TCHAR *)_tcsrchr(path, '\\'); |
| 410 | 409 | |
| 411 | 410 | // if there's still a separator, and it's not the root, nuke it and recurse |
| 412 | | if (sep != NULL && sep > path && sep[0] != ':' && sep[-1] != INVPATHSEPCH) |
| 411 | if (sep != NULL && sep > path && sep[0] != ':' && sep[-1] != '\\') |
| 413 | 412 | { |
| 414 | 413 | *sep = 0; |
| 415 | 414 | create_path_recursive(path); |
| 416 | | *sep = INVPATHSEPCH; |
| 415 | *sep = '\\'; |
| 417 | 416 | } |
| 418 | 417 | |
| 419 | 418 | // if the path already exists, we're done |