summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/a1bus/a1cffa.h
blob: d395468891bcd0a40c0b88d1740cdc8000c06673 (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
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/*********************************************************************

    a1cffa.h

    Rich Dreher's Compact Flash for Apple I

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

#ifndef __A1BUS_CFFA__
#define __A1BUS_CFFA__

#include "emu.h"
#include "a1bus.h"
#include "machine/ataintf.h"

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

class a1bus_cffa_device:
	public device_t,
	public device_a1bus_card_interface
{
public:
	// construction/destruction
	a1bus_cffa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	a1bus_cffa_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);

	// optional information overrides
	virtual machine_config_constructor device_mconfig_additions() const override;
	virtual const rom_entry *device_rom_region() const override;

	required_device<ata_interface_device> m_ata;

	DECLARE_READ8_MEMBER(cffa_r);
	DECLARE_WRITE8_MEMBER(cffa_w);

protected:
	virtual void device_start() override;
	virtual void device_reset() override;

private:
	UINT8 *m_rom;
	UINT16 m_lastdata;
	bool m_writeprotect;
};

// device type definition
extern const device_type A1BUS_CFFA;

#endif  /* __A1BUS_CFFA__ */