summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/machine/smc91c9x.h
blob: 9f8161f32b139462f2b032a22a6b65a82188d99f (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
/*************************************************************************

    SMC91C9X ethernet controller implementation

    by Aaron Giles

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

#ifndef __SMC91C9X__
#define __SMC91C9X__

#include "devlegcy.h"


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

typedef void (*smc91c9x_irq_func)(device_t *device, int state);


typedef struct _smc91c9x_config smc91c9x_config;
struct _smc91c9x_config
{
	smc91c9x_irq_func	interrupt;
};



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

#define MCFG_SMC91C94_ADD(_tag, _config) \
	MCFG_DEVICE_ADD(_tag, SMC91C94, 0) \
	MCFG_DEVICE_CONFIG(_config)

#define MCFG_SMC91C96_ADD(_tag, _config) \
	MCFG_DEVICE_ADD(_tag, SMC91C96, 0) \
	MCFG_DEVICE_CONFIG(_config)



/***************************************************************************
    FUNCTION PROTOTYPES
***************************************************************************/

READ16_DEVICE_HANDLER( smc91c9x_r );
WRITE16_DEVICE_HANDLER( smc91c9x_w );


/* ----- device interface ----- */
class smc91c9x_device : public device_t
{
public:
	smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
	~smc91c9x_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;
};


class smc91c94_device : public smc91c9x_device
{
public:
	smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

extern const device_type SMC91C94;

class smc91c96_device : public smc91c9x_device
{
public:
	smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
};

extern const device_type SMC91C96;


#endif