summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
authorGravatarGravatar couriersud <couriersud@gmx.org>2019-11-16 16:08:48 +0100
committerGravatarGravatar couriersud <couriersud@gmx.org>2019-11-16 16:09:04 +0100
commit67dc264e22edad3f2b67bcc3573587ca3b2eb2a0 (patch)
tree134b83957f7fd545f7ade6df54d24d3b3b8ceb45 /src/mame
parentdbe7b978ae9e3c2316878384fd549568e4918f89 (diff)
netlist: more code maintenance. (nw)
- refactor error messages. - Fix some drivers to cope with outputted added my the mame driver for video and sound. - Fix validation.
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/atarittl.cpp42
-rw-r--r--src/mame/drivers/pong.cpp15
-rw-r--r--src/mame/machine/nl_stuntcyc.cpp6
3 files changed, 31 insertions, 32 deletions
diff --git a/src/mame/drivers/atarittl.cpp b/src/mame/drivers/atarittl.cpp
index 2cd87fa4df7..d8130d45d29 100644
--- a/src/mame/drivers/atarittl.cpp
+++ b/src/mame/drivers/atarittl.cpp
@@ -155,13 +155,13 @@ public:
{
}
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit0_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit1_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit2_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit3_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit4_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit5_cb);
- NETDEV_LOGIC_CALLBACK_MEMBER(probe_bit6_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit0_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit1_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit2_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit3_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit4_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit5_cb);
+ NETDEV_ANALOG_CALLBACK_MEMBER(probe_bit6_cb);
NETDEV_LOGIC_CALLBACK_MEMBER(probe_clock_cb);
uint32_t screen_update_stuntcyc(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
@@ -270,13 +270,13 @@ void stuntcyc_state::machine_reset()
m_probe_bit6 = 0;
}
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit0_cb) { m_probe_bit0 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit1_cb) { m_probe_bit1 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit2_cb) { m_probe_bit2 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit3_cb) { m_probe_bit3 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit4_cb) { m_probe_bit4 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit5_cb) { m_probe_bit5 = data; }
-NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_bit6_cb) { m_probe_bit6 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit0_cb) { m_probe_bit0 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit1_cb) { m_probe_bit1 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit2_cb) { m_probe_bit2 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit3_cb) { m_probe_bit3 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit4_cb) { m_probe_bit4 = data; }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit5_cb) { m_probe_bit5 = data; printf("b0: %f\n", data); }
+NETDEV_ANALOG_CALLBACK_MEMBER(stuntcyc_state::probe_bit6_cb) { m_probe_bit6 = data; }
NETDEV_LOGIC_CALLBACK_MEMBER(stuntcyc_state::probe_clock_cb)
{
synchronize();
@@ -348,13 +348,13 @@ void stuntcyc_state::stuntcyc(machine_config &config)
/* basic machine hardware */
NETLIST_CPU(config, m_maincpu, STUNTCYC_NL_CLOCK).set_source(netlist_stuntcyc);
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit0", 0).set_params("probe_bit0", FUNC(stuntcyc_state::probe_bit0_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit1", 0).set_params("probe_bit1", FUNC(stuntcyc_state::probe_bit1_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit2", 0).set_params("probe_bit2", FUNC(stuntcyc_state::probe_bit2_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit3", 0).set_params("probe_bit3", FUNC(stuntcyc_state::probe_bit3_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit4", 0).set_params("probe_bit4", FUNC(stuntcyc_state::probe_bit4_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit5", 0).set_params("probe_bit5", FUNC(stuntcyc_state::probe_bit5_cb));
- NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_bit6", 0).set_params("probe_bit6", FUNC(stuntcyc_state::probe_bit6_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit0", 0).set_params("probe_bit0", FUNC(stuntcyc_state::probe_bit0_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit1", 0).set_params("probe_bit1", FUNC(stuntcyc_state::probe_bit1_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit2", 0).set_params("probe_bit2", FUNC(stuntcyc_state::probe_bit2_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit3", 0).set_params("probe_bit3", FUNC(stuntcyc_state::probe_bit3_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit4", 0).set_params("probe_bit4", FUNC(stuntcyc_state::probe_bit4_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit5", 0).set_params("probe_bit5", FUNC(stuntcyc_state::probe_bit5_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:probe_bit6", 0).set_params("probe_bit6", FUNC(stuntcyc_state::probe_bit6_cb));
NETLIST_LOGIC_OUTPUT(config, "maincpu:probe_clock", 0).set_params("probe_clock", FUNC(stuntcyc_state::probe_clock_cb));
/* video hardware */
diff --git a/src/mame/drivers/pong.cpp b/src/mame/drivers/pong.cpp
index 7917e4f3cec..eabeebdc7b6 100644
--- a/src/mame/drivers/pong.cpp
+++ b/src/mame/drivers/pong.cpp
@@ -150,11 +150,16 @@ public:
required_device<fixedfreq_device> m_video;
required_device<dac_word_interface> m_dac; /* just to have a sound device */
- NETDEV_ANALOG_CALLBACK_MEMBER(sound_cb)
+ NETDEV_ANALOG_CALLBACK_MEMBER(sound_cb_analog)
{
m_dac->write(std::round(16384 * data));
}
+ NETDEV_LOGIC_CALLBACK_MEMBER(sound_cb_logic)
+ {
+ m_dac->write(16384 * data);
+ }
+
protected:
// driver_device overrides
@@ -470,7 +475,7 @@ void pong_state::pong(machine_config &config)
NETLIST_LOGIC_INPUT(config, "maincpu:coinsw", "coinsw.POS", 0);
NETLIST_LOGIC_INPUT(config, "maincpu:antenna", "antenna.IN", 0);
- NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(pong_state::sound_cb));
+ NETLIST_LOGIC_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(pong_state::sound_cb_logic));
NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("videomix", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome));
/* video hardware */
@@ -514,7 +519,7 @@ void breakout_state::breakout(machine_config &config)
NETLIST_LOGIC_INPUT(config, "maincpu:antenna", "antenna.IN", 0);
- NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(breakout_state::sound_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(breakout_state::sound_cb_analog));
NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("videomix", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome));
// Leds and lamps
@@ -573,7 +578,7 @@ void pong_state::pongd(machine_config &config)
NETLIST_LOGIC_INPUT(config, "maincpu:antenna", "antenna.IN", 0, 0x01)
#endif
- NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("AUDIO", FUNC(pong_state::sound_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("AUDIO", FUNC(pong_state::sound_cb_analog));
NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("videomix", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome));
/* video hardware */
@@ -609,7 +614,7 @@ void rebound_state::rebound(machine_config &config)
NETLIST_LOGIC_INPUT(config, "maincpu:dsw1b", "DSW1b.POS", 0);
NETLIST_LOGIC_INPUT(config, "maincpu:dsw2", "DSW2.POS", 0);
- NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(rebound_state::sound_cb));
+ NETLIST_ANALOG_OUTPUT(config, "maincpu:snd0", 0).set_params("sound", FUNC(rebound_state::sound_cb_analog));
NETLIST_ANALOG_OUTPUT(config, "maincpu:vid0", 0).set_params("videomix", "fixfreq", FUNC(fixedfreq_device::update_composite_monochrome));
NETLIST_ANALOG_OUTPUT(config, "maincpu:led_credit", 0).set_params("CON11", FUNC(rebound_state::led_credit_cb));
diff --git a/src/mame/machine/nl_stuntcyc.cpp b/src/mame/machine/nl_stuntcyc.cpp
index 03a1401929a..37a4f639568 100644
--- a/src/mame/machine/nl_stuntcyc.cpp
+++ b/src/mame/machine/nl_stuntcyc.cpp
@@ -664,11 +664,5 @@ NETLIST_START(stuntcyc)
MISS_SW_B0.VCC, MISS_SW_B1.VCC, MISS_SW_B2.VCC, R38_2.VCC, R39_2.VCC)
NET_C(GND, high.GND, low.GND, ANTENNA.GND, FREESCORE_SW_B0.GND, FREESCORE_SW_B1.GND, FREESCORE_SW_B2.GND, FREESCORE_SW_B3.GND,
MISS_SW_B0.GND, MISS_SW_B1.GND, MISS_SW_B2.GND, R38_2.GND, R39_2.GND)
-
- NET_C(VCC, OUT_probe_bit0.VCC, OUT_probe_bit1.VCC, OUT_probe_bit2.VCC, OUT_probe_bit3.VCC,
- OUT_probe_bit4.VCC, OUT_probe_bit5.VCC, OUT_probe_bit6.VCC, OUT_probe_clock.VCC)
- NET_C(GND, OUT_probe_bit0.GND, OUT_probe_bit1.GND, OUT_probe_bit2.GND, OUT_probe_bit3.GND,
- OUT_probe_bit4.GND, OUT_probe_bit5.GND, OUT_probe_bit6.GND, OUT_probe_clock.GND)
-
#endif
NETLIST_END()