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
|
// license:BSD-3-Clause
// copyright-holders:R. Belmont
/**********************************************************************
Commodore PET userport "CB2 sound" audio device emulation
http://zimmers.net/cbmpics/cbm/PETx/petfaq.html
**********************************************************************/
#include "emu.h"
#include "cb2snd.h"
#include "sound/volt_reg.h"
//**************************************************************************
// DEVICE DEFINITIONS
//**************************************************************************
const device_type PET_USERPORT_CB2_SOUND_DEVICE = &device_creator<pet_userport_cb2_sound_device>;
MACHINE_CONFIG_FRAGMENT( cb2snd )
MCFG_SPEAKER_STANDARD_MONO("speaker")
MCFG_SOUND_ADD("dac", DAC_1BIT, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.99)
MCFG_DEVICE_ADD("vref", VOLTAGE_REGULATOR, 0) MCFG_VOLTAGE_REGULATOR_OUTPUT(5.0)
MCFG_SOUND_ROUTE_EX(0, "dac", 1.0, DAC_VREF_POS_INPUT)
MACHINE_CONFIG_END
//-------------------------------------------------
// machine_config_additions - device-specific
// machine configurations
//-------------------------------------------------
machine_config_constructor pet_userport_cb2_sound_device::device_mconfig_additions() const
{
return MACHINE_CONFIG_NAME( cb2snd );
}
//**************************************************************************
// LIVE DEVICE
//**************************************************************************
//-------------------------------------------------
// pet_userport_cb2_sound_device - constructor
//-------------------------------------------------
pet_userport_cb2_sound_device::pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
device_t(mconfig, PET_USERPORT_CB2_SOUND_DEVICE, "PET Userport 'CB2 Sound' Device", tag, owner, clock, "petucb2", __FILE__),
device_pet_user_port_interface(mconfig, *this),
m_dac(*this, "dac")
{
}
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
void pet_userport_cb2_sound_device::device_start()
{
}
DECLARE_WRITE_LINE_MEMBER( pet_userport_cb2_sound_device::input_m )
{
m_dac->write(state);
}
|