summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2019-01-28 18:20:40 +0100
committer hap <happppp@users.noreply.github.com>2019-01-28 18:20:54 +0100
commitf240ceb79aa1f68b37676cdfbb2cd59dc225accd (patch)
treece438c3fbb6b8aff101c866d723f9e676e9bd95d
parentcbcef6af48af317808c30a3e05c0b654893dab50 (diff)
fidelz80: small cleanup (nw)
-rw-r--r--src/mame/drivers/fidelz80.cpp44
1 files changed, 14 insertions, 30 deletions
diff --git a/src/mame/drivers/fidelz80.cpp b/src/mame/drivers/fidelz80.cpp
index 8de482d6ced..80200077c45 100644
--- a/src/mame/drivers/fidelz80.cpp
+++ b/src/mame/drivers/fidelz80.cpp
@@ -517,8 +517,8 @@ expect that the software reads these once on startup only.
class fidelz80_state : public fidelbase_state
{
public:
- fidelz80_state(const machine_config &mconfig, device_type type, const char *tag)
- : fidelbase_state(mconfig, type, tag),
+ fidelz80_state(const machine_config &mconfig, device_type type, const char *tag) :
+ fidelbase_state(mconfig, type, tag),
m_mcu(*this, "mcu"),
m_z80pio(*this, "z80pio"),
m_ppi8255(*this, "ppi8255"),
@@ -570,9 +570,7 @@ private:
// BCC, BKC
DECLARE_READ8_MEMBER(bcc_input_r);
DECLARE_WRITE8_MEMBER(bcc_control_w);
- DECLARE_WRITE8_MEMBER(bkc_control_w);
void bcc_io(address_map &map);
- void bkc_io(address_map &map);
void bcc_map(address_map &map);
// SCC
@@ -901,12 +899,16 @@ WRITE8_MEMBER(fidelz80_state::cc10_ppi_porta_w)
// TTL
-WRITE8_MEMBER(fidelz80_state::bkc_control_w)
+WRITE8_MEMBER(fidelz80_state::bcc_control_w)
{
// a0-a2,d7: digit segment data via NE591
u8 mask = 1 << (offset & 7);
m_7seg_data = (m_7seg_data & ~mask) | ((data & 0x80) ? mask : 0);
+ // BCC: NE591 Q7 is speaker out
+ if (m_dac != nullptr)
+ m_dac->write(BIT(m_7seg_data, 7));
+
// d0-d3: led select, input mux
// d4,d5: upper leds(direct)
set_display_segmask(0xf, 0x7f);
@@ -914,13 +916,6 @@ WRITE8_MEMBER(fidelz80_state::bkc_control_w)
m_inp_mux = data & 0xf;
}
-WRITE8_MEMBER(fidelz80_state::bcc_control_w)
-{
- // same as BKC, and NE591 Q7 is speaker out
- bkc_control_w(space, offset, data);
- m_dac->write(BIT(m_7seg_data, 7));
-}
-
READ8_MEMBER(fidelz80_state::bcc_input_r)
{
// d0-d3: multiplexed inputs
@@ -1183,12 +1178,6 @@ void fidelz80_state::bcc_io(address_map &map)
map(0x00, 0x07).rw(FUNC(fidelz80_state::bcc_input_r), FUNC(fidelz80_state::bcc_control_w));
}
-void fidelz80_state::bkc_io(address_map &map)
-{
- map.global_mask(0x07);
- map(0x00, 0x07).rw(FUNC(fidelz80_state::bcc_input_r), FUNC(fidelz80_state::bkc_control_w));
-}
-
// SCC
@@ -1703,7 +1692,7 @@ INPUT_PORTS_END
Machine Drivers
******************************************************************************/
-void fidelz80_state::bcc(machine_config &config)
+void fidelz80_state::bkc(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, 3.579545_MHz_XTAL);
@@ -1711,6 +1700,12 @@ void fidelz80_state::bcc(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &fidelz80_state::bcc_io);
TIMER(config, "display_decay").configure_periodic(FUNC(fidelbase_state::display_decay_tick), attotime::from_msec(1));
+ config.set_default_layout(layout_fidel_bkc);
+}
+
+void fidelz80_state::bcc(machine_config &config)
+{
+ bkc(config);
config.set_default_layout(layout_fidel_bcc);
/* sound hardware */
@@ -1721,17 +1716,6 @@ void fidelz80_state::bcc(machine_config &config)
vref.add_route(0, "dac", 1.0, DAC_VREF_POS_INPUT);
}
-void fidelz80_state::bkc(machine_config &config)
-{
- /* basic machine hardware */
- Z80(config, m_maincpu, 3.579545_MHz_XTAL);
- m_maincpu->set_addrmap(AS_PROGRAM, &fidelz80_state::bcc_map);
- m_maincpu->set_addrmap(AS_IO, &fidelz80_state::bkc_io);
-
- TIMER(config, "display_decay").configure_periodic(FUNC(fidelbase_state::display_decay_tick), attotime::from_msec(1));
- config.set_default_layout(layout_fidel_bkc);
-}
-
void fidelz80_state::scc(machine_config &config)
{
/* basic machine hardware */