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
|
// license:BSD-3-Clause
// copyright-holders: Olivier Galibert
// ADB - Apple Desktop Bus
//
// The serial desktop device bus from before USB was cool.
//
// Single data wire + poweron line, open collector
#include "emu.h"
#include "adb.h"
#include "adbhle.h"
#include "a9m0330.h"
#include "a9m0331.h"
DEFINE_DEVICE_TYPE(ADB_CONNECTOR, adb_connector, "adbslot", "ADB connector")
adb_connector::adb_connector(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, ADB_CONNECTOR, tag, owner, clock),
device_single_card_slot_interface<adb_slot_card_interface>(mconfig, *this)
{
}
void adb_connector::device_start()
{
}
adb_device *adb_connector::get_device()
{
adb_slot_card_interface *const connected = get_card_device();
if (connected)
return connected->device().subdevice<adb_device>(connected->m_adb.finder_tag());
else
return nullptr;
}
adb_slot_card_interface::adb_slot_card_interface(const machine_config &mconfig, device_t &device, const char *adb_tag) :
device_interface(device, "adb"),
m_adb(*this, adb_tag)
{
}
adb_device::adb_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, type, tag, owner, clock),
m_adb_cb(*this),
m_poweron_cb(*this)
{
}
void adb_device::device_start()
{
m_adb_cb.resolve_safe();
m_poweron_cb.resolve_safe();
}
void adb_device::device_reset()
{
m_adb_istate = true;
m_adb_ostate = true;
}
void adb_device::default_devices(device_slot_interface &device)
{
device.option_add("hle", ADB_HLE);
device.option_add("a9m0330", ADB_A9M0330);
device.option_add("a9m0331", ADB_A9M0331);
}
|