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

    beta.h

    Implementation of Beta disk drive support for Spectrum and clones

    04/05/2008 Created by Miodrag Milanovic

*********************************************************************/
#ifndef __BETA_H__
#define __BETA_H__

#include "machine/wd17xx.h"


#define BETA_DISK_TAG   "beta"

class beta_disk_device : public device_t
{
public:
	beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	~beta_disk_device() {}
	
	DECLARE_READ8_MEMBER(status_r);
	DECLARE_READ8_MEMBER(track_r);
	DECLARE_READ8_MEMBER(sector_r);
	DECLARE_READ8_MEMBER(data_r);
	DECLARE_READ8_MEMBER(state_r);

	DECLARE_WRITE8_MEMBER(param_w);
	DECLARE_WRITE8_MEMBER(command_w);
	DECLARE_WRITE8_MEMBER(track_w);
	DECLARE_WRITE8_MEMBER(sector_w);
	DECLARE_WRITE8_MEMBER(data_w);
	
	DECLARE_WRITE_LINE_MEMBER(wd179x_intrq_w);
	DECLARE_WRITE_LINE_MEMBER(wd179x_drq_w);
	
	int is_active();
	void enable();
	void disable();
	void clear_status();
	
	UINT8 m_betadisk_status;
	UINT8 m_betadisk_active;
	
protected:
	// device-level overrides
	virtual void device_start();
	virtual void device_reset();
	virtual const rom_entry *device_rom_region() const;
	virtual machine_config_constructor device_mconfig_additions() const;

private:
	// internal state
	wd2793_device *m_wd179x;
};

extern const device_type BETA_DISK;


#define MCFG_BETA_DISK_ADD(_tag) \
	MCFG_DEVICE_ADD(_tag, BETA_DISK, 0)

#define MCFG_BETA_DISK_REMOVE(_tag)     \
	MCFG_DEVICE_REMOVE(_tag)

#endif /* __BETA_H__ */