summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-08-29 08:33:46 -0400
committer AJR <ajrhacker@users.noreply.github.com>2021-08-29 08:33:46 -0400
commitc833c1e2ed65496c29e1d8370f1de8db422b160d (patch)
treef30dd6f7e4b42ef5b3ca615b56a30000e15e8546
parent29f940dc59c924e4e93b70a387289269b368c0af (diff)
harddriv.cpp, kenseim.cpp: Use output finders instead of output().set_value
-rw-r--r--src/mame/drivers/harddriv.cpp2
-rw-r--r--src/mame/drivers/kenseim.cpp31
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/machine/harddriv.cpp30
4 files changed, 36 insertions, 29 deletions
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index b65b1064257..d4e5b8438ba 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -360,6 +360,8 @@ harddriv_state::harddriv_state(const machine_config &mconfig, device_type type,
m_duartn68681(*this, "duartn68681"),
m_adc8(*this, "adc8"),
m_lamps(*this, "lamp%u", 1U),
+ m_sel(*this, "SEL%u", 1U),
+ m_wheel(*this, "wheel"),
m_hd34010_host_access(0),
m_msp_ram(*this, "msp_ram"),
m_dsk_ram(nullptr),
diff --git a/src/mame/drivers/kenseim.cpp b/src/mame/drivers/kenseim.cpp
index ac1288ee492..f51a0a33801 100644
--- a/src/mame/drivers/kenseim.cpp
+++ b/src/mame/drivers/kenseim.cpp
@@ -159,7 +159,10 @@ public:
m_from68k_st4(0),
m_from68k_st3(0),
m_from68k_st2(0),
- m_lamps(*this, "lamp%u", 1U)
+ m_lamps(*this, "lamp%u", 1U),
+ m_startlamp(*this, "startlamp%u", 1U),
+ m_molea(*this, "molea_%u", 0U),
+ m_moleb(*this, "moleb_%u", 0U)
{
for (int i = 0; i < 6; i++)
{
@@ -198,18 +201,10 @@ private:
void update_moles()
{
for (int i = 0; i < 6; i++)
- {
- char temp[32];
- sprintf(temp, "molea_%d", i);
- output().set_value(temp, mole_state_a[i]);
- }
+ m_molea[i] = mole_state_a[i];
for (int i = 0; i < 6; i++)
- {
- char temp[32];
- sprintf(temp, "moleb_%d", i);
- output().set_value(temp, mole_state_b[i]);
- }
+ m_moleb[i] = mole_state_b[i];
}
/* kenseim */
@@ -255,6 +250,9 @@ private:
int mole_state_a[6];
int mole_state_b[6];
output_finder<20> m_lamps;
+ output_finder<2> m_startlamp;
+ output_finder<6> m_molea;
+ output_finder<6> m_moleb;
};
@@ -357,10 +355,10 @@ void kenseim_state::cpu_portc_w(uint8_t data)
// d5: coin lock
// d6: left start button lamp
// d7: right start button lamp
- machine().bookkeeping().coin_lockout_w(0, (data & 0x10) ? 0 : 1); // toggles if you attempt to insert a coin when there are already 15 coins inserted
- machine().bookkeeping().coin_counter_w(0, (data & 0x20) ? 0 : 1);
- output().set_value("startlamp1", (data & 0x80) ? 0 : 1);
- output().set_value("startlamp2", (data & 0x40) ? 0 : 1);
+ machine().bookkeeping().coin_lockout_w(0, !BIT(data, 4)); // toggles if you attempt to insert a coin when there are already 15 coins inserted
+ machine().bookkeeping().coin_counter_w(0, !BIT(data, 5));
+ m_startlamp[0] = !BIT(data, 7);
+ m_startlamp[1] = !BIT(data, 6);
}
@@ -704,6 +702,9 @@ void kenseim_state::init_kenseim()
m_led_latch = 0;
m_lamps.resolve();
+ m_startlamp.resolve();
+ m_molea.resolve();
+ m_moleb.resolve();
}
diff --git a/src/mame/includes/harddriv.h b/src/mame/includes/harddriv.h
index 1582020992b..55a3283a602 100644
--- a/src/mame/includes/harddriv.h
+++ b/src/mame/includes/harddriv.h
@@ -303,6 +303,8 @@ protected:
optional_device<mc68681_device> m_duartn68681;
required_device<adc0808_device> m_adc8;
output_finder<2> m_lamps;
+ output_finder<4> m_sel;
+ output_finder<> m_wheel;
uint8_t m_hd34010_host_access;
diff --git a/src/mame/machine/harddriv.cpp b/src/mame/machine/harddriv.cpp
index acd7ab10505..7745c5a8d9f 100644
--- a/src/mame/machine/harddriv.cpp
+++ b/src/mame/machine/harddriv.cpp
@@ -37,6 +37,8 @@
void harddriv_state::device_start()
{
m_lamps.resolve();
+ m_sel.resolve();
+ m_wheel.resolve();
/* predetermine memory regions */
m_adsp_pgm_memory_word = (uint16_t *)(reinterpret_cast<uint8_t *>(m_adsp_pgm_memory.target()) + 1);
@@ -46,7 +48,7 @@ void harddriv_state::device_start()
}
-void harddriv_state::device_reset()
+void harddriv_state::device_reset()
{
/* halt several of the DSPs to start */
m_adsp->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
@@ -359,24 +361,24 @@ void harddriv_state::hd68k_wr1_write(offs_t offset, uint16_t data)
data = data >> 8;
switch (m_sel_select)
{
- case 1: /* SEL1 */
- m_sel1_data = data;
- machine().output().set_value("SEL1", m_sel1_data);
+ case 1: /* SEL1 */
+ m_sel1_data = data;
+ m_sel[0] = m_sel1_data;
break;
- case 2: /* SEL2 */
- m_sel2_data = data;
- machine().output().set_value("SEL2", m_sel2_data);
+ case 2: /* SEL2 */
+ m_sel2_data = data;
+ m_sel[1] = m_sel2_data;
break;
- case 3: /* SEL3 */
- m_sel3_data = data;
- machine().output().set_value("SEL3", m_sel3_data);
+ case 3: /* SEL3 */
+ m_sel3_data = data;
+ m_sel[2] = m_sel3_data;
break;
- case 4: /* SEL4 */
- m_sel4_data = data;
- machine().output().set_value("SEL4", m_sel4_data);
+ case 4: /* SEL4 */
+ m_sel4_data = data;
+ m_sel[3] = m_sel4_data;
break;
}
} else {
@@ -389,7 +391,7 @@ void harddriv_state::hd68k_wr2_write(offs_t offset, uint16_t data)
{
if (offset == 0) {
// logerror("Steering Wheel Latch = %02X\n", data);
- machine().output().set_value("wheel", data >> 8);
+ m_wheel = data >> 8;
} else {
logerror("/WR2(%04X)=%02X\n", offset, data);
}