summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/multipcm.h
blob: c6b5ed8d4b1fc3981226b8cb2ce1c858bb8efbf5 (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
// license:BSD-3-Clause
// copyright-holders:Miguel Angel Horna
#ifndef MAME_SOUND_MULTIPCM_H
#define MAME_SOUND_MULTIPCM_H

#pragma once

#include "gew.h"

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

	void write(offs_t offset, uint8_t data);
	uint8_t read();

private:
	// internal state
	uint32_t m_cur_slot;
	uint32_t m_address;

	static const int32_t VALUE_TO_CHANNEL[32];

	void init_sample(sample_t &sample, uint32_t index);

	void write_slot(slot_t &slot, int32_t reg, uint8_t data);
};

DECLARE_DEVICE_TYPE(MULTIPCM, multipcm_device)

#endif // MAME_SOUND_MULTIPCM_H