Previous 199869 Revisions Next

r31682 Sunday 17th August, 2014 at 17:15:06 UTC by R. Belmont
(MESS) Support PET user port "CB2 Sound" device [R. Belmont]
[src/emu/bus]bus.mak
[src/emu/bus/pet]cb2snd.c* cb2snd.h* user.c

trunk/src/emu/bus/pet/cb2snd.c
r0r31682
1// license:BSD-3-Clause
2// copyright-holders:R. Belmont
3/**********************************************************************
4
5    Commodore PET userport "CB2 sound" audio device emulation
6
7    http://zimmers.net/cbmpics/cbm/PETx/petfaq.html
8
9    Copyright MESS Team.
10    Visit http://mamedev.org for licensing and usage restrictions.
11
12**********************************************************************/
13
14#include "cb2snd.h"
15
16//**************************************************************************
17//  DEVICE DEFINITIONS
18//**************************************************************************
19
20const device_type PET_USERPORT_CB2_SOUND_DEVICE = &device_creator<pet_userport_cb2_sound_device>;
21
22#define DAC_TAG         "dac"
23
24MACHINE_CONFIG_FRAGMENT( cb2snd )
25   MCFG_SPEAKER_STANDARD_MONO("cb2spkr")
26   MCFG_SOUND_ADD(DAC_TAG, DAC, 0)
27   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "cb2spkr", 1.00)
28MACHINE_CONFIG_END
29
30//-------------------------------------------------
31//  machine_config_additions - device-specific
32//  machine configurations
33//-------------------------------------------------
34
35machine_config_constructor pet_userport_cb2_sound_device::device_mconfig_additions() const
36{
37   return MACHINE_CONFIG_NAME( cb2snd );
38}
39
40//**************************************************************************
41//  LIVE DEVICE
42//**************************************************************************
43
44//-------------------------------------------------
45//  pet_userport_cb2_sound_device - constructor
46//-------------------------------------------------
47
48pet_userport_cb2_sound_device::pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
49   device_t(mconfig, PET_USERPORT_CB2_SOUND_DEVICE, "PET Userport 'CB2 Sound' Device", tag, owner, clock, "petucb2", __FILE__),
50   device_pet_user_port_interface(mconfig, *this),
51   m_dac(*this, DAC_TAG)
52{
53}
54
55
56//-------------------------------------------------
57//  device_start - device-specific startup
58//-------------------------------------------------
59
60void pet_userport_cb2_sound_device::device_start()
61{
62}
63
64DECLARE_WRITE_LINE_MEMBER( pet_userport_cb2_sound_device::input_m )
65{
66   m_dac->write_unsigned8(state ? 0xff : 0x00);
67}
68
Property changes on: trunk/src/emu/bus/pet/cb2snd.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/pet/user.c
r31681r31682
124124
125125#include "diag.h"
126126#include "petuja.h"
127#include "cb2snd.h"
127128
128129SLOT_INTERFACE_START( pet_user_port_cards )
129130   SLOT_INTERFACE("diag", PET_USERPORT_DIAGNOSTIC_CONNECTOR)
130131   SLOT_INTERFACE("petuja", PET_USERPORT_JOYSTICK_ADAPTER)
132   SLOT_INTERFACE("cb2snd", PET_USERPORT_CB2_SOUND_DEVICE)
131133SLOT_INTERFACE_END
trunk/src/emu/bus/pet/cb2snd.h
r0r31682
1// license:BSD-3-Clause
2// copyright-holders:R. Belmont
3/**********************************************************************
4
5    Commodore PET userport "CB2 sound" audio device emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __PETUSER_CB2__
15#define __PETUSER_CB2__
16
17#include "emu.h"
18#include "user.h"
19#include "sound/dac.h"
20
21//**************************************************************************
22//  TYPE DEFINITIONS
23//**************************************************************************
24
25class pet_userport_cb2_sound_device : public device_t,
26   public device_pet_user_port_interface
27{
28public:
29   // construction/destruction
30   pet_userport_cb2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
31
32   virtual machine_config_constructor device_mconfig_additions() const;
33
34   virtual DECLARE_WRITE_LINE_MEMBER( input_m );
35
36   required_device<dac_device> m_dac;
37
38protected:
39   // device-level overrides
40   virtual void device_start();
41};
42
43
44// device type definition
45extern const device_type PET_USERPORT_CB2_SOUND_DEVICE;
46
47#endif
Property changes on: trunk/src/emu/bus/pet/cb2snd.h
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/bus/bus.mak
r31681r31682
510510BUSOBJS += $(BUSOBJ)/pet/user.o
511511BUSOBJS += $(BUSOBJ)/pet/diag.o
512512BUSOBJS += $(BUSOBJ)/pet/petuja.o
513BUSOBJS += $(BUSOBJ)/pet/cb2snd.o
513514endif
514515
515516

Previous 199869 Revisions Next


© 1997-2024 The MAME Team