summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-04-04 12:09:55 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-04-04 12:09:55 -0400
commitb4c6d1b2a237d8b29db5a3c2687e18290d6228c9 (patch)
treeb2f80e8a27ca79a877fd888b22e971049dffb9bc
parent59edd0cde2ba45eef075090079f5b8731066d03b (diff)
prophet600, rainbow, sc2: Use output finders (nw)
-rw-r--r--src/mame/drivers/prophet600.cpp20
-rw-r--r--src/mame/drivers/rainbow.cpp12
-rw-r--r--src/mame/drivers/sc2.cpp27
3 files changed, 39 insertions, 20 deletions
diff --git a/src/mame/drivers/prophet600.cpp b/src/mame/drivers/prophet600.cpp
index 27c456ece51..36e0f8aec00 100644
--- a/src/mame/drivers/prophet600.cpp
+++ b/src/mame/drivers/prophet600.cpp
@@ -79,16 +79,14 @@ public:
: driver_device(mconfig, type, tag),
m_maincpu(*this, MAINCPU_TAG),
m_acia(*this, UART_TAG),
+ m_digits(*this, "digit%u", 0U),
m_dac(0),
m_scanrow(0),
m_comparitor(0),
m_nmi_gate(false)
{ }
- required_device<cpu_device> m_maincpu;
- required_device<acia6850_device> m_acia;
-
- DECLARE_DRIVER_INIT(prophet600);
+ virtual void machine_start() override;
DECLARE_WRITE_LINE_MEMBER( pit_ch0_tick_w );
DECLARE_WRITE_LINE_MEMBER( pit_ch2_tick_w );
@@ -109,6 +107,11 @@ public:
void cpu_map(address_map &map);
void io_map(address_map &map);
private:
+ required_device<cpu_device> m_maincpu;
+ required_device<acia6850_device> m_acia;
+
+ output_finder<2> m_digits;
+
uint16_t m_dac;
uint8_t m_scanrow;
uint8_t m_comparitor;
@@ -175,11 +178,11 @@ WRITE8_MEMBER(prophet600_state::led_w)
}
else if (m_scanrow & 0x20)
{
- output().set_digit_value(0, data);
+ m_digits[0] = data;
}
else if (m_scanrow & 0x40)
{
- output().set_digit_value(1, data);
+ m_digits[1] = data;
}
}
@@ -260,8 +263,9 @@ void prophet600_state::io_map(address_map &map)
map(0x0e, 0x0e).mirror(0xff00).w(this, FUNC(prophet600_state::mask_w));
}
-DRIVER_INIT_MEMBER(prophet600_state, prophet600)
+void prophet600_state::machine_start()
{
+ m_digits.resolve();
}
// master crystal is 8 MHz, all clocks derived from there
@@ -301,4 +305,4 @@ ROM_START( prpht600 )
ROM_LOAD( "p600.bin", 0x000000, 0x002000, CRC(78e3f048) SHA1(61548b6de3d9b5c0ae76f8e751ece0b57de17118) )
ROM_END
-CONS( 1983, prpht600, 0, 0, prophet600, prophet600, prophet600_state, prophet600, "Sequential Circuits", "Prophet-600", MACHINE_NOT_WORKING|MACHINE_NO_SOUND )
+CONS( 1983, prpht600, 0, 0, prophet600, prophet600, prophet600_state, 0, "Sequential Circuits", "Prophet-600", MACHINE_NOT_WORKING|MACHINE_NO_SOUND )
diff --git a/src/mame/drivers/rainbow.cpp b/src/mame/drivers/rainbow.cpp
index a3652544af6..d50c9d4bde6 100644
--- a/src/mame/drivers/rainbow.cpp
+++ b/src/mame/drivers/rainbow.cpp
@@ -529,7 +529,9 @@ public:
m_screen2(*this, "screen2"),
m_palette2(*this, "palette2"), // GDC-NEW
- m_video_ram(*this, "vram")
+ m_video_ram(*this, "vram"),
+
+ m_digits(*this, "digit%u", 0U)
{
}
@@ -686,6 +688,8 @@ private:
required_device<palette_device> m_palette2;
required_shared_ptr<uint16_t> m_video_ram;
+ output_finder<2> m_digits;
+
void raise_8088_irq(int ref);
void lower_8088_irq(int ref);
@@ -874,6 +878,8 @@ void rainbow_state::machine_start()
switch_off_timer = timer_alloc(1);
switch_off_timer->adjust(attotime::from_msec(10));
+ m_digits.resolve();
+
m_SCREEN_BLANK = false;
auto *printer_port = subdevice<rs232_port_device>("printer");
@@ -2411,8 +2417,8 @@ READ8_MEMBER(rainbow_state::z80_diskstatus_r)
// Print HEX track number
static uint8_t bcd2hex[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x77, 0x7c, 0x39, 0x5e, 0x79, 0x71 };
// 0...9 ,A (0x77), b (0x7c), C (0x39) , d (0x5e), E (0x79), F (0x71)
- output().set_digit_value(0, bcd2hex[(track >> 4) & 0x0f]);
- output().set_digit_value(1, bcd2hex[ track & 0x0f]);
+ m_digits[0] = bcd2hex[(track >> 4) & 0x0f];
+ m_digits[1] = bcd2hex[track & 0x0f];
// D1: DS1 H: reflect status of bits 0 and 1 from disk.control reg.
// D0: DS0 H: "
diff --git a/src/mame/drivers/sc2.cpp b/src/mame/drivers/sc2.cpp
index 1260e0d0b48..e1d75ecc5fc 100644
--- a/src/mame/drivers/sc2.cpp
+++ b/src/mame/drivers/sc2.cpp
@@ -25,10 +25,12 @@ public:
sc2_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag),
m_beep(*this, "beeper"),
- m_maincpu(*this, "maincpu")
+ m_maincpu(*this, "maincpu"),
+ m_digits(*this, "digit%u", 0U),
+ m_leds(*this, "led%u", 0U)
{ }
- required_device<beep_device> m_beep;
+
DECLARE_READ8_MEMBER(pio_port_a_r);
DECLARE_READ8_MEMBER(pio_port_b_r);
DECLARE_WRITE8_MEMBER(pio_port_a_w);
@@ -42,10 +44,14 @@ public:
void sc2_update_display();
virtual void machine_start() override;
virtual void machine_reset() override;
- required_device<cpu_device> m_maincpu;
void sc2(machine_config &config);
void sc2_io(address_map &map);
void sc2_mem(address_map &map);
+
+ required_device<beep_device> m_beep;
+ required_device<cpu_device> m_maincpu;
+ output_finder<4> m_digits;
+ output_finder<2> m_leds;
};
READ8_MEMBER( sc2_state::sc2_beep )
@@ -105,6 +111,9 @@ INPUT_PORTS_END
void sc2_state::machine_start()
{
+ m_digits.resolve();
+ m_leds.resolve();
+
save_item(NAME(m_led_7seg_data));
save_item(NAME(m_kp_matrix));
save_item(NAME(m_led_selected));
@@ -127,29 +136,29 @@ void sc2_state::sc2_update_display()
if (!BIT(m_led_selected, 0))
{
- output().set_digit_value(0, digit_data);
+ m_digits[0] = digit_data;
m_led_7seg_data[0] = digit_data;
- output().set_led_value(0, BIT(m_digit_data, 7));
+ m_leds[0] = BIT(m_digit_data, 7);
}
if (!BIT(m_led_selected, 1))
{
- output().set_digit_value(1, digit_data);
+ m_digits[1] = digit_data;
m_led_7seg_data[1] = digit_data;
- output().set_led_value(1, BIT(m_digit_data, 7));
+ m_leds[1] = BIT(m_digit_data, 7);
}
if (!BIT(m_led_selected, 2))
{
- output().set_digit_value(2, digit_data);
+ m_digits[2] = digit_data;
m_led_7seg_data[2] = digit_data;
}
if (!BIT(m_led_selected, 3))
{
- output().set_digit_value(3, digit_data);
+ m_digits[3] = digit_data;
m_led_7seg_data[3] = digit_data;
}
}