blob: aa87135426d3a4312cf65ea0cb5b7aa4aaf8adab (
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// license:BSD-3-Clause
// copyright-holders:Quench, David Graves, R. Belmont
/* An interface for the ES8712 ADPCM controller */
#ifndef MAME_SOUND_ES8712_H
#define MAME_SOUND_ES8712_H
#pragma once
#include "machine/74157.h"
#include "sound/msm5205.h"
//**************************************************************************
// TYPE DEFINITIONS
//**************************************************************************
// ======================> es8712_device
class es8712_device : public device_t, public device_rom_interface
{
public:
es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// configuration
template <typename T> void set_msm_tag(T &&tag) { m_msm.set_tag(std::forward<T>(tag)); }
auto reset_handler() { return m_reset_handler.bind(); }
auto msm_write_handler() { return m_msm_write_cb.bind(); }
void write(offs_t offset, uint8_t data);
uint8_t read(offs_t offset);
void msm_w(offs_t offset, uint8_t data);
void msm_int(int state);
void play();
protected:
// device-level overrides
virtual void device_add_mconfig(machine_config &config) override;
virtual void device_start() override;
virtual void device_reset() override;
virtual void rom_bank_updated() override;
private:
void es8712_state_save_register();
required_device<hct157_device> m_adpcm_select;
optional_device<msm5205_device> m_msm;
// device callbacks
devcb_write_line m_reset_handler;
devcb_write8 m_msm_write_cb;
uint8_t m_playing; /* 1 if we're actively playing */
uint32_t m_base_offset; /* pointer to the base memory location */
uint32_t m_start; /* starting address for the next loop */
uint32_t m_end; /* ending address for the next loop */
uint8_t m_adpcm_trigger;
};
DECLARE_DEVICE_TYPE(ES8712, es8712_device)
#endif // MAME_SOUND_ES8712_H
|