blob: 4190dac0bc0ee04f131963b86c90e9f96d011805 (
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
/***************************************************************************
Slot device
***************************************************************************/
#include "emu.h"
#include "emuopts.h"
device_slot_interface::device_slot_interface(const machine_config &mconfig, device_t &device)
: device_interface(device)
{
m_default_card = 0;
m_input_defaults = 0;
m_slot_interfaces = 0;
}
device_slot_interface::~device_slot_interface()
{
}
void device_slot_interface::static_set_slot_info(device_t &device, const slot_interface *slots_info, const char *default_card,const input_device_default *default_input, const void *default_config, UINT32 default_clock, bool fixed)
{
device_slot_interface *slot;
if (!device.interface(slot))
throw emu_fatalerror("set_default_slot_card called on device '%s' with no slot interface", device.tag());
slot->m_slot_interfaces = slots_info;
slot->m_default_card = default_card;
slot->m_input_defaults = default_input;
slot->m_default_config = default_config;
slot->m_default_clock = default_clock;
slot->m_fixed = fixed;
}
device_t* device_slot_interface::get_card_device()
{
const char *subtag;
device_t *dev = NULL;
astring temp;
if (!device().mconfig().options().exists(device().tag()+1)) {
subtag = m_default_card;
} else {
subtag = device().mconfig().options().main_value(temp,device().tag()+1);
}
if (subtag && *subtag != 0) {
device_slot_card_interface *intf = NULL;
dev = device().subdevice(subtag);
if (dev!=NULL && !dev->interface(intf))
throw emu_fatalerror("get_card_device called for device '%s' with no slot card interface", dev->tag());
}
return dev;
}
const bool device_slot_interface::all_internal() const
{
for (int i = 0; m_slot_interfaces && m_slot_interfaces[i].name != NULL; i++)
if (!m_slot_interfaces[i].internal)
return FALSE;
return TRUE;
}
bool device_slot_interface::is_internal_option(const char *option) const
{
if ( !option )
{
return false;
}
for (int i = 0; m_slot_interfaces && m_slot_interfaces[i].name != NULL; i++)
{
if ( !strcmp(m_slot_interfaces[i].name, option) )
{
return m_slot_interfaces[i].internal;
}
}
return false;
}
device_slot_card_interface::device_slot_card_interface(const machine_config &mconfig, device_t &device)
: device_interface(device)
{
}
device_slot_card_interface::~device_slot_card_interface()
{
}
|