summaryrefslogtreecommitdiffstats
path: root/src/mess/machine/md_jcart.h
blob: bf7b3e7dd9b6fe163669e97ae6aab77f29561d1a (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
#ifndef __MD_JCART_H
#define __MD_JCART_H

#include "machine/md_slot.h"
#include "machine/i2cmem.h"


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

// ======================> md_jcart_device

class md_jcart_device : public device_t,
					public device_md_cart_interface
{
public:
	// construction/destruction
	md_jcart_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
	md_jcart_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	
	// device-level overrides
	virtual void device_start();
	virtual void device_config_complete() { m_shortname = "md_jcart"; }
	virtual ioport_constructor device_input_ports() const;

	// reading and writing
	virtual DECLARE_READ16_MEMBER(read);
	virtual DECLARE_WRITE16_MEMBER(write);

	required_ioport m_jcart3;
	required_ioport m_jcart4;

private:
	UINT8 m_jcart_io_data[2];
};

// ======================> md_seprom_codemast_device

class md_seprom_codemast_device : public md_jcart_device
{
public:
	// construction/destruction
	md_seprom_codemast_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock);
	md_seprom_codemast_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	
	// device-level overrides
	virtual void device_start();
	virtual void device_config_complete() { m_shortname = "md_seprom_codemast"; }
	virtual machine_config_constructor device_mconfig_additions() const;
	
	// reading and writing
	virtual DECLARE_READ16_MEMBER(read);
	virtual DECLARE_WRITE16_MEMBER(write);

	required_device<i2cmem_device> m_i2cmem;

private:
	UINT8 m_jcart_io_data[2];	
	UINT8 m_i2c_mem, m_i2c_clk;
};

// ======================> md_seprom_mm96_device (same read/write as codemast, but different I2C type)

class md_seprom_mm96_device : public md_seprom_codemast_device
{
public:
	// construction/destruction
	md_seprom_mm96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	
	// device-level overrides
	virtual void device_config_complete() { m_shortname = "md_seprom_mm96"; }
	virtual machine_config_constructor device_mconfig_additions() const;
};



// device type definition
extern const device_type MD_JCART;
extern const device_type MD_SEPROM_CODEMAST;
extern const device_type MD_SEPROM_MM96;

#endif