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
|
// license:BSD-3-Clause
// copyright-holders:Nigel Barnes
/**********************************************************************
Cheetah Marketing SpecDrum emulation
**********************************************************************/
#include "emu.h"
#include "specdrum.h"
#include "speaker.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
DEFINE_DEVICE_TYPE(SPECTRUM_SPECDRUM, spectrum_specdrum_device, "spectrum_specdrum", "SpecDrum")
//-------------------------------------------------
// device_add_mconfig - add device configuration
//-------------------------------------------------
void spectrum_specdrum_device::device_add_mconfig(machine_config &config)
{
SPEAKER(config, "speaker").front_center();
ZN428E(config, m_dac).add_route(ALL_OUTPUTS, "speaker", 0.5);
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// spectrum_specdrum_device - constructor
//-------------------------------------------------
spectrum_specdrum_device::spectrum_specdrum_device(const machine_config &mconfig, const char *tag, device_t *owner, const XTAL &clock)
: device_t(mconfig, SPECTRUM_SPECDRUM, tag, owner, clock)
, device_spectrum_expansion_interface(mconfig, *this)
, m_dac(*this, "dac")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void spectrum_specdrum_device::device_start()
{
}
//**************************************************************************
// IMPLEMENTATION
//**************************************************************************
void spectrum_specdrum_device::iorq_w(offs_t offset, uint8_t data)
{
switch (offset & 0x00ff)
{
case 0xdf:
m_dac->write(data);
break;
}
}
|