1 // license:BSD-3-Clause
2 // copyright-holders:Nigel Barnes
3 /**********************************************************************
4 
5     Tangerine TANDOS (MT0078)
6 
7 **********************************************************************/
8 
9 
10 #ifndef MAME_BUS_TANBUS_TANDOS_H
11 #define MAME_BUS_TANBUS_TANDOS_H
12 
13 #pragma once
14 
15 #include "bus/tanbus/tanbus.h"
16 #include "imagedev/floppy.h"
17 #include "machine/wd_fdc.h"
18 
19 //**************************************************************************
20 //  TYPE DEFINITIONS
21 //**************************************************************************
22 
23 class tanbus_tandos_device :
24 	public device_t,
25 	public device_tanbus_interface
26 {
27 public:
imperfect_features()28 	static constexpr feature_type imperfect_features() { return feature::DISK; }
29 
30 	// construction/destruction
31 	tanbus_tandos_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
32 
33 	DECLARE_FLOPPY_FORMATS(floppy_formats);
34 
35 protected:
36 	// device-level overrides
37 	virtual void device_start() override;
38 	virtual void device_reset() override;
39 
40 	// optional information overrides
41 	virtual void device_add_mconfig(machine_config &config) override;
42 	virtual const tiny_rom_entry *device_rom_region() const override;
43 
44 	virtual uint8_t read(offs_t offset, int inhrom, int inhram, int be) override;
45 	virtual void write(offs_t offset, uint8_t data, int inhrom, int inhram, int be) override;
46 	virtual void set_inhibit_lines(offs_t offset, int &inhram, int &inhrom) override;
47 
48 private:
49 	void control_w(uint8_t val);
50 	uint8_t status_r();
51 	DECLARE_WRITE_LINE_MEMBER(fdc_irq_w);
52 	DECLARE_WRITE_LINE_MEMBER(fdc_drq_w);
53 	DECLARE_WRITE_LINE_MEMBER(fdc_hld_w);
54 
55 	required_memory_region m_dos_rom;
56 	required_device<fd1793_device> m_fdc;
57 	required_device_array<floppy_connector, 4> m_floppies;
58 	floppy_image_device *m_floppy;
59 
60 	uint8_t m_drive_control;
61 	int m_irq_enable;
62 	int m_drq_enable;
63 
64 	std::unique_ptr<uint8_t[]> m_ram;
65 };
66 
67 
68 // device type definition
69 DECLARE_DEVICE_TYPE(TANBUS_TANDOS, tanbus_tandos_device)
70 
71 
72 #endif // MAME_BUS_TANBUS_TANDOS_H
73