summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/sound/rolandpcm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/sound/rolandpcm.h')
-rw-r--r--src/devices/sound/rolandpcm.h24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/devices/sound/rolandpcm.h b/src/devices/sound/rolandpcm.h
index 1390fb95185..c8f1ebb5c08 100644
--- a/src/devices/sound/rolandpcm.h
+++ b/src/devices/sound/rolandpcm.h
@@ -5,23 +5,28 @@
#pragma once
-class rolandpcm_device : public device_t, public device_sound_interface, public device_rom_interface
+#include "dirom.h"
+
+class mb87419_mb87420_device : public device_t, public device_sound_interface, public device_rom_interface<22>
{
public:
- rolandpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ mb87419_mb87420_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+ auto int_callback() { return m_int_callback.bind(); }
u8 read(offs_t offset);
void write(offs_t offset, u8 data);
protected:
- // device-level overrides
+ // device_t implementation
virtual void device_start() override;
+ virtual void device_reset() override;
- // sound stream update overrides
- virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) override;
+ // device_sound_interface implementation
+ virtual void sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) override;
- // device_rom_interface overrides
- virtual void rom_bank_updated() override;
+ // device_rom_interface implementation
+ virtual void rom_bank_pre_change() override;
static int16_t decode_sample(int8_t data);
static int16_t sample_interpolate(int16_t smp1, int16_t smp2, uint16_t frac);
@@ -41,6 +46,7 @@ private:
uint32_t start = 0; // start address (18.14 fixed point)
uint16_t end = 0; // end offset (high word)
uint16_t loop = 0; // loop offset (high word)
+
// work variables
bool enable = false;
int8_t play_dir = 0; // playing direction, -1 [backwards] / 0 [stopped] / +1 [forwards]
@@ -49,6 +55,8 @@ private:
int16_t smpl_nxt = 0; // next sample
};
+ devcb_write_line m_int_callback;
+
uint32_t m_clock; // clock
uint32_t m_rate; // sample rate (usually 32000 Hz)
sound_stream* m_stream; // stream handle
@@ -56,6 +64,6 @@ private:
uint8_t m_sel_chn; // selected channel
};
-DECLARE_DEVICE_TYPE(ROLANDPCM, rolandpcm_device)
+DECLARE_DEVICE_TYPE(MB87419_MB87420, mb87419_mb87420_device)
#endif // MAME_SOUND_ROLANDPCM_H