summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/upd71071.h
blob: 9a815d8819e36ce2f6c7f6ad9516f1ddd6cb700c (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
#ifndef UPD71071_H_
#define UPD71071_H_

#include "emu.h"

struct upd71071_intf
{
	const char* cputag;
	int clock;
	devcb_write_line    m_out_hreq_cb;
	devcb_write_line    m_out_eop_cb;
	devcb_read16        m_dma_read[4];
	devcb_write16       m_dma_write[4];
	devcb_write_line    m_out_dack_cb[4];
};

int upd71071_dmarq(device_t* device,int state,int channel);

class upd71071_device : public device_t
{
public:
	upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	~upd71071_device() { global_free(m_token); }

	// access to legacy token
	void *token() const { assert(m_token != NULL); return m_token; }
protected:
	// device-level overrides
	virtual void device_config_complete();
	virtual void device_start();
private:
	// internal state
	void *m_token;
};

extern const device_type UPD71071;


#define MCFG_UPD71071_ADD(_tag, _config) \
	MCFG_DEVICE_ADD(_tag, UPD71071, 0) \
	MCFG_DEVICE_CONFIG(_config)

DECLARE_READ8_DEVICE_HANDLER(upd71071_r);
DECLARE_WRITE8_DEVICE_HANDLER(upd71071_w);

void set_hreq( device_t *device, int state);
void set_eop( device_t *device, int state);


#endif /*UPD71071_H_*/