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
77
78
79
80
81
82
83
|
/***************************************************************************
orch90.c
Code for emulating the CoCo Orch-90 (Orchestra 90) sound cartridge
The Orch-90 was a simple sound cartridge; it had two 8-bit DACs
supporting stereo sound. The left channel was at $FF7A, and the right
channel was at $FF7B
***************************************************************************/
#include "emu.h"
#include "coco_orch90.h"
#include "sound/dac.h"
static MACHINE_CONFIG_FRAGMENT(coco_orch90)
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_SOUND_ADD("dac_left", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.0)
MCFG_SOUND_ADD("dac_right", DAC, 0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.0)
MACHINE_CONFIG_END
//**************************************************************************
// GLOBAL VARIABLES
//**************************************************************************
const device_type COCO_ORCH90 = &device_creator<coco_orch90_device>;
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// coco_orch90_device - constructor
//-------------------------------------------------
coco_orch90_device::coco_orch90_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, COCO_ORCH90, "CoCo Orch-90 PAK", tag, owner, clock, "coco_orch90", __FILE__),
device_cococart_interface( mconfig, *this )
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void coco_orch90_device::device_start()
{
m_left_dac = subdevice<dac_device>("dac_left");
m_right_dac = subdevice<dac_device>("dac_right");
}
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor coco_orch90_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( coco_orch90 );
}
/*-------------------------------------------------
write
-------------------------------------------------*/
WRITE8_MEMBER(coco_orch90_device::write)
{
switch(offset)
{
case 0x3A:
/* left channel write */
m_left_dac->write_unsigned8(data);
break;
case 0x3B:
/* right channel write */
m_right_dac->write_unsigned8(data);
break;
}
}
|