summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/thomson/extension.cpp
blob: 4fb2cfbb7ce5e856645d270931148a6d15d9e97f (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
// license:BSD-3-Clause
// copyright-holders:Olivier Galibert

// Generic Thomson TO*/MO* extension slot


#include "emu.h"
#include "extension.h"

DEFINE_DEVICE_TYPE(THOMSON_EXTENSION, thomson_extension_device, "thomson_extension", "Thomson TO*/MO* extension port")

thomson_extension_device::thomson_extension_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
	device_t(mconfig, THOMSON_EXTENSION, tag, owner, clock),
	device_single_card_slot_interface<thomson_extension_interface>(mconfig, *this),
	m_firq_callback(*this),
	m_irq_callback(*this)
{
}

void thomson_extension_device::rom_map(address_space_installer &space, offs_t start, offs_t end)
{
	auto dev = get_card_device();
	if(dev)
		space.install_device(start, end, *dev, &thomson_extension_interface::rom_map);
}

void thomson_extension_device::io_map(address_space_installer &space, offs_t start, offs_t end)
{
	auto dev = get_card_device();
	if(dev)
		space.install_device(start, end, *dev, &thomson_extension_interface::io_map);
}

void thomson_extension_device::device_start()
{
}

thomson_extension_interface::thomson_extension_interface(const machine_config &mconfig, device_t &device) :
	device_interface(device, "extension"),
	m_ext(dynamic_cast<thomson_extension_device *>(device.owner()))
{
}

void thomson_extension_interface::firq_w(int state)
{
	if(m_ext)
		m_ext->m_firq_callback(state);
}

void thomson_extension_interface::irq_w(int state)
{
	if(m_ext)
		m_ext->m_irq_callback(state);
}