1 // license:BSD-3-Clause
2 // copyright-holders:Philip Bennett
3 #ifndef MAME_AUDIO_TAITOSND_H
4 #define MAME_AUDIO_TAITOSND_H
5 
6 
7 //**************************************************************************
8 //  TYPE DEFINITIONS
9 //**************************************************************************
10 
11 // ======================> tc0140syt_device
12 
13 class tc0140syt_device : public device_t
14 {
15 public:
16 	tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
17 
set_master_tag(T && tag)18 	template <typename T> void set_master_tag(T &&tag) { m_mastercpu.set_tag(std::forward<T>(tag)); }
set_slave_tag(T && tag)19 	template <typename T> void set_slave_tag(T &&tag) { m_slavecpu.set_tag(std::forward<T>(tag)); }
20 
21 	// MASTER (4-bit bus) control functions
22 	void master_port_w(u8 data);
23 	void master_comm_w(u8 data);
24 	u8 master_comm_r();
25 
26 	// SLAVE (4-bit bus) control functions ONLY
27 	void slave_port_w(u8 data);
28 	u8 slave_comm_r();
29 	void slave_comm_w(u8 data);
30 
31 protected:
32 	tc0140syt_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
33 
34 	// device-level overrides
35 	virtual void device_start() override;
36 	virtual void device_reset() override;
37 
38 private:
39 	void update_nmi();
40 
41 	u8     m_slavedata[4];  /* Data on master->slave port (4 nibbles) */
42 	u8     m_masterdata[4]; /* Data on slave->master port (4 nibbles) */
43 	u8     m_mainmode;      /* Access mode on master cpu side */
44 	u8     m_submode;       /* Access mode on slave cpu side */
45 	u8     m_status;        /* Status data */
46 	u8     m_nmi_enabled;   /* 1 if slave cpu has nmi's enabled */
47 
48 	required_device<cpu_device> m_mastercpu;     /* this is the maincpu */
49 	required_device<cpu_device> m_slavecpu;      /* this is the audiocpu */
50 };
51 
52 // ======================> pc060ha_device
53 
54 class pc060ha_device : public tc0140syt_device
55 {
56 public:
57 	pc060ha_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
58 };
59 
60 DECLARE_DEVICE_TYPE(TC0140SYT, tc0140syt_device)
61 DECLARE_DEVICE_TYPE(PC060HA, pc060ha_device)
62 
63 
64 #endif // MAME_AUDIO_TAITOSND_H
65