summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/sensorboard.cpp
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2024-01-25 00:14:27 +0100
committer hap <happppp@users.noreply.github.com>2024-01-25 00:14:40 +0100
commit8eaf308e15d2db42e5ec947f9d7c73fe1ac7f672 (patch)
tree04464415d98f4ae85075db96cb45812a95e84c9c /src/devices/machine/sensorboard.cpp
parentcc7db139c27970019afaa5bc99c14ef522cafb60 (diff)
ecbackg: add custom sensorboard handling
Diffstat (limited to 'src/devices/machine/sensorboard.cpp')
-rw-r--r--src/devices/machine/sensorboard.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/devices/machine/sensorboard.cpp b/src/devices/machine/sensorboard.cpp
index 14093ac0a00..4136831a6fd 100644
--- a/src/devices/machine/sensorboard.cpp
+++ b/src/devices/machine/sensorboard.cpp
@@ -78,6 +78,7 @@ sensorboard_device::sensorboard_device(const machine_config &mconfig, const char
m_inp_conf(*this, "CONF"),
m_clear_cb(*this),
m_init_cb(*this),
+ m_remove_cb(*this, 0),
m_sensor_cb(*this, 0),
m_spawn_cb(*this, 0),
m_output_cb(*this)
@@ -477,13 +478,15 @@ INPUT_CHANGED_MEMBER(sensorboard_device::sensor)
m_sensortimer->adjust(m_sensordelay);
}
+ bool drop = m_hand != 0;
+
// optional custom handling:
// return d0 = block drop piece
// return d1 = block pick up piece
u8 custom = m_sensor_cb(pos);
// drop piece
- if (m_hand != 0)
+ if (drop)
{
if (~custom & 1)
drop_piece(x, y);
@@ -519,7 +522,12 @@ INPUT_CHANGED_MEMBER(sensorboard_device::ui_hand)
return;
cancel_sensor();
- remove_hand();
+
+ // optional custom handling:
+ // return d0: block remove hand
+ if (~m_remove_cb() & 1)
+ remove_hand();
+
refresh();
}