summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/peb/peribox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/ti99/peb/peribox.cpp')
-rw-r--r--src/devices/bus/ti99/peb/peribox.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/devices/bus/ti99/peb/peribox.cpp b/src/devices/bus/ti99/peb/peribox.cpp
index add22015f2d..d63c824c3ae 100644
--- a/src/devices/bus/ti99/peb/peribox.cpp
+++ b/src/devices/bus/ti99/peb/peribox.cpp
@@ -701,18 +701,10 @@ void peribox_slot_device::device_start()
void peribox_slot_device::device_config_complete()
{
m_slotnumber = get_index_from_tagname();
- device_t *carddev = subdevices().first();
- peribox_device *peb = static_cast<peribox_device*>(owner());
- if (carddev != nullptr)
- {
- peb->set_slot_loaded(m_slotnumber, this);
- m_card = static_cast<ti_expansion_card_device*>(carddev);
- }
- else
- {
- peb->set_slot_loaded(m_slotnumber, nullptr);
- m_card = nullptr;
- }
+ m_card = downcast<ti_expansion_card_device *>(subdevices().first());
+ peribox_device *peb = dynamic_cast<peribox_device*>(owner());
+ if (peb)
+ peb->set_slot_loaded(m_slotnumber, m_card ? this : nullptr);
}
/*