blob: bde41b2a7e1f042783eb6371c221843c307f9b9f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
// license:BSD-3-Clause
// copyright-holders:Curt Coder
/***************************************************************************
dirtc.c
Device Output interfaces.
***************************************************************************/
#include "emu.h"
#include "dioutput.h"
//**************************************************************************
// DEVICE OUTPUT INTERFACE
//**************************************************************************
//-------------------------------------------------
// device_output_interface - constructor
//-------------------------------------------------
device_output_interface::device_output_interface(const machine_config &mconfig, device_t &device) :
device_interface(device, "output"),
m_output_index(0),
m_output_name(nullptr)
{
}
//-------------------------------------------------
// device_output_interface - destructor
//-------------------------------------------------
device_output_interface::~device_output_interface()
{
}
void device_output_interface::set_output_value(int value) const
{
if (m_output_name)
device().machine().output().set_value(m_output_name, value);
else
fatalerror("Output name not set!");
}
void device_output_interface::set_led_value(int value) const
{
if (m_output_name)
device().machine().output().set_value(m_output_name, value);
else
device().machine().output().set_led_value(m_output_index, value);
}
void device_output_interface::set_lamp_value(int value) const
{
if (m_output_name)
device().machine().output().set_value(m_output_name, value);
else
device().machine().output().set_lamp_value(m_output_index, value);
}
void device_output_interface::set_digit_value(int value) const
{
if (m_output_name)
device().machine().output().set_value(m_output_name, value);
else
device().machine().output().set_digit_value(m_output_index, value);
}
|