mame/src/emu/dioutput.h
Vas Crabb 96c9112785 general cleanup:
* move rarely-used output and pty interfaces out of emu.h
* consolidate and de-duplicate forward declarations, also remove some obsolete ones
* clean up more #include guard macros
* scope down a few more things

(nw) Everyone, please keep forward declarations for src/emu in src/emu/emufwd.h -
this will make it far easier to keep them in sync with declarations than having
them scattered through all the other files.
2017-05-23 15:01:11 +10:00

57 lines
1.6 KiB
C++

// license:BSD-3-Clause
// copyright-holders:Curt Coder
/***************************************************************************
dioutput.h
Device Output interfaces.
***************************************************************************/
#ifndef MAME_EMU_DIOUTPUT_H
#define MAME_EMU_DIOUTPUT_H
#pragma once
//**************************************************************************
// MACROS
//**************************************************************************
#define MCFG_OUTPUT_INDEX(_index) \
device_output_interface::set_output_index(*device, _index);
#define MCFG_OUTPUT_NAME(_name) \
device_output_interface::set_output_name(*device, _name);
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> device_output_interface
class device_output_interface : public device_interface
{
public:
// construction/destruction
device_output_interface(const machine_config &mconfig, device_t &device);
virtual ~device_output_interface();
static void set_output_index(device_t &device, int index) { dynamic_cast<device_output_interface &>(device).m_output_index = index; }
static void set_output_name(device_t &device, const char *name) { dynamic_cast<device_output_interface &>(device).m_output_name = name; }
void set_output_value(int value) const;
void set_led_value(int value) const;
void set_lamp_value(int value) const;
void set_digit_value(int value) const;
protected:
int m_output_index;
const char *m_output_name;
};
#endif // MAME_EMU_DIOUTPUT_H