summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/mc6843.h
blob: be9ab55a310130c96c89efc9c29c8da107f32a3f (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
/**********************************************************************

  Copyright (C) Antoine Mine' 2007

  Motorola 6843 Floppy Disk Controller emulation.

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

#ifndef MC6843_H
#define MC6843_H

class mc6843_device : public device_t
{
public:
	mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	~mc6843_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();
	virtual void device_reset();
private:
	// internal state
	void *m_token;
};

extern const device_type MC6843;



/* ---------- configuration ------------ */

struct mc6843_interface
{
	void ( * irq_func ) ( device_t *device, int state );
};


#define MCFG_MC6843_ADD(_tag, _intrf) \
  MCFG_DEVICE_ADD(_tag, MC6843, 0)	      \
  MCFG_DEVICE_CONFIG(_intrf)

#define MCFG_MC6843_REMOVE(_tag)		\
  MCFG_DEVICE_REMOVE(_tag)


/* ---------- functions ------------ */

extern DECLARE_READ8_DEVICE_HANDLER  ( mc6843_r );
extern DECLARE_WRITE8_DEVICE_HANDLER ( mc6843_w );

extern void mc6843_set_drive ( device_t *device, int drive );
extern void mc6843_set_side  ( device_t *device, int side );
extern void mc6843_set_index_pulse ( device_t *device, int index_pulse );

#endif