summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/audio/geebee.h
blob: 1cca0fc6dd0ea9a44b0f1617a67527bae2217f83 (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
// license:GPL-2.0+
// copyright-holders:Juergen Buchmueller
#ifndef MAME_AUDIO_GEEBEE_H
#define MAME_AUDIO_GEEBEE_H

#pragma once

class geebee_sound_device : public device_t, public device_sound_interface
{
public:
	geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);

	enum
	{
		TIMER_VOLUME_DECAY
	};

	void sound_w(u8 data);

protected:
	// device-level overrides
	virtual void device_start() override;

	// sound stream update overrides
	virtual void sound_stream_update_legacy(sound_stream &stream, stream_sample_t const * const *inputs, stream_sample_t * const *outputs, int samples) override;

	virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;

private:
	// internal state
	std::unique_ptr<uint16_t[]> m_decay;
	sound_stream *m_channel;
	int m_sound_latch;
	int m_sound_signal;
	int m_volume;
	emu_timer *m_volume_timer;
	int m_noise;
	int m_vcount;
};

DECLARE_DEVICE_TYPE(GEEBEE_SOUND, geebee_sound_device)

#endif // MAME_AUDIO_GEEBEE_H