summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/aztarac.cpp
blob: 24d0a930fd3f9c4c86654144e6795f34869bb4a8 (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
// license:BSD-3-Clause
// copyright-holders:Mathis Rosenhauer
/***************************************************************************

    Centuri Aztarac hardware

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

#include "emu.h"
#include "cpu/z80/z80.h"
#include "includes/aztarac.h"


READ16_MEMBER(aztarac_state::sound_r)
{
	return m_sound_status & 0x01;
}

WRITE16_MEMBER(aztarac_state::sound_w)
{
	if (ACCESSING_BITS_0_7)
	{
		data &= 0xff;
		m_soundlatch->write(data);
		m_sound_status ^= 0x21;
		if (m_sound_status & 0x20)
			m_audiocpu->set_input_line(0, HOLD_LINE);
	}
}

READ8_MEMBER(aztarac_state::snd_command_r)
{
	m_sound_status |= 0x01;
	m_sound_status &= ~0x20;
	return m_soundlatch->read();
}

READ8_MEMBER(aztarac_state::snd_status_r)
{
	return m_sound_status & ~0x01;
}

WRITE8_MEMBER(aztarac_state::snd_status_w)
{
	m_sound_status &= ~0x10;
}

INTERRUPT_GEN_MEMBER(aztarac_state::snd_timed_irq)
{
	m_sound_status ^= 0x10;

	if (m_sound_status & 0x10)
		device.execute().set_input_line(0,HOLD_LINE);
}