summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/astrocde/accessory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/astrocde/accessory.cpp')
-rw-r--r--src/devices/bus/astrocde/accessory.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/src/devices/bus/astrocde/accessory.cpp b/src/devices/bus/astrocde/accessory.cpp
index fe7727b855d..fb047e660d8 100644
--- a/src/devices/bus/astrocde/accessory.cpp
+++ b/src/devices/bus/astrocde/accessory.cpp
@@ -19,7 +19,7 @@ DEFINE_DEVICE_TYPE(ASTROCADE_ACCESSORY_PORT, astrocade_accessory_port_device, "a
//**************************************************************************
device_astrocade_accessory_interface::device_astrocade_accessory_interface(const machine_config &mconfig, device_t &device)
- : device_slot_card_interface(mconfig, device)
+ : device_interface(device, "astrocadeacc")
, m_port(dynamic_cast<astrocade_accessory_port_device *>(device.owner()))
{
}
@@ -30,8 +30,6 @@ device_astrocade_accessory_interface::~device_astrocade_accessory_interface()
void device_astrocade_accessory_interface::interface_validity_check(validity_checker &valid) const
{
- device_slot_card_interface::interface_validity_check(valid);
-
if (device().owner() && !m_port)
{
osd_printf_error("Owner device %s (%s) is not an astrocade_accessory_port_device\n", device().owner()->tag(), device().owner()->name());
@@ -40,8 +38,6 @@ void device_astrocade_accessory_interface::interface_validity_check(validity_che
void device_astrocade_accessory_interface::interface_pre_start()
{
- device_slot_card_interface::interface_pre_start();
-
if (m_port && !m_port->started())
throw device_missing_dependencies();
}
@@ -53,7 +49,7 @@ void device_astrocade_accessory_interface::interface_pre_start()
astrocade_accessory_port_device::astrocade_accessory_port_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, ASTROCADE_ACCESSORY_PORT, tag, owner, clock)
- , device_slot_interface(mconfig, *this)
+ , device_single_card_slot_interface<device_astrocade_accessory_interface>(mconfig, *this)
, m_ltpen(0)
, m_ltpen_handler(*this)
, m_screen(*this, finder_base::DUMMY_TAG)
@@ -65,38 +61,17 @@ astrocade_accessory_port_device::~astrocade_accessory_port_device()
{
}
-void astrocade_accessory_port_device::device_validity_check(validity_checker &valid) const
-{
- device_t *const card(get_card_device());
- if (card && !dynamic_cast<device_astrocade_accessory_interface *>(card))
- {
- osd_printf_error("Card device %s (%s) does not implement device_astrocade_accessory_interface\n", card->tag(), card->name());
- }
-}
-
void astrocade_accessory_port_device::device_resolve_objects()
{
- device_astrocade_accessory_interface *const card(dynamic_cast<device_astrocade_accessory_interface *>(get_card_device()));
- if (card)
- {
- m_device = card;
+ m_device = get_card_device();
+ if (m_device)
m_device->set_screen(m_screen);
- }
m_ltpen_handler.resolve_safe();
}
void astrocade_accessory_port_device::device_start()
{
- device_t *const card(get_card_device());
- if (card)
- {
- if (!m_device)
- {
- throw emu_fatalerror("astrocade_accessory_port_device: card device %s (%s) does not implement device_astrocade_accessory_interface\n", card->tag(), card->name());
- }
- }
-
save_item(NAME(m_ltpen));
m_ltpen = 0;