summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2021-05-24 16:45:46 +0200
committer hap <happppp@users.noreply.github.com>2021-05-24 16:46:00 +0200
commita80392678a5ba6c1dfee666549fbb049b5ccba98 (patch)
treeb211f363fc56ebe0ab927f3e71e2a4c7b2e6d601
parentb410116212b76f289a347f76c3a6a503921a1252 (diff)
leonardo/renaissance: use input_merger for stb
-rw-r--r--src/mame/drivers/saitek_leonardo.cpp20
-rw-r--r--src/mame/drivers/saitek_renaissance.cpp20
2 files changed, 20 insertions, 20 deletions
diff --git a/src/mame/drivers/saitek_leonardo.cpp b/src/mame/drivers/saitek_leonardo.cpp
index 95009b8cd0c..09cef526c7f 100644
--- a/src/mame/drivers/saitek_leonardo.cpp
+++ b/src/mame/drivers/saitek_leonardo.cpp
@@ -53,6 +53,7 @@ TODO:
#include "bus/saitek_osa/expansion.h"
#include "cpu/m6800/m6801.h"
+#include "machine/input_merger.h"
#include "machine/sensorboard.h"
#include "sound/spkrdev.h"
#include "video/pwm.h"
@@ -73,6 +74,7 @@ public:
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_expansion(*this, "exp"),
+ m_stb(*this, "stb"),
m_board(*this, "board"),
m_display(*this, "display"),
m_dac(*this, "dac"),
@@ -90,6 +92,7 @@ private:
// devices/pointers
required_device<hd6303y_cpu_device> m_maincpu;
required_device<saitekosa_expansion_device> m_expansion;
+ required_device<input_merger_device> m_stb;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_display;
optional_device<speaker_sound_device> m_dac;
@@ -102,7 +105,6 @@ private:
void leds_w(u8 data);
u8 unk_r();
void unk_w(u8 data);
- void exp_stb_w(int state);
void exp_rts_w(int state);
u8 p2_r();
@@ -166,15 +168,9 @@ void leo_state::unk_w(u8 data)
// ?
}
-void leo_state::exp_stb_w(int state)
-{
- // STB-P to P5 IS
- m_maincpu->set_input_line(M6801_IS_LINE, state ? CLEAR_LINE : ASSERT_LINE);
-}
-
void leo_state::exp_rts_w(int state)
{
- // NAND with ACK-P? (not used by module)
+ // NAND with ACK-P (not used by module)
}
@@ -213,7 +209,8 @@ void leo_state::p5_w(u8 data)
// d2: expansion NMI-P
m_expansion->nmi_w(BIT(data, 2));
- // d3: NAND with STB-P?
+ // d3: NAND with STB-P
+ m_stb->in_w<1>(BIT(data, 3));
// d5: expansion ACK-P
m_expansion->ack_w(BIT(data, 5));
@@ -364,6 +361,9 @@ void leo_state::leonardo(machine_config &config)
m_maincpu->in_p6_cb().set(FUNC(leo_state::p6_r));
m_maincpu->out_p6_cb().set(FUNC(leo_state::p6_w));
+ INPUT_MERGER_ANY_LOW(config, m_stb);
+ m_stb->output_handler().set_inputline(m_maincpu, M6801_IS_LINE);
+
config.set_maximum_quantum(attotime::from_hz(6000));
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
@@ -380,7 +380,7 @@ void leo_state::leonardo(machine_config &config)
// expansion module
SAITEKOSA_EXPANSION(config, m_expansion, saitekosa_expansion_modules);
- m_expansion->stb_handler().set(FUNC(leo_state::exp_stb_w));
+ m_expansion->stb_handler().set(m_stb, FUNC(input_merger_device::in_w<0>));
m_expansion->rts_handler().set(FUNC(leo_state::exp_rts_w));
}
diff --git a/src/mame/drivers/saitek_renaissance.cpp b/src/mame/drivers/saitek_renaissance.cpp
index 83cd1d26bbb..09fcabc6878 100644
--- a/src/mame/drivers/saitek_renaissance.cpp
+++ b/src/mame/drivers/saitek_renaissance.cpp
@@ -33,6 +33,7 @@ TODO:
#include "bus/saitek_osa/expansion.h"
#include "cpu/m6800/m6801.h"
+#include "machine/input_merger.h"
#include "machine/sensorboard.h"
#include "sound/spkrdev.h"
#include "video/pwm.h"
@@ -55,6 +56,7 @@ public:
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_expansion(*this, "exp"),
+ m_stb(*this, "stb"),
m_board(*this, "board"),
m_display(*this, "display"),
m_lcd_pwm(*this, "lcd_pwm"),
@@ -76,6 +78,7 @@ private:
// devices/pointers
required_device<hd6303y_cpu_device> m_maincpu;
required_device<saitekosa_expansion_device> m_expansion;
+ required_device<input_merger_device> m_stb;
required_device<sensorboard_device> m_board;
required_device<pwm_display_device> m_display;
required_device<pwm_display_device> m_lcd_pwm;
@@ -94,7 +97,6 @@ private:
void leds_w(u8 data);
void control_w(u8 data);
u8 control_r();
- void exp_stb_w(int state);
void exp_rts_w(int state);
u8 p2_r();
@@ -189,15 +191,9 @@ u8 ren_state::control_r()
return 0;
}
-void ren_state::exp_stb_w(int state)
-{
- // STB-P to P5 IS
- m_maincpu->set_input_line(M6801_IS_LINE, state ? CLEAR_LINE : ASSERT_LINE);
-}
-
void ren_state::exp_rts_w(int state)
{
- // NAND with ACK-P? (not used by module)
+ // NAND with ACK-P (not used by module)
}
@@ -237,7 +233,8 @@ void ren_state::p5_w(u8 data)
// d1: expansion NMI-P
m_expansion->nmi_w(BIT(data, 1));
- // d3: NAND with STB-P?
+ // d3: NAND with STB-P
+ m_stb->in_w<1>(BIT(data, 3));
// d5: expansion ACK-P
m_expansion->ack_w(BIT(data, 5));
@@ -354,6 +351,9 @@ void ren_state::ren(machine_config &config)
m_maincpu->in_p6_cb().set(FUNC(ren_state::p6_r));
m_maincpu->out_p6_cb().set(FUNC(ren_state::p6_w));
+ INPUT_MERGER_ANY_LOW(config, m_stb);
+ m_stb->output_handler().set_inputline(m_maincpu, M6801_IS_LINE);
+
config.set_maximum_quantum(attotime::from_hz(6000));
SENSORBOARD(config, m_board).set_type(sensorboard_device::MAGNETS);
@@ -380,7 +380,7 @@ void ren_state::ren(machine_config &config)
// expansion module
SAITEKOSA_EXPANSION(config, m_expansion, saitekosa_expansion_modules);
- m_expansion->stb_handler().set(FUNC(ren_state::exp_stb_w));
+ m_expansion->stb_handler().set(m_stb, FUNC(input_merger_device::in_w<0>));
m_expansion->rts_handler().set(FUNC(ren_state::exp_rts_w));
}