summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/sound/k056800.h
blob: 25d24170e12e1952f9742e82902e082b8ff53009 (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
/*********************************************************

    Konami 056800 MIRAC sound interface

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

#ifndef __K056800_H__
#define __K056800_H__


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

typedef void (*k056800_irq_cb)(running_machine &, int);


struct k056800_interface
{
	k056800_irq_cb       m_irq_cb;
};

class k056800_device : public device_t,
						public k056800_interface
{
public:
	k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
	~k056800_device() {}

	enum
	{
		TIMER_TICK_SOUND_CPU
	};

	DECLARE_READ32_MEMBER( host_r );
	DECLARE_WRITE32_MEMBER( host_w );
	DECLARE_READ16_MEMBER( sound_r );
	DECLARE_WRITE16_MEMBER( sound_w );

protected:
	// device-level overrides
	virtual void device_config_complete();
	virtual void device_start();
	virtual void device_reset();

	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr);

private:
	// internal state
	UINT8                m_host_reg[8];
	UINT8                m_sound_reg[8];
	emu_timer            *m_sound_cpu_timer;
	UINT8                m_sound_cpu_irq1_enable;
	k056800_irq_cb       m_irq_cb_func;

	UINT8 host_reg_r( int reg );
	void host_reg_w( int reg, UINT8 data );
	UINT8 sound_reg_r( int reg );
	void sound_reg_w( int reg, UINT8 data );

};

extern const device_type K056800;



/***************************************************************************
    DEVICE CONFIGURATION MACROS
***************************************************************************/

#define MCFG_K056800_ADD(_tag, _interface, _clock) \
	MCFG_DEVICE_ADD(_tag, K056800, _clock) \
	MCFG_DEVICE_CONFIG(_interface)


#endif /* __K056800_H__ */