blob: 3ea38fc8b77104416cbf570a36e55b51ac265c90 (
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
|
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
/***************************************************************************
cclimber.h
Functions to emulate the cclimber audio boards
***************************************************************************/
#ifndef MAME_AUDIO_CCLIMBER_H
#define MAME_AUDIO_CCLIMBER_H
#pragma once
#include "sound/samples.h"
DECLARE_DEVICE_TYPE(CCLIMBER_AUDIO, cclimber_audio_device)
// ======================> cclimber_audio_device
class cclimber_audio_device : public device_t
{
public:
// construction/destruction
cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
DECLARE_WRITE_LINE_MEMBER(sample_trigger_w);
DECLARE_WRITE8_MEMBER(sample_trigger_w);
DECLARE_WRITE8_MEMBER(sample_rate_w);
DECLARE_WRITE8_MEMBER(sample_volume_w);
protected:
// device level overrides
virtual void device_start() override;
virtual void device_add_mconfig(machine_config &config) override;
void play_sample(int start,int freq,int volume);
private:
std::unique_ptr<int16_t[]> m_sample_buf; /* buffer to decode samples at run time */
int m_sample_num;
int m_sample_freq;
int m_sample_volume;
optional_device<samples_device> m_samples;
optional_region_ptr<uint8_t> m_samples_region;
DECLARE_WRITE8_MEMBER( sample_select_w );
SAMPLES_START_CB_MEMBER( sh_start );
};
#endif // MAME_AUDIO_CCLIMBER_H
|