From 4479bd973106b42b0cfecbd531101d532631ecb5 Mon Sep 17 00:00:00 2001 From: Paul-Arnold <98924583+Paul-Arnold@users.noreply.github.com> Date: Wed, 10 Jan 2024 14:21:56 +0000 Subject: [PATCH] barcrest/mpu5.cpp, bfm/bfm_sc4.cpp: Fix calling of SEC data_w() and clk_w() (#11923) Above functions for the Starpoint Electronic Counter require 0 or 1 to be passed. Fixed use by Barcrest MPU5 and BFG SC4. --- src/mame/barcrest/mpu5.cpp | 6 +++--- src/mame/bfm/bfm_sc4.cpp | 5 +++-- src/mame/shared/sec.cpp | 2 -- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/mame/barcrest/mpu5.cpp b/src/mame/barcrest/mpu5.cpp index 0c3b73c079c..2e7bcda10ba 100644 --- a/src/mame/barcrest/mpu5.cpp +++ b/src/mame/barcrest/mpu5.cpp @@ -274,9 +274,9 @@ void mpu5_state::asic_w8(offs_t offset, uint8_t data) case 0x09: //Assume SEC fitted for now - m_sec->data_w(~data&0x01); - m_sec->clk_w(~data&0x02); - m_sec->cs_w(~data&0x04); + m_sec->data_w(!BIT(data, 0)); + m_sec->clk_w(!BIT(data, 1)); + m_sec->cs_w(!BIT(data, 2)); [[fallthrough]]; case 0x0b: m_statuslamp[0] = BIT(data, 4); diff --git a/src/mame/bfm/bfm_sc4.cpp b/src/mame/bfm/bfm_sc4.cpp index 85555ea8057..a3bf2f88983 100644 --- a/src/mame/bfm/bfm_sc4.cpp +++ b/src/mame/bfm/bfm_sc4.cpp @@ -554,7 +554,7 @@ void sc4_state::sc4_mem_w(offs_t offset, uint16_t data, uint16_t mem_mask) case 0x0330: logerror("%08x meter write %04x\n",pc, data); //m_meterstatus = (m_meterstatus&0xc0) | (data & 0x3f); - m_sec->clk_w(~data&0x20); + m_sec->clk_w(!BIT(data, 5)); break; case 0x1248: @@ -568,7 +568,8 @@ void sc4_state::sc4_mem_w(offs_t offset, uint16_t data, uint16_t mem_mask) case 0x1330: bfm_sc4_reel4_w(data&0xf); //m_meterstatus = (m_meterstatus&0x3f) | ((data & 0x30) << 2); - m_sec->data_w(~data&0x10); + m_sec->data_w(!BIT(data, 4)); + m_sec->cs_w(!BIT(data, 5)); break; default: diff --git a/src/mame/shared/sec.cpp b/src/mame/shared/sec.cpp index e089460b83a..d722f7f276e 100644 --- a/src/mame/shared/sec.cpp +++ b/src/mame/shared/sec.cpp @@ -84,8 +84,6 @@ int sec_device::data_r(void) void sec_device::clk_w(int state) { - state = state ? 1 : 0; - if (m_clk ^ state) { if (!state)