summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/ti99/gromport/singleconn.cpp
blob: 9a0b905a9e70126192af3fd5cd6c765ae750b91d (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
91
92
// license:LGPL-2.1+
// copyright-holders:Michael Zapf
/***************************************************************************

    Single: the standard console connector, one cartridge

***************************************************************************/

#include "emu.h"
#include "singleconn.h"

DEFINE_DEVICE_TYPE_NS(TI99_GROMPORT_SINGLE, bus::ti99::gromport, ti99_single_cart_conn_device, "ti99_scartconn", "TI-99 Standard cartridge connector")

namespace bus { namespace ti99 { namespace gromport {

ti99_single_cart_conn_device::ti99_single_cart_conn_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
	: cartridge_connector_device(mconfig, TI99_GROMPORT_SINGLE, tag, owner, clock),
	m_cartridge(nullptr)
{
}

READ8Z_MEMBER(ti99_single_cart_conn_device::readz)
{
	// Pass through
	m_cartridge->readz(offset, value);
}

void ti99_single_cart_conn_device::write(offs_t offset, uint8_t data)
{
	// Pass through
	m_cartridge->write(offset, data);
}

READ8Z_MEMBER(ti99_single_cart_conn_device::crureadz)
{
	// Pass through
	m_cartridge->crureadz(offset, value);
}

void ti99_single_cart_conn_device::cruwrite(offs_t offset, uint8_t data)
{
	// Pass through
	m_cartridge->cruwrite(offset, data);
}

WRITE_LINE_MEMBER(ti99_single_cart_conn_device::romgq_line)
{
	// Pass through
	m_cartridge->romgq_line(state);
}

/*
    Combined select lines
*/
void ti99_single_cart_conn_device::set_gromlines(line_state mline, line_state moline, line_state gsq)
{
	// Pass through
	m_cartridge->set_gromlines(mline, moline, gsq);
}


WRITE_LINE_MEMBER(ti99_single_cart_conn_device::gclock_in)
{
	// Pass through
	m_cartridge->gclock_in(state);
}

/*
    Check whether the GROMs are idle.
*/
bool ti99_single_cart_conn_device::is_grom_idle()
{
	return m_cartridge->is_grom_idle();
}

void ti99_single_cart_conn_device::device_start()
{
	m_cartridge = static_cast<ti99_cartridge_device*>(subdevices().first());
}

void ti99_single_cart_conn_device::device_reset()
{
	m_cartridge->set_slot(0);
}

void ti99_single_cart_conn_device::device_add_mconfig(machine_config &config)
{
	TI99_CART(config, "cartridge", 0);
}

} } } // end namespace bus::ti99::gromport