diff options
author | 2020-07-30 15:07:31 +0200 | |
---|---|---|
committer | 2020-07-30 15:07:48 +0200 | |
commit | ce905cf4dc14bfcd69cd8759355a654a86485f0d (patch) | |
tree | 6bb0e7f3e0ed669d38de833ef157b9efb692e21e | |
parent | 33aef7a34067eeda598a597e79a9b0175be89313 (diff) |
savant: add sensorboard click delay
-rw-r--r-- | src/devices/machine/sensorboard.cpp | 40 | ||||
-rw-r--r-- | src/devices/machine/sensorboard.h | 4 | ||||
-rw-r--r-- | src/mame/drivers/novag_savant.cpp | 2 | ||||
-rw-r--r-- | src/mame/drivers/saitek_ssystem3.cpp | 1 |
4 files changed, 24 insertions, 23 deletions
diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp index 62d98add57c..e3e168d6e16 100644 --- a/src/devices/machine/sensorboard.cpp +++ b/src/devices/machine/sensorboard.cpp @@ -84,7 +84,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char m_nosensors = false; m_magnets = false; m_inductive = false; - m_ui_enabled = 3; + m_ui_enabled = 7; set_delay(attotime::never); // set defaults for most common use case (aka chess) @@ -789,16 +789,25 @@ static INPUT_PORTS_START( sensorboard ) PORT_BIT(0x8000, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("SS_CHECK", 1<<15, EQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_spawn, 16) PORT_NAME("Spawn Piece 16") PORT_START("UI") - PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Modifier 2 / Force Sensor") // hold while clicking to force sensor (ignore piece) - PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1, NOTEQUALS, 0) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Modifier 1 / Force Piece") // hold while clicking to force piece (ignore sensor) + PORT_BIT(0x0001, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<0, NOTEQUALS, 0) PORT_CODE(KEYCODE_LSHIFT) PORT_CODE(KEYCODE_RSHIFT) PORT_NAME("Modifier 2 / Force Sensor") // hold while clicking to force sensor (ignore piece) + PORT_BIT(0x0002, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<0, NOTEQUALS, 0) PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) PORT_NAME("Modifier 1 / Force Piece") // hold while clicking to force piece (ignore sensor) PORT_BIT(0x0004, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_sensor_busy) // check if any sensor is busy / pressed (read-only) - PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_hand, 0) PORT_NAME("Remove Piece") - PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 0) PORT_NAME("Undo Buffer First") - PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 1) PORT_NAME("Undo Buffer Previous") - PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 2) PORT_NAME("Undo Buffer Next") - PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 3) PORT_NAME("Undo Buffer Last") - PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_init, 0) PORT_NAME("Board Clear") - PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_init, 1) PORT_NAME("Board Reset") + PORT_BIT(0x0008, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_hand, 0) PORT_NAME("Remove Piece") + PORT_BIT(0x0010, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 0) PORT_NAME("Undo Buffer First") + PORT_BIT(0x0020, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 1) PORT_NAME("Undo Buffer Previous") + PORT_BIT(0x0040, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 2) PORT_NAME("Undo Buffer Next") + PORT_BIT(0x0080, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_undo, 3) PORT_NAME("Undo Buffer Last") + PORT_BIT(0x0100, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_init, 0) PORT_NAME("Board Clear") + PORT_BIT(0x0200, IP_ACTIVE_HIGH, IPT_OTHER) PORT_CONDITION("UI_CHECK", 1<<1, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_init, 1) PORT_NAME("Board Reset") + + PORT_START("CONF") + PORT_CONFNAME( 0x03, 0x00, "Remember Position" ) PORT_CONDITION("UI_CHECK", 1<<2, NOTEQUALS, 0) + PORT_CONFSETTING( 0x01, DEF_STR( No ) ) + PORT_CONFSETTING( 0x02, DEF_STR( Yes ) ) + PORT_CONFSETTING( 0x00, "Auto" ) + PORT_CONFNAME( 0x04, 0x00, "Show Pieces" ) PORT_CONDITION("UI_CHECK", 1<<2, NOTEQUALS, 0) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_refresh, 0) + PORT_CONFSETTING( 0x04, DEF_STR( No ) ) + PORT_CONFSETTING( 0x00, DEF_STR( Yes ) ) PORT_START("BS_CHECK") // board size (internal use) PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_bs_mask) @@ -807,16 +816,7 @@ static INPUT_PORTS_START( sensorboard ) PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_ss_mask) PORT_START("UI_CHECK") // UI enabled (internal use) - PORT_BIT( 0x03, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_ui_enabled) - - PORT_START("CONF") - PORT_CONFNAME( 0x03, 0x00, "Remember Position" ) - PORT_CONFSETTING( 0x01, DEF_STR( No ) ) - PORT_CONFSETTING( 0x02, DEF_STR( Yes ) ) - PORT_CONFSETTING( 0x00, "Auto" ) - PORT_CONFNAME( 0x04, 0x00, "Show Pieces" ) PORT_CHANGED_MEMBER(DEVICE_SELF, sensorboard_device, ui_refresh, 0) - PORT_CONFSETTING( 0x04, DEF_STR( No ) ) - PORT_CONFSETTING( 0x00, DEF_STR( Yes ) ) + PORT_BIT( 0xffffffff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(sensorboard_device, check_ui_enabled) INPUT_PORTS_END ioport_constructor sensorboard_device::device_input_ports() const diff --git a/src/devices/machine/sensorboard.h b/src/devices/machine/sensorboard.h index a0e663f4744..50b428c04b4 100644 --- a/src/devices/machine/sensorboard.h +++ b/src/devices/machine/sensorboard.h @@ -31,8 +31,8 @@ public: sensorboard_device &set_max_id(u8 i) { m_maxid = i; return *this; } // maximum piece id (if larger than set_spawnpoints) sensorboard_device &set_delay(attotime delay) { m_sensordelay = delay; return *this; } // delay when activating a sensor (like PORT_IMPULSE), set to attotime::never to disable sensorboard_device &set_nvram_enable(bool b) { m_nvram_auto = b; return *this; } // load last board position on start - sensorboard_device &set_ui_enable(bool b) { if (!b) m_maxspawn = 0; m_ui_enabled = (b) ? 3 : 0; return *this; } // enable UI inputs - sensorboard_device &set_mod_enable(bool b) { if (b) m_ui_enabled |= 1; else m_ui_enabled &= 2; return *this; } // enable modifier keys + sensorboard_device &set_ui_enable(bool b) { if (!b) m_maxspawn = 0; m_ui_enabled = (b) ? 7 : 0; return *this; } // enable UI inputs + sensorboard_device &set_mod_enable(bool b) { if (b) m_ui_enabled |= 1; else m_ui_enabled &= ~1; return *this; } // enable modifier keys auto init_cb() { return m_custom_init_cb.bind(); } // for setting pieces starting position auto sensor_cb() { return m_custom_sensor_cb.bind(); } // x = offset & 0xf, y = offset >> 4 & 0xf diff --git a/src/mame/drivers/novag_savant.cpp b/src/mame/drivers/novag_savant.cpp index 96496ee5b24..7e0944a7290 100644 --- a/src/mame/drivers/novag_savant.cpp +++ b/src/mame/drivers/novag_savant.cpp @@ -372,7 +372,9 @@ void savant_state::savant(machine_config &config) config.set_perfect_quantum(m_mcu); SENSORBOARD(config, m_board).set_type(sensorboard_device::BUTTONS); + m_board->set_delay(attotime::from_msec(200)); m_board->set_ui_enable(false); // no chesspieces + m_board->set_mod_enable(true); NVRAM(config, "nvram", nvram_device::DEFAULT_ALL_1); diff --git a/src/mame/drivers/saitek_ssystem3.cpp b/src/mame/drivers/saitek_ssystem3.cpp index 307f96ea1a5..189c82c21f1 100644 --- a/src/mame/drivers/saitek_ssystem3.cpp +++ b/src/mame/drivers/saitek_ssystem3.cpp @@ -52,7 +52,6 @@ TODO: Should be doable to add, but 6522 device doesn't support live clock changes. - LCD TC pin? connects to the display, source is a 50hz timer(from power supply), probably to keep refreshing the LCD when inactive, there is no need to emulate it -- add chessboard screen to artwork - dump/add printer unit - dump/add ssystem3 1980 program revision, were the BTANB fixed? - ssystem4 softwarelist if a prototype cartridge is ever dumped |