summaryrefslogtreecommitdiffstats
path: root/src/devices/bus/tvc/tvc.h
blob: 9fd9db95e140f29ddb2ac624d4199e1fcb358c45 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
// license:BSD-3-Clause
// copyright-holders:Sandro Ronco
/*********************************************************************

    tvc.h

**********************************************************************

                   +----------+
          GND      | A01  B01 |       GND
          +5V      | A02  B02 |       +5V
         +12V      | A03  B03 |       +12V
         -12V      | A04  B04 |       -12V
         N.C.      | A05  B05 |       N.C.
         N.C.      | A06  B06 |       /HSYNC
    3.125 CLK      | A07  B07 |       /VSYNC
          DMA      | A08  B08 |       BORDER
         LPEN      | A09  B09 |       N.C.
          DEB      | A10  B10 |       MUX
    6.25 CLK       | A11  B11 |       A3
          A1       | A12  B12 |       EC3
         EC0       | A13  B13 |       EC1
       /EXTC       | A14  B14 |       EC2
    /PHANTOM       | A15  B15 |       TXRXCLK
        N.C.       | A16  B16 |       SOUND
         BD0       | A17  B17 |       N.C.
         BD1       | A18  B18 |       N.C.
         BD2       | A19  B19 |       N.C.
         BD3       | A20  B20 |       N.C.
         BD4       | A21  B21 |       N.C.
         BD5       | A22  B22 |       N.C.
         BD6       | A23  B23 |       N.C.
         BD7       | A24  B24 |       A15
         A17       | A25  B25 |       A5
          A8       | A26  B26 |       A12
          A7       | A27  B27 |       A6
          A9       | A28  B28 |       A11
          A4       | A29  B29 |       A10
         A13       | A30  B30 |       A2
     /VIDLSB       | A31  B31 |       A0
        /EXP       | A32  B32 |       P3
        N.C.       | A33  B33 |       /BUSRQ
         /P2       | A34  B34 |       N.C.
     /CLRINT       | A35  B35 |       RESET
         IDA       | A36  B36 |       /NMI
        /INT       | A37  B37 |       /WAIT
         IDB       | A38  B38 |       /INT
        /EXP       | A39  B39 |       N.C.
         /BM       | A40  B40 |       /BIORQ
     /BRESET       | A41  B41 |       /B0
        /BWR       | A42  B42 |       /BMREQ
        /WRD       | A43  B43 |       /BRFSH
                   +----------+
*********************************************************************/

#ifndef MAME_BUS_TVC_TVC_H
#define MAME_BUS_TVC_TVC_H

#pragma once


/***************************************************************************
    TYPE DEFINITIONS
***************************************************************************/

// ======================> device_tvcexp_interface

class device_tvcexp_interface : public device_slot_card_interface
{
public:
	// construction/destruction
	virtual ~device_tvcexp_interface();

	// reading and writing
	virtual uint8_t id_r() { return 0x00; }   // ID_A and ID_B lines
	virtual void int_ack() { }
	virtual uint8_t int_r() { return 1; }
	virtual DECLARE_READ8_MEMBER(read) { return 0x00; }
	virtual DECLARE_WRITE8_MEMBER(write) { }
	virtual DECLARE_READ8_MEMBER(io_read) { return 0x00; }
	virtual DECLARE_WRITE8_MEMBER(io_write) { }

protected:
	device_tvcexp_interface(const machine_config &mconfig, device_t &device);
};

// ======================> tvcexp_slot_device

class tvcexp_slot_device : public device_t,
							public device_slot_interface
{
public:
	// construction/destruction
	tvcexp_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
	virtual ~tvcexp_slot_device();

	template <class Object> devcb_base &set_out_irq_callback(Object &&cb) { return m_out_irq_cb.set_callback(std::forward<Object>(cb)); }
	template <class Object> devcb_base &set_out_nmi_callback(Object &&cb) { return m_out_nmi_cb.set_callback(std::forward<Object>(cb)); }

	// reading and writing
	virtual uint8_t id_r();
	virtual void int_ack();
	virtual uint8_t int_r();
	virtual DECLARE_READ8_MEMBER(read);
	virtual DECLARE_WRITE8_MEMBER(write);
	virtual DECLARE_READ8_MEMBER(io_read);
	virtual DECLARE_WRITE8_MEMBER(io_write);

protected:
	// device-level overrides
	virtual void device_start() override;

	devcb_write_line            m_out_irq_cb;
	devcb_write_line            m_out_nmi_cb;

	device_tvcexp_interface*    m_cart;
};

// device type definition
DECLARE_DEVICE_TYPE(TVCEXP_SLOT, tvcexp_slot_device)


/***************************************************************************
    DEVICE CONFIGURATION MACROS
***************************************************************************/

#define MCFG_TVCEXP_SLOT_OUT_IRQ_CB(_devcb) \
	devcb = &downcast<tvcexp_slot_device &>(*device).set_out_irq_callback(DEVCB_##_devcb);

#define MCFG_TVCEXP_SLOT_OUT_NMI_CB(_devcb) \
	devcb = &downcast<tvcexp_slot_device &>(*device).set_out_nmi_callback(DEVCB_##_devcb);

#endif // MAME_BUS_TVC_TVC_H