From e02da6ccd8726f647a8796f5fd63e25a23b172c1 Mon Sep 17 00:00:00 2001 From: hap Date: Mon, 19 Apr 2021 20:16:49 +0200 Subject: smartboard: add user config to allow duplicate piece ids --- src/devices/machine/smartboard.cpp | 20 +++++++++++++++++++- src/devices/machine/smartboard.h | 4 +++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/devices/machine/smartboard.cpp b/src/devices/machine/smartboard.cpp index 303317d888b..123434e0cb5 100644 --- a/src/devices/machine/smartboard.cpp +++ b/src/devices/machine/smartboard.cpp @@ -73,6 +73,7 @@ tasc_sb30_device::tasc_sb30_device(const machine_config &mconfig, const char *ta : device_t(mconfig, TASC_SB30, tag, owner, clock) , m_board(*this, "board") , m_out_leds(*this, "sb30_led_%u.%u", 0U, 0U) + , m_conf(*this, "CONF") , m_data_out(*this) , m_led_out(*this) { } @@ -103,6 +104,23 @@ void tasc_sb30_device::device_start() } +//------------------------------------------------- +// input_ports - device-specific input ports +//------------------------------------------------- + +static INPUT_PORTS_START( smartboard ) + PORT_START("CONF") + PORT_CONFNAME( 0x01, 0x00, "Duplicate Piece IDs" ) + PORT_CONFSETTING( 0x00, DEF_STR( No ) ) + PORT_CONFSETTING( 0x01, DEF_STR( Yes ) ) +INPUT_PORTS_END + +ioport_constructor tasc_sb30_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(smartboard); +} + + //------------------------------------------------- // device_add_mconfig - add device-specific // machine configuration @@ -155,7 +173,7 @@ bool tasc_sb30_device::piece_available(u8 id) for (int x = 0; x < 8; x++) { if (m_board->read_piece(x, y) == id) - return false; + return bool(m_conf->read() & 1); } return true; diff --git a/src/devices/machine/smartboard.h b/src/devices/machine/smartboard.h index 73237f2580c..27ae5d4dcdb 100644 --- a/src/devices/machine/smartboard.h +++ b/src/devices/machine/smartboard.h @@ -32,10 +32,12 @@ protected: // device-level overrides virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; + virtual ioport_constructor device_input_ports() const override; private: required_device m_board; - output_finder<8,8> m_out_leds; + output_finder<8, 8> m_out_leds; + required_ioport m_conf; devcb_write_line m_data_out; devcb_write8 m_led_out; -- cgit v1.2.3